:root {
  --paper: #efe9e2;
  --paper-raised: #f7f3ec;
  --ink: #332e2b;
  --ink-soft: #6d635c;
  --ink-faint: #6e645c;
  --rule: #d9cfc2;
  --plum: #6b4a58;
  --plum-deep: #4d3540;
  --plum-tint: #eadde2;
  --gold: #a3792f;
  --gold-tint: #f1e3c8;
  --slate: #46586b;
  --slate-tint: #dfe6ec;
  --good: #5c7256;
  --good-tint: #e3e9df;
  /* Text-on-color pairs, chosen to pass readability checks (contrast 4.5+) */
  --on-plum: #faf6f2;   /* text on plum buttons */
  --on-good: #ffffff;   /* text on green 'done' dots */
  --gold-text: #7f5b1c; /* gold used as text (gold itself stays for borders/bars) */
  --good-text: #526a4d; /* green used as text */
  --shadow: 0 1px 0 rgba(51,46,43,0.06);
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Karla', 'Trebuchet MS', Tahoma, sans-serif;
}
/* Dark mode: follows the phone's setting. (Written the older way so iOS 16 and earlier understand it.) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #221e1e; --paper-raised: #2b2626; --ink: #ede6de; --ink-soft: #b7ab9f;
    --ink-faint: #a0968c; --rule: #40382f; --plum: #d9a6ba; --plum-deep: #f0c9d6;
    --plum-tint: #3a2b32; --gold: #d3aa5e; --gold-tint: #3a3122; --slate: #9ab2c9;
    --slate-tint: #263038; --good: #94b28a; --good-tint: #2a3327; --shadow: 0 1px 0 rgba(0,0,0,0.3);
    --on-plum: #221e1e; --on-good: #1d2a1a; --gold-text: #d3aa5e; --good-text: #94b28a;
  }
}
:root[data-theme="dark"] {
  --paper: #221e1e; --paper-raised: #2b2626; --ink: #ede6de; --ink-soft: #b7ab9f;
  --ink-faint: #a0968c; --rule: #40382f; --plum: #d9a6ba; --plum-deep: #f0c9d6;
  --plum-tint: #3a2b32; --gold: #d3aa5e; --gold-tint: #3a3122; --slate: #9ab2c9;
  --slate-tint: #263038; --good: #94b28a; --good-tint: #2a3327; --shadow: 0 1px 0 rgba(0,0,0,0.3);
    --on-plum: #221e1e; --on-good: #1d2a1a; --gold-text: #d3aa5e; --good-text: #94b28a;
}
* { box-sizing: border-box; }
/* Anything marked hidden stays hidden, even if its class sets a display style */
[hidden] { display: none !important; }
:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { overflow-y: scroll; scrollbar-gutter: stable; scroll-padding-top: env(safe-area-inset-top, 0px); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
body { padding: 20px max(18px, env(safe-area-inset-right, 0px)) 40px max(18px, env(safe-area-inset-left, 0px)); }
/* Phones: no double-tap-zoom delay on buttons, softer tap flash */
button, .btn, .chip, .tab, a, summary { touch-action: manipulation; -webkit-tap-highlight-color: rgba(107,74,88,.15); }
.page { max-width: 620px; margin: 0 auto; }
.letterhead { border-bottom: 1px solid var(--rule); padding-bottom: 20px; margin-bottom: 22px; }
.letterhead .mark { font-size: 22px; line-height: 1; margin-bottom: 10px; }
h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(28px, 6vw, 36px); letter-spacing: -0.01em; margin: 0 0 6px; color: var(--ink); }
.sub { font-size: 15px; color: var(--ink-soft); max-width: 46ch; line-height: 1.5; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 0; border-bottom: 1px solid var(--rule); margin-bottom: 26px; }
.tab { font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: var(--ink-faint); background: none; border: none; padding: 9px 4px 11px; margin-right: 18px; cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--plum); border-bottom-color: var(--plum); }
.panel { display: none; animation: fade .25s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(3px);} to {opacity:1; transform:none;} }
.card { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 3px; padding: 22px 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card h2, .card h3 { font-family: var(--font-serif); font-weight: 600; margin-top: 0; color: var(--ink); }
.card h2 { font-size: 20px; }
.card h3 { font-size: 16.5px; margin-bottom: 8px; }
p { line-height: 1.55; }
.muted { color: var(--ink-soft); font-size: 14px; }
button { font-family: var(--font-sans); cursor: pointer; }
.btn { display: inline-block; font-size: 14.5px; font-weight: 600; padding: 10px 18px; border-radius: 3px; border: 1px solid var(--plum); background: var(--plum); color: var(--on-plum); transition: opacity .15s ease, transform .1s ease; }
.btn:hover { opacity: .88; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--plum); }
.btn.small { padding: 6px 13px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: default; }
input[type="text"], input[type="number"], input[type="date"], textarea { font-family: var(--font-sans); font-size: 14.5px; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
input:focus, textarea:focus, button:focus-visible, .tab:focus-visible, .dot:focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }
label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); display:block; margin-bottom: 5px; margin-top: 14px; }
label:first-of-type { margin-top: 0; }
.names-row { display: flex; gap: 12px; margin-bottom: 4px; }
.names-row > div { flex: 1; }
.stage { display: flex; align-items: center; justify-content: center; gap: 0; margin: 22px 0 10px; position: relative; min-height: 108px; }
.floor-name { flex: 1; text-align: center; padding: 16px 8px; border-radius: 4px; border: 1px solid var(--rule); background: var(--paper); transition: background .35s ease, border-color .35s ease, transform .35s ease; font-family: var(--font-serif); font-size: 19px; }
.floor-name.on { background: var(--gold-tint); border-color: var(--gold); transform: translateY(-3px); }
.floor-name .role { display: block; font-family: var(--font-sans); font-size: 12px; font-weight: 700; color: var(--ink-faint); margin-top: 4px; }
.floor-name.on .role { color: var(--gold-text); }
.token { width: 30px; height: 30px; margin: 0 14px; flex-shrink: 0; transition: transform .35s cubic-bezier(.4,0,.2,1); }
.token.flip { transform: rotate(180deg); }
.reminders { background: var(--slate-tint); border-radius: 3px; padding: 14px 16px; margin-top: 14px; font-size: 14px; }
.reminders strong { color: var(--slate); }
.reminders ul { margin: 8px 0 0; padding-left: 18px; }
.reminders li { margin-bottom: 4px; line-height: 1.45; }
.timerbar-wrap { height: 5px; background: var(--rule); border-radius: 3px; margin-top: 16px; overflow: hidden; }
.timerbar { height: 100%; background: var(--gold); width: 100%; transition: width 1s linear; }
.timer-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.pause-banner { display: none; background: var(--plum-tint); color: var(--plum-deep); border-radius: 3px; padding: 10px 14px; font-size: 14px; font-weight: 600; margin-top: 12px; }
.pause-banner.show { display: block; }
.controls-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.checklist label.line { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; color: var(--ink); font-size: 14.5px; margin-bottom: 9px; margin-top:0; cursor: pointer; }
.checklist input[type=checkbox] { margin-top: 3px; width: auto; }
.dots { display: flex; gap: 7px; margin-bottom: 18px; }
.dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ink-faint); cursor: pointer; transition: border-color .15s ease, transform .1s ease; }
.dot:hover { border-color: var(--plum); color: var(--plum); }
.dot:active { transform: scale(.92); }
.dot.done { background: var(--good); border-color: var(--good); color: var(--on-good); }
.dot.done:hover { border-color: var(--plum); }
.dot.now { border-color: var(--plum); color: var(--plum); }
.stem { font-family: var(--font-serif); font-size: 18px; color: var(--plum); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 13px; padding: 5px 11px; border-radius: 14px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft); }
.chip:hover { border-color: var(--plum); color: var(--plum); }
.chip.toggle.active { background: var(--gold-tint); border-color: var(--gold); color: var(--gold-text); font-weight: 600; }
.chip.toggle.active:hover { border-color: var(--gold); color: var(--gold-text); }
.field-block { margin-top: 0; }
.review-line { margin-bottom: 12px; }
.review-line .stem-mini { font-weight: 700; color: var(--plum); font-size: 13.5px; display:block; margin-bottom: 2px;}
.review-line p { margin: 0; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .guide-grid { grid-template-columns: 1fr; } }
.word-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.word-list span { font-size: 12.5px; padding: 3px 9px; border-radius: 12px; }
.word-list.good span { background: var(--slate-tint); color: var(--slate); }
.word-list.bad span { background: var(--plum-tint); color: var(--plum-deep); }
blockquote { font-family: var(--font-serif); font-style: italic; font-size: 15px; color: var(--ink-soft); border-left: 2px solid var(--gold); margin: 16px 0 0; padding-left: 14px; }
footer { text-align: center; color: var(--ink-faint); font-size: 12.5px; margin-top: 36px; }

/* I-statement builder */
.assembled { font-family: var(--font-serif); font-size: 19px; line-height: 1.5; color: var(--ink); background: var(--gold-tint); border-radius: 4px; padding: 16px 18px; margin-top: 16px; }
.assembled .fill { color: var(--gold-text); font-weight: 600; }
.assembled .fill.empty { color: var(--ink-faint); font-weight: 400; font-style: italic; }
table.swaps { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
table.swaps th { text-align: left; font-size: 12px; color: var(--ink-faint); font-weight: 700; padding: 0 8px 6px 0; border-bottom: 1px solid var(--rule); }
table.swaps td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; line-height: 1.4; }
table.swaps td:first-child { color: var(--ink-soft); width: 38%; }

/* Topics */
.surprise-card { text-align: center; padding: 26px 16px; }
.surprise-card .lvl { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--gold-text); margin-bottom: 8px; }
.surprise-card .txt { font-family: var(--font-serif); font-size: 21px; line-height: 1.4; color: var(--ink); min-height: 84px; display:flex; align-items:center; justify-content:center; }
.topic-group { margin-bottom: 16px; }
.topic-group h4 { font-family: var(--font-sans); font-size: 12.5px; font-weight: 700; color: var(--ink-faint); text-transform: none; margin: 0 0 8px; }
.topic-group ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6; }

/* Troubleshooting */
.trouble-item { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.trouble-item:last-child { border-bottom: none; }
.trouble-item summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink); list-style: none; }
.trouble-item summary::-webkit-details-marker { display: none; }
.trouble-item summary::before { content: '+ '; color: var(--plum); font-weight: 700; }
.trouble-item[open] summary::before { content: '\2013 '; }
.trouble-item p { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

/* In the moment */
.result-box { background: var(--slate-tint); color: var(--slate); border-radius: 3px; padding: 12px 14px; margin-top: 14px; font-size: 14px; line-height: 1.5; }
.result-box strong { display: block; margin-bottom: 4px; color: var(--ink); }
.filter-log-item { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.filter-counts { font-size: 13px; color: var(--ink-soft); }
.rule-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.rule-item:last-child { border-bottom: none; }
button.chip-remove { background: none; border: none; color: var(--ink-faint); font-size: 17px; line-height: 1; padding: 0 4px; cursor: pointer; flex-shrink: 0; }
button.chip-remove:hover { color: var(--plum); }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.metric-card { background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: 12px 14px; }
.metric-card .num { font-family: var(--font-serif); font-size: 24px; color: var(--ink); line-height: 1.2; }
.metric-card .lbl { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.status-badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 12px; white-space: nowrap; }
.status-badge.started { background: var(--paper); color: var(--ink-soft); border: 1px solid var(--rule); }
.status-badge.paused { background: var(--gold-tint); color: var(--gold-text); }
.status-badge.resolved { background: var(--good-tint); color: var(--good-text); }
.status-badge.heard { background: var(--slate-tint); color: var(--slate); }
.topic-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.topic-item:last-child { border-bottom: none; }
.topic-main { min-width: 0; }
.topic-name { font-size: 14.5px; color: var(--ink); display: block; }
.topic-date { font-size: 12px; }
.topic-note { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; white-space: pre-line; line-height: 1.45; }
.topic-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topic-controls select { font-family: var(--font-sans); font-size: 12.5px; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: 5px 7px; }
.add-row { display: flex; gap: 8px; margin-top: 0; }
.add-row input[type="text"] { margin-top: 0; }
.empty-note { margin: 0; }
.split-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.split-row input[type="text"] { margin-top: 0; flex: 1; }
.cluster-group { border: 1px solid var(--rule); border-radius: 3px; padding: 10px 12px 0; margin-bottom: 12px; background: var(--paper); }
.cluster-label { font-size: 12px; margin-bottom: 4px; }
.cluster-group .topic-item:last-child { border-bottom: none; }
/* Pop-up sheets (first-time welcome) */
dialog.sheet { width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper-raised); color: var(--ink); padding: 24px 22px 22px; box-shadow: 0 14px 44px rgba(0,0,0,.28); }
dialog.sheet::backdrop { background: rgba(34,30,30,.5); }
dialog.sheet h2 { font-family: var(--font-serif); font-weight: 600; font-size: 21px; margin: 0 0 6px; }
@media (max-width: 520px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 8px 8px 0 0; border-bottom: none; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}
.switch-phrase { font-family: var(--font-serif); font-size: clamp(24px, 6.5vw, 30px); line-height: 1.25; color: var(--plum-deep); margin: 14px 0 12px; }
.switch-alt { font-family: var(--font-serif); font-style: italic; color: var(--ink); }
.sheet-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule); }
.sheet-foot .btn:last-child { margin-left: auto; }

/* Floor: callout after a switch, and the paraphrase check */
.floor-callout { display: none; background: var(--gold-tint); border-left: 3px solid var(--gold); color: var(--ink); border-radius: 3px; padding: 11px 14px; font-size: 14.5px; line-height: 1.5; margin-top: 12px; }
.floor-callout.show { display: block; }
.floor-check { border: 1px solid var(--plum); background: var(--plum-tint); border-radius: 3px; padding: 14px 16px; margin-top: 14px; }
.floor-check[hidden] { display: none; }
.floor-check .q { font-size: 15px; font-weight: 600; color: var(--plum-deep); margin: 0; line-height: 1.45; }
.floor-check .q .say { font-family: var(--font-serif); font-style: italic; font-weight: 500; }
.floor-check .controls-row { margin-top: 12px; }
.text-btn { background: none; border: none; padding: 6px 2px; font-size: 13px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.text-btn:hover { color: var(--plum); }

/* Feeling-word nudge */
.nudge { background: var(--slate-tint); border-radius: 3px; padding: 11px 14px; margin: 10px 0 14px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.nudge[hidden] { display: none; }
.nudge p { margin: 0; }
.nudge .chips { margin-top: 8px; }
.nudge .chip { background: var(--paper-raised); }
.nudge .btn { margin-top: 10px; }

/* Debrief */
ol.debrief-steps { padding-left: 20px; margin: 14px 0 4px; font-size: 14.5px; line-height: 1.55; }
ol.debrief-steps li { margin-bottom: 6px; }
.starters { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; font-family: var(--font-serif); font-style: italic; font-size: 15px; color: var(--ink-soft); }
.return-time { font-family: var(--font-serif); font-size: 19px; color: var(--ink); margin: 0 0 2px; }
.wheel-intro { margin: 0 0 16px; }
.wheel-save { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 16px; }

/* ---------- Touch screens (phones and tablets) ----------
   Bigger tap targets (about 44px, the size Apple and Google recommend), and text boxes
   at 16px so iPhones don't zoom in when you tap into them. Desktop is unchanged. */
@media (pointer: coarse) {
  input[type="text"], input[type="number"], input[type="date"], textarea, select,
  .topic-controls select { font-size: 16px; }
  .btn, .btn.small { min-height: 44px; }
  .chip { min-height: 40px; padding: 8px 14px; }
  .tab { min-height: 44px; }
  .dot { width: 40px; height: 40px; font-size: 14px; }
  .dots { gap: 10px; }
  .text-btn { min-height: 40px; padding: 8px 4px; }
  button.chip-remove {
    min-width: 44px; min-height: 44px; font-size: 22px;
  }
  .topic-controls select { min-height: 40px; }
  .checklist input[type=checkbox] { width: 22px; height: 22px; margin-top: 0; }
  .checklist label.line { min-height: 40px; align-items: center; }
}

/* Narrow screens: the status dropdown already shows the status, so drop the duplicate badge
   to leave room for the entry's text. */
@media (max-width: 520px) {
  .topic-controls .status-badge { display: none; }
  .topic-controls { gap: 2px; }
}

/* "New version available" bar (top of the screen, below the notch) */
.update-bar { position: fixed; z-index: 40; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--slate-tint); color: var(--ink);
  border-bottom: 1px solid var(--rule); font-size: 14px; line-height: 1.4; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.update-bar[hidden] { display: none; }
.update-bar span { flex: 1 1 200px; }

/* Install how-to, notes, feedback */
.install-link { display: inline-block; margin-top: 10px; padding-left: 0; color: var(--plum); font-weight: 600; text-align: left; }
.install-steps { margin-top: 8px; }
.install-steps ol { margin: 8px 0 4px; padding-left: 20px; font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.installed-note { background: var(--good-tint); color: var(--good-text); border-radius: 3px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.installed-note[hidden], .note-box[hidden] { display: none; }
.note-box { background: var(--gold-tint); border-left: 3px solid var(--gold); border-radius: 3px; padding: 10px 14px; font-size: 14px; line-height: 1.5; color: var(--ink); margin: 12px 0 0; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.footer-link { font-size: 12.5px; color: var(--ink-faint); padding: 2px; }

/* Safety card (Guide) */
.safety-card { border-left: 3px solid var(--plum); }
.safety-list { padding-left: 18px; margin: 10px 0 12px; font-size: 14.5px; line-height: 1.6; }
.safety-list li { margin-bottom: 6px; }
.safety-list a { color: var(--plum); font-weight: 600; }

/* About us page (about/index.html) */
.about-page .back-link { display: inline-block; margin-bottom: 14px; }
.about-photo { margin: 0 0 18px; }
.about-photo img { display: block; width: 100%; height: auto; border-radius: 3px; border: 1px solid var(--rule); }
.about-story p { font-size: 16px; line-height: 1.65; margin: 0 0 14px; }
.about-story .signoff { font-family: var(--font-serif); font-size: 18px; margin: 18px 0 0; color: var(--plum); }
.about-cta { text-align: center; margin: 0; }
a.btn { text-decoration: none; }

/* Top bar: brand (goes Home) + menu button */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--rule); padding-bottom: 12px; margin-bottom: 20px; }
.topbar .brand { display: flex; align-items: center; gap: 8px; background: none; border: none; padding: 6px 0; color: var(--ink); font-family: var(--font-serif); font-weight: 600; font-size: clamp(18px, 4.8vw, 22px); text-align: left; }
.topbar .brand .mark { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; }
.menu-btn { flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--rule); background: var(--paper-raised); color: var(--ink); border-radius: 10px; font-size: 20px; line-height: 1; }
.menu-btn:hover { border-color: var(--plum); }
.install-link { display: block; margin: -10px 0 14px; }
.install-link[hidden] { display: none; }

/* Page title row (every page except Home) */
.page-head { margin: -6px 0 16px; }
.back-home { padding: 8px 0; font-size: 14px; }
.page-title { font-family: var(--font-serif); font-weight: 600; font-size: 24px; margin: 4px 0 0; color: var(--ink); }

/* Home: the three tools */
.hello { font-family: var(--font-serif); font-size: 24px; margin: 0 0 4px; }
.tool-btn { display: block; width: 100%; text-align: left; background: var(--paper-raised); border: 1px solid var(--rule); border-left: 4px solid var(--plum); border-radius: 6px; padding: 20px 18px; margin-bottom: 12px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s ease, transform .1s ease; }
.tool-btn:hover { border-color: var(--plum); }
.tool-btn:active { transform: translateY(1px); }
.tool-btn.gold { border-left-color: var(--gold); }
.tool-btn.gold:hover { border-color: var(--gold); }
.tool-btn.slate { border-left-color: var(--slate); }
.tool-btn.slate:hover { border-color: var(--slate); }
.tool-btn .t { display: block; font-family: var(--font-serif); font-size: 20px; font-weight: 600; }
.tool-btn .d { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.home-safety { text-align: center; margin-top: 18px; }

/* Menu: slides in from the right */
dialog.menu-sheet { margin: 0 0 0 auto; height: 100%; max-height: none; width: min(340px, 86vw); border: none; border-left: 1px solid var(--rule); background: var(--paper-raised); color: var(--ink); padding: calc(18px + env(safe-area-inset-top, 0px)) 18px calc(18px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
dialog.menu-sheet::backdrop { background: rgba(0,0,0,.55); }
.menu-close { float: right; }
.menu-sheet h4 { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin: 20px 0 4px; }
.menu-sheet h4:first-of-type { margin-top: 8px; }
.menu-sheet nav button, .menu-sheet nav a { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--rule); padding: 12px 4px; font-size: 15.5px; color: var(--ink); text-decoration: none; font-family: var(--font-sans); }
.menu-sheet nav button:hover, .menu-sheet nav a:hover { color: var(--plum); }
.menu-sheet nav .safe { color: var(--plum); font-weight: 600; }

/* Speaker-Listener: names line, who speaks first, folded extras */
.who-line { font-size: 14px; color: var(--ink-soft); margin: -8px 0 14px; }
.who-line .text-btn { font-size: 14px; padding: 4px 2px; }
.first-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
details.fold { padding-top: 16px; padding-bottom: 16px; }
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '+'; font-size: 20px; color: var(--ink-faint); line-height: 1; }
details.fold[open] > summary::after { content: '2'; }
details.fold > summary h3 { margin: 0; }
details.fold[open] > summary { margin-bottom: 12px; }

/* First-time welcome */
.welcome-safety { background: var(--plum-tint); border-left: 3px solid var(--plum); border-radius: 3px; padding: 12px 14px; font-size: 14.5px; line-height: 1.5; }
.welcome-safety .text-btn { font-size: 14.5px; color: var(--plum-deep); }
