/* Praxis · own brand (spec Brand + decision 5): warm paper and ink, ONE deep accent (bottle green, which is also the
   one green button of L-07), serif for passages and story, sans for UI. All colours are tokens (M-02); AA tested in
   test/looks.test.mjs. Structure after ~/dev/uncharted-sprints/public/app/app.css: 16px+ fields, overflow-x clip,
   sticky bars with a solid background, reduced-motion block, safe areas. */
/* spine colours are part of the brand set: leather tones on the shelf */
:root[data-theme="light"] {
  --spine: #1d5a43; --spine-2: #6b3d1f; --spine-ink: #fffbf3; --board: #b99f78; --owl-light: #fffbf3; --owl-ink: #1f1a14;
  --paper: #f5efe3; --surface: #fffbf3; --passage: #efe5d1; --tabbar: #fffbf3;
  --ink: #1f1a14; --muted: #5a5044; --accent: #1d5a43;
  --go: #1d5a43; --on-go: #ffffff; --go-press: #164634;
  --ok: #1d6342; --fix: #8a3a12; --danger: #9b2c1f;
  --line: #d8ccb6; --scrim: #1f1a1466; --shadow: #1f1a1414;
}
:root[data-theme="dark"] {
  --spine: #2f6e52; --spine-2: #7a4e2d; --spine-ink: #fffbf3; --board: #5a4a36; --owl-light: #f1e7d4; --owl-ink: #1f1a14;
  --paper: #14110d; --surface: #1e1a15; --passage: #27211a; --tabbar: #1e1a15;
  --ink: #eee6d8; --muted: #b5aa95; --accent: #85c9a5;
  --go: #85c9a5; --on-go: #0d1912; --go-press: #6db08d;
  --ok: #8fd2ad; --fix: #f2a878; --danger: #f2907f;
  --line: #3b332a; --scrim: #000000a0; --shadow: #00000066;
}
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "New York", Georgia, ui-serif, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --r: 14px; --pad: 20px; --tabh: 64px; --col: 480px; --kb: 0px;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  color-scheme: light dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; background: var(--paper); color: var(--ink); }
body { font: 17px/1.5 var(--sans); -webkit-text-size-adjust: 100%; min-height: 100dvh; overflow-wrap: anywhere; }
#app { max-width: var(--col); margin: 0 auto; min-height: 100dvh; background: var(--paper); }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { font-size: 17px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.hide { display: none !important; }
.center { text-align: center; }
.small { font-size: 14px; }
.note { color: var(--muted); font-size: 15px; margin-top: 12px; }
.kicker { color: var(--accent); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; margin-bottom: 10px; }
.lbl { display: block; color: var(--muted); font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.title { font-family: var(--serif); font-size: 26px; line-height: 1.25; font-weight: 600; margin-bottom: 14px; text-wrap: balance; }

/* buttons: ONE green per screen (L-07), the rest quiet */
.btn-go, .btn-soft, .btn-danger, .btn-quiet { display: block; width: 100%; min-height: 52px; border-radius: var(--r); border: 0; cursor: pointer; font-weight: 600; font-size: 17px; text-align: center; text-decoration: none; padding: 14px 16px; }
.btn-go { background: var(--go); color: var(--on-go); }
.btn-go:active { background: var(--go-press); }
.btn-go[disabled] { opacity: .45; cursor: default; }
.btn-soft { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); margin-top: 10px; }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--line); margin-top: 10px; }
.btn-danger.solid { border-color: var(--danger); }
.btn-quiet { background: transparent; color: var(--muted); min-height: 44px; font-weight: 500; margin-top: 4px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); border-radius: 50%; cursor: pointer; }
.ico { display: block; }

/* lesson: sticky top with the step count, body, sticky foot with the one green button */
.lesson { display: flex; flex-direction: column; min-height: 100dvh; }
.lesson-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 6px) calc(8px + var(--sr)) 6px calc(8px + var(--sl)); background: var(--paper); }
.stepcount { color: var(--muted); font-size: 15px; font-weight: 600; min-width: 0; }
.progress { height: 4px; margin: 0 var(--pad); background: var(--line); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.lesson-body { flex: 1; padding: 22px calc(var(--pad) + var(--sr)) 24px calc(var(--pad) + var(--sl)); min-width: 0; }
.lesson-foot { position: sticky; bottom: var(--kb, 0px); z-index: 5; padding: 12px calc(var(--pad) + var(--sr)) calc(env(safe-area-inset-bottom, 0px) + 12px) calc(var(--pad) + var(--sl)); background: var(--paper); border-top: 1px solid var(--line); }
html.kb .lesson-foot { padding-bottom: 10px; }
.scene p, .plain, .passage p { font-family: var(--serif); font-size: 19px; line-height: 1.6; }
.scene p + p { margin-top: 12px; }
.hook { margin-top: 18px; font-weight: 600; font-size: 18px; }
.why { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.why summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.why p { margin-top: 8px; }
.passage { margin: 0; background: var(--passage); color: var(--ink); border-left: 4px solid var(--accent); border-radius: 0 var(--r) var(--r) 0; padding: 16px 18px; }
.passage p { font-size: 18px; font-style: italic; }
.cite { margin-top: 12px; font-size: 15px; }
.cite.small { color: var(--muted); font-size: 14px; margin-top: 4px; }
.field { display: block; width: 100%; min-width: 0; font-size: 17px; line-height: 1.45; padding: 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; }
.field:focus { border-color: var(--accent); outline: none; }
.field::placeholder { color: var(--muted); opacity: 1; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.chip { flex: 1 1 0; min-width: 48px; min-height: 52px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 600; cursor: pointer; }
.chip.on, .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip-ends { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 8px; }
.chip-radio { flex: 1 1 0; min-width: 0; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio span { display: grid; place-items: center; min-height: 52px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.chip-radio input:checked + span { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip-radio input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* coach */
.checking { display: flex; gap: 8px; justify-content: center; padding: 40px 0 8px; }
.checking .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite ease-in-out; }
.checking .dot:nth-child(2) { animation-delay: .15s; } .checking .dot:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.feedback { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fb { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.fb-q { font-weight: 600; font-size: 15px; }
.fb-you { margin-top: 8px; color: var(--muted); font-size: 15px; }
.fb-you .lbl { display: inline; margin: 0 6px 0 0; font-size: 13px; }
.fb-badge { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; font-size: 15px; }
.fb-badge .ico { width: 20px; height: 20px; }
.is-ok .fb-badge { color: var(--ok); } .is-fix .fb-badge { color: var(--fix); }
.fb-fix { margin-top: 6px; font-family: var(--serif); font-size: 17px; }
.fb-why { margin-top: 6px; color: var(--muted); font-size: 15px; }

/* cards, home, me */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-top: 14px; min-width: 0; }
.card h2 { font-size: 18px; margin-bottom: 6px; }
.card p + .btn-go, .card p + .btn-soft, .card .map + .btn-soft, .card .map + .btn-go { margin-top: 14px; }
.card.soft { background: var(--passage); }
.card.quiet h2 { font-family: var(--serif); }
.card.goodbye { margin-top: 22px; text-align: left; }
.screen { padding: calc(env(safe-area-inset-top, 0px) + 18px) calc(var(--pad) + var(--sr)) calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 24px) calc(var(--pad) + var(--sl)); }
.screen.join { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.top h1 { font-family: var(--serif); font-size: 30px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.stat { display: block; text-align: left; color: var(--ink); font: inherit; }
button.stat { cursor: pointer; }
.stat .num { display: block; font-family: var(--serif); font-size: 30px; font-weight: 600; }
.stat .lbl { display: block; margin: 0; }
.segs { display: flex; gap: 8px; }
.seg { flex: 1 1 0; min-width: 0; min-height: 48px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; cursor: pointer; }
.seg.on { border-color: var(--accent); color: var(--accent); }
.companion { font-family: var(--serif); font-size: 19px; font-style: italic; }
.points-pop { margin-top: 14px; display: inline-block; background: var(--surface); border: 1.5px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 18px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 26px; letter-spacing: .12em; text-align: center; margin: 16px 0; color: var(--accent); }

/* the owl (C-01 light) */
.owl-row { display: flex; align-items: center; gap: 10px; justify-content: center; min-width: 0; }
.owl-row.small .owl { width: 44px; height: 44px; }
.owl-row.small .companion { font-size: 16px; text-align: left; }
.owl { flex: 0 0 auto; }
.owl .b { fill: var(--accent); stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.owl .f { fill: var(--owl-light); }
.owl .k { fill: var(--owl-ink); }
.owl .k-s { fill: none; stroke: var(--owl-ink); stroke-width: 2; stroke-linecap: round; }
.owl .beak { fill: var(--fix); }
.top .owl-row { justify-content: flex-start; flex: 1 1 200px; }

/* The Shelf (G-04): 7 spines a level, a spine slides in on the reward */
.shelves { display: grid; gap: 14px; margin-top: 6px; }
.shelf { min-width: 0; }
.shelf-name { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.spines { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; align-items: end; height: 92px; }
.spine { display: flex; align-items: center; justify-content: center; height: 70px; border-radius: 3px 3px 0 0; border: 1.5px dashed var(--line); overflow: hidden; min-width: 0; }
.spine.on { border: 0; background: var(--spine); color: var(--spine-ink); }
.spine.on:nth-child(even) { background: var(--spine-2); height: 82px; }
.spine.on:nth-child(3n) { height: 88px; }
.spine-t { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--serif); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 100%; }
.spine.new { animation: slide .7s ease-out; }
@keyframes slide { 0% { transform: translateY(-40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.board { height: 8px; border-radius: 2px; background: var(--board); }
.shelf.full .board { box-shadow: 0 0 14px var(--accent); }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* thumb zone: Home's one green button sits at the bottom, above the tab bar */
.thumb { position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px)); z-index: 9; padding: 10px calc(var(--pad) + var(--sr)) 10px calc(var(--pad) + var(--sl)); background: var(--paper); border-top: 1px solid var(--line); max-width: var(--col); margin: 0 auto; }
.home.has-thumb { padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 96px); }
.pill { cursor: default; min-height: 44px; }
button.pill { cursor: pointer; color: var(--ink); min-height: 44px; }

/* tab bar (Q-j: Me is a tab) */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; max-width: var(--col); margin: 0 auto; background: var(--tabbar); border-top: 1px solid var(--line); padding: 0 var(--sr) env(safe-area-inset-bottom, 0px) var(--sl); }
.tabs button { flex: 1 1 0; max-width: 280px; min-width: 0; height: var(--tabh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.tabs button[aria-current="page"] { color: var(--accent); }

/* sheet + toast */
.scrim { position: fixed; inset: 0; z-index: 30; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: var(--col); max-height: 92dvh; overflow: auto; overscroll-behavior: contain; background: var(--paper); border-radius: 20px 20px 0 0; padding: 10px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 20px); box-shadow: 0 -8px 30px var(--shadow); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 10px; }
.sheet-form .btn-go { margin-top: 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; font-size: 16px; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: 0 0 24px; margin: 1px 0 0; accent-color: var(--accent); }
.err { color: var(--danger); font-size: 15px; min-height: 0; margin-top: 10px; }
.err:empty { display: none; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px) + 16px); transform: translateX(-50%); z-index: 40; max-width: var(--col); width: max-content; max-inline-size: calc(min(100vw, var(--col)) - 32px); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 15px; }

/* join page */
.brand { font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--accent); margin-bottom: 18px; }
.lead { font-size: 18px; margin-bottom: 14px; }
.bullets { padding-left: 20px; margin: 0 0 8px; display: grid; gap: 8px; }
.join-form { margin-top: 8px; }
.join-form .btn-go { margin-top: 18px; }
.daily { border: 0; padding: 0; margin: 0; min-width: 0; }
.opt { font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }


/* step 2: owl tricks (drawn beside the owl, so they use the page ink, not the owl's face ink) */
.owl .t { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.owl .scarf { fill: var(--fix); }
.levelup { margin: 6px auto 10px; padding: 10px 14px; border-radius: var(--r); background: var(--passage); display: inline-block; max-width: 100%; }
.levelup .kicker { margin: 0; }
.levelup .trick { font-family: var(--serif); font-style: italic; margin-top: 4px; }
.reward-extra { display: grid; gap: 8px; margin-top: 14px; }
.next-teaser { margin-top: 12px; font-family: var(--serif); font-style: italic; }
.next-teaser .lbl { font-family: var(--sans); font-style: normal; }

/* E-04 warm-up cards: tap to recall */
.recalls { display: grid; gap: 12px; margin-top: 14px; }
.recall h2 { font-family: var(--serif); }
.recall-q { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.recall .field + .btn-soft { margin-top: 8px; }
.recall-a { font-family: var(--serif); font-size: 17px; margin: 6px 0 10px; }
.recall-a.small { font-size: 15px; color: var(--muted); }
.recall.is-done { background: var(--passage); }

/* G-06 Sunday reveal: three cards stacked */
.reveal { margin-bottom: 12px; }
.reveal .big { font-family: var(--serif); font-size: 22px; line-height: 1.3; }
.mine { margin: 6px 0 0; font-family: var(--serif); font-size: 18px; font-style: italic; border-left: 3px solid var(--accent); padding-left: 12px; }

/* G-09 certificate (printable) and G-05 share card */
.cert-form { margin: 8px 0 14px; }
.certificate { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--r); padding: 22px 18px; }
.cert-brand { color: var(--accent); font-family: var(--serif); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; }
.certificate .title { margin-top: 8px; }
.certificate h2 { font-size: 16px; margin-top: 16px; }
.cert-ideas { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.cert-ideas li span { display: block; color: var(--muted); font-size: 14px; }
.cert-screen .lesson-foot, .share-screen .lesson-foot { position: static; padding: 14px 0 0; background: transparent; border: 0; }
.share-preview { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.share-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1080 / 1350; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.row2 .btn-soft { margin: 0; }

/* step 3: the Library */
.library .sheet-form { margin-top: 12px; }
.library .sheet-form .btn-go { margin-top: 14px; }
.library-out { margin-top: 16px; }
.answer [data-answer-text] p { font-family: var(--serif); font-size: 18px; line-height: 1.55; }
.answer [data-answer-text] p + p { margin-top: 10px; }
.sub { font-size: 16px; margin: 18px 0 8px; color: var(--muted); }
.passages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.passage-card .cite { margin-top: 0; margin-bottom: 8px; }
.passage-card .passage p { font-size: 16px; }
select.field { appearance: none; -webkit-appearance: none; background-image: none; padding-right: 14px; }

/* SPEC-1102 · Topics: subject cards with a level-colour bar (counts only), idea rows, the focus toggle */
.subjects { display: grid; gap: 12px; margin-top: 16px; }
.subject { margin-top: 0; padding: 0; border-left: 6px solid var(--spine); overflow: hidden; }
.subject.lvb { border-left-color: var(--spine-2); }
.subject.locked { padding: 16px; background: var(--passage); }
.subject-open { display: block; width: 100%; min-height: 44px; padding: 16px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.subject-name { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.subject-line { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; }
.subject-count { display: block; color: var(--muted); font-size: 14px; font-weight: 600; margin-top: 8px; }
.pill.small { min-height: 0; font-size: 12px; padding: 2px 8px; vertical-align: middle; font-family: var(--sans); color: var(--accent); }
.bar { height: 6px; margin-top: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; width: calc(var(--n) / var(--m) * 100%); background: var(--spine); border-radius: 6px; }
.bar.lvb span { background: var(--spine-2); }
.subject-screen { padding-top: 0; }
.subject-screen .lesson-top { margin: 0 calc(-1 * var(--pad)); }
.idea-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.idea-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: 100%; min-height: 44px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.idea-name { font-weight: 600; min-width: 0; }
.idea-line { grid-column: 1; color: var(--muted); font-size: 14px; min-width: 0; }
.idea-state { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.idea-row.yours .idea-state, .idea-state-line { color: var(--ok); }
.idea-state-line { font-weight: 600; font-size: 15px; margin-bottom: 12px; }
.focus-card { margin-top: 18px; }
.focus-card .seg { width: 100%; }
.kicker.gap { margin-top: 20px; }

/* SPEC-1102 · Ask as a chat: question bubbles, answers as cards, passages folded, chips that wrap (no sideways row) */
.thread { display: grid; gap: 4px; margin-top: 12px; min-width: 0; }
.turn { min-width: 0; margin-top: 10px; }
.bubble { max-width: 85%; margin-left: auto; padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: var(--go); color: var(--on-go); font-size: 17px; overflow-wrap: anywhere; width: fit-content; }
.turn .card.answer { margin-top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fold { margin-top: 12px; }
.fold .sub { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; min-width: 0; }
.ask-chip { min-height: 44px; max-width: 100%; padding: 8px 14px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--surface); color: var(--accent); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.starters { margin-top: 8px; }
.composer { position: sticky; bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px)); z-index: 6; margin: 16px calc(-1 * (var(--pad) + var(--sr))) 0 calc(-1 * (var(--pad) + var(--sl))); padding: 10px calc(var(--pad) + var(--sr)) 8px calc(var(--pad) + var(--sl)); background: var(--paper); border-top: 1px solid var(--line); }
html.kb .composer { bottom: var(--kb, 0px); }
.compose-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.compose-row .field { flex: 1 1 auto; min-height: 52px; max-height: 132px; resize: none; padding: 13px 14px; overflow-y: auto; }
.compose-row .send { width: auto; flex: 0 0 auto; min-width: 72px; padding: 14px 16px; }
.compose-meta { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 6px; min-width: 0; }
.compose-meta .note { margin: 0; text-align: right; flex: 0 1 auto; }
.field.mini { width: auto; flex: 0 1 60%; min-width: 0; min-height: 44px; padding: 8px 12px; font-size: 16px; border-radius: 22px; text-overflow: ellipsis; }
.answer { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 12px); }
.thread { overscroll-behavior: contain; }
.ctx-row { margin-top: 12px; }
.ctx-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding-left: 14px; border-radius: 22px; background: var(--passage); border: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--ink); }
.ctx-x { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); border-radius: 50%; cursor: pointer; flex: none; }
.ctx-x .ico { width: 18px; height: 18px; }

/* ── SPEC-1103 mobile pass: tap feel, keyboard, installed app, desktop column ── */
button, a, summary, select, label, [data-act] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn-go, .btn-soft, .btn-danger, .btn-quiet, .chip, .seg, .choice, .ask-chip, .pill, .tabs button, .idea-row, .subject-open { transition: transform .12s ease, background-color .12s ease; }
.btn-go:active, .btn-soft:active, .btn-danger:active, .chip:active, .seg:active, .choice:active, .ask-chip:active, .idea-row:active, .subject-open:active, .tabs button:active { transform: scale(.98); }
.btn-soft:active, .seg:active, .choice:active, .idea-row:active { background: var(--passage); }
html.kb .tabs, html.kb .thumb { display: none; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
@media (display-mode: standalone) { html, body { overscroll-behavior-y: none; } }
.haptic { position: fixed; left: -100px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
@media (min-width: 700px) {
  html, body { background: var(--desk, var(--passage)); }
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: 0 0 40px var(--shadow); }
  .tabs, .thumb { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .scrim { padding: 0 16px; }
}

/* ── SPEC-1103 game: goal ring, owl trick, spark choices, watch, calendar, badges, Together, moments ── */
.owl-btn { border: 0; background: transparent; padding: 0; min-width: 44px; min-height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; color: inherit; }
.owl-btn.play .owl { animation: trick 1.2s ease-in-out; transform-origin: 50% 90%; }
@keyframes trick { 0% { transform: none; } 20% { transform: rotate(-12deg) translateY(-4px); } 45% { transform: rotate(10deg) translateY(-6px); } 70% { transform: rotate(-4deg); } 100% { transform: none; } }
.ring { border: 0; background: transparent; padding: 0; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 3.5; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring-ok { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.choices { display: grid; gap: 10px; margin-top: 18px; }
.choice { display: block; width: 100%; min-height: 56px; padding: 14px 16px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 18px; font-weight: 600; text-align: left; cursor: pointer; }
.choice .b-how { display: block; font-weight: 400; font-size: 15px; color: var(--muted); }
.choice.right { border-color: var(--ok); color: var(--ok); box-shadow: inset 0 0 0 1.5px var(--ok); }
.choice.picked { border-color: var(--fix); color: var(--fix); }
.choice.dim { opacity: .55; }
.choice[disabled] { cursor: default; }
.spark-result { margin-top: 16px; animation: rise .35s ease-out; }
.spark-result .fb-badge { margin-top: 0; }
.spark-result .plain { margin-top: 8px; font-size: 18px; }
[data-spark-result="right"] .fb-badge { color: var(--ok); } [data-spark-result="wrong"] .fb-badge { color: var(--fix); }
.title.gap { margin-top: 18px; }
.title.spark-scene { font-size: 21px; line-height: 1.4; font-weight: 500; }
.spark-result { scroll-margin-bottom: 110px; }
.spark-result .btn-quiet { margin-top: 8px; text-align: left; padding-left: 0; }
.watch-new { color: var(--accent); font-weight: 600; }
.goal-opts { display: grid; gap: 10px; margin-top: 14px; }
.watch { flex: 0 0 auto; display: block; }
.w-case { fill: var(--surface); stroke: var(--board); stroke-width: 3; }
.w-ghost { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 3 3; }
.w-metal { fill: var(--board); }
.w-dial { fill: var(--passage); }
.w-line { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; }
.w-hand { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.w-sec { stroke: var(--fix); stroke-width: 1.2; stroke-linecap: round; transform-origin: 32px 36px; }
.watch.ticking .w-sec { animation: tick 60s steps(60) infinite; }
@keyframes tick { to { transform: rotate(360deg); } }
.w-jewel { fill: var(--danger); }
.watch-row { display: flex; gap: 14px; align-items: center; min-width: 0; }
.watch-row > div { min-width: 0; }
.watch-hero { display: grid; place-items: center; margin: 6px 0; }
.parts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.parts li { font-size: 14px; padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); }
.parts li.on { border: 1px solid var(--accent); color: var(--accent); font-weight: 600; }
.drawer { display: flex; flex-wrap: wrap; gap: 4px; }
.drawer-w .watch { width: 40px; height: 43px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.cal-h { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-c { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--paper); font-size: 15px; min-width: 0; }
.cal-c.fire { background: var(--passage); }
.cal-c.future { background: transparent; border: 1px dashed var(--line); }
.cal-c.today { box-shadow: inset 0 0 0 2px var(--accent); }
.runs { display: flex; gap: 8px; flex-wrap: wrap; }
.run { padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; font-weight: 600; }
.run.on { border: 1.5px solid var(--accent); color: var(--accent); }
.badges { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.badge { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: center; padding: 10px; border-radius: var(--r); border: 1px dashed var(--line); min-width: 0; }
.badge .b-ico { grid-row: 1 / span 2; font-size: 24px; filter: grayscale(1); opacity: .5; }
.badge .b-name { font-weight: 600; font-size: 15px; color: var(--muted); }
.badge .b-how { font-size: 13px; color: var(--muted); }
.badge.got { border: 1px solid var(--accent); background: var(--passage); }
.badge.got .b-ico { filter: none; opacity: 1; }
.badge.got .b-name { color: var(--ink); }
.together { margin-top: 18px; }
.together .bar { margin-top: 8px; }
.moments { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.moments li { padding: 10px 12px; border-radius: var(--r); background: var(--passage); font-weight: 600; animation: rise .4s ease-out both; }
.moments li.more { background: transparent; padding: 0 12px; color: var(--muted); font-weight: 500; font-size: 15px; }
.moments li:nth-child(2) { animation-delay: .1s; } .moments li:nth-child(3) { animation-delay: .2s; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.cards .card { animation: rise .3s ease-out both; }
.cards .card:nth-child(2) { animation-delay: .05s; } .cards .card:nth-child(3) { animation-delay: .1s; }
.points-pop { animation: rise .35s ease-out both; }

@media print {
  .tabs, .no-print, .lesson-top, .toast, .scrim { display: none !important; }
  html, body { background: var(--paper); }
  .screen { padding: 0; }
  .certificate { border-width: 3px; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
