/* =============================================================================
 * app.css - TriviaWorks Capture - "Spotify Car Thing" direction.
 *
 * Flat near-black. ONE luminous gold circular capture control (the disc is the
 * knob; press = bookmark). Huge clean type, vast negative space, restrained gold
 * #FFC400 as the only accent. Plus Jakarta Sans + JetBrains Mono timecodes.
 *
 * LANDSCAPE (dash-mount) is the hero: a slim LEFT RAIL nav + a two-column Listen
 * view (show identity + transport on the left, the gold disc on the right).
 * PORTRAIT (handheld) is a vertical stack with a bottom tab bar.
 *
 * Every id/class the JS touches is preserved. Notably:
 *   - #tapTarget keeps its class .tap-target (restyled into the gold disc) and
 *     still receives .flash / .rippling from app.js.
 *   - the .play-ring SVG (#ringFill) stays in the DOM, kept hidden; #progressFill
 *     carries the playhead knob; #scrubber overlays the bar to seek.
 *   - .bottomnav / .nav-btn[data-view], .ep*, .cap*, .pill, .toast, .sheet all
 *     keep the names app.js reads/writes.
 * ========================================================================== */
:root {
  --bg:        #070809;
  --screen:    #0A0B0E;
  --panel:     #121419;
  --panel-2:   #181B22;
  --line:      rgba(255,255,255,.08);
  --line-2:    rgba(255,255,255,.14);

  --ink:       #F4F1E9;  /* primary warm near-white */
  --ink-2:     #9AA1AD;  /* secondary               */
  --ink-mut:   #5B626E;  /* tertiary / muted        */

  --gold:      #FFC400;  /* the only accent         */
  --gold-2:    #FFD45A;
  --gold-dim:  #8A6B12;
  --red:       #FF463B;
  --ok:        #2BD67B;
  --voice:     #C9A6FF;  /* voice memo hue          */
  --note:      #7FD6E8;  /* text note hue           */

  /* app.js maps sync states onto these (kept as aliases) */
  --warn:      var(--gold-2);
  --error:     var(--red);

  --r-sm: 8px;
  --r:    13px;
  --r-lg: 16px;
  --pad:  22px;
  --tap:  52px;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* set by app.js to the active show's artwork (used as a faint atmospheric pool) */
  --show-art-url: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overscroll-behavior: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  /* flat near-black with a single warm low-centre pool of "stage light" */
  background:
    radial-gradient(ellipse 80% 42% at 50% 116%, rgba(255,196,0,.10), transparent 70%),
    radial-gradient(circle at 50% -8%, #16181d, transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
  padding-top: env(safe-area-inset-top);
  /* room for the fixed bottom tab bar (portrait) */
  padding-bottom: calc(66px + env(safe-area-inset-bottom));
}

/* The eyebrow label used across views */
.eyebrow {
  display: block;
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--ink-mut);
}

/* =============================================================================
 * STAGE + STATUS STRIP
 * ========================================================================== */
.stage { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; }
.statusbar {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad) 6px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #16120a;
  font-weight: 800; font-size: 12px; letter-spacing: .3px;
  padding: 3px 7px; border-radius: 6px;
}
.brand-name { font-weight: 700; letter-spacing: .2px; color: var(--ink-2); font-size: 14px; }
.status { display: flex; gap: 7px; }
.pill {
  font-size: 11px; padding: 5px 11px; border-radius: 999px;
  background: var(--panel); color: var(--ink-2);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-weight: 600;
}
.pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-mut); flex: 0 0 auto;
}
.pill.ok   { color: var(--ok); }
.pill.ok::before   { background: var(--ok); }
.pill.warn { color: var(--gold-2); }
.pill.warn::before { background: var(--gold-2); }

/* =============================================================================
 * VIEWS
 * ========================================================================== */
.views { flex: 1; min-height: 0; position: relative; }
.view {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  padding: 6px var(--pad) var(--pad); gap: 16px; overflow-y: auto;
}
.view.active { display: flex; animation: viewIn .3s cubic-bezier(.22,.61,.36,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } * { scroll-behavior: auto; } }

/* =============================================================================
 * LISTEN (player) - the now-playing hero. Single column (portrait) -> the disc
 * sits below the identity + transport. Landscape splits into two columns.
 * ========================================================================== */
#view-player { gap: 22px; }
.listen-left  { display: flex; flex-direction: column; gap: 22px; }
.listen-right { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* show identity block ------------------------------------------------------- */
.now-card { display: flex; align-items: center; gap: 15px; }
.now-artwork {
  position: relative; width: 64px; height: 64px; flex: 0 0 auto;
  border-radius: var(--r); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #1d2027, #101218);
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.now-artmark {
  font-weight: 800; font-size: 19px; letter-spacing: .5px; line-height: 1;
  background: linear-gradient(160deg, var(--gold-2), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* the per-show monogram caption is redundant beside the title here - hide it,
   but keep the node (app.js writes #nowMono) */
.now-artmono { display: none; }
.now { min-width: 0; }
.now-show { margin-bottom: 6px; color: var(--ink-mut); }
.now-episode {
  font-size: 28px; font-weight: 800; letter-spacing: -.4px; line-height: 1.05;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-date { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }

/* transport ----------------------------------------------------------------- */
.transport { display: flex; flex-direction: column; gap: 12px; }
.times {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--ink-mut); font-variant-numeric: tabular-nums;
}
.progress {
  position: relative; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,.12); margin: 0;
}
.progress-fill {
  position: relative; height: 100%; width: 0;
  background: var(--gold); border-radius: 999px;
  transition: width .12s linear;
}
/* playhead knob rides the end of the fill */
.progress-fill::after {
  content: ""; position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.55);
}
/* transparent range overlay -> drag anywhere on the bar to seek */
.scrubber {
  display: block; width: 100%; height: 24px; margin: -14px 0 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.scrubber::-webkit-slider-runnable-track { background: transparent; height: 24px; }
.scrubber::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: transparent; }
.scrubber::-moz-range-track { background: transparent; height: 24px; }
.scrubber::-moz-range-thumb { width: 24px; height: 24px; border: none; border-radius: 50%; background: transparent; }

.transport-btns { display: flex; align-items: center; justify-content: center; gap: 34px; margin-top: 2px; }
.t-btn {
  position: relative; background: none; border: 0; color: var(--ink); cursor: pointer;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s, color .12s;
}
.t-btn svg { width: 30px; height: 30px; }
.t-btn:active { transform: scale(.9); color: var(--gold); }
.t-num {
  position: absolute; top: 53%; left: 50%; transform: translate(-50%,-50%);
  font-family: var(--mono); font-size: 8.5px; font-weight: 700; color: var(--ink-2);
}
/* the play-ring SVG is kept in the DOM for the JS, but not shown (minimalist) */
.play-wrap { position: relative; width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.play-ring { display: none; }
.t-btn.play {
  position: relative; z-index: 1;
  width: 62px; height: 62px;
  border: 1.5px solid var(--line-2); background: rgba(255,255,255,.03);
  color: var(--ink); border-radius: 50%; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.t-btn.play:active { transform: scale(.92); color: var(--gold); }

/* =============================================================================
 * THE DISC - the one luminous object (#tapTarget keeps .tap-target).
 * ========================================================================== */
.capwrap {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  width: 100%;
}
.tap-target {
  position: relative; overflow: hidden; flex: 0 0 auto;
  width: 210px; height: 210px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 50% 36%, #1c1f27, #0c0e13 72%);
  color: var(--gold);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    inset 0 0 0 1.5px rgba(255,196,0,.55),
    0 24px 60px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,196,0,.06);
  display: grid; place-items: center;
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, background .25s;
}
.tap-target:active { transform: scale(.95); }
.disc-inner { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.tap-icon { color: currentColor; line-height: 0; }
.tap-icon svg { width: 46px; height: 46px; }
.tap-big { font-size: 20px; font-weight: 800; letter-spacing: 3px; }
.tap-sub {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--ink-mut);
}

/* press-flash: app.js toggles .flash on #tapTarget after a capture */
.tap-target.flash {
  background: radial-gradient(circle at 50% 40%, var(--gold-2), var(--gold) 70%);
  color: #16120a;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    0 24px 70px rgba(255,196,0,.3),
    0 0 0 1.5px var(--gold);
}
.tap-target.flash .tap-sub { color: rgba(22,18,10,.62); }

/* the expanding gold ring bloom (app.js toggles .rippling alongside .flash) */
.tap-ripple {
  position: absolute; inset: 0; margin: 0; border-radius: 50%;
  border: 2px solid var(--gold); background: transparent;
  opacity: 0; pointer-events: none;
}
.tap-target.rippling .tap-ripple { animation: bloom .62s cubic-bezier(.22,.61,.36,1); }
@keyframes bloom { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.42); } }

/* secondary captures (Voice / Note) ----------------------------------------- */
.capture-row { display: flex; gap: 13px; width: 100%; max-width: 320px; }
.cap-btn {
  position: relative; overflow: hidden; flex: 1; min-height: 58px; border-radius: var(--r-lg);
  background: rgba(255,255,255,.025); color: var(--ink);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 13px; font-weight: 600; letter-spacing: .2px; cursor: pointer;
  transition: transform .12s, background .14s, border-color .14s;
}
.cap-btn .ico { line-height: 0; }
.cap-btn .ico svg { width: 19px; height: 19px; }
.cap-btn.voice .ico { color: var(--voice); }
.cap-btn.text  .ico { color: var(--note); }
.cap-btn:active { transform: scale(.97); background: rgba(255,255,255,.06); }
/* recording state (app.js adds .recording to #voiceBtn) */
.cap-btn.voice.recording {
  background: linear-gradient(160deg, #5a1f1c, var(--red)); color: #fff;
  border-color: transparent; animation: recpulse 1.3s ease-in-out infinite;
}
.cap-btn.voice.recording .ico { color: #fff; }
@keyframes recpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,70,59,.5); } 50% { box-shadow: 0 0 0 9px rgba(255,70,59,0); } }
.rec-timer { font-family: var(--mono); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* =============================================================================
 * EPISODES - show-switcher chips + identity head + flat list rows
 * ========================================================================== */
.shows { display: flex; gap: 9px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; flex: none; }
.shows::-webkit-scrollbar { display: none; }
.chip-show {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 15px 0 8px; border-radius: 999px;
  background: var(--panel); color: var(--ink-2);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
  transition: color .14s, background .14s, border-color .14s;
}
.chip-show .chip-m {
  width: 24px; height: 24px; border-radius: 7px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
  color: #16120a; background: linear-gradient(160deg, var(--gold-2), var(--gold));
}
.chip-show.active { color: var(--ink); border-color: rgba(255,196,0,.5); background: rgba(255,196,0,.08); }

.ehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 2px; }
.ehead-id { display: flex; align-items: center; gap: 13px; min-width: 0; }
.show-chip {
  width: 46px; height: 46px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; letter-spacing: .5px; color: #16120a;
  background: linear-gradient(160deg, var(--gold-2), var(--gold));
}
.show-chip.with-art {
  background-size: cover; background-position: center; color: transparent;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.show-name {
  font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin: 0; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.count-badge {
  flex: none; font-size: 13px; font-weight: 700; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); padding: 6px 12px; border-radius: 999px;
}
.count-badge svg { width: 15px; height: 15px; color: var(--ink-2); }

.search {
  width: 100%; min-height: 54px; padding: 0 16px 0 44px; font-size: 15px; font-weight: 600;
  background: var(--panel)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235B626E' stroke-width='2.1' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E")
    no-repeat 15px center;
  color: var(--ink); border: 0; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .15s, box-shadow .15s; flex: none;
}
.search::placeholder { color: var(--ink-mut); }
.search:focus { outline: none; background-color: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.search::-webkit-search-cancel-button { -webkit-appearance: none; }

.ep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ep {
  position: relative; background: transparent; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 14px; padding: 12px 6px; min-height: 64px;
  border-bottom: 1px solid var(--line); transition: background .14s;
}
.ep:active { background: rgba(255,255,255,.03); }
.ep-art {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #1a1d24, #101218);
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-mut);
}
.ep-body { flex: 1; min-width: 0; }
.ep-label { font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-sub { font-size: 13px; font-weight: 600; color: var(--ink-mut); margin-top: 3px; }
.ep-count {
  flex: 0 0 auto; margin-left: auto;
  font-size: 13px; font-weight: 700; color: var(--gold);
  display: inline-flex; align-items: center; gap: 5px;
}
.ep-count::before { content: "\2605"; font-size: 11px; }
.empty { color: var(--ink-mut); text-align: center; padding: 48px 16px; font-size: 14px; line-height: 1.7; }

/* =============================================================================
 * CAPTURES
 * ========================================================================== */
.captures-title { font-size: 34px; font-weight: 800; letter-spacing: -.6px; margin: 4px 0 4px; color: var(--ink); }
.summary {
  background: var(--panel); border-radius: var(--r-lg); padding: 18px;
  box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 16px;
}
.cap-summary { display: flex; align-items: stretch; gap: 18px; }
.stat { flex: 1; }
.stat .num { display: block; font-family: var(--mono); font-size: 34px; font-weight: 700; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.stat.pend .num { color: var(--gold-2); }
.stat .lbl { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.stat-sep { width: 1px; background: var(--line); flex: 0 0 auto; }
.cap-actions { display: flex; gap: 11px; }
.act {
  flex: 1; min-height: 50px; border-radius: var(--r); border: 0; cursor: pointer;
  background: var(--panel-2); color: var(--ink);
  font-family: var(--font); font-size: 14px; font-weight: 700; letter-spacing: .2px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, opacity .12s, background .12s;
}
.act svg { width: 17px; height: 17px; }
.act:active { transform: scale(.98); opacity: .9; }
.act.primary { flex: 1; background: var(--gold); color: #16120a; }
.act.primary:active { background: var(--gold-2); }
/* the bare-icon Export button is a fixed square (matches the prototype ghost) */
#exportBtn { flex: 0 0 auto; width: 54px; background: var(--panel-2); }

.cap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cap-group {
  display: flex; align-items: center; gap: 10px; padding: 14px 2px 11px;
}
.cap-group:first-child { padding-top: 2px; }
.cap-group-title { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .5px; }
.cap-group-rule { flex: 1; height: 1px; background: var(--line); }
.cap-group-count { font-size: 12px; font-weight: 700; color: var(--gold); }

.cap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: var(--r); margin-bottom: 8px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  border: 0; animation: capIn .24s ease-out;
}
@keyframes capIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.cap-head { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; min-width: 0; }
.cap-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 4px 9px; border-radius: 7px;
  flex: 0 0 auto; color: var(--ink-2); background: var(--panel-2);
}
.cap-tap   .cap-badge { color: var(--gold);  background: rgba(255,196,0,.13); }
.cap-text  .cap-badge { color: var(--note);  background: rgba(127,214,232,.13); }
.cap-voice .cap-badge { color: var(--voice); background: rgba(201,166,255,.13); }
.cap-ts { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cap-sync { width: 9px; height: 9px; border-radius: 50%; margin-left: auto; flex: 0 0 auto; background: var(--gold-2); }
.cap-sync.synced  { background: var(--ok); }
.cap-sync.error   { background: var(--red); }
.cap-sync.pending { background: var(--gold-2); }
.cap-text { flex: 1 1 100%; font-size: 14px; color: var(--ink-2); font-weight: 500; line-height: 1.5; }
.cap-play {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  background: var(--panel-2); color: var(--ink); border: 0; border-radius: 999px;
  padding: 9px 15px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .1s, background .12s;
}
.cap-play:active { transform: scale(.96); background: var(--line-2); }
.cap-del {
  background: transparent; color: var(--red); border: 0; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; margin-left: auto;
  transition: transform .1s, background .12s;
}
.cap-del:active { transform: scale(.96); background: rgba(255,70,59,.12); }

/* =============================================================================
 * BOTTOM NAV (portrait)  ->  LEFT RAIL (landscape)
 * ========================================================================== */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: rgba(8,9,11,.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; min-height: 58px; background: transparent; border: 0; cursor: pointer;
  color: var(--ink-mut); font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  position: relative; transition: color .15s;
}
.nav-btn .nico { line-height: 0; display: flex; }
.nav-btn .nico svg { width: 22px; height: 22px; transition: transform .18s cubic-bezier(.22,.61,.36,1), color .15s; }
.nav-btn.active { color: var(--ink); }
.nav-btn.active .nico svg { color: var(--gold); transform: scale(1.05); }
.nav-btn:active .nico svg { transform: scale(.9); }
.nav-badge {
  position: absolute; top: 7px; right: 50%; transform: translateX(22px);
  background: var(--gold); color: #16120a; font-size: 10px; font-weight: 900;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; line-height: 16px;
}
.nav-badge:empty { display: none; }

/* =============================================================================
 * TEXT SHEET
 * ========================================================================== */
.sheet {
  position: fixed; inset: 0; z-index: 30; display: none; align-items: flex-end;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.sheet.open { display: flex; animation: sheetFade .2s ease-out; }
@keyframes sheetFade { from { opacity: 0; } to { opacity: 1; } }
.sheet-panel {
  width: 100%; background: var(--screen); border-top: 2px solid var(--gold);
  border-radius: 18px 18px 0 0; padding: 10px var(--pad) calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 50px rgba(0,0,0,.5); animation: sheetUp .28s cubic-bezier(.22,.61,.36,1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 14px; }
.sheet-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.sheet-hint { font-size: 12px; color: var(--ink-mut); font-weight: 500; margin-left: 6px; }
.sheet-input {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 14px; font-size: 16px; font-family: var(--font);
  resize: none; user-select: text; line-height: 1.5; transition: border-color .15s, box-shadow .15s;
}
.sheet-input:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 2px rgba(255,196,0,.18); }
.sheet-input::placeholder { color: var(--ink-mut); }
.sheet-btns { display: flex; gap: 12px; margin-top: 14px; }

/* =============================================================================
 * TOAST
 * ========================================================================== */
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translate(-50%, 16px); z-index: 40;
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(20,22,28,.95); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 14px 36px rgba(0,0,0,.55);
  padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .28s cubic-bezier(.22,.61,.36,1);
  max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok    { color: var(--ok); }
.toast.warn  { color: var(--gold-2); }
.toast.error { color: var(--red); }

/* =============================================================================
 * LANDSCAPE (dash-mount) - the hero. Slim left rail + two-column Listen view.
 * Trigger on landscape + short viewport so big tablets in landscape still get
 * the roomy portrait stack.
 * ========================================================================== */
@media (orientation: landscape) and (max-height: 600px) {
  /* left rail instead of a bottom bar -> reclaim vertical space */
  body { padding-bottom: env(safe-area-inset-bottom); padding-left: calc(78px + env(safe-area-inset-left)); }
  .bottomnav {
    top: 0; bottom: 0; right: auto; width: calc(78px + env(safe-area-inset-left));
    flex-direction: column; justify-content: center; gap: 6px;
    border-top: none; border-right: 1px solid var(--line);
    padding: 0 0 0 env(safe-area-inset-left);
  }
  .nav-btn { flex: 0 0 auto; min-height: 60px; }
  .nav-badge { right: auto; left: 50%; transform: translateX(8px); top: 8px; }

  .statusbar { padding: 10px var(--pad) 2px; }
  .view { padding: 8px 26px 14px; gap: 12px; }

  /* LISTEN: identity + transport on the left, the gold disc on the right */
  #view-player.active { flex-direction: row; align-items: stretch; gap: 30px; }
  #view-player .listen-left { flex: 1; justify-content: center; min-width: 0; gap: 18px; }
  #view-player .listen-right { flex: 1; }
  .now-episode { font-size: 24px; }
  .tap-target { width: 178px; height: 178px; }
  .transport-btns { justify-content: flex-start; gap: 28px; }

  /* episodes / captures: cap the readable column width on wide screens */
  #view-episodes .ep-list, #view-captures .cap-list,
  #view-episodes .ehead, #view-episodes .search, #view-episodes .shows,
  #view-captures .summary { max-width: 760px; }
}
