/* Soniq8 DOMAIN styles. Loaded AFTER @qazana/web-component-library css
   (which provides tokens + generic components). Music/DJ-specific:
   animated background, hero, tracklist, audio player, listening radar. */

/* app's signature animated background — preserved from style.css (.bg-layer) */
.bg-layer{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none}
.vinyl{position:absolute;width:800px;height:800px;right:-280px;top:-280px;border-radius:50%;
  background:
    radial-gradient(circle at center,#0a0a0a 18%,transparent 18.5%),
    radial-gradient(circle at center,rgba(255,255,255,.03) 30%,transparent 30.5%),
    radial-gradient(circle at center,rgba(255,255,255,.02) 45%,transparent 45.5%),
    radial-gradient(circle at center,rgba(255,255,255,.01) 60%,transparent 60.5%),
    conic-gradient(from 0deg,#111 0deg,#1a1a1a 30deg,#111 60deg,#1a1a1a 90deg,#111 120deg,#1a1a1a 150deg,#111 180deg,#1a1a1a 210deg,#111 240deg,#1a1a1a 270deg,#111 300deg,#1a1a1a 330deg,#111 360deg);
  border:1px solid var(--line);animation:vinyl-spin 50s linear infinite;opacity:.35}
@keyframes vinyl-spin{to{transform:rotate(360deg)}}
.waveform{position:absolute;bottom:0;left:0;width:100%;height:200px;opacity:.1}
.waveform svg{width:100%;height:100%;display:block}
.wave{fill:none;stroke:var(--primary);stroke-width:1.5px}
.wave-1{animation:wave-drift 8s ease-in-out infinite alternate;opacity:.6}
.wave-2{animation:wave-drift 12s ease-in-out infinite alternate-reverse;opacity:.35;stroke-dasharray:8 4}
@keyframes wave-drift{
  0%{d:path("M0,160 C180,260 360,60 540,160 C720,260 900,60 1080,160 C1200,220 1320,100 1440,160 L1440,320 L0,320 Z")}
  100%{d:path("M0,180 C200,80 380,280 560,140 C740,20 920,280 1100,140 C1220,80 1340,240 1440,180 L1440,320 L0,320 Z")}
}
.grid-overlay{position:absolute;inset:0;
  background-image:linear-gradient(rgba(255,255,255,.012) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.012) 1px,transparent 1px);
  background-size:60px 60px}
.hero{position:relative;border-radius:var(--radius-lg);padding:28px;margin-bottom:18px;overflow:hidden;
  background:var(--surface);border:1px solid var(--line)}
.hero-grid{display:grid;grid-template-columns:152px 1fr;gap:24px;align-items:center}
.cover{position:relative;aspect-ratio:1;border-radius:var(--radius);overflow:hidden;background:#0c1410;border:1px solid rgb(var(--primary-rgb) / .25)}
.cover svg{position:absolute;inset:0;width:100%;height:100%}
.cover span{position:absolute;left:11px;bottom:9px;font-family:var(--mono);font-size:.62rem;letter-spacing:.14em;color:var(--text-2)}
.eq{position:absolute;right:24px;top:22px;display:flex;align-items:flex-end;gap:4px;height:46px;opacity:.6}
.eq i{width:4px;border-radius:var(--radius-pill);background:var(--primary);animation:bounce 1.1s ease-in-out infinite}
@keyframes bounce{0%,100%{height:10px}50%{height:46px}}
.eq i:nth-child(2){animation-delay:.15s}.eq i:nth-child(3){animation-delay:.3s}.eq i:nth-child(4){animation-delay:.45s}.eq i:nth-child(5){animation-delay:.22s}.eq i:nth-child(6){animation-delay:.5s}
/* coverage bar */
.cov{margin:18px 0 26px;height:8px;border-radius:var(--radius-pill);background:var(--surface-2);overflow:hidden;display:flex}
.cov i{display:block;height:100%}
.cov .id{background:var(--primary);flex:91}
.cov .gap{background:repeating-linear-gradient(45deg,#2a2a2a 0 6px,#222 6px 12px);flex:9}

/* payoff */
.payoff{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:20px 22px;
  background:rgb(var(--primary-rgb) / .09);border:1px solid var(--primary-line);border-radius:var(--radius-lg);margin-bottom:36px}
.payoff .txt{flex:1;min-width:210px}
.payoff .txt h3{font-weight:700;font-size:1.15rem;letter-spacing:-.01em}   /* normal face */
.payoff .txt p{color:var(--text-2);font-size:.86rem;margin-top:3px}
/* tracklist */
.lst-head{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin-bottom:12px}
.lst-head h2{font-weight:700;font-size:1.05rem;letter-spacing:-.01em}      /* normal face */
/* identified-count annotation in the heading — mono metadata face, like .conf .pct */
.lst-count{font-family:var(--mono);font-weight:400;font-size:.72rem;letter-spacing:0;color:var(--muted);margin-left:7px}
.row{display:grid;grid-template-columns:64px 1fr auto;gap:0 16px;align-items:center;padding:14px 16px;border-radius:var(--radius);
  background:var(--surface);border:1px solid transparent;margin-bottom:7px;transition:all .2s}
/* track numbers — identified tracks only; gaps/transitions don't consume a number */
#tracklist{counter-reset:track}
.row.song-item{grid-template-columns:22px 64px 1fr auto;counter-increment:track}
.row.song-item::before{content:counter(track);font-family:var(--display);font-weight:800;font-size:.74rem;color:var(--muted);text-align:right}
.row:hover{background:var(--surface-2);border-color:var(--line);transform:translateX(3px)}
.ts{font-family:var(--mono);font-size:.82rem;color:var(--text-2);text-decoration:none;transition:color .2s}
.row:hover .ts{color:var(--primary-bright)}
.ti{min-width:0}.ti .song{font-weight:600;font-size:1rem;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ti .artist{font-size:.85rem;color:var(--text-2)}
.right{display:flex;align-items:center;gap:14px}
.conf{display:flex;align-items:center;gap:7px}
.conf .bar{width:34px;height:4px;border-radius:var(--radius-pill);background:#2a2a2a;overflow:hidden}
.conf .bar i{display:block;height:100%;background:var(--primary-bright)}
.conf .bar i.low{background:var(--warning)}
.conf .pct{font-family:var(--mono);font-size:.72rem;color:var(--muted)}
.svc{display:flex;gap:7px}
.svc a{width:28px;height:28px;border-radius:var(--radius-sm);display:grid;place-items:center;background:var(--surface-2);
  font-size:.66rem;font-weight:700;color:var(--text-2);text-decoration:none;transition:all .18s}
.svc a:hover{background:var(--primary);color:var(--on-primary);transform:translateY(-1px)}

/* gap row — coral accent */
.gap-row{display:flex;align-items:center;gap:14px;padding:13px 16px;border-radius:var(--radius);margin-bottom:7px;
  border:1px dashed rgb(var(--danger-rgb) / .4);background:rgb(var(--danger-rgb) / .05)}
.gap-row .ts{font-family:var(--mono);font-size:.82rem;color:var(--danger);text-decoration:none}
.gap-row .label{font-size:.9rem;color:var(--text)}
.gap-row .dur{font-family:var(--mono);font-size:.74rem;color:var(--text-2)}
.gap-row .tag{margin-left:auto;font-family:var(--mono);font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;color:var(--danger)}
.gap-row button{margin-left:10px;background:transparent;border:1px solid rgb(var(--danger-rgb) / .5);color:var(--danger);
  font-family:var(--body);font-weight:600;font-size:.76rem;padding:7px 13px;border-radius:var(--radius-sm);cursor:pointer;transition:all .18s}
.gap-row button:hover{background:var(--danger);color:#2a0c0c}

/* footer + ancillary links — normal face, not mono */
.row,.gap-row{opacity:0;animation:rise .58s var(--ease) forwards}
@media(max-width:600px){
  .hero-grid{grid-template-columns:1fr;gap:16px}.cover{width:118px}.eq{display:none}
  .row{grid-template-columns:54px 1fr}.right{grid-column:2;justify-content:flex-start;margin-top:6px}
  .row.song-item{grid-template-columns:18px 54px 1fr}.row.song-item .right{grid-column:3}
}

/* ============================================================
   Reactive / micro-interaction layer
   ============================================================ */

/* expandable track row */
.row[data-detail]{cursor:pointer}
.chev{margin-left:2px;color:var(--muted);transition:transform .25s var(--ease),color .25s;font-size:.7rem}
.row.open .chev{transform:rotate(90deg);color:var(--primary-bright)}
.detail{grid-column:1 / -1;display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s var(--ease)}
.row.open .detail{grid-template-rows:1fr}
.detail-inner{overflow:hidden;min-height:0}
.detail-grid{display:flex;flex-wrap:wrap;gap:8px;padding:13px 2px 3px}
.meta{font-family:var(--mono);font-size:.72rem;color:var(--text-2);background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--radius-sm);padding:5px 10px}
.meta b{color:var(--text);font-weight:600}
.meta.moat{color:var(--primary-bright);border-color:var(--primary-line);background:rgb(var(--primary-rgb) / .06)} /* collective-intelligence signal */
.meta.verified{color:var(--primary-bright)}

/* confidence bar fills smoothly when revealed */
.conf .bar i{transition:width 1.1s var(--ease)}

/* hero equalizer reacts to pointer proximity (driven by --eq-amp set in JS) */
.eq i{transform:scaleY(var(--eq-amp,1));transform-origin:bottom;transition:transform .25s ease-out}


/* ============================================================
   Audio player / waveform scrubber
   ============================================================ */
.player{display:flex;align-items:center;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px}
.play-btn{flex-shrink:0;width:42px;height:42px;border-radius:50%;border:0;background:var(--primary);color:var(--on-primary);
  display:grid;place-items:center;cursor:pointer;font-size:.95rem;transition:transform .15s,background .15s}
.play-btn:hover{background:var(--primary-bright);transform:scale(1.06)}
.wf{flex:1;min-width:0}
.wf-markers{position:relative;height:14px;margin-bottom:3px}
.wf-mark{position:absolute;font-family:var(--mono);font-size:.6rem;color:var(--muted);transform:translateX(-50%);white-space:nowrap;top:0}
.wf-mark.gapm{color:var(--danger)}
.wf-bars{position:relative;display:flex;align-items:center;gap:2px;height:46px;cursor:pointer}
.wf-bars .wb{flex:1;min-width:2px;background:var(--surface-2);border-radius:2px;transition:background .08s}
.wf-bars .wb.on{background:var(--primary-bright)}
.wf-head{position:absolute;top:-2px;bottom:-2px;width:2px;background:var(--danger);box-shadow:0 0 6px var(--danger);pointer-events:none;left:0}
.wf-time{display:flex;justify-content:space-between;font-family:var(--mono);font-size:.7rem;color:var(--muted);margin-top:6px}
/* compact (inline preview, e.g. a gap row) */
.player.compact{padding:8px 11px;gap:11px;border-radius:var(--radius-sm)}
.player.compact .play-btn{width:32px;height:32px;font-size:.78rem}
.player.compact .wf-bars{height:26px;gap:2px}
.player.compact .wf-cur{font-family:var(--mono);font-size:.72rem;color:var(--muted);flex-shrink:0}

/* ============================================================
   Audio playing animation
   ============================================================ */
.wb{transform-origin:center bottom}
.player.playing .wf-head{animation:headglow .85s ease-in-out infinite}
@keyframes headglow{50%{box-shadow:0 0 13px var(--danger)}}
.player.playing .wf-bars .wb.on{animation:wbeat .7s ease-in-out infinite}
.player.playing .wf-bars .wb.on:nth-child(2n){animation-delay:.12s}
.player.playing .wf-bars .wb.on:nth-child(3n){animation-delay:.26s}
.player.playing .wf-bars .wb.on:nth-child(5n){animation-delay:.36s}
@keyframes wbeat{50%{transform:scaleY(1.22)}}
@media(prefers-reduced-motion:reduce){.player.playing .wf-head,.player.playing .wb.on{animation:none}}

/* ============================================================
   Animated branding
   ============================================================ */
@keyframes brand-spin{to{transform:rotate(360deg)}}
.logo-anim .rings{transform-origin:16px 16px;animation:brand-spin 7s linear infinite}
.logo-anim:hover .rings{animation-duration:2.2s}
@keyframes brand-sheen{0%{background-position:220% 0}100%{background-position:-220% 0}}
.brand-8.shimmer{background:linear-gradient(110deg,var(--primary) 35%,#eafff1 50%,var(--primary-bright) 65%);background-size:220% auto;
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;animation:brand-sheen 3.2s linear infinite}
.brand-eq{display:inline-flex;align-items:flex-end;gap:2px;height:20px;vertical-align:-4px}
.brand-eq i{width:3px;background:var(--primary-bright);border-radius:2px;height:6px;animation:bounce 1s ease-in-out infinite}
.brand-eq i:nth-child(2){animation-delay:.15s}.brand-eq i:nth-child(3){animation-delay:.3s}.brand-eq i:nth-child(4){animation-delay:.45s}
@media(prefers-reduced-motion:reduce){.logo-anim .rings,.brand-8.shimmer,.brand-eq i{animation:none}}

/* ============================================================
   Product-specific: coverage timeline + match alternates
   ============================================================ */
.minimap{display:flex;height:32px;border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--line);cursor:pointer}
.minimap .seg.song{background:rgb(var(--primary-rgb) / .5)}
.minimap .seg.song:hover{background:var(--primary-bright)}
.minimap .seg.gapseg{background:repeating-linear-gradient(45deg,#2c2c2c 0 5px,#222 5px 10px)}
.minimap-leg{display:flex;gap:16px;font-size:.74rem;color:var(--muted);margin-top:8px}
.minimap-leg span{display:inline-flex;align-items:center;gap:6px}
.minimap-leg i{width:11px;height:11px;border-radius:3px;display:inline-block}
.alts{display:flex;flex-direction:column;gap:7px}
.alt{display:flex;align-items:center;gap:11px;padding:9px 11px;border:1px solid var(--line);border-radius:var(--radius);font-size:.88rem;cursor:pointer;transition:.16s}
.alt:hover{border-color:rgb(var(--primary-rgb) / .4);background:rgb(var(--primary-rgb) / .04)}
.alt.pick{border-color:var(--primary);background:rgb(var(--primary-rgb) / .07)}
.alt .acover{width:34px;height:34px;border-radius:var(--radius-sm);background:#0c1410;border:1px solid rgb(var(--primary-rgb) / .2);display:grid;place-items:center;color:var(--primary-bright);flex-shrink:0}
.alt .ameta{min-width:0}.alt .ameta .at2{font-weight:600}.alt .ameta .aa{font-size:.8rem;color:var(--muted)}
.alt .aconf{margin-left:auto;font-family:var(--mono);font-size:.74rem;color:var(--muted)}

/* brand equalizer uses a small-amplitude beat */
@keyframes beq{0%,100%{height:6px}50%{height:18px}}
.brand-eq i{animation-name:beq}

/* safety net: any bare <input> gets themed text color (component rules still win) */
input,textarea{color:var(--text)}

/* Soniq8 Live card wrapper (the radar centerpiece lives inside) */
.live-card{max-width:300px;text-align:center;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:30px 24px}

/* tab panels */
.tabpanel{padding:16px 2px;color:var(--text-2);font-size:.9rem}

/* date picker: month/year quick-nav header + month grid */
.cal-h .cal-title{flex:1;background:transparent;border:0;color:var(--text);font-weight:600;font-size:.86rem;cursor:pointer;border-radius:var(--radius-sm);padding:5px}
.cal-h .cal-title:hover{background:var(--surface-2)}
.cal-grid.months{grid-template-columns:repeat(3,1fr);gap:6px}
.cal-grid .mcell{padding:11px 0;text-align:center;font-size:.8rem;border-radius:var(--radius-sm);cursor:pointer;color:var(--text-2)}
.cal-grid .mcell:hover{background:var(--surface-2);color:var(--text)}
.cal-grid .mcell.sel{background:var(--primary);color:var(--on-primary);font-weight:600}

/* ============================================================
   Soniq8 Live — radar listening (faithful to RadarView.swift)
   center mark breathes · 3 staggered pings · swelling halo ·
   progress ring (sample solid / countdown faint) · sonar blips
   (green sample / gold match) · one-shot match burst.
   ============================================================ */
.radar{position:relative;width:230px;height:230px;display:grid;place-items:center;margin:0 auto}
.radar .ping{position:absolute;width:115px;height:115px;border-radius:50%;border:2px solid var(--primary);opacity:0}
.radar.on .ping{animation:radar-ping 2.6s linear infinite}
.radar.on .ping.p2{animation-delay:.87s}.radar.on .ping.p3{animation-delay:1.73s}
@keyframes radar-ping{0%{transform:scale(.5);opacity:.32}100%{transform:scale(1.5);opacity:0}}
.radar .halo{position:absolute;width:150px;height:150px;border-radius:50%;background:var(--primary);opacity:.12;filter:blur(22px);transform:scale(.7)}
.radar.on .halo{animation:radar-halo 2.4s ease-in-out infinite}
@keyframes radar-halo{50%{opacity:.3;transform:scale(1.04)}}
.radar .ring{position:absolute;width:188px;height:188px;transform:rotate(-90deg)}
.radar .ring circle{fill:none;stroke-width:4;stroke-linecap:round}
.radar .ring .track2{stroke:var(--primary-soft)}
.radar .ring .prog{stroke:rgb(var(--primary-rgb) / .35);transition:stroke .2s}
.radar .mark{position:relative;z-index:2;width:96px;height:96px;border-radius:50%;cursor:pointer;box-shadow:0 6px 26px -6px rgb(var(--primary-rgb) / .5)}
.radar.on .mark{animation:radar-breathe 1.7s ease-in-out infinite}
@keyframes radar-breathe{50%{transform:scale(1.05)}}
.radar .blip{position:absolute;border-radius:50%;pointer-events:none;z-index:1}
.radar .burst{position:absolute;width:126px;height:126px;border-radius:50%;border:3px solid var(--primary-bright);opacity:0;pointer-events:none}
.radar .burst.go{animation:radar-burst .85s ease-out}
@keyframes radar-burst{0%{transform:scale(.55);opacity:.9}100%{transform:scale(1.8);opacity:0}}
@keyframes blip-out{0%{transform:scale(1);opacity:1}100%{transform:scale(3);opacity:0}}
.radar-status{text-align:center;margin-top:14px;color:var(--text-2);font-size:.9rem}
@media(prefers-reduced-motion:reduce){.radar .ping,.radar.on .halo,.radar.on .mark,.radar .blip,.radar .burst.go{animation:none}}

/* ============================================================
   Live results-screen integration helpers (templates/index.html)
   ============================================================ */
.results-section{position:relative;z-index:1}
/* page-title hierarchy: vendor .title caps at 2.7rem, which crowds the 2.6rem
   landing headline — keep mix/processing titles a clear step below it */
.main-content .title{font-size:clamp(1.4rem,3vw,1.5625rem)}  /* 25px desktop */
.hero .by{color:var(--text-2);font-size:.88rem;margin:2px 0 14px}
.hero .by b{color:var(--text);font-weight:600}
.hero .stats{margin-top:4px}
.exports{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.lst-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.gap-row{flex-wrap:wrap}                 /* gap action buttons wrap on narrow */
.gap-row .gap-search{margin-left:10px;color:var(--danger);font-size:.76rem;font-weight:600;text-decoration:none}

/* ============================================================
   Processing screen (templates/index.html #processingSection)
   ============================================================ */
.proc-head{margin-bottom:6px}
.by{color:var(--text-2);font-size:.88rem}
.prog-wrap{margin:20px 0 24px}
.prog-top{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}
.prog-top .phase{font-weight:700;font-size:1.05rem;color:var(--text)}
.prog-top .pct{font-family:var(--mono);font-size:1.05rem;color:var(--primary-bright)}
.prog{height:10px;border-radius:var(--radius-pill);background:var(--surface-2);overflow:hidden}
.prog i{display:block;height:100%;width:0;background:var(--primary);border-radius:var(--radius-pill);
  box-shadow:0 0 16px rgb(var(--primary-rgb) / .5);transition:width .4s var(--ease);position:relative;overflow:hidden}
.prog i::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.25),transparent);animation:sheen 1.4s linear infinite}
@keyframes sheen{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
.prog-meta{margin-top:8px;font-family:var(--mono);font-size:.74rem;color:var(--muted)}
.prog-hint{color:#c8860a}
.processing-section .log{margin-top:18px;max-height:300px;overflow-y:auto}
@media(prefers-reduced-motion:reduce){.prog i::after{animation:none}}

/* ============================================================
   Landing / first-run (templates/index.html #landingSection)
   ============================================================ */
.center{text-align:center;margin:5vh auto 0;position:relative;z-index:1}  /* fills .container like other screens */
.center .phonetic{font-family:var(--mono);font-size:.82rem;color:var(--muted);letter-spacing:.04em}
.center h1{font-family:var(--display);font-weight:800;font-size:clamp(2.2rem,6vw,2.6rem);line-height:1.02;letter-spacing:-.03em;margin:14px 0 12px}
.center h1 .em{background:linear-gradient(135deg,var(--primary),var(--primary-bright));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
/* override qazana's .sub component (mono/uppercase section label) for the hero copy */
.center .sub{font-family:var(--body);text-transform:none;letter-spacing:-.01em;color:var(--text-2);font-size:1.05rem;margin:0 auto;max-width:680px}
.center .url-form{max-width:680px;margin:0 auto}
/* paste input: clear resting affordance, strong activated state, minimal motion */
.paste{display:flex;gap:10px;margin:30px 0 14px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius-lg);padding:8px 8px 8px 18px;align-items:center;
  transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}
.paste:hover{border-color: var(--line-strong)}
.paste:focus-within{border-color:var(--primary-bright);background:var(--surface-3);box-shadow:0 0 0 3px var(--primary-ring)}
.paste > i{flex-shrink:0;opacity:.5;color:var(--text-2);transition:opacity .15s,color .15s}
.paste:focus-within > i{opacity:1;color:var(--primary-bright)}
.paste input{flex:1;min-width:0;background:transparent;border:0;outline:0;-webkit-appearance:none;appearance:none;
  color:var(--text);font-family:var(--body);font-size:1rem;letter-spacing:-.01em;caret-color:var(--primary-bright)}
.paste input:focus{background:transparent;border:0;outline:0;box-shadow:none}
.paste input::placeholder{color:var(--muted)}
.paste .btn-primary{white-space:nowrap}
.try{display:flex;gap:10px;align-items:center;justify-content:center;flex-wrap:wrap;color:var(--muted);font-size:.86rem}
.ex{font-family:var(--mono);font-size:.78rem;color:var(--primary-bright);text-decoration:none;
  border:1px solid var(--primary-line);border-radius:var(--radius-pill);padding:6px 13px;transition:all .18s}
.ex:hover{background:var(--primary-soft)}
.url-help-line{margin-top:16px;color:var(--muted);font-size:.82rem}
/* ---- landing motion: one staggered entrance, then a scroll story ---- */
@media (prefers-reduced-motion: no-preference){
  .center > *{opacity:0;animation:rise .6s var(--ease) forwards}
  .center .phonetic{animation-delay:.05s}
  .center h1{animation-delay:.13s}
  .center .sub{animation-delay:.21s}
  .center .url-form{animation-delay:.29s}
  .center .try{animation-delay:.37s}
  .center .url-help-line{animation-delay:.45s}
  /* slow gradient sweep across the "any DJ mix" highlight */
  .center h1 .em{background-size:200% 100%;animation:em-sweep 7s ease-in-out infinite}
  /* teaser rows ride the same rise, just later; confidence bars grow in */
  .teaser .list .row:nth-child(1){animation-delay:.55s}
  .teaser .list .row:nth-child(2){animation-delay:.67s}
  .teaser .list .row:nth-child(3){animation-delay:.79s}
  .teaser .bar i{transform-origin:left;animation:bar-in .7s var(--ease) .95s backwards}
}
@keyframes em-sweep{0%,100%{background-position:0% 0}50%{background-position:100% 0}}
@keyframes bar-in{from{transform:scaleX(0)}}
/* scroll-driven reveals — soniq8.js tags .flow-node/.flow-edge/.feature-card/
   .ethos-* with .reveal and flips .inview via IntersectionObserver */
.reveal{opacity:0;transform:translateY(18px);
  transition:opacity .6s var(--ease) var(--reveal-delay,0s),transform .6s var(--ease) var(--reveal-delay,0s)}
.reveal.inview{opacity:1;transform:none}
.flow-edge.reveal svg path{stroke-dasharray:70;stroke-dashoffset:70;
  transition:stroke-dashoffset .7s var(--ease) calc(var(--reveal-delay,0s) + .15s)}
.flow-edge.reveal.inview svg path{stroke-dashoffset:0}
/* after the line draws in, glide the arrow forward to suggest flow.
   uses `translate` (not `transform`) so it composes with the 90deg
   rotate the edge gets in the mobile vertical layout. */
@keyframes flow-edge-glide{0%,100%{translate:0}50%{translate:3px}}
.flow-edge.reveal.inview svg{
  animation:flow-edge-glide 2.6s var(--ease) calc(var(--reveal-delay,0s) + .9s) infinite}
.feature-card{transition:transform var(--dur-2) var(--ease),border-color var(--dur-2) var(--ease)}
.feature-card:hover{transform:translateY(-3px);border-color:var(--primary-line)}
@media (prefers-reduced-motion: reduce){.reveal{opacity:1;transform:none;transition:none}
  .flow-edge.reveal svg path{stroke-dasharray:none;stroke-dashoffset:0}
  .flow-edge.reveal.inview svg{animation:none}}

.teaser{margin-top:46px;position:relative;z-index:1;max-width:820px;margin-left:auto;margin-right:auto}  /* showcase width, same as .flow */
.teaser .cap{font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);text-align:center;margin-bottom:14px}
.teaser .list{opacity:.55;-webkit-mask-image:linear-gradient(#000 40%,transparent);mask-image:linear-gradient(#000 40%,transparent)}

/* ============================================================
   Account base styles — only the rules shared beyond profile/billing remain
   here (jobs, admin, error pages, notify modals). The profile/billing styles
   were consolidated into the refactored "Account screens" section below.
   ============================================================ */
.loading-text { color: var(--text-2); font-size: .88rem; }
.muted { color: var(--text-2); font-size: .88rem; }
.muted a { color: var(--primary); text-decoration: none; }

/* ── Jobs / Analyses List ─────────────────────────── */
.jobs-stats {
    display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.jobs-stat {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    flex: 1; min-width: 140px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.jobs-stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-lg);
    background: rgb(var(--primary-rgb) / .1);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
}
.jobs-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.jobs-stat-label { font-size: .75rem; color: var(--text-2); margin-top: 1px; }

.jobs-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.jobs-search {
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .9rem; font-family: inherit;
    width: 280px; transition: border-color .2s;
}
.jobs-search:focus { outline: none; border-color: var(--primary); }
.jobs-sort select {
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .85rem; font-family: inherit;
    cursor: pointer;
}

.jobs-list { display: flex; flex-direction: column; gap: 12px; }

.job-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    text-decoration: none; color: inherit;
    cursor: pointer;
    transition: border-color .2s, background .15s;
}
.job-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}
.job-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.job-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    width: 140px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
}
.job-thumb {
    width: 100%; height: 100%;
    border-radius: var(--radius);
    object-fit: cover;
}
.job-thumb-placeholder {
    width: 100%; height: 100%;
    border-radius: var(--radius);
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.12); font-size: 1.5rem;
}
.job-thumb-dur {
    position: absolute;
    bottom: 4px; right: 4px;
    background: rgba(0,0,0,.8);
    color: var(--text);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .3px;
    font-variant-numeric: tabular-nums;
}

.job-info { flex: 1; min-width: 0; }
.job-title {
    font-size: 1rem; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 4px;
}
.job-meta {
    display: flex; gap: 12px; flex-wrap: wrap;
    font-size: .8rem; color: var(--text-2);
    margin-top: 3px;
}
.job-meta span { display: flex; align-items: center; gap: 4px; }
.job-meta i { font-size: .68rem; opacity: .7; }

.job-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.job-badge {
    padding: 2px 10px; border-radius: var(--radius-lg);
    font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .3px;
}
.badge-songs { background: rgb(var(--primary-rgb) / .12); color: var(--primary); }
.badge-provider { background: var(--surface-2); color: var(--text-2); }
.badge-provider i { margin-right: 2px; font-size: .65rem; }
.badge-duration { background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.badge-rate-good { background: rgb(var(--primary-rgb) / .12); color: var(--primary-bright); }
.badge-rate-ok { background: rgb(var(--warning-rgb) / .12); color: var(--warning); }
.badge-rate-low { background: rgb(var(--danger-rgb) / .1); color: var(--danger); }
.badge-processing { background: rgb(var(--info-rgb) / .12); color: var(--info); }
.badge-processing i { margin-right: 3px; }
.badge-partial { background: rgb(var(--warning-rgb) / .12); color: var(--warning); }
.badge-partial i { margin-right: 3px; }
.badge-failed { background: rgb(var(--danger-rgb) / .1); color: var(--danger); }
.badge-failed i { margin-right: 3px; }

.job-processing {
    border-color: rgb(var(--info-rgb) / .2);
    cursor: default;
}
.job-processing:hover { border-color: rgb(var(--info-rgb) / .3); }
.job-processing .job-thumb { opacity: .6; }

/* .job-progress / -bar / -fill / -text live in the "profile/jobs" block
   below (search ".job-progress{margin-top:9px"). Only -status / -pct are
   defined here because that block doesn't cover them. */
.job-progress-status {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.job-progress-pct {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.job-partial {
    border-color: rgb(var(--warning-rgb) / .15);
}
.job-partial:hover { border-color: rgb(var(--warning-rgb) / .25); }

.job-failed {
    border-color: rgb(var(--danger-rgb) / .15);
    opacity: .8;
}
.job-failed:hover { border-color: rgb(var(--danger-rgb) / .25); }

.job-retry-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    border-color: rgb(var(--primary-rgb) / .2);
}
.job-retry-btn:hover {
    background: rgb(var(--primary-rgb) / .1);
    border-color: rgb(var(--primary-rgb) / .3);
}

.job-yt-btn {
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text-2);
    padding: 8px 12px;
    font-size: .85rem;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.job-yt-btn:hover {
    border-color: #ff0000;
    color: #ff0000;
    background: rgba(255,0,0,.08);
}

.job-reprocess-btn {
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text-2);
    padding: 8px 12px;
    font-size: .78rem;
    cursor: pointer;
    transition: all .2s;
}
.job-reprocess-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgb(var(--primary-rgb) / .08);
}
.job-reprocess-btn:disabled {
    opacity: .5;
    cursor: default;
}
/* Incomplete-mix badge (no audio features yet). */
.badge-needs-data { background: rgb(var(--warning-rgb) / .12); color: var(--warning); }
.badge-needs-data i { margin-right: 3px; }
.job-arrow {
    color: var(--text-2); font-size: .8rem;
    flex-shrink: 0;
}

/* Pagination is cursor-based: this container only hosts the .load-more-btn
   (numbered-page button styles retired — their .jobs-pagination button
   selector outranked .load-more-btn and broke its styling). */
.jobs-pagination { display: flex; justify-content: center; }

.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-2);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; color: rgba(255,255,255,.1); }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.empty-state a {
    color: var(--primary); text-decoration: none;
    font-weight: 600;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
    .job-card {
        grid-template-columns: 1fr auto;
    }
    .job-card .job-thumb-wrap {
        grid-column: 1 / -1;
        width: 100%; height: 160px;
    }
    .jobs-search { width: 100%; }
}

/* ============================================================
   Account screens — jobs / profile / billing (templates use account.css
   classes; restyled here on the tokens, overriding account.css).
   ============================================================ */
/* Fill the .container flex column and align with the site header (like the
   analysis page's .main-content). NOTE: margin:0 auto on a flex item disables
   stretch and collapses it to content width — that bug made jobs/billing/profile
   render at different narrow widths. No horizontal padding so card edges line up
   with the header logo (the container's 20px inset provides the gutter). */
.account-page{padding:28px 0 80px;position:relative;z-index:1}

/* ---- jobs: stats row ---- */
.jobs-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:20px}
.jobs-stat{display:flex;align-items:center;gap:13px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius-lg);padding:16px 18px}
.jobs-stat-icon{width:40px;height:40px;border-radius:var(--radius);display:grid;place-items:center;
  background:var(--primary-soft);color:var(--primary-bright);font-size:1rem;flex-shrink:0}
.jobs-stat-value{font-family:var(--mono);font-weight:700;font-size:1.4rem;color:var(--text);line-height:1}
.jobs-stat-label{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-top:3px}

/* ---- jobs: toolbar ---- */
.jobs-toolbar{display:flex;gap:10px;margin-bottom:18px;flex-wrap:wrap}
.jobs-search{flex:1;min-width:200px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:11px 14px;color:var(--text);font-family:var(--body);font-size:.9rem}
.jobs-search:focus{outline:none;border-color:var(--primary-bright);box-shadow:0 0 0 3px var(--primary-ring)}
.jobs-search::placeholder{color:var(--muted)}
.jobs-sort select{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:11px 14px;color:var(--text);font-family:var(--body);font-size:.9rem;cursor:pointer}
.jobs-sort select:focus{outline:none;border-color:var(--primary-bright);box-shadow:0 0 0 3px var(--primary-ring)}
/* Active/archived view toggle — sized and surfaced like its toolbar siblings. */
.jobs-archived-toggle{flex-shrink:0;display:inline-flex;align-items:center;gap:7px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:11px 14px;color:var(--text-2);font-family:var(--body);font-size:.9rem;cursor:pointer;
  transition:border-color var(--dur-2) var(--ease),color var(--dur-2) var(--ease),background var(--dur-2) var(--ease)}
.jobs-archived-toggle:hover{border-color:var(--line-strong);color:var(--text)}
.jobs-archived-toggle:focus-visible{outline:none;border-color:var(--primary-bright);box-shadow:0 0 0 3px var(--primary-ring)}
.jobs-archived-toggle.active{border-color:var(--primary-bright);color:var(--primary-bright);background:var(--primary-soft)}

/* ---- jobs: analysis card (refactored — status stripe, hover-play cover,
        mono metadata, identification-coverage bar) ---- */
.jobs-list{display:flex;flex-direction:column;gap:10px}
.job-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:16px;align-items:center;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:13px;cursor:pointer;transition:border-color var(--dur-2) var(--ease),background var(--dur-2) var(--ease);
  position:relative;overflow:hidden}
.job-card:hover{background:var(--surface-2);border-color:var(--line-strong)}
/* status shows via the badge, not a colored left stripe */
.job-card.job-processing{border-color:rgb(var(--info-rgb) / .35)}
.job-card.job-failed{border-color:rgb(var(--danger-rgb) / .3)}
.job-card.job-partial{border-color:rgb(var(--warning-rgb) / .3)}

/* cover: video thumb / vinyl placeholder, with hover-play + duration pill */
.job-thumb-wrap{position:relative;flex-shrink:0;width:100px;height:64px;border-radius:var(--radius);overflow:hidden}
.job-thumb,.job-thumb-placeholder{width:100%;height:100%;object-fit:cover;display:grid;place-items:center;color:var(--muted)}
.job-thumb-placeholder{background:radial-gradient(circle at 32% 30%, rgb(var(--primary-rgb) / .14), var(--surface-3) 70%)}
.job-thumb-wrap::after{content:"\f04b";font-family:"Font Awesome 6 Free";font-weight:900;position:absolute;inset:0;
  display:grid;place-items:center;color: var(--text);font-size:.85rem;background:rgba(0,0,0,.42);opacity:0;transition:opacity var(--dur-1) var(--ease)}
.job-card:hover .job-thumb-wrap::after{opacity:1}
.job-thumb-dur{position:absolute;right:5px;bottom:5px;background:rgba(0,0,0,.82);color: var(--text);font-family:var(--mono);
  font-size:.62rem;padding:1px 6px;border-radius:var(--radius-sm);z-index:1}

.job-info{min-width:0}
.job-title{font-weight:600;font-size:1rem;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:4px}
.job-meta{display:flex;gap:13px;flex-wrap:wrap;font-family:var(--mono);font-size:.72rem;color:var(--text-2);margin-bottom:8px}
.job-meta i{color:var(--muted);margin-right:4px}
.job-badges{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.job-badge{display:inline-flex;align-items:center;gap:5px;font-size:.68rem;font-weight:600;padding:3px 9px;
  border-radius:var(--radius-pill);border:1px solid transparent;font-family:var(--body)}
.badge-songs{color:var(--primary-bright);background:var(--primary-soft);border-color:var(--primary-line)}
.badge-rate-good{color:var(--primary-bright);background:var(--primary-soft)}
.badge-rate-ok{color:var(--warning);background:var(--warning-soft)}
.badge-rate-low{color:var(--danger);background:var(--danger-soft)}
.badge-processing{color:var(--info);background:var(--info-soft)}
.badge-failed{color:var(--danger);background:var(--danger-soft)}
.badge-partial{color:var(--warning);background:var(--warning-soft)}
.badge-provider,.badge-duration{color:var(--text-2);background:var(--surface-3);border-color:var(--line)}

/* NEW: identification-coverage bar (per analysis) */
.job-coverage{display:flex;align-items:center;gap:9px;margin-top:9px;max-width:340px}
.job-coverage-track{flex:1;height:5px;border-radius:var(--radius-pill);background:var(--surface-3);overflow:hidden}
.job-coverage-fill{height:100%;border-radius:var(--radius-pill);background:var(--primary-bright);transition:width .6s var(--ease)}
.job-coverage-fill.ok{background:var(--warning)}
.job-coverage-fill.low{background:var(--danger)}
.job-coverage-label{font-family:var(--mono);font-size:.68rem;color:var(--muted);white-space:nowrap}

/* progress (processing) */
.job-progress{margin-top:9px}
.job-progress-bar{height:6px;border-radius:var(--radius-pill);background:var(--surface-3);overflow:hidden}
.job-progress-fill{height:100%;min-width:2%;background:var(--primary);border-radius:var(--radius-pill);transition:width .4s var(--ease);position:relative;overflow:hidden}
.job-progress-fill::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.25),transparent);animation:sheen 1.4s linear infinite}
.job-progress-fill.is-failed{background:var(--danger)}
.job-progress-fill.is-failed::after{animation:none}
.job-progress-text{display:flex;justify-content:space-between;align-items:center;font-family:var(--mono);font-size:.7rem;color:var(--muted);margin-top:5px}
.job-progress-right{display:flex;align-items:center;gap:8px}
.job-log-caret{font-size:.7rem;color:var(--muted);transition:transform var(--dur-1) var(--ease)}
.job-expandable{cursor:pointer}
.job-expandable:hover .job-log-caret{color:var(--text-2)}
.job-card.is-expanded .job-log-caret{transform:rotate(180deg);color:var(--primary-bright)}
/* live log panel — reuse the qazana .log terminal, but scroll instead of the
   fixed-height fade-out, and cap the height inside a job card. */
.job-card.is-expanded{align-items:start}
.job-log-wrap{margin-top:10px}
.job-log{max-height:200px;overflow-y:auto;padding:12px 14px}
.job-log::after{display:none}

.job-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.job-yt-btn,.job-reprocess-btn{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:var(--radius-sm);border:1px solid var(--line);background:var(--surface-3);color:var(--text-2);
  cursor:pointer;text-decoration:none;font-size:.82rem;transition:all var(--dur-1) var(--ease)}
.job-yt-btn:hover{color:#ff4d4d;border-color:rgba(255,77,77,.4)}
.job-reprocess-btn:hover{color:var(--primary-bright);border-color:var(--primary-line)}
/* delete shares the reprocess shell but must hover danger, not primary */
.job-del-btn:hover{color:var(--danger);border-color:rgb(var(--danger-rgb) / .4);background:var(--danger-soft)}
.job-retry-btn{width:auto;gap:6px;padding:0 12px;color:var(--warning);border-color:rgb(var(--warning-rgb) / .4)}
.job-cancel-btn{width:auto;gap:6px;padding:0 12px}
.job-cancel-btn:hover{color:var(--danger);border-color:rgb(var(--danger-rgb) / .4);background:var(--danger-soft)}
.job-arrow{color:var(--muted);transition:transform var(--dur-1) var(--ease)}
.job-card:hover .job-arrow{transform:translateX(3px);color:var(--primary-bright)}
@media(prefers-reduced-motion:reduce){.job-progress-fill::after{animation:none}}
.empty-state{text-align:center;padding:56px 20px;border:1px dashed var(--line);border-radius:var(--radius-lg);color:var(--text-2)}
.empty-state i{font-size:2rem;opacity:.5;display:block;margin-bottom:14px;color:var(--muted)}
.empty-state h3{font-weight:700;margin-bottom:6px;color:var(--text)}
.empty-state a{color:var(--primary-bright);text-decoration:none}
.load-more-btn{display:block;margin:18px auto 0;background:var(--surface-2);border:1px solid var(--line);color:var(--text);
  border-radius:var(--radius);padding:10px 22px;cursor:pointer;font-family:var(--body);font-weight:600;font-size:.85rem;transition:all var(--dur-1) var(--ease)}
.load-more-btn:hover{background:var(--surface-3);border-color:var(--line-strong)}

/* ---- profile + billing: card shell (same family as the jobs cards) ---- */
.account-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:24px;margin-bottom:18px}
.card-header{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.card-header h2,.card-header h3{font-family:var(--display);font-weight:800;font-size:1.15rem;letter-spacing:-.01em;color:var(--text)}
.card-header i{width:36px;height:36px;border-radius:var(--radius);display:grid;place-items:center;flex-shrink:0;
  background:var(--primary-soft);color:var(--primary-bright);font-size:.9rem}
.card-desc{color:var(--text-2);font-size:.86rem;margin:-8px 0 18px}
.account-card-danger{border-color:rgb(var(--danger-rgb) / .25)}
.account-card-danger .card-header i{background:var(--danger-soft);color:var(--danger)}

/* uppercase tracked micro-labels — same voice as .jobs-stat-label */
.field-group label,.balance-label,.balance-stat-label,.pack-label,.txn-header span{
  font-size:.68rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}

/* ---- profile: account information ---- */
.profile-section{display:flex;gap:26px;align-items:flex-start;flex-wrap:wrap}
.avatar-area{flex-shrink:0}
.profile-avatar,.avatar-placeholder{width:76px;height:76px;border-radius:50%;object-fit:cover;
  border:2px solid var(--primary-line);background:var(--surface-3)}
.avatar-placeholder{display:flex;align-items:center;justify-content:center;font-size:1.5rem;color:var(--muted)}
/* before JS resolves the avatar, the empty <img src=""> must not paint a stray
   circle; renderProfile() sets an inline display either way */
.profile-avatar[src=""]{display:none}
.profile-fields{flex:1;min-width:260px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px}
.profile-fields .field-group:first-child{grid-column:1 / -1}
.field-group label{display:block;margin-bottom:7px}
.field-value{font-family:var(--mono);font-size:.84rem;color:var(--text);word-break:break-word}
/* vendor qazana.css also defines .field-row (stacked form layout) — restate
   the row direction so the Save button sits beside the input, not below it */
.field-row{display:flex;flex-direction:row;align-items:center;gap:10px}
.field-input{flex:1;min-width:0;background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);
  padding:10px 13px;color:var(--text);font-family:var(--body);font-size:.9rem;
  transition:border-color var(--dur-2) var(--ease),box-shadow var(--dur-2) var(--ease)}
.field-input:focus{outline:none;border-color:var(--primary-bright);box-shadow:0 0 0 3px var(--primary-ring)}
.field-save{background:var(--primary);color:var(--on-primary);border:0;border-radius:var(--radius);
  padding:10px 18px;font-family:var(--body);font-weight:600;font-size:.85rem;cursor:pointer;white-space:nowrap;
  transition:background var(--dur-1)}
.field-save:hover{background:var(--primary-bright)}
.form-message{padding:10px 14px;border-radius:var(--radius);font-size:.85rem;margin-top:14px}
.form-message.error{background:var(--danger-soft);color:var(--danger);border:1px solid rgb(var(--danger-rgb) / .25)}
.form-message.success{background:var(--primary-soft);color:var(--primary-bright);border:1px solid var(--primary-line)}

/* ---- profile: tier ---- */
.tier-display{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.current-tier{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.tier-badge{font-family:var(--mono);font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.12em;
  padding:5px 13px;border-radius:var(--radius-pill);border:1px solid var(--line);background:var(--surface-3);color:var(--text-2)}
.tier-pro{background:rgb(var(--accent-rgb) / .12);color:var(--accent);border-color:rgb(var(--accent-rgb) / .3)}
.tier-unlimited{background:var(--warning-soft);color:var(--warning);border-color:rgb(var(--warning-rgb) / .3)}
.tier-credits{font-family:var(--mono);font-size:.78rem;color:var(--text-2)}
.tier-upgrade-link{display:inline-flex;align-items:center;gap:7px;color:var(--primary-bright);text-decoration:none;
  font-weight:600;font-size:.86rem}
.tier-upgrade-link i{transition:transform var(--dur-1) var(--ease)}
.tier-upgrade-link:hover i{transform:translateX(3px)}

/* ---- profile: connections ---- */
.spotify-section{display:flex;flex-direction:column;gap:14px}
#spotifyConnected{align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.connection-status{display:flex;align-items:center;gap:11px;font-size:.9rem}
.connection-status>div{display:flex;flex-direction:column;gap:3px;line-height:1.3}
.connection-status.connected i{color:var(--primary-bright);font-size:1.1rem}
.connection-status.connected strong{color:var(--text)}
.connection-status span{display:block;font-family:var(--mono);font-size:.74rem;color:var(--text-2)}
.connection-desc{color:var(--text-2);font-size:.88rem;margin:0}
#spotifyDisconnected .connection-desc{margin-bottom:12px}

/* ---- profile: API keys ---- */
.apikeys-section{display:flex;flex-direction:column;gap:14px}
.new-key-box{border:1px solid var(--primary-line);background:var(--primary-soft);border-radius:var(--radius);padding:13px 15px}
.new-key-warning{display:flex;align-items:center;gap:8px;color:var(--warning);font-size:.82rem;margin:0 0 9px}
.new-key-row{display:flex;align-items:center;gap:9px}
.new-key-row code{flex:1;min-width:0;font-family:var(--mono);font-size:.8rem;color:var(--text);
  background:var(--surface-sunken);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:9px 11px;overflow-x:auto;white-space:nowrap}
.apikeys-list{display:flex;flex-direction:column;gap:8px}
.apikey-item{display:flex;align-items:center;justify-content:space-between;gap:12px;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px}
.apikey-info{display:flex;flex-direction:column;gap:3px;min-width:0}
.apikey-info strong{font-size:.9rem;font-weight:600;color:var(--text)}
.apikey-info span{font-family:var(--mono);font-size:.72rem;color:var(--muted)}
.apikey-prefix{font-family:var(--mono);font-size:.74rem;font-weight:400;color:var(--text-2);
  background:var(--surface-3);border:1px solid var(--line);border-radius:var(--radius-sm);padding:1px 7px;margin-left:6px}

/* ---- profile: password + danger zone ---- */
.password-form{max-width:420px;display:flex;flex-direction:column;gap:14px;align-items:flex-start}
.password-form .field-group{width:100%}
.danger-section{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.danger-section .connection-desc{flex:1;min-width:220px}

/* ---- profile: recent analyses ---- */
.history-list{display:flex;flex-direction:column;gap:8px}
.history-item{display:flex;align-items:center;justify-content:space-between;gap:12px;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;
  text-decoration:none;color:inherit;
  transition:border-color var(--dur-2) var(--ease),transform var(--dur-2) var(--ease)}
.history-item:hover{border-color:var(--line-strong);transform:translateX(3px)}
.history-info{display:flex;flex-direction:column;gap:3px;min-width:0}
.history-info strong{font-size:.92rem;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-info span{font-family:var(--mono);font-size:.72rem;color:var(--muted)}
.history-item > i{color:var(--muted);font-size:.72rem;flex-shrink:0;
  transition:transform var(--dur-1) var(--ease),color var(--dur-1) var(--ease)}
.history-item:hover > i{color:var(--primary-bright);transform:translateX(3px)}

/* ---- billing: balance hero ---- */
.balance-display{display:flex;align-items:center;gap:26px;flex-wrap:wrap}
.balance-main{min-width:170px;padding-right:26px;border-right:1px solid var(--line)}
.balance-number{font-family:var(--mono);font-weight:800;font-size:2.6rem;color:var(--primary-bright);line-height:1;letter-spacing:-.02em}
.balance-label{display:block;margin-top:9px}
.balance-details{flex:1;min-width:260px;display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.balance-stat{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius);padding:13px 15px}
.balance-stat-value{display:block;font-family:var(--mono);font-weight:700;font-size:1rem;color:var(--text);line-height:1.25}
.balance-stat-label{display:block;margin-top:6px}

/* ---- billing: plans ---- */
.plans-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}
.plan-card{position:relative;display:flex;flex-direction:column;background:var(--surface-2);border:1px solid var(--line);
  border-radius:var(--radius-lg);padding:22px 20px 20px;
  transition:border-color var(--dur-2) var(--ease),transform var(--dur-2) var(--ease)}
.plan-card:hover{border-color:var(--line-strong);transform:translateY(-2px)}
.plan-card.plan-current{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary-line)}
.plan-tag{position:absolute;top:-10px;right:16px;font-family:var(--mono);font-size:.6rem;font-weight:700;
  text-transform:uppercase;letter-spacing:.12em;background:var(--primary);color:var(--on-primary);
  padding:3px 10px;border-radius:var(--radius-pill)}
.plan-name{font-family:var(--display);font-weight:800;font-size:1rem;letter-spacing:-.01em;color:var(--text)}
.plan-price{font-family:var(--mono);font-weight:700;font-size:1.7rem;color:var(--text);margin:7px 0 16px;line-height:1}
.plan-price span{font-size:.74rem;font-weight:400;color:var(--muted)}
.plan-features{list-style:none;margin:0 0 18px;padding:0;font-size:.85rem;color:var(--text-2);flex:1}
.plan-features li{display:flex;align-items:center;gap:9px;padding:5px 0}
.plan-features i{font-size:.7rem;color:var(--primary-bright);width:14px;text-align:center}
.plan-features i.dim{color:var(--muted);opacity:.6}
.plan-action{min-height:40px;display:flex;align-items:center}
.plan-action .btn-plan{width:100%}
.current-badge{display:inline-flex;align-items:center;justify-content:center;width:100%;
  font-family:var(--mono);font-size:.64rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;
  color:var(--primary-bright);background:var(--primary-soft);border:1px solid var(--primary-line);
  border-radius:var(--radius);padding:10px 12px}

/* ---- billing: credit packs (rendered by JS into #packsGrid) ---- */
.packs-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.pack-card{display:flex;flex-direction:column;align-items:center;text-align:center;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-lg);padding:18px 16px 16px;
  transition:border-color var(--dur-2) var(--ease),transform var(--dur-2) var(--ease)}
.pack-card:hover{border-color:var(--primary-line);transform:translateY(-2px)}
.pack-credits{font-family:var(--mono);font-weight:800;font-size:1.7rem;color:var(--primary-bright);line-height:1}
.pack-label{margin:7px 0 10px}
.pack-price{font-family:var(--mono);font-weight:700;font-size:.95rem;color:var(--text);margin-bottom:13px}
.pack-card .btn-pack{width:100%}

/* ---- billing: transaction history ---- */
.transaction-list{overflow-x:auto}
.txn-header,.txn-row{display:grid;grid-template-columns:110px minmax(0,1fr) 76px 76px;gap:12px;align-items:center;padding:10px 4px}
.txn-header{border-bottom:1px solid var(--line);padding-top:0}
.txn-header span:nth-child(3),.txn-header span:nth-child(4){text-align:right}
.txn-row{border-bottom:1px solid var(--line);font-size:.88rem}
.txn-row:last-child{border-bottom:0}
.txn-date{font-family:var(--mono);font-size:.74rem;color:var(--text-2);white-space:nowrap}
.txn-desc{color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.txn-amount{font-family:var(--mono);font-weight:700;font-size:.84rem;text-align:right}
.txn-positive{color:var(--primary-bright)}
.txn-negative{color:var(--danger)}
.txn-balance{font-family:var(--mono);font-size:.78rem;color:var(--muted);text-align:right}

/* generic buttons used across account screens map to qazana .btn aesthetics */
.btn-plan,.btn-pack,.btn-primary-sm{display:inline-flex;align-items:center;justify-content:center;gap:8px;
  background:var(--primary);color:var(--on-primary);border:0;border-radius:var(--radius);
  padding:11px 18px;font-family:var(--body);font-weight:600;font-size:.86rem;cursor:pointer;transition:background var(--dur-1)}
.btn-plan:hover,.btn-pack:hover,.btn-primary-sm:hover{background:var(--primary-bright)}
.btn-outline{display:inline-flex;align-items:center;gap:8px;background:transparent;border:1px solid var(--line-strong);
  color:var(--text);border-radius:var(--radius);padding:10px 17px;cursor:pointer;
  font-family:var(--body);font-weight:600;font-size:.86rem;transition:all var(--dur-1)}
.btn-outline:hover{border-color:rgb(var(--border-rgb) / .3);background:rgb(var(--border-rgb) / .04)}
.btn-danger{display:inline-flex;align-items:center;gap:8px;background:transparent;
  border:1px solid rgb(var(--danger-rgb) / .5);color:var(--danger);border-radius:var(--radius);
  padding:10px 17px;cursor:pointer;font-family:var(--body);font-weight:600;font-size:.86rem;transition:all var(--dur-1)}
.btn-danger:hover{background:var(--danger);color:var(--on-danger)}
.btn-sm{padding:6px 12px;font-size:.8rem}

/* ---- account screens: responsive ---- */
@media(max-width:640px){
  .profile-section{flex-direction:column}
  .profile-fields{grid-template-columns:1fr;width:100%}
  .balance-display{flex-direction:column;align-items:stretch}
  .balance-main{border-right:0;padding-right:0;border-bottom:1px solid var(--line);padding-bottom:18px}
  .balance-details{min-width:0}
  .txn-header,.txn-row{grid-template-columns:84px minmax(0,1fr) 58px 58px;gap:8px;font-size:.8rem}
  .txn-date{font-size:.68rem}
}

/* ============================================================
   Shared site chrome (header/nav/footer/user-menu/legal) + base —
   ported from style.css so non-index pages need only soniq8.css. */
:root{--shadow:0 4px 20px rgba(0,0,0,.3);--transition:all .3s cubic-bezier(.4,0,.2,1)}
*{box-sizing:border-box}
body{font-family:var(--body);background:var(--bg);color:var(--text);line-height:1.6;min-height:100vh;margin:0}
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.site-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}
.site-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.site-header-logo span {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--primary-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    box-shadow: 0 3px 12px rgb(var(--primary-rgb) / .25);
    flex-shrink: 0;
}
.site-header-nav {
    display: flex;
    gap: 4px;
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    padding: 3px;
    border: 1px solid var(--line);
    margin-left: auto;
    margin-right: auto;
}
.site-header-nav:empty {
    background: none;
    border: none;
    padding: 0;
}
.site-header-nav .nav-tab {
    padding: 7px 16px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--text-2);
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.site-header-nav .nav-tab i {
    font-size: 0.75rem;
    opacity: 0.7;
}
.site-header-nav .nav-tab.active {
    background: rgb(var(--primary-rgb) / 0.12);
    color: var(--primary);
}
.site-header-nav .nav-tab.active i {
    opacity: 1;
}
.site-header-nav .nav-tab:hover:not(.active) {
    color: #ddd;
    background: var(--surface-2);
}
.tagline {
    font-size: 1.2rem;
    color: var(--text-2);
    margin-top: 10px;
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 0;
    position: relative;
    z-index: 1;  /* above the ambient glow below */
}
/* Content/legal pages get the same fixed ambient glow as the auth screen
   (auth.css .auth.centered::before) so they don't read as a different site. */
body:has(> .container .legal-page)::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(55% 45% at 50% -5%, rgb(var(--primary-rgb) / .16), transparent 65%),
        radial-gradient(45% 40% at 85% 100%, rgb(var(--accent-rgb) / .12), transparent 60%);
}
.legal-page h1 {
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.legal-updated {
    color: var(--text-2);
    font-size: 0.85rem;
    margin-bottom: 32px;
}
.legal-page h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 10px;
    color: var(--text);
}
.legal-page h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
    color: var(--text-2);
}
.legal-page p {
    color: var(--text-2);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 12px;
}
.legal-page ul {
    color: var(--text-2);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 24px;
}
.legal-page li {
    margin-bottom: 6px;
}
.legal-page a {
    color: var(--primary);
    text-decoration: none;
}
.legal-page a:hover {
    text-decoration: underline;
}
.footer {
    margin-top: 50px;
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--line);
    color: var(--text-2);
}
.footer-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 30px;
}
/* Build version — only rendered for admins (server-gated in the footer). */
.footer-version {
    margin-top: 14px;
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .04em;
    color: var(--muted);
}
.footer-links a {
    color: var(--text-2);
    text-decoration: none;
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--primary);
}
.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.auth-loading { color: var(--text-2); }
.auth-anonymous {
    display: flex;
    gap: 8px;
}
.auth-btn {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.auth-btn:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
}
.auth-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-credits {
    background: rgb(var(--accent-rgb) / 0.15);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 600;
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.user-menu:hover {
    background: var(--surface-2);
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.user-name {
    font-size: 0.85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #141414;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    min-width: 230px;
    padding: 8px 0;
    z-index: 100;
    box-shadow:
        0 0 0 1px rgb(var(--primary-rgb) / .04),
        0 16px 48px rgba(0,0,0,0.5),
        0 4px 16px rgba(0,0,0,0.3);
    animation: dropdown-in 0.15s ease-out;
}
.dropdown-item {
    padding: 9px 16px;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
    text-decoration: none;
    border-radius: 0;
    margin: 0 4px;
    border-radius: var(--radius);
}
.dropdown-item:hover {
    background: rgb(var(--primary-rgb) / 0.06);
    color: var(--text);
}
.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}
.dropdown-item:hover i {
    opacity: 1;
}
.dropdown-item a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 6px 12px;
}
.admin-status-dot {
    display: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #555;
    margin-right: 8px;
    flex-shrink: 0;
    transition: background 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}
/* ============================================================
   Ported from the retired style.css — landing sections, app.js modals
   (cost preview / Spotify export / match), manual-tag edit form.
   (chrome/base/bg + qazana-overlap excluded to avoid cascade flips.) */
.how-it-works {
    margin-bottom: 32px;
}
.features-section {
    margin-bottom: 32px;
}
.flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.flow-node {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    flex: 1;
    min-width: 0;
}
.flow-node:hover {
    border-color: rgb(var(--primary-rgb) / 0.25);
    box-shadow: 0 0 20px rgb(var(--primary-rgb) / 0.06);
}
.flow-node-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgb(var(--primary-rgb) / 0.1);
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
    border: 2px solid rgb(var(--primary-rgb) / 0.2);
}
.flow-node-body {
    min-width: 0;
}
.flow-node-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.flow-node-desc {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.35;
}
.flow-edge {
    width: 48px;
    flex-shrink: 0;
    color: rgb(var(--primary-rgb) / 0.3);
    display: flex;
    align-items: center;
}
.flow-edge svg {
    width: 100%;
    height: 24px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: rgb(var(--primary-rgb) / 0.1);
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 14px;
}
.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.recent-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}
.recent-header h3 i {
    color: var(--primary);
    font-size: 0.95rem;
}
.recent-view-all {
    font-size: 0.82rem;
    color: var(--text-2);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}
.recent-view-all:hover {
    color: var(--primary);
}
.recent-view-all i {
    font-size: 0.7rem;
}
.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.recent-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    cursor: pointer;
}
.recent-card:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
}
.recent-card-processing {
    border-color: rgb(var(--primary-rgb) / 0.35);
}
.recent-processing-label {
    color: var(--primary);
    font-weight: 600;
}
.recent-thumb {
    width: 64px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--surface-2);
    flex-shrink: 0;
}
.recent-info {
    flex: 1;
    min-width: 0;
}
.recent-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.recent-meta {
    font-size: 0.75rem;
    color: var(--text-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.recent-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.recent-meta i {
    font-size: 0.65rem;
}
.url-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}
.url-field-icon {
    color: #ff0000;
    font-size: 1.1rem;
    flex-shrink: 0;
    opacity: 0.6;
}
@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgb(var(--primary-rgb) / 0.4); }
    50%      { box-shadow: 0 0 0 10px rgb(var(--primary-rgb) / 0); }
}
.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 0.9rem;
}
.stat i {
    color: var(--primary);
}
.edit-form {
    padding: 12px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.edit-form input {
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    margin-bottom: 8px;
    width: 100%;
}
.edit-form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.edit-form-buttons button {
    padding: 6px 14px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition);
}
.edit-form-buttons button:first-child {
    background: var(--primary);
    color: white;
}
.edit-form-buttons button:last-child {
    background: var(--surface-2);
    color: var(--text);
}
.apple-btn {
    background: #666;
    cursor: not-allowed;
}
.coming-soon {
    font-size: 0.7rem;
    background: var(--danger);
    padding: 2px 6px;
    border-radius: var(--radius);
    margin-left: 5px;
}
/* Error state (used by showError for ALL errors): a calm design-system card with
   a danger accent + icon badge, and a brand-colored recovery action — rather than a
   full red alarm box. */
.error-section {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}
.error-card {
    max-width: none;
    width: 100%;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--danger);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    animation: errorIn 0.35s ease both;
}
@keyframes errorIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.error-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgb(var(--danger-rgb) / 0.12);
    color: var(--danger);
    font-size: 1.4rem;
}
.error-title {
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
}
.error-message {
    color: var(--text-2);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 40ch;
    word-break: break-word;
}
.retry-btn {
    margin-top: 22px;
    padding: 11px 22px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--on-primary);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.retry-btn:hover {
    background: var(--primary-bright);
    transform: translateY(-2px);
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--line);
}
.modal-content h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.modal-content input {
    width: 100%;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    margin-bottom: 20px;
}
.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 22px;
}
/* The Spotify-export modal uses .btn-primary/.btn-secondary, which were only defined
   in admin.css (not loaded here), so the Create/Update buttons rendered unstyled. */
.modal-buttons .btn-primary,
.modal-buttons .btn-secondary {
    padding: 11px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-bright, var(--primary)); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--surface); }
/* ===== Auth modal (anonymous paste -> sign in -> analysis resumes) =====
   Scrim + dialog. The dialog carries the `auth` class so the auth kit
   (vendor/qazana/auth.css) styles the form internals exactly like /login;
   the overrides below undo the kit's full-page layout (grid + 100vh)
   inside the dialog. Tab switcher + inline error mirror login.html. */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}
.auth-modal.is-open {
    display: flex;
}
.auth-modal .auth-modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
}
/* unlayered, so it beats the kit's @layer .auth page rules */
.auth-modal .auth-modal-card.auth {
    display: block;
    min-height: 0;
    background: var(--surface);
}
.auth-modal-close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.auth-modal-close:hover {
    color: var(--text);
}
.auth-modal h1 {
    font-size: 1.4rem;
}
/* same override as the hero copy: qazana's .sub is a mono/uppercase label */
.auth-modal .sub {
    font-family: var(--body);
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--text-2);
    font-size: 0.95rem;
    margin-bottom: 20px;
}
.auth-modal .auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 16px;
}
.auth-modal .auth-tab {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font-family: var(--body);
    font-weight: 600;
    font-size: 0.86rem;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.auth-modal .auth-tab.active {
    background: var(--primary);
    color: var(--on-primary);
}
.auth-modal .form-error {
    background: var(--danger-soft);
    border: 1px solid rgb(var(--danger-rgb) / 0.35);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.84rem;
    margin-bottom: 14px;
}
/* single full-width provider button (same fix as /login: auto-fit can't take
   fr tracks, so size implicit columns — one equal column per provider) */
.auth-modal .oauth {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}
.auth-modal .google-btn .oauth-icon {
    flex-shrink: 0;
}
.spotify-linked {
    color: var(--primary);
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 4px;
}
/* Per-track export-result chip appended after the title ("Added" / "Not found"). */
.spotify-export-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
    border: 1px solid transparent;
}
.spotify-export-status i { font-size: 0.85em; }
.spotify-export-status.spotify-added {
    color: #1db954;
    background: rgba(29, 185, 84, 0.12);
    border-color: rgba(29, 185, 84, 0.3);
}
.spotify-export-status.spotify-not-found {
    color: #c8860a;
    background: rgba(200, 134, 10, 0.1);
    border-color: rgba(200, 134, 10, 0.28);
}
.spotify-export-status.spotify-not-found a {
    color: inherit;
    text-decoration: underline;
}
.spotify-match-preview {
    margin-top: 12px;
}
.match-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.match-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
}
.match-ready {
    color: var(--primary);
    background: rgb(var(--primary-rgb) / 0.08);
}
.match-search {
    color: var(--warning);
    background: rgb(var(--warning-rgb) / 0.08);
}
.match-skip {
    color: var(--danger);
    background: rgb(var(--danger-rgb) / 0.08);
}
.match-duplicate {
    color: var(--muted);
    background: rgba(158, 158, 158, 0.08);
}
.dup-count {
    color: var(--text-2);
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 4px;
}
.match-details {
    margin-top: 8px;
    font-size: 0.8rem;
}
.match-details summary {
    cursor: pointer;
    color: var(--text-2);
    padding: 4px 0;
}
.match-details ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
    max-height: 120px;
    overflow-y: auto;
}
.match-details li {
    padding: 3px 10px;
    color: var(--text-2);
    margin-bottom: 3px;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}
@media (max-width: 768px){
.logo h1 {
        font-size: 1.8rem;
    }
.how-it-works {
        margin-bottom: 24px;
    }
.features-section {
        margin-bottom: 24px;
    }
.flow {
        flex-direction: column;
        gap: 0;
    }
.flow-node {
        border-radius: 0;
        padding: 14px 18px;
    }
.flow-node:first-child {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
.flow-node:last-child {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
.flow-edge {
        width: 100%;
        height: 28px;
        justify-content: center;
    }
.flow-edge svg {
        width: 24px;
        height: 100%;
        transform: rotate(90deg);
    }
.features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
.recent-grid {
        grid-template-columns: 1fr;
    }
.url-bar {
        flex-direction: column;
    }
}
@media (max-width: 480px){
.features-grid {
        grid-template-columns: 1fr;
    }
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.google-login:hover { border-color: #4285f4; }
.github-login:hover { border-color: var(--line-strong); }
.jobs-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgb(var(--primary-rgb) / 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
    white-space: nowrap;
}
.jobs-badge:hover {
    background: rgb(var(--primary-rgb) / 0.25);
}
.jobs-badge i {
    font-size: 0.7rem;
}
@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.spotify-connect-item i {
    color: #888;
}
.spotify-connect-item.spotify-connected i {
    color: var(--primary);
}
.spotify-connect-item.spotify-connected::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    margin-left: auto;
    flex-shrink: 0;
}
.admin-alert-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger);
    color: var(--text);
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    border-radius: var(--radius);
    padding: 0 3px;
}
.ethos-section {
    max-width: 680px;  /* match the landing text column (.sub / .url-form) */
    margin: 72px auto 48px;
    text-align: center;
}
.ethos-lead {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.9rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 45%, var(--primary-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 18px;
}
.ethos-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-2);
}
@media (max-width: 600px){
.ethos-lead { font-size: 1.4rem; }
.ethos-section { margin: 48px auto 32px; }
}
.update-banner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 140%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 92vw;
    padding: 12px 14px 12px 18px;
    background: var(--surface-2);
    border: 1px solid rgb(var(--primary-rgb) / 0.35);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 0.92rem;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
}
.update-banner.update-banner-in {
    transform: translate(-50%, 0);
    opacity: 1;
}
.update-banner i { color: var(--primary); margin-right: 4px; }
.update-banner-refresh {
    background: var(--primary);
    color: #04130a;
    border: none;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.update-banner-refresh:hover { background: var(--primary-bright); }
.update-banner-dismiss {
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.update-banner-dismiss:hover { color: var(--text); }
@media (max-width: 600px){
.update-banner { font-size: 0.85rem; bottom: 14px; gap: 10px; padding: 10px 12px; }
}

/* ---- Version picker ("which remix did the DJ play?") ---- */
.vp-chip{cursor:pointer;border:1px solid rgb(var(--accent-rgb) / .5);background:rgb(var(--accent-rgb) / .12);
  color:var(--accent);font:inherit;font-size:.66rem;font-weight:700;line-height:1;padding:3px 8px;border-radius:var(--radius-pill);transition:all .18s}
.vp-chip:hover{background:rgb(var(--accent-rgb) / .22);transform:translateY(-1px)}
.vp-dialog{max-width:560px}
.vp-body{max-height:70vh;overflow-y:auto}
.vp-lead{margin:0 0 14px;color:var(--text-2);font-size:.86rem}
.vp-cards{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.vp-card{display:grid;grid-template-columns:40px 1fr auto auto;gap:12px;align-items:center;padding:9px 11px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);transition:border-color .18s}
.vp-card:hover{border-color:rgb(var(--primary-rgb) / .4)}
.vp-art{width:40px;height:40px;border-radius:var(--radius-sm);object-fit:cover;background:var(--surface-2)}
.vp-art-ph{display:grid;place-items:center;color:var(--text-2);font-size:1rem}
.vp-info{min-width:0}
.vp-title{font-size:.9rem;color:var(--text);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vp-ver{font-size:.66rem;font-weight:700;color:var(--accent);background:rgb(var(--accent-rgb) / .12);
  padding:1px 6px;border-radius:var(--radius-pill);margin-left:4px}
.vp-sub{font-size:.78rem;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vp-meta{font-family:var(--mono);font-size:.7rem;color:var(--text-2);margin-left:6px}
.vp-play{width:32px;height:32px;border-radius:50%;border:1px solid var(--line);background:var(--surface-2);
  color:var(--text);cursor:pointer;display:grid;place-items:center;transition:all .18s}
.vp-play::before{content:"▶";font-size:.62rem}
.vp-play:hover{border-color:var(--primary);color:var(--primary-bright)}
.vp-play.playing{background:var(--primary);color:#06120c;border-color:var(--primary)}
.vp-play.playing::before{content:"❚❚";font-size:.56rem}
.vp-section-label{font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  color:var(--text-2);margin:4px 0 8px}
.vp-select{padding:7px 14px;border-radius:var(--radius-sm);border:1px solid var(--primary);
  background:rgb(var(--primary-rgb) / .12);color:var(--primary-bright);font-weight:700;font-size:.78rem;cursor:pointer;transition:all .18s}
.vp-select:hover{background:var(--primary);color:#06120c}
.vp-select:disabled{opacity:.6;cursor:default}
.vp-search{margin-top:18px;border-top:1px solid var(--line);padding-top:14px}
.vp-search-label{display:block;font-size:.8rem;color:var(--text-2);margin-bottom:8px}
.vp-search-input{width:100%;padding:10px 14px;border-radius:var(--radius-sm);border:1px solid var(--line);
  background:var(--surface);color:var(--text);font:inherit;font-size:.88rem;margin-bottom:10px}
.vp-search-input:focus{outline:none;border-color:var(--primary)}
.vp-empty{list-style:none;color:var(--text-2);font-size:.82rem;padding:8px 2px}

/* ---- "Listen" to an unidentified gap (plays the stored GapChunk) ---- */
.gap-row .gap-listen-btn{border-color:rgb(var(--primary-rgb) / .5);color:var(--primary-bright);
  display:inline-flex;align-items:center;gap:5px}
.gap-row .gap-listen-btn:hover{background:var(--primary);color:#06120c}
.gl-ico::before{content:"\25B6";font-size:.58rem}
.gap-row .gap-listen-btn.playing{background:var(--primary);color:#06120c;border-color:var(--primary)}
.gap-row .gap-listen-btn.playing .gl-ico::before{content:"\275A\275A";letter-spacing:-1px}

/* ---- Version picker: "Hear what you heard" (the actual mix segment clip) ---- */
.vp-segment{display:inline-flex;align-items:center;gap:7px;margin:0 0 14px;padding:8px 14px;
  border:1px solid rgb(var(--accent-rgb) / .5);background:rgb(var(--accent-rgb) / .12);color:var(--accent);
  font:inherit;font-size:.82rem;font-weight:700;border-radius:var(--radius-sm);cursor:pointer;transition:all .18s}
.vp-segment:hover{background:rgb(var(--accent-rgb) / .22)}
.vp-seg-ico::before{content:"\25B6";font-size:.58rem}
.vp-segment.playing{background:var(--accent);color:#1a1205;border-color:var(--accent)}
.vp-segment.playing .vp-seg-ico::before{content:"\275A\275A";letter-spacing:-1px}

/* ── Playlist batch + deferred ("waiting for credits") queue ───────────────── */
.batch-modal { text-align: left; }
.batch-controls { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.batch-selectall {
    background: none; border: 1px solid var(--line); color: var(--text-2);
    border-radius: var(--radius-pill); padding: .2rem .7rem; font-size: .78rem;
    cursor: pointer; font-family: var(--mono);
}
.batch-selectall:hover { color: var(--text); border-color: var(--line-strong); }
.batch-list {
    max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column;
    gap: .35rem; padding-right: .25rem; margin-bottom: .9rem;
}
.batch-item, .deferred-item {
    display: flex; align-items: center; gap: .6rem; padding: .4rem .55rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); cursor: pointer;
}
.batch-item:hover { border-color: var(--line-strong); }
.batch-item input[type="checkbox"] { flex: 0 0 auto; accent-color: var(--primary); }
.batch-thumb {
    flex: 0 0 auto; width: 56px; height: 32px; object-fit: cover;
    border-radius: var(--radius-sm); background: var(--surface-sunken);
}
.batch-thumb-empty { background: var(--surface-3); }
.batch-item-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1 1 auto; }
.batch-item-title {
    font-size: .86rem; color: var(--text); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.batch-item-meta { font-size: .72rem; color: var(--muted); font-family: var(--mono); }
.batch-badge {
    flex: 0 0 auto; font-size: .7rem; font-family: var(--mono); color: var(--text-2);
    background: var(--surface-3); border-radius: var(--radius-pill); padding: .12rem .5rem;
}
.batch-badge-free { color: var(--accent); }
.batch-summary {
    border-top: 1px solid var(--line); padding-top: .7rem;
    display: flex; flex-direction: column; gap: .3rem;
}
.batch-note { font-size: .72rem; color: var(--muted); margin-top: .35rem; line-height: 1.4; }

.deferred-section {
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: var(--surface); padding: 1rem 1.1rem; margin: 0 0 1.4rem;
}
.deferred-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.deferred-head h3 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .5rem; color: var(--text); }
.deferred-list { display: flex; flex-direction: column; gap: .35rem; }
.deferred-item { cursor: default; }
.deferred-remove {
    flex: 0 0 auto; background: none; border: none; color: var(--muted);
    cursor: pointer; padding: .25rem .4rem; border-radius: var(--radius-sm);
}
.deferred-remove:hover { color: var(--danger); background: var(--danger-soft); }
