/* A plain, serious look of our own: ink on paper, one accent. The brand comes later. */
:root { --ink: #1c2530; --soft: #5b6673; --line: #d5dae0; --paper: #fff; --wash: #f3f5f7; --accent: #2c6a9c; --accent-ink: #fff; --right: #1d6b3a; --wrong: #a3261d; --flag: #b56a00; }
/* Figtree (Erik Kennedy, SIL Open Font Licence 1.1): plain, friendly letterforms and an ordinary zero, which matters in a maths paper. One file, served from here. */
@font-face { font-family: "Figtree"; src: url("/static/font/figtree.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
html { font-size: 17px; }
html[data-zoom="1"] { font-size: 20px; }
html[data-zoom="2"] { font-size: 23px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--wash); line-height: 1.55; }
button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 3px solid #e0a100; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1 { font-size: 1.9rem; line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .6rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 0 0 .3rem; }
a { color: var(--accent); }

/* papers list */
.page { max-width: 46rem; margin: 0 auto; padding: 2rem 1.2rem 3rem; }
/* the bar across the top of the practice, parent and privacy pages */
.site-top { max-width: 46rem; margin: 0 auto; padding: 0 1.2rem; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-top nav { display: flex; gap: 1.4rem; }
.site-top nav a { color: var(--ink); text-decoration: none; font-size: .95rem; padding: .3rem 0; border-bottom: 2px solid transparent; }
.site-top nav a:hover { border-bottom-color: var(--line); }
.site-top nav a[aria-current] { border-bottom-color: var(--accent); font-weight: 600; }
.foot-note { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.foot-note p { margin: 0 0 .3rem; }
.lead { color: var(--soft); max-width: 38rem; }
.papers { list-style: none; padding: 0; margin: .8rem 0 .6rem; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.papers .paper { border: 0; border-radius: 0; background: none; padding: .9rem 1.2rem; }
.papers .paper + .paper { border-top: 1px solid var(--line); }
.daily > .paper { padding: 1.4rem 1.4rem; border-top: 3px solid var(--accent); box-shadow: 0 10px 30px rgb(44 106 156 / .08); }
.daily > .paper h2 { font-size: 1.3rem; }
.paper { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.2rem; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .2rem 1rem; }
.paper h2 { margin: 0; }
.paper .meta { grid-column: 1; margin: 0; color: var(--soft); font-size: .92rem; }
.paper button { grid-column: 2; grid-row: 1 / span 2; }
.small { color: var(--soft); font-size: .85rem; }
.daily { margin: 2rem 0 0; }
h2.section { margin: 2.6rem 0 0; font-size: 1.2rem; }
.streak { margin: .9rem 0 .4rem; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .8rem 0 1.2rem; }
.stats div { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: .8rem 1rem; }
.stats dd { margin: 0; font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--accent); font-variant-numeric: tabular-nums; }
.stats dt { color: var(--soft); font-size: .88rem; }
.quiet { background: none; border: 0; padding: .65rem .4rem; text-decoration: underline; margin-left: auto; }
a.primary, a.plain { display: inline-block; text-decoration: none; }
.ready { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.skills { margin: 1rem 0 .4rem; }
.skills .next, .page > .next { margin: 0 0 .8rem; padding: .7rem 1rem; background: #fdf6e7; border-left: 3px solid var(--flag); border-radius: 0 6px 6px 0; }
.skills details { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; margin-bottom: .5rem; }
.skills summary { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; cursor: pointer; font-weight: 600; list-style: none; }
.skills summary::-webkit-details-marker { display: none; }
.skills summary span:first-child::before { content: "\203A"; display: inline-block; width: 1rem; color: var(--accent); transition: transform .15s; }
.skills details[open] summary span:first-child::before { transform: rotate(90deg); }
.skills summary .meta { font-weight: 400; color: var(--soft); margin: 0; }
.skills table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.skills th, .skills td { text-align: left; font-weight: 400; padding: .4rem 1rem; border-top: 1px solid var(--line); }
.skills td:last-child { text-align: right; white-space: nowrap; color: var(--soft); }
@media (prefers-reduced-motion: reduce) { .skills summary span:first-child::before { transition: none; } }
.meter { display: inline-flex; gap: 3px; vertical-align: middle; }
.meter i { width: 14px; height: 8px; border-radius: 2px; background: var(--line); }
.meter i.on { background: var(--accent); }
.chooser { grid-template-columns: 1fr; }
.chooser button { margin: .3rem .3rem 0 0; }
.child { margin: 2rem 0; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.child h2 { font-size: 1.5rem; letter-spacing: -.01em; }
.child .meta { color: var(--soft); margin: 0 0 .8rem; }
.days { list-style: none; padding: 0; margin: 0 0 .3rem; display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; max-width: 30rem; }
.day { display: block; text-align: center; padding: .3rem 0; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--soft); font-size: .8rem; text-decoration: none; }
.day.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.day.open { border-color: var(--flag); }
.day-test { display: block; margin-top: 2px; text-align: center; border: 1px solid var(--flag); border-radius: 3px; color: var(--soft); font-size: .7rem; font-weight: 600; text-decoration: none; }
.day-test.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.child h3 { margin-top: 1.4rem; }
.sat { padding-left: 1.2rem; }
.sat .meta { color: var(--soft); }
.actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.danger { color: var(--wrong); }
.add { grid-template-columns: 1fr auto; margin-top: 2rem; }
.add label { grid-column: 1 / -1; font-weight: 600; }
.add input { font: inherit; padding: .55rem .7rem; border: 1px solid var(--soft); border-radius: 6px; min-width: 0; }
.add .meta { grid-column: 1 / -1; }
.add button { grid-column: 2; grid-row: 2; }
.primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 6px; padding: .65rem 1.1rem; font-weight: 600; }
.plain { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: .65rem 1.1rem; font-weight: 600; color: var(--accent); }
.primary:hover:not(:disabled) { background: #22547d; }
.plain:hover:not(:disabled) { border-color: var(--accent); }
.primary:active:not(:disabled), .plain:active:not(:disabled) { transform: translateY(1px); }

/* the test screen: fixed bars top and bottom, the work scrolls between them */
body.test { background: var(--paper); }
#app { display: grid; grid-template-rows: auto 1fr auto; height: 100dvh; }
.bar { display: flex; align-items: stretch; background: var(--paper); border: 0 solid var(--line); min-height: 3.4rem; }
.bar.top { border-bottom-width: 1px; }
.bar.bottom { border-top-width: 1px; }
.tool { background: none; border: 0; border-right: 1px solid var(--line); padding: 0 1rem; font-size: .9rem; }
.timer { display: flex; align-items: center; border-right: 1px solid var(--line); }
.timer .tool { border-right: 0; }
a.tool.exit { display: flex; align-items: center; text-decoration: none; color: var(--accent); font-weight: 600; }
.clock { font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 600; padding-left: 1rem; user-select: none; }
.timer.low .clock { color: var(--wrong); }
.counter { background: var(--wash); border: 0; border-right: 1px solid var(--line); padding: 0 1.4rem; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: .7rem; }
.grid-icon { width: 1.1rem; height: 1.1rem; background: radial-gradient(circle, var(--accent) 38%, transparent 42%) 0 0 / 33.4% 33.4%; }
.paper-name { margin-left: auto; align-self: center; padding: 0 1rem; color: var(--soft); font-size: .9rem; }
.nav { background: var(--accent); color: var(--accent-ink); border: 0; padding: 0 2rem; font-weight: 700; font-size: 1.05rem; min-width: 9rem; }
.spacer { flex: 1; }
.flag { background: var(--wash); border: 0; border-left: 1px solid var(--line); padding: 0 1.6rem; font-weight: 600; }
.flag.on { background: #fdf0d8; color: var(--flag); }

.work { overflow: auto; padding: 1.6rem 2rem; }
.work.split { display: grid; grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1fr); padding: 0; overflow: hidden; }
.work.split > .question { overflow: auto; padding: 1.6rem 2rem; }
.work:not(.split) > .question, .summary > * { max-width: 46rem; }
.stimulus { display: grid; grid-template-rows: auto 1fr; min-height: 0; border-right: 1px solid var(--line); }
.tabs { display: flex; gap: .3rem; padding: 1rem 1.6rem 0; border-bottom: 1px solid var(--line); }
.tabs button { background: var(--wash); border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; padding: .5rem 1rem; font-weight: 600; color: var(--accent); margin-bottom: -1px; }
.tabs button.on { background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--paper); }
.stimulus-body { overflow: auto; padding: 1.2rem 1.6rem 2rem; }
.intro { font-weight: 700; }
.pane-switch { display: none; }
.collapse { align-self: center; background: var(--paper); border: 1px solid var(--line); border-left: 0; width: 1.6rem; height: 3.2rem; padding: 0; color: var(--accent); font-size: 1.3rem; margin-left: -1px; }
.work:not(.split) > .collapse { float: left; margin: 0 1rem 0 -2rem; border-left: 0; }

.prompt { margin: 0 0 .8rem; white-space: pre-wrap; }
.options { border: 0; padding: 0; margin: 1rem 0 0; display: grid; gap: .2rem; }
.option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .9rem; padding: .6rem .7rem; border-radius: 4px; cursor: pointer; }
.option:hover { background: var(--wash); }
.option input { width: 1.5rem; height: 1.5rem; accent-color: var(--accent); margin: 0; }
.option em, .answered em { font-style: normal; font-size: .85rem; font-weight: 600; }
.option.correct { background: #e7f3ea; }
.option.correct em { color: var(--right); }
.option.chosen-wrong { background: #fbeae8; }
.option.chosen-wrong em { color: var(--wrong); }
select { padding: .25rem .4rem; border: 1px solid var(--soft); border-radius: 4px; background: var(--paper); min-width: 7rem; max-width: 100%; }
.gap-text { line-height: 2.3; white-space: pre-line; }
.stimulus-body p, .why p { white-space: pre-line; } /* a poem's lines; a gapped text's reasons, one a line */
.match { padding-left: 1.3rem; display: grid; gap: .8rem; }
.match li > span:first-child { display: block; margin-bottom: .3rem; }
span.answered > * { margin-right: .45rem; }
.points { margin: 0 0 1rem; }
.writing { width: 100%; min-height: 55vh; padding: 1rem; border: 1px solid var(--soft); border-radius: 4px; line-height: 1.6; resize: vertical; }
body[data-demo] .writing { min-height: 15rem; field-sizing: content; resize: none; background: var(--wash); } /* the sample's writing is there to read, at its full length */
.why { margin-top: 1.5rem; padding: 1rem 1.2rem; background: var(--wash); border-left: 4px solid var(--accent); }
.why p { margin: 0; }
.why p.gap { margin-top: .8rem; }
.why ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.why h3 { margin: 1rem 0 0; }
.mark { font-weight: 700; font-size: .85rem; }
.mark.right { color: var(--right); }
.mark.wrong { color: var(--wrong); }
.mark.part { color: var(--flag); }

/* My words: the notebook */
.wordlist { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .8rem; }
.word { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem .6rem; }
.word h2 { font-size: 1.3rem; margin: 0 0 .3rem; }
.word .base { font-weight: 400; font-size: .9rem; color: var(--soft); }
.tag { margin-left: .6rem; padding: .1rem .5rem; border-radius: 999px; background: #e7f3ea; color: var(--right); font-size: .78rem; font-weight: 600; vertical-align: middle; }
.word p { margin: 0 0 .5rem; }
.word .meta { color: var(--soft); font-size: .95rem; }
.own { margin-top: .9rem; display: grid; grid-template-columns: 1fr auto; gap: .4rem .6rem; align-items: end; }
.own label { grid-column: 1 / -1; font-weight: 600; }
.own textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--soft); border-radius: 6px; line-height: 1.45; resize: vertical; background: var(--paper); }
.own .small { grid-column: 1 / -1; margin: 0; min-height: 1.2em; }
.comment { margin-top: .6rem; padding: .7rem 1rem; background: #fdf6e7; border-left: 3px solid var(--flag); border-radius: 0 6px 6px 0; }
.comment.good { background: #e7f3ea; border-left-color: var(--right); }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 1rem 0; }
.picks .right { background: #e7f3ea; border-color: var(--right); color: var(--right); opacity: 1; }
.picks .wrong { background: #fbeae8; border-color: var(--wrong); color: var(--wrong); opacity: 1; }
.meaning { font-size: 1.25rem; background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 1rem 1.2rem; }

.again { margin: 0 0 .8rem; padding: .6rem .9rem; background: #fdf6e7; border-left: 3px solid var(--flag); border-radius: 0 6px 6px 0; max-width: 46rem; }
.options + .again, .options + p { margin-top: 1rem; }

/* a topic's lesson */
.steps { padding-left: 1.3rem; display: grid; gap: .5rem; margin: .6rem 0 1.4rem; }
.lesson .trap { padding: .8rem 1rem; background: #fdf6e7; border-left: 3px solid var(--flag); border-radius: 0 6px 6px 0; margin: 0 0 1.6rem; }
.lesson h2.section { margin-bottom: .6rem; }
.lesson .example { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; }
.lesson .example p { white-space: pre-line; margin: 0 0 .8rem; }
.lesson .example ol { list-style: upper-alpha; padding-left: 1.6rem; margin: 0 0 1rem; display: grid; gap: .3rem; }
.lesson .example li.correct { color: var(--right); font-weight: 600; }
.skills a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
.skills a:hover { text-decoration-color: var(--accent); }

/* a tapped word and its meaning (daily practice) */
.w { cursor: pointer; border-radius: 3px; }
.w:hover { background: #eaf3fa; }
.w.on { background: var(--accent); color: var(--accent-ink); }
.word-card { position: fixed; left: 50%; bottom: 4.4rem; transform: translateX(-50%); width: min(34rem, calc(100vw - 1.5rem)); background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 6px; box-shadow: 0 14px 40px rgb(20 40 50 / .22); padding: 1rem 1.2rem .9rem; z-index: 2; }
.word-card h3 { font-size: 1.25rem; margin: 0 0 .3rem; }
.word-card .base { font-weight: 400; font-size: .9rem; color: var(--soft); }
.word-card p { margin: 0 0 .5rem; }
.word-card .eg { color: var(--soft); font-style: italic; }
.word-card .row { display: flex; justify-content: space-between; align-items: center; margin: .6rem 0 0; }
.word-card .plain { padding: .4rem .9rem; }

/* progress summary and results */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.4rem; }
.filters button { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; }
.filters button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 3.2rem); gap: .5rem; }
.cell { height: 3.2rem; border: 2px solid var(--line); border-radius: 4px; background: var(--paper); font-weight: 700; position: relative; }
.cell.answered { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cell.not-read { border-style: dashed; color: var(--soft); }
.cell.right { background: #e7f3ea; border-color: var(--right); color: var(--right); }
.cell.wrong { background: #fbeae8; border-color: var(--wrong); color: var(--wrong); }
.cell.part { background: #fdf0d8; border-color: var(--flag); color: var(--flag); }
.cell.right::before, .cell.wrong::before, .cell.part::before { position: absolute; top: 1px; right: 4px; font-size: .65rem; } /* a mark as well as a colour */
.cell.right::before { content: "\2713"; }
.cell.wrong::before { content: "\2715"; }
.cell.part::before { content: "\00BD"; }
.cell:hover { border-color: var(--ink); }
.cell.flagged::after { content: ""; position: absolute; top: -2px; right: -2px; border: .5rem solid var(--flag); border-left-color: transparent; border-bottom-color: transparent; border-radius: 0 4px 0 0; }
.confirm { margin-top: 2rem; padding: 1.2rem; border: 2px solid var(--accent); border-radius: 6px; display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.confirm p { flex-basis: 100%; margin: 0; font-weight: 600; }
.score { font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: .2rem 0 .6rem; color: var(--accent); }
.hint { color: var(--soft); }
.offline-note { display: none; position: fixed; bottom: 4rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 4px; margin: 0; }
body.offline .offline-note { display: block; }

@media (max-width: 760px) {
  /* a phone shows the text or the question, one at a time at full height, with a switch above. Both stay in the
     same cell (hidden, not removed), so each keeps its scroll place. */
  .work.split { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .work.split > .stimulus, .work.split > .question { grid-area: 2 / 1; }
  .work.split.show-q > .stimulus, .work.split.show-text > .question { visibility: hidden; }
  .pane-switch { display: flex; grid-area: 1 / 1; background: var(--wash); border-bottom: 1px solid var(--line); }
  .pane-switch button { flex: 1; min-height: 2.8rem; background: none; border: 0; border-bottom: 3px solid transparent; font-weight: 600; color: var(--soft); }
  .pane-switch button.on { background: var(--paper); color: var(--ink); border-bottom-color: var(--accent); }
  .stimulus { border-right: 0; }
  .tabs button { flex: 1; padding: .5rem .2rem; font-size: .88rem; }
  select { min-height: 2.6rem; padding: .4rem .5rem; }
  .collapse { display: none; }
  .paper-name { display: none; }
  .bar { white-space: nowrap; }
  .tool { padding: 0 .55rem; font-size: .8rem; }
  .clock { padding-left: .55rem; font-size: 1.15rem; }
  .counter { padding: 0 .6rem; font-size: .9rem; gap: .4rem; flex: 1; justify-content: center; border-right: 0; }
  .nav { min-width: 0; padding: 0 .9rem; font-size: .95rem; }
  .flag { padding: 0 .9rem; }
  .work, .work.split > .question { padding: 1.1rem 1rem; }
  .tabs { padding: .6rem 1rem 0; }
  .stimulus-body { padding: .8rem 1rem 1.2rem; }
  .daily > .paper, .add { grid-template-columns: 1fr; }
  .daily > .paper button { grid-column: 1; grid-row: auto; margin-top: .6rem; }
  .papers .paper { padding: .9rem 1rem; }
  .ready { grid-column: 1 / -1; grid-row: auto; margin-top: .6rem; justify-content: stretch; }
  .ready button { flex: 1; }
  .own { grid-template-columns: 1fr; }
  .site-top nav { gap: .9rem; }
  .site-top nav a { font-size: .88rem; }
  .stats dd { font-size: 1.35rem; }
}

.wordmark { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.prose h2 { margin-top: 2rem; }
.prose li { margin-bottom: .5rem; max-width: 40rem; }
.account { margin-top: 2rem; }
.plan .actions { margin-top: .6rem; }
.plan .small { margin-top: .5rem; }
.account a.primary { display: inline-block; text-decoration: none; margin-right: .6rem; }
