
/* Puzzle Path. Exercise-book paper look: child mode shows one big card at a time; parent mode is tabbed working pages. */
:root {
  --paper: #f5f6f0;
  --sheet: #ffffff;
  --sheet-2: #eef0e8;
  --ink: #1d2a3a;
  --ink-soft: #5a6676;
  --rule: #d9ddd1;
  --grid: #e3e8f2;
  --accent: #2c63d1;
  --accent-ink: #ffffff;
  --mark: #ffcf3f;
  --good: #1b7343;
  --warn: #95560a;
  --bad: #b3423a;
  --shadow: 0 1px 0 rgba(29,42,58,.06), 0 6px 18px rgba(29,42,58,.07);
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12171e; --sheet: #1a212b; --sheet-2: #222b37; --ink: #e8edf3; --ink-soft: #9ba7b6;
    --rule: #2e3846; --grid: #243041; --accent: #7aa2f2; --accent-ink: #0d1420; --mark: #e7b52c;
    --good: #5cc28d; --warn: #e4a54a; --bad: #e57d74; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12171e; --sheet: #1a212b; --sheet-2: #222b37; --ink: #e8edf3; --ink-soft: #9ba7b6;
  --rule: #2e3846; --grid: #243041; --accent: #7aa2f2; --accent-ink: #0d1420; --mark: #e7b52c;
  --good: #5cc28d; --warn: #e4a54a; --bad: #e57d74; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body { font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; font-weight: 700; }
h1 { font-size: 2rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 12px 48px; display: grid; gap: 20px; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
.top .bar { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 10px; display: flex; align-items: center; gap: 12px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.brand svg { flex: none; }
.spacer { flex: 1; }
.btn { border: 1.5px solid var(--rule); background: var(--sheet); border-radius: 12px; padding: 10px 16px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.btn:hover { border-color: var(--ink-soft); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.big { font-family: var(--display); font-size: 1.35rem; padding: 14px 28px; border-radius: 16px; min-height: 60px; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.stack { display: grid; gap: 14px; min-width: 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); } /* never wider than its card (iPhone, large text) */
.eyebrow { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; border: 1px solid var(--rule); background: var(--sheet-2); white-space: nowrap; }
.pill.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--rule)); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--rule)); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--rule)); }
.pill.info { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); }
.note { border-left: 4px solid var(--mark); background: var(--sheet-2); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.note.err { border-left-color: var(--bad); }
.hl { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--mark) 70%, transparent) 55%); padding: 0 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---- child ---- */
.hello { display: grid; gap: 6px; padding-top: 8px; }
.hello h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.today { display: grid; gap: 16px; padding: 28px; border-radius: 24px; background: var(--sheet); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--mark); }
.today .puzzle-no { font-family: var(--display); font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.today h2 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); }
.path { display: grid; gap: 10px; }
.path-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--rule); }
.stones { display: flex; gap: 6px; }
.stone { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rule); background: var(--sheet); }
.stone.on { background: var(--mark); border-color: var(--ink); }
.stone.now { border-color: var(--accent); border-style: dashed; }
.q { display: grid; gap: 12px; }
.q-head { display: flex; gap: 12px; align-items: flex-start; }
.q-no { font-family: var(--display); font-weight: 700; font-size: 1.1rem; width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--mark); color: #1d2a3a; }
.q-text { font-size: 1.2rem; line-height: 1.55; white-space: pre-wrap; min-width: 0; }
.pad-label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); }
.pad { position: relative; border: 1.5px solid var(--rule); border-radius: 14px; overflow: hidden; background-color: var(--sheet);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
.pad canvas { display: block; width: 100%; touch-action: none; }
.pad.work canvas { height: 300px; }
.pad.work.small canvas { height: 240px; } /* working under multiple-choice options */
.pad.answer { border: 2px solid var(--ink); }
.pad.answer canvas { height: 96px; }
.pad.lines { background-image: linear-gradient(to bottom, transparent 47px, var(--ink-soft) 47px); background-size: 100% 48px; background-position: 0 0; }
.qblock { display: grid; gap: 8px; padding-top: 10px; }
.qblock + .qblock { border-top: 1px dashed var(--rule); padding-top: 14px; }
.pmarks { margin-left: auto; color: var(--ink-soft); font-size: .85rem; white-space: nowrap; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.card.q > .tools { position: sticky; bottom: 0; z-index: 2; margin: 0 -4px; padding: 10px 4px; background: var(--sheet); border-top: 1px solid var(--rule); } /* in reach on a long question */
.tool { border: 1.5px solid var(--rule); background: var(--sheet); border-radius: 10px; min-height: 40px; padding: 4px 12px; font-weight: 700; }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.hintbox { background: var(--sheet-2); border-radius: 12px; padding: 10px 14px; }
.answerbox { margin: 4px 0 0; border-left: 4px solid var(--good, #1f8a4c); background: var(--sheet-2); border-radius: 0 12px 12px 0; padding: 10px 14px; }
.fb-item { display: grid; gap: 10px; padding: 16px 0; border-top: 1px dashed var(--rule); }
.fb-item:first-child { border-top: 0; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.stars { display: grid; gap: 10px; }
.star-line { display: flex; gap: 10px; align-items: flex-start; font-size: 1.1rem; }
.star-line svg { flex: none; margin-top: 3px; }
.moods { display: flex; gap: 10px; flex-wrap: wrap; }
.mood { border: 2px solid var(--rule); border-radius: 16px; background: var(--sheet); padding: 10px 14px; display: grid; justify-items: center; gap: 4px; min-width: 84px; font-weight: 700; }
.thinking { display: grid; justify-items: center; gap: 14px; padding: 40px 20px; text-align: center; }
.dots { display: flex; gap: 8px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--mark); animation: bob 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 80%, 100% { transform: translateY(0); opacity: .5 } 40% { transform: translateY(-8px); opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .dots span { animation: none; opacity: 1; } }

/* ---- parent ---- */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 640px) { .tabs { flex-wrap: wrap; overflow-x: visible; gap: 0; } .tab { padding: 8px 10px; } } /* all tabs visible on phones */
.tab { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; color: var(--ink-soft); border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .75rem; }
.headline { font-family: var(--display); font-size: clamp(1.3rem, 3.5vw, 1.7rem); line-height: 1.25; font-weight: 600; }
.kv { display: grid; grid-template-columns: fit-content(50%) minmax(0, 1fr); gap: 6px 14px; }
.kv dt { color: var(--ink-soft); } .kv dd { margin: 0; }
.score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.score .big { font-family: var(--display); font-size: 3rem; font-weight: 700; line-height: 1; }
.review { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 720px) { .review { grid-template-columns: minmax(0, 1fr); } }
.answer-img { width: 100%; border-radius: 10px; border: 1px solid var(--rule); background: #fff; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
select, input[type="text"], input[type="date"], input[type="password"], input[type="number"] { background: var(--sheet); border: 1.5px solid var(--rule); border-radius: 10px; padding: 8px 10px; min-height: 40px; max-width: 100%; min-width: 0; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) 2.5em; gap: 10px; align-items: center; font-size: .9rem; }
.bar-track { height: 12px; border-radius: 6px; background: var(--sheet-2); overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.topic-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.checks { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); } /* never wider than its card (iPhone, large text) */
.checks label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--sheet-2); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 84px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }

/* ---- overlay ---- */
.overlay { position: fixed; inset: 0; z-index: 20; background: color-mix(in srgb, var(--ink) 45%, transparent); display: grid; place-items: center; padding: 16px; }
.dialog { width: min(420px, 100%); background: var(--sheet); border-radius: 20px; padding: 24px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.pin { font-size: 1.6rem; letter-spacing: .4em; text-align: center; width: 100%; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 12px; font-weight: 700; max-width: calc(100% - 32px); }

/* ---- product additions ---- */
html, body { height: auto; min-height: 100%; }
.onboard { max-width: 560px; margin: 0 auto; display: grid; gap: 18px; padding-top: 8px; }
.code-input { font-size: 2rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.bigcode { font-family: var(--display); font-size: clamp(2.4rem, 9vw, 3.4rem); letter-spacing: .18em; font-variant-numeric: tabular-nums; text-align: center; background: var(--sheet-2); border-radius: 16px; padding: 12px; user-select: all; }
.switcher { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.switcher select { min-width: 10em; }
.offline { background: var(--warn); color: #fff; text-align: center; font-weight: 700; padding: 6px 12px; font-size: .9rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 0; }
.err { color: var(--bad); }
.list { display: grid; gap: 8px; }
.list-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.install-tip { display: flex; gap: 12px; align-items: center; }
.install-tip svg { flex: none; }

/* ---- subjects (parent and child): home cards, subject header and colour ---- */
.s-math { --subj: #2c63d1; } .s-science { --subj: #1a7a4b; } .s-english { --subj: #8a4fc7; } .s-chinese, .s-hchinese { --subj: #b8452d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .s-math { --subj: #7aa2f2; } :root:not([data-theme="light"]) .s-science { --subj: #5cc28d; } }
:root[data-theme="dark"] .s-math { --subj: #7aa2f2; } :root[data-theme="dark"] .s-science { --subj: #5cc28d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .s-english { --subj: #b993e8; } :root:not([data-theme="light"]) :is(.s-chinese, .s-hchinese) { --subj: #f08c74; } }
:root[data-theme="dark"] .s-english { --subj: #b993e8; } :root[data-theme="dark"] :is(.s-chinese, .s-hchinese) { --subj: #f08c74; }
.subjdot { width: 14px; height: 14px; border-radius: 4px; background: var(--subj); flex: none; display: inline-block; }
.subjhead { display: grid; gap: 4px; padding: 12px 16px; border-radius: 16px; background: color-mix(in srgb, var(--subj) 12%, var(--sheet)); border: 1px solid color-mix(in srgb, var(--subj) 35%, var(--rule)); }
.subjhead h1 { font-size: 1.8rem; color: var(--subj); }
.backlink { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 0; min-height: 36px; justify-self: start; text-align: left; }
.tabs.s-math .tab[aria-selected="true"], .tabs.s-science .tab[aria-selected="true"] { border-bottom-color: var(--subj); }
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.scard { text-align: left; background: var(--sheet); border: 1px solid var(--rule); border-left: 6px solid var(--subj); border-radius: 16px; padding: 16px; display: grid; gap: 10px; box-shadow: var(--shadow); width: 100%; }
.scard.locked { box-shadow: none; background: transparent; border-style: dashed; border-left-style: solid; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bad); color: #fff; font-size: .78rem; font-weight: 700; }
.s-math-pill { color: #2c63d1; } .s-science-pill { color: #1a7a4b; } .s-english-pill { color: #8a4fc7; } .s-chinese-pill, .s-hchinese-pill { color: #b8452d; }
.needrow { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.morelist { display: grid; }
.morelist button { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 16px 4px; font-weight: 700; display: flex; justify-content: space-between; }
.morelist button:last-child { border-bottom: 0; }
.seg { display: inline-flex; border: 1.5px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--sheet); justify-self: start; }
.seg button { border: 0; background: transparent; padding: 8px 16px; font-weight: 700; min-height: 40px; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--subj, var(--ink)); color: #fff; }
.sec-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--rule); background: var(--sheet); border-radius: 999px; padding: 6px 14px; font-weight: 700; min-height: 38px; font-size: .92rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.field { display: grid; gap: 8px; }
.field > .lab { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--rule); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: var(--sheet); width: 40px; min-height: 40px; font-weight: 700; font-size: 1.1rem; }
.stepper span { min-width: 36px; text-align: center; font-weight: 700; }
textarea { background: var(--sheet); border: 1.5px solid var(--rule); border-radius: 10px; padding: 8px 10px; width: 100%; min-height: 64px; resize: vertical; }
.mini-stones { display: inline-flex; gap: 3px; vertical-align: middle; }
.mini-stones i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--rule); }
.mini-stones i.on { background: var(--mark); border-color: var(--ink); }
.mini-stones i.now { border-color: var(--subj, var(--accent)); border-style: dashed; }
/* prepare */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { border: 1.5px solid var(--rule); border-radius: 12px; background: var(--sheet); padding: 8px 4px; display: grid; gap: 4px; justify-items: center; text-align: center; min-height: 84px; align-content: start; font-size: .8rem; color: var(--ink); }
.day .dn { font-weight: 700; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.day .dd { font-family: var(--display); font-weight: 700; font-size: 1.1rem; line-height: 1; }
.day .what { color: var(--ink-soft); line-height: 1.2; font-size: .72rem; }
.day .set { color: var(--accent); font-weight: 700; }
.setline { margin: 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.day.past { background: var(--sheet-2); }
.day.isnow { border-color: var(--ink); }
.day.sel { border-color: var(--subj, var(--accent)); box-shadow: 0 0 0 2px var(--subj, var(--accent)) inset; }
.day.rest { opacity: .55; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.choice { text-align: left; border: 1.5px solid var(--rule); background: var(--sheet); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.choice strong { font-family: var(--display); font-size: 1.05rem; }
.choice span { font-size: .84rem; color: var(--ink-soft); line-height: 1.3; }
.choice[aria-pressed="true"] { border-color: var(--subj, var(--accent)); box-shadow: 0 0 0 2px var(--subj, var(--accent)) inset; }
.trow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--rule); }
.trow input { width: 20px; height: 20px; accent-color: var(--accent); }
.trow .info { font-size: .8rem; color: var(--ink-soft); }
.preview { background: var(--sheet-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.slots { display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.slot .why { font-size: .82rem; color: var(--ink-soft); }
.qn { font-family: var(--display); font-weight: 700; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet-2); border: 1px solid var(--rule); }
/* progress */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.kpi .v { font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.kpi .l { font-size: .82rem; color: var(--ink-soft); }
.chart svg, .climb svg { width: 100%; max-width: 520px; height: auto; display: block; }
.strip { display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); gap: 3px; }
.strip i { aspect-ratio: 1; border-radius: 4px; background: var(--sheet-2); border: 1px solid var(--rule); }
.strip i.done { background: var(--good); border-color: var(--good); }
.strip i.other { background: color-mix(in srgb, var(--ink-soft) 30%, var(--sheet)); }
.strip i.miss { background: transparent; border: 1.5px dashed var(--bad); }
.strip i.isnow { outline: 2px solid var(--ink); outline-offset: 1px; }
.topic-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.topic-line .meta { font-size: .82rem; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.status { font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); white-space: nowrap; }
.status.secure { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--rule)); }
.status.getting { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
.status.weak { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--rule)); }
.status.none { color: var(--ink-soft); }
.cbar { display: grid; grid-template-columns: 9em minmax(0, 1fr) 1.5em; gap: 10px; align-items: center; font-size: .9rem; }
.cbar .track { height: 12px; background: var(--sheet-2); border-radius: 6px; overflow: hidden; }
.cbar .fill { display: block; height: 100%; background: var(--warn); border-radius: 6px; }
/* puzzles and mistakes */
.weekhead { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft); padding: 14px 4px 2px; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--rule); text-align: left; background: none; width: 100%; }
.prow:hover { background: var(--sheet-2); }
div.prow:hover { background: none; } /* Home's This week with nothing done is plain text, not a row to tap */
.prow .t { font-weight: 700; }
.prow .s { color: var(--ink-soft); font-size: .88rem; }
.prow > .pill { white-space: normal; max-width: 10em; } /* a long result wraps instead of squeezing the name (iPhone) */
.prow.card { background: var(--sheet); border: 1px solid var(--rule); padding: 14px 20px; } /* a row to tap keeps its card (report q6i_-pJesFDd) */
.prow.card:hover { background: var(--sheet-2); }
.prow .go { color: var(--accent); white-space: nowrap; }
.ticks { display: flex; gap: 4px; }
/* Papers → Done here on a phone (PR #22 ux review): the date is never cut (it drops under the name before the name is
   ellipsised); the ticks wrap 4 a row, never over half the row, and go under the text when the row is narrow (large text). */
.prow.done { display: flex; flex-wrap: wrap; }
.prow.done .stack { flex: 1 1 12em; }
.prow.done .t { display: flex; flex-wrap: wrap; column-gap: .4em; white-space: normal; overflow: visible; min-width: 0; } /* a grid item: without min-width 0 the nowrap name sets the column's minimum and widens the row (code review round 4) */
.prow.done .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow.done .when { font-weight: 400; color: var(--ink-soft); white-space: nowrap; }
.prow.done .ticks { flex-wrap: wrap; justify-content: flex-end; max-width: min(50%, 100px); margin-left: auto; }
/* Papers on an iPhone at large text (night ux 2026-11-01): second lines and a paper's name wrap, never "…"; a paper's
   pill goes under its name when the row is narrow, like Home's Focus rows (ux-checklist 0, 0a). */
.prow.done .s, .prow.card .s, .prow.paper .t, .prow.paper .s { white-space: normal; overflow-wrap: anywhere; }
.prow.paper { display: flex; flex-wrap: wrap; }
.prow.paper > .stack { flex: 1 1 8em; }
.tk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff; }
.tk.r { background: var(--good); } .tk.n { background: var(--bad); } .tk.w { background: var(--warn); } .tk.p { background: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); display: inline-block; }
.mcard { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.mstate { font-size: .85rem; font-weight: 700; }
.mstate.open { color: var(--bad); } .mstate.fixed { color: var(--good); }
.twocol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 560px) { .twocol { grid-template-columns: minmax(0, 1fr); } }
.sticky-act { position: sticky; bottom: env(safe-area-inset-bottom, 0px); background: var(--paper); border-top: 1px solid var(--rule); padding: 10px 0; z-index: 4; }
.qcard { display: grid; gap: 14px; }
.qtop { display: flex; gap: 12px; align-items: flex-start; }
.qtop > .stack { min-width: 0; flex: 1; }
.qmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qmeta .pill { white-space: normal; }
.mk { display: grid; gap: 10px; margin: 0; }
.mk-row { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 4px 12px; font-size: .95rem; }
.mk-row dt { color: var(--ink-soft); font-weight: 700; font-size: .85rem; padding-top: 2px; }
.mk-row dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 480px) { .mk-row { grid-template-columns: minmax(0, 1fr); } }
details.sol summary { cursor: pointer; font-weight: 700; color: var(--accent); }
details.sol pre { font-family: var(--body); white-space: pre-wrap; margin: 8px 0 0; background: var(--sheet-2); padding: 10px 12px; border-radius: 10px; }
.retry { border-left: 3px solid var(--accent); padding-left: 14px; display: grid; gap: 10px; }
.parentnote { background: color-mix(in srgb, var(--mark) 35%, var(--sheet)); border-radius: 4px 14px 14px 14px; padding: 12px 14px; box-shadow: 2px 3px 0 color-mix(in srgb, var(--ink) 12%, transparent); display: grid; gap: 4px; }
.parentnote .who { font-weight: 700; font-size: .85rem; }

/* ---- child: subject cards, one question per screen, history and progress ---- */
.scards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kcard { text-align: left; display: grid; gap: 10px; padding: 20px; border-radius: 22px; background: var(--sheet); border: 2px solid var(--subj); box-shadow: 6px 6px 0 color-mix(in srgb, var(--subj) 30%, transparent); width: 100%; }
.kcard .say { font-family: var(--display); font-size: 1.4rem; font-weight: 600; line-height: 1.2; }
.kicker { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; color: var(--subj); }
.kcard .kicker { font-size: 1.3rem; }
.kcard.todo { background: color-mix(in srgb, var(--subj) 12%, var(--sheet)); border-width: 3px; }
.kcard .todopill { margin-left: 10px; padding: 3px 12px; border-radius: 999px; background: var(--subj); color: #fff; font-size: .95rem; font-weight: 700; }
.task { display: grid; gap: 12px; padding: 22px; border-radius: 22px; background: var(--sheet); border: 2px solid var(--subj); box-shadow: 6px 6px 0 color-mix(in srgb, var(--subj) 30%, transparent); }
.task.done { border-style: dashed; box-shadow: none; background: transparent; }
.task h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); }
.btn.go { background: var(--subj, var(--accent)); color: #fff; border-color: var(--subj, var(--accent)); }
.stabs { display: flex; gap: 8px; }
.stabs button { flex: 1; border: 1.5px solid var(--rule); background: var(--sheet); border-radius: 14px; min-height: 52px; font-weight: 700; font-family: var(--display); font-size: 1.05rem; }
.stabs button[aria-pressed="true"] { background: var(--subj); color: #fff; border-color: var(--subj); }
.fixit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; }
.weekdots { display: flex; gap: 8px; flex-wrap: wrap; }
.wd { display: grid; justify-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.wd i { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center; font-style: normal; font-size: .9rem; }
.wd i.on { background: var(--mark); border-color: var(--ink); color: #1d2a3a; }
.wd i.now { border-color: var(--accent); border-style: dashed; }
.qprog { display: flex; gap: 6px; }
.qprog i { flex: 1; height: 8px; border-radius: 4px; background: var(--sheet-2); border: 1px solid var(--rule); }
.qprog i.on { background: var(--subj); border-color: var(--subj); }
.qprog i.cur { background: color-mix(in srgb, var(--subj) 45%, var(--sheet)); }
.navrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.helpnote { border-left: 4px solid var(--accent); background: var(--sheet-2); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.celebrate { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 24px 16px; }
.celebrate .big { font-family: var(--display); font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 700; line-height: 1.1; }
.lit { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 100%; }
.litbar { height: 14px; border-radius: 99px; background: var(--rule); overflow: hidden; max-width: 420px; width: 100%; margin: 0 auto; }
.litbar span { display: block; height: 100%; background: var(--mark); border-radius: 99px; }
.litn { text-align: center; font-weight: 700; margin: 6px 0 0; }
details.fb-right > summary { cursor: pointer; padding: 6px 0; list-style-position: inside; }
.lit .stone { width: 34px; height: 34px; }
.stone.pop { animation: pop .7s ease-out both; }
@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .stone.pop { animation: none; } }
.hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; width: 100%; }
.hrow .t { font-weight: 700; }
.hrow .s { color: var(--ink-soft); font-size: .9rem; }
.marks { display: flex; gap: 4px; }
.cmk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: #fff; }
.cmk.r { background: var(--good); } .cmk.f { background: var(--accent); } .cmk.n { background: var(--sheet); color: var(--accent); border: 2px dashed var(--accent); } .cmk.w { background: var(--sheet-2); color: var(--ink-soft); border: 1.5px solid var(--rule); }
.remember { border: 2px solid var(--subj, var(--accent)); border-radius: 12px; padding: 10px 14px; }
.big3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.big3 div { background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; padding: 14px; display: grid; gap: 2px; text-align: center; }
.big3 .v { font-family: var(--display); font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--subj); }
.big3 .l { font-size: .85rem; color: var(--ink-soft); }
.topic { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px dashed var(--rule); }
.ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 520px) { .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rung { border-radius: 10px; padding: 8px; font-size: .74rem; line-height: 1.25; border: 1.5px solid var(--rule); background: var(--sheet); color: var(--ink-soft); min-height: 64px; position: relative; }
.rung b { display: block; font-family: var(--display); font-size: .9rem; color: var(--ink); }
.rung.on { background: color-mix(in srgb, var(--mark) 55%, var(--sheet)); border-color: var(--ink); color: var(--ink); }
.rung.now { border: 2px dashed var(--subj); color: var(--ink); }
.rung .newbadge.school { background: var(--ink-soft); }
.rung .newbadge { position: absolute; top: -9px; right: 6px; background: var(--subj); color: #fff; font-size: .62rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; letter-spacing: .05em; }
.mcards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.mcardfull { display: grid; gap: 8px; padding: 16px 18px; border-radius: 14px; border: 2px solid var(--subj, var(--accent)); background: var(--sheet); }
.mcardfull h4 { margin: 0; font-size: 1.15rem; }
.mcardfull ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.mcardfull .trap { margin: 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn, #c77700) 12%, transparent); }
.mcardk { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--subj, var(--accent)); background: var(--sheet); }
#print-root { display: none; }
@media print {
  body.printing > :not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; color: #000; background: #fff; font-family: var(--body); }
  #print-root h1 { font-size: 18pt; margin: 0 0 4pt; }
  #print-root .pq { break-inside: avoid; padding: 10pt 0; border-top: 1px solid #999; }
  #print-root .pwork { height: 55mm; }
  #print-root .pans { border: 2px solid #000; padding: 8pt; height: 14mm; }
}

/* ---------- question bank: figures, multiple choice, parts ---------- */
.qfig { margin: 4px 0; display: flex; justify-content: center; }
.qfig { flex-direction: column; align-items: center; }
.padhead { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.padhead .tool.small { min-height: 30px; padding: 2px 10px; font-size: .8rem; }
.qfig .padhead { width: 100%; max-width: 560px; }
.qfig .figbox { position: relative; display: block; width: 100%; }
.qfig img { display: block; max-width: 100%; width: 100%; height: auto; background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 8px; }
/* her Pencil layer over a diagram: exactly the drawing, inside the border and padding */
.qfig canvas[data-figpad] { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); touch-action: none; cursor: crosshair; }
.figalt { font-style: italic; color: var(--ink-soft); }
.qpart { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-left: 4px solid var(--subj, var(--accent)); background: var(--sheet-2); border-radius: 0 12px 12px 0; }
.qpart .plabel { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.mcq { display: grid; gap: 10px; }
@media (min-width: 700px) { .mcq { grid-template-columns: 1fr 1fr; } }
.opt { display: flex; gap: 12px; align-items: center; text-align: left; padding: 16px 18px; border-radius: 16px; border: 2px solid var(--rule); background: var(--sheet); font-size: 1.15rem; min-height: 64px; }
.opt .letter { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--sheet-2); font-family: var(--display); font-weight: 700; }
.opt.picked { border-color: var(--subj, var(--accent)); background: color-mix(in srgb, var(--subj, var(--accent)) 14%, var(--sheet)); }
.opt.picked .letter { background: var(--subj, var(--accent)); color: #fff; }
.opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--sheet)); }
.opt.right .letter { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--accent); }
.opt:disabled { opacity: 1; cursor: default; }
.sure { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sure button { padding: 10px 16px; border-radius: 999px; border: 2px solid var(--rule); background: var(--sheet); font-weight: 700; }
.sure button[aria-pressed="true"] { border-color: var(--ink); background: var(--mark); }
.partres { display: flex; gap: 8px; align-items: center; }
.tipbar { background: var(--mark); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
.myweek { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.myweek .v { font-family: var(--display); font-size: 2rem; font-weight: 700; display: block; }
.myweek .l { font-size: .9rem; color: var(--ink-soft); }
.brief { font-size: 1.15rem; line-height: 1.5; }
.losslist .lrow { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--rule); }
.losslist .lrow:first-child { border-top: 0; }
.bankq { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--rule); }
.bankq:first-child { border-top: 0; }
.bankq .qmeta { font-size: .85rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 2px 10px; border-radius: 999px; background: var(--sheet-2); border: 1px solid var(--rule); font-size: .82rem; }
.chip.x { cursor: pointer; }
.cropbox { position: relative; overflow: hidden; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.cropbox img { position: absolute; transform-origin: 0 0; }
.compare { display: grid; gap: 12px; }
@media (min-width: 800px) { .compare { grid-template-columns: 1fr 1fr; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { max-width: 200px; }
.partedit { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--rule); border-radius: 12px; }
.sectionhead { margin: 8px 0 0; font-size: 1.2rem; color: var(--subj, var(--accent)); }

/* ---------- grown-up side: Today · Topics · Plan · Puzzles (docs/parent-redesign.md) ---------- */
.ptabs { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; background: var(--paper); }
.ptab { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; color: var(--ink-soft); border-bottom: 3px solid transparent; white-space: nowrap; min-height: 48px; font-size: 1rem; }
.ptab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.ptab .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .75rem; }
.subjseg { max-width: min(440px, 100%); flex-wrap: wrap; }
.subjsel select { font: inherit; font-weight: 700; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--grid); background: var(--card, transparent); color: var(--ink); max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* A passage (design 13): kept as written, paragraphs and line breaks. */
.passage { white-space: pre-wrap; line-height: 1.6; }
.sbar { display: block; height: 8px; border-radius: 99px; background: var(--grid); overflow: hidden; min-width: 60px; }
.sfill { display: block; height: 100%; border-radius: 99px; background: var(--ink-soft); }
.sfill.weak { background: var(--bad); } .sfill.getting { background: var(--warn); } .sfill.strong { background: var(--good); }
.tpct { font-weight: 700; } .tpct.weak { color: var(--bad); } .tpct.getting { color: var(--warn); } .tpct.strong { color: var(--good); } .tpct.unknown { color: var(--ink-soft); }
.trend.up { color: var(--good); font-weight: 700; } .trend.down { color: var(--bad); font-weight: 700; }
.frow { display: flex; gap: 10px; align-items: center; }
.frow > .trow2 { flex: 1; }
.trow2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; text-align: left; border: 0; background: transparent; padding: 10px 0; color: inherit; font: inherit; border-bottom: 1px solid var(--rule); min-height: 44px; cursor: pointer; }
.trow2 .sbar { grid-column: 1 / -1; }
.trow2 .tmeta { grid-column: 1 / -1; font-size: .85rem; color: var(--ink-soft); }
.frow2 { display: grid; grid-template-columns: minmax(0, 1fr) 110px 52px; gap: 10px; align-items: center; text-align: left; border: 0; background: transparent; padding: 6px 0; color: inherit; font: inherit; min-height: 44px; cursor: pointer; }
.frow2 .tpct { text-align: right; }
.tip { background: color-mix(in srgb, var(--accent) 10%, var(--sheet)); border-radius: 12px; padding: 12px; margin: 0; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
h3 .linkbtn { text-decoration: none; color: inherit; }
.tline { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.tev { display: grid; justify-items: center; gap: 2px; min-width: 76px; border: 1px solid var(--rule); background: var(--sheet); border-radius: 12px; padding: 8px 6px; font: inherit; color: inherit; cursor: pointer; }
.tev[disabled] { cursor: default; opacity: 1; }
.tev .tres { font-weight: 800; border-radius: 8px; padding: 2px 8px; }
.tev.ok .tres { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--ink); }
.tev.part .tres { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--ink); }
.tev.bad .tres { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--ink); }
.tev .tday { font-size: .8rem; font-weight: 700; } .tev .tsrc { font-size: .72rem; color: var(--ink-soft); text-align: center; }
.step { display: flex; gap: 10px; align-items: flex-start; }
.step .sn { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; border: 2px solid var(--rule); color: var(--ink-soft); }
.step.done .sn { background: color-mix(in srgb, var(--good) 18%, transparent); border-color: var(--good); color: var(--good); }
.step.next .sn { border-color: var(--accent); color: var(--accent); }
.mini { display: grid; gap: 4px; text-align: left; border: 0; background: var(--paper); border-radius: 12px; padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; }
.bad-t { color: var(--bad); }
.days { display: grid; gap: 8px; }
.dayrow { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 8px 12px; }
.dayrow.sel { border: 2px solid var(--accent); }
.dayrow.exam { background: color-mix(in srgb, var(--warn) 12%, var(--sheet)); }
.dayrow.rest .dtext { color: var(--ink-soft); }
.dlabel { display: grid; justify-items: center; border: 0; background: transparent; font: inherit; color: inherit; min-height: 44px; cursor: pointer; }
.dlabel .dn { font-size: .8rem; font-weight: 700; color: var(--ink-soft); } .dlabel .dd { font-size: 1.2rem; font-weight: 800; }
.dtext { line-height: 1.45; }
.waitbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--rule)); background: color-mix(in srgb, var(--warn) 10%, var(--sheet)); border-radius: 14px; padding: 12px 14px; font: inherit; color: inherit; cursor: pointer; }
.needrow > span[style*="flex:1"] { flex: 1 1 180px !important; }
.looknote { margin: 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 12%, var(--sheet)); color: var(--ink); font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; } /* a long note wraps, never widens the page */
.needtext { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; } /* the subject above the text */
.qstrip { display: flex; flex-wrap: wrap; gap: 6px; }
.qdot { display: inline-flex; align-items: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 22px; border: 1.5px solid var(--rule); background: var(--sheet); font-weight: 700; color: var(--ink); }
.qdot b { font-size: .95em; }
.qdot.q-right b { color: var(--good); } .qdot.q-fixed b { color: var(--accent); } .qdot.q-wrong b { color: var(--bad); } .qdot.q-wait b { color: var(--warn); } .qdot.q-none { color: var(--ink-soft); }
.qdot.q-wrong { border-color: color-mix(in srgb, var(--bad) 50%, var(--rule)); } .qdot.q-fixed { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }
.qdot.on { outline: 3px solid var(--accent); outline-offset: 1px; }
.onlybar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--sheet); border: 1px solid var(--rule); font-weight: 700; }
/* things to fix (her My mistakes) and marks won back */
.fixthing { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--rule); }
.fixthing details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.fixdots { display: inline-flex; gap: 6px; }
.fixdots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--subj, var(--accent)); }
.fixdots span.on { background: var(--subj, var(--accent)); }
.fixok { color: var(--good); display: inline-flex; }
.wonrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); }
.wonrow .small { grid-column: 1; }
.wonrow .pill { grid-column: 2; grid-row: 1 / span 2; }
/* scanning a paper page by page */
.scanpages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.scanpage { display: grid; gap: 4px; justify-items: center; border: 1px solid var(--rule); border-radius: 12px; padding: 8px; background: var(--sheet); }
.scanpage img { width: 100%; height: 140px; object-fit: contain; background: #fff; border-radius: 6px; }
.scanpage .btn { min-width: 44px; min-height: 44px; }
/* the grown-up's Progress page */
.pchart { width: 100%; height: auto; display: block; }
.prog-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); text-align: left; }
.prog-row:first-of-type { border-top: 0; }
.prog-row.plain { background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.prog-row .sbar { display: block; margin-top: 6px; max-width: 240px; }
.num { font-variant-numeric: tabular-nums; }

/* Grown-up Home (P1/P2), check one at a time (P3), all topics (P6) */
.needrow2, .frow3, .starbtn { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.needrow2 { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 4px; min-height: 44px; border-top: 1px solid var(--rule); }
.needrow2:first-of-type { border-top: 0; }
.needrow2 .ndot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); flex: none; }
.needrow2 .ntext { flex: 1; min-width: 0; }
.needrow2 .nact { color: var(--accent); white-space: nowrap; }
h1.headline { font-family: var(--display); text-wrap: balance; margin: 0; }
.frow3 { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 0; min-height: 44px; border-top: 1px solid var(--rule); }
.frow3:first-of-type { border-top: 0; }
.frow3 > .stack { flex: 1 1 8em; min-width: 0; } /* the status pill goes under the name when the row is narrow */
.frow3 .line1, .startstep .line1 { white-space: normal; } /* a reason wraps, never "…" (ux-checklist 0a) */
.startstep { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.startstep .sn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--accent); color: var(--accent); font-weight: 700; flex: none; }
.startstep.done .sn { background: var(--good); border-color: var(--good); color: var(--accent-ink); }
.startstep.done strong { color: var(--ink-soft); }
.seg button .subjdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-left: 5px; vertical-align: super; }
.trow3 { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--rule); min-width: 0; } /* a long name can't widen the card's grid (iPhone) */
.trow3:first-child { border-top: 0; }
.trow3 .prow { display: flex; gap: 10px; border-bottom: 0; width: auto; min-width: 0; } /* beside the star, not 100% of the row */
.trow3 .tpct { white-space: nowrap; }
.starbtn { min-width: 44px; min-height: 44px; font-size: 1.3rem; color: var(--mark); }
.card.plain, button.card { text-align: left; width: 100%; }
.center { text-align: center; align-items: center; }

/* Ask */
.askq { margin-left: auto; max-width: 85%; background: color-mix(in srgb, var(--accent) 14%, var(--paper)); padding: 10px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.aska { max-width: 95%; white-space: pre-wrap; line-height: 1.5; }
#asklog { gap: 12px; }
#ask-in { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: inherit; }

/* Report (P14): a small icon button in the header bar; the form floats over the page. */
.btn.report-btn { min-width: 44px; min-height: 44px; justify-content: center; padding: 0 10px; color: var(--ink-soft); }
.report-box { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; padding: 16px; background: rgba(0,0,0,.35); }
.report-box .dialog { width: min(480px, 100%); }
.report-box textarea { min-height: 80px; }
.report-box .seg { flex-wrap: wrap; }
.qstrip, .qcard, .onlybar { scroll-margin-top: 64px; } /* in-page jumps land below the sticky tabs */

/* Few words (ux-checklist 0a): one line per row text, a small line under a button, secondary actions behind "…". */
.line1, .prow .t, .prow .s { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#s-finish { display: flex; flex-wrap: wrap; } /* Settings' Finish row: the subject's line wraps, never "Mat…" (iPhone, large text) */
#s-finish .t { white-space: normal; }
.list-row > .prow .t, .list-row > .prow .s { white-space: normal; } /* Her list: "Puzzle #7" wraps beside its "…", never "Pu…" (iPhone, large text) */
.list-row > .moremenu { margin-left: auto; } /* wrapped under the name, the "…" stays right so its menu opens on screen */
.btnline { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 100%; }
.btnline > .small { padding-left: 4px; max-width: 100%; white-space: normal; } /* wraps, never "…" or wider than the page */
.moremenu { position: relative; display: inline-flex; }
.moreb { min-width: 44px; justify-content: center; font-size: 1.1rem; letter-spacing: 1px; }
.moremenu .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; min-width: 11em; padding: 4px; border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); box-shadow: var(--shadow); }
.moremenu .menu[hidden] { display: none; }
.moremenu .menu button { border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-align: left; padding: 10px 12px; min-height: 44px; border-radius: 8px; white-space: nowrap; cursor: pointer; }
.moremenu .menu button:hover { background: var(--sheet-2); }
.moremenu .menu button[disabled] { opacity: .5; }
.fixdots { letter-spacing: 2px; color: var(--accent); }
.btn.addday { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; font-size: 1.3rem; line-height: 1; }
.btn[data-focus][aria-pressed="true"] { background: var(--mark); border-color: var(--ink); }
.pill.verdict { flex: none; }
.why { display: inline; }
.why > summary { display: inline; list-style: none; cursor: pointer; color: var(--ink-soft); }
.why > summary::-webkit-details-marker { display: none; }
.why[open] > p { margin-top: 4px; }
.why[open] { flex-basis: 100%; }
/* Admin: tabs wrap at phone width; System blocks (A0b) turn red when an alert names them. */
.seg.segwrap { flex-wrap: wrap; max-width: 100%; }
.seg .dot { width: 8px; height: 8px; margin-left: 6px; vertical-align: middle; }
.sysblock h3 { margin: 0; }
.sysblock .sysline { margin: 0; font-weight: 700; }
.sysblock.bad { border-color: var(--bad); }
.sysblock.bad .sysline { color: var(--bad); }
.sysblock details > summary { cursor: pointer; color: var(--accent); }
.sysblock details { min-width: 0; } /* grid items: a report's one-line summary ellipsizes instead of widening the page */
.sysmsg { overflow-wrap: anywhere; white-space: pre-wrap; margin: 0; }
.reprow { border-bottom: 1px solid var(--rule); }
.sysblock .reprow > summary { padding: 10px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.repimg { max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 10px; }
.sysblock h4 { margin: 12px 0 2px; }

/* Engine v3 (14f): a line sent in three widths shows the full one, wrapping (v3web.js). */
.w3 .w3-short, .w3 .w3-shortest { display: none; }
.skillrow { flex-wrap: wrap; }
/* ---------- Admin → Bank: skill tags (14c §3–§4) ---------- */
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.tagcap { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--sheet); color: var(--ink); font-size: .85rem; font-weight: 700; max-width: 100%; overflow-wrap: anywhere; }
.tagcap.main { background: var(--ink); color: var(--paper); }
.tagcap.method { border-style: dashed; font-weight: 600; }
.tagcap.diff { border-color: var(--warn); color: var(--warn); }
.tagcap.main.diff { background: var(--warn); color: #fff; }
.tagcap .c { font-weight: 400; opacity: .8; white-space: nowrap; flex: none; }
button.tagcap { min-height: 44px; }
button.tagcap[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-style: solid; }
button.tagcap:disabled { opacity: .45; }
.tagcap .linkish { border: 0; background: none; color: inherit; font: inherit; padding: 0 2px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tagdiff { color: var(--warn); font-weight: 700; }
.tagpart { border-top: 1px solid var(--rule); padding-top: 12px; min-width: 0; }
.tagthis { border-top: 3px solid var(--accent); }
.tagcmp { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.tagpick { display: grid; gap: 10px; padding: 10px; border: 1px dashed var(--rule); border-radius: 12px; min-width: 0; }
.tagpick input[type="search"] { width: 100%; max-width: 100%; }
.tagpick .matches { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.tagpick .matches button { flex: none; display: block; line-height: 1.35; text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: none; padding: 8px 4px; min-height: 44px; color: var(--ink); overflow-wrap: anywhere; }
.skel { height: 1em; border-radius: 8px; background: var(--sheet-2); animation: skel 1.1s ease-in-out infinite alternate; }
@keyframes skel { to { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
