/* Groundwork: the A Level tracker's quiet "salt and pepper" look (see the A Level site report, sections 2 to 4).
   Greyscale everywhere; colour only for meaning (red / amber / green marks). Every rule uses a token. */
:root {
  /* Report token names */
  --paper: #FFFFFF; --sheet: #FFFFFF; --wash: #F4F4F4; --ink: #2B2B2B; --ink-soft: #5E5E5E;
  --rule: #D4D4D4; --mid: #B3B3B3; --accent: #2B2B2B; --accent-ink: #FFFFFF;
  --red: #B23A2E; --orange: #C2611D; --yellow: #A88300; --amber: #A86A12; --green: #2E7A4C; --blue: #2F68B0;
  /* Older names used across the site: aliases of the tokens above */
  --bg: var(--paper); --line: var(--rule); --mute: var(--mid); --ink2: var(--ink-soft); --shade: var(--wash);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;   /* the only spacing values */
  --h: 40px; --h2: 32px;                                                   /* the only control heights */
  --r: 12px; --r2: 8px; --max: 960px; --top-h: 57px;   /* height of the sticky top bar */
  --sans: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  --head: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Source Serif 4", Georgia, serif;
  /* Motion: one easing family so every movement feels related */
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-io: cubic-bezier(.4, 0, .2, 1);
  --fast: .15s; --med: .24s;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #2B2B2B; --sheet: #323232; --wash: #3A3A3A; --ink: #FFFFFF; --ink-soft: #B3B3B3;
    --rule: #4A4A4A; --mid: #6E6E6E; --accent: #FFFFFF; --accent-ink: #2B2B2B;
    --red: #F08A7E; --orange: #F2A65A; --yellow: #F2D35B; --amber: #F2BE5B; --green: #7FD19E; --blue: #8DB6EE;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #2B2B2B; --sheet: #323232; --wash: #3A3A3A; --ink: #FFFFFF; --ink-soft: #B3B3B3;
  --rule: #4A4A4A; --mid: #6E6E6E; --accent: #FFFFFF; --accent-ink: #2B2B2B;
  --red: #F08A7E; --orange: #F2A65A; --yellow: #F2D35B; --amber: #F2BE5B; --green: #7FD19E; --blue: #8DB6EE;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; margin: 0 0 var(--s3); }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.4rem); margin-bottom: var(--s4); }
h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { text-wrap: pretty; }
code { font-family: var(--mono); font-size: .85em; }
.code { font-family: var(--mono); font-size: .8rem; background: var(--wash); border: 1px solid var(--rule); border-radius: 6px;
  padding: 2px var(--s2); color: var(--ink); text-decoration: none; white-space: nowrap; transition: border-color var(--fast); }
a.code:hover { border-color: var(--ink); }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.prose { max-width: 65ch; }
.num, table td, .stat { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--ink) 18%, transparent); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0px); }
.top-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: var(--s3);
  padding-block: var(--s3); padding-left: max(var(--s4), env(safe-area-inset-left, 0px)); padding-right: max(var(--s4), env(safe-area-inset-right, 0px)); }
.logo { display: flex; align-items: center; gap: var(--s2); text-decoration: none; font: 600 22px var(--serif);
  letter-spacing: -0.01em; flex: none; }
.logo svg { width: 24px; height: 24px; transition: transform .45s cubic-bezier(.3,.7,.2,1); }
.logo:hover svg { transform: rotate(-90deg); }
/* page links: grey pills, the current page is a solid ink pill */
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; height: var(--h2); padding: 0 10px; flex: none; white-space: nowrap;
  text-decoration: none; color: var(--ink-soft); border-radius: 999px; font-size: .9rem;
  transition: background-color var(--fast), color var(--fast); }
.nav a:hover { color: var(--ink); background: var(--wash); }
.nav a.on { color: var(--accent-ink); background: var(--accent); font-weight: 500; }
.tools { display: flex; gap: var(--s2); align-items: center; flex: none; }
.icon-btn { width: var(--h2); height: var(--h2); border-radius: 50%; border: 1px solid var(--rule); background: var(--sheet);
  display: inline-grid; place-items: center; cursor: pointer; padding: 0; flex: none; transition: border-color var(--fast), transform var(--fast); }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 16px; height: 16px; transition: transform .45s cubic-bezier(.3,.7,.2,1); }
.icon-btn[data-act="theme"]:active svg { transform: rotate(-30deg) scale(.9); }
.avatar { font: 600 12px var(--sans); }
.menu { position: absolute; right: max(var(--s4), calc((100vw - var(--max)) / 2 + var(--s4))); top: calc(100% + 6px); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s1); min-width: 200px;
  box-shadow: 0 16px 40px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06); transform-origin: top right; animation: pop-in .16s var(--ease); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none;
  text-decoration: none; border-radius: var(--r2); cursor: pointer; transition: background-color var(--fast); }
.menu a:hover, .menu button:hover { background: var(--wash); }
.menu .who { padding: 8px 12px; border-bottom: 1px solid var(--rule); margin-bottom: var(--s1); }

.demo-bar { background: var(--wash); border-bottom: 1px solid var(--rule); text-align: center; font-size: .8rem;
  padding: 6px var(--s4); color: var(--ink-soft); }
.demo-bar button { border: 0; background: none; text-decoration: underline; cursor: pointer; color: var(--ink-soft); padding: 0; font-size: inherit; }

main { max-width: var(--max); margin: 0 auto; padding-block: var(--s6) 64px;
  padding-left: max(var(--s4), env(safe-area-inset-left, 0px)); padding-right: max(var(--s4), env(safe-area-inset-right, 0px));
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

/* Building blocks */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s5); margin-bottom: var(--s4); min-width: 0; }
.sheet.tight { padding: var(--s4); }
.sheet.invert { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sheet.invert .muted, .sheet.invert .eyebrow { color: color-mix(in srgb, var(--paper) 70%, var(--ink)); }
.eyebrow { font: 500 .72rem/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: var(--s2); }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: var(--s4); }
.grid > .sheet { margin-bottom: 0; }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
/* Buttons: pills, 40px or 32px tall, hairline border that darkens on hover; a small press on click */
.btn { height: var(--h); padding: 0 var(--s4); border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet);
  cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  text-decoration: none; white-space: nowrap; color: var(--ink);
  transition: border-color var(--fast), background-color var(--fast), opacity var(--fast), transform .1s var(--ease); }
.btn:hover { border-color: var(--ink); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { opacity: .88; }
.btn.sm, .btn.small { height: var(--h2); padding: 0 var(--s3); font-size: .875rem; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
/* Chips: every filter is a row of chips; the chosen one is solid ink */
.chip { height: var(--h2); padding: 0 var(--s3); border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet);
  cursor: pointer; font-size: .875rem; text-decoration: none; display: inline-flex; align-items: center; gap: var(--s1); white-space: nowrap; color: var(--ink);
  transition: border-color var(--fast), background-color var(--fast), color var(--fast), transform .1s var(--ease); }
.chip:hover { border-color: var(--ink); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tile { display: block; text-decoration: none; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r);
  padding: var(--s4); transition: border-color var(--fast), transform .1s var(--ease); }
.tile:hover { border-color: var(--ink); }
.tile:active { transform: scale(.99); }
.tile h3 { margin-bottom: var(--s1); }
.stat { font: 600 1.7rem/1.15 var(--head); letter-spacing: -0.02em; }
.meter { height: 6px; background: var(--wash); border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--rule); }
.meter > span, .meter > i { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width .6s var(--ease); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: transparent; border: 2px solid var(--rule); flex: none; }
.dot.right { background: var(--green); border-color: var(--green); } .dot.partly { background: var(--amber); border-color: var(--amber); } .dot.wrong { background: var(--red); border-color: var(--red); }
.c-right { color: var(--green); } .c-partly { color: var(--amber); } .c-wrong { color: var(--red); }
.flag { font-family: var(--mono); font-size: .7rem; border: 1px solid var(--ink-soft); color: var(--ink-soft); border-radius: 999px; padding: 1px var(--s2); }
.notice { font-size: .9rem; background: var(--wash); padding: var(--s2) var(--s3); border-radius: var(--r2); border-left: 3px solid var(--mid); }
.empty { text-align: center; color: var(--ink-soft); padding: var(--s6) var(--s4); border: 1px dashed var(--rule); border-radius: var(--r); }
input[type=text], input[type=password], input[type=date], input[type=search], input[type=number], input[type=email], input[type=time], select, textarea {
  height: var(--h); border: 1px solid var(--rule); border-radius: var(--r2); background: var(--sheet); padding: 0 var(--s3); width: 100%;
  transition: border-color var(--fast), box-shadow var(--fast); }
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
textarea { height: auto; padding: var(--s2) var(--s3); min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
label.field { display: block; margin-bottom: var(--s3); }
label.field > span { display: block; font-size: .875rem; color: var(--ink-soft); margin-bottom: var(--s1); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child > td { border-bottom: 0; }
th { font: 500 .72rem var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; }
tr.link { cursor: pointer; } tr.link td { transition: background-color var(--fast); } tr.link:hover td { background: var(--wash); }

/* Home */
.hello { font: 600 clamp(2.2rem, 1.5rem + 3vw, 3.2rem)/1.05 var(--head); letter-spacing: -0.035em; margin: 0 0 var(--s3); text-wrap: balance; }
.quote { font: italic 400 1.2rem/1.45 var(--serif); color: var(--ink-soft); margin: 0 0 var(--s6); max-width: 52ch; }

/* Questions */
.q { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s4) var(--s5); margin-bottom: var(--s3); min-width: 0; }
.q-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.q-head { flex-wrap: wrap; }
.q-head .marks { margin-left: auto; font: 500 .75rem var(--mono); color: var(--ink-soft); }
.q-part { display: flex; gap: var(--s2); margin-top: var(--s2); }
.q-part b { flex: none; width: 22px; }
/* Model answer: a shaded box with an ink rule down the left; it eases in when revealed */
.answer { background: var(--wash); border-left: 3px solid var(--ink); border-radius: 0 var(--r2) var(--r2) 0; padding: var(--s3) var(--s4);
  margin-top: var(--s3); min-width: 0; animation: rise var(--med) var(--ease); }
.marker:not([hidden]) { animation: rise var(--med) var(--ease); }
.marker { margin-top: var(--s3); }
.mark-btns { display: flex; gap: var(--s1); flex-wrap: wrap; margin: var(--s2) 0; }
/* Mark buttons: one per mark, coloured red (0) through amber to green (full) via --mc, set in app.js */
.mark-btns button { width: var(--h); height: var(--h); border-radius: var(--r2); border: 1px solid var(--rule); background: var(--sheet);
  font: 500 .95rem var(--mono); cursor: pointer; padding: 0; --mc: var(--ink);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--mc) 55%, transparent);
  transition: background-color .12s, border-color .12s, color .12s, transform .1s var(--ease); }
.mark-btns button:hover { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, var(--sheet)); }
.mark-btns button:active { transform: scale(.94); }
.mark-btns button[aria-pressed="true"] { background: var(--mc) !important; color: var(--paper); border-color: var(--mc); box-shadow: none; font-weight: 600; }
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }

/* Textbook placeholder */
.page-ph { aspect-ratio: 1000 / 1360; max-width: 520px; margin: 0 auto; border: 1px dashed var(--rule); border-radius: var(--r2);
  display: grid; place-items: center; color: var(--ink-soft); background: var(--wash); text-align: center; padding: var(--s5); }

/* Sign in */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s4); position: relative; overflow: hidden; }
/* faint squared-paper ground behind the card, drawn from tokens so it follows the theme */
.signin::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 32px 32px; opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%); }
.signin .card { position: relative; width: 100%; max-width: 380px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px;
  padding: var(--s6) var(--s5); box-shadow: 0 30px 80px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04); animation: rise .5s var(--ease); }
.signin .logo { justify-content: center; font-size: 30px; margin-bottom: var(--s2); }
.signin .logo svg { width: 32px; height: 32px; }
.signin .logo svg path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 1s .15s var(--ease-io) forwards; }
.err { color: var(--red); font-size: .85rem; min-height: 20px; margin: var(--s1) 0 var(--s2); }

/* Charts */
.chart { width: 100%; height: 180px; display: block; }
.chart text { fill: var(--ink-soft); font: 11px var(--mono); }

/* Dialogs: soft entrance and exit, blurred backdrop. Toasts: an ink pill that slides up. */
.backdrop { position: fixed; inset: 0; background: color-mix(in srgb, #000 42%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 50; padding: var(--s4); animation: fade-in .2s ease-out; }
.dialog { background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s5); width: 100%; max-width: 460px;
  max-height: 90vh; overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,.28); animation: dlg-in .24s var(--ease); }
.backdrop.out { animation: fade-out .16s ease-in forwards; pointer-events: none; }
.backdrop.out .dialog { animation: dlg-out .16s ease-in forwards; }
.toast { position: fixed; bottom: calc(var(--s5) + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: var(--s2) var(--s4); border-radius: 999px; z-index: 60; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.2);
  animation: toast-in .28s var(--ease); max-width: calc(100vw - 32px); }
.toast.out { animation: toast-out .2s ease-in forwards; }

/* Narrower screens: logo and round buttons stay on one line, page links scroll sideways underneath */
@media (max-width: 1180px) {
  :root { --top-h: 93px; }
  .top-in { flex-wrap: wrap; row-gap: var(--s2); padding-bottom: var(--s2); }
  .nav { order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); }
  .tools { margin-left: auto; }
}
@media (max-width: 640px) {
  .sheet { padding: var(--s4); }
  .q { padding: var(--s4); }
  .hide-sm { display: none; }
  main { padding-top: var(--s5); }
}
.c-amber { color: var(--amber); }

/* ---------- Past papers, question bank, timed papers ---------- */
main.wide { max-width: 1200px; }
.filters.selects select, .filters.selects input[type=search] { width: auto; min-width: 140px; height: var(--h2); font-size: 13px; }
.filters.selects input[type=search] { flex: 1; min-width: 180px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--shade);
  color: var(--ink2); text-decoration: none; white-space: nowrap; }
.tag.ok { color: var(--green); } .tag.warn { color: var(--amber); }
.c-amber { color: var(--amber); }
.linkish { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
/* Question body: the scan is the question; its typed text only appears when the scan can't load. */
.q-body { display: grid; gap: var(--s2); justify-items: start; margin-bottom: var(--s3); }
.q-body .q-text { display: none; }
.q-body.noimg .q-text { display: block; }
.q-body.noimg .q-img, .q-img-failed { display: none; }
.q-body > p, .q-text p { margin: 0 0 var(--s2); }
/* Question images are scans drawn on white, so they sit on a white "paper" card in BOTH themes:
   readable in dark mode, and they don't flash when the theme changes. */
.q-img { display: block; max-width: min(100%, 760px); height: auto; border: 1px solid var(--rule); border-radius: var(--r2); margin: 0 0 var(--s2);
  background: #fff; padding: var(--s2); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.model { line-height: 1.8; }
mark.mp { background: color-mix(in srgb, var(--green) 18%, transparent); color: inherit; border-bottom: 2px solid var(--green);
  border-radius: 2px; padding: 0 2px; transition: background .15s; }
mark.mp sup { font: 600 10px var(--sans); color: var(--green); margin-left: 2px; }
mark.mp.hl { background: color-mix(in srgb, var(--green) 40%, transparent); }
.points { font-size: 14px; }
.points ol { list-style: none; padding: 0; margin: 0; }
.hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.points li { display: flex; gap: var(--s2); padding: 6px 4px; border-radius: 6px; cursor: default; }
  .points li:hover { background: var(--sheet); }
.pt-n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: var(--paper); font: 600 11px/20px var(--mono); text-align: center; }
.choice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border: 1px solid var(--rule); border-radius: var(--r2); margin-bottom: var(--s2); cursor: pointer;
  transition: border-color var(--fast), background-color var(--fast); }
.choice:hover { border-color: var(--ink); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--shade); }
.choice.off { opacity: .5; cursor: default; }
.choice input { margin-top: 4px; }
.pdf { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.pdf-page { width: 100%; max-width: 900px; height: auto; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.exam-banner { background: var(--ink); color: var(--bg); text-align: center; padding: 8px var(--s4); font-size: 14px; display: flex; gap: var(--s3);
  align-items: center; justify-content: center; flex-wrap: wrap; }
.exam-banner .btn { height: 28px; }
.exam-bar { position: sticky; top: calc(var(--top-h) + 8px); z-index: 5; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s3) var(--s4); display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s3); align-items: center; margin-bottom: var(--s3); }
.exam-btns { justify-content: flex-end; }
.exam-time { text-align: center; }
.exam-clock { font: 700 34px var(--mono); letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.exam-clock.low { color: var(--amber); } .exam-clock.over { color: var(--red); }
.exam-meter { grid-column: 1 / -1; }
.exam-online { display: grid; grid-template-columns: 140px 1fr; gap: var(--s4); align-items: start; }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; position: sticky; top: calc(var(--top-h) + 140px); }
.qnav button { min-width: 56px; height: 32px; border: 1px solid var(--rule); border-radius: 999px; background: var(--sheet); cursor: pointer; font: 500 13px var(--mono);
  transition: background-color var(--fast), border-color var(--fast), color var(--fast); }
.qnav button:hover { border-color: var(--ink); }
.qnav button.done { border-color: var(--green); color: var(--green); }
.qnav button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.exam-q { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
.exam-answer { margin-top: var(--s3); font: 15px/1.6 var(--sans); }
.pause-cover { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; place-items: center; text-align: center; padding: var(--s4); }
.pause-cover[hidden] { display: none; }
.pause-cover .exam-clock { font-size: 56px; margin-bottom: var(--s3); }
.pause-cover .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.stack { display: flex; flex-direction: column; gap: var(--s2); }
.stack .btn { justify-content: center; }
.outcome { font: 600 18px var(--head); margin: 0 0 var(--s4); }
.timeline { height: 96px; }
.legend { display: flex; gap: var(--s4); margin-top: var(--s2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 70px; gap: var(--s2); align-items: center; font-size: 13px; }
.bar-label { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { position: relative; height: 14px; background: var(--shade); border-radius: 3px; }
.bar { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width .6s var(--ease); }
.pace { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--red); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; }
details.aq { border-top: 1px solid var(--line); padding: var(--s2) 0; }
details.aq summary { cursor: pointer; display: flex; gap: var(--s2); align-items: center; padding: 4px 0; }
.aq-mark { margin-left: auto; font-weight: 600; }
.aq-body { padding: var(--s2) 0 var(--s3); }
.their-answer { white-space: pre-wrap; background: var(--sheet); border: 1px dashed var(--line); border-radius: var(--r2); padding: var(--s3); margin-bottom: var(--s3); font-size: 14px; }
.review { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
@media (max-width: 640px) {
  .exam-bar { grid-template-columns: 1fr; text-align: center; }
  .exam-btns { justify-content: center; }
  .exam-online { grid-template-columns: 1fr; }
  .qnav { position: static; }
  .bar-row { grid-template-columns: 90px 1fr 60px; }
}
@media print { .top, .exam-banner, .demo-bar { display: none; } }

/* Papers drive */
details.folder { border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: var(--s2); background: var(--sheet); }
details.folder > summary { cursor: pointer; padding: var(--s3) var(--s4); display: flex; gap: var(--s3); align-items: center; justify-content: space-between; list-style: none; }
details.folder > summary::-webkit-details-marker { display: none; }
details.folder > summary .fname::before { content: "▸"; display: inline-block; width: 18px; color: var(--ink-soft); transition: transform var(--med) var(--ease); }
details.folder[open] > summary .fname::before { transform: rotate(90deg); }
details.folder .fname { font-weight: 600; }
details.folder.sub { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; }
details.folder.sub > summary { padding-left: var(--s6); }
details.folder.sub .table-wrap { padding: 0 var(--s4) var(--s3) var(--s6); }
table.files td { padding: 6px 8px; }
a.file { text-decoration: none; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; font-size: 13px; display: inline-block; transition: border-color var(--fast); }
a.file:hover { border-color: var(--ink); }
a.file.dl { padding: 3px 8px; margin-left: 4px; }

/* ================= Motion =================
   Page changes and the light/dark switch use the View Transitions API (Chrome, Edge, Safari), so the whole page
   changes as one picture instead of parts snapping. Other browsers get a short CSS fade. Reduced motion turns it all off. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dlg-out { to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes page-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

/* Named parts: the top bar stays put, the page content slides, and the active nav pill glides to its new link. */
.top { view-transition-name: topbar; }
main { view-transition-name: page; }
.nav a.on { view-transition-name: navpill; }
::view-transition-group(*) { animation-duration: .32s; animation-timing-function: var(--ease); }
::view-transition-group(topbar) { z-index: 3; }
::view-transition-group(navpill) { z-index: 4; }
::view-transition-old(page) { animation: page-out .12s var(--ease-io) both; }
::view-transition-new(page) { animation: page-in .3s .09s var(--ease) both; }
/* The pill itself is the group's background, so it stretches smoothly while the words cross-fade unstretched. */
::view-transition-group(navpill) { background: var(--accent); border-radius: 999px; overflow: clip; }
::view-transition-old(navpill), ::view-transition-new(navpill) { height: 100%; width: 100%; object-fit: none; animation-duration: .22s; }
/* Small in-page updates (a filter, a saved mark): just a quick cross-fade, no slide. */
html.vt-soft::view-transition-old(page) { animation: fade-out .12s ease both; }
html.vt-soft::view-transition-new(page) { animation: fade-in .18s ease both; }
/* Theme switch: everything is one picture; a circle wipes out from the button (driven in app.js). */
html.vt-theme .top, html.vt-theme main, html.vt-theme .nav a.on { view-transition-name: none; }
html.vt-flat main { view-transition-name: none; }
html.vt-flat::view-transition-old(root) { animation: fade-out .14s ease both; }
html.vt-flat::view-transition-new(root) { animation: fade-in .26s .04s ease both; }
html.vt-theme::view-transition-old(root), html.vt-theme::view-transition-new(root) { mix-blend-mode: normal; }
html.vt-theme::view-transition-old(root) { animation: fade-out .5s var(--ease-io) both; }
html.vt-theme::view-transition-new(root) { animation: fade-in .5s var(--ease-io) both; }

/* Fallback when view transitions aren't available */
main.enter { animation: rise .3s var(--ease); }
html.theme-fading, html.theme-fading *, html.theme-fading *::before, html.theme-fading *::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease, stroke .35s ease, box-shadow .35s ease !important; }

/* <details> open and close smoothly where the browser supports it */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  details::details-content { block-size: 0; overflow: clip; transition: block-size .26s var(--ease), content-visibility .26s allow-discrete; }
  details[open]::details-content { block-size: auto; }
}
summary { transition: color var(--fast); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .signin .logo svg path { stroke-dashoffset: 0; }
}

/* ================= Groundwork layout (A Level tracker report) =================
   Slim top bar, subject rail on the left, to-do panel on the right, the page in between. */
.top-in { max-width: 1440px; }
.layout { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
.layout.has-todo { grid-template-columns: 64px minmax(0, 1fr) 300px; }
.layout.is-focus { display: block; }
.layout > main { width: 100%; }
.rail { position: sticky; top: var(--top-h); display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s6) 0 var(--s4); z-index: 5; }
.rail-i { position: relative; }
.rail-b { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-soft);
  transition: border-color var(--fast), color var(--fast), background-color var(--fast), transform var(--fast); }
.rail-b svg { width: 22px; height: 22px; }
.rail-b:hover, .rail-i:focus-within .rail-b { border-color: var(--ink); color: var(--ink); }
.rail-i.on .rail-b { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.rail-pop { position: absolute; left: calc(100% + 8px); top: 0; min-width: 200px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r);
  padding: var(--s1); box-shadow: 0 16px 40px rgba(0,0,0,.14); opacity: 0; visibility: hidden; transform: translateX(-4px);
  transition: opacity var(--fast), transform var(--fast), visibility 0s linear var(--fast); }
.rail-i:hover .rail-pop, .rail-i:focus-within .rail-pop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.rail-pop::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px; }
.rail-pop b { display: block; padding: 8px 12px 4px; font-family: var(--head); }
.rail-pop a { display: block; padding: 8px 12px; border-radius: var(--r2); text-decoration: none; font-size: .9rem; }
.rail-pop a:hover { background: var(--wash); }

.todo { position: sticky; top: calc(var(--top-h) + var(--s4)); margin: var(--s6) var(--s4) var(--s4) 0; max-height: calc(100vh - var(--top-h) - 48px); overflow: auto;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s4); scrollbar-width: thin; }
.td-top { margin-bottom: var(--s3); }
.td-ic { font-family: var(--mono); }
.seg { display: flex; gap: 2px; background: var(--wash); border-radius: 999px; padding: 3px; margin-bottom: var(--s3); }
.seg > * { flex: 1; height: 28px; border: 0; background: none; border-radius: 999px; font-size: .82rem; color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; text-decoration: none; white-space: nowrap; transition: background-color var(--fast), color var(--fast); }
.seg > [aria-selected="true"] { background: var(--sheet); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.wide { max-width: 420px; margin-bottom: var(--s4); }
.badge { font: 600 10px/16px var(--mono); min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--ink); color: var(--paper); }
.td-h { margin: var(--s3) 0 var(--s2); }
.td-note { background: var(--wash); border-radius: var(--r2); padding: var(--s2) var(--s3); margin-bottom: var(--s2); }
.td-item { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s2); border-radius: var(--r2); text-decoration: none; color: inherit; transition: background-color var(--fast); }
a.td-item:hover { background: var(--wash); }
.td-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.td-c { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--mid); flex: none; margin-top: 2px; background: none; padding: 0; cursor: pointer; }
.td-c.half { background: linear-gradient(90deg, var(--ink-soft) 50%, transparent 50%); border-color: var(--ink-soft); }
.td-c.on { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--sheet); }
.td-item:has(.td-c.on) .td-b { text-decoration: line-through; color: var(--ink-soft); }
.td-x { border: 0; background: none; color: var(--mid); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.td-x:hover { color: var(--red); }
.td-item.idea { border: 1px solid var(--rule); margin-bottom: var(--s2); }
.todo-btn { display: none; }

.search-btn { height: var(--h2); border: 1px solid var(--rule); background: var(--sheet); border-radius: 999px; padding: 0 6px 0 10px; display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-soft); cursor: pointer; font-size: .85rem; transition: border-color var(--fast); }
.search-btn:hover { border-color: var(--ink); }
.search-btn svg { width: 14px; height: 14px; }
kbd { font: 500 10px/1 var(--mono); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; background: var(--wash); color: var(--ink-soft); }

@media (max-width: 1280px) {
  .layout.has-todo { grid-template-columns: 64px minmax(0, 1fr); }
  .todo-btn { display: inline-grid; }
  .todo { position: fixed; right: var(--s4); top: calc(var(--top-h) + var(--s2)); margin: 0; width: min(340px, calc(100vw - 32px)); z-index: 30;
    box-shadow: 0 20px 50px rgba(0,0,0,.2); opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity var(--med) var(--ease), transform var(--med) var(--ease), visibility 0s linear var(--med); }
  html.todo-open .todo { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  html.todo-open .todo-btn { background: var(--ink); color: var(--paper); }
}
@media (max-width: 760px) {
  .layout, .layout.has-todo { display: block; }
  .rail { position: static; flex-direction: row; justify-content: flex-start; padding: var(--s4) var(--s4) 0; }
  .rail-b { width: 40px; height: 40px; }
  .rail-pop { left: 0; top: calc(100% + 6px); }
  .rail-pop::before { left: 0; right: 0; top: -8px; height: 8px; width: auto; bottom: auto; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: var(--h2); padding: 0; justify-content: center; }
}

/* ---------- Home ---------- */
.hello-row { align-items: flex-end; }
.home-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--s4); margin-bottom: var(--s4); }
.home-top > .sheet { margin: 0; }
@media (max-width: 980px) { .home-top { grid-template-columns: 1fr; } }
.cd .btn.ghost { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 35%, transparent); }
.cd .btn.ghost:hover { border-color: var(--paper); }
.flip { display: flex; align-items: flex-start; gap: 6px; margin-top: var(--s4); flex-wrap: wrap; }
.flip > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.flip > b { font: 600 2rem/56px var(--head); opacity: .5; }
.flip span:not(.fd) { font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.fds { display: flex; gap: 3px; }
.fd { display: inline-grid; place-items: center; width: 38px; height: 56px; border-radius: 8px; font: 600 2rem/1 var(--mono);
  background: color-mix(in srgb, var(--paper) 12%, var(--ink)); color: var(--paper); position: relative; overflow: hidden; }
.fd::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: color-mix(in srgb, var(--ink) 70%, transparent); }
.fd.flip-in { animation: flip-in .45s var(--ease); }
@keyframes flip-in { from { transform: rotateX(80deg); opacity: .3; } to { transform: none; opacity: 1; } }
@media (max-width: 520px) { .fd { width: 28px; height: 44px; font-size: 1.5rem; } .flip > b { line-height: 44px; font-size: 1.5rem; } }
.cstrip { display: grid; grid-template-rows: repeat(7, 10px); grid-auto-flow: column; grid-auto-columns: 10px; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.cs { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--paper) 18%, var(--ink)); flex: none; }
.cs.past { opacity: 0; }
.cs.now { background: var(--paper); box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 3px var(--paper); }
.dialog .cs.ex, .cs.ex { box-shadow: none; }
.cd-list { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: var(--s3); font-size: .85rem; }
.cd-row { display: flex; align-items: center; gap: var(--s2); }
.cd-row .muted { margin-left: auto; }
.streak-card .big-streak { font: 600 3rem/1 var(--head); letter-spacing: -0.03em; display: flex; align-items: baseline; gap: 6px; }
.big-streak svg { width: 26px; height: 26px; align-self: center; color: var(--orange); }
.big-streak span { font: 500 .9rem var(--sans); color: var(--ink-soft); letter-spacing: 0; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--rule); font-size: .78rem; white-space: nowrap; }
.pill.red { color: var(--red); border-color: currentColor; } .pill.amber { color: var(--amber); border-color: currentColor; }
.pill.got { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fc-row { padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.fc-row:last-child { border: 0; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); display: inline-block; }
.sdot[data-subj="maths"] { background: var(--blue); } .sdot[data-subj="physics"] { background: var(--orange); } .sdot[data-subj="chemistry"] { background: var(--green); }
.sbadge { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--ink); color: var(--paper); font: 600 13px var(--head); }
.rag-meter { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: var(--s3) 0 var(--s2); background: var(--wash); gap: 2px; }
.rag-meter.big { height: 12px; }
.rag-meter i { display: block; min-width: 0; }
.tiles3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.subj-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
#bp-qotd .inner { border-top: 1px solid var(--rule); padding-top: var(--s4); }
#bp-qotd .answer:not([hidden]) { margin-top: var(--s3); }
.rn-row { display: grid; grid-template-columns: 20px 12px minmax(0, 1fr) auto auto; gap: var(--s3); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.rn-row:last-child { border: 0; }
.rn-i { font: 500 12px var(--mono); color: var(--ink-soft); }
@media (max-width: 640px) { .rn-row { grid-template-columns: 12px minmax(0, 1fr) auto; } .rn-i, .rn-row > .small { display: none; } }
.sq { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; background: var(--wash); border: 1px solid var(--rule); }
.sq.b-weak { background: var(--red); border-color: var(--red); } .sq.b-shaky { background: var(--amber); border-color: var(--amber); }
.sq.b-there { background: var(--blue); border-color: var(--blue); } .sq.b-strong { background: var(--green); border-color: var(--green); }

/* heatmap */
.hm { display: grid; grid-template-columns: 28px auto; grid-template-rows: auto auto; gap: 4px 6px; font: 500 10px var(--mono); color: var(--ink-soft); width: max-content; }
.hm-months { grid-column: 2; display: grid; grid-template-columns: repeat(var(--weeks), 11px); gap: 3px; height: 12px; }
.hm-months span { white-space: nowrap; overflow: visible; }
.hm-days { grid-row: 2; display: grid; grid-template-rows: repeat(7, 11px); gap: 3px; line-height: 11px; }
.hm-grid { grid-row: 2; grid-column: 2; display: grid; grid-template-rows: repeat(7, 11px); grid-template-columns: repeat(var(--weeks), 11px); gap: 3px; }
.hm.mini { grid-template-columns: auto; } .hm.mini .hm-days { display: none; } .hm.mini .hm-months, .hm.mini .hm-grid { grid-column: 1; }
.hm-c { width: 11px; height: 11px; border-radius: 2px; border: 0; padding: 0; background: var(--wash); display: inline-block; cursor: pointer; }
.hm-c:disabled { opacity: .35; cursor: default; }
.hm-c.l1 { background: color-mix(in srgb, var(--green) 30%, var(--wash)); } .hm-c.l2 { background: color-mix(in srgb, var(--green) 55%, var(--wash)); }
.hm-c.l3 { background: color-mix(in srgb, var(--green) 80%, var(--wash)); } .hm-c.l4 { background: var(--green); }
.hm-c.frz { background: color-mix(in srgb, var(--blue) 45%, var(--wash)); }
.hm-c.today { box-shadow: 0 0 0 1.5px var(--ink); }
.hm-c:not(:disabled):hover { box-shadow: 0 0 0 1.5px var(--ink-soft); }

/* ---------- Sessions (focus mode) ---------- */
.filter-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: var(--s3); align-items: center; margin-bottom: var(--s2); }
@media (max-width: 640px) { .filter-row { grid-template-columns: 1fr; gap: 4px; } }
.sbar { position: sticky; top: calc(var(--top-h) + var(--s2)); z-index: 4; display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s2) var(--s4); align-items: center;
  background: color-mix(in srgb, var(--sheet) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sclock { font: 600 1.6rem/1 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .sbar { grid-template-columns: 1fr auto; } .sbar > .row { grid-column: 1 / -1; justify-content: flex-start !important; } }
.navgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.ng { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--rule); background: var(--sheet); font: 500 13px var(--mono); cursor: pointer; position: relative; }
.ng.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ng.right { background: color-mix(in srgb, var(--green) 22%, var(--sheet)); } .ng.partly { background: color-mix(in srgb, var(--amber) 22%, var(--sheet)); } .ng.wrong { background: color-mix(in srgb, var(--red) 20%, var(--sheet)); }
.ng.flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.markbox { margin-top: var(--s4); }
.mk-score { font: 600 1.4rem var(--mono); }
.empty-pause { text-align: center; padding: 64px var(--s4); }
.keys { margin-top: var(--s4); }
html.focus .top .nav { opacity: .35; pointer-events: none; transition: opacity var(--med); }
html.focus main { max-width: 860px; }

/* ---------- Flashcards ---------- */
.deck-row { padding: var(--s3) 0; border-bottom: 1px solid var(--rule); gap: var(--s3); }
.deck-row:last-child { border: 0; }
.fcard { background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; min-height: 280px; padding: var(--s6); margin: var(--s4) 0; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: var(--s4); box-shadow: 0 10px 30px rgba(0,0,0,.06);
  transition: transform .35s var(--ease), border-color var(--fast); }
.fcard:hover { border-color: var(--ink-soft); }
.fcard.flipped { cursor: default; animation: card-flip .4s var(--ease); }
@keyframes card-flip { from { transform: rotateY(25deg) scale(.98); opacity: .6; } to { transform: none; opacity: 1; } }
.fc-front { font: 500 1.35rem/1.4 var(--head); max-width: 38ch; }
.fc-back { border-top: 1px solid var(--rule); padding-top: var(--s4); width: 100%; max-width: 52ch; font-size: 1.05rem; }
.grade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.btn.grade { height: auto; flex-direction: column; padding: var(--s3) var(--s2); border-radius: var(--r); gap: 2px; }
.btn.grade.g1 { border-color: color-mix(in srgb, var(--red) 55%, var(--rule)); } .btn.grade.g2 { border-color: color-mix(in srgb, var(--amber) 55%, var(--rule)); }
.btn.grade.g3 { border-color: color-mix(in srgb, var(--green) 55%, var(--rule)); } .btn.grade.g4 { border-color: color-mix(in srgb, var(--blue) 55%, var(--rule)); }
@media (max-width: 520px) { .grade-row { grid-template-columns: repeat(2, 1fr); } }
.cbars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.cbars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font: 500 10px var(--mono); color: var(--ink-soft); }
.cbars i { display: block; width: 100%; background: var(--ink); border-radius: 3px 3px 0 0; min-height: 2px; }

/* ---------- Past papers (one tree) ---------- */
.sec-h { margin: var(--s6) 0 var(--s3); }
.pfolder { border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); margin-bottom: var(--s2); }
.pfolder > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); cursor: pointer; }
.pfolder > summary::-webkit-details-marker { display: none; }
.pfolder > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-soft); border-bottom: 1.5px solid var(--ink-soft); transform: rotate(-45deg); transition: transform var(--fast); flex: none; }
.pfolder[open] > summary::before { transform: rotate(45deg); }
.pfolder > summary .fname { flex: 1; font-weight: 500; }
.pfolder.sub { margin: 0 var(--s3) var(--s2); border-color: var(--wash); background: var(--paper); }
.pfolder.sub > summary { padding: var(--s2) var(--s3); }
.sittings { padding: 0 var(--s3) var(--s2); }
.sitting { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--wash); flex-wrap: wrap; }
.sit-t { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.sit-t:hover b { text-decoration: underline; }
.fchip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--rule); font: 500 11px var(--mono); text-decoration: none; transition: border-color var(--fast), background-color var(--fast); }
.fchip:hover { border-color: var(--ink); background: var(--wash); }
.pbars { display: flex; align-items: flex-end; gap: 4px; height: 36px; margin: var(--s2) 0; }
.pbars i { width: 18px; background: var(--ink); border-radius: 3px 3px 0 0; }
.pbars i.nil { height: 4px; background: var(--wash); }
.tabs { display: flex; gap: var(--s2); flex-wrap: wrap; margin: 0 0 var(--s4); }
.tabs a { height: var(--h2); display: inline-flex; align-items: center; padding: 0 var(--s3); border-radius: 999px; border: 1px solid var(--rule); text-decoration: none; font-size: .875rem; }
.tabs a:hover { border-color: var(--ink); }
details.topic > summary { list-style: none; cursor: pointer; gap: var(--s3); flex-wrap: wrap; }
details.topic > summary::-webkit-details-marker { display: none; }
details.topic[open] > summary { margin-bottom: var(--s3); }

/* ---------- Search and tour ---------- */
.search-wrap { align-items: flex-start; padding-top: 12vh; }
.search-dlg { max-width: 600px; padding: 0; overflow: hidden; }
.search-in { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); }
.search-in svg { width: 18px; height: 18px; color: var(--ink-soft); flex: none; }
.search-in input { border: 0; background: none; height: 36px; flex: 1; font-size: 1rem; outline: none; box-shadow: none; padding: 0; }
.search-res { max-height: 56vh; overflow: auto; padding: var(--s1); }
.sr { display: flex; justify-content: space-between; gap: var(--s3); padding: 10px 12px; border-radius: var(--r2); text-decoration: none; }
.sr > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr > span:last-child { flex: none; }
.sr.on, .sr:hover { background: var(--wash); }
.tour { position: fixed; inset: 0; z-index: 60; opacity: 0; transition: opacity .3s; }
.tour.on { opacity: 1; }
.tv { position: fixed; background: color-mix(in srgb, #000 55%, transparent); transition: all .35s var(--ease); }
.tour-ring { position: fixed; border: 2px solid #fff; pointer-events: none; transition: all .35s var(--ease); box-shadow: 0 0 0 4px color-mix(in srgb, #fff 25%, transparent); }
.tour-card { position: fixed; width: min(360px, calc(100vw - 32px)); background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s5);
  box-shadow: 0 20px 50px rgba(0,0,0,.3); transition: left .35s var(--ease), top .35s var(--ease); }
.tour-card h3 { margin: 0 0 var(--s2); }
.tour-logo svg { width: 36px; height: 36px; margin-bottom: var(--s2); }
@media (prefers-reduced-motion: reduce) { .tv, .tour-ring, .tour-card, .fd.flip-in, .fcard.flipped { transition: none; animation: none; } }

/* ---------- 18 Nov additions: homework reminder, data sheet, print ---------- */
.hw-banner { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); margin-bottom: var(--s4); border-radius: var(--r);
  background: var(--ink); color: var(--paper); text-decoration: none; transition: opacity var(--fast); }
.hw-banner:hover { opacity: .9; }
.hw-banner span { font-size: .875rem; opacity: .8; }
.pt-wrap { overflow-x: auto; padding-bottom: var(--s2); }
.pt-groups, .pt { display: grid; grid-template-columns: repeat(18, minmax(38px, 1fr)); gap: 3px; min-width: 720px; }
.pt-groups { font: 500 11px var(--mono); color: var(--ink-soft); text-align: center; margin-bottom: 4px; }
.pt { grid-template-rows: repeat(6, 52px); }
.pt-el { border: 1px solid var(--rule); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; background: var(--sheet); }
.pt-el b { font: 600 15px var(--head); }
.pt-ar, .pt-z { font: 500 9px var(--mono); color: var(--ink-soft); }
.pt-tm { border: 1px dashed var(--rule); border-radius: 6px; display: grid; place-items: center; font: 500 10px var(--mono); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em; pointer-events: none; }
.pt-tm span { align-self: end; justify-self: start; margin: 0 0 8px 10px; }
@media print {
  .rail, .todo, .search-btn, .todo-btn, .hw-banner, .toast, [data-act="bp-print"] { display: none !important; }
  .layout, .layout.has-todo { display: block; }
  .sheet { break-inside: avoid; }
}

/* ---------- Lessons and money, announcements, sign-off ---------- */
.x-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 560px) { .x-cols3 { grid-template-columns: 1fr; } }
.dialog:has(.topic-pick) { max-width: 620px; }
.topic-pick { border: 1px solid var(--rule); border-radius: var(--r2); margin-bottom: 6px; }
.topic-pick > summary { cursor: pointer; padding: 8px 12px; list-style: none; }
.topic-pick > summary::-webkit-details-marker { display: none; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; padding: 4px 12px 10px; }
.topic-grid label { display: flex; gap: 6px; align-items: flex-start; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { font: 500 11px var(--mono); color: var(--ink-soft); text-align: center; padding-bottom: 4px; }
.cal-d { min-height: 84px; border: 1px solid var(--rule); border-radius: var(--r2); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d.today { border-color: var(--ink); }
.cal-n { font: 500 11px var(--mono); color: var(--ink-soft); }
.cal-l { border: 0; border-radius: 4px; font-size: 11px; padding: 2px 4px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink);
  background: color-mix(in srgb, var(--green) 22%, var(--sheet)); }
.cal-l.st-missed, .cal-l.st-cancelled_late { background: color-mix(in srgb, var(--red) 22%, var(--sheet)); }
.cal-l.st-cancelled, .cal-l.st-cancelled_tutor, .cal-l.st-rescheduled { background: var(--wash); color: var(--ink-soft); text-decoration: line-through; }
.cal-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--green) 40%, var(--sheet)); }
.cal-key.st-missed { background: color-mix(in srgb, var(--red) 40%, var(--sheet)); } .cal-key.st-cancelled { background: var(--wash); border: 1px solid var(--rule); }
@media (max-width: 640px) { .cal-d { min-height: 56px; } .cal-l { font-size: 9px; } }
.statement .logo-s { font: 600 20px var(--serif); }
.notice-card { border-left: 3px solid var(--ink); }
@media print {
  .no-print, .top, .demo-bar { display: none !important; }
  .statement { border: 0; padding: 0; }
}

/* ---------- Tutor workflow (timetable, reminders, prep, question sets, resources) and the tour ---------- */
.tt { display: grid; grid-template-columns: 48px repeat(7, minmax(0, 1fr)); gap: 4px; overflow-x: auto; }
.tt-times { position: relative; height: var(--h); margin-top: 28px; font: 500 10px var(--mono); color: var(--ink-soft); }
.tt-times span { position: absolute; left: 0; transform: translateY(-50%); }
.tt-day { min-width: 84px; }
.tt-h { font: 500 12px var(--mono); text-align: center; height: 24px; margin-bottom: 4px; }
.tt-day.today .tt-h { color: var(--ink); font-weight: 700; }
.tt-col { position: relative; height: var(--h); border-radius: var(--r2); background: repeating-linear-gradient(var(--sheet) 0 53px, var(--wash) 53px 54px); border: 1px solid var(--rule); }
.tt-day.today .tt-col { border-color: var(--ink); }
.tt-l { position: absolute; left: 3px; right: 3px; border: 0; border-radius: 6px; padding: 3px 6px; text-align: left; cursor: pointer; display: flex; flex-direction: column; overflow: hidden; font-size: 11px; line-height: 1.25;
  background: color-mix(in srgb, var(--green) 22%, var(--sheet)); color: var(--ink); }
.tt-l span { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-l.st-scheduled { background: var(--sheet); border: 1.5px dashed var(--ink-soft); }
.tt-l.st-missed, .tt-l.st-cancelled_late { background: color-mix(in srgb, var(--red) 22%, var(--sheet)); }
.tt-l.st-cancelled, .tt-l.st-cancelled_tutor, .tt-l.st-rescheduled { background: var(--wash); text-decoration: line-through; }
.cal-l.st-scheduled { background: var(--sheet); border: 1px dashed var(--ink-soft); }
.rem { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.rem:last-child { border: 0; }
@media (max-width: 640px) { .rem { grid-template-columns: 1fr; gap: 4px; } }
.qs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s4); align-items: start; }
@media (max-width: 900px) { .qs-layout { grid-template-columns: 1fr; } }
.qs-basket { position: sticky; top: calc(var(--top-h) + var(--s4)); }
.qs-row { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.qs-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qs-b { padding: 4px 0; border-bottom: 1px solid var(--wash); }
.res-row { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.res-row:last-child { border: 0; }
.res-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.vs-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 6px 0; }
.vs-bar { position: relative; height: 10px; background: var(--wash); border-radius: 5px; overflow: hidden; }
.vs-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.vs-bar i.then { background: var(--mid); opacity: .55; } .vs-bar i.now { background: var(--ink); height: 4px; top: 3px; }
.next-step { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.next-step .btn.ghost { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.next-step .btn.ghost:hover { border-color: var(--paper); }
.prep .eyebrow { margin-bottom: 4px; }
.tour-card.busy { opacity: .6; }
.tour-card { transition: left .3s var(--ease), top .3s var(--ease), opacity .2s; }
.tour-ring { border-radius: 12px; }
.tour-dots { width: 90px; height: 4px; background: var(--wash); border-radius: 2px; overflow: hidden; }
.tour-dots i { display: block; height: 100%; background: var(--ink); transition: width .3s var(--ease); }
.qs-t .code, .res-t .code { align-self: flex-start; }

/* ---------- Walkthrough v3: one spotlight that glides; closes to a full dim between pages ---------- */
.tour-catch { position: fixed; inset: 0; }
.tour .tour-ring { position: fixed; border: 0; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(255,255,255,.18), 0 0 0 200vmax rgba(0,0,0,.55);
  transition: left .45s var(--ease), top .45s var(--ease), width .45s var(--ease), height .45s var(--ease), box-shadow .3s var(--ease), border-radius .45s; }
.tour .tour-ring.closed { box-shadow: 0 0 0 0 rgba(255,255,255,0), 0 0 0 0 rgba(255,255,255,0), 0 0 0 200vmax rgba(0,0,0,.55); border-radius: 50%; }
.tour .tour-ring.snap { transition: none; }
.tour .tour-card { transition: opacity .24s var(--ease), transform .24s var(--ease); z-index: 1; }
.tour .tour-card.out { opacity: 0; transform: translateY(6px) scale(.985); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .tour .tour-ring, .tour .tour-card { transition: none; } }

/* ---------- Report builder and the report document (always on white, like a printed page) ---------- */
.rb-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: var(--s4); align-items: start; margin-top: var(--s4); }
@media (max-width: 1000px) { .rb-layout { grid-template-columns: 1fr; } }
.rb-form { position: sticky; top: calc(var(--top-h) + var(--s4)); max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; }
@media (max-width: 1000px) { .rb-form { position: static; max-height: none; } }
.rb-secs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-bottom: var(--s3); }
.btn.ghost-danger { background: transparent; color: var(--red); border-color: transparent; }
.rdoc { --ink: #2B2B2B; --ink-soft: #5E5E5E; --rule: #D4D4D4; --wash: #F4F4F4; --sheet: #FFFFFF; --paper: #FFFFFF; --mid: #B3B3B3; --green: #2E7A4C; --red: #B23A2E; --amber: #A86A12;
  background: #fff; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r); padding: 36px 40px; font-size: 14px; line-height: 1.55; }
.rdoc h1 { font: 700 32px/1.1 var(--head); letter-spacing: -.02em; margin: 6px 0 4px; color: var(--ink); }
.rdoc h2 { font: 600 15px var(--head); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); color: var(--ink); }
.rdoc h3 { font: 600 13px var(--sans); margin: 0 0 6px; color: var(--ink); }
.rdoc section { margin-top: 26px; break-inside: avoid; page-break-inside: avoid; }
.rdoc p { margin: 0 0 8px; }
.rdoc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rdoc th { text-align: left; font: 500 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.rdoc td { padding: 7px 8px; border-bottom: 1px solid var(--wash); vertical-align: top; color: var(--ink); }
.rd-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.rd-eyebrow { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.rd-sub, .rd-m { color: var(--ink-soft); font-size: 12.5px; }
.rd-brand { text-align: right; }
.rd-logo { font: 600 20px var(--serif); }
.rd-draft { display: inline-block; margin-top: 6px; font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; border: 1.5px dashed var(--ink-soft); color: var(--ink-soft); padding: 2px 8px; border-radius: 4px; }
.rd-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.rd-tile { border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; }
.rd-l { font: 500 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.rd-v { font: 700 26px/1.2 var(--head); margin-top: 4px; }
.rd-s { font-size: 12px; color: var(--ink-soft); }
.rd-up { color: var(--green); font-weight: 600; } .rd-down { color: var(--red); font-weight: 600; }
.rd-notes { background: var(--wash); border-radius: 10px; padding: 18px 20px; }
.rd-notes h2 { border: 0; padding: 0; }
.rd-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-top: 10px; }
.rd-list { list-style: none; margin: 0; padding: 0; }
.rd-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--wash); }
.rd-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 18px; }
.rd-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; padding-bottom: 34px; }
.rd-bar i { display: block; width: 70%; max-width: 38px; min-height: 2px; background: var(--ink); border-radius: 4px 4px 0 0; }
.rd-bn { font: 500 10px var(--mono); color: var(--ink-soft); margin-bottom: 3px; }
.rd-bl, .rd-bp { position: absolute; left: 0; right: 0; text-align: center; font: 500 9.5px var(--mono); color: var(--ink-soft); white-space: nowrap; overflow: hidden; }
.rd-bl { bottom: 16px; } .rd-bp { bottom: 2px; color: var(--ink); }
.pp-bars { height: 170px; }
.rd-key { font-size: 11.5px; color: var(--ink-soft); margin: 8px 0 0; }
.rd-reasons > div { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 44px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.rd-track { height: 8px; background: var(--wash); border-radius: 4px; overflow: hidden; } .rd-track i { display: block; height: 100%; background: var(--ink); }
.rd-lnotes > div { padding: 6px 0; border-bottom: 1px solid var(--wash); font-size: 13px; }
.rd-exams { display: flex; flex-wrap: wrap; gap: 18px; } .rd-exams > div { display: flex; gap: 10px; align-items: center; } .rd-exams b { font: 700 26px var(--head); }
.rd-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 11.5px; color: var(--ink-soft); }
.rdoc.rd-pdf { border: 0; border-radius: 0; padding: 0; }
@media (max-width: 640px) { .rdoc { padding: 20px 16px; } .rd-tiles { grid-template-columns: 1fr 1fr; } .rd-head { flex-direction: column; } .rd-brand { text-align: left; } }
@media print { .rdoc { border: 0; padding: 0; } }

/* ---------- Parent pages ---------- */
.pp-li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.pr-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; }
.pr-row:last-child { border: 0; } .pr-row:hover b { text-decoration: underline; }
.pl-month { border-bottom: 1px solid var(--rule); padding: 8px 0; } .pl-month summary { cursor: pointer; list-style: none; padding: 4px 0; } .pl-month summary::-webkit-details-marker { display: none; }
.bp-bt { gap: var(--s3); }

/* ---------- 19 Nov: avatars, the tutor's home dashboard, the tutee home and smoother movement ---------- */
.av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: var(--wash); color: var(--ink);
  border: 1px solid var(--rule); font: 600 13px var(--head); letter-spacing: .02em; transition: background-color var(--med), color var(--med); }
.av.sm { width: 26px; height: 26px; font-size: 11px; }
.av.av-lg { width: 52px; height: 52px; font-size: 19px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.av-head { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.td-hello { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); margin-bottom: var(--s4); }
.td-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.td-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); grid-auto-flow: row dense; margin-bottom: var(--s4); }
.td-grid > .sheet { margin: 0; }
.td-c4 { grid-column: span 4; } .td-c5 { grid-column: span 5; } .td-c7 { grid-column: span 7; } .td-c8 { grid-column: span 8; } .td-c12 { grid-column: span 12; }
.td-r2 { grid-row: span 2; }
.td-today .td-next { font: 500 1.15rem/1.35 var(--head); margin: 10px 0 12px; }
.td-today .eyebrow { color: color-mix(in srgb, var(--paper) 70%, var(--ink)); }
.td-today .btn.ghost { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 35%, transparent); }
.td-today .btn.ghost:hover { border-color: var(--paper); }
.td-today .av { background: color-mix(in srgb, var(--paper) 14%, var(--ink)); color: var(--paper); border-color: transparent; }
.td-lesson { display: flex; align-items: center; gap: var(--s2); padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--paper) 16%, var(--ink)); }
.td-time { font: 500 12px var(--mono); min-width: 44px; opacity: .85; }
.td-ln { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-st { opacity: .7; }
.td-needs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.td-need { display: flex; flex-direction: column; gap: 2px; padding: var(--s3); border-radius: var(--r2); background: var(--wash); text-decoration: none; color: var(--ink-soft);
  transition: background-color var(--med), color var(--med), transform var(--fast); }
.td-need b { font: 600 1.9rem/1 var(--head); color: var(--mid); }
.td-need span { font-size: .8rem; line-height: 1.3; }
.td-need.on { background: var(--ink); color: color-mix(in srgb, var(--paper) 78%, var(--ink)); } .td-need.on b { color: var(--paper); }
.td-need:hover { transform: translateY(-2px); } .td-need:active { transform: scale(.97); }
.td-tutee { display: grid; grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 1fr) auto auto; grid-template-areas: "av n bar days last" "av n bar tags tags";
  gap: 2px var(--s3); align-items: center; padding: var(--s3) var(--s2); margin: 0 calc(-1 * var(--s2)); border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; border-radius: var(--r2);
  transition: background-color var(--med); }
.td-tutee:last-child { border-bottom: 0; } .td-tutee:hover { background: var(--wash); }
.td-tutee .av { grid-area: av; } .td-tn { grid-area: n; display: flex; flex-direction: column; min-width: 0; } .td-bar { grid-area: bar; display: flex; flex-direction: column; gap: 4px; }
.td-days { grid-area: days; text-align: right; } .td-last { grid-area: last; text-align: right; } .td-tags { grid-area: tags; display: flex; gap: 4px; justify-content: flex-end; }
.td-tags:empty { display: none; }
.td-hwr { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; transition: opacity var(--fast); }
.td-hwr:hover b { text-decoration: underline; }
.td-money { display: grid; gap: var(--s3); margin-top: var(--s3); } .td-money > div { display: flex; flex-direction: column; }
.td-money b { font: 600 1.6rem/1.1 var(--head); letter-spacing: -0.02em; }
.td-par { display: flex; align-items: center; gap: var(--s2); padding: 6px 0; }
.td-link { display: block; width: 100%; text-align: left; padding: 6px 0; border: 0; background: none; cursor: pointer; text-decoration: none; color: inherit; font-size: .925rem;
  border-bottom: 1px solid var(--rule); transition: padding-left var(--med) var(--ease), color var(--fast); }
.td-link:last-child { border-bottom: 0; } .td-link:hover { padding-left: 6px; }
.td-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--s4); }
.td-grid > .sheet, #bp-results, #bp-rn, #bp-hw, #bp-countdown { animation: rise .42s var(--ease) both; }
.td-grid > .sheet:nth-child(2) { animation-delay: .04s; } .td-grid > .sheet:nth-child(3) { animation-delay: .08s; } .td-grid > .sheet:nth-child(4) { animation-delay: .12s; }
.td-grid > .sheet:nth-child(5) { animation-delay: .16s; } .td-grid > .sheet:nth-child(n+6) { animation-delay: .2s; }
@media (max-width: 900px) { .td-c4, .td-c5, .td-c7, .td-c8 { grid-column: span 12; } .td-r2 { grid-row: auto; } .td-c4 { grid-column: span 6; } }
@media (max-width: 640px) { .td-c4 { grid-column: span 12; } .td-needs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-tutee { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "av n last" "av bar bar" "av days tags"; } .td-days { text-align: left; } }
.pa-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.pa-row:last-child { border-bottom: 0; } .pa-n { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 700px) { .pa-row { grid-template-columns: 36px minmax(0, 1fr); } .pa-row > .small, .pa-b { grid-column: 2; } }
.tiles4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.hr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s3); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.hr-row:last-child { border-bottom: 0; } .hr-row:hover b { text-decoration: underline; }
.hr-t { display: flex; flex-direction: column; min-width: 0; } .hr-s { font: 500 13px var(--mono); color: var(--ink-soft); }
#bp-countdown .flip { flex-wrap: nowrap; gap: 4px; } #bp-countdown .fds { gap: 2px; }
#bp-countdown .fd { width: clamp(18px, 2.1vw, 26px); height: 40px; font-size: 1.25rem; border-radius: 6px; } #bp-countdown .flip > b { font-size: 1.2rem; line-height: 40px; }
.home-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: var(--s4); margin-bottom: var(--s4); } .home-pair > .sheet { margin: 0; }
@media (max-width: 1100px) { .home-pair { grid-template-columns: 1fr; } }
.td-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: var(--s4); }
.td-week > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 500 10px var(--mono); opacity: .8; }
.td-week i { width: 100%; height: 34px; border-radius: 6px; background: color-mix(in srgb, var(--paper) 10%, var(--ink)); display: grid; place-items: center; font: 600 13px var(--head); font-style: normal; color: var(--paper); }
.td-week .on i { background: var(--paper); color: var(--ink); } .td-week .now { opacity: 1; }
#bp-countdown .cd-list { border-top: 1px solid color-mix(in srgb, var(--paper) 16%, var(--ink)); padding-top: var(--s2); }
/* Every press and hover eases rather than snapping */
.tile { transition: border-color var(--med), transform var(--med) var(--ease), box-shadow var(--med); }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px -12px color-mix(in srgb, var(--ink) 60%, transparent); }
.btn, .chip, .icon-btn, .pill, .td-item, .td-hwr, .x-stmt, tr.link, .sheet { transition: background-color var(--med), color var(--med), border-color var(--med), opacity var(--med), transform var(--fast) var(--ease), box-shadow var(--med); }
tr.link:hover { background: var(--wash); }
.td-tools { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s3); grid-auto-flow: row dense; }
.td-tool { grid-column: span 3; }
.td-tool { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); color: inherit;
  text-decoration: none; font: inherit; text-align: left; cursor: pointer; min-height: 64px; transition: border-color var(--med), transform var(--med) var(--ease), box-shadow var(--med), background-color var(--med); }
.td-tool:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 8px 20px -14px color-mix(in srgb, var(--ink) 70%, transparent); }
.td-tool:active { transform: scale(.98); }
.td-tool b { font-weight: 600; font-size: .92rem; line-height: 1.25; } .td-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.td-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--wash); flex: none; transition: background-color var(--med), color var(--med); }
.td-ic svg { width: 18px; height: 18px; }
.td-tool:hover .td-ic { background: var(--ink); color: var(--paper); }
.td-tool.big { grid-column: span 3; flex-direction: row; align-items: flex-start; padding: var(--s4) var(--s5); min-height: 96px; }
.td-tool.big:nth-child(1), .td-tool.big:nth-child(4) { grid-column: span 7; } .td-tool.big:nth-child(2), .td-tool.big:nth-child(3) { grid-column: span 5; }
.td-tool.big:nth-child(1) { background: var(--ink); color: var(--paper); border-color: var(--ink); } .td-tool.big:nth-child(1) .muted { color: color-mix(in srgb, var(--paper) 72%, var(--ink)); }
.td-tool.big:nth-child(1) .td-ic { background: color-mix(in srgb, var(--paper) 14%, var(--ink)); }
.td-tool.big .td-ic { width: 42px; height: 42px; } .td-tool.big b { font: 600 1.1rem/1.2 var(--head); }
@media (max-width: 1000px) { .td-tool { grid-column: span 4; } .td-tool.big:nth-child(n) { grid-column: span 6; } }
@media (max-width: 640px) { .td-tool { grid-column: span 6; padding: var(--s3); } .td-tool.big:nth-child(n) { grid-column: span 12; } }
/* mock papers (19 Nov) */
.dpill { height: 20px; padding: 0 8px; font-size: .7rem; } .dpill.d1 { color: var(--green); border-color: currentColor; } .dpill.d2 { color: var(--amber); border-color: currentColor; } .dpill.d3 { color: var(--red); border-color: currentColor; }
.mk-kinds { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr 1fr; gap: var(--s2); margin-top: var(--s3); }
.mk-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--s3) var(--s4); border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--med), transform var(--med) var(--ease), background-color var(--med); }
.mk-kind:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-2px); } .mk-kind:active:not(:disabled) { transform: scale(.98); }
.mk-kind:first-child:not(:disabled) { background: var(--ink); color: var(--paper); border-color: var(--ink); } .mk-kind:first-child:not(:disabled) .muted { color: color-mix(in srgb, var(--paper) 72%, var(--ink)); }
.mk-kind:disabled { opacity: .45; cursor: not-allowed; } .mk-kind.busy { opacity: .6; }
.mk-weak { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s2); margin-top: var(--s3); }
.mk-wt { display: flex; flex-direction: column; gap: 6px; padding: var(--s3); border: 1px solid var(--rule); border-radius: var(--r2); background: var(--wash); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color var(--med); }
.mk-wt:hover { border-color: var(--ink); }
.mk-bad { background: color-mix(in srgb, var(--red) 10%, transparent); border-radius: var(--r2); }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 760px) { .mk-kinds { grid-template-columns: 1fr 1fr; } }

/* ---- part 8 (20 Nov): printable mocks, photos of answers, marking ---- */
.ms-steps { display: grid; gap: 12px; }
.ms-step { display: flex; gap: 12px; align-items: flex-start; opacity: .6; transition: opacity var(--med) var(--ease); }
.ms-step.on, .ms-step.done { opacity: 1; }
.ms-n { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule); display: grid; place-items: center; font: 600 13px var(--mono); }
.ms-step.on .ms-n { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ms-step.done .ms-n { color: var(--green); border-color: var(--green); }
.ms-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.ms-photos figure { margin: 0; }
.ms-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--rule); border-radius: var(--r2); background: #fff; display: block; transition: transform var(--fast) var(--ease); }
.ms-photos a:hover img { transform: translateY(-2px); }
.ms-q .ms-d { margin: 6px 0; }
.ms-q .ms-d summary { cursor: pointer; }
.ms-q .ms-d[open] { padding-bottom: 6px; }
.ms-why { animation: ms-in var(--med) var(--ease); }
@keyframes ms-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
#ms-tutor { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 640px) { #ms-tutor { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .ms-why { animation: none; } }

/* Key terms page (21 Nov) */
.kt-topic > dl.kt-list { margin: 0; padding: 0 var(--s4) var(--s3); }
.kt-topic .x-term { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; gap: var(--s3); padding: 8px 0; border-top: 1px solid var(--rule); }
.kt-topic .x-term dt { font-weight: 600; }
.kt-topic .x-term dd { margin: 0; color: var(--ink-soft); }
.kt-topic .x-term .pill { font-size: .7rem; vertical-align: middle; }
.kt-topic .kt-src { padding: 0 var(--s4) var(--s3); margin: 0; }
@media (max-width: 560px) { .kt-topic .x-term { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- 23 Nov: Kernel Studios credit ("from Kernel Studios") and the opening splash ---------- */
:root { --kernel-text: #26292C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --kernel-text: #F3F2EF; } }
:root[data-theme="dark"] { --kernel-text: #F3F2EF; }

.brand { display: inline-flex; align-items: center; gap: .3em; font: 600 1em/1 var(--serif); letter-spacing: -0.01em; color: var(--ink); }
.brand .brand-mark { width: 1.42em; height: 1.42em; flex: none; }
.kernel-credit { display: inline-flex; align-items: center; gap: 8px; font-family: Inter, system-ui, sans-serif; font-size: 13px; line-height: 1; color: var(--kernel-text); white-space: nowrap; }
.kernel-credit svg { width: 17px; height: 17px; flex: none; color: var(--kernel-text); }
.kernel-credit .kc-from { color: #8B8E92; font-weight: 400; }
.kernel-credit b { font-weight: 600; }

/* Settings: app logo with the credit centred under it (always the last thing on the page) */
.kernel-about { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 0 12px; order: 99; }
.kernel-about .brand { font-size: 1.25rem; pointer-events: none; }
main:has(> .kernel-about) { display: flex; flex-direction: column; }
main:has(> .kernel-about) > * { min-width: 0; }

/* Opening splash */
.splash { position: fixed; inset: 0; z-index: 9999; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; transition: opacity 400ms ease; }
.splash.out { opacity: 0; pointer-events: none; }
.splash .brand { font-size: 2.25rem; gap: 0; }
.splash .brand-mark { position: relative; z-index: 1; background: var(--paper); }
.splash .sp-name { display: inline-block; overflow: hidden; width: 0; transition: width 600ms cubic-bezier(.16, 1, .3, 1);
  padding: .12em 0 .3em; margin: -.12em 0 -.3em; }   /* room for the g's tail inside the clipping box */
.splash .sp-name > span { display: inline-block; padding-left: 0.22em; white-space: nowrap; transform: translateX(-100%); transition: transform 600ms cubic-bezier(.16, 1, .3, 1); }
.splash .sp-name i { font-style: normal; display: inline-block; opacity: 0; transition: opacity 260ms ease-out; }
.splash.open .sp-name > span { transform: none; }
.splash.open .sp-name i { opacity: 1; }
.splash .kernel-credit { opacity: 0; transition: opacity 400ms ease; }
.splash.credit .kernel-credit { opacity: 1; }
.splash.still .sp-name { width: auto; }
.splash.still .sp-name > span { transform: none; }
.splash.still .sp-name i, .splash.still .kernel-credit { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .splash *, .splash { transition-duration: 0ms !important; } .splash { transition: opacity 300ms ease !important; } }
@media print { .splash { display: none; } }

/* Sign in with Kernel */
.k-head { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.15rem; margin: var(--s4) 0 var(--s1); }
.k-head svg { width: 22px; height: 22px; flex: none; color: var(--ink); }
.k-sub { text-align: center; margin: 0 0 var(--s4); }
.k-wide { width: 100%; justify-content: center; }
.k-second { margin-top: var(--s2); }
.k-foot { text-align: center; margin: var(--s3) 0 0; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.k-card-row { display: flex; align-items: center; gap: var(--s3); }
.k-card-row > svg { width: 22px; height: 22px; flex: none; color: var(--ink); }
.k-card-row > div { flex: 1 1 auto; }
.k-card-row > .btn { flex: none; }
.k-email { overflow-wrap: anywhere; }
@media (max-width: 520px) { .k-card-row { flex-wrap: wrap; } .k-card-row > div { flex: 1 1 calc(100% - 40px); } .k-card-row > .btn { margin-left: 34px; } }

/* ---------- 23 Nov: phone app (Home Screen). Wider screens keep the layout above unchanged. ---------- */
#scroller { display: contents; }
.tabbar { display: none; }
.update-pill { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 0; right: 0; margin: auto; width: max-content; max-width: calc(100vw - 32px);
  z-index: 9000; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; background: var(--ink); color: var(--paper);
  border-radius: 999px; padding: 6px 6px 6px 16px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.22); animation: pill-in .32s var(--ease); }
.update-pill button { border: 0; background: var(--paper); color: var(--ink); border-radius: 999px; padding: 5px 12px; font: 600 13.5px var(--sans); cursor: pointer; }
@keyframes pill-in { from { opacity: 0; translate: 0 -10px; } to { opacity: 1; translate: 0 0; } }
.sheet-back { place-items: end stretch; padding: 0; }
.bsheet { background: var(--sheet); color: var(--ink); border-top: 1px solid var(--rule); border-radius: 18px 18px 0 0; width: 100%;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: grid; gap: 2px; animation: sheet-up .26s var(--ease); max-height: 80vh; overflow: auto; }
.backdrop.out .bsheet { animation: sheet-down .18s ease-in forwards; }
.bsheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--rule); margin: 4px auto 10px; }
.bsheet a, .bsheet button { display: block; width: 100%; text-align: left; padding: 13px 12px; border: 0; background: none; color: var(--ink); font: 500 16px var(--sans);
  text-decoration: none; border-radius: 10px; cursor: pointer; }
.bsheet a.on { background: var(--ink); color: var(--paper); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }

@media (max-width: 760px) {
  :root { --tab-h: 58px; --top-h: calc(61px + env(safe-area-inset-top, 0px)); }
  html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
  html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
  body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
  /* the strip behind the status bar takes the top bar's colour */
  body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--paper); z-index: 40; }
  #root { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  #scroller { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain; overscroll-behavior-x: none; }
  .demo-bar, .exam-banner { flex: none; }
  .top { position: relative; flex: none; padding-top: 0; z-index: 20; background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .top-in { flex-wrap: nowrap; padding-block: 12px; }
  .top .nav { display: none; }
  .tools { margin-left: auto; }
  .menu { right: max(16px, env(safe-area-inset-right, 0px)); }
  main { padding-bottom: calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px)); }
  .signin { min-height: 100%; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .todo { top: calc(var(--top-h) + 8px); }
  .toast { bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom, 0px)); border-radius: 18px; text-align: center; }
  /* bottom tab bar */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--paper); border-top: 1px solid var(--rule);
    padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px)); view-transition-name: tabbar; }
  .tabbar a, .tabbar button { flex: 1 1 0; min-width: 0; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; padding: 0; color: var(--ink-soft); text-decoration: none; font: 500 11px/1.1 var(--sans); cursor: pointer; transition: color var(--fast); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .on { color: var(--ink); font-weight: 600; }
  .tabbar .on svg { stroke-width: 2.1; }
  /* phones zoom into small text boxes, so they are 16px; nothing below 11px */
  .cal-l, kbd, mark.mp sup, .badge, .flip span:not(.fd), .hm, .cbars > div, .pt-ar, .pt-z, .pt-tm, .tt-times, .rdoc th, .rd-l, .rd-bn, .rd-bl, .rd-bp, .td-week > div { font-size: 11px; }
  .eyebrow { font-size: 11px; }
  .small { font-size: 13px; }
}
@media (max-width: 360px) { .top .logo span { display: none; } }
@supports (-webkit-touch-callout: none) { input, select, textarea { font-size: 16px !important; } }
@media print { .tabbar, .update-pill { display: none !important; } }
