/* =============================================================
   DESIGN DIRECTION v2 — "Creative Acoustic Studio"
   ---------------------------------------------------------------
   Superseding the earlier "instrument panel" direction per an
   explicit client spec (see /DESIGN.md for the full rationale):
   move away from an engineering-utility look toward a premium
   creative tool (Linear / Arc / Figma / Adobe Audition register).

   Key shifts from v1:
     - ONE reduced accent system (cyan -> purple gradient), not two
       functionally-split accents
     - Borders are rare; hierarchy comes from background contrast +
       spacing + soft shadows instead of hairlines everywhere
     - Generous whitespace (24/16/16/8/20px scale) replaces the
       dense, bezeled instrument-panel spacing
     - Cards, not framed "modules" with corner screws
     - The canvas/visualization is the largest, least-decorated
       element on screen; the sidebar is deliberately quieter
   ============================================================= */

:root {
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-hover: #1b1f25;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-hi: #f2f4f7;
  --text-mid: #9aa1ab;
  --text-low: #5c6470;

  --primary: #54d5ff;
  --primary-dim: rgba(84, 213, 255, 0.16);
  --secondary: #8e7dff;
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --danger: #ff5a5f;
  --danger-dim: rgba(255, 90, 95, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 20px;
  --sp-4: 24px;

  --font-ui: "Inter", "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text-hi);
  font-family: var(--font-ui);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---- Header ---- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  flex-shrink: 0;
  row-gap: var(--sp-1);
  padding: 14px var(--sp-4);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.app-header__mark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-hi);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.app-header__mark::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gradient);
}
.app-header__sep { color: var(--text-low); margin: 0 2px; font-weight: 400; }
.app-header__brand {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app-nav { flex: 1; display: flex; justify-content: center; }
.app-nav__link {
  color: var(--text-mid);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.app-nav__link:hover { color: var(--text-hi); background: var(--panel-hover); }

.app-nav--icons { gap: 6px; }
.app-nav__icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-mid);
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.app-nav__icon svg { width: 19px; height: 19px; }
.app-nav__icon:hover,
.app-nav__icon:focus-visible { color: var(--text-hi); background: var(--panel-hover); }
.app-nav__icon[aria-current="page"] { color: var(--primary); background: var(--primary-dim); }

.app-header__actions { display: flex; align-items: center; gap: var(--sp-1); position: relative; }

/* ---- Overflow ("more") menu — houses Import/Export/Reset so the
   header stays to a single clear primary action, per spec ---- */

.overflow-menu { position: relative; }
.overflow-menu__trigger {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-mid);
  cursor: pointer;
  font-size: 16px;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.overflow-menu__trigger:hover { background: var(--panel-hover); color: var(--text-hi); }
.overflow-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 6px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
}
.overflow-menu__panel[hidden] { display: none; }
.overflow-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 150ms var(--ease);
}
.overflow-menu__item:hover { background: var(--panel-hover); }
.overflow-menu__item.is-danger { color: var(--danger); }
.overflow-menu__item.is-danger:hover { background: var(--danger-dim); }

/* ---- Status lamp (CSD page) ---- */

.status-lamp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-low);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}
.status-lamp::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-low);
  margin-right: 6px;
}
.status-lamp.is-live { color: var(--primary); border-color: transparent; background: var(--primary-dim); }
.status-lamp.is-live::before { background: var(--primary); box-shadow: 0 0 6px 1px var(--primary); }

/* ---- Layout: visualization dominant, sidebar quieter/narrower ---- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--sp-2);
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--sp-2);
  background: var(--bg);
}

.panel { min-width: 0; min-height: 0; overflow-y: auto; }
.panel--canvas { display: flex; flex-direction: column; gap: var(--sp-1); min-height: 0; }
.panel--sidebar { display: flex; flex-direction: column; gap: var(--sp-1); min-height: 0; }

.canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: #08090b;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 88px 88px, 22px 22px;
}
#top-view-canvas:not([hidden]), #side-view-canvas:not([hidden]), #room3d-view-canvas:not([hidden]) { width: 100%; height: 100%; display: block; touch-action: none; }
#vehicle-canvas { width: 100%; height: 100%; display: block; touch-action: none; }

.badge--tbd {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-low);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  padding: 4px 10px;
}

.seat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1); }
.seat-btn {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-mid);
  font-size: 12px;
  cursor: pointer;
}
.seat-btn:hover { background: var(--panel-hover); }
.seat-btn.is-active { border-color: var(--accent, #54D5FF); color: var(--text-hi); background: var(--panel-hover); }

/* Transport progress bar (structure ported from speaker-studio-p0 mock,
   tokens mapped onto this app's existing --panel/--border-strong/--primary). */
.progress-row { display: flex; align-items: center; gap: var(--sp-1); }
.time { font-size: 11px; color: var(--text-mid); min-width: 38px; }
.time.mono { font-family: var(--font-mono); }
.time:last-child { text-align: right; }
.progress-track {
  flex: 1; height: 28px; border-radius: var(--radius-sm); position: relative; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border-strong); overflow: hidden;
}
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, var(--primary-dim), rgba(84, 213, 255, 0.06));
  border-right: 2px solid var(--primary); z-index: 2; pointer-events: none;
}
.progress-thumb {
  position: absolute; top: 50%; left: 0%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 8px rgba(84, 213, 255, 0.6); z-index: 3; pointer-events: none;
}

/* A/B/C Compare slots (structure ported from speaker-studio-p0 mock). */
.compare-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: var(--sp-1); }
.slot {
  height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-mid); font-size: 12px; font-weight: 600; cursor: pointer;
}
.slot:hover { background: var(--panel-hover); }
.slot.is-active { border-color: var(--primary); color: var(--text-hi); background: var(--primary-dim); }
.slot--flat { border-style: dashed; }
.ac-value { font-size: 11px; color: var(--text-mid); }

/* Playback source (album art / track / load buttons) — structure ported
   from the speaker-studio-p0 mock's .pb-source, tokens mapped onto this
   app's existing palette. */
.pb-source { display: flex; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-1); }
.album-art {
  width: 56px; height: 56px; border-radius: var(--radius-md); flex-shrink: 0;
  background: linear-gradient(135deg, var(--panel-hover), var(--panel));
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); position: relative; overflow: hidden;
}
.album-art img { width: 100%; height: 100%; object-fit: cover; }
.pb-track { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.pb-track-name { font-size: 13px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-load { display: flex; gap: 6px; }

/* Playlist (Load Folder result) */
.playlist {
  list-style: none; margin: 0 0 var(--sp-1); padding: 0;
  max-height: 160px; overflow-y: auto;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.playlist li {
  padding: 6px 10px; font-size: 12px; color: var(--text-mid); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid var(--border);
}
.playlist li:last-child { border-bottom: none; }
.playlist li:hover { background: var(--panel-hover); color: var(--text-hi); }
.playlist li.is-active { background: var(--primary-dim); color: var(--text-hi); font-weight: 600; }

/* FR graph hover readout (ported from mock's .graph-readout). */
.graph-readout[hidden] { display: none; }
.graph-readout {
  position: absolute; top: 12px; right: 52px;
  display: flex; gap: 12px; align-items: baseline;
  background: rgba(21, 24, 29, 0.75); backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 6px 12px;
  font-family: var(--font-mono); pointer-events: none;
}
.ro-freq { font-size: 12px; color: var(--text-hi); font-weight: 600; }
.ro-gain { font-size: 12px; color: var(--primary); }

/* Graph toolbar (mode buttons + Show FR Diff) — deliberately NOT
   .field-row here: that class's justify-content:space-between is meant
   for narrow 300px sidebar cards (label pinned left, control pinned
   right) and was stretching the mode buttons + diff checkbox across
   the full width of this much wider canvas panel, putting related
   controls far apart. This groups everything at flex-start instead. */
.graph-toolbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-1); flex-shrink: 0; }
.graph-toolbar__group { display: flex; gap: 6px; }
.graph-toolbar__check {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-mid); cursor: pointer; user-select: none;
}
.graph-toolbar__check:hover { color: var(--text-hi); }

/* Segmented control (ported from mock's .seg/.seg-btn). */
.seg { display: flex; gap: 4px; border-radius: var(--radius-sm); background: var(--panel); padding: 3px; margin-bottom: var(--sp-1); }
.seg-btn {
  flex: 1; padding: 6px 0; border: none; border-radius: 6px; background: transparent;
  color: var(--text-mid); font-size: 12px; font-weight: 600; cursor: pointer;
}
.seg-btn:hover { color: var(--text-hi); }
.seg-btn.is-on { background: var(--primary-dim); color: var(--text-hi); }

/* Driver tabs (Woofer/Midrange/Tweeter — ported from mock's .driver-tabs/.drv-tab). */
.driver-tabs { display: flex; gap: 4px; margin-bottom: var(--sp-1); }
.drv-tab {
  flex: 1; padding: 8px 0; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-mid); font-size: 12px; font-weight: 600; cursor: pointer;
}
.drv-tab:hover { background: var(--panel-hover); }
.drv-tab.is-active { border-color: var(--primary); color: var(--text-hi); background: var(--primary-dim); }

/* Vehicle speaker list (grouped, on/off toggle per speaker — ported
   from the Vehicle mock's #speakerList / .spk-item structure). */
.vehicle-speaker-list { max-height: 320px; overflow-y: auto; }
.vehicle-speaker-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-low); margin: var(--sp-1) 0 4px;
}
.vehicle-speaker-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer;
}
.vehicle-speaker-item:hover { background: var(--panel-hover); }
.vehicle-speaker-item.is-selected { background: var(--primary-dim); }
.vehicle-speaker-item__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.vehicle-speaker-item.is-off .vehicle-speaker-item__dot { background: var(--text-low) !important; box-shadow: none !important; }
.vehicle-speaker-item__info { flex: 1; min-width: 0; }
.vehicle-speaker-item__name { font-size: 12px; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-speaker-item__sub { font-size: 10px; color: var(--text-low); }
.vehicle-speaker-item__state {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-mid);
}
.vehicle-speaker-item.is-off .vehicle-speaker-item__state { opacity: 0.5; }
.vehicle-speaker-item:not(.is-off) .vehicle-speaker-item__state { color: var(--primary); border-color: var(--primary); }
#csd-view-canvas:not([hidden]) { width: 100%; height: 100%; display: block; touch-action: none; }
#graph-view-canvas:not([hidden]) { width: 100%; height: 100%; display: block; cursor: grab; }
#profile-fr-canvas { width: 100%; height: 100%; display: block; }

.hint { color: var(--text-low); font-size: 11px; margin: 2px 2px 0; flex-shrink: 0; }
.hint--note { color: var(--text-low); opacity: 0.8; line-height: 1.5; max-width: 70ch; }

.heatmap-controls { justify-content: flex-start; gap: var(--sp-2); margin-top: var(--sp-1); }
.heatmap-controls__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-mid);
  font-size: 12px;
  cursor: pointer;
}
#heatmap-freq-input { width: 88px; }
#heatmap-freq-input:disabled { opacity: 0.4; }

/* ---- View switcher: bigger touch targets, glow when active ---- */

.view-switch {
  display: inline-flex;
  gap: 4px;
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
  flex-shrink: 0;
}
.view-switch__btn {
  min-height: 44px;
  min-width: 64px;
  background: transparent;
  color: var(--text-mid);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 var(--sp-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.view-switch__btn:hover { color: var(--text-hi); }
.view-switch__btn.is-active {
  background: var(--primary-dim);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(84, 213, 255, 0.35), 0 0 16px rgba(84, 213, 255, 0.25);
}

/* ---- Cards (collapsible sections) — replaces the old bezeled
   "module" with corner screws + dashed meter-tick header ---- */

.card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  width: 100%;
  padding: var(--sp-2);
  background: transparent;
  border: none;
  color: var(--text-hi);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.card__header:hover { background: var(--panel-hover); }
.card__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card__header-extra { display: flex; align-items: center; gap: var(--sp-1); }
.card__chevron {
  color: var(--text-low);
  transition: transform 200ms var(--ease);
  font-size: 10px;
}
.card.is-collapsed .card__chevron { transform: rotate(-90deg); }
.card__body {
  padding: 0 var(--sp-2) var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.card.is-collapsed .card__body { display: none; }

/* ---- Form fields ---- */

.field-row[hidden] { display: none; }
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-shrink: 0;
}
.field-row label, .field-row .field-row__static-label { color: var(--text-mid); font-size: 12px; }

.field-row input[type="number"], .field-row select {
  background: var(--bg);
  color: var(--text-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  width: 108px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms var(--ease);
}
.field-row select { font-family: var(--font-ui); }

#glossary-term-select {
  width: 100%;
  background: var(--bg);
  color: var(--text-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: var(--font-ui);
  font-size: 12.5px;
}
#glossary-description { line-height: 1.6; }

.readout {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--secondary);
}
.field-row input:focus, .field-row select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Custom file picker: hides the native <input type=file> entirely so
   its un-stylable, non-wrapping default label text ("no file chosen")
   can't overflow the sidebar — see ROADMAP.md's changelog. */
.file-picker { display: flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.file-picker input[type="file"] { display: none; }
.file-picker__name {
  color: var(--text-mid);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

/* ---- Buttons: clear primary/secondary/danger hierarchy ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 var(--sp-2);
  background: var(--panel-hover);
  color: var(--text-hi);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 100ms var(--ease), background 150ms var(--ease), box-shadow 150ms var(--ease);
}
.btn:hover { background: var(--panel); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn--small { height: 30px; padding: 0 12px; font-size: 11.5px; }
.btn--icon-only { width: 36px; padding: 0; }

.btn--primary {
  background: var(--gradient);
  color: #06121a;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(84, 213, 255, 0.25);
}
.btn--primary:hover { filter: brightness(1.08); box-shadow: 0 6px 24px rgba(84, 213, 255, 0.35); }

.btn--secondary { background: transparent; border: 1px solid var(--border-strong); color: var(--text-hi); }
.btn--secondary:hover { background: var(--panel-hover); }

.btn--danger { background: transparent; border: 1px solid rgba(255, 90, 95, 0.35); color: var(--danger); }
.btn--danger:hover { background: var(--danger-dim); }

/* ---- Speaker table: icon-style swatch prefix, stronger selection ---- */

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  color: var(--text-low);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px 8px;
}
.table td { padding: 8px; font-size: 12.5px; color: var(--text-mid); }
#speaker-table td { color: var(--text-hi); display: flex; align-items: center; gap: 8px; }
.table tbody tr {
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 150ms var(--ease);
}
.table tbody tr:hover { background: var(--panel-hover); }
.table tbody tr.selected {
  background: var(--primary-dim);
  box-shadow: inset 2px 0 0 var(--primary);
}
.table tbody tr.selected td:first-child { color: var(--text-hi); font-weight: 600; }

/* Signature element carried over from v1: each speaker's color as an
   indicator lamp (glow halo) rather than a flat swatch — this stays,
   since it directly embodies the app's core interaction (telling
   speakers apart by color), unlike the bezel/screw framing it lived in. */
.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 8px 1px currentColor;
  transition: transform 150ms var(--ease), filter 150ms var(--ease);
}
.color-swatch:hover { transform: scale(1.15); filter: brightness(1.15); }
.color-swatch--lg { width: 26px; height: 26px; }

/* ---- Detail panel ---- */

.detail-panel { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-1); }

/* ---- EQ bands ---- */

.eq-bands {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.eq-band { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; }
.eq-band__label { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-low); }
.eq-band__slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 18px;
  height: 120px;
  accent-color: var(--primary);
  background: transparent;
}
.eq-band__value {
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  min-height: 1.2em;
}

.app-header__home {
  color: inherit;
  text-decoration: none;
}
.app-header__home:hover,
.app-header__home:focus-visible { color: var(--primary); }

/* ---- Micro-interactions ---- */

.card__body { animation: card-in 200ms var(--ease); }
@keyframes card-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 800px) {
  html, body { overflow: auto; }
  body { display: block; }
  .layout { grid-template-columns: 1fr; grid-auto-rows: min-content; flex: none; padding: var(--sp-1); gap: var(--sp-1); }
  .panel--canvas { height: 66vh; }
  .app-nav { order: 3; width: 100%; justify-content: flex-start; }
}

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

/* ==========================================================================
   Welcome / landing page (welcome.html)
   ========================================================================== */

.welcome-body { display: block; height: auto; min-height: 100%; overflow-y: auto; }

.welcome {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px var(--sp-3) 64px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-bottom: 48px;
}

.welcome-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: var(--sp-3);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), background 160ms var(--ease);
}
.welcome-card:hover,
.welcome-card:focus-visible {
  border-color: var(--border-strong);
  background: var(--panel-hover);
  transform: translateY(-2px);
}
.welcome-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.welcome-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.welcome-card__icon svg { width: 100%; height: 100%; }
.welcome-card__title {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  color: var(--text-hi);
}
.welcome-card__desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-mid);
  margin: 0;
  flex: 1;
}
.welcome-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.welcome-card__tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary-dim);
  color: var(--primary);
}
.welcome-card__enter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 6px;
}
.welcome-card:hover .welcome-card__enter,
.welcome-card:focus-visible .welcome-card__enter { color: var(--primary); }

.welcome-note {
  display: flex;
  gap: 12px;
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(84, 213, 255, 0.05);
}
.welcome-note__mark { font-family: var(--font-mono); color: var(--primary); font-size: 13px; }
.welcome-note__body { font-size: 13.5px; line-height: 1.6; color: var(--text-mid); margin: 0; }
.welcome-note__body strong { color: var(--text-hi); font-weight: 600; }

@media (max-width: 800px) {
  .welcome-grid { grid-template-columns: 1fr; }
  .welcome { padding-top: 32px; }
}
