/* Layout: one phone-width study companion; five rooms behind a bottom tab bar; content scrolls, chrome stays still. */
:root {
  /* Colours come from tokens.css, generated from app.json by app_kit.py. These map its font roles. */
  --display: var(--font-display);
  --body: var(--font-body);
  --read: var(--font-read);
  --mono: var(--font-mono);
  --read-size: 1.125rem;
  --shadow: 0 1px 2px rgb(46 58 64 / .06), 0 8px 24px rgb(46 58 64 / .07);
}
:root[data-theme="dark"] { --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25); } }
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }

.app {
  max-width: 520px; margin: 0 auto; min-height: 100%;
  display: flex; flex-direction: column;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(84px + env(safe-area-inset-bottom, 0px));
}

/* Header */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-block: 22px 6px; }
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.wordmark { font: 500 31px/1.05 var(--display); letter-spacing: -.015em; }
.wordmark b { font-style: normal; font-weight: 400; color: var(--accent); }
.sprig { width: 64px; height: 48px; flex: none; }
/* Art slots: each takes a supplied image, else the built-in line sprig. Monochrome art is tinted by --art-tint. */
.art { display: inline-block; }
.art svg, .art img { width: 100%; height: 100%; display: block; object-fit: contain; }
.art.mask { background: var(--art-tint); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.sprig path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
:root[data-ornament="off"] .sprig, :root[data-ornament="off"] .orn { display: none; }

.view { display: none; flex-direction: column; gap: 18px; padding-top: 10px; }
.view.on { display: flex; animation: rise .35s ease both; }
@keyframes rise { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.on { animation: none; } * { transition: none !important; } }

.h2 { font: 500 24px/1.15 var(--display); }
.h2 i { color: var(--accent); }
.sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; max-width: 60ch; }
.label { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Today strip */
.today { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.today > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.today .big { font: 500 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.today .big small { font: 400 12px var(--body); color: var(--muted); margin-left: 3px; }
.today .first { background: var(--glacier); border-color: transparent; }
.today .first .label { color: var(--ink); opacity: .75; }
.today .goal { border: 0; background: transparent; padding: 0; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); opacity: .8; width: 100%; }
.today input[type=date] { border: 0; background: transparent; padding: 0; font-size: 12px; color: var(--ink); opacity: .8; width: 100%; }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 15px; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn svg { width: 16px; height: 16px; }

/* Library */
.sources { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.src { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.src input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0 0 0 2px; flex: none; }
.src > .open-row { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 10px 2px; display: flex; flex-direction: column; gap: 3px; border-radius: 10px; }
.src > .open-row:disabled { cursor: default; opacity: .85; }
.src .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.src .d { font-size: 13.5px; line-height: 1.4; color: var(--ink); opacity: .8; }
.src .m { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.src .more { flex: none; border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); display: grid; place-items: center; }
.src .more svg { width: 20px; height: 20px; }
.src .ctl { display: inline-flex; gap: 2px; flex: none; }
.src .ctl button { border: 0; background: var(--sunk); width: 32px; height: 32px; border-radius: 50%; color: var(--muted); display: grid; place-items: center; }
.src .ctl button:disabled { opacity: .35; }
.src .ctl svg { width: 16px; height: 16px; }
.src.on { background: var(--hl); border-radius: 12px; }
.tag { display: inline-block; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; background: var(--sunk); color: var(--muted); margin-right: 6px; vertical-align: 1px; }
.drop { border: 1.5px dashed var(--line); border-radius: 16px; padding: 18px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.drop.over { border-color: var(--accent); background: var(--hl); }
.paste { display: none; flex-direction: column; gap: 8px; }
.paste.on { display: flex; }
.field { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; }
textarea.field { min-height: 110px; resize: vertical; line-height: 1.5; }

/* Reader */
.reader-head { display: flex; flex-direction: column; gap: 4px; }
.reader-title { font: 500 26px/1.15 var(--display); }
.doc { font: 400 var(--read-size)/1.7 var(--read); max-width: 62ch; }
.doc p { margin: 0 0 1em; }
.doc .s { border-radius: 4px; transition: background .2s; cursor: pointer; }
.doc .s.now { background: var(--hl); box-shadow: 0 0 0 3px var(--hl); }
.doc .w { background: var(--glacier); border-radius: 3px; }
.doc h4 { font: 600 13px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 1.6em 0 .6em; }
.doc .speaker { font: 600 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.doc .speaker img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.player {
  position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.player .in { max-width: 488px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.player .play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.player .play svg { width: 18px; height: 18px; }
.player .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.player .now-t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 3px; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.player select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 6px; font: 500 12px var(--mono); }
.player .skip { border: 0; background: transparent; padding: 4px; color: var(--muted); }
.player .skip svg { width: 20px; height: 20px; }

/* Studio */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.picked { font-size: 13px; color: var(--muted); }
.out { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.out .doc { font-size: calc(var(--read-size) - 1px); }
.thinking { font: 400 13px var(--mono); color: var(--muted); }
.note { font-size: 12.5px; color: var(--muted); }

/* Quiz */
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.qmeta { display: flex; justify-content: space-between; gap: 8px; font: 500 12px var(--mono); color: var(--muted); }
.qtext { font: 400 21px/1.35 var(--read); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15px; line-height: 1.4; }
.opt b { font: 500 13px var(--mono); color: var(--muted); }
.opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.why { border-left: 2px solid var(--glacier); padding: 2px 0 2px 12px; font-size: 14px; color: var(--ink); }
.why strong { color: var(--accent); }
.dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.r { background: var(--good); } .dots i.x { background: var(--bad); } .dots i.c { background: var(--accent); }
.done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0; }
.done .score { font: italic 500 54px/1 var(--display); color: var(--accent); }

/* Style */
.skins { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.skin { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.skin[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.swatches { display: flex; gap: 0; }
.swatches i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -6px; }
.swatches i:first-child { margin-left: 0; }
.skin span { font: italic 500 17px var(--display); }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting > div { min-width: 0; }
.setting .s1 { font-weight: 600; }
.setting .s2 { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); flex: none; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
input[type=range] { accent-color: var(--accent); width: 130px; }
.preview { font: 400 var(--read-size)/1.6 var(--read); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }

/* Tab bar */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabs nav { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab { border: 0; background: transparent; padding: 9px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted); }
.tab svg { width: 22px; height: 22px; }
.tab[aria-selected="true"] { color: var(--accent); }
.orn { display: flex; justify-content: center; opacity: .9; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 999px; font-size: 13px; z-index: 9; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }
.fb-open { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 11px 6px 9px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--accent); }
.fb-open svg { width: 18px; height: 18px; }
.sheet-bg { position: fixed; inset: 0; background: rgba(10,20,24,.35); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 520px; margin: 0 auto; max-height: 88%; overflow: auto;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-block: 10px calc(20px + env(safe-area-inset-bottom, 0px)); }
.sheet[hidden], .sheet-bg[hidden] { display: none !important; }
.grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 6px; }
.fb-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.fb-item { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fb-item .m { font: 400 11.5px var(--mono); color: var(--muted); }
.motif { display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; background: currentColor; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.motif.big { width: 40px; height: 40px; margin: 0; flex: none; color: var(--art-tint); }
.colcard .motif.big { color: var(--ink); opacity: .8; }
.motifs { display: flex; gap: 6px; flex-wrap: wrap; }
.mot { border: 1px solid transparent; background: var(--surface); border-radius: 12px; padding: 6px; }
.mot[aria-pressed="true"] { border-color: var(--ink); }
.search { position: relative; }
.search input { padding-left: 38px; border-radius: 999px; }
.search svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); }
.cols { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin-inline: -2px; padding-inline: 2px; }
.cols::-webkit-scrollbar { display: none; }
.cols .chip { flex: none; }
.chip .n { font: 500 11px var(--mono); opacity: .7; margin-left: 4px; }
.colcard { background: var(--glacier); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.colcard .nm { font: italic 500 22px/1.15 var(--display); }
.colcard .nm input { font: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--ink); width: 100%; padding: 0; }
.colcard .btn { background: var(--surface); }
.colcard .btn.primary { background: var(--accent); }
.made { display: flex; flex-direction: column; }
.made button { text-align: left; border: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); background: transparent; padding: 9px 0; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.made button span:last-child { font: 400 12px var(--mono); color: var(--muted); flex: none; text-align: right; }
.made .stale { color: var(--accent); }
.snip { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.snip mark { background: var(--hl); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.linkbtn { border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 13px; padding: 4px 0; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.stages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.stage { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.stage.on { background: var(--accent); color: var(--accent-ink); }
.stage.done { background: var(--glacier); color: var(--ink); }
.thumbs { display: inline-flex; gap: 4px; }
.thumb { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); }
.thumb svg { width: 17px; height: 17px; }
.thumb[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.brake { border: 1px solid var(--line); background: var(--sunk); border-radius: 14px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.brake svg { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 1px; }
.empty { color: var(--muted); font-size: 14px; padding: 16px 0; }
.hint { margin-top: 12px; background: var(--glacier); color: var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.offline { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mock-note { font: 400 12px var(--mono); color: var(--muted); }
/* Home-screen app: the page owns its own reset and safe areas. */
body { margin: 0; }
.top { padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
img { max-width: 100%; }

/* The five actions: pinned while she ticks documents further down the list. */
.colcard.sticky { position: sticky; top: calc(8px + env(safe-area-inset-top)); z-index: 5; box-shadow: var(--shadow); }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acts .btn { justify-content: center; }
.acts .wide { grid-column: 1 / -1; }
.figs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 12px; scroll-snap-type: x mandatory; }
.figs figure { margin: 0; flex: 0 0 72%; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.figs img { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #fff; }
.figs figcaption { font: 13px/1.4 var(--body); color: var(--muted); padding: 8px 10px; }
.buddy { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--glacier); color: var(--ink); display: grid; place-items: center; padding: 0; }
.buddy .art { width: 24px; height: 24px; display: grid; place-items: center; }
.buddy svg { width: 24px; height: 24px; }
.voices { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
#voiceList { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.vrow { display: flex; justify-content: space-between; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; }
.vrow b { display: block; font-weight: 500; }
.vrow small { color: var(--muted); font-size: 12px; }
.vrow svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.vrow[aria-checked="true"] { border-color: var(--accent); background: var(--hl); }

/* Library: two modes. Browse is plain; picking tints the page and shows ticks and a bar. */
.seg.wide { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.seg.wide button { padding: 9px 11px; font-size: 14px; }
.seg [aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.libbar { display: flex; gap: 8px; justify-content: space-between; }
.picking { position: sticky; top: calc(8px + env(safe-area-inset-top)); z-index: 5; background: var(--glacier); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.pk-head { display: flex; flex-direction: column; gap: 2px; }
.pk-head b { font: italic 500 20px/1.15 var(--display); }
.pk-bar { display: flex; flex-direction: column; gap: 8px; }
.pk-bar .picked { font: 500 13px var(--mono); color: var(--ink); }
.pk-bar .btn { background: var(--surface); }
.pk-bar .btn.primary { background: var(--accent); }
.pk-bar #pkCancel { align-self: flex-start; background: transparent; }
.selecting .sources { border-top-color: var(--accent); }
.stacklist { display: flex; flex-direction: column; gap: 10px; }
.stackcard { display: flex; gap: 14px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.stackcard b { display: block; font: italic 500 19px/1.2 var(--display); }
.stackcard small { color: var(--muted); font-size: 13px; }
.stackcard .motif.big { color: var(--art-tint); }
.section-h { display: flex; justify-content: space-between; align-items: baseline; padding-top: 6px; }
.section-h h3 { font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.back { align-self: flex-start; }
.danger { align-self: flex-start; color: var(--muted); font-weight: 500; text-align: left; }
.mrow { display: flex; align-items: center; gap: 6px; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.mrow > button:first-child { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 10px 0; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.mrow > button:first-child span:last-child { font: 400 12px var(--mono); color: var(--muted); flex: none; text-align: right; }
.mrow .tag { font-size: 9px; }
.mrow .rm { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); display: grid; place-items: center; flex: none; }
.mrow .rm svg { width: 15px; height: 15px; }
.mrow .rm.sure { background: var(--bad); color: #fff; }
.made .label { padding-bottom: 6px; display: block; }
.docbar { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.docbar .desc { margin: 0; font-size: 14.5px; line-height: 1.45; }
.docbar .acts { grid-template-columns: 1fr 1fr 1fr; }
.docbar .acts .btn { padding: 8px 10px; font-size: 13px; }
.docbar .note .linkbtn { padding: 0; }
/* The menu sheet */
.menu { display: flex; flex-direction: column; }
.menu .label { padding: 14px 0 4px; }
.menu .mi { text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 13px 2px; display: flex; flex-direction: column; gap: 2px; font-size: 15.5px; font-weight: 500; }
.menu .mi small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.menu-new { display: flex; gap: 8px; padding-top: 10px; }
.menu-new .btn { flex: none; }
/* Toast with Undo */
.toast { display: flex; gap: 12px; align-items: center; }
.toast.act { pointer-events: auto; }
.toast .linkbtn { color: var(--bg); text-decoration: underline; padding: 0; }
/* Voices: big rows, a mark on the chosen one, a playing state, a plain message if one fails */
.vrow { min-height: 58px; gap: 12px; width: 100%; }
.vrow .vname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vrow b { font-size: 16px; }
.vrow .vmark { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.vrow[aria-checked="true"] .vmark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vrow .vmark svg { width: 15px; height: 15px; }
.vrow .vplay { width: 36px; height: 36px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; flex: none; }
.vrow.loading .vplay { animation: pulse 1s ease-in-out infinite; }
.vrow.playing .vplay { background: var(--accent); }
.vrow.playing .vplay svg { color: var(--accent-ink); }
.vrow .verr { font-style: normal; font-size: 12.5px; color: var(--bad); }
@keyframes pulse { 50% { opacity: .4; } }

/* The sign-in screen: shown signed out, or for an account the API refuses. */
/* Until the API accepts her token (app.js adds .signed-in), only the sign-in screen can show. */
html:not(.signed-in) body > :not(.app), html:not(.signed-in) .app > :not(.gate) { display: none !important; }
.gate { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 32px 20px; }
.gate img { border-radius: 22px; }
.gate h1 { margin: 8px 0 0; }
.gate .sub { margin: 0 0 8px; }
