/* VoiceIsolate Pro — Landing (Stem-Split & Live-Mix UI) */

/* ── `hidden` attribute must always win ───────────────────────────────────
   State-managed UI here is toggled with `el.hidden = true/false`. The UA
   sheet's `[hidden] { display: none }` has UA origin, so ANY author rule
   that sets `display` (e.g. `.ps-workspace-nav { display: flex }`) silently
   un-hides the element while JS still believes it is hidden. Keep this rule
   so `hidden` stays authoritative; never set `display` on a hidden element
   to "show" it — clear the attribute instead. */
[hidden] {
  display: none !important;
}

/* ── Design Tokens ────────────────────────────────────────────────────── */
:root {
  --surface-root: #070b10;
  --surface-panel: #0d131b;
  --surface-raised: #121a23;
  --border-subtle: #1d2a34;
  --text-primary: #f4f7fa;
  --text-secondary: #8d9aaa;
  --action-process: #ff3d4d;
  /* Filled-surface variant of --action-process. The accent red only reaches
     3.48:1 against white, so any control that paints white text ON the action
     color uses this darker red (5.05:1) instead. Accents, borders, glows and
     text-on-dark keep --action-process. */
  --action-process-solid: #d81f30;
  --action-live: #2ed5e5;
  --state-success: #31cf7d;
  --state-warning: #f0b541;
  --source-secondary: #9b6cff;

  --void:       var(--surface-root);
  --bg:         var(--surface-root);
  --surface-1:  var(--surface-panel);
  --surface-2:  var(--surface-raised);
  --surface-3:  #161f29;
  --canvas-bg:  #05080c;
  --well-bg:    rgba(0,0,0,0.32);

  --red-700: #b91c1c;
  --red-600: #e11d3a;
  --red-500: var(--action-process);
  --red-400: #ff6b78;
  --red-wash: rgba(255,61,77,0.08);
  --signal-peak: #fcd34d;

  --ok:     var(--state-success);
  --warn:   var(--state-warning);
  --danger: var(--action-process);

  --text-hi:   var(--text-primary);
  --text:      #c5ced6;
  --text-2:    var(--text-secondary);
  /* Raised from #6d7a86 (4.49:1 on --surface-root) to clear WCAG AA 4.5:1
     for the 9-12px secondary labels this token paints. */
  --text-dim:  #7b8894;
  /* Faintest text tier. Raised from rgba(244,247,250,0.18) — 1.61:1, the 9-10px
     `.vis-hint` / `.hint-range-*` labels it paints were unreadable. 0.48 alpha
     is 4.65-4.72:1 on every VIP surface and still sits below --text-dim (5.14-
     5.44:1), so the hierarchy holds. Text tokens are AA-pinned; use a border or
     background token for decoration instead of dropping this one. */
  --text-ghost: rgba(244,247,250,0.48);

  --border:        var(--border-subtle);
  --border-strong: #26323d;
  --border-red:    rgba(255,61,77,0.18);
  --border-focus:  rgba(46,213,229,0.55);

  --hover-fill: rgba(255,255,255,0.04);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);

  --grid-line: rgba(220,38,38,0.035);

  --font-ui:   ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  --fs-3xs: 9px;
  --fs-2xs: 10px;
  --fs-xs:  11px;
  --fs-sm:  12px;
  --fs-base: 13px;
  --fs-md:  14px;
  --fs-lg:  16px;
  --fs-xl:  20px;

  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;

  --dur-fast: 0.12s;
  --dur-base: 0.20s;
  --ease-out: cubic-bezier(0.22, 0.7, 0.2, 1);

  --titlebar-h: 44px;

  /* Creative flair — spectral aurora accents */
  --aurora-1: rgba(220, 38, 38, 0.18);
  --aurora-2: rgba(239, 68, 68, 0.10);
  --aurora-3: rgba(252, 211, 77, 0.06);
  --glow-ring: 0 0 0 1px rgba(220, 38, 38, 0.22), 0 0 28px rgba(220, 38, 38, 0.12);
  --pulse-glow: 0 0 20px rgba(220, 38, 38, 0.35);
}

/* Consumer-mode ORT provider hint (Landing) */
.ort-provider-hint {
  margin-left: auto;
  font: var(--fw-medium) var(--fs-2xs) / 1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ── Reset & Base ─────────────────────────────────────────────────────── */

/* Ambient spectral aurora behind the app shell */
body::after {
  content: '';
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 55vh;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, var(--aurora-1), transparent 70%),
    radial-gradient(ellipse 40% 35% at 80% 20%, var(--aurora-2), transparent 65%),
    radial-gradient(ellipse 35% 30% at 55% 60%, var(--aurora-3), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: vip-aurora-drift 18s ease-in-out infinite alternate;
  opacity: 0.35;
}

@keyframes vip-aurora-drift {
  from { transform: translate3d(0, 0, 0) scale(1); filter: hue-rotate(0deg); }
  to   { transform: translate3d(2%, 3%, 0) scale(1.04); filter: hue-rotate(8deg); }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fw-regular) var(--fs-base)/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red-600); color: #fff; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ── Title bar ────────────────────────────────────────────────────────── */
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--titlebar-h);
  padding: 0 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.titlebar-left { display: flex; align-items: center; gap: 10px; }

.logo-icon {
  width: 26px; height: 26px; flex: none;
  display: flex; align-items: center; justify-content: center;
}

/* Equalizer mark */
.logo-icon svg { display: block; }

.app-title {
  font: var(--fw-bold) 13px/1 var(--font-ui);
  color: var(--text-hi);
  letter-spacing: var(--ls-tight, -0.01em);
}

.arch-badge {
  font: var(--fw-bold) var(--fs-2xs)/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
}

.titlebar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.eng-mode-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  font: var(--fw-medium) var(--fs-sm)/1 var(--font-ui);
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.eng-mode-link:hover {
  color: var(--text-hi);
  border-color: var(--border-red);
}
.eng-mode-link--primary {
  color: #fff;
  background: var(--red-600);
  border-color: var(--red-600);
}
.eng-mode-link--primary:hover {
  color: #fff;
  background: var(--red-500);
  border-color: var(--red-500);
}

/* ── Hero (first impression / conversion) ─────────────────────────────── */
.vip-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 16px 8px;
  text-align: left;
}
.vip-hero.ps-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 24px;
  align-items: start;
}
.vip-hero__eyebrow {
  margin: 0 0 10px;
  font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-400);
}
.vip-hero__title {
  margin: 0 0 12px;
  font: var(--fw-bold) clamp(1.9rem, 4.6vw, 3.2rem)/1.08 var(--font-ui);
  letter-spacing: -0.03em;
  color: var(--text-hi);
  max-width: 12ch;
}
.vip-hero__sub {
  margin: 0 0 20px;
  max-width: 40rem;
  font: var(--fw-regular) var(--fs-md)/1.55 var(--font-ui);
  color: var(--text-2);
}
.vip-hero__sub strong { color: var(--text-hi); font-weight: var(--fw-semibold); }
.vip-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.vip-hero__cta,
a.vip-btn {
  text-decoration: none;
  box-sizing: border-box;
}
.vip-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.vip-trust__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--fw-medium) var(--fs-xs)/1.2 var(--font-ui);
  color: var(--text-2);
}
.vip-trust__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  color: var(--ok);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.28);
}

/* Pitch / how-it-works */
.vip-pitch__list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--text-2);
  font-size: var(--fs-base);
  line-height: 1.55;
}
.vip-pitch__list li { margin-bottom: 8px; }
.vip-pitch__list strong { color: var(--text-hi); }
.vip-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vip-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-2);
  font-size: var(--fs-base);
  line-height: 1.45;
}
.vip-steps strong { color: var(--text-hi); }
.vip-steps__n {
  flex: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font: var(--fw-bold) var(--fs-xs)/1 var(--font-mono);
  color: var(--red-400);
  background: var(--red-wash);
  border: 1px solid var(--border-red);
}
.vip-pitch__foot { margin: 16px 0 0; }
.vip-pitch__foot a { color: var(--red-400); }
.privacy-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.vip-cta-band {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.vip-advanced {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}
.vip-advanced__summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font: var(--fw-semibold) var(--fs-sm)/1.2 var(--font-ui);
  color: var(--text-hi);
  min-height: 44px;
  display: flex;
  align-items: center;
  user-select: none;
}
.vip-advanced__summary::-webkit-details-marker { display: none; }
.vip-advanced__summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--red-400);
  transition: transform var(--dur-fast) var(--ease-out);
}
.vip-advanced[open] > .vip-advanced__summary::before {
  transform: rotate(90deg);
}
.vip-advanced .slider-grid--advanced {
  padding: 0 10px 12px;
  margin: 0;
}
#uploadPanel {
  scroll-margin-top: calc(var(--titlebar-h) + 12px);
}

/* ── Main area ────────────────────────────────────────────────────────── */
.main-area {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Panels ───────────────────────────────────────────────────────────── */
.panel {
  position: relative;
  background:
    linear-gradient(165deg, rgba(220, 38, 38, 0.04) 0%, transparent 42%),
    var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.panel:hover {
  border-color: rgba(220, 38, 38, 0.22);
  box-shadow: var(--shadow-sm), var(--glow-ring);
}

.panel.vip-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 40%, rgba(220, 38, 38, 0.05) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: vip-card-sheen 8s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes vip-card-sheen {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .panel.vip-card::before { animation: none; }
}

.section-label {
  margin: 0 0 6px;
  font: var(--fw-bold) var(--fs-2xs)/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hint {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: var(--fs-base);
  line-height: 1.5;
}

/* ── Upload drop zone ─────────────────────────────────────────────────── */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 20px;
  margin-bottom: 14px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(220, 38, 38, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(220, 38, 38, 0.03), transparent);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone.drag-over {
  border-color: var(--border-red);
  background: var(--red-wash);
  outline: none;
}

.upload-svg { color: var(--text-dim); margin-bottom: 4px; }

.upload-title {
  margin: 0;
  font: var(--fw-semibold) var(--fs-base)/1.3 var(--font-ui);
}

.upload-sub {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: var(--fs-xs);
}

/*
 * Visually hidden but kept in the viewport — Chromium 120+ blocks programmatic
 * .click() on file inputs positioned far off-screen (left:-9999px).
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-file {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0.001;
  overflow: hidden;
  pointer-events: auto;
}

/* ── Form rows ────────────────────────────────────────────────────────── */
.upload-row,
.transport-row,
.status-row,
.export-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.export-row {
  margin: 12px 0 4px;
}

.inline-label {
  font: var(--fw-medium) var(--fs-xs)/1 var(--font-ui);
  color: var(--text-dim);
}

select,
input[type="file"] {
  font: var(--fw-regular) var(--fs-base)/1 var(--font-ui);
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
select:focus,
input[type="file"]:focus { border-color: var(--border-focus); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--fw-semibold) var(--fs-sm)/1 var(--font-ui);
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}
.btn:hover:not(:disabled) {
  color: var(--text-hi);
  border-color: var(--border-red);
  background: var(--hover-fill);
}
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.34; cursor: not-allowed; }

.btn-primary {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--red-500);
  border-color: var(--red-500);
  color: #fff;
}

.btn-toggle.active {
  background: var(--red-wash);
  border-color: var(--red-600);
  color: var(--red-400);
}

/* ── Status row ───────────────────────────────────────────────────────── */
.status-row { margin-top: 12px; }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--text-dim);
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.status-dot.active { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.status-dot.warn   { background: var(--warn); }
.status-dot.error  { background: var(--danger); }

#statusText {
  font: var(--fw-medium) var(--fs-sm)/1 var(--font-ui);
  color: var(--text-2);
}

/* ── ProcessLoader (DS bundle component) ──────────────────────────────── */
/* Mount point: hidden until landing.js mounts the component inside it.    */
#procLoaderMount { margin-top: 14px; }
#procLoaderMount[hidden] { display: none; }

/* Spectral scan-bar animation — staggered per bar via inline delay prop.  */
@keyframes vip-scan {
  0%, 100% { transform: scaleY(0.15); opacity: 0.45; }
  50%       { transform: scaleY(1.0);  opacity: 1;    }
}

/* Active pipeline-node pulse. */
@keyframes vip-node-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--red-wash); }
  50%       { box-shadow: 0 0 0 8px rgba(220,38,38,0.12); }
}

/* Each scan bar fills its flex row height and scales from the bottom. */
.vip-ploader__bar {
  height: 100%;
  transform-origin: 50% 100%;
}

@media (prefers-reduced-motion: reduce) {
  .vip-ploader__bar { animation: none !important; }
}

/* ── Video preview ────────────────────────────────────────────────────── */
.video-card {
  margin: 4px 0 14px;
  background: var(--void);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.video-card[hidden] { display: none; }

.video-player { display: block; width: 100%; max-height: 420px; background: #000; }

.video-note {
  margin: 0; padding: 6px 12px;
  font: var(--fw-regular) var(--fs-xs)/1.4 var(--font-ui);
  color: var(--text-dim);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

/* ── Time readout ─────────────────────────────────────────────────────── */
.time-readout {
  font: var(--fw-medium) var(--fs-sm)/1 var(--font-mono);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* ── Vis block ────────────────────────────────────────────────────────── */
.vis-block { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }

.vis-label {
  font: var(--fw-bold) var(--fs-2xs)/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.vis-hint {
  font-family: var(--font-ui);
  font-weight: var(--fw-regular);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-ghost);
  margin-left: 4px;
}

.vis-canvas {
  width: 100%; height: 110px; display: block;
  background: var(--canvas-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: crosshair;
}

/* ── Slider grid ──────────────────────────────────────────────────────── */
.slider-grid { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }

.slider-row {
  display: grid;
  /* Trailing track holds .slider-hint-btn, which is 24px so it meets the
     WCAG 2.2 AA 2.5.8 minimum target size. */
  grid-template-columns: 148px 1fr 64px 24px;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.slider-hint-btn {
  /* 24px is the WCAG 2.2 AA 2.5.8 minimum target. The .slider-row trailing
     grid track is sized to match, so the dot does not overflow its column. */
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  /* --text-dim is pinned against the base surfaces, but this control lightens
     its own to rgb(32,40,48), where #7b8894 falls to 4.11:1. The secondary
     token clears it at 5.21:1. */
  color: var(--text-secondary);
  font: var(--fw-bold) 11px/24px var(--font-ui);
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  padding: 0;
  transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}
.slider-hint-btn:hover {
  color: var(--red-400);
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.08);
}
.slider-row.hint-open .slider-hint-btn {
  color: var(--red-400);
  border-color: rgba(220, 38, 38, 0.55);
  background: rgba(220, 38, 38, 0.12);
}
.slider-hint {
  grid-column: 1 / -1;
  display: none;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font: var(--fw-regular) var(--fs-2xs)/1.35 var(--font-ui);
  color: var(--text-dim);
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.18);
}
.slider-row.hint-open .slider-hint { display: block; }
.hint-aids-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.hint-dir-badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px;
  font: var(--fw-bold) 10px/1 var(--font-ui); border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05); color: var(--text-dim);
}
.hint-dir-up { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.1); }
.hint-dir-down { color: #fca5a5; border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.1); }
.hint-dir-both { color: var(--red-400); border-color: rgba(220, 38, 38, 0.35); background: rgba(220, 38, 38, 0.08); }
.hint-range-meter { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 120px; }
.hint-range-lo, .hint-range-hi { font: var(--fw-regular) 9px/1 var(--font-mono); color: var(--text-ghost); }
.hint-range-track {
  position: relative; flex: 1; height: 5px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.35), rgba(52, 211, 153, 0.35));
}
.hint-range-thumb {
  position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--text-hi); border: 2px solid var(--red-600);
}
.hint-body { margin: 0; font: var(--fw-regular) var(--fs-2xs)/1.4 var(--font-ui); color: var(--text-dim); }
.hint-toward { background: rgba(220, 38, 38, 0.08); border-radius: 3px; padding: 0 2px; }
.hint-toward em { color: var(--red-400); font-style: normal; font-weight: var(--fw-semibold); }
.hint-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.hint-chip {
  display: inline-flex; padding: 3px 8px; border-radius: 6px; font: var(--fw-medium) 10px/1.25 var(--font-ui);
  border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.04); color: var(--text-dim);
}
.hint-chip-up { border-color: rgba(52, 211, 153, 0.28); color: #a7f3d0; }
.hint-chip-down { border-color: rgba(248, 113, 113, 0.28); color: #fecaca; }
.hint-chip-both { border-color: rgba(220, 38, 38, 0.22); color: var(--red-400); }
.hint-examples {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; padding-top: 6px;
  border-top: 1px solid var(--border);
}
.hint-example-pill {
  padding: 4px 9px; border-radius: 99px; border: 1px solid rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.08); color: var(--text-2); font: var(--fw-semibold) 10px/1 var(--font-ui);
  cursor: pointer;
}
.hint-example-pill:hover { background: rgba(220, 38, 38, 0.16); color: var(--text-hi); }
.slider-hint-btn:focus-visible, .hint-example-pill:focus-visible {
  outline: 2px solid var(--red-400); outline-offset: 2px;
}
.slider-row:hover {
  background: var(--hover-fill);
  border-left-color: var(--red-600);
}

.slider-row label {
  font: var(--fw-medium) var(--fs-xs)/1 var(--font-ui);
  color: var(--text-2);
}
.slider-row:hover label { color: var(--text); }

.slider-val {
  font: var(--fw-semibold) var(--fs-xs)/1 var(--font-mono);
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.slider-row:hover .slider-val { color: var(--red-400); }

input[type="range"] {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  /* box-sizing is border-box globally, so height includes the padding: the
     padding is an invisible grab area (a 3px-tall track is not a usable target
     for a mouse either, and fails WCAG 2.2 AA 2.5.8 on touch), and the content
     box is the 4px track that actually gets painted.
     background-clip MUST stay after the background shorthand — the shorthand
     resets it to border-box, which is what made the padded touch sliders
     render as a solid 24px slab instead of a track. */
  height: 24px;
  padding: 10px 0;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--red-600) 0%,
    var(--red-600) var(--pct, 50%),
    var(--border-strong) var(--pct, 50%),
    var(--border-strong) 100%
  );
  background-clip: content-box;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-hi);
  border: 2px solid var(--red-600);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out);
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.2); }
input[type="range"]:hover::-moz-range-thumb { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-hi);
  border: 2px solid var(--red-600);
  box-shadow: var(--shadow-sm);
}
input[type="range"]:disabled { opacity: 0.34; cursor: not-allowed; }

/* ── Privacy panel ────────────────────────────────────────────────────── */
.privacy-panel { border-left: 3px solid rgba(52,211,153,0.5); }

/* ── Speaker grid ─────────────────────────────────────────────────────── */
.speaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.speaker-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.speaker-card:hover { border-color: var(--border-red); }
.speaker-card-muted { opacity: 0.42; }

.speaker-card-header { display: flex; align-items: center; gap: 8px; }

.speaker-swatch { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.speaker-swatch-1 { background: #3b82f6; }
.speaker-swatch-2 { background: #a855f7; }
.speaker-swatch-3 { background: #10b981; }
.speaker-swatch-4 { background: #f59e0b; }
.speaker-swatch-5 { background: #ef4444; }
.speaker-swatch-6 { background: #06b6d4; }
.speaker-swatch-7 { background: #84cc16; }
.speaker-swatch-8 { background: #f97316; }

.speaker-label {
  font: var(--fw-semibold) var(--fs-sm)/1 var(--font-ui);
  color: var(--text-hi);
}

.speaker-talk-time {
  margin-left: auto;
  font: var(--fw-regular) var(--fs-xs)/1 var(--font-mono);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.speaker-vol-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 10px;
}

.speaker-actions { display: flex; gap: 8px; }
.speaker-actions .btn { padding: 5px 10px; font-size: var(--fs-xs); }

.speaker-empty { margin: 0; color: var(--text-dim); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .slider-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto auto;
    gap: 6px;
    padding: 8px 6px;
  }
  .slider-row label { grid-column: 1; grid-row: 1; align-self: center; }
  .slider-val { grid-column: 2; grid-row: 1; align-self: center; min-width: 44px; }
  .slider-hint-btn { grid-column: 3; grid-row: 1; align-self: center; }
  .slider-row input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
  .slider-hint { grid-column: 1 / -1; grid-row: 3; font-size: var(--fs-xs); padding: 10px; }
  .hint-range-meter { min-width: 0; flex: 1 1 100%; }

  .titlebar {
    padding: 0 10px 0 12px;
    gap: 8px;
  }
  .titlebar-left { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  /* Never let the mono badge collide with Download / Engineer */
  .arch-badge,
  #archBadgeMount {
    display: none !important;
  }
  .app-title {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .titlebar-right {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
  }
  .vip-hero { padding: 20px 14px 4px; }
  .vip-hero.ps-hero { grid-template-columns: 1fr; }
  .vip-hero__title { max-width: none; }
  .vip-hero__actions .vip-btn,
  .vip-hero__actions a.vip-btn {
    flex: 1 1 auto;
    min-width: min(100%, 148px);
    justify-content: center;
  }
  .upload-row {
    flex-direction: column;
    align-items: stretch;
  }
  .upload-row .vip-select,
  .upload-row select {
    width: 100%;
    min-height: 44px;
  }
  .upload-row .vip-btn,
  .upload-row #processBtn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
  .transport-row {
    gap: 8px;
  }
  .transport-row .vip-iconbtn {
    min-width: 44px;
    min-height: 44px;
  }
  /* Soften continuous card animations on mid-size phones */
  .panel.vip-card::before { animation-duration: 14s; opacity: 0.45; }
}

@media (max-width: 560px) {
  .time-readout { margin-left: 0; width: 100%; }
  .main-area { padding: 10px 12px max(48px, env(safe-area-inset-bottom)); gap: 12px; }
  .vip-hero { padding: 16px 12px 0; }
  .vip-hero__sub { font-size: var(--fs-base); }
  .panel { padding: 14px 14px; }
  .upload-zone { padding: 22px 14px; min-height: 168px; }
  .upload-sub { max-width: 28ch; }
  .titlebar-left { gap: 8px; min-width: 0; }
  .eng-mode-link { padding: 8px 10px; font-size: var(--fs-xs); }
  /* Kill heavy aurora + sheen on small screens (battery + first paint) */
  body::after {
    animation: none;
    opacity: 0.55;
    height: 40vh;
  }
  .panel.vip-card::before { animation: none; opacity: 0.35; }
  .panel:hover { box-shadow: var(--shadow-sm); }
}

@media (pointer: coarse) {
  .transport-seek {
    padding: 14px 0 12px;
    min-height: 44px;
    touch-action: manipulation;
  }
  .landing-seek-input {
    height: 28px;
  }
  .slider-hint-btn, .hint-example-pill {
    min-width: 44px;
    min-height: 44px;
  }
  .slider-hint-btn {
    width: 44px;
    height: 44px;
    line-height: 44px;
    font-size: 14px;
  }
  .hint-example-pill { padding: 10px 14px; font-size: var(--fs-xs); }
  /* Height carries the padding (border-box), so the content box — the painted
     track — stays 4px while the grab area grows to a full 44px on touch. */
  .slider-row input[type="range"] { height: 44px; padding: 20px 0; }

  /* 44×44 primary controls */
  .vip-tap,
  .btn,
  .vip-btn,
  .eng-mode-link,
  #browseBtn,
  #processBtn,
  #downloadBtn,
  #playBtn,
  #pauseBtn,
  #stopBtn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }
  .vip-switch {
    min-height: 44px;
    padding: 8px 10px;
  }
  .vip-btn--lg {
    min-height: 48px;
    padding: 12px 18px;
  }
  .upload-zone { touch-action: manipulation; }
}

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

/* ════════════════════════════════════════════════════════════════════════
   DESIGN-SYSTEM COMPONENTS  (VoiceIsolate Pro DS — _ds_bundle.js)
   Styling for the DS components wired into the Live-Mix surface by
   landing.js. ProcessLoader is styled above; these cover the rest of the
   bundle. Kept visually consistent with the native .btn / .panel house
   style so DS-rendered and native controls read as one UI.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Badge ────────────────────────────────────────────────────────────── */
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font: var(--fw-bold) var(--fs-3xs)/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-400);
  background: var(--red-wash);
  border: 1px solid var(--border-red);
  border-radius: var(--radius-sm);
  padding: 4px 7px;
  white-space: nowrap;
}
.vip-badge__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
}
.vip-badge--accent { color: var(--red-400); }
.vip-badge--ok     { color: var(--ok);  border-color: rgba(52,211,153,0.3);  background: rgba(52,211,153,0.07); }
.vip-badge--warn   { color: var(--warn); border-color: rgba(234,179,8,0.3);  background: rgba(234,179,8,0.07); }
.vip-badge--danger { color: var(--danger); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }

/* ── StatusPill — engine/process state with glowing dot (data-state) ───── */
.vip-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font: var(--fw-medium) var(--fs-sm)/1 var(--font-ui);
  color: var(--text-2);
}
.vip-pill::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--text-dim);
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.vip-pill[data-state="active"]  { color: var(--text-hi); }
.vip-pill[data-state="active"]::before  { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.vip-pill[data-state="warn"]::before    { background: var(--warn); box-shadow: 0 0 6px rgba(234,179,8,0.6); }
.vip-pill[data-state="error"]   { color: var(--text); }
.vip-pill[data-state="error"]::before   { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.6); }
.vip-pill[data-state="pending"]::before { background: var(--text-dim); }

/* ── Button ───────────────────────────────────────────────────────────── */
.vip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--fw-semibold) var(--fs-sm)/1 var(--font-ui);
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}
.vip-btn:hover:not(:disabled) {
  color: var(--text-hi);
  border-color: var(--border-red);
  background: var(--hover-fill);
}
.vip-btn:active:not(:disabled) { transform: translateY(0.5px); }
.vip-btn:disabled { opacity: 0.34; cursor: not-allowed; }
.vip-btn--primary {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.vip-btn--primary:hover:not(:disabled) { background: var(--red-500); border-color: var(--red-500); }
.vip-btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-hi);
}
.vip-btn--ghost:hover:not(:disabled) {
  border-color: var(--border-red);
  background: var(--hover-fill);
  color: var(--text-hi);
}
.vip-btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.vip-btn--sm { padding: 5px 10px; font-size: var(--fs-xs); }
.vip-btn--lg { padding: 12px 18px; font-size: var(--fs-md); min-height: 48px; }
.vip-btn--block { display: flex; width: 100%; justify-content: center; }
a.vip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.vip-btn--rec { border-color: var(--red-600); color: var(--red-400); }

/* ── IconButton ───────────────────────────────────────────────────────── */
.vip-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  font-size: var(--fs-md);
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}
.vip-iconbtn:hover:not(:disabled) { color: var(--text-hi); border-color: var(--border-red); background: var(--hover-fill); }
.vip-iconbtn:active:not(:disabled) { transform: translateY(0.5px); }
.vip-iconbtn:disabled { opacity: 0.34; cursor: not-allowed; }
.vip-iconbtn--sm { width: 28px; height: 28px; font-size: var(--fs-sm); }
.vip-iconbtn--lg { width: 40px; height: 40px; font-size: var(--fs-lg); }
.vip-iconbtn--active { border-color: var(--red-600); color: var(--red-400); background: var(--red-wash); }

/* ── Switch ───────────────────────────────────────────────────────────── */
.vip-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  color: var(--text-2);
  font: var(--fw-semibold) var(--fs-sm)/1 var(--font-ui);
}
.vip-switch:disabled { opacity: 0.34; cursor: not-allowed; }
.vip-switch__track {
  position: relative;
  width: 34px; height: 18px; flex: none;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.vip-switch__thumb {
  position: absolute;
  top: 1px; left: 1px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-dim);
  transition: transform var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.vip-switch--on .vip-switch__track { background: var(--red-wash); border-color: var(--red-600); }
.vip-switch--on .vip-switch__thumb { transform: translateX(16px); background: var(--red-500); }
.vip-switch--on .vip-switch__label { color: var(--red-400); }

/* ── Input / Field / Select ───────────────────────────────────────────── */
.vip-field { display: inline-flex; flex-direction: column; gap: 4px; }
.vip-field__label { font: var(--fw-medium) var(--fs-xs)/1 var(--font-ui); color: var(--text-dim); }
.vip-field__hint  { font: var(--fw-regular) var(--fs-2xs)/1.3 var(--font-ui); color: var(--text-dim); }
.vip-input, .vip-select {
  font: var(--fw-regular) var(--fs-base)/1 var(--font-ui);
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.vip-input:focus, .vip-select:focus { border-color: var(--border-focus); outline: none; }
.vip-input--mono { font-family: var(--font-mono); }

/* ── Card ─────────────────────────────────────────────────────────────── */
.vip-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ── Drag-and-drop upload panel ───────────────────────────────────────── */
#uploadPanel {
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.upload-panel--dragging {
  border-color: var(--border-focus) !important;
  background: var(--red-wash) !important;
  outline: 2px dashed var(--border-focus);
  outline-offset: -3px;
}
/*
 * FIX: Removed `pointer-events: none` from `.upload-panel--dragging *`.
 * That rule was accidentally disabling the fileInput during drag, which
 * meant dragover feedback worked but the drop handler's fileInput.click()
 * path was broken. The dragleave false-fire concern is handled by the
 * panel-level dragover/dragleave guards in landing.js instead.
 */
.vip-card--hover { transition: border-color var(--dur-base) var(--ease-out); }
.vip-card--hover:hover { border-color: var(--border-red); }
.vip-card--well { background: var(--well-bg); box-shadow: none; }
.vip-card__head { display: flex; align-items: flex-start; justify-content: space-between; padding: var(--sp-7) var(--sp-7) 0; }
.vip-card__kicker { margin: 0 0 4px; font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.vip-card__title { margin: 0; font: var(--fw-semibold) var(--fs-lg)/1.2 var(--font-ui); color: var(--text-hi); }

/* ── ParamSlider — signature red value-fill track ─────────────────────── */
.vip-slider__input {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    var(--red-600) 0,
    var(--red-500) var(--pct, 0%),
    rgba(255, 255, 255, 0.08) var(--pct, 0%),
    rgba(255, 255, 255, 0.08) 100%
  );
  cursor: pointer;
  transition: height 0.15s ease, box-shadow 0.15s ease;
}
.vip-slider__input:hover:not(:disabled) {
  height: 4px;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}
.vip-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: #fff;
  border: 2px solid var(--red-500);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}
.vip-slider__input::-moz-range-thumb {
  width: 11px; height: 11px; border: 2px solid var(--red-500); border-radius: 50%;
  background: #fff;
}
.vip-slider__input:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── LevelMeter — real output level (RMS fill + peak marker) ───────────── */
.vip-meter {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.vip-meter__label { font: var(--fw-medium) var(--fs-xs)/1 var(--font-ui); color: var(--text-dim); flex: none; }
.vip-meter__track {
  position: relative;
  flex: 1;
  height: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
}
.vip-meter__fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(to right, var(--ok), var(--warn) 78%, var(--danger));
  /* No width transition: the fill is driven every animation frame from JS, so
     a CSS transition would constantly restart and stutter behind the writes. */
}
.vip-meter__val { font: var(--fw-medium) var(--fs-2xs)/1 var(--font-mono); color: var(--text-2); flex: none; min-width: 42px; text-align: right; }

/* Output-level meter row in the Live-Mix panel (hidden until stems load). */
.output-meter { margin-top: 14px; }
.output-meter[hidden] { display: none; }

/* ── Level-matched A/B comparison ──────────────────────────────────────────
   Precision-instrument framing: a recessed well holding one arming action and
   a segmented Original/Cleaned pair. The armed side is lit with the live
   accent so the current reference is readable at a glance. Buttons are real
   <button>s driven by aria-pressed — state is never colour-only.
   ------------------------------------------------------------------------ */
.compare-row {
  margin: 14px 0 4px;
  padding: 14px;
  background: var(--well-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.compare-row__title {
  margin: 0 0 4px;
  font: var(--fw-semibold) var(--fs-xs)/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.compare-row .hint { margin-bottom: 10px; }
.compare-row__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
/* Segmented pair: one hairline between the two halves, outer corners rounded. */
.compare-row__ab {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.vip-btn--ab {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 36px;
  min-width: 92px;
  justify-content: center;
}
/* The segmented wrapper uses overflow:hidden for its rounded outer corners,
   which clips the global :focus-visible ring (outline-offset: 2px) on the two
   edge buttons — leaving keyboard users with no focus indicator there. Draw
   this one inside the button instead so it survives the clip. */
.vip-btn--ab:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
  border-radius: 0;
}
.compare-row__ab .vip-btn--ab + .vip-btn--ab { border-left: 1px solid var(--border-strong); }
.vip-btn--ab[aria-pressed="true"]:not(:disabled) {
  background: rgba(46, 213, 229, 0.14);
  border-color: var(--action-live);
  color: var(--text-hi);
  box-shadow: inset 0 -2px 0 0 var(--action-live);
}
.compare-row #comparisonStatus {
  margin: 10px 0 0;
  font-size: var(--fs-sm);
}
.compare-row #comparisonStatus:empty { display: none; }

/* Quick Clean stage line under the outcome picker. Colour reinforces the
   #uploadPanel[data-state] stage; the text itself always states the stage, so
   the colour is redundant rather than load-bearing. */
.quick-clean-status {
  margin: 0 0 14px;
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.quick-clean-status[data-state="error"] { color: var(--red-400); }
.quick-clean-status[data-state="processed"],
.quick-clean-status[data-state="exported"] { color: var(--ok); }

/* Phone: full-width targets, no horizontal overflow at 390px. */
@media (max-width: 560px) {
  .compare-row__controls { flex-direction: column; align-items: stretch; }
  .compare-row__ab { width: 100%; }
  .vip-btn--ab { flex: 1; min-width: 0; min-height: 44px; }
  #prepareComparisonBtn { width: 100%; justify-content: center; min-height: 44px; }
}
