/* Learning Fox design system. Mobile-first; tablet rail at 700px; desktop sidebar at 1024px. */
:root {
  --bg: #F8F6F1; --surface: #FFFFFF; --ink: #172B2C; --ink-2: #354B4D; --muted: #687A7C; --line: #ECE6DC; --line-2: #D9D1C4;
  --brand: #0E9384; --brand-ink: #0A6E63; --brand-soft: #E0F3EF; --night: #0B5F57; --fox: #F7782A; --fox-soft: #FFF3E8;
  --ok: #15954B; --ok-soft: #E1F4E8; --warn: #B4610B; --warn-soft: #FDF0DA; --bad: #D93B3B; --bad-soft: #FDE7E7;
  --r: 18px; --r-sm: 10px; --shadow: 0 1px 2px rgba(60, 45, 25, .05), 0 6px 18px rgba(60, 45, 25, .05);
  --side: 248px; --tap: 44px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; margin-top: 8px; }
p { margin: 0; }
a { color: var(--brand-ink); }
img { max-width: 100%; }
code { font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--brand-soft); color: var(--brand-ink); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; justify-content: center; }
.nowrap { white-space: nowrap; flex-wrap: nowrap !important; }
.grow { flex: 1; min-width: 0; }
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ic { flex: none; }

/* ---------- layout shell ---------- */
.shell { min-height: 100vh; }
.side { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-title { flex: 1; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 18px; }
main { padding: 20px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; outline: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; border-radius: 12px; position: relative; }
.tabbar a.on { color: var(--brand); background: var(--brand-soft); }
.shell.focus .tabbar { display: none; }
.shell.focus main { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.who-btn { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; border-radius: 999px; padding: 4px 10px 4px 4px; background: var(--bg); }
.who-btn.compact span:not(.who-av), .who-btn.compact .muted { display: none; }
.who-btn.compact { padding: 4px; }
.who-av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 8px; border-radius: 999px; background: var(--bg); }
.topbar .sync span { display: none; }
.sync.synced { color: var(--ok); } .sync.error { color: var(--bad); } .sync.offline, .sync.signedout { color: var(--warn); }
.badge-n { position: absolute; top: 4px; right: calc(50% - 22px); background: var(--bad); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }

/* tablet: icon rail */
@media (min-width: 700px) {
  .topbar, .tabbar { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 96px; background: var(--surface); border-right: 1px solid var(--line); padding: calc(14px + env(safe-area-inset-top)) 8px calc(14px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); z-index: 20; overflow-y: auto; }
  .side .brand { justify-content: center; margin-bottom: 14px; }
  .side .brand span { display: none; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px; border-radius: 14px; text-decoration: none; color: var(--ink-2); font-size: 11px; font-weight: 700; text-align: center; position: relative; min-height: var(--tap); }
  .side-nav a:hover { background: var(--bg); }
  .side-nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: center; padding-top: 12px; }
  .side-foot .sync span { display: none; }
  .side-foot .who-btn { flex-direction: column; padding: 6px; font-size: 11px; background: none; }
  .side-foot .who-btn .muted { display: none; }
  main { margin-left: 96px; padding: calc(28px + env(safe-area-inset-top)) 28px 48px; }
  .is-child .side { width: 108px; }
  .is-child main { margin-left: 108px; }
}
/* desktop: full sidebar */
@media (min-width: 1024px) {
  .side { width: var(--side); padding: 22px 14px; }
  .side .brand { justify-content: flex-start; padding: 0 10px; margin-bottom: 22px; }
  .side .brand span { display: inline; }
  .side-nav a { flex-direction: row; gap: 12px; font-size: 15px; padding: 10px 12px; text-align: left; }
  .side-nav .badge-n { position: static; margin-left: auto; }
  .side-foot { align-items: stretch; }
  .side-foot .sync span { display: inline; }
  .side-foot .who-btn { flex-direction: row; font-size: 14px; background: var(--bg); padding: 6px 12px 6px 6px; }
  .side-foot .who-btn .muted { display: inline; margin-left: auto; font-size: 12px; }
  main, .is-child main { margin-left: var(--side); padding: 32px 40px 56px; }
  .is-child .side { width: var(--side); }
  @media (hover: hover) { .side-nav a:hover { background: var(--bg); } }
}
@media (min-width: 1400px) { main { margin-left: calc(var(--side) + max(0px, (100vw - var(--side) - 1180px) / 2 - 40px)); } }

/* ---------- building blocks ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.warn { background: var(--warn-soft); box-shadow: none; }
.card.accent { background: var(--brand-soft); box-shadow: none; }
.card.accent .btn.soft, .celebrate .btn.soft { background: #fff; box-shadow: inset 0 0 0 1.5px #BFE3DC; }
.card.note { background: var(--fox-soft); box-shadow: none; }
.card.celebrate { background: linear-gradient(120deg, #E1F4E8, #FFF1E4); box-shadow: none; }
.linkcard { text-decoration: none; color: inherit; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.linkcard:hover { box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); align-items: end; }
.grid.plan-grid { grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .grid.plan-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } .sticky { position: sticky; top: 24px; } }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; border: 0; padding: 0; margin: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; }
.page-head p { margin-top: 4px; max-width: 62ch; }
.section-title { margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-weight: 700; min-height: var(--tap); align-self: flex-start; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; }
.btn:hover { background: var(--brand-ink); }
.btn:active { transform: scale(.98); }
.btn.soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn.soft:hover { background: #CDEBE5; }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--bad); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.big { min-height: 54px; padding: 14px 26px; font-size: 17px; border-radius: 14px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border: 0; background: transparent; border-radius: 12px; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.icon-btn[disabled] { opacity: .3; }
.linklike { background: none; border: 0; color: var(--brand-ink); text-decoration: underline; cursor: pointer; padding: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
label.inline { flex-direction: row; align-items: center; }
.field { width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; font-weight: 500; font-size: 16px; color: var(--ink); }
.field:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.field.sm { min-height: 36px; padding: 6px 10px; font-size: 14px; width: auto; }
.field.big { font-size: 24px; font-weight: 700; min-height: 60px; text-align: center; }
textarea.field { resize: vertical; line-height: 1.5; }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; color: var(--ink); min-height: 36px; }
.check input[type=checkbox], .check input[type=radio] { width: 22px; height: 22px; flex: none; accent-color: var(--brand); }
.checks { display: flex; flex-direction: column; gap: 4px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; margin-bottom: 4px; }
.end-cell { display: flex; align-items: flex-end; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 6px 14px 6px 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink-2); }
.chip-btn.sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.chip-btn.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: #065F46; } .pill.due { background: var(--warn-soft); color: #92400E; } .pill.late { background: var(--bad-soft); color: #991B1B; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role=tab] { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 0; background: var(--bg); color: var(--ink-2); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.tabs [aria-selected=true] { background: var(--brand); color: #fff; }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .3s; }
.fb { border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.fb.good { background: var(--ok-soft); color: #065F46; }
.fb.bad { background: var(--warn-soft); color: #78350F; }
.fb.warnfb { background: var(--warn-soft); color: #78350F; display: flex; gap: 6px; align-items: center; }
.fb span { display: block; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stats > div { background: var(--surface); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stats strong { font-size: 26px; font-weight: 800; }
.stats span { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kv td:first-child { color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 560px; }

/* ---------- child: hero, tasks, subjects ---------- */
.hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: linear-gradient(120deg, #DDF2EE 0%, #FFF1E4 100%); color: var(--ink); border-radius: 24px; padding: 22px; }
.hero .muted, .hero .eyebrow { color: var(--ink-2); }
.hero .chip { background: rgba(255, 255, 255, .8); color: var(--ink); }
.hero .chip .ic { color: var(--fox); }
.hero-av .avatar { border-radius: 28px; box-shadow: 0 6px 18px rgba(60, 45, 25, .14); }
.hero h1 { margin: 2px 0 10px; }
.avatar { flex: none; display: block; border-radius: 30%; }
.tasks { display: flex; flex-direction: column; gap: 10px; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg); border-left: 5px solid var(--c, var(--brand)); }
.task.next { background: var(--surface); box-shadow: 0 0 0 2px var(--c, var(--brand)), var(--shadow); }
.task.done { opacity: .72; }
.task.done strong { text-decoration: line-through; text-decoration-color: var(--line-2); }
.task-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--cs, var(--brand-soft)); color: var(--c, var(--brand)); }
.task.done .task-ic { background: var(--ok-soft); color: var(--ok); }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-body .muted { font-size: 13px; }
.subj-tile { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: var(--r); border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; min-height: 84px; border-bottom: 4px solid var(--c); color: inherit; }
.subj-tile:hover { transform: translateY(-1px); }
.subj-tile span:last-child { display: flex; flex-direction: column; }
.subj-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--cs); color: var(--c); }
.card.subj { border-top: 5px solid var(--c); }
.skill-list { display: flex; flex-direction: column; }
.skill-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: inherit; text-decoration: none; min-height: var(--tap); width: 100%; }
.skill-row > span:nth-child(2) { flex: 1; min-width: 0; }
.skill-row:hover { background: var(--bg); }
.dot-st { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; }
.skill-row.mastered .dot-st { background: var(--ok); border-color: var(--ok); color: #fff; }
.dot-st .half { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); }
.num { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--muted); }

/* ---------- lessons and questions ---------- */
.lesson { border-top: 6px solid var(--c, var(--brand)); }
.teach { font-size: 18px; line-height: 1.65; display: flex; flex-direction: column; gap: 10px; }
.teach ul { margin: 0; padding-left: 22px; }
.is-child .teach { font-size: 19px; }
.try { background: var(--fox-soft); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.try strong { display: flex; gap: 6px; align-items: center; color: #9A3412; }
.stds summary, details summary { cursor: pointer; font-weight: 700; color: var(--ink-2); min-height: 36px; display: flex; align-items: center; gap: 6px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 0 0 4px; transition: transform .15s; flex: none; }
details[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.date-nav { flex-wrap: nowrap; }
.date-nav > div { flex: 1; min-width: 0; }
@media (max-width: 699px) {
  .task.editable { flex-wrap: wrap; }
  .task.editable .task-body { flex: 1 1 calc(100% - 60px); }
  .task.editable > .row { width: 100%; justify-content: flex-end; margin-top: -6px; }
}
.stds ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.player-top { display: flex; align-items: center; gap: 12px; }
.player-top .bar { flex: 1; height: 12px; }
.q-wrap { display: grid; gap: 16px; }
@media (min-width: 1024px) { .q-wrap.has-passage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .q-wrap.has-passage .passage { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; } }
.passage { background: var(--surface); border-radius: var(--r); padding: 16px 20px; box-shadow: var(--shadow); }
.passage-body { font-size: 18px; line-height: 1.75; margin: 8px 0 12px; font-family: Georgia, 'Iowan Old Style', serif; color: var(--ink); }
.q-card { background: var(--surface); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.q-head { display: flex; gap: 12px; align-items: flex-start; }
.q-prompt { flex: 1; font-size: 22px; font-weight: 700; line-height: 1.4; }
.q-prompt.big { font-size: 26px; }
.q-prompt .bigletter { display: block; font-size: 88px; line-height: 1; font-weight: 800; color: var(--brand); margin-bottom: 6px; }
.q-prompt .bigword { display: block; font-size: 56px; font-weight: 800; letter-spacing: .04em; color: var(--brand); margin: 4px 0 8px; }
.q-visual { display: flex; justify-content: center; overflow-x: auto; padding: 4px; }
.q-visual .row { justify-content: center; }
.qv { max-width: 100%; height: auto; }
.stack .qv, .q-visual .stack { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.choices.one { grid-template-columns: 1fr; }
.choices.sym .choice { font-size: 34px; font-weight: 800; }
.choice { min-height: 64px; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; font-size: 19px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--ink); transition: border-color .12s, background .12s, transform .08s; }
.choices.one .choice { justify-content: flex-start; text-align: left; font-size: 17px; font-weight: 600; }
@media (hover: hover) { .choice:hover:not([disabled]) { border-color: var(--brand); } }
.choice:active:not([disabled]) { transform: scale(.98); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand); }
.choice.right { border-color: var(--ok); background: var(--ok-soft); }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.dim { opacity: .5; }
.choice .qv { max-height: 60px; width: auto; }
.choice .frac, .q-prompt .frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; font-size: .8em; line-height: 1.1; }
.frac span:first-child { border-bottom: 2px solid currentColor; }
.emo { font-size: 36px; line-height: 1.2; letter-spacing: 4px; }
.emo-line { font-size: 40px; letter-spacing: 6px; text-align: center; word-break: break-all; }
.pw { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pw .emo { font-size: 44px; }
.pw span:last-child { font-size: 15px; }
.picto { display: flex; flex-direction: column; gap: 4px; background: var(--bg); padding: 12px 16px; border-radius: 12px; }
.picto div { display: flex; gap: 12px; } .picto div span:first-child { width: 90px; font-weight: 700; }
.picto em { font-size: 13px; color: var(--muted); }
.ans-row { display: flex; align-items: center; gap: 10px; max-width: 360px; }
.unit { font-weight: 700; color: var(--muted); font-size: 18px; }
.q-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.q-actions .btn.big { min-width: 160px; }
.fallback { font-size: 13px; color: var(--muted); }
.is-child .q-prompt { font-size: 24px; }
.is-child .choice { min-height: 72px; font-size: 21px; }
.result { align-items: center; text-align: center; padding: 32px 20px; }
.score-ring { --p: 0; --c: var(--brand); width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.score-ring span { width: 104px; height: 104px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 800; }
.review { width: 100%; text-align: left; }
.rv { padding: 10px 12px; border-radius: 12px; margin-top: 8px; background: var(--bg); border-left: 4px solid var(--line-2); }
.rv.good { border-color: var(--ok); } .rv.bad { border-color: var(--bad); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 17px; }
.writing { white-space: pre-wrap; background: var(--bg); border-radius: 12px; padding: 14px; font-family: Georgia, serif; font-size: 16px; line-height: 1.6; max-height: 320px; overflow: auto; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.checklist li.ok { color: var(--ok); }
.thumb { max-width: 220px; border-radius: 10px; display: block; }

/* ---------- rewards ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 10px; border-radius: 14px; background: var(--bg); color: var(--muted); }
.badge.got { background: linear-gradient(160deg, #FEF3C7, #FFEDD5); color: #92400E; }
.badge small { font-size: 12px; }
.grid.shop { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shop-item { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: var(--bg); align-items: flex-start; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line-2); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- parent ---------- */
.kidcard .row:first-child { flex-wrap: nowrap; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; text-decoration: none; color: var(--ink-2); background: var(--bg); font-size: 12px; font-weight: 700; min-height: 64px; }
.day strong { font-size: 18px; }
.day i { font-style: normal; font-size: 11px; color: var(--brand); min-height: 14px; }
.day.today { box-shadow: inset 0 0 0 2px var(--line-2); }
.day.on { background: var(--brand); color: #fff; } .day.on i { color: #CFF0EA; }
.qlist { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.qlist > li { display: flex; gap: 8px; align-items: flex-start; }
.qprev { flex: 1; min-width: 0; font-size: 15px; background: var(--bg); padding: 10px 12px; border-radius: 12px; }
.qprev ul { margin: 6px 0 0; padding-left: 18px; }
.qprev li.ok { color: var(--ok); font-weight: 700; }
.qprev .qv { max-width: 100%; height: auto; max-height: 180px; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.std-list { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow: auto; }
.std { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); font-size: 14px; }
.std .muted { grid-column: 2; }
.std.ok code { background: var(--ok-soft); color: #065F46; }
.elective { border-top: 4px solid var(--c); }
.mode-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); margin-top: 4px; }
.mode-tag.review { background: #E4F0FD; color: #1559A8; }
.mode-tag.testout { background: #FFF1D6; color: #9A5B00; }
.mode-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); }
.mode-banner.review { background: #E4F0FD; color: #1559A8; }
.mode-banner.testout { background: #FFF1D6; color: #7A4800; }
.mode-banner.warn { background: var(--warn-soft); color: #7A4800; }
.mode-banner.lvup { background: #E1F4E8; color: #0F6B36; margin-top: 12px; }
/* math difficulty levels */
.lvl-chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px 3px 7px; border-radius: 999px; background: #E4F0FD; color: #1559A8; font-size: 12px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.lvl-chip i { display: inline-block; width: 5px; height: 12px; border-radius: 2px; background: #B8D4F5; }
.lvl-chip i:nth-child(2) { height: 14px; } .lvl-chip i:nth-child(3) { height: 16px; } .lvl-chip i:nth-child(4) { height: 18px; margin-right: 3px; }
.lvl-chip i.on { background: #1D7FE0; }
.lvl-chip.lv4 { background: #EEEAFF; color: #5B3FD6; } .lvl-chip.lv4 i.on { background: #7A5AF8; }
.lvl-start, .lvl-result { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.lvl-result { justify-content: center; }
.card.help { flex-direction: row; gap: 12px; background: #FFF8EC; box-shadow: none; align-items: flex-start; }
.card.help .teach { font-size: 16px; margin-top: 6px; }
.dot-st.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.dot-st.due { border-color: #1D7FE0; color: #1D7FE0; }
.dot-st.warn { border-color: var(--warn); color: var(--warn); font-weight: 800; font-size: 13px; }
.dot-st .quarter { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.legend .dot-st { display: inline-grid; width: 20px; height: 20px; vertical-align: middle; }
.insights { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.insights span { background: var(--bg); border-radius: 10px; padding: 4px 10px; }
.insights strong { color: var(--ink); }
.subj-tile .mode-tag { align-self: flex-start; }
.std-check { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; font-size: 14px; }
.std-check li { display: flex; gap: 10px; align-items: flex-start; }
.std-check .mark { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; margin-top: 1px; }
.std-check li.done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.std-check .half { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.checklist-box > .bar { margin-top: 6px; }
.place-detail { border-top: 1px solid var(--line); padding-top: 8px; }
.place-detail h3 { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.place-detail .mark { font-size: 11px; color: var(--bad); }
.place-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.place-cell { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg); }
.place-cell .grow { display: flex; flex-direction: column; }
a.fb { text-decoration: none; }
.child-edit { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.grid.samples { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sample { display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--bg); border-radius: 12px; }
.sample img { border-radius: 8px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.more-list { display: flex; flex-direction: column; gap: 10px; }
.more-list .linkcard { flex-wrap: nowrap; justify-content: flex-start; gap: 14px; }
.more-list .linkcard strong { flex: 1; }
.sync-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.sync-dot.synced { background: var(--ok); } .sync-dot.error { background: var(--bad); } .sync-dot.offline, .sync-dot.signedout { background: var(--warn); }

/* ---------- gate screens ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 15% 0%, #D6F0EB, transparent 50%), radial-gradient(circle at 100% 100%, #FFE9D6, transparent 45%), var(--bg); }
.gate-card { width: 100%; max-width: 620px; background: var(--surface); border-radius: 24px; padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.role-list { display: flex; flex-direction: column; gap: 10px; }
.role { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; min-height: 72px; color: inherit; }
.role:hover { border-color: var(--brand); background: var(--brand-soft); }
.role > span { display: flex; flex-direction: column; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.who-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 10px; border-radius: 20px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 17px; color: inherit; }
.who-tile:hover { border-color: var(--brand); }
.who-tile.parent { color: var(--night); justify-content: center; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- overlays ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .5); display: grid; place-items: center; padding: 16px; }
.modal-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; max-width: calc(100vw - 32px); transition: all .2s; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 700px) { .toast { bottom: 32px; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; animation: fall 2.4s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .btn, .choice, .bar > i { transition: none; } }
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .6); overflow: auto; padding: 24px 12px; }
.sheet { background: #fff; max-width: 820px; margin: 0 auto; padding: clamp(20px, 5vw, 48px); border-radius: 8px; color: #000; font-family: Georgia, serif; display: flex; flex-direction: column; gap: 12px; }
.sheet h2, .sheet h3 { font-family: Georgia, serif; }
.sheet table { font-size: 13px; }
.sheet .noprint { display: flex; gap: 10px; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; position: sticky; bottom: 0; background: #fff; padding-top: 12px; }
/* ---------- printable workbooks ---------- */
.wb { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: #111; display: flex; flex-direction: column; gap: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet .wb h2, .sheet .wb h3 { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.wb h2 { font-size: 22px; }
.wb-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 2px solid #111; padding-bottom: 10px; }
.wb-top > div:first-child { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.wb-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; align-items: center; }
.wb-sec { margin-top: 14px; }
.wb-h { font-family: inherit; font-size: 18px; border-left: 6px solid; padding: 2px 0 2px 10px; margin-bottom: 8px; }
.wb-h small { font-weight: 500; color: #555; font-size: 13px; }
.wb-notes { background: #F4F1EA; border-radius: 10px; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.wb-notes p { margin: 0 0 4px; }
.wb-passage { border: 1.5px solid #999; border-radius: 10px; padding: 10px 14px; font-family: Georgia, serif; font-size: 15px; line-height: 1.6; margin: 8px 0; break-inside: avoid; }
.wb-q { display: flex; gap: 12px; margin: 14px 0; break-inside: avoid; page-break-inside: avoid; }
.wb-num { width: 28px; height: 28px; flex: none; border: 2px solid #111; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.wb-num.sm { width: 24px; height: 24px; font-size: 12px; border-width: 1.5px; }
.wb-body { flex: 1; min-width: 0; }
.wb-prompt { font-size: 17px; font-weight: 600; line-height: 1.45; }
.wb-prompt .bigletter, .wb-prompt .bigword { display: block; font-size: 44px; font-weight: 800; }
.wb-vis { margin: 6px 0; }
.wb-vis .qv { max-width: 320px; height: auto; }
.wb-vis .emo-line, .wb .emo { font-size: 28px; }
.wb-opts { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px 16px; font-size: 16px; }
.wb-opts li { display: flex; align-items: center; gap: 8px; }
.wb-opts .qv { max-height: 48px; width: auto; }
.bubble { width: 24px; height: 24px; flex: none; border: 1.5px solid #111; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.wb-opts li.key .bubble { background: #15954B; border-color: #15954B; color: #fff; }
.wb-opts li.key { font-weight: 700; }
.wb-blank { margin-top: 10px; font-size: 16px; }
.wb-blank span { display: inline-block; width: 180px; border-bottom: 1.5px solid #111; margin: 0 6px; }
.wb-lines i { display: block; height: 30px; border-bottom: 1px solid #BBB; }
.wb-check { list-style: none; padding: 0; margin: 6px 0; font-size: 14px; columns: 2; }
.key-ans { color: #0B6B37; margin-top: 6px; font-size: 15px; }
.wb-foot { margin-top: 18px; font-size: 13px; color: #555; text-align: center; }
.grade-list { display: flex; flex-direction: column; }
.grade-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.grade-row .check { min-height: 40px; }
.subj-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
@media print {
  body * { visibility: hidden; }
  .sheet-wrap, .sheet-wrap * { visibility: visible; }
  .sheet-wrap { position: absolute; inset: 0; background: #fff; padding: 0; overflow: visible; }
  .sheet { padding: 0; max-width: none; }
  .noprint { display: none !important; }
  @page { margin: 14mm; }
}
