/* ==========================================================================
   4 High-Contrast Camera-Ready Editorial Themes + Multi-Color Semantic Brush
   ========================================================================== */
:root,
html[data-theme="gold"] {
  --bg: #f0ece2;
  --panel: #ffffff;
  --subtle: #f8f6f0;
  --header-bg: rgba(255, 254, 250, 0.94);
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --border: #e2ddd0;
  --border-strong: #cbc4b3;
  --accent: #1d2c59;
  --accent-hover: #131e42;
  --accent-soft: #e7edfc;
  --accent-fg: #ffffff;

  --brush-word: rgba(255, 198, 28, 0.78);
  --brush-phrase: rgba(255, 206, 56, 0.28);
  --brush-line: #d97706;
  --brush-ink: #0d0900;
  --active-bg: #fffdf7;
  --active-border: #eab308;
  --active-shadow: 0 8px 26px rgba(217, 119, 6, 0.13);

  /* Multi-Color Role Palette: Sapphire Blue · Sunset Coral · Emerald Teal */
  --pred: #1d4ed8;
  --pred-bg: rgba(37, 99, 235, 0.11);
  --pred-brush: rgba(56, 189, 248, 0.54);
  --pred-wash: rgba(59, 130, 246, 0.16);
  --pred-line: #2563eb;
  --pred-ink: #082f49;
  --pred-pill-bg: #2563eb;
  --pred-pill-ink: #ffffff;

  --rel: #c2410c;
  --rel-bg: rgba(234, 88, 12, 0.11);
  --rel-brush: rgba(251, 146, 60, 0.58);
  --rel-wash: rgba(249, 115, 22, 0.16);
  --rel-line: #ea580c;
  --rel-ink: #431407;
  --rel-pill-bg: #ea580c;
  --rel-pill-ink: #ffffff;

  --cont: #047857;
  --cont-bg: rgba(16, 185, 129, 0.12);
  --cont-brush: rgba(52, 211, 153, 0.56);
  --cont-wash: rgba(16, 185, 129, 0.17);
  --cont-line: #059669;
  --cont-ink: #022c22;
  --cont-pill-bg: #059669;
  --cont-pill-ink: #ffffff;
}

html[data-theme="midnight"] {
  --bg: #070b14;
  --panel: #101726;
  --subtle: #162033;
  --header-bg: rgba(11, 17, 30, 0.94);
  --ink: #f8fafc;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --border: #22304a;
  --border-strong: #32466a;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.16);
  --accent-fg: #07101e;

  --brush-word: rgba(250, 204, 21, 0.86);
  --brush-phrase: rgba(250, 204, 21, 0.22);
  --brush-line: #facc15;
  --brush-ink: #0a0f1a;
  --active-bg: #141e33;
  --active-border: #38bdf8;
  --active-shadow: 0 10px 30px rgba(56, 189, 248, 0.16);

  --pred: #60a5fa;
  --pred-bg: rgba(59, 130, 246, 0.19);
  --pred-brush: rgba(56, 189, 248, 0.88);
  --pred-wash: rgba(56, 189, 248, 0.24);
  --pred-line: #38bdf8;
  --pred-ink: #041526;
  --pred-pill-bg: #38bdf8;
  --pred-pill-ink: #041526;

  --rel: #fb923c;
  --rel-bg: rgba(249, 115, 22, 0.19);
  --rel-brush: rgba(251, 146, 60, 0.90);
  --rel-wash: rgba(251, 146, 60, 0.25);
  --rel-line: #fb923c;
  --rel-ink: #270e02;
  --rel-pill-bg: #fb923c;
  --rel-pill-ink: #270e02;

  --cont: #34d399;
  --cont-bg: rgba(16, 185, 129, 0.19);
  --cont-brush: rgba(52, 211, 153, 0.88);
  --cont-wash: rgba(52, 211, 153, 0.24);
  --cont-line: #34d399;
  --cont-ink: #022419;
  --cont-pill-bg: #34d399;
  --cont-pill-ink: #022419;
}

html[data-theme="mint"] {
  --bg: #edf7f2;
  --panel: #ffffff;
  --subtle: #f4fbf7;
  --header-bg: rgba(255, 255, 255, 0.94);
  --ink: #0c261f;
  --ink-2: #2b4a41;
  --muted: #5a776f;
  --border: #d2e7dd;
  --border-strong: #b1d6c6;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #def5ed;
  --accent-fg: #ffffff;

  --brush-word: rgba(52, 211, 153, 0.72);
  --brush-phrase: rgba(52, 211, 153, 0.24);
  --brush-line: #059669;
  --brush-ink: #032018;
  --active-bg: #f6fffb;
  --active-border: #10b981;
  --active-shadow: 0 8px 24px rgba(16, 185, 129, 0.14);

  --pred: #0284c7;
  --pred-bg: rgba(2, 132, 199, 0.11);
  --pred-brush: rgba(56, 189, 248, 0.52);
  --pred-wash: rgba(2, 132, 199, 0.15);
  --pred-line: #0284c7;
  --pred-ink: #082f49;
  --pred-pill-bg: #0284c7;
  --pred-pill-ink: #ffffff;

  --rel: #e11d48;
  --rel-bg: rgba(225, 29, 72, 0.11);
  --rel-brush: rgba(251, 113, 133, 0.52);
  --rel-wash: rgba(225, 29, 72, 0.15);
  --rel-line: #e11d48;
  --rel-ink: #4c0519;
  --rel-pill-bg: #e11d48;
  --rel-pill-ink: #ffffff;

  --cont: #047857;
  --cont-bg: rgba(4, 120, 87, 0.12);
  --cont-brush: rgba(52, 211, 153, 0.58);
  --cont-wash: rgba(16, 185, 129, 0.17);
  --cont-line: #059669;
  --cont-ink: #022c22;
  --cont-pill-bg: #059669;
  --cont-pill-ink: #ffffff;
}

html[data-theme="paper"] {
  --bg: #f2ebda;
  --panel: #fcf9f0;
  --subtle: #f5eedf;
  --header-bg: rgba(252, 249, 240, 0.94);
  --ink: #1e1a15;
  --ink-2: #494137;
  --muted: #766b5d;
  --border: #ded5c1;
  --border-strong: #c8bda4;
  --accent: #7c2d12;
  --accent-hover: #5a1f0a;
  --accent-soft: #fae9e0;
  --accent-fg: #ffffff;

  --brush-word: rgba(253, 224, 71, 0.94);
  --brush-phrase: rgba(253, 224, 71, 0.36);
  --brush-line: #ca8a04;
  --brush-ink: #17120a;
  --active-bg: #fffef9;
  --active-border: #eab308;
  --active-shadow: 0 8px 22px rgba(202, 138, 4, 0.15);

  --pred: #1e40af;
  --pred-bg: rgba(30, 64, 175, 0.11);
  --pred-brush: rgba(96, 165, 250, 0.56);
  --pred-wash: rgba(37, 99, 235, 0.16);
  --pred-line: #1d4ed8;
  --pred-ink: #0f172a;
  --pred-pill-bg: #1d4ed8;
  --pred-pill-ink: #ffffff;

  --rel: #c2410c;
  --rel-bg: rgba(194, 65, 12, 0.12);
  --rel-brush: rgba(251, 146, 60, 0.60);
  --rel-wash: rgba(234, 88, 12, 0.17);
  --rel-line: #c2410c;
  --rel-ink: #431407;
  --rel-pill-bg: #c2410c;
  --rel-pill-ink: #ffffff;

  --cont: #0f766e;
  --cont-bg: rgba(15, 118, 110, 0.12);
  --cont-brush: rgba(45, 212, 191, 0.56);
  --cont-wash: rgba(13, 148, 136, 0.17);
  --cont-line: #0f766e;
  --cont-ink: #042f2e;
  --cont-pill-bg: #0f766e;
  --cont-pill-ink: #ffffff;
}

html[data-scale="sm"] { --scale: 0.90; }
html[data-scale="md"] { --scale: 1.00; }
html[data-scale="lg"] { --scale: 1.14; }
html[data-scale="xl"] { --scale: 1.28; }

:root { --ease-out: cubic-bezier(0.22, 1, 0.36, 1); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Inter", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   Header & Live Audio Equalizer Session Pill (Full-Bleed)
   ========================================================================== */
header {
  position: sticky; top: 0; z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bar {
  width: 100%; max-width: none; margin: 0; padding: 8px 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-fg);
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}
.brand-icon svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 17px; font-weight: 800; }
.brand-text em { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; color: var(--muted); margin-top: 2px; }

#importer {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 6px;
  background: var(--subtle); border: 1.5px solid var(--border-strong);
  border-radius: 11px; padding: 3.5px 4px 3.5px 10px;
  transition: all 0.16s ease;
}
#importer:focus-within { background: var(--panel); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.imp-icon { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
#url { flex: 1; min-width: 0; border: 0; background: transparent; padding: 6px 4px; font-size: 13px; color: var(--ink); outline: none; }
#importer button {
  border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-fg);
  padding: 7px 14px; font-size: 12.5px; font-weight: 650; cursor: pointer; white-space: nowrap;
}
#importer button:hover { background: var(--accent-hover); }

.session-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 99px;
  background: var(--subtle); border: 1px solid var(--border);
  font-size: 12px; color: var(--ink-2); white-space: nowrap;
}
.session-pill b { color: var(--accent); font-weight: 750; font-variant-numeric: tabular-nums; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i {
  display: block; width: 2.5px; height: 4px; border-radius: 99px;
  background: var(--brush-line); transition: height 0.2s ease;
}
body.is-playing .eq i:nth-child(1) { animation: eq 0.7s infinite ease-in-out; }
body.is-playing .eq i:nth-child(2) { animation: eq 0.55s infinite ease-in-out 0.12s; }
body.is-playing .eq i:nth-child(3) { animation: eq 0.8s infinite ease-in-out 0.24s; }
body.is-playing .eq i:nth-child(4) { animation: eq 0.62s infinite ease-in-out 0.08s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--ink);
  border-radius: 8.5px; padding: 6.5px 11px; font-size: 12.5px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: all 0.14s ease;
}
.tool-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tool-btn.accent-btn { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tool-btn input { display: none; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: var(--accent-fg); font-size: 11px;
}

/* ==========================================================================
   Main Full-Screen Workbench Grid & Player Card
   ========================================================================== */
main {
  flex: 1; width: 100%; max-width: none; margin: 0;
  padding: 10px 16px 14px; display: flex; flex-direction: column; min-height: 0;
}
#status:empty { display: none; }
#status:not(:empty) {
  margin: 0 0 10px; padding: 9px 14px; border-radius: 10px;
  background: var(--brush-phrase); border: 1px solid var(--brush-line);
  color: var(--ink); font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.workspace {
  flex: 1; display: grid;
  grid-template-columns: minmax(380px, 0.88fr) minmax(0, 1.52fr);
  gap: 14px; min-height: 0;
}
.player-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 15px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05); overflow: hidden;
}
.player-card { flex-shrink: 0; }
#stage {
  position: relative; background: #080b12; aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
}
#video, #audio { width: 100%; height: 100%; display: block; cursor: pointer; }
#audio { height: 54px; padding: 8px; }

/* Circular Shadowing Countdown Overlay */
.shadow-overlay {
  position: absolute; inset: 0;
  background: rgba(9, 13, 24, 0.72);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  color: #ffffff;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.ring-wrap { position: relative; width: 62px; height: 62px; display: grid; place-items: center; }
.ring-svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 5; }
.ring-fill {
  fill: none; stroke: #facc15; stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 170; stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear;
}
#ringSec { position: absolute; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fde047; }
.shadow-copy strong { display: block; font-size: 16px; margin-bottom: 2px; }
.shadow-copy small { color: #cbd5e1; font-size: 12px; }

/* Custom Magnetic Scrubber */
.scrubber-wrap { padding: 8px 14px 2px; background: var(--panel); }
#seek {
  -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
  border-radius: 99px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--pred-line) 0%, var(--rel-line) calc(var(--pct, 0%) * 0.5), var(--cont-line) var(--pct, 0%), var(--border) var(--pct, 0%));
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2.5px solid var(--panel);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.12s ease;
}
#seek:hover::-webkit-slider-thumb { transform: scale(1.2); }

.controls { padding: 8px 14px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.btn-row, .speed-row { display: flex; align-items: center; gap: 5.5px; flex-wrap: wrap; }
button { font-family: inherit; }

.play-fab {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-fg);
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  transition: transform 0.14s ease, background 0.15s ease;
}
.play-fab:hover { background: var(--accent-hover); transform: scale(1.06); }
.icon-btn {
  width: 31px; height: 31px; border-radius: 8px; flex-shrink: 0;
  border: 1px solid var(--border-strong); background: var(--subtle); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: all 0.14s ease;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.pill-toggle, .segs button, .phrase-bar button, .mini-btn {
  border: 1px solid var(--border-strong); background: var(--subtle); color: var(--ink);
  border-radius: 8px; padding: 5px 9.5px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.14s ease; white-space: nowrap;
}
.pill-toggle:hover, .segs button:hover, .phrase-bar button:hover, .mini-btn:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
.pill-toggle.on, .segs button.on {
  background: var(--accent) !important; border-color: var(--accent) !important; color: var(--accent-fg) !important;
}
.rec-btn.recording {
  background: #dc2626 !important; border-color: #dc2626 !important; color: #fff !important;
  animation: pulseRec 1.1s infinite;
}
@keyframes pulseRec { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); } 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); } }

#clock { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; color: var(--muted); }
.lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.segs { display: inline-flex; gap: 4px; }
.shortcut-hint { margin-left: auto; font-size: 11px; color: var(--muted); }

.meta { padding: 10px 14px; }
.meta h1 { margin: 0 0 2px; font-size: 15px; line-height: 1.35; font-weight: 750; }
.meta p { margin: 0; font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Live Phrase Focus Card (Dynamically Color-Synced to Active Role)
   ========================================================================== */
.focus-card {
  position: relative; padding: 14px 16px; border-width: 1.5px;
  display: flex; flex-direction: column;
  transition: border-color 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
}
.focus-card.predicate {
  --b-word: var(--pred-brush); --b-wash: var(--pred-wash); --b-line: var(--pred-line); --b-ink: var(--pred-ink);
  --b-pill-bg: var(--pred-pill-bg); --b-pill-ink: var(--pred-pill-ink);
  border-color: var(--pred-line); box-shadow: 0 8px 24px var(--pred-wash);
}
.focus-card.relation {
  --b-word: var(--rel-brush); --b-wash: var(--rel-wash); --b-line: var(--rel-line); --b-ink: var(--rel-ink);
  --b-pill-bg: var(--rel-pill-bg); --b-pill-ink: var(--rel-pill-ink);
  border-color: var(--rel-line); box-shadow: 0 8px 24px var(--rel-wash);
}
.focus-card.content {
  --b-word: var(--cont-brush); --b-wash: var(--cont-wash); --b-line: var(--cont-line); --b-ink: var(--cont-ink);
  --b-pill-bg: var(--cont-pill-bg); --b-pill-ink: var(--cont-pill-ink);
  border-color: var(--cont-line); box-shadow: 0 8px 24px var(--cont-wash);
}

.phrase-meter { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--border); overflow: hidden; }
.phrase-meter i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--b-line, var(--pred-line)), var(--b-word, var(--brush-line)));
  transition: width 0.06s linear;
}
.focus-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; color: var(--b-line, var(--accent)); transition: color 0.22s ease; }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--b-line, var(--brush-line));
  box-shadow: 0 0 0 3px var(--b-wash, var(--brush-phrase));
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.7; } }

.live-orig { font-size: calc(20px * var(--scale)); font-weight: 650; line-height: 1.62; color: var(--ink); margin-bottom: 10px; }
.live-zh {
  display: block; width: 100%; text-align: left;
  border: 1.5px solid var(--b-line, var(--brush-line));
  background: var(--b-pill-bg, var(--brush-phrase));
  color: var(--b-pill-ink, var(--ink));
  padding: 9px 13px; border-radius: 10px; font-size: calc(15px * var(--scale));
  font-weight: 700; line-height: 1.48; cursor: pointer; margin-bottom: 11px;
  box-shadow: 0 4px 14px var(--b-wash, var(--brush-phrase));
  transition: background 0.24s var(--ease-out), border-color 0.24s var(--ease-out), color 0.2s ease;
}
.phrase-bar { display: flex; align-items: center; gap: 5px; }
.phrase-steps { display: flex; gap: 4px; overflow-x: auto; }
.phrase-steps button { min-width: 28px; padding: 4px 7px; }
.phrase-steps button[aria-current="true"] { background: var(--b-line, var(--accent)); color: #ffffff; border-color: var(--b-line, var(--accent)); }
#repeatPart { margin-left: auto; }
.sentence-full { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border); }
.sentence-full span { font-size: 11px; color: var(--muted); font-weight: 650; }
.sentence-full p { margin: 3px 0 0; font-size: calc(13.5px * var(--scale)); color: var(--ink-2); line-height: 1.52; }

.lib-list { display: flex; flex-direction: column; gap: 7px; max-height: 55dvh; overflow-y: auto; }
.lib-item {
  text-align: left; border: 1px solid var(--border); background: var(--subtle);
  color: var(--ink); border-radius: 9px; padding: 9px 11px; cursor: pointer; font-size: 13px; font-weight: 650;
  transition: all 0.14s ease;
}
.lib-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.lib-item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; font-weight: 400; }

/* ==========================================================================
   Transcript Column + Multi-Color Paintbrush Sweep
   ========================================================================== */
.transcript-col { display: flex; flex-direction: column; min-height: 0; }
.transcript-head {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  flex-shrink: 0;
}
.th-left, .th-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.transcript-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.transcript-head small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cloze-actions { display: inline-flex; gap: 5px; }

.mode-segs {
  display: inline-flex; background: var(--subtle);
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 3px; gap: 3px;
}
.mode-segs button {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 5px 11px; border-radius: 6.5px; font-size: 12.5px; font-weight: 650; cursor: pointer;
}
.mode-segs button.on { background: var(--accent); color: var(--accent-fg); }

.legend-bar {
  padding: 7px 16px; background: var(--subtle); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px;
  flex-shrink: 0;
}
.legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 650; color: var(--ink-2); }
.leg { display: inline-flex; align-items: center; gap: 5px; }
.leg::before { content: ""; width: 9.5px; height: 9.5px; border-radius: 50%; }
.leg.predicate::before { background: var(--pred-line); box-shadow: 0 0 0 2.5px var(--pred-wash); }
.leg.relation::before { background: var(--rel-line); box-shadow: 0 0 0 2.5px var(--rel-wash); }
.leg.content::before { background: var(--cont-line); box-shadow: 0 0 0 2.5px var(--cont-wash); }
.leg.speaking::before {
  background: conic-gradient(var(--pred-line), var(--rel-line), var(--cont-line), var(--pred-line));
  box-shadow: 0 0 0 2.5px var(--brush-phrase);
}
.legend-tip { color: var(--muted); font-size: 11.5px; }

.lines { flex: 1; overflow-y: auto; padding: 10px 12px; }
.line {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 56px;
  gap: 10px;
  padding: 12px 14px 12px 16px;
  border-radius: 13px;
  border: 1.5px solid transparent;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.line:not(.active) { opacity: 0.72; }
.line:hover { opacity: 1; background: var(--subtle); }
.line.active {
  opacity: 1;
  background: var(--active-bg);
  border-color: var(--active-border);
  box-shadow: var(--active-shadow);
}
/* Live vertical tri-color progress rail on the active sentence */
.line.active::before {
  content: "";
  position: absolute; left: 5px; top: 10px; bottom: 10px; width: 3.5px;
  border-radius: 99px; background: var(--border);
}
.line.active::after {
  content: "";
  position: absolute; left: 5px; top: 10px;
  height: calc((100% - 20px) * var(--row-pct, 0));
  width: 3.5px; border-radius: 99px;
  background: linear-gradient(180deg, var(--pred-line), var(--rel-line), var(--cont-line));
  transition: height 0.08s linear;
}

.stamp {
  align-self: start; border: 0; background: transparent; padding: 4px 0;
  font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 650;
  color: var(--muted); cursor: pointer; text-align: left;
}
.line.active .stamp { color: var(--accent); font-weight: 800; }

.row-tools { display: flex; align-items: flex-start; justify-content: flex-end; gap: 2px; }
.row-act {
  border: 0; background: transparent; cursor: pointer;
  font-size: 14px; color: var(--muted); opacity: 0.42; padding: 3px 4px; border-radius: 6px;
  transition: transform 0.14s ease, opacity 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.line:hover .row-act, .line.active .row-act { opacity: 0.78; }
.row-act:hover, .row-act.saved { opacity: 1 !important; color: var(--brush-line); background: var(--brush-phrase); transform: scale(1.1); }

.orig { font-size: calc(17.5px * var(--scale)); line-height: 1.9; color: var(--ink); font-weight: 550; }
.cn { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; line-height: 1.7; }

/* Blind & Cloze Blur-Reveal Modes */
body[data-mode="blind"] .live-zh,
body[data-mode="blind"] .sentence-full,
body[data-mode="blind"] .cn { display: none !important; }

body[data-mode="cloze"] .w.cloze-hide:not(.revealed) {
  filter: blur(5.5px);
  background: var(--border) !important;
  border-radius: 5px;
  padding: 0 4px;
  user-select: none;
  transition: filter 0.25s var(--ease-out), background 0.25s ease;
}
body[data-mode="cloze"] .w.cloze-hide.revealed {
  filter: blur(0);
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  animation: clozePop 0.28s var(--ease-out);
}
@keyframes clozePop { 0% { transform: scale(1.12); background: var(--brush-word); } 100% { transform: scale(1); } }

/* Role-Scoped Multi-Color Paintbrush Variables */
.frag.predicate {
  --b-word: var(--pred-brush); --b-wash: var(--pred-wash); --b-line: var(--pred-line); --b-ink: var(--pred-ink);
  --b-pill-bg: var(--pred-pill-bg); --b-pill-ink: var(--pred-pill-ink);
}
.frag.relation {
  --b-word: var(--rel-brush); --b-wash: var(--rel-wash); --b-line: var(--rel-line); --b-ink: var(--rel-ink);
  --b-pill-bg: var(--rel-pill-bg); --b-pill-ink: var(--rel-pill-ink);
}
.frag.content {
  --b-word: var(--cont-brush); --b-wash: var(--cont-wash); --b-line: var(--cont-line); --b-ink: var(--cont-ink);
  --b-pill-bg: var(--cont-pill-bg); --b-pill-ink: var(--cont-pill-ink);
}

/* Active Phrase Soft Color Wash (matches role color!) */
.orig .frag {
  display: inline; padding: 0.08em 0.14em; border-radius: 5px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  background-image: linear-gradient(transparent 56%, var(--b-wash, var(--brush-phrase)) 56%, var(--b-wash, var(--brush-phrase)) 96%, transparent 96%);
  background-repeat: no-repeat; background-size: 0% 100%;
  transition: background-size 0.34s var(--ease-out);
}
.orig .frag.current { background-size: 100% 100%; }

/* Word-Level Multi-Color Paintbrush — 4 Distinct Styles */
.w {
  display: inline; border-radius: 5px; padding: 0.05em 0.08em; cursor: pointer;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  background-repeat: no-repeat; background-size: 0% 100%;
  transition: background-size 0.18s var(--ease-out), color 0.12s ease, transform 0.14s ease, box-shadow 0.16s ease;
}
.w:hover { text-decoration: underline dotted var(--b-line, var(--accent)); text-underline-offset: 4px; }

html[data-brush="marker"] .w {
  background-image: linear-gradient(transparent 30%, var(--b-word, var(--brush-word)) 30%, var(--b-word, var(--brush-word)) 96%, transparent 96%);
}
html[data-brush="marker"] .w.speaking-word {
  background-size: 100% 100%; color: var(--b-ink, var(--brush-ink)); font-weight: 800;
  box-shadow: 0 0 0 1.8px var(--b-line, var(--brush-line));
}

html[data-brush="glow"] .w {
  background-image: linear-gradient(90deg, var(--b-word, var(--brush-word)), var(--b-word, var(--brush-word)));
  border-radius: 6px; padding: 0.06em 0.2em;
}
html[data-brush="glow"] .w.speaking-word {
  background-size: 100% 100%; color: var(--b-ink, var(--brush-ink)); font-weight: 800;
  box-shadow: 0 2px 14px var(--b-wash, var(--brush-phrase));
}

html[data-brush="underline"] .w {
  background-image: linear-gradient(transparent 80%, var(--b-line, var(--brush-line)) 80%, var(--b-line, var(--brush-line)) 100%);
}
html[data-brush="underline"] .w.speaking-word {
  background-size: 100% 100%; color: var(--b-line, var(--brush-line)); font-weight: 800;
}

html[data-brush="pop"] .line.active .w:not(.speaking-word) { opacity: 0.56; }
html[data-brush="pop"] .w.speaking-word {
  display: inline-block; background: var(--b-pill-bg, var(--brush-word)); color: var(--b-pill-ink, var(--brush-ink));
  font-weight: 800; padding: 0 6px; border-radius: 7px; transform: scale(1.09);
  box-shadow: 0 3px 12px var(--b-wash, var(--brush-phrase));
}

/* Paired Multi-Color Chinese Phrase Pills */
.cn .frag {
  font-size: calc(13.5px * var(--scale)); padding: 2.5px 9.5px; border-radius: 7px;
  font-weight: 650; cursor: pointer; border: 1.5px solid transparent;
  transition: all 0.2s var(--ease-out);
}
.cn .frag.predicate { background: var(--pred-bg); color: var(--pred); }
.cn .frag.relation { background: var(--rel-bg); color: var(--rel); }
.cn .frag.content { background: var(--cont-bg); color: var(--cont); }
.cn .frag:hover { filter: brightness(0.94); transform: translateY(-1px); }
.cn .frag.current {
  background: var(--b-pill-bg, var(--brush-word)) !important;
  color: var(--b-pill-ink, var(--brush-ink)) !important;
  border-color: var(--b-line, var(--brush-line));
  box-shadow: 0 3px 12px var(--b-wash, var(--brush-phrase));
  font-weight: 750;
  transform: translateY(-1px);
}

/* ==========================================================================
   Popovers & Dialogs
   ========================================================================== */
#settingsMenu, #libraryMenu, #wordPop {
  border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--panel); color: var(--ink);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22); padding: 15px 16px; margin: 0;
}
#settingsMenu, #libraryMenu { width: 330px; position: fixed; top: 56px; right: 16px; left: auto; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.link-btn { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 650; cursor: pointer; }
.set-group + .set-group { margin-top: 13px; }
.set-group label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.theme-grid, .choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.theme-chip, .choice-grid button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid var(--border); background: var(--subtle); color: var(--ink);
  border-radius: 8.5px; padding: 7px 8px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.theme-chip.on, .choice-grid button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 750; }
.sw { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.15); }
.sw-gold { background: linear-gradient(135deg, #2563eb 33%, #ea580c 66%, #059669 100%); }
.sw-midnight { background: linear-gradient(135deg, #070b14 45%, #38bdf8 55%); }
.sw-mint { background: linear-gradient(135deg, #0f766e 45%, #34d399 55%); }
.sw-paper { background: linear-gradient(135deg, #7c2d12 45%, #fde047 55%); }

#wordPop { width: min(305px, calc(100vw - 24px)); position: fixed; }
.wp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.wp-top strong { font-size: 18px; font-weight: 800; }
.wp-ipa { display: block; font-size: 12.5px; color: var(--muted); font-family: ui-monospace, monospace; margin-top: 2px; }
.wp-actions { display: flex; gap: 5px; }
.wp-actions button { border: 1px solid var(--border-strong); background: var(--subtle); color: var(--ink); border-radius: 7px; padding: 4px 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.wp-actions .primary-sm { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.wp-zh { font-size: 14.5px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.wp-en { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

dialog {
  width: min(620px, 94vw); max-height: 82dvh;
  border: 1px solid var(--border-strong); border-radius: 16px;
  background: var(--panel); color: var(--ink); padding: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(4px); }
.dlg-head { padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dlg-tabs { display: flex; gap: 6px; }
.dlg-tabs button { border: 1px solid var(--border); background: var(--subtle); color: var(--ink); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 650; cursor: pointer; }
.dlg-tabs button.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.dlg-right { display: flex; gap: 6px; }
.dlg-body { padding: 14px 16px; max-height: 62dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.nb-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--subtle); }
.nb-row strong { font-size: 15px; }
.nb-row small { color: var(--muted); margin-left: 6px; }
.nb-row p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.nb-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.nb-del:hover { color: #dc2626; }

.auth-form { display: flex; flex-direction: column; gap: 11px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.auth-form input {
  border: 1.5px solid var(--border-strong); background: var(--subtle); color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none;
}
.auth-form input:focus { border-color: var(--accent); background: var(--panel); }
.auth-tip { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.auth-err { margin: 0; font-size: 12.5px; color: #dc2626; font-weight: 650; min-height: 16px; }
.auth-active-box { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; line-height: 1.6; }

/* Hide mobile-only UI on desktop */
.mobile-only, .mobile-dock { display: none; }

/* Floating Recenter Button inside Transcript */
.transcript-col { position: relative; }
.recenter-btn {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  border: 0; border-radius: 99px;
  background: var(--accent); color: var(--accent-fg);
  padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  z-index: 10; transition: transform 0.15s ease, opacity 0.15s ease;
}
.recenter-btn:active { transform: translateX(-50%) scale(0.95); }

/* ==========================================================================
   Desktop Full-Screen Viewport Lock (Edge-to-Edge, Zero Dead Space)
   ========================================================================== */
@media (min-width: 861px) {
  body { height: 100dvh; overflow: hidden; }
  main { overflow: hidden; }
  .workspace { height: 100%; }
  .player-col { height: 100%; overflow-y: auto; }
  .focus-card { flex: 1; }
  .transcript-col { height: 100%; }
}

/* ==========================================================================
   Mobile Native-App Experience (<= 860px):
   Pinned Slim Header + Pinned Video + Auto-Scrolling Lyrics + Pinned Bottom Dock
   ========================================================================== */
@media (max-width: 860px) {
  .mobile-only { display: inline-flex; }
  .m-hide { display: none !important; }
  body {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg);
  }

  /* 1. Ultra-Clean iOS/Editorial Top Bar (Brand + Talk Title + Circular Icon Pills) */
  header {
    flex-shrink: 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }
  .bar { padding: 8px 12px 6px; gap: 8px; flex-wrap: wrap; align-items: center; }
  .brand { gap: 6px; }
  .brand-text strong, .brand-text em { display: none; }
  .brand-icon {
    width: 30px; height: 30px; border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  }
  .brand-icon svg { width: 15px; height: 15px; }

  .mobile-title {
    flex: 1; min-width: 0;
    font-size: 13.5px; font-weight: 750; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    letter-spacing: -0.01em;
  }

  .actions {
    flex: 0 0 auto; justify-content: flex-end;
    gap: 6px; flex-wrap: nowrap;
  }
  .tool-btn.icon-pill {
    width: 32px; height: 32px; padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--ink-2);
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
  }
  .tool-btn.icon-pill.accent-btn {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
  }
  .tool-btn.icon-pill .badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px;
  }
  .actions a.tool-btn, .actions label.tool-btn { display: none; }

  /* Collapsible URL Importer (Clean floating pill bar) */
  #importer {
    display: none;
    order: 3; flex: 1 0 100%; min-width: 0;
    padding: 3px 3px 3px 10px; margin-top: 4px;
    background: var(--panel); border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  }
  body.mobile-import-open #importer { display: flex; }
  #url { font-size: 13px; padding: 5px 4px; }
  #importer button { padding: 6px 12px; font-size: 12px; border-radius: 9px; }

  .session-pill, .shortcut-hint, .legend-tip { display: none; }

  /* 2. Locked Viewport Main: Framed Cinema Video Card + Scrolling Lyrics */
  main {
    flex: 1; min-height: 0; overflow: hidden;
    padding: 0; display: flex; flex-direction: column;
  }
  #status:empty { display: none; }
  #status:not(:empty) {
    margin: 4px 12px 6px; padding: 6px 10px; font-size: 12px;
  }
  .workspace {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; gap: 0;
  }

  /* Framed Luxury Cinema Video Card (Pinned at Top!) */
  .player-col { flex-shrink: 0; gap: 0; padding: 2px 12px 6px; }
  .player-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    background: #05080f;
  }
  #stage {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #05080f;
  }

  /* Hide desktop-redundant blocks on mobile */
  .scrubber-wrap,
  .controls,
  .meta,
  #liveCard,
  .transcript-head,
  .legend-bar,
  .stamp {
    display: none !important;
  }

  /* 3. Auto-Scrolling Bilingual Lyrics Stream with Soft Top/Bottom Fade Mask */
  .transcript-col {
    flex: 1; min-height: 0;
    border: 0; border-radius: 0; box-shadow: none;
    background: transparent;
  }
  .lines {
    flex: 1; min-height: 0; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 12px 12px 30px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 5%, #000 93%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 5%, #000 93%, transparent 100%);
  }
  .line {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 16px;
    border-width: 1px;
  }
  /* Quiet editorial typography for non-active sentences */
  .line:not(.active) {
    opacity: 0.44;
    background: transparent;
    border-color: transparent;
  }
  .line:not(.active) .cn .frag {
    background: transparent !important;
    color: var(--ink-2) !important;
    padding: 0 2px 0 0;
    border-color: transparent;
    font-weight: 500;
  }
  .line:not(.active) .row-tools { display: none; }

  /* Jewel-like Elevated Active Sentence Card */
  .line.active {
    grid-template-columns: 1fr auto;
    gap: 8px;
    opacity: 1;
    padding: 13px 12px 13px 17px;
    background: var(--panel);
    border-color: var(--active-border);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(217, 119, 6, 0.10);
  }
  .line.active::before { left: 6px; top: 13px; bottom: 13px; width: 3.5px; }
  .line.active::after { left: 6px; top: 13px; height: calc((100% - 26px) * var(--row-pct, 0)); width: 3.5px; }

  .orig { font-size: calc(16.5px * var(--scale)); line-height: 1.72; font-weight: 600; letter-spacing: -0.01em; }
  .line.active .orig { font-size: calc(17.5px * var(--scale)); font-weight: 650; }
  .cn { margin-top: 7px; gap: 5px; line-height: 1.5; }
  .cn .frag { font-size: calc(12.5px * var(--scale)); padding: 3px 8.5px; border-radius: 8px; }
  .row-tools { flex-direction: column; justify-content: center; gap: 6px; }
  .row-act {
    width: 28px; height: 28px; padding: 0;
    display: grid; place-items: center;
    border-radius: 8px; background: var(--subtle);
    font-size: 13px; opacity: 0.85;
  }

  /* 4. Sculpted Frosted-Glass Bottom Sheet Dock */
  .mobile-dock {
    display: flex; flex-direction: column; gap: 9px;
    flex-shrink: 0;
    background: var(--header-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    border-radius: 22px 22px 0 0;
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
    z-index: 25;
  }
  .mdock-seek {
    display: flex; align-items: center; gap: 9px;
    font-size: 11px; font-weight: 700; color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  #mSeek {
    -webkit-appearance: none; appearance: none; flex: 1; height: 4px;
    border-radius: 99px; outline: none;
    background: linear-gradient(90deg, var(--pred-line) 0%, var(--rel-line) calc(var(--pct, 0%) * 0.5), var(--cont-line) var(--pct, 0%), var(--border) var(--pct, 0%));
  }
  #mSeek::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--panel);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  }
  .mdock-btns {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
  }
  .mdock-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: transparent; color: var(--ink-2);
    padding: 5px 2px; border-radius: 12px; font-size: 10.5px; font-weight: 650;
    cursor: pointer; transition: color 0.14s ease, background 0.14s ease;
  }
  .mdock-btn.on { color: var(--accent); background: var(--accent-soft); }
  .mdock-play {
    width: 50px; height: 50px; border-radius: 18px; border: 0; flex-shrink: 0;
    background: linear-gradient(145deg, var(--accent), var(--accent-hover));
    color: var(--accent-fg);
    display: grid; place-items: center; cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.12s ease;
  }
  .mdock-play:active { transform: scale(0.93); }

  #settingsMenu, #libraryMenu {
    width: calc(100vw - 24px);
    left: 12px; right: 12px; top: 52px;
    max-height: 76dvh; overflow-y: auto;
  }
}
