:root{
--bg:#ffffff; --surface:#ffffff; --hero:#eaf4fb; --line:#d5e1eb; --control:#7d8e9e;
--ink:#0a2a45; --muted:#5b6b7a; --brand:#1491d6; --action:#0b74b5; --on-action:#ffffff;
--correct:#177a41; --correct-soft:#e6f4ec; --incorrect:#b3261e; --incorrect-soft:#fcecea;
--gold:#f2b233; --radius-md:12px; --radius-lg:24px; --radius-pill:999px;
--touch:44px; --control-h:52px; --tile:64px;
--space-3:12px; --space-4:16px; --space-5:20px; --space-6:24px; --space-8:32px;
--navy:#0a2a45;
}
/* Dark mode, app-wide: set as data-theme="dark" on <html>, applied
   before paint (each page's own inline head script) so there's no
   light-mode flash. The admin console has its own Settings > Appearance
   control; every other page gets the floating toggle (.theme-fab)
   below, via assets/auth.js's initThemeToggle(). Brand colors (--brand,
   --action, --gold, --correct, --incorrect) stay the same in both
   themes, same as any brand's dark mode — only surfaces and text
   invert. --navy is untouched too: the admin sidebar is already dark
   navy in light mode, so it needs no change here. */
html[data-theme="dark"]{
--bg:#0f1b2a; --surface:#15263b; --hero:#132234; --line:#27394c; --control:#4a5d70;
--ink:#eaf2f8; --muted:#93a6b8;
--correct-soft:rgba(23,122,65,.22); --incorrect-soft:rgba(179,38,30,.22);
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--ink)}
.wrap{max-width:720px;margin:0 auto;padding:var(--space-6)}

/* Brand lockup — real asset (assets/logo-lockup.png), per the brand book's fixed-artwork rule */
.brand-hero{display:flex;justify-content:center;margin-bottom:var(--space-8)}
.brand-hero .logo-lockup{height:110px;width:auto}
/* Dark mode: the white logo on dark backgrounds (brand kit: blue logo on
   white/Sky, white logo on Blue or Ink Navy). Same official artwork. */
html[data-theme="dark"] img.logo-lockup{content:url(assets/logo-lockup-white.png)}
html[data-theme="dark"] img[src$="assets/logo-mark.png"]{content:url(assets/logo-mark-ondark.png)}

h1{font-size:28px;line-height:36px;font-weight:800;letter-spacing:-0.01em;margin:0 0 8px}
.lede{font-size:16px;line-height:24px;color:var(--muted);margin:0 0 var(--space-8);max-width:52ch}

label{display:block;font-size:14px;font-weight:700;margin-bottom:6px;color:var(--ink)}
.field{margin-bottom:var(--space-5)}
.hint{font-size:13px;color:var(--muted);margin-top:6px}
input,select{width:100%;height:var(--control-h);border:1.5px solid var(--control);border-radius:var(--radius-md);padding:0 var(--space-4);font:inherit;font-size:16px;color:var(--ink);background:var(--surface)}
input:focus,select:focus{outline:3px solid var(--action);outline-offset:2px;border-color:var(--action)}
input.err{border-color:var(--incorrect)}
.err-text{font-size:13px;color:var(--incorrect);margin-top:6px}
/* .card p sets muted text; messages inside cards must keep their own color. */
.card .err-text{color:var(--incorrect)}
.card .ok-text{color:var(--ink)}
/* The brand red is too dark to read on the dark background; use a lighter tint of it there. */
html[data-theme="dark"] .err-text{color:#f28b82}

.pw-field{position:relative}
.pw-field input{padding-right:44px}
.pw-toggle{position:absolute;top:0;right:0;height:var(--control-h);width:44px;border:0;background:transparent;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted);padding:0}
.pw-toggle:hover{color:var(--ink)}
.pw-toggle:focus-visible{outline:3px solid var(--action);outline-offset:-3px;border-radius:var(--radius-md)}
.pw-toggle svg{width:20px;height:20px}
.pw-toggle .pw-icon-hide{display:none}
.pw-toggle[aria-pressed="true"] .pw-icon-show{display:none}
.pw-toggle[aria-pressed="true"] .pw-icon-hide{display:block}

/* Floating light/dark toggle, auto-added by initThemeToggle() to every
   page that doesn't already have its own Appearance control. */
.theme-fab{position:fixed;right:var(--space-5);bottom:var(--space-5);height:48px;width:48px;border-radius:999px;border:1.5px solid var(--control);background:var(--surface);color:var(--ink);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 10px rgba(10,42,69,.18);z-index:40}
.theme-fab:hover{border-color:var(--action);color:var(--action)}
.theme-fab:focus-visible{outline:3px solid var(--action);outline-offset:2px}
.theme-fab svg{width:22px;height:22px}
.theme-fab .icon-sun{display:none}
html[data-theme="dark"] .theme-fab .icon-moon{display:none}
html[data-theme="dark"] .theme-fab .icon-sun{display:block}

.chips{display:flex;flex-wrap:wrap;gap:var(--space-3)}
.chip{min-height:var(--touch);padding:0 18px;border-radius:var(--radius-pill);border:1.5px solid var(--control);background:var(--surface);font-weight:700;font-size:15px;color:var(--ink);cursor:pointer;display:flex;align-items:center}
.chip[aria-pressed="true"]{background:var(--hero);border-color:var(--action);color:var(--action)}

.btn{display:inline-flex;align-items:center;justify-content:center;height:var(--control-h);min-height:var(--touch);padding:0 24px;border-radius:var(--radius-md);border:0;font-weight:700;font-size:17px;cursor:pointer;width:100%}
.btn-primary{background:var(--action);color:var(--on-action)}
.btn-primary:disabled{opacity:.45;cursor:not-allowed}
.link-btn{background:none;border:0;padding:0;color:var(--action);font:inherit;font-weight:700;cursor:pointer;text-decoration:underline;min-height:var(--touch)}
html[data-theme="dark"] .link-btn{color:var(--brand)}
.ok-text{font-size:14px;color:var(--ink);background:var(--correct-soft);border-left:3px solid var(--correct);padding:10px 12px;border-radius:var(--radius-md);margin-top:8px}
.check-row{display:flex;align-items:center;gap:10px;font-size:15px;color:var(--ink);margin:4px 0 var(--space-4);min-height:var(--touch);cursor:pointer}
.check-row input{width:20px;height:20px;accent-color:var(--action)}
/* QR codes stay dark-on-white in both themes, or phone cameras can't read them. */
.qr-box{display:inline-block;background:#ffffff;padding:0;border-radius:var(--radius-md);line-height:0}
.qr-box svg{width:200px;height:200px}
.setup-key{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:14px;letter-spacing:.06em;word-break:break-all;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:8px 10px;display:inline-block}
.code-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;list-style:none;padding:0;margin:12px 0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:15px;color:var(--ink)}
.code-list li{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:8px 10px;text-align:center}
.prompt-word{overflow-wrap:anywhere}
.prompt-word.is-long{font-size:clamp(22px,6vw,30px);line-height:1.25}
.lesson-banner{background:var(--hero);border-left:4px solid var(--gold);border-radius:var(--radius-md);padding:12px 14px;margin-bottom:var(--space-4);color:var(--ink)}
.lesson-banner p{margin:0 0 6px;font-size:14px;color:var(--ink)}
.lesson-banner .lesson-tag{font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.lesson-banner .chip{margin-top:4px}
.status-pill.received{background:var(--correct-soft);color:var(--ink)}
.history-item .receipt{font-size:12px;color:var(--muted);margin:4px 0 0;font-variant-numeric:tabular-nums}
.history-item .reason{font-size:13px;color:var(--ink);margin:4px 0 0}
.saved-today{margin-top:var(--space-6)}
.saved-today .history-list{list-style:none;padding:0;margin:0}
.status-pill.on{background:var(--correct-soft);color:var(--ink)}
.status-pill.off{background:var(--surface);color:var(--muted);border:1px solid var(--line)}
.btn-secondary{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.btn-row{display:flex;gap:12px;flex-wrap:wrap;margin-top:var(--space-5)}
.btn-row .btn{width:auto}
.btn-quiet{background:transparent;color:var(--muted);font-weight:700}

.card{background:var(--hero);border-radius:var(--radius-lg);padding:var(--space-6);margin-top:var(--space-8)}
.card h2{font-size:18px;line-height:26px;font-weight:800;margin:0 0 8px}
.card p{font-size:15px;line-height:22px;color:var(--muted);margin:0}

.foot{margin-top:var(--space-8);font-size:13px;color:var(--muted)}
/* Mobile-first: recording happens on a phone mic, so thumb reach and tap size matter most here */
html{-webkit-text-size-adjust:100%}
.wrap{padding-bottom:calc(var(--space-6) + env(safe-area-inset-bottom))}

/* Recorder screen */
.rec-page{display:flex;flex-direction:column;min-height:100vh}
.rec-scroll{flex:1;padding:var(--space-6) var(--space-6) var(--space-4)}
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-6)}
.topbar .mark{height:28px;width:auto}
.topbar .quota{font-size:13px;font-weight:700;color:var(--muted)}
.progress{height:8px;border-radius:var(--radius-pill);background:var(--hero);overflow:hidden;margin-bottom:var(--space-6)}
.progress>div{height:100%;background:var(--action);border-radius:var(--radius-pill);transition:width .25s ease}

.prompt-card{text-align:center;background:var(--hero);border-radius:var(--radius-lg);padding:var(--space-8) var(--space-6);margin-bottom:var(--space-5)}
.prompt-label{font-size:15px;line-height:22px;font-weight:700;color:var(--muted);margin:0 0 var(--space-3)}
.prompt-word{font-size:40px;line-height:48px;font-weight:800;letter-spacing:-0.01em;color:var(--ink);margin:0 0 6px;word-break:break-word}
.prompt-meaning{font-size:17px;color:var(--muted);margin:0}
.prompt-nav{display:flex;justify-content:center;gap:var(--space-5);font-size:13px;color:var(--muted);font-weight:700}

/* Pinned bottom action area — reachable with a thumb, like a native recording app */
.rec-dock{position:sticky;bottom:0;background:var(--surface);border-top:1px solid var(--line);padding:var(--space-5) var(--space-6) calc(var(--space-5) + env(safe-area-inset-bottom))}
.record-wrap{display:flex;flex-direction:column;align-items:center;gap:var(--space-3);margin-bottom:var(--space-5)}
.record-btn{width:124px;height:124px;border-radius:999px;border:0;background:var(--action);color:var(--on-action);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 1px 2px rgba(10,42,69,.08),0 12px 40px rgba(10,42,69,.16);touch-action:manipulation}
.record-btn svg{width:42px;height:42px}
.record-btn.is-recording{background:var(--incorrect);animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(179,38,30,.35)}50%{box-shadow:0 0 0 18px rgba(179,38,30,0)}}
.record-status{font-size:15px;font-weight:700;color:var(--muted);min-height:22px}
.record-status.is-recording{color:var(--incorrect)}

.playback-row{display:flex;gap:var(--space-4);justify-content:center;align-items:center;margin-bottom:var(--space-5)}
.icon-btn{width:56px;height:56px;border-radius:999px;border:1.5px solid var(--control);background:var(--surface);display:flex;align-items:center;justify-content:center;cursor:pointer;touch-action:manipulation}
.icon-btn svg{width:24px;height:24px;fill:var(--ink)}
.icon-btn.danger{border-color:var(--incorrect)}
.icon-btn.danger svg{fill:var(--incorrect)}

.action-row{display:flex;gap:var(--space-3)}
.action-row .btn{flex:1}
.skip-link{display:block;text-align:center;margin-top:var(--space-4);background:none;border:0;color:var(--muted);font-size:14px;font-weight:700;cursor:pointer;text-decoration:underline;width:100%;min-height:var(--touch)}

@media (max-width:380px){
  .record-btn{width:108px;height:108px}
  .prompt-word{font-size:32px;line-height:40px}
}

[hidden]{display:none!important}

.dash-page{padding:var(--space-6) var(--space-6) calc(var(--space-8) + env(safe-area-inset-bottom))}
.dash-top{display:flex;align-items:center;gap:var(--space-3);margin-bottom:var(--space-6)}
.dash-top .mark{height:32px;width:auto}
.dash-top h1{font-size:20px;margin:0}
.quota-card{background:var(--hero);border-radius:var(--radius-lg);padding:var(--space-6);margin-bottom:var(--space-5)}
.quota-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:var(--space-3)}
.quota-head .label{font-size:14px;font-weight:700;color:var(--muted)}
.quota-head .count{font-size:15px;font-weight:800;color:var(--ink)}
.quota-card .progress{margin-bottom:var(--space-4)}
.quota-card .btn{width:100%}
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4);margin-bottom:var(--space-5)}
.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-5)}
.stat-card .stat-label{font-size:13px;font-weight:700;color:var(--muted);margin:0 0 6px}
.stat-card .stat-value{font-size:26px;font-weight:800;color:var(--ink);margin:0}
.stat-card .stat-sub{font-size:12px;color:var(--muted);margin:4px 0 0}
.earn-card{background:var(--navy);color:#fff;border-radius:var(--radius-lg);padding:var(--space-6);margin-bottom:var(--space-6)}
.earn-label{font-size:13px;font-weight:700;color:rgba(255,255,255,.7);margin:0 0 4px}
.earn-value{font-size:30px;font-weight:800;margin:0 0 2px;letter-spacing:-0.01em}
.earn-sub{font-size:13px;color:rgba(255,255,255,.75);margin:0}
.earn-divider{height:1px;background:rgba(255,255,255,.18);margin:var(--space-4) 0}
.earn-row{display:flex;justify-content:space-between;font-size:14px;margin:0 0 6px;color:rgba(255,255,255,.9)}
.earn-row span:first-child{color:rgba(255,255,255,.65)}
.section-title{font-size:15px;font-weight:800;color:var(--ink);margin:0 0 var(--space-3)}
.history-list{display:flex;flex-direction:column;gap:var(--space-3);margin-bottom:var(--space-6)}
.history-item{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4) var(--space-5)}
.history-item .word{font-weight:700;color:var(--ink);font-size:15px;margin:0}
.history-item .meaning{font-size:13px;color:var(--muted);margin:2px 0 0}
.status-pill{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.status-pill.approved{background:var(--correct-soft);color:var(--correct)}
.status-pill.pending{background:var(--hero);color:var(--muted)}
.status-pill.flagged{background:var(--incorrect-soft);color:var(--incorrect)}
@media (max-width:380px){
  .stat-card .stat-value{font-size:22px}
  .earn-value{font-size:26px}
}

.admin-shell{display:flex;min-height:100vh}
.admin-side{width:220px;flex:none;background:var(--navy);color:#fff;padding:var(--space-6) var(--space-4);display:flex;flex-direction:column;gap:var(--space-6)}
.side-brand{display:flex;align-items:center;gap:10px}
.side-brand .mark{height:30px;width:30px;border-radius:7px;object-fit:cover}
.side-brand .wordmark{font-family:'Cinzel',serif;font-weight:900;font-size:14px;letter-spacing:.04em;color:#fff}
.side-nav{display:flex;flex-direction:column;gap:4px}
.side-item{display:block;padding:10px 12px;border-radius:var(--radius-md);color:rgba(255,255,255,.75);font-size:14px;font-weight:700;text-decoration:none;cursor:pointer;border:0;background:none;text-align:left;width:100%;font-family:inherit}
.side-item:hover{background:rgba(255,255,255,.08)}
.side-item.active{background:var(--brand);color:#fff}
.admin-main{flex:1;min-width:0;background:var(--bg)}
.admin-top{display:flex;align-items:center;justify-content:space-between;padding:var(--space-5) var(--space-6);border-bottom:1px solid var(--line);background:var(--surface)}
.admin-tool{font-size:14px;font-weight:700;color:var(--muted)}
.admin-user{font-size:13px;color:var(--muted);display:flex;align-items:center}
.admin-user a{color:var(--action);text-decoration:underline;font-weight:700}
.admin-content{padding:var(--space-6);max-width:960px}
.admin-panel[hidden]{display:none}
.hero-card{position:relative;overflow:hidden;background:var(--brand);color:#fff;border-radius:var(--radius-lg);padding:var(--space-8) var(--space-6);margin-bottom:var(--space-5)}
.hero-card .eyebrow{font-size:12px;font-weight:800;letter-spacing:.08em;color:rgba(255,255,255,.75);margin:0 0 6px}
.hero-card h1{font-size:28px;margin:0 0 6px;color:#fff}
.hero-card p{font-size:14px;color:rgba(255,255,255,.9);margin:0;max-width:60ch}
.hero-card::after{content:"";position:absolute;right:-40px;top:-60px;width:180px;height:180px;border-radius:999px;background:rgba(255,255,255,.12)}
.filter-bar{display:flex;flex-direction:column;gap:var(--space-3);margin-bottom:var(--space-5)}
.filter-bar input{height:var(--control-h);border:1px solid var(--control);border-radius:var(--radius-md);padding:0 var(--space-4);font-size:15px;background:var(--surface);width:100%}
.filter-bar input:focus{outline:2px solid var(--action);outline-offset:1px}
.queue-table{display:flex;flex-direction:column;gap:var(--space-3)}
.queue-row{display:flex;align-items:center;gap:var(--space-4);background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-4) var(--space-5);flex-wrap:wrap}
.queue-row .play-btn{width:40px;height:40px;border-radius:999px;border:0;background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:center;flex:none;cursor:pointer}
.queue-row .play-btn svg{width:14px;height:14px;fill:#fff}
.queue-meta{flex:1;min-width:160px}
.queue-meta .word{font-weight:700;color:var(--ink);font-size:15px;margin:0}
.queue-meta .sub{font-size:13px;color:var(--muted);margin:2px 0 0}
.lang-tag{font-size:11px;font-weight:700;color:var(--action);background:var(--hero);padding:2px 8px;border-radius:999px;margin-left:6px}
.queue-speaker{font-size:13px;color:var(--muted);flex:none;width:110px}
.status-pill.notreviewed{background:var(--hero);color:var(--action)}
.queue-actions{display:flex;gap:8px;flex:none}
.q-btn{width:36px;height:36px;border-radius:999px;border:0;display:flex;align-items:center;justify-content:center;cursor:pointer}
.q-btn.approve{background:var(--correct-soft);color:var(--correct)}
.q-btn.reject{background:var(--incorrect-soft);color:var(--incorrect)}
.q-btn svg{width:16px;height:16px;fill:currentColor}
.audit-list{display:flex;flex-direction:column}
.audit-item{display:flex;gap:var(--space-4);padding:var(--space-4) 0;border-bottom:1px solid var(--line)}
.audit-time{font-size:12px;color:var(--muted);flex:none;width:100px}
.audit-text{font-size:14px;color:var(--ink);margin:0}
.audit-text b{font-weight:700}
@media (max-width:720px){
  .admin-shell{flex-direction:column}
  .admin-side{width:100%;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--space-4)}
  .side-nav{flex-direction:row}
  .queue-speaker{display:none}
}


/* Internal-tools layout standard (claude/internal-layout-standard.md):
   main menu (area tiles, navy) + section menu (Overview, then parts) +
   main area (Overview summary, or a working screen under a blue heading). */
.console-shell{display:flex;min-height:100vh}
.console-section{width:200px;flex:none;background:var(--surface);border-right:1px solid var(--line);padding:var(--space-6) var(--space-4);display:flex;flex-direction:column;gap:4px}
.console-section .section-label{font-size:11px;font-weight:800;letter-spacing:.06em;color:var(--muted);text-transform:uppercase;margin:0 0 var(--space-3) 4px}
.section-item{display:block;padding:10px 12px;border-radius:var(--radius-md);color:var(--ink);font-size:14px;font-weight:700;text-decoration:none;cursor:pointer;border:0;background:none;text-align:left;width:100%;font-family:inherit}
.section-item:hover{background:var(--hero)}
.section-item.active{background:var(--hero);color:var(--action)}
.console-main{flex:1;min-width:0;background:var(--bg)}
.console-page[hidden]{display:none}
.page-heading{color:var(--brand);font-size:24px;font-weight:800;margin:0 0 var(--space-5)}

/* Overview: headline numbers, by-language table, needs-attention list. */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:var(--space-4);margin-bottom:var(--space-6)}
.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);padding:var(--space-5)}
.stat-card .num{font-size:32px;font-weight:800;color:var(--ink);line-height:1.1}
.stat-card .label{font-size:13px;color:var(--muted);margin-top:4px}
.section-title{font-size:16px;font-weight:800;color:var(--ink);margin:var(--space-6) 0 var(--space-3)}
.data-table{width:100%;border-collapse:collapse;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);overflow:hidden}
.data-table th,.data-table td{text-align:left;padding:10px 14px;font-size:14px;border-bottom:1px solid var(--line)}
.data-table th{color:var(--muted);font-weight:700;font-size:12px;text-transform:uppercase;letter-spacing:.03em;background:var(--hero)}
.data-table th.sortable{cursor:pointer;user-select:none;white-space:nowrap}
.data-table th.sortable .arrow{opacity:.4;font-size:11px;margin-left:4px}
.data-table th.sortable.sorted .arrow{opacity:1;color:var(--action)}
.data-table tr:last-child td{border-bottom:0}
.attention-list{display:flex;flex-direction:column;gap:var(--space-3)}
.attention-item{display:flex;align-items:flex-start;gap:var(--space-4);background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--gold);border-radius:var(--radius-md);padding:var(--space-4) var(--space-5)}
.attention-item .who{font-weight:700;font-size:14px;color:var(--ink)}
.attention-item .why{font-size:13px;color:var(--muted);margin-top:2px}
.attention-empty{font-size:14px;color:var(--muted);padding:var(--space-5);text-align:center;border:1px dashed var(--line);border-radius:var(--radius-md)}

/* Working-screen list controls: filters, page size, paging. */
.list-toolbar{display:flex;flex-wrap:wrap;gap:var(--space-3);align-items:center;justify-content:space-between;margin-bottom:var(--space-4)}
.list-toolbar .chips{flex:1 1 auto}
.page-size select{height:36px;border-radius:var(--radius-md);border:1px solid var(--control);background:var(--surface);font-size:13px;padding:0 8px}
.pager{display:flex;align-items:center;gap:var(--space-3);margin-top:var(--space-4);font-size:13px;color:var(--muted)}
.pager button{height:32px;padding:0 14px;border-radius:var(--radius-pill);border:1.5px solid var(--control);background:var(--surface);font-weight:700;font-size:13px;color:var(--ink);cursor:pointer}
.pager button:disabled{opacity:.4;cursor:default}

@media (max-width:860px){
  .console-shell{flex-direction:column}
  .admin-side{width:100%}
  .console-section{width:100%;flex-direction:row;overflow-x:auto}
}

/* Gentle warnings (e.g. the recorder's long-silence check, b-12): Kente
   Gold edge, readable in both themes. */
.warn-text{font-size:14px;line-height:20px;color:var(--ink);background:rgba(242,178,51,.16);border-left:3px solid var(--gold);padding:10px 12px;border-radius:var(--radius-md);margin:0 0 var(--space-4);text-align:left}
.warn-text b{font-weight:700}

/* Trim by hand (b-12, admin): assets/trim-editor.js */
.trim-dialog{width:min(860px,94vw);border:1px solid var(--line);border-radius:var(--radius-lg);padding:var(--space-6);background:var(--surface);color:var(--ink);box-shadow:0 20px 60px rgba(10,42,69,.35)}
.trim-dialog::backdrop{background:rgba(10,42,69,.55)}
.trim-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.trim-head h2{margin:0;font-size:22px;font-weight:800;color:var(--action)}
html[data-theme="dark"] .trim-head h2{color:var(--brand)}
.trim-close{width:44px;height:44px;border:0;border-radius:999px;background:transparent;color:var(--muted);font-size:28px;line-height:1;cursor:pointer}
.trim-close:hover{background:var(--hero);color:var(--ink)}
.trim-sub{margin:4px 0 0;font-size:18px;font-weight:700}
.trim-help{margin:6px 0 var(--space-4)}
.trim-wave{position:relative;height:160px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--hero);touch-action:none;cursor:ew-resize;user-select:none;overflow:visible}
.trim-wave canvas{display:block;width:100%;height:160px;border-radius:var(--radius-md)}
.trim-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--muted);font-weight:700;background:var(--hero);border-radius:var(--radius-md)}
.trim-handle{position:absolute;top:-6px;bottom:-6px;width:24px;margin-left:-12px;cursor:ew-resize;display:flex;justify-content:center;outline:none}
.trim-handle::before{content:"";width:3px;height:100%;background:var(--action);border-radius:2px}
.trim-handle span{position:absolute;top:50%;width:16px;height:36px;margin-top:-18px;border-radius:8px;background:var(--action);border:2px solid var(--surface);box-shadow:0 1px 4px rgba(10,42,69,.35)}
.trim-handle:focus-visible span{outline:3px solid var(--gold);outline-offset:2px}
.trim-readout{display:flex;flex-wrap:wrap;gap:6px 24px;margin:var(--space-3) 0;font-size:15px;color:var(--muted)}
.trim-readout b{color:var(--ink);margin-right:4px}
.trim-tools{display:flex;flex-wrap:wrap;gap:8px}
.trim-tools .chip{min-height:38px;font-size:14px;padding:0 14px}
.trim-now{font-size:14px;color:var(--muted);margin:var(--space-4) 0 0}
.trim-now b{color:var(--ink)}
.trim-actions{margin-top:var(--space-4)}
html[data-theme="dark"] .trim-handle::before,html[data-theme="dark"] .trim-handle span{background:var(--brand)}

/* Light/dark switch in the header of staff and reviewer pages (review, choose):
   names the theme you'd switch to. Same look in both themes' surfaces. */
.theme-pill{min-height:36px;padding:0 14px;border-radius:999px;border:1.5px solid var(--control);background:var(--surface);color:var(--ink);font:inherit;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap}
.theme-pill:hover{border-color:var(--action);color:var(--action)}
html[data-theme="dark"] .theme-pill:hover{border-color:var(--brand);color:var(--brand)}
.theme-pill:focus-visible{outline:3px solid var(--action);outline-offset:2px}
.page-top{display:flex;justify-content:flex-end;align-items:center;gap:14px;margin-bottom:var(--space-4)}
.page-top a{color:var(--action);font-weight:700;font-size:14px}
html[data-theme="dark"] .page-top a{color:var(--brand)}
/* Audiobank admin header on phones: the light/dark switch and Sign out stay
   on one line; the long email gives way. */
#headerTheme{white-space:nowrap}
@media (max-width:640px){
  .admin-top{padding:var(--space-3) var(--space-4);gap:8px 10px;flex-wrap:wrap}
  .admin-top > span:last-child{flex-wrap:wrap;gap:8px 12px !important}
  .admin-top .admin-tool{font-size:14px}
  .admin-user{display:flex;gap:10px;white-space:nowrap}
  .admin-user .admin-email{display:none}
  #adminRoleLinks a{white-space:nowrap}
}
