/* Fonts are served from this site (no third-party font requests). All are SIL Open Font License 1.1; see /fonts/LICENSE.txt. */
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/baloo-2-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/baloo-2-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/baloo-2-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/lexend-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/lexend-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/lexend-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/lexend-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Patrick Hand"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/patrick-hand-latin-400-normal.woff2) format("woff2"); }

/* Numspan
   Layout: one narrow worksheet column on graph paper. Light theme = paper, dark theme = chalkboard. */
:root {
  --paper: #F6F8FC;
  --grid: #E2E9F3;
  --ink: #1B2A4A;
  --ink-soft: #5B6A86;
  --card: #FFFFFF;
  --line: #D3DCE9;
  --pencil: #F4B400;
  --pencil-deep: #C98F00;
  --on-pencil: #2B1F00;
  --gold: #B7791F;
  --gold-bg: #FFF4D6;
  --good: #188A4B;
  --good-bg: #E3F6EA;
  --bad: #D3263A;
  --bad-bg: #FDE8EA;
  --eraser: #E8828F;
  --blue: #2F5FC4;
  --blue-bg: #E7EFFD;
  --f-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Lexend", "Segoe UI", system-ui, sans-serif;
  --f-hand: "Patrick Hand", "Comic Sans MS", cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1E2B27; --grid: #26362F; --ink: #EEF2EB; --ink-soft: #A7B7AE;
    --card: #283832; --line: #3A4E46; --pencil: #FFC83D; --pencil-deep: #D9A21C;
    --on-pencil: #2B1F00; --gold: #FFD36B; --gold-bg: #4A3D1C;
    --good: #62D394; --good-bg: #20402F; --bad: #FF7383; --bad-bg: #4A2A2F; --eraser: #F09AA6; --blue: #8FB2FF; --blue-bg: #24334F;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.1; text-wrap: balance; margin: 0; }
.muted { color: var(--ink-soft); }

.app { max-width: 760px; margin: 0 auto; padding-inline: 16px; padding-block: 16px 64px; }

/* ---------- header ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.mark { display: block; border-radius: 11px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--f-display); font-weight: 800; font-size: 1.7rem; letter-spacing: .02em; }
.brand-sub { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin-top: 3px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.who { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 14px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.who-switch { font-size: .75rem; font-weight: 500; color: var(--ink-soft); background: var(--paper); border-radius: 999px; padding: 2px 10px; }
.who:hover { border-color: var(--pencil-deep); }

/* ---------- buttons, fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; cursor: pointer;
  font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; text-decoration: none;
  border: 2px solid var(--line); background: var(--card); box-shadow: 0 3px 0 var(--line);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn.primary { background: var(--pencil); border-color: var(--pencil-deep); color: var(--on-pencil); box-shadow: 0 4px 0 var(--pencil-deep); }
.btn.primary:active { box-shadow: 0 1px 0 var(--pencil-deep); }
.btn.gold { background: var(--gold-bg); border-color: var(--gold); color: var(--gold); box-shadow: 0 4px 0 var(--gold); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .95rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .88rem; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field span { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.field input {
  min-height: 48px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card);
}
.field input:focus { border-color: var(--pencil-deep); outline: none; }
.form-error { margin: 4px 0 12px; color: var(--bad); font-weight: 500; font-size: .92rem; }
.form-error.ok { color: var(--good); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .88rem; color: var(--ink-soft); }
.check input { width: 18px; height: 18px; accent-color: var(--pencil-deep); }

.card { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 22px; margin-top: 14px; }
.eyebrow { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- auth ---------- */
.auth-card { max-width: 440px; margin: 8px auto 0; background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 26px 22px; }
.auth-card h1 { font-size: 1.9rem; font-weight: 800; }
.auth-card > p.muted { margin: 8px 0 18px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: var(--paper); border: 2px solid var(--line); margin-bottom: 18px; }
.tab { min-height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.fine { margin: 14px 0 0; font-size: .8rem; color: var(--ink-soft); }

/* ---------- home ---------- */
.hello { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.hello h1 { font-size: 1.8rem; font-weight: 800; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--ink-soft); }
.summary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.continue {
  margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 2px solid var(--pencil-deep); box-shadow: 0 4px 0 var(--pencil-deep); border-radius: 18px; padding: 16px 18px;
}
.continue .what { min-width: 0; }
.continue .what b { display: block; font-family: var(--f-display); font-size: 1.25rem; line-height: 1.15; }
.tier { margin-top: 30px; }
.tier-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.tier-head h2 { font-size: 1.4rem; font-weight: 800; }
.tier-head p { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.lvl {
  display: flex; flex-direction: column; gap: 6px; text-align: left; min-width: 0;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.lvl:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--ink-soft); }
.lvl:disabled { background: transparent; border-style: dashed; cursor: not-allowed; opacity: .65; }
.lvl.current { border-color: var(--pencil-deep); box-shadow: 0 4px 0 var(--pencil); }
.lvl .code { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.lvl .title { font-family: var(--f-display); font-weight: 700; font-size: 1.08rem; line-height: 1.15; }
.lvl .foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.progress { flex: 1 1 80px; height: 6px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--good); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1.5px solid var(--line); color: var(--ink-soft); white-space: nowrap; }
.chip.pass { color: var(--good); border-color: var(--good); background: var(--good-bg); }
.chip.high { color: var(--gold); border-color: var(--gold); background: var(--gold-bg); }
.chip.now { color: var(--on-pencil); border-color: var(--pencil-deep); background: var(--pencil); }

.account { margin-top: 40px; padding-top: 18px; border-top: 2px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.pw-form { flex-basis: 100%; max-width: 360px; }

/* ---------- level ---------- */
.level-head { margin-top: 16px; }
.level-head h2 { font-size: 2rem; font-weight: 800; margin-top: 2px; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.step-btn {
  width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer;
}
.step-btn:disabled { background: transparent; border-style: dashed; cursor: not-allowed; opacity: .65; }
.step-btn.current { border-color: var(--pencil-deep); box-shadow: 0 3px 0 var(--pencil); }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--line); font-variant-numeric: tabular-nums; }
.step-btn.is-pass .step-num { background: var(--good); border-color: var(--good); color: var(--card); }
.step-btn.is-high .step-num { background: var(--gold); border-color: var(--gold); color: var(--card); }
.step-name { font-weight: 600; min-width: 0; }
.step-name small { display: block; color: var(--ink-soft); font-weight: 400; font-size: .8rem; }

/* ---------- intro ---------- */
#introName { font-size: 2rem; font-weight: 800; margin-top: 2px; }
.sample { margin: 18px 0; padding: 16px; border-radius: 14px; background: var(--paper); text-align: center; font-weight: 700; font-size: 1.6rem; font-variant-numeric: tabular-nums; overflow-x: auto; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-card { display: flex; flex-direction: column; gap: 8px; border: 2px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; background: var(--card); }
.mode-card.medium { border-color: var(--good); background: var(--good-bg); }
.mode-card.hard { border-color: var(--blue); background: var(--blue-bg); }
.mode-card.expert { border-color: var(--gold); background: var(--gold-bg); }
.mode-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mode-name { font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; line-height: 1; }
.mode-card.medium .mode-name { color: var(--good); }
.mode-card.hard .mode-name { color: var(--blue); }
.mode-card.expert .mode-name { color: var(--gold); }
.mode-tag { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); }
.mode-card p { margin: 0 0 4px; font-size: .88rem; flex: 1; }
.mode-card .btn { width: 100%; font-size: 1rem; }
.tip { margin: 8px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--paper); border-left: 4px solid var(--pencil); max-width: 62ch; }
.tip::before { content: "How it works: "; font-weight: 700; }
.learn { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--bad-bg); border: 2px solid var(--bad); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.learn p { margin: 0; flex: 1 1 260px; }
.learn p b { color: var(--bad); }
.ready { margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: var(--good-bg); border: 2px solid var(--good); color: var(--good); font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.meters.single { grid-template-columns: 1fr; }
.small-print { font-size: .82rem; margin: 12px 0 0; }
.history { margin-top: 24px; }
.history h3 { font-size: 1.1rem; margin-bottom: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* ---------- play ---------- */
.playbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mode { font-family: var(--f-display); font-weight: 700; font-size: 1rem; text-align: center; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode.medium { color: var(--good); }
.mode.hard { color: var(--blue); }
.mode.expert { color: var(--gold); }
.qnum { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: .9rem; }
.meters { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.meter { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.meter-label { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--ink-soft); margin-bottom: 8px; }
.meter-label b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.dots { display: flex; gap: 3px; }
.dots i { flex: 1; max-width: 14px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); }
.dots i.ok { border-color: var(--good); background: var(--good); }
.dots i.no { border-color: var(--bad); background: var(--bad); }
.speedbar { height: 14px; border-radius: 99px; background: var(--paper); border: 2px solid var(--line); overflow: hidden; }
.speedbar i { display: block; height: 100%; width: 0; background: var(--bad); border-radius: 99px; transition: width .25s ease; }
.speedbar.met i { background: var(--good); }
.prompt { margin: 28px 0 0; text-align: center; color: var(--ink-soft); font-weight: 500; min-height: 1.5em; }
.problem {
  margin: 8px 0 30px; text-align: center; font-weight: 700;
  font-size: clamp(2.3rem, 11vw, 4.2rem); line-height: 1.25; font-variant-numeric: tabular-nums;
  overflow-x: auto;
}
.problem.long { font-size: clamp(1.4rem, 6vw, 2.3rem); }
.line { display: block; }
.problem .line + .line { margin-top: .25em; }
.sample .line + .line { margin-top: .2em; }
.mistakes .eq .line + .line { margin-top: .1em; }
.box { display: inline-block; min-width: 1.4em; padding: 0 .15em; border: 3px dashed var(--ink-soft); border-radius: 12px; color: var(--ink-soft); line-height: 1.2; }
.box.good { border-style: solid; border-color: var(--good); color: var(--good); background: var(--good-bg); }
.box.fix { border-style: solid; border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choices.long { grid-template-columns: 1fr; }
.choice {
  position: relative; min-height: 84px; border-radius: 18px; cursor: pointer; padding: 10px 14px 10px 30px;
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line);
  font-weight: 700; font-size: clamp(1.5rem, 6.5vw, 2.1rem); font-variant-numeric: tabular-nums; line-height: 1.2;
}
.choices.long .choice { min-height: 64px; font-size: clamp(1.05rem, 4.5vw, 1.35rem); }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.choice kbd { position: absolute; top: 8px; left: 10px; font-family: var(--f-body); font-size: .7rem; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; line-height: 1.5; }
.choice.right { background: var(--good-bg); border-color: var(--good); color: var(--good); box-shadow: 0 4px 0 var(--good); }
.choice.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); box-shadow: 0 4px 0 var(--bad); animation: shake .32s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.keyhint { margin-top: 16px; text-align: center; font-size: .78rem; color: var(--ink-soft); }

/* math pieces */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .62em; line-height: 1.1; margin: 0 .08em; }
.frac .fn { padding: 0 .15em; border-bottom: .09em solid currentColor; }
.frac .fd { padding: 0 .15em; }
.mixed { margin-right: .04em; }
.mat { display: inline-grid; vertical-align: middle; gap: 0 .5em; padding: .05em .35em; border-left: .08em solid currentColor; border-right: .08em solid currentColor; border-radius: .25em; font-size: .7em; line-height: 1.25; }
.mrow { display: contents; }
.mat.c1 { grid-template-columns: auto; }
.mat.c2 { grid-template-columns: auto auto; }
.mat.c3 { grid-template-columns: auto auto auto; }
.m-pass { fill: var(--good); }
.m-high { fill: var(--gold); }
.m-check { fill: none; stroke: var(--card); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.m-star { fill: var(--card); }
.dotgrid { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.frame { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.frame i { width: clamp(22px, 7vw, 34px); aspect-ratio: 1; border-radius: 50%; background: var(--ink); }
.frame i.empty { background: transparent; border: 2px dashed var(--line); }
.frame.small { grid-template-columns: repeat(5, auto); }

/* ---------- result ---------- */
.result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.stamp { font-family: var(--f-hand); font-size: 2.3rem; line-height: 1; color: var(--ink-soft); border: 3px solid var(--ink-soft); border-radius: 14px; padding: 8px 16px 6px; transform: rotate(-4deg); }
.stamp.pass { color: var(--good); border-color: var(--good); }
.stamp.high { color: var(--gold); border-color: var(--gold); }
.badge-big svg { width: 64px; height: 64px; }
.result-sub { margin: 16px 0 0; max-width: 58ch; }
.scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; }
.score { border: 2px dashed var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.score dt { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.score dd { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 1.8rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.score dd small { font-family: var(--f-body); font-weight: 500; font-size: .78rem; color: var(--ink-soft); display: block; }
.note { margin-top: 16px; padding: 10px 14px; border-radius: 12px; font-weight: 500; }
.note.pass { background: var(--good-bg); color: var(--good); }
.note.high { background: var(--gold-bg); color: var(--gold); }
.note.plain { background: var(--paper); }
.mistakes { margin-top: 22px; }
.mistakes h3 { font-size: 1.1rem; margin-bottom: 8px; }
.mistakes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mistakes li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 8px 12px; border-radius: 10px; background: var(--paper); font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.mistakes .eq { font-weight: 700; min-width: 0; overflow-x: auto; }
.mistakes .eq .box { border: 0; padding: 0; color: var(--good); min-width: 0; }
.mistakes .eq .frame i { width: 14px; }
.mistakes .you { font-family: var(--f-hand); font-size: 1.15rem; color: var(--bad); }

@media (max-width: 700px) {
  .modes { grid-template-columns: 1fr; }
}
/* ---------- tiers, blocks, checkpoints ---------- */
.tier-tabs { margin-top: 22px; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tier-tab { flex: 1 0 auto; min-width: 110px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); cursor: pointer; text-align: left; }
.tier-tab span { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.tier-tab small { color: var(--ink-soft); font-size: .75rem; font-variant-numeric: tabular-nums; }
.tier-tab[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.tier-tab[aria-selected="true"] small { color: var(--paper); opacity: .8; }
.tier-blurb { margin: 10px 0 0; color: var(--ink-soft); font-size: .9rem; }
.block { margin-top: 26px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 10px; }
.block-head h2 { font-size: 1.3rem; font-weight: 800; }
.levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lvl { gap: 4px; padding: 10px 11px; }
.lvl-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lvl-n { font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; line-height: 1; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.lvl.current .lvl-n { color: var(--pencil-deep); }
.lvl .title { font-size: .95rem; }
.lvl .chip { align-self: flex-start; }
.lvl.locked { background: transparent; border-style: dashed; }
.lvl.locked .title { color: var(--ink-soft); }
.chip.lock { font-weight: 500; }
.test-or { grid-column: 1 / -1; margin: 6px 0 0; font-size: .9rem; }
.pips { display: inline-flex; gap: 3px; }
.pip { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: transparent; }
.pip.on.basic { background: var(--ink-soft); border-color: var(--ink-soft); }
.pip.on.medium { background: var(--good); border-color: var(--good); }
.pip.on.hard { background: var(--blue); border-color: var(--blue); }
.pip.on.expert { background: var(--gold); border-color: var(--gold); }
.checkpoint { margin-top: 8px; width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; text-align: left; cursor: pointer;
  padding: 12px 16px; border-radius: 14px; border: 2px dashed var(--ink-soft); background: var(--card); }
.checkpoint b { display: block; font-family: var(--f-display); font-size: 1.1rem; line-height: 1.2; }
.checkpoint.current { border-style: solid; border-color: var(--pencil-deep); box-shadow: 0 4px 0 var(--pencil); }
.checkpoint.passed { border-style: solid; border-color: var(--good); }
.checkpoint:disabled { opacity: .6; cursor: not-allowed; }
.cp-side { display: flex; align-items: center; gap: 10px; }
.card-h { font-family: var(--f-display); font-size: 1.15rem; margin: 0 0 8px; }
.tips { margin-top: 18px; }
.tips ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .92rem; }
.mode-card .chip { align-self: flex-start; }
.mode-card .btn:disabled { opacity: .55; cursor: not-allowed; }
.test-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
#checkModes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
@media (max-width: 700px) { .test-row, #checkModes { grid-template-columns: 1fr; } }
.test-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--card); box-shadow: 0 3px 0 var(--line); min-width: 0; }
.test-btn b { font-family: var(--f-display); font-size: 1.1rem; }
.test-btn span { font-size: .85rem; color: var(--ink-soft); }
.test-btn.medium { border-color: var(--good); box-shadow: 0 3px 0 var(--good); }
.test-btn.hard { border-color: var(--blue); box-shadow: 0 3px 0 var(--blue); }
.test-btn.expert { border-color: var(--gold); box-shadow: 0 3px 0 var(--gold); }
.test-btn:active { transform: translateY(2px); }
.test-btn .chip { color: var(--good); }
.dots { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; }
.dots.test { grid-template-columns: repeat(25, minmax(0, 1fr)); }
.dots i { max-width: none; width: 100%; aspect-ratio: 1; border-width: 1.5px; }
.mode.basic { color: var(--ink); }
.history .table-wrap { margin-top: 4px; }

@media (max-width: 520px) {
  .modes, .meters { grid-template-columns: 1fr; }
  .score dd { font-size: 1.5rem; }
  .score { padding: 8px 10px; }
  .card, .auth-card { padding: 18px 16px; }
  .brand-name { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- column layout and working lines ---------- */
.problem.columns { font-size: clamp(2.2rem, 10vw, 3.6rem); }
.col { display: inline-grid; grid-template-columns: auto auto; column-gap: .35em; text-align: right; line-height: 1.12; vertical-align: middle; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.col-op { text-align: left; }
.col-line { grid-column: 1 / -1; border-top: .07em solid currentColor; margin: .1em 0 .12em; }
.col-ans { padding-top: .04em; }
.col-ans .box { margin-right: 0; }
.col-work { display: grid; gap: .12em; justify-items: end; padding: .05em 0; }
.problem.columns { overflow: visible; padding-inline: 4px; }
.scratch { width: auto; font: inherit; font-size: .62em; text-align: right; letter-spacing: .06em; padding: .08em .25em;
  border: 2px dashed var(--line); border-radius: 10px; background: transparent; color: var(--ink-soft); }
.scratch:focus { outline: none; border-style: solid; border-color: var(--pencil-deep); color: var(--ink); }
.scratch-blank { display: block; width: 3em; height: .5em; border-bottom: 2px dashed var(--line); }
.notebook { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--gold-bg); color: var(--ink); border-left: 4px solid var(--gold); font-weight: 500; }
.mistakes .col { font-size: .9em; }

/* ---------- who's practicing / parent area ---------- */
.notice { background: var(--gold-bg); color: var(--ink); border: 2px solid var(--gold); border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; font-weight: 500; }
.auth-card.wide-card { max-width: 620px; text-align: center; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; margin: 22px 0 8px; }
.profile { position: relative; display: grid; justify-items: center; gap: 8px; padding: 18px 10px 14px; background: var(--paper); border: 2px solid var(--line); border-radius: 18px; cursor: pointer; }
.profile:hover { border-color: var(--pencil-deep); transform: translateY(-2px); }
.avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-family: var(--f-display); font-size: 2rem; font-weight: 800; background: var(--pencil); color: var(--on-pencil); }
.avatar.small { width: 40px; height: 40px; font-size: 1.2rem; flex: none; }
.profile.c1 .avatar, .kid.c1 .avatar { background: #7FC8F8; color: #08263A; }
.profile.c2 .avatar, .kid.c2 .avatar { background: #9BE3A9; color: #0B3115; }
.profile.c3 .avatar, .kid.c3 .avatar { background: #F6A6B2; color: #3D0A12; }
.profile.add .avatar { background: transparent; border: 2px dashed var(--line); color: var(--ink-soft); }
.pname { font-weight: 600; overflow-wrap: anywhere; }
.pin-tag { position: absolute; top: 8px; right: 10px; font-size: .68rem; font-weight: 600; color: var(--ink-soft); }
.profile-foot { display: flex; justify-content: center; gap: 24px; margin-top: 16px; }
.pin-box { margin: 18px auto 0; max-width: 280px; }
.pin-box h3 { font-size: 1.3rem; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-soft); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button { min-height: 58px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; cursor: pointer; }
.pin-pad button:active { transform: translateY(2px); }
.pin-pad .pin-alt { font-family: var(--f-body); font-size: .9rem; font-weight: 500; color: var(--ink-soft); }

#manageBody h2 { font-size: 1.6rem; }
.kid-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 12px; }
.kid { display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 8px 12px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); }
.kid input:not([type=checkbox]) { min-width: 0; min-height: 42px; padding: 0 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.kid .check { grid-column: 2 / -1; }
.kid-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.kid-msg { grid-column: 2 / -1; font-size: .85rem; color: var(--good); }
.kid-msg:empty { display: none; }
.danger-link { color: var(--bad); }
.add-kid { display: grid; grid-template-columns: 1fr 140px auto; align-items: end; gap: 10px; margin-top: 6px; }
.add-kid .field { margin: 0; min-width: 0; }
.add-kid input { width: 100%; min-width: 0; }
.add-kid .btn { min-height: 46px; }
.upgrade { margin-top: 16px; padding: 18px; border-radius: 16px; background: var(--gold-bg); border: 2px solid var(--gold); }
.upgrade h3 { font-size: 1.25rem; }
.upgrade p { margin: 6px 0 10px; }
.prices { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
#manageBody .account { margin-top: 0; padding-top: 0; border-top: 0; }
#manageDone { margin-top: 16px; }
@media (max-width: 560px) {
  .kid { grid-template-columns: auto 1fr; }
  .kid .kid-pin, .kid .check, .kid-actions, .kid-msg { grid-column: 1 / -1; }
  .add-kid { grid-template-columns: 1fr 1fr; }
  .add-kid .btn { grid-column: 1 / -1; }
}

/* ---------- front page, privacy, terms ---------- */
.app.wide { max-width: 1120px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 28px 0 56px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.01em; max-width: 14ch; }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 46ch; margin: 18px 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-cta .btn { text-decoration: none; display: inline-flex; align-items: center; }
.hero-fine { margin: 14px 0 0; font-size: .9rem; color: var(--ink-soft); }

/* the try-it bridge: the same navy, gold and cream as the logo */
.demo { position: relative; background: #1B2A4A; color: #FFF4D6; border-radius: 28px; padding: 30px 26px 26px; box-shadow: 0 10px 0 #0F1A30; overflow: hidden; }
.demo-arch { display: block; width: 100%; height: 92px; margin-bottom: -6px; }
.demo-arch path { fill: none; stroke: #F4B400; stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: stroke-dasharray .4s ease-out; }
.demo-arch path.ghost { stroke: rgba(255, 244, 214, .3); stroke-width: 3; stroke-dasharray: 6 6; }
.demo-arch path.half { stroke-width: 7; }
.demo-deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span-grp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.plank { height: 46px; border-radius: 10px; border: 2px dashed rgba(255, 244, 214, .35); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; color: #1B2A4A; }
.plank.on { background: #FFF4D6; border: 2px solid #FFF4D6; animation: plank-in .35s ease-out; }
@keyframes plank-in { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.demo-water { height: 16px; margin: 10px 8% 0; background: radial-gradient(circle at 10px -4px, transparent 9px, #7FC8F8 10px, #7FC8F8 12px, transparent 13px) 0 0 / 20px 16px repeat-x; opacity: .8; }
.demo-q { font-family: var(--f-display); font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 800; text-align: center; margin: 18px 0 14px; min-height: 1.2em; }
.demo-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.demo-choices button { min-height: 62px; border-radius: 14px; border: 0; background: #FFF4D6; color: #1B2A4A; font-family: var(--f-display); font-size: 1.6rem; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 #C9B98F; }
.demo-choices button:active { transform: translateY(3px); box-shadow: 0 1px 0 #C9B98F; }
.demo-choices button.right { background: #62D394; box-shadow: 0 4px 0 #2E9A5E; }
.demo-choices button.wrong { background: #F6A6B2; box-shadow: none; opacity: .7; }
.demo-choices .btn, .demo-choices .again { grid-column: span 2; text-decoration: none; justify-content: center; display: inline-flex; align-items: center; }
.demo-choices .again { min-height: 52px; background: transparent; color: #FFF4D6; border: 2px solid rgba(255, 244, 214, .5); box-shadow: none; font-family: var(--f-body); font-size: 1rem; font-weight: 600; }
.demo-note { text-align: center; color: #C9D3E6; font-size: .92rem; margin: 14px 0 0; min-height: 1.4em; }

.band { padding: 44px 0; border-top: 2px dashed var(--line); }
.band h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 800; }
.band-lede { color: var(--ink-soft); max-width: 60ch; margin: 10px 0 24px; font-size: 1.05rem; }
.band-note { margin: 18px 0 0; font-weight: 500; }
.mode-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.ms { position: relative; border: 2px solid var(--line); background: var(--card); border-radius: 18px; padding: 22px 20px 20px; }
.ms h3 { font-size: 1.5rem; margin-bottom: 6px; }
.ms p { margin: 0; color: var(--ink-soft); }
.ms.medium { background: var(--good-bg); border-color: var(--good); }
.ms.medium h3 { color: var(--good); }
.ms.hard { background: var(--blue-bg); border-color: var(--blue); }
.ms.hard h3 { color: var(--blue); }
.ms.expert { background: var(--gold-bg); border-color: var(--gold); }
.ms.expert h3 { color: var(--gold); }
.ms + .ms::before { content: ""; position: absolute; left: -17px; top: 50%; width: 16px; height: 2px; background: var(--ink-soft); }

.path { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; position: relative; }
.path::before { content: ""; position: absolute; left: 10%; right: 10%; top: 14px; height: 6px; border-radius: 3px; background: var(--pencil); }
.path li { position: relative; padding: 40px 12px 0; text-align: center; }
.path li::before { content: ""; position: absolute; top: 4px; left: 50%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: var(--ink); border: 4px solid var(--pencil); box-sizing: border-box; }
.path b { display: block; font-family: var(--f-display); font-size: 1.25rem; }
.path span { display: block; color: var(--ink-soft); font-size: .92rem; margin-top: 4px; }

.band.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; }
.family-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.family-list li { padding-left: 30px; position: relative; color: var(--ink-soft); }
.family-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 10px; border-radius: 3px; background: var(--pencil); }
.family-list b { color: var(--ink); }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 22px; }
.plan h3 { font-size: 1.3rem; }
.plan p { margin: 4px 0; color: var(--ink-soft); }
.plan .price { font-family: var(--f-display); font-size: 1.6rem; font-weight: 800; color: var(--ink); margin: 6px 0 10px; }
.plan.featured { border-color: var(--pencil-deep); box-shadow: 0 5px 0 var(--pencil); }

.faq details { border-bottom: 2px solid var(--line); padding: 4px 0; max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; padding: 12px 0; list-style-position: outside; }
.faq details p { margin: 0 0 14px; color: var(--ink-soft); max-width: 66ch; }
.faq a, .doc a { color: inherit; text-underline-offset: 3px; }

.site-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 30px 0 10px; border-top: 2px dashed var(--line); margin-top: 20px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; }
.foot-brand img { border-radius: 7px; }
.site-foot nav { display: flex; gap: 20px; }
.site-foot nav a { color: var(--ink); text-underline-offset: 3px; }
.site-foot p { margin: 0; font-size: .88rem; }

.doc { max-width: 720px; background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 28px clamp(18px, 4vw, 40px) 36px; margin: 8px auto 0; }
.doc h1 { font-size: 2.2rem; font-weight: 800; margin-top: 10px; }
.doc h2 { font-size: 1.3rem; margin: 26px 0 6px; }
.doc p, .doc li { line-height: 1.65; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 8px; }
.doc-back { display: inline-block; color: var(--ink-soft); text-underline-offset: 3px; font-size: .92rem; margin-bottom: 6px; }
#signinBtn { text-decoration: none; display: inline-flex; align-items: center; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-bottom: 40px; }
  .mode-steps, .plans { grid-template-columns: 1fr; }
  .ms + .ms::before { display: none; }
  .band.split { grid-template-columns: 1fr; gap: 6px; }
  .path { grid-template-columns: 1fr; }
  .path::before { left: 11px; right: auto; top: 10px; bottom: 10px; width: 6px; height: auto; }
  .path li { text-align: left; padding: 0 0 18px 44px; }
  .path li::before { left: 14px; top: 0; }
}
@media (max-width: 420px) {
  .demo { padding: 22px 14px 18px; }
  .demo-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plank { height: 38px; font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) { .plank.on { animation: none; } }

/* ---------- agreement and parent account ---------- */
.agree { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 4px 0 14px; font-size: .88rem; color: var(--ink-soft); cursor: pointer; line-height: 1.45; }
.agree input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--pencil-deep); }
.agree a { color: var(--ink); text-underline-offset: 2px; }
.legal-links { display: flex; justify-content: center; gap: 22px; margin: 16px 0 0; font-size: .85rem; }
.legal-links a { color: var(--ink-soft); text-underline-offset: 3px; }
.auth-card .doc-back { margin-bottom: 12px; }
#acctLine { margin: 0 0 10px; overflow-wrap: anywhere; }
a.linkish { display: inline-block; }
.danger-card { border-color: var(--bad-bg); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; box-shadow: 0 4px 0 #8f1424; }
.doc h3 { font-size: 1.05rem; margin: 16px 0 4px; font-family: var(--f-body); font-weight: 600; }
a.btn { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
a.btn.primary { color: var(--on-pencil); }
.demo-q.done { font-size: clamp(1.5rem, 3vw, 2rem); }
.plan .price small { font-family: var(--f-body); font-size: .9rem; font-weight: 500; color: var(--ink-soft); }
.plan .price-alt { margin-top: -6px; font-size: .9rem; }

/* ---------- plan, invite, banner, streak ---------- */
#planStatus { margin: 0 0 14px; }
.period { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.period button { border: 0; background: var(--card); padding: 8px 16px; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.period button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.period small { font-weight: 500; color: var(--good); }
.period button[aria-pressed="true"] small { color: #9BE3A9; }
.plan-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.plan-opt { display: grid; gap: 2px; text-align: left; padding: 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--paper); cursor: pointer; }
.plan-opt:hover { border-color: var(--pencil-deep); }
.plan-opt b { font-family: var(--f-display); font-size: 1.25rem; }
.plan-opt span { color: var(--ink-soft); font-size: .88rem; }
.plan-opt strong { font-family: var(--f-display); font-size: 1.3rem; margin-top: 6px; }
.plan-opt[data-plan="family"] { border-color: var(--pencil-deep); box-shadow: 0 4px 0 var(--pencil); }
#portalBtn { margin-top: 4px; }
.invite-row { display: flex; gap: 8px; margin: 10px 0 4px; }
.invite-row input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); font-size: .9rem; }
.weekly { margin: 0 0 12px; }
.profile.locked { opacity: .65; }
.profile.locked .pin-tag { color: var(--gold); }
.plan-banner { margin: 0 0 14px; padding: 10px 16px; border-radius: 14px; background: var(--good-bg); color: var(--ink); font-weight: 500; }
.plan-banner.trial { background: var(--gold-bg); }
.streak { display: inline-flex; align-items: center; gap: 6px; }
.streak svg { fill: var(--line); }
.streak.on svg { fill: #F2711C; }
.place-cta { border-style: solid; border-color: var(--pencil-deep); }
.place-cta .what span { color: var(--ink-soft); font-size: .9rem; }

/* ---------- placement ---------- */
.place-card { max-width: 640px; margin: 8px auto 0; }
.place-card h1 { font-size: 2rem; font-weight: 800; }
.place-card > p { margin: 8px 0 18px; }
.grade-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 8px 0 18px; }
.grade { min-height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); font-family: var(--f-display); font-size: 1.3rem; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.grade:hover { border-color: var(--pencil-deep); }
.place-progress { height: 8px; border-radius: 4px; background: var(--line); margin: 6px 0 18px; overflow: hidden; }
.place-progress i { display: block; height: 100%; width: 0; background: var(--pencil); transition: width .3s; }
.btn.idk { display: block; margin: 16px auto 0; }
#placeDone .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
@media (max-width: 480px) { .grade-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .plan-pick { grid-template-columns: 1fr; } }

/* ---------- certificate ---------- */
.cert-tools { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.certificate { position: relative; background: #FFFDF6; color: #1B2A4A; border: 3px solid #1B2A4A; outline: 10px solid #F4B400; outline-offset: -18px; border-radius: 6px; padding: 54px 48px 40px; text-align: center; aspect-ratio: 1.414; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cert-mark { border-radius: 14px; margin-bottom: 10px; }
.cert-kicker { font-family: var(--f-display); font-size: 1.1rem; font-weight: 700; letter-spacing: .04em; margin: 0; color: #B7791F; }
.cert-small { margin: 10px 0 0; color: #5B6A86; }
.cert-name { font-family: var(--f-hand); font-weight: 400; font-size: clamp(2.6rem, 7vw, 4.2rem); margin: 4px 0 0; border-bottom: 2px solid #D3DCE9; padding: 0 30px 2px; line-height: 1.1; }
.cert-what { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 800; margin: 6px 0 0; }
.cert-detail { margin: 4px 0 0; color: #5B6A86; }
.cert-sign { display: flex; justify-content: space-between; gap: 40px; width: 100%; max-width: 560px; margin-top: 34px; }
.cert-sign div { flex: 1; display: grid; gap: 4px; }
.cert-sign i { display: block; height: 2px; background: #1B2A4A; }
.cert-sign small { color: #5B6A86; }
.cert-brand { font-family: var(--f-display); font-weight: 800; }
.cert-link { margin-top: 10px; grid-column: 1 / -1; }
@media (max-width: 560px) { .certificate { padding: 40px 20px 28px; aspect-ratio: auto; } .cert-sign { gap: 18px; } }
@media print {
  @page cert { size: landscape; margin: 10mm; }
  body { background: #fff; padding: 0; }
  .app { max-width: none; padding: 0; }
  .top, .cert-tools, #notice { display: none !important; }
  .certificate { page: cert; width: 100%; height: 180mm; aspect-ratio: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.plan .regular { font-size: .85rem; color: var(--good); font-weight: 600; min-height: 1.3em; margin: 0 0 6px; }
.plan .regular s, .plan-opt .was s { color: var(--ink-soft); font-weight: 400; }
.plan-opt .was { display: block; font-family: var(--f-body); font-size: .8rem; font-weight: 600; color: var(--good); }

/* ---------- suggestions, mixed review, bridge, stickers ---------- */
.review-tag { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--blue); background: var(--blue-bg); border-radius: 999px; padding: 2px 10px; margin-right: 6px; }
.sugs { margin-top: 12px; }
.sugs .card-h { font-size: 1rem; margin-bottom: 8px; }
.sug { display: grid; gap: 2px; width: 100%; text-align: left; padding: 12px 16px; margin-bottom: 8px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; cursor: pointer; }
.sug:hover { border-color: var(--pencil-deep); }
.sug b { font-size: 1rem; }
.sug span { color: var(--ink-soft); font-size: .88rem; }
.sug.review { border-left: 6px solid var(--bad); }
.sug.speed { border-left: 6px solid var(--blue); }
.sug.expert { border-left: 6px solid var(--gold); }
.sug.old { border-left: 6px solid var(--good); }
.tier-bridge { margin: 4px 0 18px; }
.bridge { display: block; width: 100%; height: auto; }
.br-water { fill: none; stroke: #7FC8F8; stroke-width: 3; stroke-linecap: round; opacity: .7; }
.br-pier { fill: var(--line); }
.br-arch { fill: none; stroke: var(--pencil); stroke-width: 4; stroke-linecap: round; }
.br-arch.ghost { stroke: var(--line); stroke-width: 2; stroke-dasharray: 3 3; }
.br-arch.done { stroke: var(--pencil-deep); stroke-width: 5; }
.br-plank { fill: transparent; stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 2 1.5; }
.br-plank.on { fill: var(--ink); stroke: var(--ink); stroke-dasharray: none; }
.br-plank.hi { fill: var(--pencil); stroke: var(--pencil-deep); stroke-dasharray: none; }
.br-flag line { stroke: var(--ink); stroke-width: 2; }
.br-flag path { fill: var(--good); }
.br-flag.hi path { fill: var(--pencil); }
.stickers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.sticker { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; border: 2px dashed var(--line); color: var(--ink-soft); text-align: center; font-size: .72rem; line-height: 1.2; text-decoration: none; }
.sticker svg { width: 30px; height: 30px; fill: var(--line); }
.sticker.got { border-style: solid; border-color: var(--good); background: var(--good-bg); color: var(--ink); cursor: pointer; }
.sticker.got svg { fill: var(--good); }
.sticker.hi { border-color: var(--gold); background: var(--gold-bg); }
.sticker.hi svg { fill: var(--pencil-deep); }
.bridge-note { margin: 8px 0 0; font-size: .85rem; color: var(--ink-soft); }

/* ---------- progress page ---------- */
.prog-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; }
.prog-head h1 { font-size: 2rem; font-weight: 800; }
.kid-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.kid-tabs button { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 600; cursor: pointer; }
.kid-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.prog-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0 4px; }
.prog-stats div { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; }
.prog-stats b { font-family: var(--f-display); font-size: 1.8rem; line-height: 1.1; }
.prog-stats span { color: var(--ink-soft); font-size: .82rem; }
.prog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card .small-print { margin: 0 0 8px; }
.c-svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-bar { fill: var(--blue); }
.c-hit { fill: transparent; }
.c-hit:hover + .c-bar, g:hover .c-bar { fill: var(--ink); }
.c-base { stroke: var(--line); stroke-width: 1; }
.c-ref { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.c-ref-t, .c-axis, .c-val { fill: var(--ink-soft); font-size: 9px; font-family: var(--f-body); }
.c-val { fill: var(--ink); font-weight: 600; font-size: 10px; }
.c-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--blue); stroke: var(--card); stroke-width: 2; }
.chart-empty { padding: 30px 0; text-align: center; }
.prog-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.prog-list li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.prog-table summary { cursor: pointer; font-weight: 600; }
@media (max-width: 640px) { .prog-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prog-grid { grid-template-columns: 1fr; } .stickers { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; } .sticker span { display: none; } }
.remind-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.remind-row .field { margin: 0; }
.remind-row input[type=time] { min-height: 44px; padding: 0 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }

/* ---------- front page: demo, sample report, quotes ---------- */
.band.see { align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.phone { width: min(280px, 100%); aspect-ratio: 390 / 760; border: 10px solid var(--ink); border-radius: 36px; overflow: hidden; background: var(--paper); box-shadow: 0 10px 0 rgba(27, 42, 74, .15); }
.phone video { display: block; width: 100%; height: 100%; object-fit: cover; }
.sample-report { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 20px; max-width: 460px; }
.sample-report p { margin: 6px 0; font-size: .95rem; }
.sr-flag { position: absolute; top: 12px; right: 14px; margin: 0 !important; font-size: .75rem !important; font-weight: 600; color: var(--gold); background: var(--gold-bg); border-radius: 999px; padding: 2px 10px; }
.sr-title { font-family: var(--f-display); font-weight: 800; font-size: 1.25rem !important; margin: 0 !important; }
.sr-dates { color: var(--ink-soft); margin-top: 0 !important; }
.sr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.sr-stats div { background: var(--paper); border-radius: 10px; padding: 8px 4px; text-align: center; display: grid; }
.sr-stats b { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.1; }
.sr-stats span { font-size: .72rem; color: var(--ink-soft); }
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.quote { margin: 0; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 20px; }
.quote blockquote { margin: 0 0 10px; font-size: 1.05rem; line-height: 1.55; }
.quote figcaption { color: var(--ink-soft); font-size: .88rem; font-weight: 600; }
@media (max-width: 860px) { .band.see { grid-template-columns: 1fr; } .phone { margin: 0 auto; } }

/* ---------- lessons ---------- */
.lesson-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -4px 0 16px; }
.lesson-cta .muted { font-size: .88rem; flex: 1 1 220px; }
.lesson-cta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; flex: none; }
.lesson-idea .frac, .lesson-how .frac, .worked ol .frac { font-size: .78em; }
.learn-actions { display: flex; flex-wrap: wrap; gap: 8px; }
dialog.sheet {
  width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 2px solid var(--line); border-radius: 20px;
  background: var(--card); color: var(--ink); display: none; flex-direction: column; overflow: hidden;
}
dialog.sheet[open] { display: flex; }
dialog.sheet::backdrop { background: rgba(10, 20, 40, .55); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 2px solid var(--line); }
.sheet-head h2 { margin: 2px 0 0; font-family: var(--f-display); font-size: 1.45rem; line-height: 1.2; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; padding: 6px 20px 18px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 20px; border-top: 2px solid var(--line); display: flex; justify-content: flex-end; }
.lesson-part { padding: 16px 0 6px; }
.lesson-part + .lesson-part { border-top: 2px dashed var(--line); }
.lesson-part h3 { font-family: var(--f-display); font-size: 1.25rem; margin: 0 0 6px; }
.lesson-idea { margin: 0 0 12px; line-height: 1.55; }
.lesson-how { margin: 0 0 14px; padding: 12px 14px 12px 34px; background: var(--blue-bg); border-radius: 14px; line-height: 1.5; }
.lesson-how li + li { margin-top: 4px; }
.lesson-label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin: 0 0 6px; }
.worked { border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 10px; }
.worked-q { text-align: center; font-weight: 700; font-size: 1.45rem; font-variant-numeric: tabular-nums; overflow-x: auto; padding: 4px 0 8px; }
.worked-q .line + .line { margin-top: .15em; }
.worked-q .box { border-width: 2px; }
.worked ol { margin: 0; padding-left: 22px; line-height: 1.55; font-size: .95rem; }
.worked ol li + li { margin-top: 3px; }
.worked ol li::marker { color: var(--ink-soft); font-weight: 600; }
.lesson-more { margin: 2px 0 6px; }
.lesson-end { margin: 4px 0 8px; font-size: .9rem; }
.worked-n { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.worked-p { text-align: center; color: var(--ink-soft); font-size: .92rem; margin-top: 2px; }
details.lesson-part > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.lesson-part > summary::-webkit-details-marker { display: none; }
details.lesson-part > summary::after { content: '+'; font-family: var(--f-display); font-size: 1.4rem; color: var(--ink-soft); line-height: 1; }
details.lesson-part[open] > summary::after { content: '−'; }
details.lesson-part > summary h3 { margin: 0; }
details.lesson-part[open] > summary { margin-bottom: 6px; }
details.lesson-part { padding: 12px 0; }
.col-work .col-n.work { color: var(--ink-soft); }
@media (max-width: 560px) {
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; margin: 0; }
  .sheet-head, .sheet-body, .sheet-foot { padding-left: 16px; padding-right: 16px; }
  .worked-q { font-size: 1.25rem; }
}
@media print { dialog.sheet { display: none !important; } }

/* ---------- growth: level check for visitors, classrooms, challenges, sprints ---------- */
.btn.ghost { background: transparent; box-shadow: none; }
.hero-try { margin: 10px 0 0; color: var(--ink-soft); font-size: .95rem; max-width: 46ch; }
.band.teach .btn { margin-top: 4px; }
.place-next { margin: 4px 0 16px; padding-left: 22px; display: grid; gap: 4px; }
.place-next b { margin-right: 4px; }
.lead-form { margin-top: 22px; padding-top: 18px; border-top: 2px dashed var(--line); }
.lead-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.form-error.ok { color: var(--good); }
.auth-switch { margin: 14px 0 0; text-align: center; font-size: .9rem; color: var(--ink-soft); }
.code-input { font-family: var(--f-display); font-size: 1.6rem; letter-spacing: .2em; text-transform: uppercase; text-align: center; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.name-btn { min-height: 54px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); box-shadow: 0 3px 0 var(--line); font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; cursor: pointer; padding: 6px 10px; }
.name-btn:hover { border-color: var(--pencil-deep); }

.cls-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 8px; }
.cls-head h1 { font-size: 1.9rem; font-weight: 800; margin: 0; }
.cls-head p { margin: 4px 0 0; }
.cls-head-actions { display: flex; gap: 8px; }
.cls-new { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 180px) auto; gap: 0 12px; align-items: end; }
.cls-new select, .cls-assign select, .cls-edit select { width: 100%; min-height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); padding: 0 10px; font: inherit; }
.cls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0 14px; }
.big-code { font-family: var(--f-display); font-size: 2.6rem; font-weight: 800; letter-spacing: .14em; margin: 2px 0 6px; }
.cls-code .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.cls-settings { margin-top: 10px; }
.cls-settings summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.cls-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 160px) auto; gap: 0 10px; align-items: end; margin-top: 8px; }
.cls-assign .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.roster td { vertical-align: top; }
.roster .pin-cell { font-variant-numeric: tabular-nums; letter-spacing: .08em; font-weight: 600; }
.roster .row-acts { white-space: nowrap; }
.roster .row-acts .linkish { font-size: .8rem; }
.add-students { margin-top: 14px; }
.add-students textarea { width: 100%; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 10px; font: inherit; resize: vertical; }
.seat-buy { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.seat-buy .field { width: 140px; margin: 0; }
.seat-total { margin: 0 0 10px; }
.seat-total b { font-family: var(--f-display); font-size: 1.5rem; }
.signin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.signin-card { border: 2px dashed var(--line); border-radius: 14px; padding: 14px 16px; background: var(--card); break-inside: avoid; }
.signin-card p { margin: 3px 0; font-size: .9rem; }
.signin-card .sc-name { font-family: var(--f-display); font-size: 1.4rem; font-weight: 800; margin: 4px 0 8px; }
.signin-card .sc-code { font-family: var(--f-display); letter-spacing: .1em; font-size: 1.05rem; }
.signin-card .sc-class { color: var(--ink-soft); font-size: .8rem; margin-top: 8px; }
@media print {
  .signin-cards { grid-template-columns: repeat(3, 1fr); }
  .signin-card { background: #fff; color: #1B2A4A; border-color: #999; }
}
@media (max-width: 560px) { .cls-new, .cls-edit { grid-template-columns: 1fr; } .big-code { font-size: 2.1rem; } }

.continue.assign { border-color: var(--blue); box-shadow: 0 4px 0 var(--blue); }
.continue.assign .eyebrow { color: var(--blue); }
.continue.assign.done { border-color: var(--good); box-shadow: 0 4px 0 var(--good); }
.continue .what span:not(.eyebrow) { display: block; color: var(--ink-soft); font-size: .9rem; margin-top: 2px; }
.continue.locked-next { border-color: var(--gold); box-shadow: 0 4px 0 var(--gold); background: var(--gold-bg); }
.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-top: 14px; }
.xcard { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.xcard .x-head b { display: block; font-family: var(--f-display); font-size: 1.15rem; line-height: 1.2; }
.xcard .x-head .muted { display: block; font-size: .85rem; margin-top: 2px; }
.xcard.challenge { border-color: var(--good); }
.xcard.challenge.summer { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-bg), var(--card) 60%); }
.xcard.challenge.done { background: var(--good-bg); }
.x-bar { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: .85rem; }
.x-bar b { font-variant-numeric: tabular-nums; }
.x-bar i { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--paper); border: 1.5px solid var(--line); overflow: hidden; }
.x-bar em { display: block; width: 0; height: 100%; background: var(--good); border-radius: 99px; }
.x-foot { margin: 2px 0 0; font-size: .85rem; color: var(--ink-soft); }
.xcard.sprint { border-color: var(--blue); }
.x-score { margin: 0; font-size: .9rem; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; counter-reset: b; font-size: .88rem; }
.board li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: 8px; counter-increment: b; }
.board li::before { content: counter(b); width: 1.4em; color: var(--ink-soft); font-weight: 600; }
.board li span { flex: 1; }
.board li.me { background: var(--blue-bg); font-weight: 600; }
.grade-grid.small { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; margin: 0; }
.grade-grid.small .grade { min-height: 40px; font-size: .95rem; padding: 0 2px; white-space: nowrap; }
.xcard .x-head .muted b { display: inline; font-family: inherit; font-size: inherit; color: var(--ink); }

/* Warm-up after a test-out, and the "carry on after the test" choice */
.sug.warm { border-left: 6px solid var(--gold); }
.continue.alt { border-style: dashed; box-shadow: none; margin-top: 10px; }
.continue.alt .what b { font-size: 1.05rem; }
.continue .alt-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Today's goal and the challenges at the child's level */
.xcard.goal .x-bar { margin-top: 10px; }
.xcard.goal.done { border-color: var(--good); background: var(--good-bg); }
.xcard.goal.done .x-bar em { background: var(--good); }
.xcard.chal .ch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.xcard.chal .ch-row:first-of-type { border-top: 0; padding-top: 4px; }
.xcard.chal .ch-row > div { display: grid; gap: 2px; min-width: 0; }
.xcard.chal .ch-row .muted { font-size: .88rem; }
.ch-score { font-size: .9rem; }
.stars { display: inline-flex; gap: 1px; vertical-align: -1px; }
.stars i { font-style: normal; color: var(--line); font-size: 1.05em; }
.stars i.on { color: var(--pencil); text-shadow: 0 1px 0 var(--pencil-deep); }
.result-sub .stars { font-size: 1.5rem; display: flex; justify-content: center; margin-bottom: 4px; }
.res-goal { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--good-bg); border: 2px solid var(--good); text-align: center; }
.kid-goal { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.kid-goal select { font: inherit; padding: 4px 6px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); }

/* ---------- printable worksheets ---------- */
.sheet-link { margin: 10px 0 0; font-size: .92rem; }
.sheet-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.sheet-tools label { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; }
.sheet-tools select { font: inherit; padding: 4px 6px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); }
.worksheet { margin-top: 16px; }
.ws-page { background: #fff; color: #1B2A4A; border: 2px solid var(--line); border-radius: 14px; padding: 26px 30px; margin-bottom: 18px; }
.ws-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #1B2A4A; padding-bottom: 10px; }
.ws-head b { display: block; font-family: var(--f-display); font-size: 1.3rem; line-height: 1; }
.ws-head span { font-size: .95rem; }
.ws-name { display: flex; gap: 24px; flex-wrap: wrap; margin: 16px 0 6px; font-size: .95rem; }
.ws-name span { display: inline-flex; align-items: flex-end; gap: 6px; }
.ws-name i { display: inline-block; min-width: 120px; border-bottom: 1.5px solid #1B2A4A; font-style: normal; font-weight: 600; padding: 0 4px; }
.ws-name span:last-child i { min-width: 36px; }
.ws-tip { font-size: .88rem; color: #3D4C6B; margin: 6px 0 14px; }
.ws-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin: 0; padding-left: 24px; }
.ws-list.roomy { gap: 34px 28px; }
.ws-list li { break-inside: avoid; font-size: 1.15rem; padding-left: 4px; }
.ws-list li::marker { font-weight: 700; color: #5B6A86; font-size: .9rem; }
.ws-p { display: block; font-size: .8rem; color: #5B6A86; margin-bottom: 2px; }
.ws-q { font-family: var(--f-display); font-weight: 700; }
.ws-q .box.ws-box { border-style: solid; border-color: #9AA8C2; min-width: 2.4em; min-height: 1.3em; }
.ws-line { display: inline-block; width: 4.5em; border-bottom: 1.5px solid #1B2A4A; vertical-align: -2px; }
.ws-ch { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: .95rem; }
.ws-ch b { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border: 1.5px solid #1B2A4A; border-radius: 50%; font-size: .75rem; margin-right: 2px; }
.ws-foot { margin: 20px 0 0; font-size: .75rem; color: #5B6A86; text-align: center; }
.ws-answers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 20px; padding-left: 26px; margin: 16px 0 0; font-size: 1.05rem; }
@media (max-width: 560px) { .ws-list { grid-template-columns: 1fr; } .ws-answers { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ws-page { padding: 18px 16px; } }
@media print {
  @page ws { size: portrait; margin: 12mm; }
  .sheet-tools, #sheet .btn { display: none !important; }
  .worksheet { margin: 0; }
  .ws-page { page: ws; border: 0; border-radius: 0; padding: 0; margin: 0; }
  .ws-key { break-before: page; }
  .ws-list { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Word problems */
.prompt .story { display: block; max-width: 34em; margin: 0 auto; color: var(--ink); font-size: 1.15rem; line-height: 1.45; text-align: left; font-weight: 500; }
.ws-list li.ws-story .ws-p { font-size: .92rem; color: #1B2A4A; line-height: 1.4; margin-bottom: 6px; }
.ws-list li.ws-story .ws-q { font-size: 1rem; }

/* Get the app */
.ga-lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 62ch; }
.ga-h { margin-top: 28px; }
.ga-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.ga-card { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.ga-card.here { border-color: var(--pencil-deep); box-shadow: 0 4px 0 var(--pencil-deep); margin: 18px 0 8px; }
.ga-card h3 { font-size: 1.15rem; margin: 0 0 10px; }
.ga-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.ga-btns .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.ga-btns .btn small { font-weight: 500; opacity: .7; }
.ga-steps { margin: 6px 0 8px; padding-left: 22px; display: grid; gap: 6px; }
.ga-card code { font-size: .85em; background: var(--paper); padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere; }

/* Points: home card, result line, parent settings */
.xcard.pts { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-bg), var(--card) 70%); }
.pts-top { display: flex; align-items: center; gap: 12px; }
.pts-badge { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--pencil); color: var(--on-pencil); font-size: 1.5rem; box-shadow: 0 3px 0 var(--pencil-deep); }
.xcard.pts .x-bar em { background: var(--pencil); }
.pts-reward { display: grid; gap: 4px; padding: 10px 12px; border: 2px dashed var(--line); border-radius: 12px; background: var(--card); }
.pts-reward b { font-family: var(--f-display); font-size: 1.05rem; }
.pts-reward.done { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.pts-reward .x-bar em { background: var(--good); }
.pts-how summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.pts-how ul { margin: 6px 0 0; padding-left: 18px; font-size: .85rem; display: grid; gap: 3px; }
.res-points { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--gold-bg); border: 2px solid var(--gold); text-align: center; display: grid; gap: 2px; }
.res-points[hidden] { display: none; }
.pts-plus { font-family: var(--f-display); font-size: 1.35rem; font-weight: 800; }
.kid-reward { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .9rem; }
.kid-reward .kid-pts { font-weight: 700; }
.kid-reward .kid-rw-text { flex: 1 1 200px; }
.kid-reward .ok { color: var(--good); }
@media (max-width: 560px) { .kid-reward { grid-column: 1 / -1; } }


/* Streaks, weekly goal and badges */
.xcard.goals { border-color: var(--blue); }
.gl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 32%); align-items: center; gap: 6px 14px; padding: 8px 0; border-top: 1px dashed var(--line); }
.gl-row:first-of-type { border-top: 0; }
.gl-row > div:first-child { display: grid; gap: 1px; min-width: 0; }
.gl-row .muted { font-size: .86rem; }
.gl-row .muted b { color: var(--ink); }
.gl-row .x-bar { grid-template-columns: 1fr; }
.xcard.goals .x-bar em { background: var(--blue); }
.streak-row.on > div > b:first-child::before { content: "🔥 "; }
.gl-h { margin: 8px 0 0; font-family: var(--f-display); font-size: 1rem; }
.bd-groups { list-style: none; padding: 0 !important; display: grid; gap: 10px !important; }
.bd-groups li { display: grid; gap: 4px; }
.bd-list { display: flex; flex-wrap: wrap; gap: 6px; }
.bd { font-size: .78rem; padding: 2px 9px; border-radius: 99px; border: 1.5px dashed var(--line); color: var(--ink-soft); }
.bd.on { border-style: solid; border-color: var(--pencil-deep); background: var(--gold-bg); color: var(--ink); font-weight: 600; }
.pts-bonus { font-weight: 600; }
.pts-bonus::before { content: "★ "; color: var(--pencil-deep); }
@media (max-width: 520px) { .gl-row { grid-template-columns: 1fr; } }

/* Bridge colors and decorations from the shop */
.bridge.arch-ruby .br-arch:not(.ghost) { stroke: #E0245E; }
.bridge.arch-ruby .br-plank.hi { fill: #E0245E; stroke: #E0245E; }
.bridge.arch-emerald .br-arch:not(.ghost) { stroke: #1FA463; }
.bridge.arch-emerald .br-plank.hi { fill: #1FA463; stroke: #1FA463; }
.bridge.arch-sapphire .br-arch:not(.ghost) { stroke: #2F6FE4; }
.bridge.arch-sapphire .br-plank.hi { fill: #2F6FE4; stroke: #2F6FE4; }
.bridge.arch-violet .br-arch:not(.ghost) { stroke: #8A4FE0; }
.bridge.arch-violet .br-plank.hi { fill: #8A4FE0; stroke: #8A4FE0; }
.bridge.arch-sunset .br-arch:not(.ghost) { stroke: #F2711C; }
.bridge.arch-sunset .br-plank.hi { fill: #F2711C; stroke: #F2711C; }
.bridge.arch-silver .br-arch:not(.ghost) { stroke: #9AA7B8; }
.bridge.arch-silver .br-plank.hi { fill: #9AA7B8; stroke: #9AA7B8; }
.bridge.arch-rainbow .br-arch:not(.ghost) { stroke: url(#rbw); }
.br-deco { pointer-events: none; }

/* Avatars and the shop */
.avatar.emoji { background: var(--card); border: 3px solid var(--pencil); font-size: 2.3rem; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.avatar.small.emoji { font-size: 1.4rem; border-width: 2px; }
.avatar.big { width: 84px; height: 84px; font-size: 2.6rem; flex: none; }
.avatar.big.emoji { font-size: 3rem; }
.hello h1 { display: flex; align-items: center; gap: 12px; }
.me-avatar { width: 52px; height: 52px; font-size: 1.6rem; text-decoration: none; flex: none; box-shadow: 0 3px 0 var(--pencil-deep); }
.me-avatar.emoji { font-size: 1.9rem; }
.pts-top { flex-wrap: wrap; }
.pts-top .x-head { flex: 1 1 160px; }
.pts-shop { margin-left: auto; }
.shop-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 12px; }
.shop-head h1 { font-size: 1.8rem; font-weight: 800; }
.shop-head p { margin: 4px 0 0; }
.shop-head b { color: var(--ink); }
.shop-preview { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px 12px 4px; }
.shop-tabs { display: flex; gap: 6px; margin: 16px 0 12px; flex-wrap: wrap; }
.shop-tabs button { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer; }
.shop-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.shop-item { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); cursor: pointer; text-align: center; }
.shop-item .em { font-size: 2.4rem; line-height: 1.1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.shop-item b { font-size: .95rem; }
.shop-item span:last-child { font-size: .78rem; color: var(--ink-soft); }
.shop-item.far { opacity: .6; }
.shop-item.can { border-color: var(--pencil-deep); }
.shop-item.on { border-color: var(--good); background: var(--good-bg); }
.shop-item.confirm { border-color: var(--pencil-deep); background: var(--gold-bg); box-shadow: 0 4px 0 var(--pencil-deep); }
.sw { width: 48px; height: 26px; border-radius: 26px 26px 4px 4px; border: 6px solid var(--pencil); border-bottom: 0; }
.sw.arch-ruby { border-color: #E0245E; } .sw.arch-emerald { border-color: #1FA463; } .sw.arch-sapphire { border-color: #2F6FE4; }
.sw.arch-violet { border-color: #8A4FE0; } .sw.arch-sunset { border-color: #F2711C; } .sw.arch-silver { border-color: #9AA7B8; }
.sw.arch-rainbow { border-color: transparent; background: linear-gradient(90deg, #E0245E, #F2711C, #F4B400, #1FA463, #2F6FE4) border-box; -webkit-mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; }
.speak-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; margin: 18px 0 -10px; }
.boost-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
.boost { border: 1.5px dashed var(--pencil-deep); background: var(--card); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 600; cursor: pointer; }
.boost.confirm { border-style: solid; background: var(--gold-bg); }
.bridge.arch-spooky .br-arch:not(.ghost) { stroke: url(#spk); }
.bridge.arch-frost .br-arch:not(.ghost) { stroke: url(#frost); }
.sw.arch-spooky { border-color: #FF7518 #8A4FE0 transparent #8A4FE0; }
.sw.arch-frost { border-color: #9FD8FF; }
.shop-item { position: relative; }
.shop-item .season { position: absolute; top: 6px; left: 6px; right: 6px; font-style: normal; font-size: .66rem; font-weight: 700; color: #fff; background: #8A4FE0; border-radius: 99px; padding: 1px 6px; }
.shop-item:has(.season) .em, .shop-item:has(.season) .sw { margin-top: 14px; }
.power-help { grid-column: span 2; background: var(--card); border: 2px dashed var(--line); border-radius: 16px; padding: 12px 14px; font-size: .9rem; }
.power-help p { margin: 6px 0 0; color: var(--ink-soft); }
@media (max-width: 420px) { .power-help { grid-column: 1 / -1; } }
.kid-cheer { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .9rem; }
.kid-cheer-h { font-weight: 700; }
.cheer-stickers { display: flex; flex-wrap: wrap; gap: 4px; }
.cheer-stickers label { cursor: pointer; }
.cheer-stickers input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cheer-stickers span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); font-size: 1.2rem; }
.cheer-stickers input:checked + span { border-color: var(--pencil-deep); background: var(--gold-bg); }
.cheer-stickers input:focus-visible + span { outline: 3px solid var(--pencil); }
.kid-cheer .kid-cheer-text { flex: 1 1 180px; }
@media (max-width: 560px) { .kid-cheer { grid-column: 1 / -1; } }
.continue.cheer { border-color: var(--good); box-shadow: 0 4px 0 var(--good); background: var(--good-bg); justify-content: flex-start; }
.continue.cheer .what { flex: 1 1 180px; }
.cheer-st { font-size: 2.4rem; line-height: 1; }

/* Fact fluency map (parents' progress page) */
.fact-tabs { display: flex; gap: 6px; margin: 4px 0 8px; }
.fact-tabs button { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; font-weight: 600; cursor: pointer; font-size: .85rem; }
.fact-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fact-grid { display: grid; gap: 2px; margin-top: 8px; max-width: 520px; }
.fact-grid.c13 { grid-template-columns: repeat(13, minmax(0, 1fr)); }
.fact-grid.c12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.fact-grid .fh { display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--ink-soft); aspect-ratio: 1; }
.fc { display: inline-block; aspect-ratio: 1; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); }
.fc.f-fast { background: var(--good); border-color: var(--good); }
.fc.f-ok { background: #9BE3A9; border-color: #9BE3A9; }
.fc.f-slow { background: var(--pencil); border-color: var(--pencil-deep); }
.fc.f-learn { background: var(--bad); border-color: var(--bad); }
.fact-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .78rem; color: var(--ink-soft); margin: 10px 0 0; }
.fact-key .k { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.fact-key .fc { width: 12px; }

/* About page */
.about-head { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; }
.about-mark { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 50%; background: var(--ink); color: var(--pencil); border: 3px solid var(--pencil); font-family: var(--f-display); font-size: 1.5rem; font-weight: 800; }
.about-note { margin: 14px 0 0; padding: 12px 16px; border-left: 4px solid var(--pencil); background: var(--gold-bg); border-radius: 0 12px 12px 0; font-family: var(--f-hand); font-size: 1.2rem; line-height: 1.35; }
