/* =============================================================================
   Vokal by DSK — styles.css
   Neon-but-pro audio editor. Themes via [data-theme]. Mobile-vertical first.
   Tokens forked from the Parkour design system, tuned for a DAW.
   ========================================================================== */

/* ----------------------------- THEME TOKENS ------------------------------ */
:root {
  --font-ui: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Chakra Petch", ui-monospace, "SFMono-Regular", monospace;

  --fw-light: 300; --fw-reg: 400; --fw-med: 500; --fw-semi: 600; --fw-bold: 700;
  --ls-label: 1.5px; --ls-wide: 2.5px;

  --radius-xs: 4px; --radius-sm: 6px; --radius-md: 10px;
  --radius-lg: 14px; --radius-xl: 20px; --radius-pill: 999px;

  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 360ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-touch: 44px;

  /* fixed neon signal colors (consistent meaning across themes) */
  --neon-green: #00ff7a;   /* in-tune / go / success */
  --neon-cyan:  #39e6d6;   /* UI accent / what to tap */
  --neon-amber: #ffd24a;   /* active note / reward */
  --neon-red:   #ff4d5e;   /* danger / off-pitch / record */
  --neon-violet:#b98cff;   /* secondary data */
}

/* ---- DARK (asphalt) — default ---- */
:root, [data-theme="dark"] {
  --bg:        #16181a;
  --bg-2:      #1d2023;
  --surface:   #232629;
  --raised:    #2b2f33;
  --line:      #34393e;
  --line-soft: #2a2e32;
  --text:      #f2f5f4;
  --text-mut:  #9aa3a1;
  --text-faint:#646d6b;
  --accent:    var(--neon-cyan);
  --good:      var(--neon-green);
  --warn:      var(--neon-amber);
  --bad:       var(--neon-red);
  --grid-line: rgba(255,255,255,0.045);
  --grid-strong: rgba(255,255,255,0.10);
  --roll-bg:   #16191c;
  --glow: 0.55;
  --shadow-1: 0 2px 8px rgba(0,0,0,0.45);
  --shadow-2: 0 8px 28px rgba(0,0,0,0.55);
  --shadow-3: 0 18px 50px rgba(0,0,0,0.65);
  --scrim: rgba(8,10,11,0.82);
}

/* ---- LIGHT ---- */
[data-theme="light"] {
  --bg:        #eef1f0;
  --bg-2:      #e4e8e7;
  --surface:   #f7f9f8;
  --raised:    #ffffff;
  --line:      #d3dad8;
  --line-soft: #e2e7e5;
  --text:      #14201d;
  --text-mut:  #5a6764;
  --text-faint:#8b9794;
  --accent:    #0aa794;
  --good:      #04a35a;
  --warn:      #c98800;
  --bad:       #e23044;
  --grid-line: rgba(20,32,29,0.06);
  --grid-strong: rgba(20,32,29,0.13);
  --roll-bg:   #f1f4f3;
  --glow: 0.18;
  --shadow-1: 0 2px 8px rgba(60,80,75,0.14);
  --shadow-2: 0 10px 28px rgba(60,80,75,0.18);
  --shadow-3: 0 18px 46px rgba(60,80,75,0.22);
  --scrim: rgba(40,55,52,0.45);
}

.glow-green { box-shadow: 0 0 14px rgba(0,255,122,calc(var(--glow))); }

/* -------------------------------- RESET ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  touch-action: pan-y;            /* allow vertical scroll, block pinch zoom */
}
body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;       /* no pull-to-refresh */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; -webkit-user-select: text; user-select: text; }
canvas { display: block; touch-action: none; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* -------------------------------- LAYOUT --------------------------------- */
#app {
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
@media (min-width: 760px) {
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: var(--shadow-3); }
}

/* -------------------------------- TOPBAR --------------------------------- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: calc(env(safe-area-inset-top) + 10px) var(--space-4) 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--bg-2), var(--bg));
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand__logo { width: 30px; height: 30px; border-radius: 8px; box-shadow: var(--shadow-1); }
.brand__name {
  font-weight: var(--fw-bold);
  font-size: 17px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  line-height: 1;
}
.brand__name b { color: var(--good); text-shadow: 0 0 12px rgba(0,255,122,calc(var(--glow)*0.8)); }
.brand__sub { display: block; font-size: 8.5px; letter-spacing: 3px; color: var(--text-faint); margin-top: 3px; font-weight: var(--fw-semi); }

.iconbtn {
  width: var(--space-touch); height: var(--space-touch);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 19px;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast);
}
.iconbtn:hover { border-color: var(--accent); }
.iconbtn:active { transform: scale(0.92); }
.iconbtn svg { width: 21px; height: 21px; }

/* -------------------------------- TABS ----------------------------------- */
.tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  padding: var(--space-2) var(--space-4) 0;
  background: var(--bg);
}
.tab {
  flex: 1;
  min-height: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11.5px; font-weight: var(--fw-semi);
  text-transform: uppercase; letter-spacing: var(--ls-label);
  color: var(--text-mut);
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.tab svg { width: 16px; height: 16px; }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab[disabled] { opacity: 0.35; pointer-events: none; }

/* -------------------------------- STAGE ---------------------------------- */
.stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--space-4);
}
.view { display: none; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.view.is-active { display: flex; }

.vizcard {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--roll-bg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.vizcard canvas { width: 100%; height: 100%; }

/* empty / placeholder state */
.empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-3); text-align: center; padding: var(--space-6);
  color: var(--text-mut);
}
.empty__ico { font-size: 40px; opacity: 0.8; filter: grayscale(0.1); }
.empty h3 { margin: 0; font-size: 15px; color: var(--text); letter-spacing: 0.5px; }
.empty p { margin: 0; font-size: 12.5px; max-width: 32ch; line-height: 1.5; }
.empty.hidden { display: none; }

/* live recording chip */
.reclive {
  position: absolute; top: 10px; left: 10px;
  display: none; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.5); border: 1px solid var(--bad);
  font-size: 11px; font-weight: var(--fw-bold); letter-spacing: 1.5px; color: var(--bad);
  backdrop-filter: blur(4px);
}
.reclive.on { display: inline-flex; }
.reclive .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: blink 1s steps(2,start) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* piano-roll layer labels */
.rollinfo {
  position: absolute; right: 10px; top: 10px;
  display: flex; gap: 12px;
  padding: 6px 10px; border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.42); backdrop-filter: blur(4px);
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-mut);
  pointer-events: none;
}
.rollinfo .k { display: inline-flex; align-items: center; gap: 5px; }
.rollinfo .sw { width: 14px; height: 4px; border-radius: 2px; }

/* playhead */
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--warn); box-shadow: 0 0 10px var(--warn); pointer-events: none; transform: translateX(-50%); display: none; }
.playhead.on { display: block; }

/* roll toolbar (undo/redo/zoom) */
.rolltools {
  position: absolute; top: 8px; left: 8px; z-index: 4;
  display: flex; align-items: center; gap: 3px;
  padding: 4px; border-radius: var(--radius-md);
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  border: 1px solid var(--line-soft);
}
[data-theme="light"] .rolltools { background: rgba(255,255,255,0.78); }
.rtool {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text); background: transparent;
  transition: background var(--dur-fast), opacity var(--dur-fast), transform var(--dur-fast);
}
.rtool svg { width: 17px; height: 17px; }
.rtool:hover { background: rgba(255,255,255,0.10); }
[data-theme="light"] .rtool:hover { background: rgba(0,0,0,0.06); }
.rtool:active { transform: scale(0.9); }
.rtool[disabled] { opacity: 0.28; pointer-events: none; }
.rtool-sep { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }

/* roll horizontal scrollbar — shown on PC only (finger-pan on touch) */
.rollscroll {
  position: absolute; left: 36px; right: 8px; bottom: 6px; height: 10px; z-index: 4;
  border-radius: var(--radius-pill); background: rgba(0,0,0,0.35); display: none;
}
[data-theme="light"] .rollscroll { background: rgba(0,0,0,0.12); }
.rollscroll.on { display: block; }
.rollscroll__thumb {
  position: absolute; top: 0; height: 100%; min-width: 26px;
  border-radius: var(--radius-pill); background: var(--accent); opacity: 0.65;
  cursor: grab; box-shadow: 0 0 8px rgba(57,230,214,calc(var(--glow)*0.5));
}
.rollscroll__thumb:hover { opacity: 0.85; }
.rollscroll__thumb:active { cursor: grabbing; opacity: 1; }
@media (hover: none), (pointer: coarse) {
  .rollscroll { display: none !important; }
}
@media (max-width: 380px) {
  .rollinfo { display: none; }
}

/* -------------------------------- CONTROLS ------------------------------- */
.controls {
  flex: 0 0 auto;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.ctl-row { display: flex; align-items: center; gap: var(--space-3); }
.ctl-label { font-size: 9.5px; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-faint); font-weight: var(--fw-semi); }

/* segmented control */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 3px; gap: 3px; }
.seg button {
  min-height: 34px; padding: 0 12px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: var(--fw-semi); letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--text-mut); white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.seg button.is-active { background: var(--accent); color: #05201d; }
[data-theme="light"] .seg button.is-active { color: #fff; }

/* select pill */
.pill {
  min-height: 38px; padding: 0 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; font-weight: var(--fw-semi); letter-spacing: 0.5px;
  display: inline-flex; align-items: center; gap: 8px;
}
.pill select {
  background: transparent; border: none; color: var(--text); font: inherit; font-weight: var(--fw-semi);
  outline: none; padding-right: 4px;
}
.pill select option { background: var(--surface); color: var(--text); }

/* custom select (replaces native <select>) */
.csel { position: relative; display: inline-flex; }
.csel__btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 8px 0 11px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-ui); font-size: 13px; font-weight: var(--fw-semi); letter-spacing: 0.3px;
  transition: border-color var(--dur-fast);
}
.csel__btn svg { width: 14px; height: 14px; opacity: 0.65; transition: transform var(--dur-fast); }
.csel.open .csel__btn { border-color: var(--accent); }
.csel.open .csel__btn svg { transform: rotate(180deg); }
.csel__val { white-space: nowrap; }
.csel__menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 100%; max-height: 232px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-3); padding: 5px; display: none;
}
.csel.up .csel__menu { top: auto; bottom: calc(100% + 6px); }
.csel.open .csel__menu { display: block; }
.csel__opt {
  display: block; width: 100%; text-align: left; white-space: nowrap;
  min-height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: var(--fw-med); color: var(--text);
}
.csel__opt:hover { background: var(--raised); }
.csel__opt.sel { background: var(--accent); color: #05201d; font-weight: var(--fw-bold); }
[data-theme="light"] .csel__opt.sel { color: #fff; }

/* settings modal rows */
.set-sec { margin-bottom: 16px; }
.set-label { font-size: 10px; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-faint); font-weight: var(--fw-semi); margin-bottom: 8px; }
.set-seg { display: flex; width: 100%; }
.set-seg button { flex: 1; justify-content: center; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-row > span { font-size: 13.5px; font-weight: var(--fw-med); }
.set-sec .csel, .set-sec .csel__btn { width: 100%; }
.set-sec .csel__btn { justify-content: space-between; min-height: 40px; }

/* switch toggle */
.switch {
  width: 46px; height: 27px; border-radius: var(--radius-pill); flex: 0 0 auto;
  background: var(--line); border: 1px solid var(--line); position: relative; transition: background var(--dur-base);
}
.switch__k { position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: var(--text-mut); transition: transform var(--dur-base) var(--ease-out), background var(--dur-base); }
.switch.on { background: color-mix(in srgb, var(--good) 35%, var(--bg)); border-color: var(--good); }
.switch.on .switch__k { transform: translateX(19px); background: var(--good); box-shadow: 0 0 8px var(--good); }

/* knob */
.knob-wrap { display: flex; align-items: center; gap: var(--space-3); }
.knob {
  width: 56px; height: 56px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 50% 38%, var(--raised), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.05);
  touch-action: none; flex: 0 0 auto;
}
.knob::after {
  content: ""; position: absolute; left: 50%; top: 8px; width: 3px; height: 16px;
  border-radius: 2px; background: var(--accent); transform-origin: 50% 20px;
  box-shadow: 0 0 8px rgba(57,230,214,calc(var(--glow)));
  transform: translateX(-50%) rotate(var(--knob-rot, -135deg));
}
.knob__ring { position: absolute; inset: -4px; }
.knob-meta { display: flex; flex-direction: column; gap: 2px; }
.knob-meta .v { font-size: 15px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.knob-meta .t { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); }

/* small toggle button */
.tgl {
  min-height: 38px; padding: 0 14px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--text-mut);
  font-size: 11px; font-weight: var(--fw-bold); letter-spacing: var(--ls-label); text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px; transition: all var(--dur-fast);
}
.tgl.on { border-color: var(--good); color: var(--good); box-shadow: 0 0 14px rgba(0,255,122,calc(var(--glow)*0.5)); }
.tgl .led { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.tgl.on .led { background: var(--good); box-shadow: 0 0 8px var(--good); }

.spacer { flex: 1 1 auto; }

/* -------------------------------- TRANSPORT ------------------------------ */
.transport {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  align-items: end;
  padding: var(--space-3) var(--space-4) calc(env(safe-area-inset-bottom) + 10px);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.tbtn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 4px; border-radius: var(--radius-md);
  color: var(--text-mut); transition: color var(--dur-fast), background var(--dur-fast);
}
.tbtn svg { width: 24px; height: 24px; }
.tbtn span { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; font-weight: var(--fw-semi); }
.tbtn:hover { color: var(--text); }
.tbtn:active { background: var(--surface); }
.tbtn[disabled] { opacity: 0.3; pointer-events: none; }
.tbtn.is-active { color: var(--accent); }

/* primary record button (centered, larger) */
.tbtn--rec { position: relative; }
.recdisc {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--bad); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.4), 0 0 16px rgba(255,77,94,calc(var(--glow)));
  transition: transform var(--dur-fast) var(--ease-out), border-radius var(--dur-base) var(--ease-out);
}
.recdisc::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: all var(--dur-base) var(--ease-out); }
.tbtn--rec.recording .recdisc { animation: recpulse 1.4s ease-in-out infinite; }
.tbtn--rec.recording .recdisc::before { width: 16px; height: 16px; border-radius: 3px; }
@keyframes recpulse { 50% { box-shadow: 0 4px 0 rgba(0,0,0,0.4), 0 0 28px rgba(255,77,94,1); } }
.tbtn--rec span { color: var(--bad); }

/* -------------------------------- FOOTER --------------------------------- */
.footer {
  flex: 0 0 auto;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 8px);
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
}
.footer a { color: var(--accent); text-decoration: none; font-weight: var(--fw-bold); }
.footer a:hover { text-decoration: underline; }

/* -------------------------------- MODALS --------------------------------- */
.modal-root { position: fixed; inset: 0; z-index: 80; display: none; }
.modal-root.open { display: block; }
.modal-scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(5px); animation: fade var(--dur-base) var(--ease-out); }
.modal {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-3);
  padding: var(--space-5) var(--space-5) calc(env(safe-area-inset-bottom) + 20px);
  animation: sheet var(--dur-slow) var(--ease-pop);
}
@media (min-width: 560px) {
  .modal { bottom: auto; top: 50%; transform: translate(-50%,-50%); border-radius: var(--radius-xl); border-bottom: 1px solid var(--line); animation: pop var(--dur-base) var(--ease-pop); }
}
.modal__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -6px auto 14px; }
.modal__ico { font-size: 26px; margin-bottom: 8px; }
.modal h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: 0.5px; }
.modal p { margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--text-mut); }
.modal__actions { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
.modal__body { margin-bottom: 18px; }

.btn {
  min-height: var(--space-touch); padding: 0 18px; border-radius: var(--radius-md);
  font-weight: var(--fw-bold); font-size: 13px; letter-spacing: var(--ls-label); text-transform: uppercase;
  background: var(--raised); color: var(--text); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast), background var(--dur-fast);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); }
.btn--primary { background: var(--accent); color: #05201d; border-color: transparent; }
[data-theme="light"] .btn--primary { color: #fff; }
.btn--good { background: var(--good); color: #05201d; border-color: transparent; box-shadow: 0 0 16px rgba(0,255,122,calc(var(--glow)*0.6)); }
[data-theme="light"] .btn--good { color: #fff; }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }

/* radio list inside modals */
.optlist { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--bg-2);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.opt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); }
.opt__r { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-faint); flex: 0 0 auto; position: relative; }
.opt.sel .opt__r { border-color: var(--accent); }
.opt.sel .opt__r::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.opt__t { font-size: 13.5px; font-weight: var(--fw-semi); }
.opt__d { font-size: 11px; color: var(--text-mut); margin-top: 2px; }
.opt .opt__txt { display: flex; flex-direction: column; }
.opt__ico { font-size: 18px; }

/* progress */
.prog { height: 8px; border-radius: var(--radius-pill); background: var(--bg); overflow: hidden; margin-top: 4px; border: 1px solid var(--line); }
.prog__fill { height: 100%; width: 0%; background: var(--accent); border-radius: var(--radius-pill); transition: width 120ms linear; }

/* theme swatches */
.themegrid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.themecard {
  border-radius: var(--radius-md); border: 1px solid var(--line); overflow: hidden; text-align: center;
  background: var(--bg-2); padding-bottom: 8px; transition: border-color var(--dur-fast);
}
.themecard.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.themecard__sw { height: 56px; display: flex; }
.themecard__sw i { flex: 1; }
.themecard__name { font-size: 11px; font-weight: var(--fw-bold); letter-spacing: 1px; text-transform: uppercase; margin-top: 7px; }

/* -------------------------------- TOAST ---------------------------------- */
.toast-root { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto;
  background: var(--raised); border: 1px solid var(--line); color: var(--text);
  padding: 11px 16px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: var(--fw-semi);
  box-shadow: var(--shadow-2); display: inline-flex; align-items: center; gap: 9px;
  animation: toastin var(--dur-base) var(--ease-pop);
  max-width: min(90vw, 420px);
}
.toast .i { font-size: 15px; }
.toast.good { border-color: var(--good); } .toast.good .i { color: var(--good); }
.toast.bad { border-color: var(--bad); } .toast.bad .i { color: var(--bad); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%,-46%) scale(0.96); } }
@keyframes sheet { from { transform: translate(-50%, 18px); } }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; }
}

/* hidden helper */
.hidden { display: none !important; }
