/* ========================================================================
   ORBIT — immersive 8D audio platform. Design system.
   ==================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=Rubik:wght@400;500;600;700&display=swap");

:root {
  /* neutrals — cool, biased toward the teal accent */
  --ink: #0B0D12;
  --surface: #12141B;
  --elevated: #1A1D26;
  --elevated-2: #20242F;
  --line: #262A35;
  --line-soft: #1E222C;
  --text: #EAECF2;
  --muted: #9AA0AE;
  --faint: #6B7180;

  /* single bold accent */
  --accent: #2FE0C0;
  --accent-ink: #04120E;
  --accent-soft: rgba(47, 224, 192, .14);

  /* violet is reserved for the spatial visualization ONLY */
  --spatial-a: #2FE0C0;
  --spatial-b: #8B7BFF;

  /* semantic */
  --good: #3ECF8E;
  --warn: #F5B14C;
  --crit: #F16B6B;

  --shadow: 0 18px 50px -20px rgba(0,0,0,.65);
  --radius: 16px;
  --radius-sm: 10px;

  --sans-latin: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans-he: "Rubik", "Assistant", system-ui, "Segoe UI", sans-serif;
  --display: "Sora", var(--sans-latin);
  --sans: var(--sans-latin);
  --nav-w: 248px;
  --player-h: 84px;
}
:root[lang="he"] { --sans: var(--sans-he); --display: "Sora", var(--sans-he); }

/* light theme */
:root[data-theme="light"] {
  --ink: #F7F8FB;
  --surface: #FFFFFF;
  --elevated: #FFFFFF;
  --elevated-2: #F1F3F8;
  --line: #E4E7EF;
  --line-soft: #EDEFF5;
  --text: #10131A;
  --muted: #5A6070;
  --faint: #8A90A0;
  --accent: #12A88E;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(18, 168, 142, .12);
  --spatial-a: #12A88E;
  --spatial-b: #7A67F5;
  --shadow: 0 18px 40px -22px rgba(20,30,60,.28);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink: #F7F8FB; --surface: #FFFFFF; --elevated: #FFFFFF; --elevated-2: #F1F3F8;
    --line: #E4E7EF; --line-soft: #EDEFF5; --text: #10131A; --muted: #5A6070; --faint: #8A90A0;
    --accent: #12A88E; --accent-ink:#FFFFFF; --accent-soft: rgba(18,168,142,.12);
    --spatial-a:#12A88E; --spatial-b:#7A67F5; --shadow: 0 18px 40px -22px rgba(20,30,60,.28);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { font-family: var(--display); font-weight: 700; line-height: 1.12; text-wrap: balance; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.tnum { font-variant-numeric: tabular-nums; }
svg.ic { width: 18px; height: 18px; flex: none; }

/* ---------- app shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100%;
}
:root[dir="rtl"] .app { direction: rtl; }

/* sidebar */
.side {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  background: linear-gradient(180deg, var(--surface), var(--ink));
  border-inline-end: 1px solid var(--line);
  padding: 20px 16px calc(var(--player-h) + 20px);
  display: flex; flex-direction: column; gap: 22px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.brand-tag { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-group-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 14.5px;
  border: 1px solid transparent; background: none; width: 100%; text-align: start;
  transition: background .15s, color .15s;
}
.nav-item:hover { color: var(--text); background: var(--elevated); }
.nav-item.active { color: var(--text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.nav-item.active .ic { color: var(--accent); }
.nav-item .ic { width: 20px; height: 20px; flex: none; color: currentColor; }
.side-foot { margin-top: auto; font-size: 11.5px; color: var(--faint); padding: 8px; }

/* main column */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.search {
  flex: 1; max-width: 520px; position: relative; display: flex; align-items: center;
}
.search .ic { position: absolute; inset-inline-start: 12px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; padding: 11px 14px 11px 40px;
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text); font-size: 14px;
}
:root[dir="rtl"] .search input { padding: 11px 40px 11px 14px; }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--accent); background: var(--surface); }
.spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: 10px; color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.lang-btn { width: auto; padding: 0 14px; font-weight: 600; font-size: 13px; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: var(--elevated); color: var(--text);
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; }

/* content */
.content { padding: 26px 28px calc(var(--player-h) + 40px); max-width: 1280px; width: 100%; }
.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.section-head h2 { font-size: 21px; }
.section-head .link { color: var(--muted); font-size: 13px; }
.section-head .link:hover { color: var(--accent); }

/* hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 44px 44px 40px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 88% 12%, rgba(139,123,255,.20), transparent 55%),
    radial-gradient(120% 130% at 6% 90%, var(--accent-soft), transparent 50%),
    linear-gradient(180deg, var(--elevated), var(--surface));
  margin-bottom: 40px;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.hero-inner { position: relative; max-width: 560px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; font-weight: 600; }
.hero h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -.01em; }
.hero p { color: var(--muted); font-size: 16px; margin: 16px 0 26px; max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* rows / cards */
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 210px; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.row::-webkit-scrollbar { height: 8px; }
.row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }

.card {
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; scroll-snap-align: start;
  transition: transform .12s, border-color .15s, background .15s;
  cursor: pointer; position: relative;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--elevated-2); }
.cover {
  position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.06);
}
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.cover .cover-title { position: relative; z-index: 2; font-family: var(--display); font-weight: 700; font-size: 16px; color: #fff; padding: 14px; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.5); line-height: 1.15; }
.cover .wave { position: absolute; inset: 0; z-index: 1; opacity: .5; }
.badge-8d {
  position: absolute; inset-block-start: 10px; inset-inline-start: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(6,10,14,.6); color: #fff; backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18);
}
.badge-8d .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.badge-8d.adv { background: linear-gradient(90deg, var(--spatial-a), var(--spatial-b)); color: #04120e; border-color: transparent; font-weight: 800; }
.badge-8d.adv .dot { background: #04120e; box-shadow: none; }

/* engine picker */
.engine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.engine-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.engine-card:hover { border-color: var(--accent); }
.engine-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.engine-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.engine-card p { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0; }
@media (max-width: 900px) { .engine-grid { grid-template-columns: 1fr; } }
.play-fab {
  position: absolute; inset-block-end: 10px; inset-inline-end: 10px; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; border: none;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s;
}
.card:hover .play-fab { opacity: 1; transform: translateY(0); }
.card h3 { font-size: 14.5px; font-weight: 600; font-family: var(--sans); line-height: 1.3; margin-bottom: 4px; }
.card .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.card .meta .sep { opacity: .5; }

/* pill / chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--elevated); color: var(--muted); font-size: 13px; font-weight: 500; }
.chip.active, .chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent-soft); color: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill-live { background: rgba(62,207,142,.14); color: var(--good); }
.pill-beta { background: rgba(245,177,76,.15); color: var(--warn); }
.pill-soon { background: var(--elevated-2); color: var(--muted); }
.pill-ready { background: rgba(62,207,142,.14); color: var(--good); }
.pill-processing { background: rgba(47,224,192,.14); color: var(--accent); }
.pill-draft { background: var(--elevated-2); color: var(--muted); }

/* episode detail */
.ep-head { display: flex; gap: 26px; margin-bottom: 30px; flex-wrap: wrap; }
.ep-cover { width: min(460px, 100%); aspect-ratio: 16/9; border-radius: 20px; overflow: hidden; flex: none; position: relative; display:grid; place-items:center; }
.ep-info { flex: 1; min-width: 260px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; }
.ep-info h1 { font-size: clamp(24px, 3.4vw, 38px); }
.ep-creator { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.ep-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.ep-body { color: var(--muted); max-width: 70ch; font-size: 15.5px; }
.stat-inline { display: flex; gap: 22px; flex-wrap: wrap; margin: 8px 0; }
.stat-inline .s { display: flex; flex-direction: column; }
.stat-inline .s b { font-family: var(--display); font-size: 18px; }
.stat-inline .s span { font-size: 12px; color: var(--faint); }

/* creator profile header */
.creator-hero { display: flex; align-items: center; gap: 22px; padding: 30px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--elevated), var(--surface)); margin-bottom: 30px; position: relative; overflow: hidden; }
.avatar { width: 96px; height: 96px; border-radius: 24px; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 30px; color: #04120e; }
.creator-hero h1 { font-size: 30px; display: flex; align-items: center; gap: 10px; }
.verified-ic { width: 20px; height: 20px; color: var(--accent); }

/* ---------- studio / admin ---------- */
.page-head { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head p { color: var(--muted); margin-top: 6px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.kpi { background: var(--elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); }
.kpi .val { font-family: var(--display); font-size: 30px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -.01em; }
.kpi .delta { font-size: 12.5px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.delta.up { color: var(--good); }
.delta.down { color: var(--crit); }

.panels { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 22px; }
.panel { background: var(--elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { font-size: 15px; margin-bottom: 4px; font-family: var(--sans); font-weight: 600; }
.panel .sub { font-size: 12px; color: var(--faint); margin-bottom: 14px; }
.panel canvas { width: 100%; height: 180px; display: block; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; }
.bars .b { flex: 1; background: var(--accent-soft); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
.bars .b > span { position: absolute; inset-block-end: 0; inset-inline: 0; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent)); border-radius: 6px 6px 0 0; }

.legend { display: flex; flex-direction: column; gap: 12px; }
.legend .lg { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend .lg .v { margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.table tr:hover td { background: var(--elevated-2); }
.table .t-title { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.mini-cover { width: 40px; height: 40px; border-radius: 8px; flex: none; }

/* flow cards (new episode) */
.flow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.flow-card { background: var(--elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; cursor: pointer; transition: border-color .15s, transform .1s; }
.flow-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.flow-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.flow-card .fic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.flow-card h3 { font-size: 17px; font-family: var(--sans); font-weight: 600; margin-bottom: 6px; }
.flow-card p { color: var(--muted); font-size: 13.5px; }

/* wizard */
.steps { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; font-weight: 500; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-size: 12px; }
.step.done .n, .step.current .n { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step.current { color: var(--text); }
.form-block { background: var(--elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.form-block h3 { font-size: 15px; font-family: var(--sans); font-weight: 600; margin-bottom: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.input, textarea.input, select.input {
  width: 100%; padding: 11px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 14px; font-family: inherit;
}
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 96px; resize: vertical; }
.dropzone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); background: var(--surface); }
.dropzone:hover { border-color: var(--accent); color: var(--text); }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; }
.voice-opt { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; align-items: center; gap: 10px; background: var(--surface); cursor: pointer; font-size: 13.5px; }
.voice-opt:hover, .voice-opt.sel { border-color: var(--accent); }
.voice-opt.sel { background: var(--accent-soft); }
.voice-opt .va { width: 30px; height: 30px; border-radius: 8px; background: var(--elevated-2); display: grid; place-items: center; color: var(--accent); flex: none; }
.range { width: 100%; accent-color: var(--accent); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- player bar ---------- */
.player {
  position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 60;
  height: var(--player-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px;
  padding: 0 22px; transform: translateY(120%); transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.player.show { transform: translateY(0); }
.pl-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pl-cover { width: 52px; height: 52px; border-radius: 10px; flex: none; position: relative; overflow: hidden; }
.pl-txt { min-width: 0; }
.pl-txt .t { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-txt .c { font-size: 12px; color: var(--muted); }
.pl-center { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(46vw, 520px); }
.pl-controls { display: flex; align-items: center; gap: 16px; }
.pl-controls button { background: none; border: none; color: var(--muted); display: grid; place-items: center; }
.pl-controls button:hover { color: var(--text); }
.pl-play { width: 42px; height: 42px; border-radius: 50%; background: var(--text) !important; color: var(--ink) !important; }
:root[data-theme="dark"] .pl-play, :root:not([data-theme="light"]) .pl-play { background: #fff !important; color: #0b0d12 !important; }
.pl-seek { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 11.5px; color: var(--muted); }
.track { flex: 1; height: 5px; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; }
.track .fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--accent); border-radius: 999px; width: 0; }
.track .knob { position: absolute; top: 50%; transform: translate(50%,-50%); width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); inset-inline-start: 0; opacity: 0; transition: opacity .15s; }
.track:hover .knob { opacity: 1; }
.pl-right { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.pl-right .spatial-mini { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--accent); font-weight: 600; }
.pl-right .spatial-mini canvas { width: 34px; height: 34px; }
.speed-btn { font-size: 12px; font-weight: 700; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; }
.speed-btn:hover { color: var(--text); border-color: var(--accent); }
.vol { width: 90px; accent-color: var(--accent); }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(3,5,9,.66); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: var(--shadow); }
.modal h2 { font-size: 22px; margin-bottom: 4px; }
.modal .msub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.modal .field:last-of-type { margin-bottom: 20px; }
.modal .switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.modal .switch a { color: var(--accent); cursor: pointer; }
.headphone-banner { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 500; margin-bottom: 22px; }

/* demo account quick-fill */
.demo-accts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.demo-acct { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--elevated); color: var(--text); }
.demo-acct:hover { border-color: var(--accent); background: var(--elevated-2); }
.demo-acct b { font-size: 13px; }
.demo-acct span { font-size: 11.5px; color: var(--muted); }
.pl-cover img { width: 100%; height: 100%; object-fit: cover; }

/* impersonation banner */
.imp-banner { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: linear-gradient(90deg, var(--warn), color-mix(in srgb, var(--warn) 60%, transparent)); color: #1a1204; font-weight: 600; font-size: 13.5px; }
.imp-banner .btn { margin-inline-start: auto; background: rgba(0,0,0,.2); border-color: rgba(0,0,0,.25); color: #1a1204; }
.imp-banner svg.ic { color: #1a1204; }

/* admin users table */
.avatar-sm { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 700; color: #04120e; text-transform: uppercase; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn.xs { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.xs svg.ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { border-color: var(--crit); color: var(--crit); }

/* cost estimate */
.cost-block { background: linear-gradient(180deg, var(--accent-soft), var(--elevated)); }
.cost-est { display: flex; gap: 30px; flex-wrap: wrap; }
.cost-est > div { display: flex; flex-direction: column; gap: 2px; }
.cost-est span { font-size: 12px; color: var(--muted); }
.cost-est b { font-family: var(--display); font-size: 24px; }

/* spinner */
.spin { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: currentColor; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* plans */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card { border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--surface); }
.plan-card.cur { border-color: var(--accent); background: var(--accent-soft); }
.plan-name { font-family: var(--display); font-weight: 700; font-size: 17px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin: 8px 0; }
.plan-price b { font-family: var(--display); font-size: 32px; }
.plan-price span { color: var(--muted); font-size: 13px; }
.plan-tokens { color: var(--accent); font-size: 13px; font-weight: 600; }
.plan-perks { color: var(--muted); font-size: 12.5px; margin-top: 8px; line-height: 1.5; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: 1fr; } .cost-est { gap: 20px; } }

/* headphone toast */
.toast { position: fixed; inset-block-end: calc(var(--player-h) + 18px); inset-inline: 0; margin-inline: auto; width: fit-content; z-index: 80; background: var(--elevated-2); border: 1px solid var(--line); color: var(--text); padding: 12px 20px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; pointer-events: none; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- mobile ---------- */
.mtab { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .content { padding: 18px 16px calc(var(--player-h) + 78px); }
  .topbar { padding: 12px 16px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .panels { grid-template-columns: 1fr; }
  .flow-grid { grid-template-columns: 1fr; }
  .hero { padding: 30px 24px; }
  .ep-cover { width: 100%; }
  .pl-center { display: none; }
  .player { grid-template-columns: 1fr auto; height: 70px; inset-block-end: 62px; padding: 0 14px; }
  .pl-right { gap: 8px; }
  .vol, .pl-right .spatial-mini span { display: none; }
  .mtab {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 70;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); height: 62px;
  }
  .mtab button { background: none; border: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; }
  .mtab button.active { color: var(--accent); }
  .mtab .ic { width: 22px; height: 22px; }
  .kpi .val { font-size: 24px; }
  .row { grid-auto-columns: 158px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* clip factory: caption styling */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--line); cursor: pointer; padding: 0; transition: border-color .15s, transform .1s; }
.swatch:hover { transform: translateY(-1px); }
.swatch.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.swatch-custom { background: none; }
.cap-preview { margin-top: 14px; background: #101216; border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-align: center; font-weight: 700; font-size: 17px; text-shadow: 0 2px 6px rgba(0,0,0,.9), 0 0 2px #000; }
