/* PaceCast — design tokens */
:root {
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaee;
  --border: #e3e6eb;
  --text: #0e1116;
  --text-2: #4a5361;
  --text-3: #7b8594;
  --accent: #12b76a;
  --accent-strong: #0a9457;
  --accent-soft: #e3f7ed;
  --accent-ink: #04170d;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --info: #2e6fdb;
  --info-soft: #e7effc;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-2: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .08);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --sidebar: 248px;
  --player-h: 0px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0f14;
  --bg-elev: #10151c;
  --surface: #131922;
  --surface-2: #1a212c;
  --surface-3: #232c38;
  --border: #222b37;
  --text: #e8edf3;
  --text-2: #aab4c2;
  --text-3: #7a8596;
  --accent: #2fd483;
  --accent-strong: #5ee3a0;
  --accent-soft: rgba(47, 212, 131, .12);
  --accent-ink: #04170d;
  --warn: #f0b44c;
  --warn-soft: rgba(240, 180, 76, .12);
  --danger: #ff6b5e;
  --danger-soft: rgba(255, 107, 94, .12);
  --info: #6ea2ff;
  --info-soft: rgba(110, 162, 255, .12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 16px 40px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px calc(20px + var(--player-h));
  border-right: 1px solid var(--border); background: var(--bg-elev); display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 750; font-size: 19px; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-top: -3px; }
.nav-section { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2);
  font-weight: 550; transition: background .15s, color .15s; position: relative;
}
.nav-link svg { width: 19px; height: 19px; flex: none; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--text); }
.nav-link.active svg { color: var(--accent-strong); }
:root[data-theme="dark"] .nav-link.active svg { color: var(--accent); }
.nav-badge { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; }
.watch-chip {
  display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px;
}
.watch-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.watch-chip .dot.ok { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.watch-chip strong { display: block; font-size: 13px; }
.watch-chip span { color: var(--text-3); }

.main { min-width: 0; padding: 28px clamp(16px, 4vw, 48px) calc(48px + var(--player-h)); }
.page { max-width: 1120px; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { transform: translateY(6px); } to { transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.025em; margin: 0; font-weight: 750; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 60ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 18px; letter-spacing: -.015em; margin: 0; font-weight: 700; }
h3 { font-size: 15px; margin: 0; font-weight: 650; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.section-head a { color: var(--text-2); font-size: 14px; font-weight: 550; }
.section-head a:hover { color: var(--text); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* mobile top bar + tab bar */
.topbar, .tabbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
  }
  .topbar .brand { padding: 0; font-size: 17px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--text-3); padding: 4px 0; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active svg { color: var(--accent); }
  .main { padding: 20px 16px calc(96px + var(--player-h)); }
  .player { bottom: calc(62px + env(safe-area-inset-bottom)) !important; left: 8px !important; right: 8px !important; }
}

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-1); }
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; user-select: none;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.is-on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.on { color: var(--accent-strong); }
:root[data-theme="dark"] .icon-btn.on { color: var(--accent); }
.play-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: var(--text); color: var(--bg); transition: transform .1s;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn svg { width: 16px; height: 16px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.badge.accent { background: var(--accent-soft); color: var(--accent-strong); }
:root[data-theme="dark"] .badge.accent { color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }

.input, .select, textarea.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237b8594' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.search-xl .input { height: 54px; font-size: 16px; border-radius: 999px; padding-left: 48px; box-shadow: var(--shadow-1); }
.search-xl > svg { left: 18px; }

.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.setting { display: flex; align-items: center; gap: 12px 16px; padding: 16px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.setting > .grow { min-width: 200px; }
.setting:first-child { border-top: 0; padding-top: 4px; }
.setting .grow p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.setting .control { flex: none; min-width: 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; font-size: 18px; color: var(--text-2); }
.stepper button:hover { background: var(--surface-2); }
.stepper output { min-width: 56px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14px; }

/* art */
.art { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-3); flex: none; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art.sm { width: 48px; border-radius: 10px; }
.art.md { width: 64px; border-radius: 12px; }
.art.lg { width: 200px; border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.art-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; font-size: 28px; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), #2e6fdb); }

/* grids */
.grid-shows { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 18px; }
.show-card { display: flex; flex-direction: column; gap: 10px; position: relative; }
.show-card .art { width: 100%; transition: transform .2s, box-shadow .2s; box-shadow: var(--shadow-1); }
.show-card:hover .art { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.show-card h3 { font-size: 14px; line-height: 1.3; }
.show-card .meta { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.show-card .art-overlay { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; }
.show-card .corner { position: absolute; top: 8px; right: 8px; }
.show-card .add-fab {
  width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-2); transition: transform .12s;
}
.show-card .add-fab:hover { transform: scale(1.08); }
.show-card .add-fab.done { background: var(--surface); color: var(--accent-strong); }
.show-card .add-fab svg { width: 18px; height: 18px; }
.chip-on-art { background: rgba(10, 14, 20, .72); color: #fff; backdrop-filter: blur(6px); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat .k { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v small { font-size: 14px; color: var(--text-3); font-weight: 600; margin-left: 2px; }

/* hero sync card */
.sync-hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 26px; color: #eafff3;
  background: radial-gradient(120% 140% at 100% 0%, #1c7a52 0%, #0f3d2b 45%, #0b1d17 100%);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; box-shadow: var(--shadow-2);
}
.sync-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  border: 28px solid rgba(47, 212, 131, .12); pointer-events: none;
}
.sync-hero h2 { font-size: 26px; color: #fff; letter-spacing: -.02em; }
.sync-hero p { color: #b5dcc8; margin: 6px 0 0; }
.sync-hero .nums { display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.sync-hero .nums div { font-size: 13px; color: #9cc9b3; }
.sync-hero .nums strong { display: block; font-size: 24px; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sync-hero .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #fff; }
.sync-hero .btn:hover { background: rgba(255,255,255,.18); }
.sync-hero .btn.primary { background: #2fd483; color: #04170d; border-color: transparent; }
.stack-art { display: flex; }
.stack-art .art { width: 64px; border: 3px solid #0f3d2b; margin-left: -18px; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.stack-art .art:first-child { margin-left: 0; }
@media (max-width: 640px) { .sync-hero { grid-template-columns: 1fr; } .stack-art { display: none; } }

/* episode list */
.ep-list { display: flex; flex-direction: column; }
.ep {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 10px; border-radius: var(--radius);
  transition: background .15s; position: relative;
}
.ep + .ep::before { content: ""; position: absolute; top: 0; left: 10px; right: 10px; border-top: 1px solid var(--border); }
.ep:hover { background: var(--surface); }
.ep:hover + .ep::before, .ep:hover::before { opacity: 0; }
.ep-title { font-weight: 600; line-height: 1.35; }
.ep-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ep-meta { display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: 13px; margin-top: 3px; flex-wrap: wrap; }
.ep-meta .sep::before { content: "·"; }
.ep-actions { display: flex; align-items: center; gap: 2px; }
.ep.done .ep-title { color: var(--text-3); }
.progress { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; max-width: 240px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.ep-desc { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }
.drag-handle { cursor: grab; color: var(--text-3); display: grid; place-items: center; width: 22px; }
.drag-handle svg { width: 18px; height: 18px; }
.ep.dragging { opacity: .4; }
.ep.drop-above { box-shadow: inset 0 2px 0 var(--accent); }
.ep.drop-below { box-shadow: inset 0 -2px 0 var(--accent); }
.order-num { width: 26px; text-align: center; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* podcast header */
.pod-head { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: end; margin-bottom: 28px; }
.pod-head h1 { font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 6px; }
.pod-head .author { color: var(--text-2); font-weight: 600; }
.pod-head .desc { color: var(--text-2); margin: 12px 0 18px; max-width: 70ch; font-size: 14px; }
@media (max-width: 720px) { .pod-head { grid-template-columns: 1fr; } .pod-head .art.lg { width: 160px; } }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar .input-icon { flex: 1; min-width: 200px; max-width: 360px; }

/* empty states */
.empty { text-align: center; padding: 56px 20px; border: 1.5px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-2); }
.empty .icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
:root[data-theme="dark"] .empty .icon { color: var(--accent); }
.empty .icon svg { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty p { margin: 0 auto 18px; max-width: 44ch; }

/* callouts */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--info-soft); color: var(--text); font-size: 14px; }
.callout svg { width: 20px; height: 20px; flex: none; color: var(--info); margin-top: 1px; }
.callout.warn { background: var(--warn-soft); } .callout.warn svg { color: var(--warn); }
.callout.ok { background: var(--accent-soft); } .callout.ok svg { color: var(--accent-strong); }

/* timeline / activity */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding: 10px 0; align-items: start; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.tl-dot svg { width: 15px; height: 15px; }
.tl-dot.success { background: var(--accent-soft); color: var(--accent-strong); }
.tl-dot.warning { background: var(--warn-soft); color: var(--warn); }
.tl-dot.error { background: var(--danger-soft); color: var(--danger); }
.tl-item .when { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* steps */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 4px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 12px 0; }
.step::before {
  counter-increment: step; content: counter(step); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; background: var(--surface-2); color: var(--text-2); font-size: 14px;
}
.step.done::before { content: "✓"; background: var(--accent); color: var(--accent-ink); }
.step h3 { margin-top: 6px; }
.step p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }

/* pair code */
.code-input { display: flex; gap: 8px; }
.code-input input {
  width: 100%; height: 64px; text-align: center; font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .35em;
  text-transform: uppercase; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); outline: none; padding-left: .35em;
}
.code-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* watch mock */
.watch-mock {
  width: 220px; height: 220px; border-radius: 50%; margin: 0 auto; position: relative; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 35%, #1b222c, #07090c 70%); color: #eaf2f8;
  box-shadow: 0 0 0 10px #2a313b, 0 0 0 13px #11161c, 0 24px 50px -10px rgba(0,0,0,.55); padding: 34px; font-size: 13px;
}
.watch-mock .code { font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: .12em; color: #2fd483; }
.watch-mock .wm-title { font-weight: 700; font-size: 14px; }
.watch-mock .wm-sub { color: #93a1b2; font-size: 11.5px; }
.watch-mock .ring { position: absolute; inset: 6px; border-radius: 50%; }

/* tables / kv */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 550; }

/* two col */
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1240px) { .cols { grid-template-columns: 1fr; } }

/* ---------- player ---------- */
.player {
  position: fixed; z-index: 40; left: calc(var(--sidebar) + 16px); right: 16px; bottom: 16px; border-radius: 20px;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(20px); border: 1px solid var(--border);
  box-shadow: var(--shadow-2); padding: 10px 14px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: 16px; align-items: center;
  animation: up .25s ease;
}
@keyframes up { from { transform: translateY(20px); opacity: 0; } }
.player .now { display: flex; gap: 12px; align-items: center; min-width: 0; }
.player .now .t { font-weight: 650; font-size: 14px; }
.player .now .s { font-size: 12.5px; color: var(--text-3); }
.player .ctrls { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.player .btns { display: flex; align-items: center; gap: 6px; }
.player .play-btn { width: 42px; height: 42px; }
.skip { position: relative; }
.skip span { position: absolute; font-size: 8.5px; font-weight: 800; top: 50%; left: 50%; translate: -50% -42%; }
.scrub { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.scrub input { flex: 1; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--p, 0%), var(--surface-3) var(--p, 0%)); cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
.player .right { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.speed-btn { border: 1px solid var(--border); background: transparent; border-radius: 999px; height: 30px; padding: 0 10px; font-weight: 700; font-size: 12.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .player { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 10px; gap: 10px; }
  .player .ctrls { min-width: 0; }
  .player .scrub, .player .right, .player .btns .skip { display: none; }
  .player .art.sm { width: 40px; }
}

/* ---------- toast & modal ---------- */
#toasts { position: fixed; z-index: 100; left: 50%; translate: -50% 0; bottom: calc(24px + var(--player-h)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 999px; font-size: 14px; font-weight: 550;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-2); animation: up .2s ease; max-width: min(92vw, 520px);
}
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.error { background: var(--danger); color: #fff; }
.toast button { border: 0; background: transparent; color: inherit; font-weight: 750; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) { #toasts { bottom: calc(80px + var(--player-h)); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5, 8, 12, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: min(86vh, 860px); overflow: auto; background: var(--bg-elev); border-radius: 24px; border: 1px solid var(--border);
  box-shadow: var(--shadow-2); animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 6px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.modal-body { padding: 14px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 22px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; color: #eafff3;
  background: radial-gradient(90% 80% at 80% 10%, #1f8a5c 0%, #0f3d2b 50%, #08130f 100%);
}
.auth-hero h1 { font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 18px; color: #fff; max-width: 12ch; }
.auth-hero h1 em { font-style: normal; color: #2fd483; }
.auth-hero p.lead { font-size: 17px; color: #b5dcc8; max-width: 44ch; margin: 0; }
.auth-hero .brand { color: #fff; padding: 0; }
.feature-list { display: grid; gap: 14px; margin-top: 34px; max-width: 480px; }
.feature { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.feature .fi { width: 38px; height: 38px; border-radius: 12px; background: rgba(47, 212, 131, .14); color: #2fd483; display: grid; place-items: center; }
.feature .fi svg { width: 19px; height: 19px; }
.feature strong { color: #fff; display: block; font-size: 15px; }
.feature span { color: #9cc9b3; font-size: 14px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-form .box { width: min(400px, 100%); }
.auth-form h2 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-form .sub { color: var(--text-2); margin: 0 0 26px; }
.auth-form form { display: flex; flex-direction: column; gap: 14px; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--text-2); font-size: 14px; }
.auth-switch a { color: var(--text); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.form-error { color: var(--danger); font-size: 13.5px; font-weight: 550; min-height: 1em; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-hero { padding: 32px 24px; } .feature-list { display: none; } .auth-hero h1 { font-size: 34px; } }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider { height: 1px; background: var(--border); margin: 18px 0; }
.link { color: var(--accent-strong); font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; }
:root[data-theme="dark"] .link { color: var(--accent); }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pill:hover { border-color: var(--text-3); }
.pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Sign in with Google */
.g-btn { min-height: 44px; display: flex; justify-content: center; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-2); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
