:root { --bg:#f6f5f2; --card:#fff; --ink:#1d1d1f; --mute:#6e6e73; --line:#e3e1dc;
  /* main #FFC0CB fills key controls (text on it is dark, 7.6:1) · emphasis #AA7A82 for indicators, progress and the
     play button (3.6:1, fine for shapes/icons, not for text) · pink-family text uses #7F6065 (5.6:1) · green #BFFFCB */
  --acc-fill:#ffc0cb; --on-acc:#4a3236; --acc:#aa7a82; --on-emph:#fff; --acc-ink:#7f6065; --acc-soft:#fff0f3;
  --miss:#c9c6bf; --sub:#f1f0ec;
  /* status colours, used only for feedback */
  --ok:#1f5c33; --on-ok:#1f5c33; --ok-soft:#bfffcb; --danger:#b42318; --on-danger:#fff; --warn:#b54708; --warn-soft:#fef3dc; --info:#1d5fd1; --info-soft:#e8f0fd;
  --bad:#c2410c; --bad-soft:#fdeee5; 
 
}
/* theme: "system" follows the device; the settings popup can force light or dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg:#151517; --card:#1f1f22; --ink:#ececee; --mute:#9a9aa0; --line:#2e2e33;
    /* dark: the softer #E5ACB6 fills, so the pink doesn't glare on black */
    --acc-fill:#e5acb6; --on-acc:#2b1d20; --acc:#aa7a82; --on-emph:#fff; --acc-ink:#e5acb6; --acc-soft:#3a2b2e;
    --miss:#4a4a50; --sub:#26262a;
    --ok:#bfffcb; --on-ok:#bfffcb; --ok-soft:#1f3a28; --danger:#ff8a80; --on-danger:#2b0f0f; --warn:#f5b54a; --warn-soft:#3a2e17; --info:#8ab4ff; --info-soft:#1e2a40;
    --bad:#ff9a66; --bad-soft:#3a2519; }
}
:root[data-theme="dark"] { --bg:#151517; --card:#1f1f22; --ink:#ececee; --mute:#9a9aa0; --line:#2e2e33;
    /* dark: the softer #E5ACB6 fills, so the pink doesn't glare on black */
    --acc-fill:#e5acb6; --on-acc:#2b1d20; --acc:#aa7a82; --on-emph:#fff; --acc-ink:#e5acb6; --acc-soft:#3a2b2e;
    --miss:#4a4a50; --sub:#26262a;
    --ok:#bfffcb; --on-ok:#bfffcb; --ok-soft:#1f3a28; --danger:#ff8a80; --on-danger:#2b0f0f; --warn:#f5b54a; --warn-soft:#3a2e17; --info:#8ab4ff; --info-soft:#1e2a40;
    --bad:#ff9a66; --bad-soft:#3a2519; color-scheme:dark; }
* { box-sizing:border-box; }
body { margin:0; font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; -webkit-font-smoothing:antialiased; background:var(--bg); color:var(--ink); }
a { color:var(--acc-ink); }
.top { display:flex; align-items:center; justify-content:space-between; padding:14px 24px; border-bottom:1px solid var(--line); background:var(--card); position:sticky; top:0; z-index:5; }
.brand { font-weight:700; font-size:17px; color:var(--ink); text-decoration:none; }
#nav { display:flex; gap:14px; align-items:center; font-size:14px; }
#nav a { text-decoration:none; color:var(--mute); }
#nav a.on { color:var(--ink); font-weight:600; }
.pill { font-size:12px; padding:3px 9px; border-radius:99px; background:var(--acc-soft); color:var(--acc-ink); font-weight:600; }
main { max-width:1180px; margin:0 auto; padding:24px 20px 60px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:22px; }
h1 { font-size:22px; margin:0 0 6px; } h2 { font-size:17px; margin:0 0 12px; }
.sub { color:var(--mute); font-size:13px; margin:0 0 16px; line-height:1.6; }
button, .btn { font:inherit; font-size:13px; border:1px solid var(--line); background:var(--card); color:var(--ink); border-radius:8px; padding:7px 12px; cursor:pointer; text-decoration:none; display:inline-block; }
button:hover, .btn:hover { border-color:var(--acc); }
button.on, .btn.primary, button.primary { background:var(--acc-fill); color:var(--on-acc); border-color:var(--acc); }
button.danger { color:var(--danger); }
button:disabled { opacity:.5; cursor:default; }
input, textarea { font:inherit; font-size:14px; width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink); }
textarea { resize:vertical; line-height:1.55; }
input:focus, textarea:focus { outline:2px solid var(--acc-soft); border-color:var(--acc); }
label.f { display:block; font-size:13px; color:var(--mute); margin:12px 0 6px; }
.err { color:var(--danger); font-size:13px; min-height:18px; margin-top:10px; }
.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--ink); color:var(--bg); padding:10px 16px; border-radius:10px; font-size:14px; z-index:20; max-width:90vw; }

/* auth */
.auth { max-width:400px; margin:40px auto; }
.auth .switch { font-size:13px; color:var(--mute); margin-top:16px; text-align:center; }

/* drive */
.plan { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.meter { height:8px; background:var(--sub); border-radius:99px; overflow:hidden; width:220px; margin-top:8px; }
.meter i { display:block; height:100%; background:var(--acc); }
.drop { display:block; border:2px dashed var(--line); border-radius:12px; padding:22px; text-align:center; color:var(--mute); font-size:14px; cursor:pointer; line-height:1.6; margin-bottom:16px; }
.drop.over { border-color:var(--acc); color:var(--acc-ink); }
.files { width:100%; border-collapse:collapse; font-size:14px; }
.files td, .files th { padding:12px 8px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; }
.files th { font-size:12px; color:var(--mute); font-weight:500; }
.files .name { font-weight:600; word-break:break-all; }
.files .act { text-align:right; white-space:nowrap; }
.files .act > * { margin-left:6px; }
.bar { height:6px; background:var(--sub); border-radius:99px; overflow:hidden; width:160px; margin-top:6px; }
.bar i { display:block; height:100%; background:var(--acc); transition:width .4s; }
.status { font-size:12px; color:var(--mute); }
.empty { text-align:center; color:var(--mute); padding:30px 0; font-size:14px; }

/* player */
.player { display:grid; grid-template-columns:1fr 400px; gap:20px; align-items:start; }
@media (max-width:700px) { .player { grid-template-columns:1fr; } .side { position:static !important; max-height:none !important; } }
.now { margin:14px 0 4px; display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; }
.now .q { font-size:38px; font-weight:700; font-variant-numeric:tabular-nums; }
.now .p { color:var(--mute); font-size:14px; }
audio { width:100%; margin-top:6px; }
.subs { margin-top:14px; background:var(--sub); border-radius:10px; padding:14px 16px; min-height:84px; }
.subs .prev { color:var(--mute); font-size:14px; min-height:20px; }
.subs .cur { font-size:19px; line-height:1.45; margin-top:4px; min-height:28px; }
.ctrl { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.ctrl .sep { width:1px; background:var(--line); margin:0 2px; }
.keys { color:var(--mute); font-size:12px; margin-top:12px; line-height:1.8; }
kbd { border:1px solid var(--line); border-radius:4px; padding:0 5px; font-size:11px; }
.side { max-height:calc(100vh - 90px); overflow:auto; position:sticky; top:78px; }
.seg { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.seg button { border:0; border-radius:0; padding:5px 10px; font-size:12px; }
.row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; font-size:12px; color:var(--mute); margin-bottom:10px; }
.row button.sm { padding:4px 9px; font-size:12px; }
.part { margin:14px 0; }
.part h3 { font-size:13px; margin:0 0 8px; color:var(--mute); font-weight:600; display:flex; justify-content:space-between; gap:8px; }
.part h3 a { cursor:pointer; font-weight:500; text-decoration:none; }
.grid { display:grid; grid-template-columns:repeat(6, 1fr); gap:6px; }
.n { position:relative; height:36px; border-radius:8px; border:1px solid var(--line); background:var(--card); font-variant-numeric:tabular-nums; font-size:14px; padding:0; }
.n.miss { color:var(--miss); border-style:dashed; }
.n.est { border-style:dotted; border-color:var(--acc); }
.n.off { color:var(--miss); background:var(--sub); text-decoration:line-through; }
.n.cur { background:var(--acc-fill); color:var(--on-acc); border-color:var(--acc); text-decoration:none; }
.n.grp { box-shadow:inset 0 0 0 2px var(--acc-soft); }
.n.memo::after { content:""; position:absolute; top:4px; right:4px; width:6px; height:6px; border-radius:50%; background:var(--bad); }
.n.cur.memo::after { background:var(--on-acc); }
.selmode .n { outline:2px dotted var(--acc); outline-offset:-3px; }
.edit .n { outline:2px dashed var(--bad); outline-offset:-3px; }
.note { font-size:12px; color:var(--mute); margin-top:10px; line-height:1.6; }

/* memo */
.memo-box { margin-top:16px; border:1px solid var(--line); border-radius:12px; padding:16px; }
.memo-box h3 { margin:0 0 4px; font-size:15px; display:flex; justify-content:space-between; align-items:center; gap:8px; }
.memo-box .saved { font-size:12px; color:var(--mute); font-weight:400; }
.memo-box .prevnote { font-size:12px; color:var(--acc-ink); margin:2px 0 6px; }
.memo-box .pin { font-size:12px; }
.cmp { margin-top:12px; background:var(--sub); border-radius:10px; padding:12px 14px; font-size:15px; line-height:1.9; }
.cmp .score { font-size:13px; color:var(--mute); margin-bottom:6px; }
.cmp .w-ok { color:var(--ok); }
.cmp .w-miss { background:var(--bad-soft); color:var(--bad); border-radius:4px; padding:0 2px; font-weight:600; }
.cmp .w-extra { color:var(--bad); text-decoration:line-through; }
.cmp .lab { color:var(--mute); }
.cmp .legend { font-size:12px; color:var(--mute); margin-top:6px; }

/* pricing */
.plans { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:20px 0; }
@media (max-width:700px) { .plans { grid-template-columns:1fr; } }
.plans .card.plan-on { border-color:var(--acc); box-shadow:0 0 0 1px var(--acc); }
.passes { display:flex; flex-direction:column; gap:8px; margin:10px 0 4px; }
.plans .pass { display:flex; align-items:center; gap:10px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; cursor:pointer; }
.pass:has(input:checked) { border-color:var(--acc); box-shadow:0 0 0 1px var(--acc); }
.pass input { accent-color:var(--acc-ink); margin:0; width:auto; flex:none; padding:0; }
.pass .pname { font-weight:600; }
.pass .pprice { margin-left:auto; font-weight:700; font-size:17px; }
.price { font-size:28px; font-weight:700; margin:6px 0; }
.plans ul { padding-left:18px; color:var(--mute); font-size:14px; line-height:1.9; }
#payment-method, #agreement { margin-top:8px; }
.admin td, .admin th { font-size:13px; }
#nav a, #nav span, .brand { white-space:nowrap; }
@media (max-width:640px) {
  .top { flex-wrap:wrap; gap:8px; padding:10px 14px; }
  #nav { gap:10px; font-size:13px; flex-wrap:wrap; }
  #nav .uname { display:none; }
  main { padding:14px 10px 40px; }
  .card { padding:16px; }
  .keys { display:none; }
  .files .act .btn, .files .act button { padding:6px 9px; }
  .now .q { font-size:30px; }
}

/* custom player bar */
.pbar { margin-top:10px; background:var(--sub); border-radius:16px; padding:14px 16px 10px; }
.track { position:relative; height:22px; cursor:pointer; touch-action:none; }
.rail { position:absolute; left:0; right:0; top:8px; height:6px; border-radius:99px; background:var(--line); overflow:hidden; transition:height .12s, top .12s; }
.track:hover .rail, .track.drag .rail { top:6px; height:10px; }
.rail > * , #segs .seg { position:absolute; top:0; bottom:0; }
.buf { left:0; width:0; background:color-mix(in srgb, var(--mute) 22%, transparent); }
#segs { position:absolute; inset:0; }
#segs .seg { background:color-mix(in srgb, var(--acc) 22%, transparent); }
.curseg { background:color-mix(in srgb, var(--acc) 30%, transparent); }
.fill { left:0; width:0; background:var(--acc); border-radius:99px; }
#ticks { position:absolute; left:0; right:0; top:3px; height:16px; pointer-events:none; }
.tick { position:absolute; top:0; width:2px; height:4px; margin-left:-1px; border-radius:1px; background:var(--miss); }
.tick.on { background:var(--acc); }
.knob { position:absolute; top:4px; width:14px; height:14px; margin-left:-7px; border-radius:50%; background:#fff; border:3px solid var(--acc); box-shadow:0 1px 4px rgba(0,0,0,.25); pointer-events:none; transition:transform .12s; }
.track:hover .knob, .track.drag .knob { transform:scale(1.15); }
.tip { position:absolute; bottom:24px; transform:translateX(-50%); background:var(--ink); color:var(--bg); font-size:12px; padding:4px 8px; border-radius:6px; white-space:nowrap; pointer-events:none; font-variant-numeric:tabular-nums; }
.pctl { display:flex; justify-content:space-between; align-items:center; margin-top:6px; gap:10px; }
.pl, .pr { display:flex; align-items:center; gap:6px; }
.pbar button.ib { border:0; background:transparent; padding:6px; border-radius:50%; color:var(--ink); display:inline-flex; }
.pbar button.ib:hover { background:var(--card); }
.pbar button.play { width:46px; height:46px; border-radius:50%; border:0; background:var(--acc); color:var(--on-emph); display:inline-flex; align-items:center; justify-content:center; padding:0; box-shadow:0 2px 8px color-mix(in srgb, var(--acc) 40%, transparent); }
.pbar button.play:hover { filter:brightness(1.08); }
.pbar button.play svg { margin-left:2px; }
.pbar button.play.playing svg { margin-left:0; }
.time { font-size:13px; color:var(--mute); font-variant-numeric:tabular-nums; margin-left:6px; }
.time b { color:var(--ink); font-weight:600; }
.pbar .chip { border-radius:99px; padding:4px 10px; font-size:12px; font-weight:600; background:var(--card); }
.vol { display:inline-flex; align-items:center; }
.vol input[type=range] { -webkit-appearance:none; appearance:none; width:80px; height:4px; padding:0; border:0; border-radius:99px; background:linear-gradient(to right, var(--ink) var(--v,100%), var(--line) var(--v,100%)); }
.vol input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:12px; height:12px; border-radius:50%; background:var(--ink); }
.vol input[type=range]::-moz-range-thumb { width:12px; height:12px; border:0; border-radius:50%; background:var(--ink); }
@media (max-width:640px) { .vol input[type=range] { display:none; } .pbar { padding:12px 12px 8px; } }

/* ===== player layout (stage + question panel) ===== */
.pl-wrap { display:grid; grid-template-columns:1fr 320px; gap:16px; height:calc(100vh - 104px); min-height:560px; }
.stage { position:relative; display:flex; flex-direction:column; padding:18px 22px 16px; min-height:0; }
.stage-top { display:flex; align-items:center; gap:10px; min-width:0; }
.stage-top .back { text-decoration:none; font-size:18px; color:var(--mute); padding:2px 6px; border-radius:6px; }
.stage-top .back:hover { background:var(--sub); color:var(--ink); }
.fname { font-size:13px; color:var(--mute); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; min-width:0; }
.qbadge { display:flex; align-items:baseline; gap:8px; flex-shrink:0; }
.qbadge b { font-size:22px; font-variant-numeric:tabular-nums; }
.qbadge span { font-size:13px; color:var(--mute); }
.stage-main { flex:1; min-height:0; display:flex; flex-direction:column; padding:8px 76px 8px 6px; }
.lines { flex:1; min-height:0; overflow:auto; display:flex; flex-direction:column; justify-content:center; gap:14px; padding:18px 0; scrollbar-width:none; }
.lines::-webkit-scrollbar { display:none; }
.stage.typing .lines { flex:0 1 auto; max-height:42%; justify-content:flex-start; gap:8px; padding:10px 0; }
.ln { display:flex; align-items:baseline; gap:14px; font-size:28px; line-height:1.35; color:var(--ink); transition:color .2s, opacity .2s; }
.ln .tx { flex:1; }
.ln.boiler { font-size:16px; color:var(--mute); }
.ln.choice { font-size:24px; }
.ln:not(.now):not(.masked) { color:color-mix(in srgb, var(--ink) 55%, transparent); }
.ln.boiler:not(.masked) { color:var(--mute); }
.ln.now { color:var(--ink); }
.ln.dim { color:var(--mute); font-size:16px; }
.stage.typing .ln { font-size:18px; gap:10px; }
.stage.typing .ln.boiler { font-size:13px; }
.opt { flex-shrink:0; width:1.5em; height:1.5em; border-radius:50%; border:2px solid currentColor; display:inline-flex; align-items:center; justify-content:center; font-size:.62em; font-weight:700; transform:translateY(-.08em); }
.ln.masked .opt { color:var(--mute); }
.dots { display:inline-flex; gap:.45em; align-items:center; height:1em; }
.dots i { width:.28em; height:.28em; border-radius:50%; background:var(--miss); display:block; }
.ln.masked.now .dots i { background:var(--acc); animation:pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity:.35; } }
.stage .memo-box { margin-top:10px; overflow:auto; min-height:0; flex:1; }
.fab { position:absolute; right:18px; top:50%; transform:translateY(-60%); display:flex; flex-direction:column; gap:14px; z-index:2; }
.fabb { width:56px; height:56px; border-radius:50%; padding:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
  border:2px solid var(--acc); background:var(--card); color:var(--acc-ink); box-shadow:0 3px 10px rgba(0,0,0,.08); }
.fabb span { font-size:10px; font-weight:600; }
.fabb.on { background:var(--acc-fill); color:var(--on-acc); box-shadow:0 4px 14px color-mix(in srgb, var(--acc) 45%, transparent); }
.fabb:hover { filter:brightness(1.05); transform:scale(1.04); }
.stage .pbar { margin-top:8px; }
.pbar .ib.tog.on, .pbar #loop.on { background:var(--ink); color:var(--card); }
.pbar .chip.on { background:var(--acc-fill); color:var(--on-acc); border-color:var(--acc); }

.qpanel { display:flex; flex-direction:column; padding:14px 0 0; min-height:0; }
.qp-head { display:flex; justify-content:space-between; align-items:center; padding:0 16px 10px; gap:8px; }
.qp-sel, .qp-edit { padding:0 16px 10px; font-size:12px; color:var(--mute); display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.qp-sel[hidden], .qp-edit[hidden] { display:none; }
.qp-sel .sm { padding:4px 9px; font-size:12px; }
.qp-edit a { color:var(--acc-ink); cursor:pointer; font-weight:600; }
.qp-scroll { flex:1; min-height:0; overflow-y:auto; padding:0 12px 16px 16px; scrollbar-width:thin; scrollbar-color:transparent transparent; transition:scrollbar-color .3s; }
.qp-scroll.scrolling { scrollbar-color:var(--miss) transparent; }
.qp-scroll::-webkit-scrollbar { width:6px; }
.qp-scroll::-webkit-scrollbar-thumb { background:transparent; border-radius:99px; }
.qp-scroll.scrolling::-webkit-scrollbar-thumb { background:var(--miss); }
.qpanel .part { margin:0; padding:14px 0; border-top:2px solid var(--acc-soft); }
.qpanel .part:first-child { border-top:0; padding-top:4px; }
.qpanel .part h3 { font-size:17px; color:var(--ink); font-weight:700; margin-bottom:10px; align-items:baseline; }
.qpanel .part h3 a { font-size:12px; color:var(--acc-ink); }
.qpanel .grid { grid-template-columns:repeat(5, 1fr); gap:7px; }
.qpanel .n { height:40px; font-size:14px; border-width:1.5px; border-color:var(--ink); border-radius:9px; }
.qpanel .n.off { border-color:var(--line); }
.qpanel .n.miss { border-color:var(--miss); }
.qpanel .n.est { border-color:var(--acc); }
.qpanel .n.cur { border-color:var(--acc); }
.more { position:relative; }
.more summary { list-style:none; cursor:pointer; width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:18px; color:var(--mute); border:1px solid var(--line); }
.more summary::-webkit-details-marker { display:none; }
.more[open] summary { border-color:var(--acc); color:var(--acc-ink); }
.more .menu { position:absolute; right:0; top:38px; width:260px; background:var(--card); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,.12); padding:6px; z-index:10; }
.more .mi { padding:10px; font-size:12px; color:var(--mute); display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.more .mi + .mi { border-top:1px solid var(--line); }
.more .mi.keys { line-height:1.9; display:block; }

@media (max-width:700px) {
  .pl-wrap { grid-template-columns:1fr; height:auto; }
  .stage { min-height:72vh; }
  .qpanel { max-height:none; }
  .qp-scroll { overflow:visible; }
  .qpanel .grid { grid-template-columns:repeat(5, 1fr); }
  .ln { font-size:21px; } .ln.choice { font-size:19px; }
  .stage-main { padding-right:64px; }
  .fabb { width:48px; height:48px; }
  .fab { right:10px; }
}
/* typing mode: transcript on top, memo below, both scroll inside the stage */
.stage-main { overflow:hidden; }
.stage.typing .lines { flex:0 0 auto; max-height:36%; }
.stage .memo-box { flex:1 1 0; min-height:0; overflow:auto; padding:14px 16px; }
.stage .memo-box textarea#mMemo { min-height:44px; }
.stage .memo-box label.f { margin:8px 0 4px; }
.pl-wrap { grid-template-columns:minmax(0,1fr) 320px; }
.pl-wrap > * { min-width:0; }
.pbar .chip, .time { white-space:nowrap; }
@media (max-width:700px) {
  .pl-wrap { grid-template-columns:minmax(0,1fr); }
  .pctl { flex-wrap:wrap; row-gap:6px; }
  .time span:not(#tDur) { display:inline; }
}
@media (max-width:640px) {
  .stage { padding:14px 14px 12px; }
  .stage-main { padding:4px 58px 4px 2px; }
  .ln { font-size:19px; gap:10px; } .ln.choice { font-size:17px; }
  .pbar .pr { gap:2px; }
  .pbar button.play { width:42px; height:42px; }
  .time { font-size:12px; margin-left:2px; }
  .qpanel .n { height:38px; }
}

/* previous-memo bubble */
.bubble { position:absolute; top:56px; right:22px; z-index:4; display:flex; align-items:center; gap:6px; padding:7px 12px 7px 10px;
  border-radius:16px 16px 4px 16px; border:1px solid var(--acc); background:var(--acc-soft); color:var(--acc-ink); font-size:12px; font-weight:600;
  box-shadow:0 3px 10px color-mix(in srgb, var(--acc) 18%, transparent); animation:pop .25s ease-out; }
.bubble[hidden] { display:none; }
.bubble b { background:var(--acc-fill); color:var(--on-acc); border-radius:99px; font-size:11px; min-width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; padding:0 5px; }
.bubble:hover, .bubble.open { background:var(--acc-fill); color:var(--on-acc); }
.bubble:hover b, .bubble.open b { background:var(--on-acc); color:var(--acc); }
@keyframes pop { from { transform:scale(.85); opacity:0; } }
.prevpop { position:absolute; top:96px; right:22px; width:min(380px, calc(100% - 44px)); max-height:55%; overflow:auto; z-index:5;
  background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:0 10px 30px rgba(0,0,0,.15); padding:6px 0; }
.pp-head { display:flex; justify-content:space-between; align-items:center; padding:8px 14px; font-size:14px; }
.pp-head .x { border:0; font-size:20px; line-height:1; padding:0 4px; color:var(--mute); background:transparent; }
.pp-item { padding:10px 14px; border-top:1px solid var(--line); }
.pp-date { font-size:12px; color:var(--mute); display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.pp-del { border:0; background:transparent; color:var(--danger); font-size:12px; padding:0; }
.pp-v { font-size:14px; line-height:1.6; white-space:pre-wrap; word-break:break-word; }
@media (max-width:640px) { .bubble { top:50px; right:14px; } .prevpop { top:90px; right:14px; width:calc(100% - 28px); } }

/* Korean translation under a heard sentence */
.ln .ko { font-size:.62em; line-height:1.5; color:var(--acc-ink); margin-top:4px; font-weight:500; }
.ln.masked .ko { font-size:16px; }
.stage.typing .ln .ko { font-size:13px; margin-top:2px; }
.ln.masked .tx { display:flex; flex-direction:column; }
@keyframes fadeup { from { opacity:0; transform:translateY(3px); } }
.fabb[hidden] { display:none; }
.more .mi.credit { font-size:11px; }
@media (max-width:640px) { .ln .ko { font-size:13px; } }

/* keep long blocks scrollable from the top while short blocks stay vertically centred */
.lines { justify-content:flex-start; }
.lines > :first-child { margin-top:auto; }
.lines > :last-child { margin-bottom:auto; }
@media (max-width:700px) { .stage { scroll-margin-top:64px; } }
@media (max-width:420px) { #nav { gap:8px; font-size:12.5px; } .brand { font-size:16px; } }
.status { white-space:nowrap; }
@media (max-width:640px) {
  .files th:nth-child(2), .files td:nth-child(2) { width:1%; }
  .files td, .files th { padding:10px 4px; }
}

/* ===== phone: full-screen player + bottom sheet of question numbers ===== */
.sheet-grip, .peek-row, .sheet-dim { display:none; }
@media (max-width:700px) and (orientation:portrait), (max-width:700px) and (min-height:541px) {
  body.player-mode { overflow:hidden; overscroll-behavior:none; }
  body.player-mode main { padding:8px 8px 0; }
  body.player-mode .pl-wrap { --peek-h:122px; display:block; height:calc(100dvh - var(--hdr, 56px) - 8px); min-height:0; }
  body.player-mode .stage { height:100%; min-height:0; padding-bottom:calc(var(--peek-h) + 8px); border-radius:14px 14px 0 0; }
  body.player-mode .fab { top:42%; }

  body.player-mode .qpanel {
    position:fixed; left:0; right:0; bottom:0; z-index:30; height:min(76dvh, 620px);
    border-radius:20px 20px 0 0; border-bottom:0; padding:0;
    transform:translateY(calc(100% - var(--peek-h))); transition:transform .3s cubic-bezier(.2,.8,.2,1);
    box-shadow:0 -6px 24px rgba(0,0,0,.12); display:flex; flex-direction:column;
  }
  body.player-mode .qpanel.open { transform:none; }
  body.player-mode .qpanel.dragging { transition:none; }
  body.player-mode .sheet-grip { display:block; padding:8px 16px 8px; touch-action:none; cursor:grab; flex-shrink:0; }
  .sheet-grip .bar { display:block; width:42px; height:5px; border-radius:3px; background:var(--miss); margin:0 auto 8px; }
  .peek-head { display:flex; justify-content:space-between; align-items:baseline; }
  .peek-head b { font-size:16px; }
  .peek-hint { font-size:12px; color:var(--mute); }
  body.player-mode .peek-row { display:grid; grid-template-columns:repeat(5, 1fr); gap:7px; padding:0 16px 14px; flex-shrink:0; }
  body.player-mode .qpanel.open .peek-row { display:none; }
  body.player-mode .qp-head { padding-top:2px; }
  body.player-mode .qp-scroll { overflow-y:auto; overscroll-behavior:contain; padding-bottom:24px; }
  body.player-mode .sheet-dim { display:block; position:fixed; inset:0; z-index:29; background:rgba(0,0,0,.28); opacity:0; pointer-events:none; transition:opacity .25s; }
  body.player-mode .sheet-dim.show { opacity:1; pointer-events:auto; }
  body.player-mode .qpanel .n { height:40px; }
}
@media (max-width:700px) and (orientation:portrait), (max-width:700px) and (min-height:541px) {
  body.player-mode .qpanel:not(.open):not(.dragging) > :not(.sheet-grip):not(.peek-row) { visibility:hidden; }
}

/* ===== top bar: ← back / ☰ list + page title ===== */
.hl { display:flex; align-items:center; gap:6px; min-width:0; flex:1; }
.hbtn { width:38px; height:38px; padding:0; border:0; border-radius:10px; background:transparent; color:var(--ink); display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; margin-left:-8px; }
.hbtn:hover, .hbtn.on { background:var(--sub); border:0; }
.htitle { font-size:16px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.top { gap:12px; }
#nav { flex-shrink:0; }
.menu-panel { overflow-y:auto; overscroll-behavior:contain; position:fixed; top:calc(var(--hdr, 60px) - 4px); left:14px; z-index:50; width:270px; max-width:calc(100vw - 28px);
  background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:0 12px 32px rgba(0,0,0,.16); padding:6px; animation:menuIn .16s ease-out; }
@keyframes menuIn { from { opacity:0; transform:translateY(-4px); } }
.mhead { padding:12px 12px 12px; border-bottom:1px solid var(--line); margin-bottom:4px; display:flex; flex-direction:column; gap:2px; }
.mhead b { font-size:15px; }
.mhead > span { font-size:12px; color:var(--mute); }
.mplan { margin-top:8px; font-size:12px; color:var(--mute); display:flex; align-items:center; gap:6px; }
.mitem { display:flex; align-items:center; justify-content:space-between; padding:12px; border-radius:9px; text-decoration:none; color:var(--ink); font-size:15px; }
.mitem:hover { background:var(--sub); }
.mitem.on { color:var(--acc-ink); font-weight:600; }
.mitem.danger { color:var(--danger); }
.mtag { font-size:11px; background:var(--acc-soft); color:var(--acc-ink); border-radius:99px; padding:2px 8px; font-weight:600; }
.stage-top .fname:empty { flex:1; }
@media (max-width:640px) {
  .htitle { font-size:15px; }
  #nav .pill { display:none; }
}
@media (max-width:700px) and (orientation:portrait), (max-width:700px) and (min-height:541px) { body.player-mode .top { z-index:31; } }

/* profile circle (account menu) */
.avatar-btn { padding:3px; border:0; border-radius:50%; background:transparent; display:inline-flex; }
.avatar-btn:hover, .avatar-btn.on { background:var(--sub); border:0; }
.avatar { width:34px; height:34px; border-radius:50%; background:var(--acc-fill); color:var(--on-acc); display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:15px; flex-shrink:0; }
.avatar.paid { box-shadow:0 0 0 2px var(--card), 0 0 0 4px #e0a526; }
.avatar.big { width:42px; height:42px; font-size:18px; }
.mwho { display:flex; gap:10px; align-items:center; }
.mwho > div { display:flex; flex-direction:column; min-width:0; }
.mwho b { font-size:15px; }
.mwho span { font-size:12px; color:var(--mute); overflow:hidden; text-overflow:ellipsis; }
.mhead .meter { width:100%; margin-top:8px; height:6px; }
#nav { display:flex; align-items:center; }
.mwho .avatar { color:var(--on-acc); font-size:18px; overflow:visible; }
.htitle.main { font-size:17px; }

/* drive: tap a file name to open; files being prepared show a spinner above the list */
.files a.fname { font-weight:600; font-size:15px; color:var(--ink); text-decoration:none; word-break:break-all; display:inline-block; padding:2px 0; }
.files a.fname:hover { color:var(--acc-ink); text-decoration:underline; }
.files td:first-child { width:100%; }
.pending { display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.prow { display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:12px; background:var(--sub); }
.prow.err { background:var(--bad-soft); }
.prow button { flex-shrink:0; }
.pinfo { flex:1; min-width:0; }
.pname { font-weight:600; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.spinner { width:22px; height:22px; border-radius:50%; border:3px solid var(--line); border-top-color:var(--acc); animation:spin .8s linear infinite; flex-shrink:0; }
@keyframes spin { to { transform:rotate(360deg); } }
.perr { width:22px; height:22px; border-radius:50%; background:var(--danger); color:var(--on-danger); font-weight:700; font-size:13px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.drop b { font-size:15px; }

/* ===== bottom progress panel for uploads / analysis ===== */
.uppanel { position:fixed; left:50%; transform:translateX(-50%); bottom:16px; z-index:40; width:min(560px, calc(100vw - 20px));
  background:var(--card); border:1px solid var(--line); border-radius:20px; box-shadow:0 10px 30px rgba(0,0,0,.18); overflow:hidden; animation:upIn .25s ease-out; }
@keyframes upIn { from { transform:translate(-50%, 20px); opacity:0; } }
.uphead { display:flex; align-items:center; gap:14px; padding:14px 14px 12px 18px; }
.uptext { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.uptext b { font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.uptext span { font-size:13px; color:var(--mute); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upbtn { width:40px; height:40px; border-radius:50%; border:0; background:var(--sub); font-size:18px; padding:0; flex-shrink:0; color:var(--ink); }
.upbtn:hover { border:0; filter:brightness(.97); }
.upbar { height:4px; background:var(--sub); }
.upbar i { display:block; height:100%; background:var(--acc); transition:width .5s; }
.uplist { max-height:42vh; overflow:auto; border-top:1px solid var(--line); padding:6px 10px; }
.upitem { display:flex; align-items:center; gap:12px; padding:10px 8px; }
.upitem + .upitem { border-top:1px solid var(--line); }
.upitem .uptext b { font-size:14px; }
.upitem .uptext span { font-size:12px; }
.upitem button, .upitem .btn { flex-shrink:0; padding:5px 10px; font-size:12px; }
.upmini { height:4px; border-radius:99px; background:var(--sub); margin-top:5px; overflow:hidden; }
.upmini i { display:block; height:100%; background:var(--acc); transition:width .5s; }
.spinner.sm { width:18px; height:18px; border-width:2.5px; }
.pok { width:22px; height:22px; border-radius:50%; background:var(--ok-soft); color:var(--ok); font-size:13px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
body:has(#upPanel) main { padding-bottom:110px; }

/* subtitle size setting */
#lines { zoom:var(--sub-scale, 1); }

/* ===== settings popup ===== */
.modal-back { position:fixed; inset:0; z-index:60; background:rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; padding:16px; animation:fadeIn .15s ease-out; }
@keyframes fadeIn { from { opacity:0; } }
.modal { width:min(520px, 100%); max-height:min(86vh, 760px); display:flex; flex-direction:column; background:var(--card); color:var(--ink);
  border-radius:20px; box-shadow:0 20px 50px rgba(0,0,0,.25); overflow:hidden; animation:popUp .2s ease-out; }
@keyframes popUp { from { transform:translateY(10px) scale(.98); opacity:0; } }
.mh { display:flex; align-items:center; gap:8px; padding:14px 14px 12px 20px; border-bottom:1px solid var(--line); }
.mh b { font-size:18px; }
.mstatus { flex:1; font-size:12px; color:var(--mute); }
.mx, .mback { width:36px; height:36px; border-radius:50%; border:0; background:var(--sub); font-size:16px; padding:0; color:var(--ink); flex-shrink:0; }
.mback { font-size:24px; line-height:1; margin-left:-8px; }
.mx:hover, .mback:hover { border:0; filter:brightness(.97); }
.mbody { overflow:auto; padding:6px 20px 22px; }
.mbody section { padding:14px 0 6px; }
.mbody section + section { border-top:1px solid var(--line); }
.mbody h4 { margin:0 0 6px; font-size:12px; color:var(--mute); font-weight:600; }
.srow { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:9px 0; flex-wrap:wrap; }
.slabel { font-size:15px; display:flex; flex-direction:column; gap:2px; }
.slabel small { font-size:12px; color:var(--mute); }
.srow .seg button { padding:6px 10px; font-size:13px; }
.sval { color:var(--mute); font-size:14px; }
.tgl { width:48px; height:28px; border-radius:99px; border:0; background:var(--line); padding:0; position:relative; flex-shrink:0; transition:background .2s; }
.tgl i { position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .2s; }
.tgl.on { background:var(--ink); }
.tgl.on i { background:var(--card); }
.tgl.on i { transform:translateX(20px); }
.tgl:hover { border:0; }
.slink { width:100%; display:flex; align-items:center; gap:10px; padding:12px 0; border:0; border-radius:0; background:transparent; text-align:left; font-size:15px; color:var(--ink); }
.slink:hover { border:0; background:transparent; color:var(--acc-ink); }
.slink > span:first-child { flex:1; }
.slink.danger { color:var(--danger); }
.slink .chev { color:var(--mute); font-size:20px; line-height:1; }
.sform { padding-top:10px; }
.sform button.primary, .sform .danger-fill { width:100%; padding:12px; margin-top:6px; font-size:15px; }
.danger-fill { background:var(--danger); color:var(--on-danger); border-color:var(--danger); }
.warn { background:var(--bad-soft); border-radius:12px; padding:14px 16px; font-size:14px; line-height:1.6; }
.warn ul { margin:6px 0; padding-left:18px; }
.warn p { margin:4px 0 0; color:var(--mute); font-size:13px; }
.lics { padding-top:8px; display:flex; flex-direction:column; gap:10px; }
.lic { border:1px solid var(--line); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:3px; font-size:13px; color:var(--mute); }
.lic b { color:var(--ink); font-size:15px; }
.lic b small { color:var(--mute); font-weight:400; }
.lic a { font-size:13px; word-break:break-all; }
@media (max-width:640px) {
  .modal-back { align-items:flex-end; padding:0; }
  .modal { width:100%; max-height:90dvh; border-radius:20px 20px 0 0; }
  .srow .seg button { padding:6px 8px; font-size:12.5px; }
}
/* toasts stay visible above the settings popup and the progress tray */
.toast { z-index:80; }
body:has(#upPanel) .toast { bottom:120px; }
.upbtn[hidden] { display:none; }
.upicon { display:inline-flex; }

.card.notice { margin-bottom:16px; border-color:var(--warn); background:var(--warn-soft); color:var(--ink); font-size:14px; line-height:1.6; }

.refund-rule { margin:-4px 0 16px; }
#orders { margin-top:4px; }
#orders h2 { margin:0 0 8px; }
.orow { display:flex; align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--line); font-size:14px; }
.orow .omain { flex:1; min-width:0; }
.orow .omain .sub { margin:2px 0 0; }
.orow .oact { flex:none; max-width:45%; text-align:right; }

/* yes/no dialog (ads, notices) */
.ask-back { z-index:70; }
.modal.ask { padding:22px 22px 18px; max-width:420px; }
.modal.ask h2 { margin:0 0 8px; font-size:18px; }
.modal.ask p { margin:0 0 18px; color:var(--mute); font-size:14px; line-height:1.6; }
.ask-btns { display:flex; gap:8px; justify-content:flex-end; }
.ask-btns button { padding:9px 16px; }

.kebab { width:36px; height:36px; padding:0; border:0; background:transparent; border-radius:50%; color:var(--mute); display:inline-flex; align-items:center; justify-content:center; }
.kebab:hover, .kebab.on { background:var(--sub); color:var(--ink); border:0; }
.ask-input { display:flex; align-items:center; gap:6px; margin:4px 0 18px; }
.ask-input span { color:var(--mute); font-size:14px; flex:none; }
.finfo { display:grid; grid-template-columns:auto 1fr; gap:8px 16px; margin:4px 0 18px; font-size:14px; }
.finfo dt { color:var(--mute); }
.finfo dd { margin:0; word-break:break-all; }

.pin { display:inline-flex; vertical-align:-2px; margin-right:6px; color:var(--acc); }
.files tr.pinned td { background:var(--acc-soft); }
.files tr.pinned td:first-child { border-radius:10px 0 0 10px; }
.files tr.pinned td:last-child { border-radius:0 10px 10px 0; }
.files tr.pinned .pin { color:var(--acc-ink); }
/* "모두 선택" + tap hint in the question panel */
.selall { display:inline-flex; align-items:center; gap:8px; font-size:14px; font-weight:600; cursor:pointer; user-select:none; }
/* custom rounded checkbox: soft square, pink fill + dark tick when on */
.selall input { appearance:none; -webkit-appearance:none; width:20px; height:20px; margin:0; padding:0; flex:none; cursor:pointer;
  border:1.5px solid var(--mute); border-radius:7px; background:var(--card); display:inline-grid; place-content:center;
  transition:background .15s, border-color .15s; }
.selall input::after { content:""; width:10px; height:6px; border:2.2px solid var(--on-acc); border-top:0; border-right:0;
  border-radius:1px; transform:translateY(-1px) rotate(-45deg) scale(0); transition:transform .15s; }
.selall input:checked { background:var(--acc-fill); border-color:var(--acc); }
.selall input:checked::after { transform:translateY(-1px) rotate(-45deg) scale(1); }
.selall input:focus-visible { outline:2px solid var(--acc); outline-offset:2px; }
.selall:hover input:not(:checked) { border-color:var(--ink); }
.qp-hint { font-size:12px; color:var(--mute); }
.qpanel .n { touch-action:manipulation; user-select:none; -webkit-user-select:none; }

/* some questions on: hatched stretches with upright end lines */
#segmarks { position:absolute; inset:0; pointer-events:none; }
#segmarks i { position:absolute; top:1px; bottom:1px; width:2px; margin-left:-1px; border-radius:1px; background:var(--ink); opacity:.75; }
.track.partial .rail { top:5px; height:12px; }
.track.partial:hover .rail, .track.partial.drag .rail { top:4px; height:14px; }
/* only some questions on: selected stretches solid dark, the rest stays pale */
.track.partial #segs .seg { background:var(--acc-ink); }
.track.partial .curseg { background:transparent; box-shadow:inset 0 0 0 2px var(--acc-fill); border-radius:2px; }
.track.partial .fill { background:color-mix(in srgb, var(--ink) 14%, transparent); border-radius:0; }
.track.partial #ticks { display:none; }
.track.partial .knob { top:4px; }



/* sentence under the pointer turns green (muted green that sits with the rose palette; 5.1:1 on white); click = play from 1 s before */
:root { --hl-ink:#3b7a57; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hl-ink:#9be7b0; } }
:root[data-theme="dark"] { --hl-ink:#9be7b0; }
#lines .ln[data-s] { cursor:pointer; }
#lines .ln[data-s] .tx { transition:color .12s; }
#lines .ln.hl .tx, #lines .ln.hl .tx .ko, #lines .ln.hl .opt { color:var(--hl-ink); }
#lines .ln.hl .opt { border-color:var(--hl-ink); }
#lines .ln.hl .dots i { background:var(--hl-ink); }
/* switched-off question: dashed outline, still clearly a button */
.n.off, .qpanel .n.off { color:var(--mute); background:var(--card); text-decoration:none; border-style:dashed; border-color:var(--mute); }
/* position not found: grey fill (dashed now means "off") */
.n.miss, .qpanel .n.miss { border-style:solid; border-color:var(--line); background:var(--sub); color:var(--miss); }

/* signup agreements */
.agree { margin:14px 0 4px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; display:flex; flex-direction:column; gap:10px; }
.agree .ck { display:flex; align-items:center; gap:10px; font-size:14px; cursor:pointer; margin:0; }
.agree .ck.all { font-weight:700; padding-bottom:10px; border-bottom:1px solid var(--line); }
.agree .ck span { flex:1; }
.agree .ck a { font-size:13px; color:var(--acc-ink); }
.agree input, .selall input { appearance:none; -webkit-appearance:none; width:20px; height:20px; margin:0; padding:0; flex:none; cursor:pointer;
  border:1.5px solid var(--mute); border-radius:7px; background:var(--card); display:inline-grid; place-content:center; }
.agree input::after { content:""; width:10px; height:6px; border:2.2px solid var(--on-acc); border-top:0; border-right:0; border-radius:1px; transform:translateY(-1px) rotate(-45deg) scale(0); transition:transform .15s; }
.agree input:checked { background:var(--acc-fill); border-color:var(--acc); }
.agree input:checked::after { transform:translateY(-1px) rotate(-45deg) scale(1); }
.forgot { text-align:right; margin:8px 0 2px; font-size:13px; }
.forgot a { color:var(--mute); }
/* legal documents */
.legal { font-size:14px; line-height:1.75; }
.legal h1 { font-size:22px; margin:0 0 6px; }
.legal h2 { font-size:16px; margin:22px 0 6px; }
.legal ol, .legal ul { padding-left:20px; margin:6px 0; }
.legal li { margin:3px 0; }
.legal table { width:100%; border-collapse:collapse; font-size:13px; margin:8px 0; }
.legal th, .legal td { border:1px solid var(--line); padding:7px 8px; vertical-align:top; text-align:left; }
.legal th { background:var(--sub); }
.legal-meta { color:var(--mute); font-size:12.5px; }
.legal-card { padding:24px 26px; }
.doc-scroll { max-height:60vh; overflow:auto; margin:0 0 16px; padding-right:6px; }
.modal.ask:has(.doc-scroll) { max-width:640px; }
.doc-in-modal { max-height:62vh; overflow:auto; }
.backup-card { margin-bottom:16px; }
.backup-card h2 { margin:0 0 6px; font-size:18px; }
.bad { color:var(--danger); font-weight:600; }

/* signup email code */
.mailrow { display:flex; gap:8px; align-items:center; }
.mailrow input { flex:1; min-width:0; margin:0; }
.mailrow button { flex:none; white-space:nowrap; padding:9px 12px; font-size:13px; }
.mailrow input[readonly] { background:var(--soft, #f5f5f7); color:var(--mute); }
#sendCode.done { color:var(--ok); border-color:var(--ok-soft); background:color-mix(in srgb, var(--ok-soft) 35%, transparent); }
.codebox { margin-top:8px; }
.codebox .timer { font-size:13px; font-variant-numeric:tabular-nums; color:var(--acc-ink); min-width:34px; text-align:right; }
.codebox #code { letter-spacing:4px; font-variant-numeric:tabular-nums; }
.codemsg { font-size:12.5px; color:var(--mute); margin-top:6px; line-height:1.5; }
.codebox #code:placeholder-shown { letter-spacing:normal; }

/* ===== phone held sideways: player on the left, question numbers on the right (like the web) ===== */
@media (orientation:landscape) and (max-height:540px) {
  .top { padding:6px 16px; }
  .top .avatar { width:30px; height:30px; font-size:14px; }
  body.player-mode { overflow:hidden; overscroll-behavior:none; }
  body.player-mode main { max-width:none; padding:6px max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
  body.player-mode .pl-wrap { display:grid; grid-template-columns:minmax(0,1fr) clamp(220px, 31vw, 300px); gap:8px;
    height:calc(100dvh - var(--hdr, 46px) - 6px); min-height:0; }
  body.player-mode .stage { height:100%; min-height:0; padding:8px 12px 8px; border-radius:14px 14px 0 0; }
  body.player-mode .stage-top { padding-right:2px; }
  body.player-mode .qbadge b { font-size:17px; }
  body.player-mode .qbadge span { font-size:12px; }
  body.player-mode .stage-main { padding:2px 54px 2px 2px; }
  body.player-mode .lines { gap:8px; padding:6px 0; }
  body.player-mode .ln { font-size:18px; gap:10px; }
  body.player-mode .ln.choice { font-size:16px; }
  body.player-mode .ln .ko { font-size:12.5px; }
  body.player-mode .stage.typing .lines { max-height:40%; }
  body.player-mode .stage .memo-box { padding:8px 10px; }
  body.player-mode .fab { top:40px; bottom:auto; right:8px; transform:none; gap:8px; }
  body.player-mode .fabb { width:42px; height:42px; }
  body.player-mode .fabb svg { width:18px; height:18px; }
  body.player-mode .fabb span { font-size:9px; }
  body.player-mode .stage .pbar { margin-top:4px; padding:6px 10px 4px; border-radius:12px; }
  body.player-mode .pctl { margin-top:2px; flex-wrap:nowrap; gap:6px; }
  body.player-mode .pbar .pr { gap:2px; }
  body.player-mode .pbar button.play { width:38px; height:38px; }
  body.player-mode .pbar button.ib { padding:5px; }
  body.player-mode .time { font-size:12px; }
  body.player-mode .vol input[type=range] { display:none; }
  body.player-mode .bubble { top:40px; right:58px; }
  body.player-mode .prevpop { top:76px; right:58px; max-height:60%; }

  body.player-mode .qpanel { position:static; transform:none; height:100%; max-height:none; min-height:0; display:flex; flex-direction:column;
    padding:10px 0 0; border-radius:14px 14px 0 0; box-shadow:none; }
  body.player-mode .qpanel > * { visibility:visible; }
  body.player-mode .sheet-grip, body.player-mode .peek-row, body.player-mode .sheet-dim { display:none; }
  body.player-mode .qp-head { padding:0 12px 8px; }
  body.player-mode .qp-scroll { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 8px 12px 12px; }
  body.player-mode .qpanel .part { padding:10px 0; }
  body.player-mode .qpanel .part h3 { font-size:15px; margin-bottom:8px; }
  body.player-mode .qpanel .grid { grid-template-columns:repeat(5, 1fr); gap:5px; }
  body.player-mode .qpanel .n { height:34px; font-size:13px; border-radius:8px; }
}

/* ===== other screens held sideways ===== */
@media (orientation:landscape) and (max-height:540px) {
  .auth { margin:14px auto 24px; }
  main { padding-top:12px; }
  .uppanel { left:auto; right:12px; bottom:10px; transform:none; width:min(400px, calc(100vw - 24px)); animation:upInSide .25s ease-out; }
  .uplist { max-height:28vh; }
  .uphead { padding:10px 12px 8px 14px; }
  body:has(#upPanel) .toast { bottom:24px; }
  .modal { max-height:calc(100dvh - 24px); }
  .modal-back { padding:12px; }
}
@keyframes upInSide { from { transform:translateY(20px); opacity:0; } }
/* keyboard up while typing sideways (only ~150-250px left): just the memo and the controls */
@media (orientation:landscape) and (max-height:300px) {
  body.player-mode .top, body.player-mode .qpanel { display:none; }
  body.player-mode main { padding-top:4px; }
  body.player-mode .pl-wrap { grid-template-columns:minmax(0,1fr); height:calc(100dvh - 4px); }
  body.player-mode .stage { padding:4px 8px 4px; }
  body.player-mode .stage.typing .stage-top, body.player-mode .stage.typing .fab,
  body.player-mode .stage.typing .lines, body.player-mode .stage.typing .memo-box .row { display:none; }
  body.player-mode .stage.typing .stage-main { padding:0; }
  body.player-mode .stage.typing .memo-box { padding:2px 4px 0; display:flex; flex-direction:column; }
  body.player-mode .stage.typing .memo-box h3 { margin:0 0 4px; font-size:13px; }
  body.player-mode .stage.typing .memo-box textarea { flex:1; min-height:40px; resize:none; }
  body.player-mode .stage .pbar { padding:2px 8px 2px; margin-top:4px; }
  body.player-mode .pctl { margin-top:0; }
  body.player-mode .pbar button.play { width:32px; height:32px; }
  body.player-mode .pbar .chip { padding:3px 8px; }
}

/* ===== profile characters ===== */
.avatar.ava { background:#fff5f7; border:1.5px solid var(--acc-fill); overflow:hidden; padding:0; }
.avatar.ava img { width:74%; height:74%; object-fit:contain; object-position:center; display:block; margin:auto; pointer-events:none; user-select:none; }
.avatar.pop { animation:avaPop .5s cubic-bezier(.22,1,.36,1); }
@keyframes avaPop { 0% { transform:scale(.6); } 100% { transform:scale(1); } }
.slink .sval .sava { width:24px; height:24px; border-radius:50%; background:#fff5f7; object-fit:contain; padding:2px; box-sizing:border-box; vertical-align:-6px; margin-right:6px; }
.opt-hint { font-size:12px; color:var(--mute); margin:-2px 0 4px; }

.ava-pick { display:grid; grid-template-columns:repeat(auto-fill, minmax(66px, 1fr)); gap:8px 6px; margin:4px 0 6px; }
.ava-opt { position:relative; display:flex; flex-direction:column; align-items:center; gap:4px; padding:6px 2px 4px; border:0; border-radius:14px;
  background:transparent; color:var(--mute); font:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.ava-opt:hover, .ava-opt.on, .ava-opt.on:hover { border:0; background:transparent; box-shadow:none; }
@media (hover:hover) { .ava-opt:hover .ava-face { border-color:var(--acc-fill); } }
.ava-opt small { font-size:12px; line-height:1.2; }
.ava-face { width:58px; height:58px; border-radius:50%; background:#fff5f7; border:2px solid transparent; display:flex; align-items:center; justify-content:center;
  overflow:visible; transition:border-color .2s, background .2s, filter .3s; }
.ava-face img { width:118%; height:118%; object-fit:contain; pointer-events:none; user-select:none; transform-origin:50% 85%; }
.ava-init { font-weight:700; font-size:22px; color:var(--on-acc); }
.ava-opt.on { color:var(--acc-ink); font-weight:600; }
.ava-opt.on .ava-face { border-color:var(--acc); background:#ffe3ea; }
.ava-opt.on .ava-face img { animation:avaIdle 2.6s ease-in-out infinite; }
@keyframes avaIdle { 0%, 100% { transform:translateY(0) scale(1); } 50% { transform:translateY(-2%) scale(1.035); } }
.ava-opt:focus-visible { outline:2px solid var(--acc); outline-offset:2px; }

/* happy: each character has its own move */
.ava-face.joy img { animation:joyHop .9s cubic-bezier(.22,1,.36,1); }
.ava-opt[data-a="dog"] .ava-face.joy img { animation:joyWag 1s ease-in-out; }
.ava-opt[data-a="frog"] .ava-face.joy img { animation:joyFrog 1s ease-out; }
.ava-opt[data-a="seal"] .ava-face.joy img { animation:joyRoll 1.1s ease-in-out; }
.ava-opt[data-a="rabbit"] .ava-face.joy img { animation:joyRabbit 1s ease-out; }
.ava-opt[data-a="squid"] .ava-face.joy img { animation:joySquid 1.1s ease-in-out; }
.ava-opt[data-a="penguin"] .ava-face.joy img { animation:joyWaddle 1.1s ease-in-out; }
.ava-opt[data-a="pig"] .ava-face.joy img { animation:joyPig 1s ease-out; }
.ava-opt[data-a=""] .ava-face.joy .ava-init { display:inline-block; animation:joyHop .8s ease-out; }
@keyframes joyHop { 0% { transform:scale(1); } 30% { transform:translateY(-22%) scale(1.12); } 60% { transform:translateY(0) scale(.96, 1.04); } 100% { transform:none; } }
@keyframes joyWag { 0%, 100% { transform:none; } 15% { transform:translateY(-14%) rotate(-10deg); } 30% { transform:translateY(-6%) rotate(10deg); }
  45% { transform:translateY(-12%) rotate(-10deg); } 60% { transform:translateY(-4%) rotate(8deg); } 80% { transform:rotate(-4deg); } }
@keyframes joyFrog { 0% { transform:none; } 18% { transform:scale(1.12, .82); } 45% { transform:translateY(-34%) scale(.94, 1.1); }
  70% { transform:translateY(0) scale(1.14, .84); } 85% { transform:scale(.97, 1.04); } 100% { transform:none; } }
@keyframes joyRoll { 0%, 100% { transform:none; } 20% { transform:rotate(-16deg) translateX(-6%); } 45% { transform:rotate(14deg) translateX(6%) translateY(-8%); }
  70% { transform:rotate(-8deg) translateX(-3%); } 85% { transform:rotate(4deg); } }
@keyframes joyRabbit { 0%, 100% { transform:none; } 20% { transform:translateY(-22%); } 38% { transform:translateY(0) scale(1.06, .94); }
  58% { transform:translateY(-26%) rotate(-6deg); } 78% { transform:translateY(0) scale(1.06, .94); } }
@keyframes joySquid { 0%, 100% { transform:none; } 15% { transform:translateY(-10%) skewX(12deg); } 35% { transform:translateY(-18%) skewX(-12deg); }
  55% { transform:translateY(-10%) skewX(10deg); } 75% { transform:translateY(-4%) skewX(-6deg); } }
@keyframes joyWaddle { 0%, 100% { transform:none; } 15% { transform:rotate(-14deg) translateX(-5%); } 32% { transform:rotate(14deg) translateX(5%) translateY(-6%); }
  50% { transform:rotate(-14deg) translateX(-5%); } 68% { transform:rotate(12deg) translateX(4%) translateY(-6%); } 85% { transform:rotate(-5deg); } }
@keyframes joyPig { 0%, 100% { transform:none; } 20% { transform:translateY(-20%) scale(.95, 1.06); } 40% { transform:scale(1.12, .86); }
  60% { transform:translateY(-12%); } 80% { transform:scale(1.05, .95); } }

/* sad: shrinks, droops and loses its colour for a moment */
.ava-face.sad { filter:grayscale(.75) brightness(.97); }
.ava-face.sad img { animation:sadDroop 1.8s ease-in-out; }
.ava-opt[data-a="squid"] .ava-face.sad img { animation:sadMelt 1.8s ease-in-out; }
.ava-opt[data-a="penguin"] .ava-face.sad img { animation:sadShiver 1.8s ease-in-out; }
.ava-opt[data-a="seal"] .ava-face.sad img { animation:sadSink 1.8s ease-in-out; }
@keyframes sadDroop { 0%, 100% { transform:none; } 20%, 75% { transform:translateY(7%) rotate(-9deg) scale(.9); } }
@keyframes sadMelt { 0%, 100% { transform:none; } 25%, 75% { transform:translateY(10%) scale(1.08, .82); } }
@keyframes sadShiver { 0%, 100% { transform:none; } 15%, 75% { transform:translateY(5%) scale(.9); }
  25%, 35%, 45%, 55%, 65% { transform:translateY(5%) scale(.9) translateX(-3%); } 30%, 40%, 50%, 60%, 70% { transform:translateY(5%) scale(.9) translateX(3%); } }
@keyframes sadSink { 0%, 100% { transform:none; } 25%, 75% { transform:translateY(14%) rotate(6deg) scale(.92); } }

.ava-fx { position:absolute; left:50%; top:4px; width:58px; height:58px; margin-left:-29px; pointer-events:none; }
.ava-fx.joy i { position:absolute; font-style:normal; color:#ff7b9c; font-size:15px; opacity:0; animation:fxUp 1.1s ease-out forwards; }
.ava-fx.joy i:nth-child(1) { left:-2px; top:12px; }
.ava-fx.joy i:nth-child(2) { right:-4px; top:2px; font-size:12px; animation-delay:.12s; }
.ava-fx.joy i:nth-child(3) { right:6px; top:30px; color:#f5b301; font-size:12px; animation-delay:.25s; }
@keyframes fxUp { 0% { opacity:0; transform:translateY(6px) scale(.4); } 25% { opacity:1; transform:translateY(-4px) scale(1.1); }
  100% { opacity:0; transform:translateY(-22px) scale(.9); } }
.ava-fx.sad i { position:absolute; left:16px; top:20px; width:8px; height:11px; background:#8fc6ff; border-radius:50% 50% 50% 50% / 62% 62% 40% 40%;
  opacity:0; animation:fxTear 1.5s ease-in .15s forwards; }
@keyframes fxTear { 0% { opacity:0; transform:translateY(0) scale(.4); } 20% { opacity:1; transform:translateY(0) scale(1); }
  100% { opacity:0; transform:translateY(26px) scale(.8); } }

.ava-view { padding-top:8px; }
.ava-hero { display:flex; align-items:center; gap:14px; padding:8px 0 16px; }
.avatar.hero { width:72px; height:72px; font-size:30px; }
.ava-hero b { display:block; font-size:17px; }
.ava-who span { font-size:13px; color:var(--mute); }
.auth .ava-pick { grid-template-columns:repeat(auto-fill, minmax(62px, 1fr)); }
@media (prefers-reduced-motion: reduce) {
  .ava-face img, .ava-face .ava-init, .avatar.pop, .ava-fx i { animation:none !important; }
}
.mwho .avatar.ava { overflow:hidden; }

/* directions buttons in the number panel */
.dirbtn { width:100%; display:flex; align-items:center; gap:8px; margin:0 0 8px; padding:8px 12px; border-radius:10px;
  border:1px solid var(--line); background:var(--sub); color:var(--ink); font:inherit; font-size:13.5px; font-weight:600; text-align:left; cursor:pointer; }
.dirbtn svg { color:var(--acc-ink); flex-shrink:0; }
.dirbtn span { flex:1; }
.dirbtn small { color:var(--mute); font-weight:500; font-size:12px; font-variant-numeric:tabular-nums; }
.dirbtn:hover { border-color:var(--acc); background:var(--sub); }
.dirbtn.cur { background:var(--acc-fill); border-color:var(--acc); color:var(--on-acc); }
.dirbtn.cur svg, .dirbtn.cur small { color:var(--on-acc); }
.part.guide-only { padding-bottom:4px; }
.part.guide-only .dirbtn { margin:0; }

/* ===== member side: notices, 1:1 inquiries, unread dot ===== */
.anotice { display:flex; gap:12px; align-items:flex-start; justify-content:space-between; padding:14px 16px; margin-bottom:12px;
  border-color:var(--acc-fill); background:color-mix(in srgb, var(--acc-fill) 22%, var(--card)); }
.anotice.warn { border-color:#f0b429; background:color-mix(in srgb, #ffd666 26%, var(--card)); }
.anotice b { font-size:14.5px; }
.anotice p { margin:4px 0 0; font-size:13.5px; color:var(--mute); white-space:pre-wrap; }
.anotice .mx, .adh .mx { border:0; background:transparent; font-size:16px; color:var(--mute); padding:2px 6px; }
.avatar-btn { position:relative; }
.avatar-btn .adot { position:absolute; top:-1px; right:-1px; width:10px; height:10px; border-radius:50%; background:#e5484d; border:2px solid var(--card); }
.dotn { display:inline-block; font-size:11px; font-weight:700; color:#fff; background:#e5484d; border-radius:99px; padding:1px 7px; margin-left:6px; }
button.wide { width:100%; margin:4px 0 12px; }
.inqs { display:flex; flex-direction:column; gap:8px; }
details.inq { border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
details.inq summary { cursor:pointer; list-style:none; display:flex; flex-wrap:wrap; gap:4px 8px; align-items:center; }
details.inq summary::-webkit-details-marker { display:none; }
details.inq summary b { font-size:14px; }
details.inq summary small { width:100%; color:var(--mute); font-size:12px; }
.inq-q { white-space:pre-wrap; font-size:13.5px; margin:10px 0; color:var(--ink); }
.inq-a { background:var(--sub); border-radius:10px; padding:10px 12px; font-size:13.5px; }
.inq-a small { color:var(--mute); }
.inq-a div { white-space:pre-wrap; margin-top:4px; }
.sform select, .aform select { font:inherit; font-size:14px; width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink); }
.pill.p-gray { background:var(--sub); color:var(--mute); }
.pill.p-bad { background:color-mix(in srgb, #e5484d 16%, var(--card)); color:#c62a2f; }
.pill.p-warn { background:color-mix(in srgb, #ffb224 22%, var(--card)); color:#9a5b00; }

/* ===== admin console ===== */
body.admin-mode main { max-width:1280px; }
.adm .atabs { display:flex; gap:4px; overflow-x:auto; margin:0 0 16px; padding-bottom:2px; scrollbar-width:none; }
.adm .atabs button { white-space:nowrap; border-radius:99px; padding:8px 14px; font-size:13.5px; position:relative; }
.adm .atabs button.on { font-weight:700; }
.abadge { display:inline-block; min-width:18px; margin-left:6px; padding:0 5px; border-radius:99px; background:#e5484d; color:#fff; font-size:11px; font-weight:700; line-height:18px; text-align:center; }
.abadge:empty, .abadge[hidden] { display:none; }
#apane > .card + .card { margin-top:14px; }
#apane h2 { font-size:17px; margin:0 0 6px; }
#apane h2 small { font-size:12px; color:var(--mute); font-weight:400; margin-left:6px; }
.sub.small, p.small { font-size:12.5px; }
.kpis { display:grid; grid-template-columns:repeat(auto-fill, minmax(210px, 1fr)); gap:12px; margin-bottom:14px; }
.kpi { text-align:left; display:flex; flex-direction:column; gap:4px; padding:16px; border-radius:14px; background:var(--card); }
.kpi:disabled { opacity:1; cursor:default; }
.kpi span { font-size:12.5px; color:var(--mute); }
.kpi b { font-size:24px; font-variant-numeric:tabular-nums; letter-spacing:-.3px; }
.kpi small { font-size:12px; color:var(--mute); }
.atodo ul { margin:6px 0 4px; padding:0; list-style:none; }
.atodo li { padding:6px 0; border-bottom:1px solid var(--line); }
.linkish { border:0; background:transparent; padding:0; color:var(--acc-ink); font-size:13.5px; text-align:left; cursor:pointer; }
.linkish:hover { text-decoration:underline; }
.charts { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:14px; margin-top:14px; }
.achart { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; }
.ach-h { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; }
.ach-h span, .ach-x { font-size:12px; color:var(--mute); }
.ach-x { display:flex; justify-content:space-between; margin-top:6px; }
.bars { display:flex; align-items:flex-end; gap:3px; height:120px; border-bottom:1px solid var(--line); }
.bars i { flex:1; background:var(--acc-fill); border-radius:3px 3px 0 0; position:relative; min-width:4px; }
.bars i:last-child { background:var(--acc); }
.bars i em { position:absolute; bottom:100%; left:50%; transform:translateX(-50%); font-size:10px; font-style:normal; color:var(--mute); display:none; }
.bars i:hover em { display:block; }
.atools { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.atools input { flex:1; min-width:200px; }
.atools select, .aform select { font:inherit; font-size:13.5px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--ink); }
.ascroll { overflow-x:auto; }
.atable { width:100%; border-collapse:collapse; font-size:13.5px; }
.atable th { font-size:12px; color:var(--mute); font-weight:500; text-align:left; padding:8px; border-bottom:1px solid var(--line); white-space:nowrap; }
.atable td { padding:10px 8px; border-bottom:1px solid var(--line); vertical-align:middle; white-space:nowrap; }
.atable td.wrap, .atable .wrap { white-space:normal; min-width:180px; }
.atable tr[data-u] { cursor:pointer; }
.atable tr[data-u]:hover { background:var(--sub); }
.atable .act { text-align:right; }
.atable .act > * + * { margin-left:6px; }
.atable .nm { font-weight:600; white-space:normal; word-break:break-all; }
.awho { display:flex; align-items:center; gap:10px; }
.awho .avatar { flex:none; }
.awho .status { white-space:normal; }
.amore { text-align:center; margin-top:12px; }
.ahead { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:10px; flex-wrap:wrap; }
.alist { list-style:none; margin:4px 0 0; padding:0; }
.alist li { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; padding:9px 0; border-bottom:1px solid var(--line); }
.alist .nm { font-weight:600; font-size:13.5px; word-break:break-all; }
.alist .status { flex:1; min-width:160px; white-space:normal; }
.alist .act { margin-left:auto; display:flex; gap:6px; }
.ainq { border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-top:10px; }
.ainq summary { cursor:pointer; display:flex; flex-wrap:wrap; gap:4px 8px; align-items:center; }
.ainq summary .status { width:100%; white-space:normal; }
.ainq-body { white-space:pre-wrap; background:var(--sub); border-radius:10px; padding:10px 12px; margin:10px 0 6px; font-size:13.5px; }
.arow-end { display:flex; justify-content:flex-end; align-items:center; gap:10px; margin-top:6px; }
/* member drawer */
.adrawer-back { position:fixed; inset:0; background:rgba(0,0,0,.32); z-index:40; display:flex; justify-content:flex-end; animation:fadeIn .15s; }
.adrawer { width:min(560px, 100vw); height:100%; overflow-y:auto; background:var(--bg); padding:18px 20px 40px; box-shadow:-10px 0 30px rgba(0,0,0,.15); animation:slideIn .2s ease-out; }
@keyframes slideIn { from { transform:translateX(40px); opacity:.4; } }
@keyframes fadeIn { from { opacity:0; } }
.adh { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:12px; }
.awho.big b { font-size:18px; }
.adrawer h3 { font-size:14px; margin:20px 0 6px; }
.adrawer h3 small { font-weight:400; color:var(--mute); font-size:12px; margin-left:4px; }
.adrawer .notice { padding:10px 12px; margin-bottom:10px; font-size:13.5px; }
.adrawer .notice.bad { border-color:#e5484d; }
.ainfo { display:grid; grid-template-columns:auto 1fr; gap:6px 14px; margin:0; font-size:13.5px; }
.ainfo dt { color:var(--mute); white-space:nowrap; }
.ainfo dd { margin:0; word-break:break-all; }
.adoes { display:flex; flex-wrap:wrap; gap:6px; }
.aform { max-width:420px; width:calc(100vw - 32px); }
.aform label.f { margin-top:10px; }
.aform .err { color:var(--danger); font-size:13px; min-height:4px; }
@media (max-width:640px) {
  .kpis { grid-template-columns:1fr 1fr; gap:8px; }
  .kpi { padding:12px; } .kpi b { font-size:19px; }
  .atable th:nth-child(5), .atable td:nth-child(5) { display:none; }
}

/* ===== upload events ===== */
.meter { position:relative; }
.meter.has-ev s { position:absolute; right:0; top:0; bottom:0; text-decoration:none; }
.meter.has-ev i { position:relative; z-index:1; }
.evtag { display:inline-block; font-size:11px; font-weight:700; color:var(--ok); background:var(--ok-soft); border-radius:99px; padding:1px 7px; margin-left:4px; vertical-align:1px; }
.evchip { display:flex; gap:8px; align-items:flex-start; margin-top:10px; padding:8px 10px; border-radius:10px; font-size:13px; line-height:1.45;
  background:color-mix(in srgb, var(--ok-soft) 45%, var(--card)); border:1px solid color-mix(in srgb, var(--ok-soft) 90%, var(--line)); color:var(--ink); }
.evchip > b { flex:none; font-size:11px; color:var(--card); background:var(--ok); border-radius:6px; padding:1px 6px; margin-top:1px; }
.evchip small { color:var(--mute); }
.evchip.small { font-size:12px; margin-top:8px; padding:6px 8px; }

/* ===== phone comfort pass ===== */
/* nothing may push the page sideways (an overflow widened the whole layout on phones) */
body { overflow-x:clip; }
/* drive: long file names wrap, the ⋮ button always stays on screen */
.files { table-layout:fixed; }
.files td.act { width:52px; }
.files a.fname { white-space:normal; overflow-wrap:anywhere; word-break:normal; display:block; }
.files .status { white-space:normal; }
.drop b { display:block; }
.drop-sub { display:block; font-size:12.5px; margin-top:2px; }
/* taps: no grey/blue flash, a small press instead; labels on buttons can't be selected by a long press */
html { -webkit-tap-highlight-color:transparent; }
button, .btn, .mitem, .slink, .n, .kebab, label.ck, .selall { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
button:active:not(:disabled), .btn:active, .mitem:active, .slink:active { transform:scale(.97); transition:transform .06s; }
.n:active { transform:scale(.94); }
.track, .tgl:active { transform:none; }

@media (max-width:640px) {
  /* links people tap */
  .forgot a, .auth .sub a, .switch a, .agree .ck a { display:inline-block; padding:10px 4px; margin:-10px -4px; }
  .agree .ck { min-height:36px; }
  .agree .ck input, .selall input { width:22px; height:22px; }
  .card.plan .btn, .card.plan button { min-height:40px; display:inline-flex; align-items:center; }
  /* settings sheet: a control that doesn't fit goes under its label, with full-width buttons */
  .srow { padding:10px 0; }
  .srow .seg { width:100%; display:flex; }
  .srow .seg button { flex:1; min-height:40px; padding:6px 4px; font-size:13.5px; }
  .tgl { width:52px; height:32px; }
  .tgl i { width:26px; height:26px; }
  .tgl.on i { transform:translateX(20px); }
  .slink { min-height:48px; }
  /* player controls: 40px targets */
  .pbar button.ib { padding:10px; }
  .pbar .chip { padding:7px 12px; font-size:12.5px; }
  .fabb span { font-size:11px; }
  .dirbtn { min-height:42px; }
  .selall { padding:6px 0; }
}
@media (max-width:640px) {
  /* bottom-sheet dialogs: big thumb-sized buttons across the sheet */
  .modal.ask { padding-bottom:max(18px, env(safe-area-inset-bottom)); }
  .ask-btns { display:flex; gap:8px; }
  .ask-btns button { flex:1; min-height:46px; font-size:15px; margin:0; }
  .ask-input input { min-height:44px; font-size:16px; }
}
/* short phones held upright: the side buttons must not run into the play bar */
@media (max-width:640px) and (max-height:720px) and (orientation:portrait) {
  body.player-mode .fab { gap:8px; top:38%; }
  .fabb { width:42px; height:42px; }
}

/* ===== touch screens of any size (phones and tablets): finger-sized targets ===== */
@media (pointer:coarse) {
  .forgot a, .switch a, .agree .ck a { display:inline-block; padding:10px 4px; margin:-10px -4px; }
  .agree .ck { min-height:36px; }
  .agree .ck input, .selall input { width:22px; height:22px; }
  .card.plan .btn, .card.plan button { min-height:40px; display:inline-flex; align-items:center; }
  .srow .seg button { min-height:40px; padding:6px 12px; font-size:13.5px; }
  .tgl { width:52px; height:32px; }
  .tgl i { width:26px; height:26px; }
  .tgl.on i { transform:translateX(20px); }
  .slink, .mitem { min-height:46px; }
  .kebab { min-width:40px; min-height:40px; }
  .pbar button.ib { padding:10px; }
  .pbar .chip { padding:7px 12px; font-size:12.5px; }
  .fabb span { font-size:11px; }
  .dirbtn { min-height:42px; }
  .selall { padding:6px 0; }
  .qpanel .n { height:40px; }
  .ask-btns button { min-height:44px; padding:9px 18px; }
  .atabs button, .atools select, .atools .btn { min-height:40px; }
}
/* tablets held upright (701-1000px): a narrower number column, and the play bar may take two rows */
@media (min-width:701px) and (max-width:1000px) and (orientation:portrait) {
  .pl-wrap { grid-template-columns:minmax(0,1fr) 250px; gap:12px; }
  .qpanel .grid { grid-template-columns:repeat(4, 1fr); }
  .pctl { flex-wrap:wrap; row-gap:6px; }
  .pctl .pr { margin-left:auto; }
}
/* touch screens have volume buttons: the slider only takes space */
@media (pointer:coarse) { .vol input[type=range] { display:none; } }

/* ===== impeccable pass: AI tells removed, browser surfaces themed ===== */
/* page ground: a neutral tinted toward the brand rose instead of the reflex warm cream */
:root { --bg:#f7f5f6; --line:#e6e1e3; --sub:#f2eef0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg:#151416; --line:#2f2c30; --sub:#262428; } }
:root[data-theme="dark"] { --bg:#151416; --line:#2f2c30; --sub:#262428; }
/* the parts the browser draws */
::selection { background:color-mix(in srgb, var(--acc-fill) 70%, transparent); color:var(--ink); }
input, textarea { caret-color:var(--acc-ink); }
html { scrollbar-color:color-mix(in srgb, var(--mute) 45%, transparent) transparent; }
input[type=checkbox], input[type=radio], progress { accent-color:var(--acc-ink); }
:where(button, a, summary, select, [tabindex]):focus-visible { outline:2px solid var(--acc); outline-offset:2px; }
:where(input, textarea, select):focus-visible { outline:2px solid color-mix(in srgb, var(--acc) 55%, transparent); outline-offset:0; border-color:var(--acc); }
/* drawn icons in place of glyphs */
.mx, .mback, .upbtn { display:inline-flex; align-items:center; justify-content:center; }
.slink .chev { display:inline-flex; color:var(--mute); }
.linkish svg { vertical-align:-3px; }
#sendCode svg, .pok svg { vertical-align:-2px; }
.ava-fx.joy i { display:inline-flex; }
/* modal heading levels (h2 title, h3 groups) keep their old look */
.mh .mtitle { margin:0; font-size:18px; font-weight:700; }
.mbody h3.sgroup { margin:0 0 6px; font-size:12px; color:var(--mute); font-weight:600; }
/* motion: exponential ease-out, no rubber-band overshoot in the easing itself */
.avatar.pop { animation-timing-function:cubic-bezier(.22,1,.36,1); }
.ava-face.joy img { animation-timing-function:cubic-bezier(.22,1,.36,1); }
/* event share of the upload meter: a plain tint, not stripes */
.meter.has-ev s { background:color-mix(in srgb, var(--ok-soft) 75%, transparent); }
/* nothing under 12px */
.evtag, .evchip > b { font-size:12px; }
.evchip small { font-size:12px; }
.abadge { font-size:12px; background:#c62a2f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.p-bad { color:#ffb3b0; background:color-mix(in srgb, #e5484d 24%, var(--card)); } }
:root[data-theme="dark"] .pill.p-bad { color:#ffb3b0; background:color-mix(in srgb, #e5484d 24%, var(--card)); }
/* long notes keep a readable measure */
.note, .sub, .plans + p, .card > p { max-width:72ch; }
/* pricing: the current plan is told by its label and a quiet tint, not a thick accent frame; cards keep their own height */
.plans { align-items:start; }
.plans .card.plan-on { border-color:var(--line); box-shadow:none; background:color-mix(in srgb, var(--acc-fill) 9%, var(--card)); }
/* impeccable detector findings */
:root { --mute:#66656a; }                                    /* 5:1 on the tinted surfaces */
.fabb span { font-size:11px; }                               /* no functional text under 11px */
/* no card inside a card: the agreement list and the inquiry rows are sections divided by rules */
.agree { border:0; border-radius:0; padding:12px 0 4px; border-top:1px solid var(--line); }
.ainq { border:0; border-radius:0; border-bottom:1px solid var(--line); padding:14px 0; margin-top:0; }
/* impeccable detector, round 2 */
.evchip { border:0; }                                                     /* a tint, not a card inside the card */
.stage .memo-box { border:0; border-top:1px solid var(--line); border-radius:0; padding:14px 2px 0; }
.fabb.on { box-shadow:0 2px 8px rgba(0,0,0,.14); }                        /* neutral elevation, no coloured glow */
::placeholder { color:var(--mute); opacity:1; }
@media (max-width:640px) { main { padding-left:16px; padding-right:16px; } }   /* text never sits on the screen edge */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill.p-warn { color:#ffd08a; background:color-mix(in srgb, #ffb224 20%, var(--card)); }
  :root:not([data-theme="light"]) .anotice.warn p { color:#e8dcc3; }
}
:root[data-theme="dark"] .pill.p-warn { color:#ffd08a; background:color-mix(in srgb, #ffb224 20%, var(--card)); }
:root[data-theme="dark"] .anotice.warn p { color:#e8dcc3; }
.pbar button.play { box-shadow:0 2px 6px rgba(0,0,0,.16); }
.bubble { box-shadow:0 3px 10px rgba(0,0,0,.10); }

/* ---- question numbers as keycaps: ON = the key is pressed down into the plate, OFF = the key stands up unpressed */
:root { --key-edge:#d9cfd3; --key-drop:rgba(0,0,0,.08); --key-well:rgba(74,50,54,.22); --key-on:#fbe3e8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --key-edge:#0e0d0f; --key-drop:rgba(0,0,0,.4); --key-well:rgba(0,0,0,.65); --key-on:#3a2b2e; } }
:root[data-theme="dark"] { --key-edge:#0e0d0f; --key-drop:rgba(0,0,0,.4); --key-well:rgba(0,0,0,.65); --key-on:#3a2b2e; }
.grid, .peek-row { row-gap:9px; padding-bottom:4px; }
/* on: pressed in */
.n, .qpanel .n { border:1px solid transparent; border-radius:10px; background:var(--key-on); color:var(--ink); font-weight:600; text-decoration:none;
  box-shadow:inset 0 2px 4px var(--key-well), inset 0 0 0 1px rgba(0,0,0,.03); transform:translateY(2px);
  transition:transform .12s cubic-bezier(.22,1,.36,1), box-shadow .12s cubic-bezier(.22,1,.36,1), background-color .12s; }
/* off: standing up, not pressed */
.n.off, .qpanel .n.off { background:var(--card); color:var(--mute); border:1px solid var(--line); text-decoration:none;
  box-shadow:0 4px 0 -1px var(--key-edge), 0 5px 8px var(--key-drop); transform:translateY(-2px); }
.n.cur, .qpanel .n.cur { background:var(--acc-fill); color:var(--on-acc); border:1px solid var(--acc); box-shadow:inset 0 2px 4px var(--key-well); }
.n.off.cur, .qpanel .n.off.cur { box-shadow:0 4px 0 -1px var(--key-edge), 0 5px 8px var(--key-drop); }
.n.miss, .qpanel .n.miss { border:1px dashed var(--miss); color:var(--miss); background:var(--sub); box-shadow:none; transform:none; }
.n.est:not(.off):not(.cur), .qpanel .n.est:not(.off):not(.cur) { border:1px dotted var(--acc); }
.n.grp:not(.off):not(.cur) { box-shadow:inset 0 0 0 2px var(--acc-fill), inset 0 2px 4px var(--key-well); }
.n:active, .qpanel .n:active { transform:translateY(3px); box-shadow:inset 0 3px 6px var(--key-well); }
@media (prefers-reduced-motion: reduce) { .n, .qpanel .n { transition:none; } }

/* phone, sheet folded down: all numbers in one row that scrolls sideways, five in view */
@media (max-width:700px) and (orientation:portrait), (max-width:700px) and (min-height:541px) {
  body.player-mode .peek-row { display:flex; position:relative; gap:7px; overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x proximity;
    scroll-padding-inline:16px; padding:6px 16px 14px; scrollbar-width:none; -webkit-overflow-scrolling:touch; touch-action:pan-x; }
  body.player-mode .peek-row::-webkit-scrollbar { display:none; }
  body.player-mode .peek-row .n { flex:0 0 calc((100vw - 32px - 28px) / 5); scroll-snap-align:start; }
}

/* ---- first-run guide: three pages, then sign-up */
body.welcome-mode .top { display:none; }
body.welcome-mode main, body.welcome-mode #app { padding:0; max-width:none; }
.welcome { position:relative; min-height:100dvh; display:flex; flex-direction:column; overflow:hidden; background:var(--bg); }
.wl-skip { position:absolute; top:max(14px, env(safe-area-inset-top)); right:16px; z-index:2; background:none; border:0; color:var(--mute); font-size:14px; padding:10px 8px; min-height:44px; cursor:pointer; }
.wl-track { flex:1; display:flex; transition:transform .35s cubic-bezier(.22,1,.36,1); }
@media (prefers-reduced-motion: reduce) { .wl-track { transition:none; } }
.wl-page { flex:0 0 100%; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:64px 24px 12px; text-align:center; }
.wl-page h1 { font-size:clamp(21px, 5.6vw, 28px); line-height:1.35; margin:22px 0 10px; letter-spacing:-.01em; text-wrap:balance; }
.wl-page p { max-width:30em; margin:0; color:var(--mute); font-size:15px; line-height:1.65; text-wrap:pretty; }
.wl-art { position:relative; width:min(340px, 100%); padding:18px; border-radius:18px; background:var(--card); border:1px solid var(--line); }
.wl-char { position:absolute; width:58px; height:58px; top:-46px; left:-4px; object-fit:contain; }
.wl-page.on .wl-char { animation:wlHop .6s .15s cubic-bezier(.22,1,.36,1) both; }
@keyframes wlHop { from { transform:translateY(10px) scale(.9); opacity:0; } to { transform:none; opacity:1; } }
@media (prefers-reduced-motion: reduce) { .wl-page.on .wl-char { animation:none; } }
.wl-up { display:inline-block; padding:8px 14px; border-radius:10px; background:var(--acc-fill); color:var(--on-acc); font-weight:600; font-size:14px; }
.wl-row { display:flex; flex-direction:column; gap:4px; margin-top:14px; padding:10px 12px; border-radius:10px; background:var(--sub); text-align:left; font-size:14px; }
.wl-ok { display:inline-flex; align-items:center; gap:4px; color:var(--ok); font-size:13px; }
.wl-ok svg { width:14px; height:14px; }
.wl-parts { display:grid; grid-template-columns:repeat(4, 1fr); gap:6px; margin-top:10px; font-size:12px; color:var(--mute); }
.wl-parts span { padding:6px 0; border-radius:8px; border:1px solid var(--line); }
.wl-demo { display:flex; flex-direction:column; gap:14px; }
.wl-step small { display:block; margin-top:8px; color:var(--mute); font-size:12.5px; }
.wl-grid { display:grid; grid-template-columns:repeat(5, 1fr); gap:7px; padding-bottom:4px; }
.wn { height:36px; display:grid; place-items:center; border-radius:10px; font-weight:600; font-size:14px; font-variant-numeric:tabular-nums;
  background:var(--key-on); border:1px solid transparent; box-shadow:inset 0 2px 4px var(--key-well); transform:translateY(2px); }
.wn.off { background:var(--card); color:var(--mute); border-color:var(--line); box-shadow:0 4px 0 -1px var(--key-edge), 0 5px 8px var(--key-drop); transform:translateY(-2px); }
.wn.tapped { outline:2px solid var(--acc); outline-offset:2px; }
.wn.dbl { background:var(--acc-fill); color:var(--on-acc); border-color:var(--acc); box-shadow:inset 0 2px 4px var(--key-well); position:relative; }
.wl-page.on .wn.dbl::after { content:""; position:absolute; inset:-6px; border-radius:14px; border:2px solid var(--acc); animation:wlDbl 1.6s .4s infinite; }
@keyframes wlDbl { 0%,100% { opacity:0; transform:scale(.85); } 10%,30% { opacity:1; transform:scale(1); } 20% { transform:scale(.92); } 50% { opacity:0; } }
@media (prefers-reduced-motion: reduce) { .wl-page.on .wn.dbl::after { animation:none; opacity:1; } }
.wl-bar { position:relative; height:6px; border-radius:3px; background:var(--sub); }
.wl-bar i { position:absolute; inset:0 auto 0 0; width:38%; border-radius:3px; background:var(--acc); }
.wl-bar em { position:absolute; top:50%; left:38%; width:14px; height:14px; margin:-7px; border-radius:50%; background:var(--acc); }
.wl-sub { text-align:left; }
.wl-sub p { margin:0 0 6px; color:var(--mute); font-size:14.5px; line-height:1.5; }
.wl-sub p.hl { color:var(--ink); background:var(--acc-soft); padding:6px 8px; border-radius:8px; margin-left:-8px; }
.wl-fabs { display:flex; gap:8px; margin-top:12px; }
.wl-fabs span { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 0; border-radius:10px; border:1px solid var(--line); font-size:12px; color:var(--mute); }
.wl-fabs span.on { background:var(--acc-fill); color:var(--on-acc); border-color:var(--acc); }
.wl-fabs svg { width:20px; height:20px; }
.wl-fabs b { font-weight:600; }
.wl-foot { display:flex; flex-direction:column; align-items:center; gap:16px; padding:8px 24px max(24px, env(safe-area-inset-bottom)); }
.wl-dots { display:flex; gap:8px; }
.wl-dots i { width:8px; height:8px; border-radius:4px; background:var(--line); cursor:pointer; transition:width .2s, background-color .2s; }
.wl-dots i.on { width:22px; background:var(--acc); }
.wl-next { width:min(360px, 100%); min-height:50px; font-size:16px; }
@media (orientation:landscape) and (max-height:540px) {
  .welcome { min-height:100dvh; }
  .wl-page { flex-direction:row; gap:28px; padding:20px 72px 8px; text-align:left; }
  .wl-txt { flex:1; }
  .wl-art { flex:0 0 300px; padding:14px; }
  .wl-page h1 { margin-top:0; font-size:20px; }
  .wl-page p { font-size:14px; }
  .wl-foot { flex-direction:row; justify-content:space-between; padding:6px 24px 14px; }
  .wl-next { width:auto; padding:0 28px; min-height:44px; }
}

.wl-txt { display:flex; flex-direction:column; align-items:center; }
@media (orientation:landscape) and (max-height:540px) { .wl-txt { align-items:flex-start; } }
/* first-run guide v2: tap on the real upload box · a memo being typed under a subtitle */
.wl-drop { position:relative; display:flex; flex-direction:column; gap:2px; padding:18px 12px; border:2px dashed var(--acc); border-radius:12px; color:var(--mute); font-size:13px; }
.wl-drop b { color:var(--acc-ink); font-size:16px; }
.wl-hand { position:absolute; right:12%; bottom:-20px; width:40px; height:40px; color:var(--ink); }
.wl-page.on .wl-hand { animation:wlTap 1.8s .3s infinite cubic-bezier(.22,1,.36,1); }
.wl-page.on .wl-drop { animation:wlPress 1.8s .3s infinite; }
@keyframes wlTap { 0%,100% { transform:translate(10px,10px); opacity:.0; } 20% { transform:none; opacity:1; } 32% { transform:scale(.88); } 44%,80% { transform:none; opacity:1; } }
@keyframes wlPress { 0%,28%,46%,100% { background:transparent; } 32%,40% { background:var(--acc-soft); } }
@media (prefers-reduced-motion: reduce) { .wl-page.on .wl-hand, .wl-page.on .wl-drop { animation:none; } }
.wl-file { display:none; }
.wl-memo { margin-top:10px; border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
.wl-mh { display:flex; justify-content:space-between; font-size:13px; }
.wl-mh span { color:var(--mute); font-size:12px; }
.wl-ta { margin-top:6px; padding:8px 10px; border:1px solid var(--acc); border-radius:8px; background:var(--card); font-size:15px; color:var(--ink); min-height:40px; }
.wl-caret { display:inline-block; width:1.5px; height:1.1em; margin-left:1px; vertical-align:-.15em; background:var(--ink); animation:wlBlink 1s steps(1) infinite; }
@keyframes wlBlink { 50% { opacity:0; } }
.wl-sub p.hl { font-size:16px; }

/* ---- player v3: one control row; icon-only round buttons; in typing mode they sit beside the subtitles so the memo gets the full width */
.pctl, body.player-mode .pctl { flex-wrap:nowrap; gap:8px; }
.pctl .pr { margin-left:auto; }
.fabb span { display:none; }
.fabb svg { width:24px; height:24px; }
.stage.typing .stage-main, body.player-mode .stage.typing .stage-main { padding-right:6px; }
.stage.typing .lines { padding-right:62px; min-height:calc(3 * var(--fab-s, 48px) + 2 * 8px + 8px); }
.stage.typing .fab, body.player-mode .stage.typing .fab { top:calc(var(--stage-top-h, 58px) + 8px); bottom:auto; transform:none; gap:8px; }
.stage.typing .fab .fabb { width:var(--fab-s, 48px); height:var(--fab-s, 48px); }
.stage.typing .fab .fabb svg { width:20px; height:20px; }
.stage.typing .memo-box { margin-top:10px; }
@media (orientation:landscape) and (max-height:540px) { .stage { --fab-s:40px; --stage-top-h:34px; } }
/* sideways phones are short: in typing mode the three buttons sit in a row in the top bar instead */
@media (orientation:landscape) and (max-height:540px) {
  body.player-mode .stage.typing .fab { flex-direction:row; top:6px; left:12px; right:auto; gap:8px; }
  body.player-mode .stage.typing .fab .fabb { width:34px; height:34px; }
  body.player-mode .stage.typing .fab .fabb svg { width:17px; height:17px; }
  body.player-mode .stage.typing .lines { min-height:0; padding-right:6px; }
}

/* subtitles start at the top of the box for every question and move up only once the box is full */
.lines, .stage.typing .lines { justify-content:flex-start; }
.lines > :first-child, .lines > :last-child { margin-top:0; margin-bottom:0; }

/* subtitles: the whole question written out; spoken line dark and large, the others grey and smaller */
#lines .ln { color:var(--mute); }
#lines .ln:not(.now) .tx { font-size:.78em; }
#lines .ln:not(.now) .opt { transform:scale(.85); }
#lines .ln.now, #lines .ln.now .tx { color:var(--ink); }
#lines .ln.now .tx { font-weight:500; }
#lines .ln.boiler:not(.now) .tx { font-size:1em; }

/* memo: about two lines tall */
.memo-box textarea#mMemo, .stage .memo-box textarea#mMemo { min-height:0; height:auto; }
.stage.typing .memo-box textarea#mMemo { height:calc(2 * 1.5em + 20px); }

/* typing mode: the memo is two lines now, so the subtitles get the room */
.stage.typing .lines, body.player-mode .stage.typing .lines { max-height:62%; }
/* bar made of only the selected stretches: a small notch where one stretch joins the next */
.track.compact #segmarks i { top:6px; bottom:6px; width:2px; margin-left:-1px; border-radius:1px; background:var(--card); opacity:1; z-index:1; }
.track.compact .fill { border-radius:99px 0 0 99px; }
/* lines scrolling past the top/bottom edge fade out instead of being cut */
#lines { -webkit-mask-image:linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%); mask-image:linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%); }
/* every line of the question in normal dark text; the line being spoken is only a little larger */
#lines .ln, #lines .ln:not(.now), #lines .ln.boiler, #lines .ln:not(.now) .tx, #lines .ln.now .tx { color:var(--ink); font-weight:400; }
#lines .ln:not(.now) .tx, #lines .ln.boiler:not(.now) .tx { font-size:1em; }
#lines .ln.now .tx { font-size:1.14em; }
#lines .ln:not(.now) .opt { transform:none; }
/* directions buttons work like the question keys: ON pressed into the plate, OFF standing up */
.dirbtn { background:var(--key-on); border:1px solid transparent; color:var(--ink); box-shadow:inset 0 2px 4px var(--key-well); transform:translateY(1px);
  transition:transform .12s cubic-bezier(.22,1,.36,1), box-shadow .12s cubic-bezier(.22,1,.36,1), background-color .12s; touch-action:manipulation; }
.dirbtn.off { background:var(--card); color:var(--mute); border-color:var(--line); box-shadow:0 3px 0 -1px var(--key-edge), 0 4px 7px var(--key-drop); transform:translateY(-1px); }
.dirbtn.off svg { color:var(--mute); }
.dirbtn.cur { background:var(--acc-fill); border-color:var(--acc); color:var(--on-acc); }
.dirbtn:hover { filter:brightness(1.02); }
@media (prefers-reduced-motion: reduce) { .dirbtn { transition:none; } }

/* login / sign-up card: lifted off the page (soft layered shadow, a light top edge) */
.auth { position:relative; border:1px solid color-mix(in srgb, var(--line) 70%, #fff); border-radius:18px;
  background:linear-gradient(180deg, #fff 0%, #fffdfd 60%, #fcf8f9 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95), 0 1px 2px rgba(74,50,54,.06), 0 6px 14px -4px rgba(74,50,54,.12), 0 22px 44px -16px rgba(74,50,54,.24); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth { background:linear-gradient(180deg, #26252a, #1f1f22); border-color:#34313a;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 2px 4px rgba(0,0,0,.35), 0 18px 40px -14px rgba(0,0,0,.6); } }
:root[data-theme="dark"] .auth { background:linear-gradient(180deg, #26252a, #1f1f22); border-color:#34313a;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 2px 4px rgba(0,0,0,.35), 0 18px 40px -14px rgba(0,0,0,.6); }

/* house rule for buttons: flat, with a soft shadow under them (no raised/3D key look). The shadow lives in
   --btn-shadow so every main button - and any new one - gets the same one */
:root { --btn-shadow:0 4px 12px -3px rgba(74,50,54,.28), 0 1px 3px rgba(74,50,54,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --btn-shadow:0 6px 16px -4px rgba(0,0,0,.6); } }
:root[data-theme="dark"] { --btn-shadow:0 6px 16px -4px rgba(0,0,0,.6); }
.btn.primary, button.primary { box-shadow:var(--btn-shadow); }
.btn.primary:disabled, button.primary:disabled { box-shadow:none; }
/* the line being spoken: clearly larger and bold, with a pink bar at its left edge */
#lines .ln.now .tx { font-size:1.3em; font-weight:700; line-height:1.3; }
#lines .ln.now { position:relative; }
#lines .ln.now::before { content:""; position:absolute; left:-10px; top:.15em; bottom:.15em; width:4px; border-radius:2px; background:var(--acc); }
#lines { padding-left:12px; }

/* spoken line: a bit larger and semi-bold, thin bar (toned down) */
#lines .ln.now .tx { font-size:1.15em; font-weight:600; line-height:1.35; }
#lines .ln.now::before { width:3px; left:-9px; opacity:.85; }
/* spoken line: bold and only slightly larger, no side bar */
#lines .ln.now::before { content:none; display:none; }
#lines .ln.now .tx { font-size:1.07em; font-weight:700; }
