/* Mathhh, an awx product. Brand: purple #6d3fc4, deep #3a2179, lavender #cfc3ee, grey #6b6877 (text grey; the first grey #8a8794 failed the contrast rule), ink #1c1b22, paper #eef0f3.
   Fonts: Bricolage Grotesque (headings), Instrument Sans (text), self-hosted. */
@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(fonts/instrument.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lexend"; src: url(fonts/lexend-latin-400-normal.woff2) format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Lexend"; src: url(fonts/lexend-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lexend"; src: url(fonts/lexend-latin-700-normal.woff2) format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Kalam"; src: url(fonts/kalam-latin-700-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
:root {
  --purple: #6d3fc4; --deep: #3a2179; --lav: #cfc3ee; --grey: #6b6877; --ink: #1c1b22; --paper: #eef0f3;
  --tint: #f3effb; --line: #dcd7e8; --white: #fff; --ok: #1f8a4c; --bad: #c0352b;
  --muted: #5d5a68; --accent: #6d3fc4; --headink: #3a2179; --bdr: #cfc3ee; --soft: #f6f5f9; --soft2: #e8e6ee; --hair: #eee;
  --ps: #d9731a; --ps-btn: #c2610d; --ps-bg: #fdebd8; --ps-ink: #7a3d00;
  --ok-bg: #e1f3e8; --ok-ink: #1f6b3f; --bad-bg: #fbe6e3; --bad-ink: #9a1f19; --mist-bg: #fdf6f5; --mist-line: #f0d4d1;
  --head: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
h2 { font-family: var(--head); font-weight: 700; font-size: 32px; letter-spacing: -.02em; line-height: 1.15; margin: 6px 0 6px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.label { font-family: var(--head); font-weight: 700; font-size: 20px; margin: 30px 0 12px; }
:focus-visible { outline: 3px solid var(--bdr); outline-offset: 2px; }

.btn { background: var(--purple); color: #fff; font-weight: 600; font-size: 16px; padding: 12px 24px; min-height: 48px; border-radius: 12px; transition: background .12s, transform .1s; }
.btn:hover { background: #5f34b1; } .btn:active { transform: scale(.98); } .btn:disabled { opacity: .45; }
.btn.ghost { background: var(--white); color: var(--accent); border: 1.5px solid var(--bdr); }
.btn.ghost:hover { background: var(--tint); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.link { color: inherit; opacity: .85; font-size: 15px; padding: 8px 4px; min-height: 44px; }
.link:hover { opacity: 1; text-decoration: underline; }

/* wordmark: Math + hh (awx logo colours) */
.logo { font-family: var(--head); font-weight: 800; font-size: 26px; letter-spacing: -.03em; color: var(--accent); }
.logo span { color: var(--grey); }
.top .logo { color: #fff; } .top .logo span { color: var(--lav); }

/* login */
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--purple); }
#login .card { width: 100%; max-width: 380px; padding: 28px 30px 28px; border: 0; position: relative; margin-top: 86px; }
#login .awi { position: absolute; width: 118px; height: auto; right: 22px; top: -122px; }
#login .logo { font-size: 40px; margin-bottom: 2px; }
#login p { color: var(--muted); margin: 0 0 22px; }
.field { width: 100%; padding: 13px 15px; margin-bottom: 10px; font: inherit; font-size: 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
#login .btn { width: 100%; margin-top: 6px; } #lerr { color: var(--bad); min-height: 22px; margin-top: 12px; font-size: 14px; }

/* top bar: brand purple, white logo (media-kit rule) */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 22px; min-height: 62px; background: var(--purple); color: #fff; }
.right { display: flex; gap: 14px; align-items: center; }
.chip { color: #fff; font-size: 15px; font-weight: 600; }
.chip.soft { color: #e9e2f8; font-weight: 500; font-variant-numeric: tabular-nums; }
#who { color: var(--lav); font-weight: 500; }
#score { background: #fff; color: #3a2179; font-weight: 700; font-size: 16px; padding: 8px 16px; border-radius: 12px; font-variant-numeric: tabular-nums; }
main { max-width: 960px; margin: 0 auto; padding: 24px 22px 130px; }

/* home */
.hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; background: var(--purple); color: #fff; border-radius: 22px; padding: 28px 30px 28px; overflow: hidden; }
.hcopy { position: relative; z-index: 1; flex: 1 1 320px; min-width: 0; }
.hero h2 { font-size: 40px; margin: 0 0 14px; }
.lvline { display: flex; align-items: center; gap: 12px; }
.lvbadge { flex: none; width: 56px; height: 56px; border-radius: 14px; background: #fff; color: #6d3fc4; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 28px; }
.hero .lvline #lvtitle { font-size: 17px; line-height: 1.3; color: #f3effb; }
.wsline { font-size: 17px; margin-top: 16px; } .wsline b { font-weight: 700; } .wsline span { color: var(--lav); }
.prog { height: 8px; background: rgba(255,255,255,.28); margin-top: 8px; max-width: 380px; border-radius: 8px; overflow: hidden; }
.prog i { display: block; height: 100%; background: #fff; border-radius: 8px; transition: width .4s; }
#topic { display: block; margin: 10px 0 18px; color: var(--lav); font-size: 14px; max-width: 420px; }
.hero .btn { background: #fff; color: #6d3fc4; font-weight: 700; }
.hero .btn:hover { background: var(--tint); }
.hero .awi { flex: none; width: 190px; height: auto; margin: -14px -6px -28px 0; align-self: flex-end; }
.nav { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; }
.chip.tab { background: var(--white); color: var(--accent); border: 1.5px solid var(--bdr); border-radius: 12px; padding: 11px 20px; min-height: 46px; font-weight: 600; }
.chip.tab:hover { background: var(--tint); }
.path { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.lv { padding: 14px 16px; min-height: 108px; }
.lv b { font-family: var(--head); font-size: 26px; font-weight: 800; color: var(--accent); } .lv span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.lv em { display: block; font-style: normal; font-size: 13px; font-weight: 600; margin-top: 8px; color: var(--accent); }
.lv.done { background: var(--tint); border-color: var(--bdr); }
.lv.now { border: 2px solid var(--purple); } .lv.now em { color: var(--headink); }
.lv.locked b, .lv.locked em { color: var(--grey); } .lv.locked { background: transparent; }
.hist { padding: 4px 20px; } .hist .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.hist .row:last-child { border: 0; } .hist .sub { font-size: 13px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; margin-left: 6px; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); } .pill.no { background: var(--bad-bg); color: var(--bad-ink); }
.timeline { font-size: 15px; font-weight: 400; color: var(--muted); margin: 8px 0 0; }

/* worksheet */
.sheet { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 14px; }
.q { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.q .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--accent); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.q .qt { font-family: var(--head); font-weight: 600; font-size: 24px; flex: 1 1 200px; min-width: 0; line-height: 1.25; letter-spacing: -.01em; }
.ans { position: relative; flex: 1 1 100%; min-width: 200px; height: 84px; border: 1.5px solid var(--bdr); border-radius: 12px; background: #fff;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ans canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; border-radius: 12px; }
.q.right { border-color: var(--ok); } .q.right .ans { border-color: var(--ok); } .q.wrong { border-color: var(--bad); } .q.wrong .ans { border-color: var(--bad); }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line); }
.bar label { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; min-height: 44px; }
.bar input[type=checkbox], .tick input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
#msg { color: var(--muted); font-size: 14px; }
#result { margin: 0 0 14px; padding: 18px 22px; display: flex; align-items: center; gap: 16px; }
#result .rtxt { flex: 1; } #result h2 { font-size: 26px; margin: 0 0 4px; color: var(--accent); } #result p { margin: 4px 0 0; }
#result .awi { flex: none; width: 92px; height: auto; }

/* timer + pause */
.clockgrp { display: inline-flex; align-items: center; gap: 8px; }
#timer { font-size: 17px; min-width: 46px; text-align: center; color: #fff; font-weight: 600; }
#pausebtn { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
#pausebtn i { width: 5px; height: 17px; background: var(--purple); border-radius: 2px; }
#pausebtn:hover { background: var(--tint); } #pausebtn.hidden, #pausebtn2.hidden { display: none; }
.paused { position: fixed; inset: 0; z-index: 60; background: var(--white); display: grid; place-items: center; padding: 24px; opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; }
.paused.on { opacity: 1; visibility: visible; }
.pcard { text-align: center; max-width: 340px; }
.pcard .awi { width: 190px; height: auto; }
.pcard h2 { font-size: 34px; margin: 8px 0 6px; color: var(--accent); } .pcard p { color: var(--muted); margin: 0 0 14px; }
.ptime { color: var(--muted); margin-bottom: 22px; } .ptime b { color: var(--headink); font-size: 20px; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* marking */
.marking { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(58,33,121,.55); opacity: 0; transition: opacity .15s; }
.marking.on { opacity: 1; }
.mcard { width: min(330px, 100%); padding: 22px 24px 20px; background: var(--white); border-radius: 20px; text-align: center; }
.mcard .awi { width: 104px; height: auto; animation: bob 1.6s ease-in-out infinite; }
.mcard h3 { font-family: var(--head); font-size: 21px; margin: 6px 0 4px; }
.mstep { margin: 0; min-height: 22px; color: var(--accent); font-weight: 600; font-size: 15px; }
.mbar { height: 6px; margin-top: 16px; background: var(--tint); border-radius: 6px; overflow: hidden; }
.mbar span { display: block; height: 100%; width: 35%; background: var(--purple); border-radius: 6px; animation: slide 1.2s ease-in-out infinite; }
.mcard small { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; }
@keyframes bob { 50% { transform: translateY(-5px); } } @keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.q.scanning .ans { overflow: hidden; } .q.scanning .ans::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 35%; background: var(--purple); border-radius: 4px; animation: slide 1.2s ease-in-out infinite; }

/* study records */
.recbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 8px 18px; margin-bottom: 14px; }
.lvsw { display: flex; align-items: center; gap: 10px; } .lvsw b { font-family: var(--head); font-weight: 800; font-size: 32px; min-width: 52px; text-align: center; color: var(--accent); }
.lvsw button, .calhead button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--bdr); background: var(--white); color: var(--accent); font-size: 22px; line-height: 1; }
.lvsw button:hover, .calhead button:hover { background: var(--tint); } .lvsw button:disabled, .calhead button:disabled { opacity: .3; }
.tick { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; min-height: 44px; }
.rec { padding: 4px 0 8px; overflow: hidden; }
.rrow { display: grid; grid-template-columns: 56px 96px 84px 1fr; gap: 10px; align-items: start; padding: 12px 18px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rrow:last-child { border: 0; } .rrow > span { color: var(--muted); font-size: 14px; padding-top: 2px; } .rrow > b { font-size: 15px; }
.rrow.today { background: var(--soft); } .rrow.today > * { color: var(--grey); }
.rhead { border-bottom: 1px solid var(--line); padding-bottom: 6px; } .rhead > span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.axis { position: relative; height: 16px; } .axis i { position: absolute; font-style: normal; font-size: 13px; color: var(--muted); transform: translateX(-2px); }
.axis i:last-child { transform: translateX(-100%); }
.strip { position: relative; height: 16px; background: var(--tint); border-radius: 8px; margin-top: 2px; }
.strip .bar { position: absolute; top: 0; bottom: 0; padding: 0; border: 0; display: block; background: var(--purple); border-radius: 8px; z-index: auto; }
.strip em { position: absolute; left: 0; top: 22px; font-style: normal; font-size: 14px; color: var(--muted); white-space: normal; line-height: 1.3; }
.rrow .strip { margin-bottom: 38px; } .rrow.today .strip { background: var(--soft2); }
@media (max-width: 560px) { .rrow { grid-template-columns: 44px 78px 1fr; } .rrow > span:nth-child(3) { display: none; } .rrow > .strip, .rhead .axis { grid-column: 1 / -1; } }

/* study history */
.cal { padding: 16px 18px 20px; max-width: 480px; } .calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calhead b { font-family: var(--head); font-size: 21px; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calgrid i { font-style: normal; display: flex; align-items: center; justify-content: center; position: relative; aspect-ratio: 1; border-radius: 50%; font-size: 14px; color: var(--ink); }
.calgrid .dow { aspect-ratio: auto; font-size: 12px; color: var(--grey); font-weight: 600; padding-bottom: 4px; }
.calgrid .day.star { background: var(--purple); color: #fff; font-size: 17px; } .calgrid .day.star small { position: absolute; bottom: 3px; font-size: 9px; opacity: .85; }
.calgrid .day.today { box-shadow: inset 0 0 0 2px var(--deep); }
.chart { padding: 18px 18px 12px; max-width: 480px; }
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; }
.col { display: flex; flex-direction: column; align-items: center; gap: 6px; } .colbar { width: 100%; height: 140px; display: flex; align-items: flex-end; }
.colbar i { display: block; width: 100%; background: var(--lav); border-radius: 8px 8px 0 0; } .colbar i.cur { background: var(--purple); }
.col .val { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; } .col .val small { color: var(--accent); font-size: 12px; margin-left: 4px; } .col .lab { color: var(--muted); font-size: 13px; }

/* worksheet: nothing selectable, pencil only draws */
#work, #work * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#work .ans, #work canvas { touch-action: none; }

@media (max-width: 520px) {
  .top { flex-wrap: wrap; padding: 6px 14px; gap: 4px 10px; }
  .top .right { flex-wrap: wrap; gap: 6px 12px; flex: 1 1 100%; justify-content: space-between; }
  main { padding: 16px 14px 130px; }
  .sheet { grid-template-columns: 1fr; }
  .q .qt { font-size: 21px; flex: 1 1 calc(100% - 44px); }
  .ans { height: 96px; }
  .hero { padding: 22px 20px 22px; } .hero h2 { font-size: 32px; } .hero .awi { width: 118px; margin: 0 -10px -22px 0; position: absolute; right: 0; top: 14px; }
  .hcopy { flex-basis: 100%; } .lvline { padding-right: 96px; } .hero .awi { z-index: 0; }
  #result .awi { width: 68px; }
}
@media (prefers-reduced-motion: reduce) { .mcard .awi, .mbar span, .q.scanning .ans::after { animation: none; } .paused, .marking { transition: none; } }

/* formal level names */
.stage { grid-column: 1 / -1; font-family: var(--head); font-weight: 700; font-size: 15px; color: var(--headink); margin: 14px 0 -2px; letter-spacing: .01em; }
.stage:first-child { margin-top: 0; }
.lv strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; margin-top: 4px; }
.lv b { font-size: 22px; } .lv span { font-size: 12.5px; }
.rname { flex: 1 1 200px; font-weight: 600; color: var(--headink); }
.lvsw b { min-width: 64px; font-size: 28px; }

/* header buttons: real buttons, bigger, with room around them */
.top { padding: 10px 28px; min-height: 72px; gap: 16px; }
.top .right { gap: 16px; }
.top .link { opacity: 1; color: #fff; font-size: 16px; font-weight: 600; min-height: 48px; padding: 10px 20px; border-radius: 12px;
  background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.4); transition: background .12s; }
.top .link:hover { background: rgba(255,255,255,.28); text-decoration: none; }
.top .link:active { transform: translateY(1px); }
.top .link:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#pausebtn { width: 48px; height: 48px; }
#score, #rtotalchip { font-size: 16px; }
#rtotalchip { background: #fff; color: #3a2179; font-weight: 700; padding: 10px 18px; border-radius: 12px; }
@media (max-width: 520px) { .top { padding: 8px 16px; min-height: 64px; } .top .link { padding: 9px 16px; min-height: 46px; } .top .right { gap: 10px 12px; } }

.top .chip { font-size: 16px; }
#timer { font-size: 18px; }

/* dashboard */
.herobtns { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn.outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
.hero .btn.outline:hover { background: rgba(255,255,255,.16); }
#dashboard .label { margin-top: 34px; } #dashboard .label.first { margin-top: 10px; } #dashboard .label.sublabel { margin-top: 0; font-size: 17px; }
.dcal { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 20px 36px; align-items: start; }
.dcal .chart { max-width: 480px; }
@media (max-width: 820px) { .dcal { grid-template-columns: 1fr; } }

/* admin: levels open for audit, Analytics link */
a.card.lv.open { display: block; color: inherit; text-decoration: none; }
a.card.lv.open:hover { border-color: var(--accent); }
a.link { display: inline-flex; align-items: center; text-decoration: none; }
.hidden { display: none !important; }

/* notes */
#notes main { max-width: 820px; margin: 0 auto; padding: 22px 20px 64px; }
#notes .crumb { font-size: 14px; color: var(--grey); margin-bottom: 12px; }
#notes .crumb a { color: var(--accent); font-weight: 600; text-decoration: none; }
#notes h2 { font-family: var(--head); margin: 0 0 4px; }
.nsec { padding: 18px 22px; margin-top: 14px; }
.nsec h3 { font-family: var(--head); font-size: 20px; margin: 0 0 8px; color: var(--headink); }
.nsec p { margin: 8px 0; line-height: 1.55; font-size: 17px; }
.nsec ul, .nsec ol { margin: 8px 0; padding-left: 24px; line-height: 1.6; font-size: 17px; }
.nsec.remember { background: var(--tint); border-color: var(--bdr); }
.ex { background: var(--tint); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
.ex h4 { margin: 0 0 4px; font-family: var(--head); font-size: 17px; color: var(--accent); }
.ex p, .ex ol, .ex ul { font-size: 16px; }
.try { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.try:last-child { border: 0; }
.try .tq { font-size: 19px; font-weight: 600; min-width: 130px; }
.try .ta { font: 800 19px var(--head); color: var(--accent); }
.try .showans { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.noterows { padding: 4px 0; margin-top: 14px; }
.noterow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--hair); color: inherit; text-decoration: none; min-height: 48px; }
.noterow:last-child { border: 0; } .noterow:hover { background: var(--tint); }
.noterow small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.notenav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.notenav a, .nsec.practise a { text-decoration: none; display: inline-flex; align-items: center; }
a.notelink { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--accent); }
#result a.btn { text-decoration: none; display: inline-flex; margin-top: 4px; }
#notes .pill, .an .pill { display: inline-block; background: var(--tint); color: var(--headink); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
#notes .pill.ok, .an .pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
#notes .pill.no, .an .pill.no { background: var(--bad-bg); color: var(--bad-ink); }

/* notes polish */
#notes main { max-width: 1040px; }
.notewrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 6px; }
.toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.toc b { font: 700 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); margin-bottom: 6px; }
.toc a { padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; min-height: 20px; }
.toc a:hover { background: var(--tint); color: var(--accent); }
.nsec { scroll-margin-top: 16px; }
#nbody .nsec:first-child, .notewrap article > .nsec:first-child { margin-top: 0; }
.nsec p.answer { display: inline-block; margin: 6px 0 2px; padding: 8px 16px; background: var(--white); border: 2px solid var(--bdr); border-radius: 12px; font: 800 20px var(--head); color: var(--headink); }
.ex ol { list-style: none; counter-reset: step; padding: 0; }
.ex ol li { counter-increment: step; position: relative; padding-left: 38px; margin: 8px 0; }
.ex ol li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--purple); color: #fff; font: 700 14px/26px var(--body); text-align: center; }
#nbody .nsec:first-of-type ul { list-style: none; padding-left: 0; }
#nbody .nsec:first-of-type ul li { position: relative; padding-left: 34px; margin: 8px 0; }
#nbody .nsec:first-of-type ul li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--purple); }
#nbody .nsec:first-of-type ul li::after { content: ""; position: absolute; left: 8px; top: 8px; width: 5px; height: 9px; border: solid var(--purple); border-width: 0 2px 2px 0; transform: rotate(40deg) translate(-1px, -1px); }
.nsec.mistakes { background: var(--mist-bg); border-color: var(--mist-line); }
.nsec.mistakes h3 { color: #8a2a24; }
.pbar { display: block; height: 10px; border-radius: 5px; background: var(--tint); overflow: hidden; margin: 10px 0 4px; }
.pbar i { display: block; height: 100%; background: var(--purple); border-radius: 5px; min-width: 0; }
.pbar.thin { height: 6px; margin: 8px 0 0; max-width: 260px; }
.nsec .small { font-size: 14px; color: var(--muted); margin: 2px 0 12px; }
.notenav a { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; line-height: 1.25; max-width: 48%; }
.notenav a small { font: 600 12px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.try { padding: 12px 0; }
.try .tq { font-size: 20px; flex: 1 1 160px; }
.try .ta { min-width: 56px; padding: 6px 14px; background: var(--tint); border-radius: 10px; text-align: center; }
.noterow > span:first-child { flex: 1; min-width: 0; }
@media (max-width: 860px) {
  .notewrap { grid-template-columns: 1fr; gap: 6px; }
  .toc { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding: 6px 0 10px; scrollbar-width: none; }
  .toc b { display: none; } .toc a { flex: none; background: var(--white); border: 1px solid var(--bdr); }
  .nsec { padding: 16px 18px; } .notenav a { max-width: 100%; flex: 1 1 100%; }
}


/* sign-in: Google first, username and password tucked away */
#login .gsign { margin: 4px 0 0; }
#login .gbtn { display: flex; justify-content: center; min-height: 44px; }
#login .ctoggle { display: block; margin: 18px auto 0; padding: 8px; border: 0; background: none; font: 500 13px var(--body); color: var(--grey); text-decoration: underline; cursor: pointer; }
#login .ctoggle:hover { color: var(--accent); }
#login.g-on .classic { display: none; }
#login.g-on.show-classic .classic { display: block; margin-top: 8px; }
#login #lerr:empty { display: none; }

/* App header: logo, Home / Dashboard / Notes tabs, account menu. Header is 72px; tabs are 44px, so 14px above and below. */
.top.apptop { padding: 0 28px; min-height: 72px; gap: 24px; flex-wrap: nowrap; justify-content: flex-start; align-items: center; }
.apptop .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.apptop .brand .logo { color: #fff; font-size: 26px; line-height: 1; } .apptop .brand .logo span { color: var(--lav); }
.apptop .tabs { display: flex; align-items: center; gap: 6px; margin-left: 4px; }
.apptop .tabs a { display: inline-flex; align-items: center; box-sizing: border-box; height: 44px; padding: 0 18px; border-radius: 12px; color: #fff; font-weight: 600; font-size: 16px; line-height: 1; text-decoration: none; opacity: .9; transition: background .12s; }
.apptop .tabs a:hover { background: rgba(255,255,255,.14); opacity: 1; }
.apptop .tabs a.on { background: rgba(255,255,255,.16); opacity: 1; }
.apptop .tabs a:focus-visible, .avatar:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.apptop .tabs a.hidden { display: none; }
.userwrap { position: relative; margin-left: auto; }
.avatar { display: inline-flex; align-items: center; gap: 10px; height: 48px; box-sizing: border-box; padding: 4px 14px 4px 4px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 16px; background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.4); transition: background .12s; }
.avatar:hover { background: rgba(255,255,255,.28); }
.av-i { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #6d3fc4; display: grid; place-items: center; font: 800 18px var(--head); font-style: normal; flex: none; }
.avatar svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.umenu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: 264px; max-width: calc(100vw - 24px); padding: 8px; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 36px rgba(40,20,90,.28); }
.umenu.hidden { display: none; }
.umenu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--hair); margin-bottom: 6px; } .umenu .who b { display: block; font-size: 16px; } .umenu .who small { color: var(--muted); font-size: 13px; }
.umenu .mi { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 12px; border-radius: 10px; background: none; border: 0; color: var(--ink); font: 500 15px var(--body); text-align: left; text-decoration: none; cursor: pointer; }
.umenu .mi:hover { background: var(--tint); } .umenu .mi.hidden { display: none; }
.umenu .mi:focus-visible { outline: 3px solid var(--bdr); outline-offset: -2px; }
.umenu hr { border: 0; border-top: 1px solid var(--hair); margin: 6px 4px; }
.titlerow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .titlerow h2 { margin: 6px 0; }
.titlerow #rtotalchip { background: var(--tint); color: var(--headink); border: 1px solid var(--bdr); font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 999px; }
.topmark { width: 34px; height: 34px; flex: none; margin-right: 4px; }
@media (max-width: 720px) {
  .top.apptop { min-height: 60px; padding: 0 14px; gap: 10px; }
  .apptop .brand .logo { font-size: 23px; } .apptop .brand img { width: 30px; height: 30px; }
  .avname, .avatar svg { display: none; } .avatar { padding: 4px; gap: 0; }
  .apptop .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; gap: 0; justify-content: space-around; background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .apptop .tabs a { flex: 1; justify-content: center; height: 60px; border-radius: 0; color: var(--muted); opacity: 1; font-size: 14px; }
  .apptop .tabs a:hover { background: var(--tint); } .apptop .tabs a.on { background: none; color: var(--accent); }
  .apptop .tabs a:focus-visible { outline-color: var(--accent); outline-offset: -3px; }
  #home, #dashboard, #notes, #settings { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .topmark { display: none; }
}

/* Settings */
#settings main.narrow { max-width: 640px; }
.srow-list { padding: 4px 20px; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); min-height: 56px; }
.srow:last-child { border: 0; } .srow > span { color: var(--muted); } .srow small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; } .srow b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.srow > div b { text-align: left; }
.tgl { position: relative; flex: none; width: 52px; height: 32px; display: inline-block; }
.tgl input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.tgl i { position: absolute; inset: 0; border-radius: 16px; background: #c9c6d3; transition: background .15s; pointer-events: none; }
.tgl i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .15s; }
.tgl input:checked + i { background: var(--purple); } .tgl input:checked + i::after { left: 23px; }
.tgl input:focus-visible + i { outline: 3px solid var(--bdr); outline-offset: 2px; }
.label.danger { color: var(--bad); }
.dzone { padding: 20px; border-color: var(--bad); } .dzone p { margin: 0 0 14px; color: var(--muted); }
.btn.danger { background: var(--bad); color: #fff; } .btn.danger:hover { background: #a82d24; } .btn.danger:disabled { opacity: .4; }
.delbox label { display: block; margin: 16px 0 6px; font-weight: 500; } .delbox .field { max-width: 280px; }
.delbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
#delerr { color: var(--bad); font-size: 14px; margin: 10px 0 0; min-height: 20px; }
.iconlink { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0 !important; }
.iconlink svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Dark mode: set by theme.js (data-theme on <html>); light by default, dark only after the user taps the button. The sign-in screens stay light. */
[data-theme="dark"] { color-scheme: dark;
  --paper: #15121f; --white: #211d30; --ink: #ece8f7; --tint: #2c2646; --line: #3b3558; --purple: #7a4fd8; --deep: #2a1a5c;
  --muted: #aca6c0; --accent: #bba0f7; --headink: #ddd3fa; --bdr: #4a4180; --soft: #262140; --soft2: #332c54; --hair: #2f2a45;
  --ps: #f0933f; --ps-btn: #c2610d; --ps-bg: #3d2a17; --ps-ink: #ffd2a3; --ok-bg: #16382a; --ok-ink: #82d6a6; --bad-bg: #43211f; --bad-ink: #f4a8a1; --mist-bg: #2a1f27; --mist-line: #4a2f33; --ok: #4fbf82; --bad: #ef6f64; }
[data-theme="dark"] #login, [data-theme="dark"] .an #login { color-scheme: light;
  --paper: #eef0f3; --white: #fff; --ink: #1c1b22; --tint: #f3effb; --line: #dcd7e8; --purple: #6d3fc4; --deep: #3a2179;
  --muted: #5d5a68; --accent: #6d3fc4; --headink: #3a2179; --bdr: #cfc3ee; --soft: #f6f5f9; --soft2: #e8e6ee; --hair: #eee; }
[data-theme="dark"] .btn:hover { background: #8a63e3; }
.themebtn { flex: none; width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: #fff; background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.4); transition: background .12s; }
.themebtn:hover { background: rgba(255,255,255,.28); }
.themebtn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.themebtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.themebtn .i-sun { display: none; } [data-theme="dark"] .themebtn .i-sun { display: block; } [data-theme="dark"] .themebtn .i-moon { display: none; }

/* Home hero: legible note link, and a more prominent Start button */
.hero a.notelink { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 10px 16px; min-height: 44px; border-radius: 12px; background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.4); color: #fff; font-weight: 600; font-size: 15px; line-height: 1.3; text-decoration: none; max-width: 100%; transition: background .12s; }
.hero a.notelink:hover { background: rgba(255,255,255,.28); }
.hero a.notelink:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.hero a.notelink.hidden { display: none; }
.hero #topic { margin-bottom: 14px; }
.herobtns { align-items: center; }
.hero #start { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 0 30px; font-size: 19px; font-weight: 800; border-radius: 14px; background: #fff; color: #6d3fc4; box-shadow: 0 6px 18px rgba(25,8,70,.32); }
.hero #start:hover { background: var(--tint); } .hero #start:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(25,8,70,.3); }
.hero #start svg { width: 22px; height: 22px; fill: currentColor; }
.hero .btn.outline { min-height: 48px; }
@media (max-width: 520px) {
  .hero #start { flex: 1 1 100%; }
  .hero .btn.outline { flex: 1 1 calc(50% - 6px); padding-left: 12px; padding-right: 12px; }
  .hero a.notelink { width: 100%; box-sizing: border-box; }
}
.hero #topic { color: #ebe5fb; max-width: 520px; font-size: 15px; } .hero .wsline span { color: #ebe5fb; }

/* Home: levels by stage and recent worksheets */
.shead { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 34px 0 14px; }
.shead h3 { font: 800 26px var(--head); letter-spacing: -.02em; margin: 0; }
.pathline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.pathline .pb { width: 140px; height: 8px; border-radius: 8px; background: var(--tint); overflow: hidden; } .pathline .pb i { display: block; height: 100%; border-radius: 8px; background: var(--purple); }
.allrec { color: var(--accent); font-weight: 600; font-size: 15px; text-decoration: none; padding: 10px 0; } .allrec:hover { text-decoration: underline; }
.lvp { background: var(--white); border: 1px solid var(--line); border-radius: 16px; margin: 0 0 12px; overflow: hidden; }
.lvp-h { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 0 20px; text-align: left; color: var(--ink); background: none; }
.lvp-h:hover { background: var(--tint); } .lvp-h:focus-visible { outline: 3px solid var(--bdr); outline-offset: -3px; }
.lvp-h > div { flex: 1; min-width: 0; } .lvp-h b { display: block; font: 700 18px var(--head); color: var(--headink); } .lvp-h small { color: var(--muted); font-size: 14px; }
.lvp.open .lvp-h { border-bottom: 1px solid var(--hair); }
.lvp .pill, .rw .pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--tint); color: var(--headink); white-space: nowrap; }
.lvp .pill.cp { background: var(--purple); color: #fff; } .lvp .pill.lockp { background: var(--soft); color: var(--muted); } .lvp .pill.ok, .rw .pill.ok { background: var(--ok-bg); color: var(--ok-ink); } .rw .pill.no { background: var(--bad-bg); color: var(--bad-ink); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lvp-h .ic { color: var(--muted); transition: transform .15s; } .lvp:not(.open) .chev { transform: rotate(-90deg); }
.lvp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 18px 20px 20px; } .lvp-grid[hidden] { display: none; }
.lvt { display: flex; flex-direction: column; min-width: 0; padding: 16px; min-height: 200px; background: var(--white); border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.lvt.cur { border-color: var(--purple); box-shadow: 0 0 0 3px var(--tint); } .lvt.lock { background: var(--soft); } .lvt.done { background: var(--tint); }
a.lvt.open:hover { border-color: var(--accent); }
.lvt .th { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; min-height: 40px; }
.lvt .bd { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--headink); font: 800 19px var(--head); } .lvt.done .bd, .lvt.lock .bd { background: var(--white); } .lvt.cur .bd { background: var(--purple); color: #fff; } .lvt .bd.sq { border-radius: 12px; }
.lvt .here { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.lvt .tag { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--white); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.lvt h4 { margin: 0 0 6px; font: 700 16px/1.25 var(--head); }
.lvt p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lvt .pfoot { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); } .lvt .pfoot b { color: var(--accent); } .lvt .pfoot .ic { width: 16px; height: 16px; } .lvt .pfoot.ok { color: var(--ok-ink); }
.lvt .psub { margin-top: 2px; padding-left: 22px; font-size: 12.5px; color: var(--muted); }
.lvt .pbar { margin-top: auto; height: 8px; border-radius: 8px; background: var(--tint); overflow: hidden; } .lvt .pbar i { display: block; height: 100%; background: var(--purple); border-radius: 8px; } .lvt .pbar + .pfoot { margin-top: 8px; }
.rlist { border-radius: 16px; overflow: hidden; }
.rw { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 12px 20px; border-bottom: 1px solid var(--hair); } .rw:last-child { border: 0; }
.rw .sc { width: 64px; flex: none; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; } .rw .sc b { font: 800 22px var(--head); color: var(--ink); }
.rw .rm { flex: 1; min-width: 0; } .rw .rm b { display: block; font-weight: 600; } .rw .rm small { color: var(--muted); font-size: 13.5px; }
@media (max-width: 900px) { .lvp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .lvp-grid { grid-template-columns: 1fr; padding: 14px; } .lvt { min-height: 0; } .lvp-h { padding: 0 16px; } .rw { padding: 12px 14px; gap: 12px; } .shead h3 { font-size: 24px; } .pathline .pb { width: 100px; } }
.pathline .segs { display: flex; align-items: center; gap: 3px; }
.pathline .segs i { display: block; width: 9px; height: 10px; border-radius: 3px; background: var(--line); }
.pathline .segs i.done { background: var(--purple); }
.pathline .segs i.now { height: 16px; background: var(--purple); box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--purple); margin: 0 3px; }
@media (max-width: 640px) { .pathline .segs i { width: 6px; } .pathline .segs { gap: 2px; } .pathline .segs i.now { margin: 0 2px; } }
.lvt.trk { border-color: var(--bdr); }
.lvt.trk .pbar { margin-top: auto; } .lvt.trk .pbar + .pfoot { margin-top: 8px; }
.lvt .trkstart { margin-top: 14px; min-height: 44px; padding: 0 18px; font-size: 15px; width: 100%; }

/* Notes polish: hub with search, level pages, reading progress, following contents list */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#notes main { max-width: 1040px; padding: 28px 24px 72px; }
.readbar { position: fixed; left: 0; right: 0; top: 72px; height: 3px; z-index: 9; } .readbar[hidden] { display: none; } .readbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 0 3px 3px 0; transition: width .08s linear; }
.nsearch { position: relative; display: flex; align-items: center; margin: 6px 0 8px; }
.nsearch label { position: absolute; left: 16px; display: flex; color: var(--muted); pointer-events: none; }
.nsearch .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nsearch input { width: 100%; height: 54px; box-sizing: border-box; padding: 0 50px 0 48px; border-radius: 14px; border: 1.5px solid var(--bdr); background: var(--white); color: var(--ink); font: 500 17px var(--body); -webkit-appearance: none; appearance: none; }
.nsearch input::-webkit-search-cancel-button { display: none; }
.nsearch input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px var(--tint); }
.nclear { position: absolute; right: 9px; width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; color: var(--muted); } .nclear:hover { background: var(--tint); } .nclear[hidden] { display: none; }
#nresults { margin-top: 18px; } #nresults[hidden], #nlevels[hidden] { display: none; }
.nres { overflow: hidden; margin-top: 8px; } .nempty { padding: 26px 22px; text-align: center; margin-top: 8px; } .nempty p { margin: 6px 0 0; color: var(--muted); }
.ncont { display: grid; grid-template-columns: 1fr auto; gap: 2px 18px; align-items: center; padding: 20px 24px; margin: 18px 0 4px; background: var(--purple); color: #fff; border-radius: 16px; text-decoration: none; }
.ncont .eyebrow { font: 700 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: #ebe5fb; } .ncont b { font: 800 22px/1.2 var(--head); } .ncont small { color: #ebe5fb; font-size: 14px; }
.ncont .btn { grid-column: 2; grid-row: 1 / 4; background: #fff; color: #6d3fc4; font-weight: 800; } .ncont:hover .btn { background: var(--tint); }
.ncont:focus-visible { outline: 3px solid var(--bdr); outline-offset: 3px; }
.nstage { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; } .nstage h3 { font: 700 20px var(--head); color: var(--headink); margin: 0; } .nstage span { color: var(--muted); font-size: 14px; }
.ngrid { display: grid; grid-template-columns: repeat(var(--c, 3), 1fr); gap: 14px; }
.nlv { display: flex; flex-direction: column; min-width: 0; padding: 16px; min-height: 176px; background: var(--white); border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
a.nlv:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(60,30,130,.12); } a.nlv:focus-visible { outline: 3px solid var(--bdr); outline-offset: 2px; }
.nlv.cur { border-color: var(--purple); box-shadow: 0 0 0 3px var(--tint); } .nlv.done { background: var(--tint); } .nlv.soon { background: var(--soft); }
.nlv .th { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; min-height: 40px; }
.nlv .bd, .nlhead .bd { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--headink); font: 800 19px var(--head); } .nlv.cur .bd { background: var(--purple); color: #fff; } .nlv.done .bd { background: var(--white); } .nlv .bd.sq, .nlhead .bd.sq { border-radius: 12px; }
.nlv h4 { margin: 0 0 6px; font: 700 16px/1.25 var(--head); }
.nlv p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nlv .nf { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--accent); } .nlv.soon .nf { color: var(--muted); } .nlv .nf .ic { width: 18px; height: 18px; }
.nchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.nchip.cur { background: var(--purple); color: #fff; border-color: var(--purple); } .nchip.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; } .nchip .ic { width: 13px; height: 13px; }
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nlhead { display: flex; align-items: center; gap: 16px; margin: 4px 0 8px; } .nlhead h2 { margin: 0; } .nlhead .sub { margin: 2px 0 0; } .nlsum { color: var(--muted); margin: 0 0 6px; }
#notes .noterow { display: flex; align-items: center; gap: 16px; padding: 16px 20px; min-height: 76px; }
#notes .noterow > span:first-child { flex: none; min-width: 0; }
#notes .noterow .nrmain { flex: 1; min-width: 0; } #notes .noterow .nrmain b { display: block; font-weight: 600; } #notes .noterow .nrmain small { display: block; margin: 2px 0 0; }
#notes .noterow .nrmain .pbar.thin { display: block; max-width: 280px; margin-top: 8px; }
.stepn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--headink); font: 800 16px var(--head); } .noterow.cur .stepn { background: var(--purple); color: #fff; } .stepn.ok { background: var(--ok-bg); color: var(--ok-ink); } .stepn .ic { width: 18px; height: 18px; }
.nrside { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); flex: none; } .noterow .go { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 20px; }
.mchip { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--white); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.toc { top: 96px; } .toc a { transition: background .12s, color .12s; } .toc a.on { background: var(--tint); color: var(--accent); font-weight: 600; }
.nsec { scroll-margin-top: 96px; }
@media (max-width: 860px) {
  .ngrid { grid-template-columns: repeat(2, 1fr) !important; }
  .toc { position: sticky; top: 60px; z-index: 8; background: var(--paper); margin: 0 -14px; padding: 8px 14px 10px; }
  .toc a.on { background: var(--purple); color: #fff; border-color: var(--purple); }
  .nsec { scroll-margin-top: 130px; }
}
@media (max-width: 720px) { .readbar { top: 60px; } #notes main { padding: 20px 14px 72px; } }
@media (max-width: 560px) { .ngrid { grid-template-columns: 1fr !important; } .nlv { min-height: 0; } .ncont { grid-template-columns: 1fr; } .ncont .btn { grid-column: 1; grid-row: auto; margin-top: 10px; } #notes .noterow { padding: 14px; gap: 12px; } .nrside .pill { display: none; } }
.nlhead .bd { width: 56px; height: 56px; font-size: 26px; background: var(--purple); color: #fff; border-radius: 16px; }

/* Notes: Try it, Practise call to action, previous / next cards */
.trysec { counter-reset: tq; }
.trybar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -2px 0 6px; }
.trybar .trycount { color: var(--muted); font-size: 14px; }
.trybar .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
.trysec .try { counter-increment: tq; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 14px 0; border-radius: 0; transition: background .15s; }
.trysec .try::before { content: counter(tq); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--headink); font: 800 15px var(--head); }
.trysec .try .tq { font-size: 20px; min-width: 0; flex: none; }
.trysec .try .showans { grid-column: 3; grid-row: 1; min-width: 148px; justify-content: center; }
.trysec .try .ta { grid-column: 2 / -1; grid-row: 2; justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 0; padding: 8px 16px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-ink); font: 800 19px var(--head); animation: ansIn .18s ease-out; }
.trysec .try .ta::before { content: "Answer"; font: 700 11px var(--body); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.trysec .try.shown .showans { background: var(--tint); }
@keyframes ansIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .trysec .try .ta { animation: none; } }
.nsec.practise.go { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px 28px; padding: 24px 28px; background: var(--purple); border-color: var(--purple); color: #fff; }
.practise.go .eyebrow { font: 700 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: #ebe5fb; }
.practise.go h3 { color: #fff; font-size: 26px; margin: 4px 0 6px; } .practise.go p { color: #ebe5fb; margin: 0 0 12px; } .practise.go .small { margin: 6px 0 0; }
.practise.go .pbar { background: rgba(255,255,255,.28); max-width: 360px; } .practise.go .pbar i { background: #fff; }
.pgbtns { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 220px; }
.btn.big { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 0 28px; font-size: 19px; font-weight: 800; border-radius: 14px; background: #fff; color: #6d3fc4; box-shadow: 0 6px 18px rgba(25,8,70,.32); }
.btn.big:hover { background: var(--tint); } .btn.big svg { width: 22px; height: 22px; fill: currentColor; }
.practise.go .btn.outline { color: #fff; border: 1.5px solid rgba(255,255,255,.6); background: transparent; } .practise.go .btn.outline:hover { background: rgba(255,255,255,.16); }
.okline { display: flex; align-items: center; gap: 8px; color: var(--ok-ink) !important; font-weight: 600; } .okline .ic { width: 20px; height: 20px; }
.notenav2 { margin-top: 22px; } .nnpos { text-align: center; color: var(--muted); margin: 0 0 10px; }
.nnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nncard { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px 20px; background: var(--white); border: 1.5px solid var(--line); border-radius: 16px; color: var(--ink); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.nncard:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(60,30,130,.12); } .nncard:focus-visible { outline: 3px solid var(--bdr); outline-offset: 2px; }
.nncard.next { grid-column: 2; justify-content: space-between; } .nncard.prev:only-child { grid-column: 1; }
.nncard .ic { width: 22px; height: 22px; flex: none; color: var(--accent); }
.nnt { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .nnt small { font: 700 12px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); } .nnt b { font: 700 17px/1.25 var(--head); } .nnt span { color: var(--muted); font-size: 14px; }
@media (max-width: 720px) {
  /* the answer chip sits beside the Show answer button (same row), so showing it does not push the pencil area down; a long answer wraps inside the chip */
  .trysec .try { grid-template-columns: 32px auto minmax(0, 1fr); } .trysec .try .tq { grid-column: 2 / -1; }
  .trysec .try .showans { grid-column: 2; grid-row: 2; justify-self: start; width: auto; min-width: 144px; margin-top: 6px; }
  .trysec .try .ta { grid-column: 3; grid-row: 2; align-self: center; margin: 6px 0 0 10px; padding: 6px 12px; font-size: 18px; max-width: 100%; overflow-wrap: anywhere; }
  .trysec .try .ta::before { display: none; }          /* the green chip next to "Hide answer" says it already; the word made the chip wide and noisy on phones */
  .trysec .try .npad { grid-row: 2; }         /* straight under the question; with the pads hidden the button and chip use this row instead */
  .trysec.pads-on .try .showans { display: none; }         /* the pad's own header line has the Show answer button on phones */
  .nsec.practise.go { grid-template-columns: 1fr; padding: 20px; } .pgbtns { min-width: 0; }
  .nnrow { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -14px; padding: 2px 14px 10px; scrollbar-width: none; }
  .nnrow::-webkit-scrollbar { display: none; }
  .nncard { flex: 0 0 84%; scroll-snap-align: center; } .nncard.next { grid-column: auto; }
  .nncard.next:only-child, .nncard.prev:only-child { flex-basis: 100%; }
}

/* Dashboard polish */
#dashboard main { max-width: 1040px; padding: 28px 24px 72px; }
#dashboard .titlerow h2 { margin: 0; } #dashboard .sub { margin: 4px 0 22px; }
.dstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dstat { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 18px 18px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.dstat b { font: 800 34px/1.1 var(--head); letter-spacing: -.02em; color: var(--ink); margin-top: 8px; font-variant-numeric: tabular-nums; }
.dstat > span:not(.dsi) { font-weight: 600; font-size: 15px; } .dstat small { color: var(--muted); font-size: 13px; }
.dsi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--tint); color: var(--accent); }
.dsi svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dnudge { margin: 14px 2px 0; color: var(--headink); font-weight: 600; }
.dsh { margin-top: 36px; } .dsh .chip.tag { background: var(--tint); color: var(--headink); border: 1px solid var(--bdr); font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 999px; }
.recbar { padding: 12px 20px; margin-bottom: 12px; }
.tgl-row { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; min-height: 44px; cursor: pointer; }
.dlevel { padding: 16px 20px 18px; margin-bottom: 12px; } .dlrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dlrow b { font-size: 20px; font-family: var(--head); } .dlnow { color: var(--muted); } .dlpct { font: 800 22px var(--head); color: var(--accent); }
.dlevel .pbar { margin: 0; height: 10px; }
.rec { overflow: hidden; }
.rrow { grid-template-columns: 118px 92px 84px 1fr; padding: 14px 20px; }
.rrow > b { font-size: 15px; } .rrow > span { padding-top: 1px; }
.rrow.today { background: var(--soft); } .rrow.today > b { color: var(--muted); }
.dempty { display: flex; align-items: center; gap: 22px; padding: 26px 28px; } .dempty img { width: 92px; height: auto; flex: none; } .dempty b { font: 700 19px var(--head); } .dempty p { margin: 4px 0 14px; color: var(--muted); }
.dlegend { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; } .dlegend .lg { width: 14px; height: 14px; border-radius: 50%; display: inline-block; margin-left: 10px; } .dlegend .lg.star { background: var(--purple); margin-left: 0; } .dlegend .lg.tod { box-shadow: inset 0 0 0 2px var(--headink); }
.cal { padding: 18px 20px 18px; } .calsum { margin: 12px 0 0; text-align: center; color: var(--muted); }
.calgrid .day { font-size: 15px; } .calgrid .day.today { box-shadow: inset 0 0 0 2px var(--headink); }
.chart { padding: 20px 20px 14px; }
.rec .rrow:hover:not(.rhead):not(.today) { background: var(--tint); }
@media (max-width: 900px) { .dstats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  #dashboard main { padding: 20px 14px 72px; } .dstat { padding: 14px; } .dstat b { font-size: 28px; }
  .rrow { grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; } .rrow > span:nth-child(3) { display: inline; grid-column: 2; grid-row: 1; justify-self: end; } .rrow > span:nth-child(2) { grid-column: 1; grid-row: 2; }
  .rrow > .strip { grid-column: 1 / -1; grid-row: 3; margin-top: 10px; } .rhead { display: none; }
  .dempty { flex-direction: column; text-align: center; padding: 22px 18px; }
  .recbar { padding: 10px 14px; } .dlevel { padding: 14px 16px; }
}
#rtotalchip { display: none; }

/* Correcting wrong answers after a failed worksheet */
.rbtns { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0 !important; } .rbtns .btn { text-decoration: none; display: inline-flex; align-items: center; } #result .rbtns a.btn { display: inline-block; line-height: 1.35; padding-top: 11px; padding-bottom: 11px; }
.fixbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; margin: 0 0 14px; background: var(--tint); border: 1.5px solid var(--bdr); border-radius: 16px; }
.fixbar b { display: block; font: 700 18px var(--head); color: var(--headink); } .fixbar span { color: var(--muted); font-size: 15px; }
.q.fixing { border-color: var(--purple); box-shadow: 0 0 0 3px var(--tint); }
.fixhint { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--tint); color: var(--headink); font-size: 14px; font-weight: 600; white-space: nowrap; } .fixhint b { margin-left: 5px; color: var(--accent); font-size: 16px; }
.fixbar > div { flex: 1 1 320px; } .fixbar span { display: block; max-width: 62ch; }

/* Phone bottom bar: an icon above each label */
.apptop .tabs .tiw { display: none; }
@media (max-width: 720px) {
  .apptop .tabs a { flex-direction: column; gap: 3px; height: 64px; padding: 0; font-size: 12px; font-weight: 600; letter-spacing: .01em; }
  .apptop .tabs .tiw { display: grid; place-items: center; width: 58px; height: 30px; border-radius: 15px; transition: background .15s; }
  .apptop .tabs .ti { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .apptop .tabs a.on { color: var(--accent); font-weight: 700; } .apptop .tabs a.on .tiw { background: var(--tint); }
  .apptop .tabs a:hover { background: none; } .apptop .tabs a:not(.on):hover .tiw { background: var(--soft); }
  #home, #dashboard, #notes, #settings { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* Worksheet on a phone: one calm header row and one bottom row */
#work .wtitle { display: contents; } #wlevel { order: 1; } #work .clockgrp { order: 2; } #sct { order: 3; } #notesbtn { order: 4; }
#notesbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
@media (max-width: 720px) {
  #work .top { flex-wrap: nowrap; gap: 8px; padding: 0 10px; min-height: 58px; }
  #work .top .right { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 8px; align-items: center; justify-content: flex-start; }
  #back { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; line-height: 1; } #back .bt { display: none; }
  #work .wtitle { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.2; }
  #wlevel, #sct { order: 0; background: none; border: 0; padding: 0; min-height: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  #wlevel { font-size: 15px; font-weight: 700; color: #fff; } #sct { font-size: 12.5px; font-weight: 500; color: #e9e2f8; }
  #work .clockgrp { order: 0; flex: none; gap: 6px; } #timer { font-size: 15px; padding: 0; min-width: 40px; text-align: center; }
  #pausebtn { width: 40px; height: 40px; } #notesbtn { order: 0; flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; } #notesbtn .nt { display: none; }
  #work:not(.marked) #score { display: none; } #work #score { padding: 6px 12px; font-size: 14px; flex: none; }
  #work .bar { gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; justify-content: stretch; }
  #work .bar label, #pausebtn2 { display: none; }
  #work .bar #eraser, #work .bar #undo, #work .bar #clear { flex: 0 0 auto; min-height: 50px; padding: 0 16px; }
  #work .bar #submit { flex: 1 1 0; min-height: 52px; font-size: 18px; font-weight: 800; }
  #work .bar #fixnext { order: 2; flex: 1 1 0; min-height: 52px; font-size: 17px; font-weight: 800; }
  #work .bar #next { order: 1; flex: 0 0 auto; min-height: 52px; } #work .bar #next:not(.ghost) { flex: 1 1 0; font-size: 18px; font-weight: 800; }
  #work .bar #msg { order: -1; flex: 1 1 100%; text-align: center; margin: 0; } #work .bar #msg:empty { display: none; }
}
@media (max-width: 720px) {
  #work.marked .clockgrp, #work.marked #sct { display: none; }
  #work.marked:not(.fixing) .bar #eraser, #work.marked:not(.fixing) .bar #undo, #work.marked:not(.fixing) .bar #clear { display: none; }
  #result { position: relative; padding-top: 18px; } #result .awi { position: absolute; top: 14px; right: 14px; width: 60px; height: auto; margin: 0; }
  #result .rtxt h2 { padding-right: 72px; margin-top: 0; }
  .rbtns .btn { width: 100%; justify-content: center; text-align: center; } .rbtns .rn { display: none; }
  #result .timeline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
}
@media (max-width: 720px) {
  #result .rtxt h2 { min-height: 66px; }
  #work .bar .btn { white-space: nowrap; }
  #work .bar #eraser, #work .bar #undo, #work .bar #clear, #work .bar #next.ghost { padding: 0 12px; }
  #work .bar #fixnext, #work .bar #submit { font-size: 16.5px; padding: 0 12px; }
  #work .bar #undo span, #work .bar #clear span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* phone: icon only, the word stays for screen readers */
}

/* Mathhh tablet rule: a worksheet's questions and answer boxes fit an iPad screen with no scrolling by default.
   The grid rows are sized from the screen height (app.js sets --cols and --rows from the number of questions). */
@media (min-width: 600px) {
  #work main { max-width: 1180px; padding: 16px 22px calc(84px + env(safe-area-inset-bottom)); }   /* clears the fixed bottom bar, also when the sheet scrolls */
  #work .sheet { --avail: calc(100vh - 72px - 16px - 84px); --avail: calc(100dvh - 72px - 16px - 84px); --gap: 12px;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: var(--gap);
    grid-auto-rows: minmax(clamp(104px, calc((var(--avail) - (var(--rows, 5) - 1) * var(--gap)) / var(--rows, 5)), 210px), auto); }
  #work .bar { flex-wrap: nowrap; } #work .bar #msg { position: absolute; left: 0; right: 0; bottom: 100%; text-align: center; padding: 4px 12px; pointer-events: none; } #work .bar #msg:empty { display: none; }
  #work .q { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 4px 10px; align-items: center; padding: 8px 12px; }
  #work .q .qt { font-size: 20px; line-height: 1.15; min-width: 0; }
  #work .q .ans { grid-column: 1 / -1; min-width: 0; height: auto; min-height: 48px; align-self: stretch; }
}

/* Writing hand setting */
.srow.hand { align-items: center; } .radios { display: flex; gap: 10px; flex: none; }
.rad { position: relative; cursor: pointer; } .rad input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rad span { display: block; padding: 11px 18px; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--bdr); background: var(--white); color: var(--accent); font-weight: 600; }
.rad input:checked + span { background: var(--purple); border-color: var(--purple); color: #fff; }
.rad input:focus-visible + span { outline: 3px solid var(--lav); outline-offset: 2px; }
@media (max-width: 560px) { .srow.hand { flex-wrap: wrap; } .radios { width: 100%; } .rad { flex: 1; } .rad span { text-align: center; } }

/* Tablet: the worksheet buttons live in a side bar (left for right-handed, right for left-handed) so a resting palm never taps them */
@media (min-width: 600px) and (pointer: coarse) {
  #work .bar { top: var(--hdr, 76px); bottom: 0; width: 150px; right: auto; left: 0; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start;
    gap: 10px; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); border-top: 0; border-right: 1px solid var(--line); overflow-y: auto; }
  html[data-hand="left"] #work .bar { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); }
  #work main { margin: 0 0 0 150px; max-width: none; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); }
  html[data-hand="left"] #work main { margin: 0 150px 0 0; }
  #work .bar .btn { width: 100%; min-height: 56px; padding: 8px 10px; white-space: normal; line-height: 1.2; text-align: center; justify-content: center; flex: none; font-size: 16px; }
  #work .bar #submit, #work .bar #fixnext, #work .bar #next:not(.ghost) { min-height: 64px; font-size: 17px; font-weight: 800; }
  #work .bar label { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; min-height: 44px; font-size: 14px; flex: none; }
  #work .bar #pausebtn2 { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  #work .bar #pausebtn2.hidden { display: none; }
  #work .bar #msg { position: static; order: -1; flex: none; margin: 0; padding: 0; font-size: 12.5px; line-height: 1.3; text-align: left; pointer-events: auto; }
  #work .bar #msg:empty { display: none; }
  #work .bar #submit, #work .bar #fixnext { margin-top: auto; } #work .bar #fixnext { order: 1; } #work .bar #next { order: 2; } #work .bar #next:not(.ghost) { margin-top: auto; }
  #work.marked:not(.fixing) .bar #eraser, #work.marked:not(.fixing) .bar #undo, #work.marked:not(.fixing) .bar #clear { display: none; }
}

@media (min-width: 600px) and (pointer: coarse) { #work .top { z-index: 12; } #work .bar { z-index: 11; } }   /* the header always stays on top of the side bar */

/* Maths-notebook grid in the answer boxes. Pure CSS background: the image sent for marking is built from the strokes on plain white, so the grid is never read. */
#work .ans { --grid: rgba(109, 63, 196, .16);
  background-color: #fff;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 18px 18px; background-position: 8px 8px; }

/* Home: a worksheet left half done */
.hero .resume { margin: 12px 0 0; padding: 9px 14px; border-radius: 12px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 15px; line-height: 1.4; max-width: 34em; }
.hero .resume + .herobtns { margin-top: 14px; }

/* Worksheet scrollbar that stays visible (touch screens hide the system one). Drawn only when the page scrolls. */
.vscroll { display: none; position: fixed; z-index: 9; width: 16px; padding: 0 3px; touch-action: none; }
@media (pointer: coarse) { .vscroll.on { display: block; } }
.vscroll::before { content: ""; position: absolute; inset: 6px 5px; border-radius: 6px; background: rgba(109, 63, 196, .2); }
.vscroll i { position: absolute; left: 3px; right: 3px; top: 0; border-radius: 6px; background: var(--purple); min-height: 44px; box-shadow: 0 0 0 2px var(--white); }
.vscroll { cursor: pointer; }

/* Tablet in portrait (744 to 900px wide): the worksheet header is one calm row, like the phone one, instead of wrapping its chips */
@media (min-width: 721px) and (max-width: 900px) {
  #work .top { flex-wrap: nowrap; gap: 8px; padding: 0 16px; min-height: 64px; }
  #work .top .right { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 8px; align-items: center; justify-content: flex-start; }
  #back { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; line-height: 1; } #back .bt { display: none; }
  #work .wtitle { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.2; }
  #wlevel, #sct { order: 0; background: none; border: 0; padding: 0; min-height: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  #wlevel { font-size: 17px; font-weight: 700; color: #fff; } #sct { font-size: 13.5px; font-weight: 500; color: #e9e2f8; }
  #work .clockgrp { order: 0; flex: none; gap: 6px; } #timer { font-size: 15px; padding: 0; min-width: 40px; text-align: center; }
  #pausebtn { width: 40px; height: 40px; } #notesbtn { order: 0; flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; } #notesbtn .nt { display: none; }
  #work #score { padding: 8px 14px; font-size: 15px; flex: none; white-space: nowrap; }
}

/* Phone: after marking the header has the dark/light button too, so make room and keep the title whole */
@media (max-width: 720px) {
  #work.marked:not(.fixing) #notesbtn { display: none; }      /* the result card links the note when it matters */
  #work.fixing #score { display: none; }                      /* the score is not needed while correcting */
}

/* Phone: the header has a dark/light button as well, so the buttons shrink a little and the title "Level 1 · Worksheet 5" stays whole while writing */
@media (max-width: 420px) {
  #work .top { gap: 6px; padding: 0 8px; } #work .top .right { gap: 6px; }
  #back { width: 38px; height: 38px; min-height: 38px; font-size: 26px; }
  #pausebtn { width: 36px; height: 36px; } #notesbtn { width: 38px; height: 38px; min-height: 38px; }
  #work .top .themebtn { width: 38px; height: 38px; } #work .top .themebtn svg { width: 20px; height: 20px; }
  #wlevel { font-size: 14px; } #timer { min-width: 34px; font-size: 14px; }
}
@media (max-width: 370px) { #wlevel { white-space: normal; line-height: 1.15; } #sct { display: none; } }      /* small phones: two lines for the title instead of cutting it */

/* Choose your level (onboarding and Settings > Change my level) */
.wel { max-width: 760px; padding-bottom: 150px; }
.wel .eyebrow { margin: 8px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.wel h2 { margin: 0 0 8px; }
#welcome.first .tabs, #welcome.first .userwrap .js-settings { display: none; }
.wstage { margin-top: 22px; } .wstage h3 { margin: 0 0 10px; font-size: 15px; color: var(--muted); font-weight: 600; }
.wgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wopt { display: block; position: relative; cursor: pointer; }
.wopt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.wcard { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px; background: var(--white); border: 1.5px solid var(--line); border-radius: 14px; transition: border-color .12s, background .12s, box-shadow .12s; }
.wopt:hover .wcard { border-color: var(--bdr); background: var(--tint); }
.wopt input:checked + .wcard { border-color: var(--purple); background: var(--tint); box-shadow: 0 0 0 3px rgba(109,63,196,.18); }
.wopt input:focus-visible + .wcard { outline: 3px solid var(--purple); outline-offset: 2px; }
.wbd { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--purple); color: #fff; font: 700 17px var(--head, inherit); display: flex; align-items: center; justify-content: center; }
.wt { min-width: 0; flex: 1; } .wt b { display: block; font-weight: 600; font-size: 15px; } .wt small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; }
.wtag { flex: none; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--tint); border: 1px solid var(--bdr); padding: 3px 9px; border-radius: 99px; }
.welbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(40,20,90,.12); padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); }
#welcome.hidden .welbar { display: none; }
.welin { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
#welnote { color: var(--muted); font-size: 14px; min-width: 0; } .welbtns { display: flex; gap: 10px; flex: none; }
@media (max-width: 560px) { .wgrid { grid-template-columns: 1fr; } .welin { flex-direction: column; align-items: stretch; gap: 8px; } #welnote { text-align: center; } .welbtns .btn { flex: 1; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wbd { background: #8a63dc; } }
:root[data-theme="dark"] .wbd { background: #8a63dc; }
.srow .btn.small { min-height: 40px; padding: 8px 16px; font-size: 15px; text-decoration: none; flex: none; display: inline-flex; align-items: center; }
.lvt a.pfoot.lk { color: var(--accent); text-decoration: none; min-height: 32px; } .lvt a.pfoot.lk:hover { text-decoration: underline; }

/* Problem-solving worksheets: one wide column, tall boxes for the working, and a "How to solve it" fold after marking */
.sheet.working { grid-template-columns: 1fr; }
.sheet.working .q .qt { font-size: 21px; font-weight: 500; line-height: 1.4; letter-spacing: 0; }
.sheet.working .ans { height: 210px; }
.sheet.working .ans::before { content: "Show your working, then write your final answer at the end"; position: absolute; left: 12px; top: 8px; font-size: 12.5px; color: var(--muted); pointer-events: none; opacity: .75; }
.q .how { flex: 1 1 100%; margin-top: 2px; }
.q .how summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.q .how ol { margin: 6px 0 2px; padding-left: 22px; color: var(--ink); font-size: 16px; line-height: 1.5; }
@media (max-width: 560px) { .sheet.working .q .qt { font-size: 19px; } .sheet.working .ans { height: 190px; } }
@media (min-width: 600px) {      /* the tablet fit-to-screen rule is not used for working sheets: one column, tall boxes, the page scrolls */
  #work .sheet.working { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  #work .sheet.working .q { padding: 12px 16px; gap: 8px 12px; }
  #work .sheet.working .q .qt { font-size: 21px; line-height: 1.4; }
  #work .sheet.working .q .ans { height: 220px; min-height: 220px; }
}

/* ---------- Home: a school notebook (ruled page, margin line, exercise-book covers, a marks book) ---------- */
.hm { max-width: 1040px; padding-top: 28px; }
.nbpage { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 26px 30px 26px 96px; box-shadow: 0 2px 0 rgba(58,33,121,.05), 0 14px 34px rgba(58,33,121,.10);
  background-image: repeating-linear-gradient(to bottom, transparent 0 35px, rgba(109,63,196,.09) 35px 36px); background-position: 0 14px; overflow: hidden; }
.nbpage::before, .marks::before { content: ""; position: absolute; left: 66px; top: 0; bottom: 0; width: 2px; background: #f0a3cc; opacity: .8; }
.nbpage::after { content: ""; position: absolute; left: 22px; top: 36px; bottom: 36px; width: 14px; background: radial-gradient(circle, var(--paper) 0 5px, transparent 5.5px) 0 0 / 14px 56px repeat-y; opacity: .9; }
.nbhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.nbdate { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.nbpage h2 { font-size: 40px; margin: 0; color: var(--headink); line-height: 1.1; }
.nbpage .awi { flex: none; width: 128px; height: auto; margin: -8px 0 -22px; }
.slip { position: relative; background: var(--tint); border: 2px dashed var(--bdr); border-radius: 16px; padding: 18px 22px 16px; max-width: 640px; }
.slipk { margin: 0 0 12px; font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.slip .lvline { display: flex; align-items: center; gap: 14px; }
.slip .lvbadge { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--purple); color: #fff; font: 800 26px var(--head); display: grid; place-items: center; }
.slip .ttitle { font: 700 19px/1.25 var(--head); color: var(--headink); } .slip .wsline { margin-top: 4px; font-size: 16px; color: var(--ink); } .slip .wsline span { color: var(--muted); }
.slip .prog { height: 10px; border-radius: 10px; background: var(--white); border: 1px solid var(--bdr); margin: 14px 0 10px; max-width: none; overflow: hidden; } .slip .prog i { background: var(--purple); }
.slip #topic { display: block; color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.slip a.notelink { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 14px; border-radius: 10px; background: var(--white); border: 1.5px solid var(--bdr); color: var(--accent); font-weight: 600; font-size: 15px; text-decoration: none; }
.slip a.notelink:hover { background: var(--soft); } .slip a.notelink.hidden { display: none; }
.slip .resume { margin: 0 0 12px; font-size: 15px; color: var(--ink); background: var(--tint); border: 1px solid var(--bdr); padding: 8px 12px; border-radius: 6px; }
.slip .herobtns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.slip .tstart { display: inline-flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 28px; font-size: 18px; font-weight: 700; background: var(--purple); color: #fff; box-shadow: 0 6px 16px rgba(109,63,196,.35); }
.slip .tstart:hover { background: #5f34b1; } .slip .tstart svg { width: 22px; height: 22px; fill: currentColor; }
.slip .btn.outline { background: var(--white); color: var(--accent); border: 1.5px solid var(--bdr); min-height: 48px; } .slip .btn.outline.hidden { display: none; }
.quick { display: flex; gap: 6px 22px; flex-wrap: wrap; margin-top: 14px; }
.ql { background: none; border: 0; padding: 6px 0; min-height: 36px; font: 600 15px var(--body); color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--bdr); }
.ql:hover { text-decoration-color: var(--accent); } .ql.hidden { display: none; }
.hm .shead { margin: 34px 0 14px; }
#path { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.book { --bk: #6d3fc4; position: relative; background: var(--bk); border-radius: 8px 18px 18px 8px; padding: 12px 12px 12px 30px; box-shadow: 0 8px 20px rgba(58,33,121,.18); }
.book::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 17px; background: rgba(0,0,0,.2); border-radius: 8px 0 0 8px; }
.book::after { content: ""; position: absolute; left: 6px; top: 22px; bottom: 22px; width: 5px; background: repeating-linear-gradient(to bottom, rgba(255,255,255,.55) 0 10px, transparent 10px 24px); border-radius: 3px; }
.bk0 { --bk: #6d3fc4; } .bk1 { --bk: #8a4fc7; } .bk2 { --bk: #5b46c9; } .bk3 { --bk: #a24fb4; } .bk4 { --bk: #4a3b9e; }
.paper { background: var(--white); border-radius: 10px; overflow: hidden; }
.bk-h { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px; background: var(--white); border: 0; text-align: left; cursor: pointer; color: var(--ink); }
.bk-h:hover { background: var(--tint); } .bk-h:focus-visible { outline: 3px solid var(--purple); outline-offset: -3px; }
.bk-h .bt { flex: 1; min-width: 0; } .bk-h b { display: block; font: 800 20px var(--head); color: var(--headink); letter-spacing: -.01em; } .bk-h small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.bk-h .ic { width: 20px; height: 20px; color: var(--muted); transition: transform .15s; flex: none; } .book:not(.open) .bk-h .ic { transform: rotate(-90deg); }
.bk-rows { border-top: 1px solid var(--hair); }
.lrow { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 11px 16px; border-bottom: 1px solid var(--hair); color: inherit; text-decoration: none; min-height: 58px; }
.lrow:last-child { border-bottom: 0; }
.lrow .bd { width: 36px; height: 36px; border-radius: 50%; background: var(--tint); color: var(--headink); font: 800 16px var(--head); display: grid; place-items: center; } .lrow .bd.sq { border-radius: 10px; }
.lrow .rn { min-width: 0; } .lrow .rn b { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.25; } .lrow .rn small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .rs { font-size: 13px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; font-weight: 600; } .lrow .rs b { color: var(--accent); }
.lrow .rs .ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; } .lrow .rs.ok { color: var(--ok); }
.lrow.done .bd { background: var(--ok-bg); color: var(--ok-ink); } .lrow.lock { background: var(--soft); } .lrow.lock .rn b { color: var(--muted); font-weight: 500; } .lrow.lock .bd { background: var(--soft2); color: var(--muted); }
a.lrow.lock .rs.lk, .lrow a.rs.lk { color: var(--accent); text-decoration: none; } .lrow a.rs.lk:hover { text-decoration: underline; }
.lrow.cur { background: var(--tint); box-shadow: inset 4px 0 0 var(--purple); } .lrow.cur .bd { background: var(--purple); color: #fff; }
.lrow .rbar { grid-column: 2 / -1; height: 7px; border-radius: 7px; background: var(--white); border: 1px solid var(--bdr); overflow: hidden; } .lrow .rbar i { display: block; height: 100%; background: var(--purple); }
a.lrow.open:hover { background: var(--tint); }
.lrow .btn.small { min-height: 38px; padding: 6px 14px; font-size: 14px; border-radius: 10px; white-space: nowrap; background: var(--white); color: var(--accent); border: 1.5px solid var(--bdr); }
.lrow .btn.small:hover { background: var(--purple); color: #fff; border-color: var(--purple); }
.marks { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 6px 18px 6px 96px; box-shadow: 0 2px 0 rgba(58,33,121,.05), 0 10px 26px rgba(58,33,121,.08); overflow: hidden;
  background-image: repeating-linear-gradient(to bottom, transparent 0 63px, rgba(109,63,196,.10) 63px 64px); }
.marks .mk { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 8px 0; }
.marks .mk .sc { position: absolute; left: 8px; width: 54px; display: inline-grid; justify-items: center; font-family: var(--head); color: var(--bad); transform: rotate(-4deg); line-height: 1; }
.marks .mk .sc b { font-size: 26px; font-weight: 800; } .marks .mk .sc i { font-style: normal; font-size: 15px; font-weight: 700; border-top: 2.5px solid var(--bad); padding-top: 1px; min-width: 30px; text-align: center; margin-top: 2px; }
.marks .mk .rm { flex: 1; min-width: 0; } .marks .mk .rm b { display: block; font-weight: 600; } .marks .mk .rm small { color: var(--muted); font-size: 13.5px; } .marks .mk .pill { margin-left: 0; flex: none; }
.marks .mk.empty { min-height: 64px; }
@media (max-width: 820px) { #path { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .nbpage { padding: 20px 16px 20px 56px; } .nbpage::before, .marks::before { left: 40px; } .nbpage::after { left: 10px; }
  .nbpage h2 { font-size: 30px; } .nbpage .awi { width: 84px; margin: -4px 0 -14px; } .slip { padding: 16px 14px 14px; }
  .slip .tstart, .slip .tstartps { width: 100%; justify-content: center; } .marks { padding-left: 64px; padding-right: 12px; } .marks .mk .sc { left: 2px; width: 48px; } .marks .mk { gap: 10px; }
  .book { padding-left: 24px; } .lrow { padding: 10px 12px; grid-template-columns: 34px minmax(0, 1fr) auto; } .lrow .btn.small { padding: 6px 10px; }
}
.nbpage .awi { position: absolute; right: 34px; bottom: 6px; width: 170px; height: auto; margin: 0; }
.slip { max-width: 600px; }
#path { display: block; columns: 2; column-gap: 22px; }
.book { break-inside: avoid; margin-bottom: 22px; display: block; }
@media (max-width: 820px) { #path { columns: 1; } .nbpage .awi { width: 120px; right: 16px; } }
@media (max-width: 640px) { .nbpage { padding-bottom: 150px; } .nbpage .awi { width: 104px; bottom: 8px; right: 12px; } }
@media (max-width: 560px) { .nbpage .awi { width: 96px; } .nbpage { padding-bottom: 128px; } }
@media (max-width: 560px) {
  .nbpage { padding: 16px 12px 18px 44px; } .nbpage::before, .marks::before { left: 32px; } .nbpage::after { left: 8px; }
  .nbpage .awi { top: 8px; bottom: auto; right: 8px; width: 78px; }
  .nbpage h2 { font-size: 28px; padding-right: 76px; } .slip { padding: 14px 12px 12px; margin-right: -2px; }
  .slip .ttitle { font-size: 17px; } .slip .lvbadge { width: 48px; height: 48px; font-size: 22px; } .slip .lvline { gap: 10px; }
  .marks { padding-left: 60px; } .marks::before { left: 52px; }
}
.slip .lvtxt { flex: 1; min-width: 0; }

/* second round: today's worksheet and the advanced topics side by side */
main.hm { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
.hm > .nbpage { grid-column: 1; grid-row: 1; } .hm > #side { grid-column: 2; grid-row: 1; }
.hm > .shead, .hm > #path, .hm > .marks { grid-column: 1 / -1; }
#side .book { margin-bottom: 0; }
#side:empty { display: none; }
.nbpage { padding-right: 24px; padding-bottom: 26px; }
.nbhead { min-height: 96px; margin-bottom: 8px; }
.nbpage .awi { top: 10px; bottom: auto; right: 18px; width: 112px; }
.slip { max-width: none; }
.nbpage h2 { font-size: 36px; }
@media (max-width: 900px) {
  main.hm { grid-template-columns: minmax(0, 1fr); } .nbpage { padding-bottom: 22px; }
  .hm > .nbpage { grid-row: 1; } .hm > #bkhead { grid-row: 2; } .hm > #path { grid-row: 3; } .hm > #side { grid-column: 1; grid-row: 4; margin-top: 4px; }
  .hm > #histlabel { grid-row: 5; } .hm > #hist { grid-row: 6; }
}
@media (max-width: 560px) { .nbpage .awi { top: 8px; right: 8px; width: 78px; } .nbhead { min-height: 78px; } .nbpage { padding-bottom: 18px; } }
#side .lrow { grid-template-columns: 38px minmax(0, 1fr); padding: 12px 16px; row-gap: 6px; align-items: start; }
#side .lrow .bd { grid-row: 1 / span 2; margin-top: 2px; }
#side .lrow .rs { grid-column: 2; justify-self: start; }
#side .lrow .rn small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#side .lrow .btn.small { min-height: 36px; }
.hm > .nbpage { align-self: stretch; }
@media (max-width: 900px) { .hm > .nbpage { align-self: start; } }

/* third round: calmer topic line, shorter locked rows, six marks */
.slip #topic { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; font-size: 15px; }
.slip #topic b { font-weight: 600; color: var(--ink); } .slip #topic span { color: var(--muted); font-size: 14px; }
#side .lrow.lock .rn small { display: none; }
#side .lrow.lock { padding-top: 10px; padding-bottom: 10px; row-gap: 2px; }
.marks { padding-top: 0; }

/* fourth round: one look across the signed-in pages */
#dashboard h2, #notes main > h2, #settings h2 { color: var(--headink); }
.shead h3, #dashboard .shead h3 { color: var(--headink); }
.nstage { --c: #6d3fc4; position: relative; padding-left: 16px; }
.nstage::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 6px; border-radius: 6px; background: var(--c); }
.nstage.st0 { --c: #6d3fc4; } .nstage.st1 { --c: #8a4fc7; } .nstage.st2 { --c: #5b46c9; } .nstage.st3 { --c: #a24fb4; } .nstage.st4 { --c: #4a3b9e; }
.book { transition: transform .15s, box-shadow .15s; } .book:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(58,33,121,.24); }
.lrow.cur:hover, .lrow.done:hover { background: var(--tint); }
.marks .mk:hover { background: rgba(109,63,196,.04); }
.slip .tstart, .slip .tstartps { transition: transform .12s, box-shadow .12s, background .12s; } .slip .tstart:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(109,63,196,.4); } .slip .tstartps:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(194,97,13,.4); }
@media (prefers-reduced-motion: reduce) { .book, .slip .tstart, .slip .tstartps { transition: none; } .book:hover, .slip .tstart:hover, .slip .tstartps:hover { transform: none; } }
.nbpage h2 { padding-right: 128px; font-size: 34px; }
@media (max-width: 560px) { .nbpage h2 { padding-right: 84px; font-size: 26px; } }
@media (max-width: 560px) { .slip .ttitle { font-size: 16px; } .slip .wsline { white-space: nowrap; font-size: 15px; } .slip .lvbadge { width: 44px; height: 44px; font-size: 20px; } }

/* iPad and phone polish: two columns from 721px (iPad portrait), touch targets of 44px */
@media (min-width: 721px) and (max-width: 900px) {
  main.hm { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 0 18px; }
  .hm > .nbpage { grid-column: 1; grid-row: 1; align-self: stretch; padding-left: 78px; padding-right: 16px; }
  .nbpage::before { left: 52px; } .nbpage::after { left: 16px; }
  .hm > #side { grid-column: 2; grid-row: 1; margin-top: 0; }
  .hm > #bkhead, .hm > #path, .hm > #histlabel, .hm > #hist { grid-row: auto; }
  .nbpage h2 { font-size: 30px; padding-right: 100px; } .nbpage .awi { width: 92px; right: 12px; }
  .marks { padding-left: 84px; } .marks::before { left: 66px; }
}
.ql { min-height: 44px; padding: 10px 2px; display: inline-flex; align-items: center; }
.quick { gap: 2px 20px; margin-top: 6px; }
.lrow .rs.lk, #side .lrow .rs { min-height: 44px; }
#side .lrow.lock .rs { margin-top: -6px; }
.lrow .btn.small, #side .lrow .btn.small { min-height: 44px; }
.bk-h { min-height: 68px; }
.slip a.notelink { min-height: 44px; }
.apptop .tabs a { min-height: 44px; }
@media (pointer: coarse) {
  .slip .tstart, .slip .tstartps { min-height: 58px; font-size: 19px; }
  .marks .mk { min-height: 68px; }
  .lrow { min-height: 62px; }
}
@media (max-width: 560px) {
  .lrow { grid-template-columns: 34px minmax(0, 1fr); row-gap: 2px; align-items: start; }
  .lrow .bd { grid-row: 1 / span 3; margin-top: 2px; }
  .lrow .rs { grid-column: 2; justify-self: start; min-height: 0; }
  .lrow .rbar { grid-column: 2; margin-top: 4px; }
  .lrow .rn small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .lrow .btn.small { margin-top: 4px; }
  .marks .mk .rm small { display: block; }
}
.allrec { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Type: the signed-in app uses the same faces and sizes as the myUASA exercise book (Lexend for text, Kalam for the red pen) ---------- */
#welcome, #home, #work, #dashboard, #notes, #settings, .marking, .paused {
  --head: "Lexend", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --body: "Lexend", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hand: "Kalam", "Comic Sans MS", cursive;
  font-family: var(--body);
}
.apptop .logo, #work .top .logo { font-family: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", Arial, sans-serif; }     /* the wordmark stays in the brand face */
#home h2, #dashboard h2, #notes h2, #settings h2, #welcome h2, #home h3, #dashboard h3, #notes h3, #settings h3, #welcome h3, .shead h3 { letter-spacing: -.01em; }
#home h2, #dashboard main > h2, #notes main > h2, #settings h2, #welcome h2 { font-size: 34px; line-height: 1.15; font-weight: 700; }
.nbpage h2 { font-size: 32px; } .shead h3 { font-size: 24px; font-weight: 700; } .bk-h b { font-size: 19px; font-weight: 700; } .nstage h3 { font-size: 20px; font-weight: 700; }
#home .sub, #dashboard .sub, #notes .sub, #settings .sub, #welcome .sub { font-size: 15px; line-height: 1.6; }
#nbody { font-size: 16.5px; line-height: 1.65; } #nbody p, #nbody li { line-height: 1.65; }
.lrow .rn b { font-weight: 600; } .lrow .rn small, .marks .mk .rm small { font-size: 13px; }
.marks .mk .sc { font-family: var(--hand); } .marks .mk .sc b { font-size: 30px; font-weight: 700; } .marks .mk .sc i { font-size: 17px; font-weight: 700; }
#work .q .qt { letter-spacing: 0; }
@media (max-width: 900px) { #home h2, #dashboard main > h2, #notes main > h2, #settings h2, #welcome h2 { font-size: 30px; } .nbpage h2 { font-size: 28px; } }
@media (max-width: 560px) { #home h2, #dashboard main > h2, #notes main > h2, #settings h2, #welcome h2 { font-size: 26px; } .nbpage h2 { font-size: 24px; } .marks .mk .sc b { font-size: 26px; } }
.apptop, #work > .top { --head: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", Arial, sans-serif; --body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-family: var(--body); }     /* the header stays as it was */

/* phones: today's worksheet and the switched-on special topics share the first screen */
.bk-more { display: none; }
@media (max-width: 720px) {
  .hm > #side { grid-row: 2; margin-top: 14px; } .hm > #bkhead { grid-row: 3; } .hm > #path { grid-row: 4; } .hm > #histlabel { grid-row: 5; } .hm > #hist { grid-row: 6; }
  #side .lrow.lock { display: none; }
  #side .bk-more { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; background: var(--soft); }
  #side .bk-more .ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  #side .bk-h { min-height: 56px; padding: 8px 16px; } #side .bk-h b { font-size: 18px; }
  #side .lrow.trk { grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; padding: 10px 14px; }
  #side .lrow.trk .bd { grid-row: auto; margin: 0; } #side .lrow.trk .rs { grid-column: auto; justify-self: end; }
  #side .lrow.trk .rn small { display: none; }
  #side .lrow.trk .btn.small { min-height: 44px; padding: 8px 12px; font-size: 14px; background: var(--purple); color: #fff; border-color: var(--purple); margin: 0; }
}
@media (max-width: 560px) {
  .nbpage { padding: 12px 12px 14px 40px; } .nbpage::before { left: 28px; } .nbpage::after { display: none; }
  .nbhead { min-height: 60px; margin-bottom: 4px; } .nbpage h2 { font-size: 22px; padding-right: 78px; } .nbdate { font-size: 12.5px; margin: 0; }
  .nbpage .awi { width: 62px; top: 6px; right: 8px; }
  .slip { padding: 10px 12px 8px; } .slipk { margin: 0 0 6px; font-size: 11.5px; }
  .slip .prog { margin: 8px 0 8px; height: 8px; } .slip .quick { margin-top: 0; }
  .slip #topic { margin-bottom: 8px; font-size: 14px; } .slip #topic span { display: none; }
  .slip .lvbadge { width: 40px; height: 40px; font-size: 18px; border-radius: 11px; } .slip .ttitle { font-size: 15px; } .slip .wsline { font-size: 14px; margin-top: 2px; }
  .slip .tstart, .slip .tstartps { min-height: 52px; }
}
@media (max-width: 560px) and (max-height: 760px) { .slip #topic, .slip a.notelink { display: none; } }
@media (max-width: 560px) {
  main.hm { padding-top: 12px; }
  #home .nbpage h2 { font-size: 20px; padding-right: 70px; line-height: 1.2; } .nbhead { min-height: 44px; margin-bottom: 2px; }
  .nbpage .awi { width: 56px; top: 4px; right: 6px; }
  .slip .quick { display: none; }          /* Dashboard and Notes are in the bottom bar already */
  .slip .lvline { gap: 10px; } .slip .lvbadge { width: 38px; height: 38px; font-size: 17px; } .slip .ttitle { font-size: 14.5px; line-height: 1.25; } .slip .wsline { font-size: 13.5px; }
  #side .lrow.trk { grid-template-columns: 34px minmax(0, 1fr); row-gap: 8px; align-items: center; padding: 10px 14px 12px; }
  #side .lrow.trk .rs { grid-column: 1 / -1; justify-self: stretch; } #side .lrow.trk .btn.small { width: 100%; justify-content: center; }
  #side .lrow.trk .rn b { font-size: 15px; }
}
@media (max-width: 560px) { .slip .lvline { padding-right: 0; } }

/* mobile polish: compact locked rows, ranges stay on one line, calmer settings headings */
.nw { white-space: nowrap; }
#settings .label { color: var(--headink); font: 700 20px var(--head); letter-spacing: -.01em; }
@media (max-width: 560px) {
  .lrow.lock { grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
  .lrow.lock .bd { grid-row: auto; margin: 0; width: 32px; height: 32px; font-size: 14px; }
  .lrow.lock .rn small, .lrow.lock .rs .lt { display: none; }
  .lrow.lock .rs { grid-column: auto; justify-self: end; min-height: 0; } .lrow.lock .rs .ic { width: 18px; height: 18px; }
  .lrow.lock .rn b { font-size: 14.5px; }
  .lrow.done { min-height: 52px; }
}

/* onboarding for a new account: Welcome, Level, Topics */
.welsteps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 4px 0 10px; }
.welsteps:empty { display: none; }
.welsteps li { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--white); border: 1.5px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.welsteps li b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--soft2); color: var(--muted); font-size: 13px; }
.welsteps li.on { border-color: var(--purple); color: var(--headink); } .welsteps li.on b { background: var(--purple); color: #fff; }
.welsteps li.done { color: var(--ok); } .welsteps li.done b { background: var(--ok-bg); color: var(--ok-ink); }
.welhero { position: relative; margin-top: 18px; }
.wcards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wc { background: var(--white); border: 1.5px solid var(--line); border-radius: 18px; padding: 22px 22px 20px; box-shadow: 0 8px 22px rgba(58,33,121,.08); }
.wc h3 { margin: 14px 0 8px; font-size: 21px; color: var(--headink); letter-spacing: -.01em; }
.wc p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink); } .wc p b { color: var(--headink); }
.wcb { display: inline-grid; place-items: center; min-width: 64px; height: 48px; padding: 0 12px; border-radius: 24px; background: var(--purple); color: #fff; font: 700 20px var(--head); }
.wcb.sq { border-radius: 14px; min-width: 48px; background: #4a3b9e; font-size: 28px; }
.wc.alt { background: var(--tint); border-style: dashed; border-color: var(--bdr); }
.welawi { display: block; margin: 18px auto 0; width: 108px; height: auto; }
.weltopics { margin-top: 18px; } .weltopics .srow-list { padding: 4px 20px; }
@media (max-width: 640px) { .wcards { grid-template-columns: 1fr; } .welawi { width: 84px; } .welsteps li span { display: none; } .welsteps li { padding-right: 5px; } .welsteps li.on span { display: inline; padding-right: 8px; } }
@media (max-width: 640px) {
  .wcards { gap: 12px; } .wc { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; padding: 14px 16px; border-radius: 16px; }
  .wc h3 { margin: 0; font-size: 18px; } .wc p { grid-column: 1 / -1; font-size: 14.5px; line-height: 1.55; }
  .wcb { min-width: 52px; height: 40px; font-size: 17px; } .wcb.sq { min-width: 40px; font-size: 24px; }
  .welawi { display: none; }
}

/* onboarding polish: "not sure where to start" sentences, a suggested topic, a gentle step change */
.whelp { background: var(--tint); border: 1.5px dashed var(--bdr); border-radius: 16px; padding: 14px 16px; margin: 6px 0 4px; }
.whelp p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink); } .whelp p b { color: var(--headink); }
.wchips { display: flex; flex-wrap: wrap; gap: 8px; }
.wchip { min-height: 44px; padding: 8px 14px; border-radius: 999px; background: var(--white); color: var(--accent); border: 1.5px solid var(--bdr); font: 600 14px var(--body); cursor: pointer; text-align: left; }
.wchip:hover { background: var(--purple); color: #fff; border-color: var(--purple); } .wchip:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.wsug { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: var(--tint); color: var(--accent); border: 1px solid var(--bdr); font-size: 12px; font-weight: 700; vertical-align: 2px; white-space: nowrap; }
@keyframes wstepin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wstep-in { animation: wstepin .22s ease-out; }
@media (prefers-reduced-motion: reduce) { .wstep-in { animation: none; } }

/* onboarding round three: sample questions, how a worksheet works, chosen sentence highlighted */
.wchip[aria-pressed="true"] { background: var(--purple); color: #fff; border-color: var(--purple); }
.wsamp { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--bdr); }
.wopt input:checked + .wcard .wsamp:not(:empty) { display: block; }
.wsamp i { display: block; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.wsamp code { display: block; font: 600 14.5px var(--body); color: var(--ink); padding: 2px 0; overflow-wrap: anywhere; }
.whow { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; margin: 18px 0 0; }
.whow li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.whow li b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--accent); font-size: 14px; }
.whow li strong { display: block; color: var(--headink); font-size: 15px; margin-bottom: 2px; }
@media (max-width: 640px) { .whow { grid-template-columns: 1fr; gap: 8px; } .whow li { padding: 10px 12px; } }

/* Recent marks rows open the worksheet to look again or correct */
.marks .mk.go { cursor: pointer; }
.marks .mk.go:focus-visible { outline: 3px solid var(--purple); outline-offset: -3px; border-radius: 10px; }

/* Mathhh in running text: Math, then a fainter hh (as in the wordmark) */
.hh { opacity: .5; }

/* "Watch it" step-by-step pictures inside notes (static/notes-watch.js) */
.watch { margin: 10px 0 12px; }
.wch { background: var(--white); border: 1px solid var(--bdr); border-radius: 12px; padding: 12px 14px 14px; }
.wch:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.wch-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; font-family: var(--head); color: var(--headink); }
.wch-n { font-size: 14px; color: var(--muted); font-family: var(--body); }
.wch-svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.wch-svg text { font-family: var(--body); font-weight: 600; font-variant-numeric: tabular-nums; }
.wch-say { margin: 8px 0 10px; min-height: 3.1em; font-size: 17px; line-height: 1.5; }
.wch-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wch-bar .btn { min-height: 44px; padding: 0 16px; }
.wt-ink { fill: var(--ink); } .wt-mute { fill: var(--muted); } .wt-pur { fill: var(--accent); } .wt-ok { fill: var(--ok); }
.wf-tint { fill: var(--tint); stroke: var(--bdr); stroke-width: 1; } .wf-p { fill: var(--purple); stroke: var(--bdr); stroke-width: 1; } .wf-ok { fill: var(--ok); stroke: var(--bdr); stroke-width: 1; }
.wl { stroke: var(--muted); stroke-width: 2; stroke-linecap: round; } .wl-heavy { stroke: var(--ink); stroke-width: 3; } .wl-cut { stroke: var(--bdr); stroke-width: 2; } .wl-gap { stroke: var(--white); stroke-width: 3; }
.wring { fill: none; stroke: #e0a400; stroke-width: 3; }
.wi { transition: fill .45s ease; }
.wi.in, .wring.in { animation: wfade .5s ease both; animation-delay: var(--d, 0s); }
@keyframes wfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wgone { from { opacity: 1; } to { opacity: 0; } }
.wi.gone { animation: wgone .28s ease forwards; }
.wch-say { transition: opacity .3s ease, transform .3s ease; }
.wch-say.out { opacity: 0; transform: translateY(6px); transition-duration: .16s; }
@media (prefers-reduced-motion: reduce) { .wi.in, .wring.in, .wi.gone { animation: none; } .wi { transition: none; } .wch-say, .wch-say.out { transition: none; transform: none; } }
@media (max-width: 520px) { .wch-say { font-size: 16px; } }

/* Pencil areas under Try it questions (static/notes-pad.js): optional graph paper, never saved or sent */
.npad-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 6px 0 10px; }
.npad-bar .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
.npad-bar span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.npad { grid-column: 1 / -1; grid-row: 3; flex: 1 1 100%; margin: 8px 0 2px; }
.npad[hidden] { display: none; }
.npad-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.npad-top .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.npad-paper { position: relative; height: 170px; border: 1.5px solid var(--bdr); border-radius: 12px; --grid: rgba(109, 63, 196, .16); background-color: #fff;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 18px 18px; background-position: 8px 8px;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.npad-paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; border-radius: 12px; }
@media (max-width: 560px) { .npad-paper { height: 150px; } }

/* Watch it: curved hops, arrow heads, counters */
.wp { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; } .wp-ok { stroke: var(--ok); } .wp-mute { stroke: var(--muted); } .wp-faint { stroke: var(--lav); stroke-dasharray: 5 6; }
.wa { fill: var(--accent); stroke: none; } .wa-ok { fill: var(--ok); } .wa-mute { fill: var(--muted); }
.wc-p { fill: var(--purple); } .wc-ok { fill: var(--ok); } .wc-tint { fill: var(--tint); stroke: var(--bdr); stroke-width: 1.5; }
.wt-b { font-weight: 800; }
.wf-lav { fill: var(--bdr); stroke: var(--bdr); stroke-width: 1; }
.wl-grey { stroke: var(--grey); }
.wl-ok-ray { stroke: var(--ok); stroke-width: 6; stroke-linecap: round; }

/* ---------- Home: the note first, practise beside it ---------- */
.hm { max-width: 1180px; }
.hmhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 0 0 18px; }
.hmhead h2 { font-size: 36px; margin: 0; color: var(--headink); line-height: 1.12; }
.hmhead .awi { flex: none; width: 104px; height: auto; margin: -10px 0 -12px; }
.hmgrid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.hmgrid.solo { grid-template-columns: minmax(0, 640px); }
.hmrail { display: flex; flex-direction: column; gap: 16px; }
.hmrail .slip { max-width: none; border: 1.5px solid var(--bdr); border-radius: 8px; padding: 16px 16px 14px; background: var(--white); }
.hmrail .slip .lvbadge { width: 48px; height: 48px; font-size: 22px; border-radius: 10px; }
.hmrail .slip .ttitle { font-size: 16px; }
.hmrail .slip .prog { background: var(--tint); }
.hmrail .slip .herobtns { flex-direction: column; align-items: stretch; }
.hmrail .slip .tstart, .hmrail .slip .tstartps { width: 100%; justify-content: center; padding: 0 18px; font-size: 17px; box-shadow: none; }
.hmrail .slip .btn.outline { width: 100%; }
.hmrail .quick { margin-top: 10px; }
.wsgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin: 0 0 8px; }
.wsgrid span { font-size: 12px; text-align: center; padding: 5px 0; border-radius: 5px; background: var(--tint); color: var(--muted); font-variant-numeric: tabular-nums; }
.wsgrid span.done { background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.wsgrid span.now { background: var(--purple); color: #fff; font-weight: 700; }
.wsgrid.hidden, .wsleg.hidden { display: none; }
/* the map of the note's worksheets is never folded away: it stays under the folding part of the panel, and shrinks to a dense strip when the panel is folded */
.wsmap { margin: 16px 0 0; } .wsmap .wsleg { margin: 0 0 12px; }
/* Problem Solving in the map: its own colour (orange), the same three states as the level's boxes */
.psmap { margin: 4px 0 0; } .psmap.hidden { display: none; }
.wsgrid.ps span { background: var(--ps-bg); color: var(--ps-ink); }
.wsgrid.ps span.done { background: var(--ps); color: #fff; font-weight: 600; }
.wsgrid.ps span.now { background: var(--ps-bg); color: var(--ps-ink); font-weight: 700; box-shadow: inset 0 0 0 2px var(--ps); }
/* the Problem Solving Start button is the orange twin of the purple Start worksheet button: same size, shape, weight and play icon, same sentence pattern */
.slip .tstartps { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; padding: 0 28px; margin: 0 0 12px; border: 0; border-radius: 12px; font-size: 18px; font-weight: 700; background: var(--ps-btn); color: #fff; box-shadow: 0 6px 16px rgba(194,97,13,.35); }
.slip .tstart .sb, .slip .tstartps .sb { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.15; } .slip .tstart .sb small, .slip .tstartps .sb small { font-size: 12.5px; font-weight: 600; opacity: .92; letter-spacing: .01em; }
.slip .tstartps:hover { background: #a95208; } .slip .tstartps svg { width: 22px; height: 22px; fill: currentColor; }
.maplegend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 12px; padding: 0; font-size: 13px; color: var(--muted); }
.maplegend.hidden { display: none; } .maplegend li { display: inline-flex; align-items: center; gap: 6px; }
.maplegend .k { width: 14px; height: 14px; border-radius: 4px; background: var(--tint); border: 1px solid var(--bdr); display: inline-block; }
.maplegend .k.done { background: var(--ok-bg); border-color: transparent; } .maplegend .k.now { background: var(--purple); border-color: transparent; } .maplegend .k.ps { background: var(--ps); border-color: transparent; }
@media (min-width: 701px) {
  .hmrail.compact .psmap .wsgrid { grid-template-columns: repeat(auto-fill, minmax(17px, 1fr)); gap: 3px; margin-bottom: 4px; } .hmrail.compact .psmap .wsgrid span { font-size: 9.5px; padding: 2px 0; border-radius: 3px; }
  .hmrail.compact .psmap #startps { margin-bottom: 8px; } .hmrail.compact .maplegend { font-size: 11.5px; margin-bottom: 6px; }
}
@media (min-width: 701px) {
  .hmrail.compact .wsgrid { grid-template-columns: repeat(auto-fill, minmax(17px, 1fr)); gap: 3px; margin-bottom: 4px; } .hmrail.compact .wsgrid span { font-size: 9.5px; padding: 2px 0; border-radius: 3px; }
  .hmrail.compact .wsleg { margin-bottom: 8px; font-size: 12.5px; }
}
.wsleg { margin: 0 0 12px; color: var(--muted); }
.rnotes { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px 12px 10px; }
.rnotes.hidden { display: none; }
.rnotes h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 6px 8px; font-weight: 700; }
.rnl { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: start; padding: 9px 8px; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: 15px; line-height: 1.3; min-height: 44px; }
.rnl:hover { background: var(--soft); }
.rnl.cur { background: var(--tint); color: var(--headink); font-weight: 600; }
.rnln { font-weight: 700; color: var(--accent); text-align: center; } .rnln.ok { color: var(--ok); } .rnln .ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; vertical-align: -3px; }
.hmnote { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 26px clamp(16px, 3.5vw, 38px) 34px; }
.hmnote.hidden { display: none; }
.hnart h2 { font-size: clamp(26px, 3.6vw, 34px); line-height: 1.15; color: var(--headink); margin: 4px 0 8px; }
.hnart .eyebrow { margin: 0; color: var(--muted); font-size: 14px; }
.hnart .nmeta { margin: 0 0 14px; }
.hnart .nsec { box-shadow: none; }
@media (max-width: 700px) {
  .hmgrid, .hmgrid.solo { grid-template-columns: minmax(0, 1fr); }
  .hmgrid, .hmgrid.solo { display: flex; flex-direction: column; gap: 16px; }
  .hmrail { display: contents; }
  main.hm .hmrail .slip { order: 1; } main.hm .hmrail #homeside { order: 2; } main.hm .hmnote { order: 3; } main.hm .hmrail .rnotes { order: 4; }
  .hmhead h2 { font-size: 28px; } .hmhead .awi { width: 80px; }
}
main.hm { display: block; }
.hmrail #homeside { margin: 0; order: 3; } .hmrail .slip { order: 1; } .rnotes { order: 2; }
@media (max-width: 560px) {
  .hmhead { margin-bottom: 10px; } .hmhead h2 { font-size: 25px; } .hmhead .awi { width: 62px; margin: -6px 0 -8px; }
  .hmrail .slip { padding: 12px 14px 10px; } .hmrail .slip .prog { margin: 10px 0 8px; }
  .hmrail .quick { margin-top: 4px; }
  .wsgrid { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; } .wsgrid span { padding: 6px 0; }
}

/* ---------- Home polish: one rhythm for the rail and the note ---------- */
.hmgrid { gap: 24px; align-items: stretch; }
.hmrail { align-self: stretch; }
.hmrail .slip { position: sticky; top: 84px; z-index: 2; }
.hmrail .slip, .rnotes, .hmnote { border-radius: 8px; }
.hmnote { padding: 28px clamp(18px, 3.5vw, 40px) 36px; }
.hnart > .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.hnart h2 { margin: 6px 0 12px; }
.hnart .nmeta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; align-items: center; }
.hnart .nmeta .pill { background: var(--tint); color: var(--headink); border: 1px solid var(--bdr); font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.hnart .nmeta .mchip { font-size: 13px; padding: 4px 12px; }
.hnart .nsec { border-radius: 8px; border: 1px solid var(--line); padding: 18px 20px; margin: 0 0 14px; background: var(--white); }
.hnart .nsec h3 { font-size: 20px; margin: 0 0 10px; }
.hnart .nsec .ex { border-radius: 8px; }
.hmrail .slip .lvline { align-items: flex-start; }
.hmrail .slip #topic { margin: 8px 0 10px; }
.hmrail .slip .wsleg { margin: 0 0 12px; font-size: 14px; }
.rnotes { padding: 14px 10px 10px; }
@media (max-width: 700px) {
  .hmgrid, .hmgrid.solo { align-items: stretch; }
  .hmrail .slip { position: static; }
  .hmnote { padding: 20px 14px 26px; }
  .hnart .nsec { padding: 14px 14px; }
}

.wp-fill { fill: var(--lav); fill-opacity: .55; stroke: none; } .wp-fill2 { fill: var(--ok-bg); stroke: none; } .wf-ok { fill: var(--ok-bg); stroke: var(--ok); stroke-width: 1.5; }

/* ---------- Home polish 2: flatter note, plainer rail ---------- */
/* inside the note, sections are not boxes within a box: a thin rule separates them, and the worked examples sit on the page */
.hnart .nsec { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 22px 0 8px; margin: 0; }
.hnart .nsec:first-of-type { border-top: 0; padding-top: 6px; }
.hnart .nsec.remember, .hnart .nsec.mistakes { border: 0; border-radius: 8px; padding: 18px 20px; margin: 18px 0 8px; }
.hnart .nsec.remember { background: var(--tint); } .hnart .nsec.mistakes { background: var(--mist-bg); }
.hnart .ex { background: transparent; border-radius: 0; padding: 0; margin: 0 0 22px; }
.hnart .ex h4 { font-size: 17px; margin: 0 0 8px; }
.hnart .ex .watch { margin: 6px 0 12px; }
.hnart .nsec h3 { margin-bottom: 12px; }
@media (max-width: 700px) {
  .hmnote { padding: 18px 16px 24px; border-radius: 8px; }
  .hnart .nsec { padding: 18px 0 6px; }
  .hnart .nsec.remember, .hnart .nsec.mistakes { padding: 14px 14px; }
}
/* the advanced topics in the rail: a plain panel, not a second exercise book */
.hmrail #side .book { background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: none; padding: 0; }
.hmrail #side .book::before, .hmrail #side .book::after { display: none; }
.hmrail #side .paper { border-radius: 8px; }
/* quick links under the worksheet panel */
.quick { gap: 2px 18px; }
.wch-n { white-space: nowrap; flex: none; }

/* ---------- Level progress at the top of Home, and the exercise books page ---------- */
.hmhead .pathtop { display: inline-block; margin-top: 12px; text-decoration: none; color: inherit; border-radius: 6px; }
.hmhead .pathtop:focus-visible { outline: 3px solid var(--bdr); outline-offset: 4px; }
.hmhead .pathline { font-size: 15px; font-weight: 700; color: var(--headink); gap: 14px; }
.hmhead .pathline .segs { gap: 4px; }
.hmhead .pathline .segs i { width: 15px; height: 12px; }
.hmhead .pathline .segs i.now { height: 18px; }
@media (max-width: 640px) { .hmhead .pathline { gap: 10px; font-size: 14px; } .hmhead .pathline .segs i { width: 8px; } }
@media (max-width: 560px) { .hmhead .nbdate { display: none; } .hmhead .pathtop { margin-top: 6px; } }
.hmhead .pathline span { white-space: nowrap; }
@media (max-width: 560px) {
  .hmhead { position: relative; display: block; }
  .hmhead .awi { position: absolute; right: 0; top: -4px; margin: 0; }
  .hmhead h2 { padding-right: 70px; }
}

/* advanced topics: on Home only the ones switched on, on the Books page the whole book first */
.hsx:empty { display: none; }
.hsx { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.hsx h3 { margin: 0; padding: 12px 16px 6px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hsx .lrow.trk { grid-template-columns: 34px minmax(0, 1fr); row-gap: 8px; align-items: center; border-bottom: 0; }
.hsx .lrow.trk .rs { grid-column: 1 / -1; justify-self: stretch; } .hsx .lrow.trk .btn.small { width: 100%; justify-content: center; min-height: 44px; }
.hsx .lrow.trk .rn small { display: none; }
.hsx-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 16px; color: var(--accent); font-weight: 600; font-size: 15px; text-decoration: none; }
.hsx-link:hover { background: var(--tint); } .hsx-link .ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }

/* ---------- One page width, and no accent bars ---------- */
.hm { max-width: 1120px; }
#notes main { max-width: 1120px; }
#dashboard main { max-width: 1120px; }
.nstage { padding-left: 0; }
.nstage::before { position: static; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 10px; vertical-align: 1px; flex: none; }
.nstage { justify-content: flex-start; } .nstage > span { margin-left: auto; }
.nstage h3 { display: flex; align-items: center; }

/* the Notes page reads like the note on Home: one white page, sections divided by a thin rule */
.notewrap > article { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 26px clamp(16px, 3.5vw, 38px) 30px; min-width: 0; }
.notewrap > article > .nsec { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 22px 0 8px; margin: 0; }
.notewrap > article > .nsec:first-child { border-top: 0; padding-top: 4px; }
.notewrap > article > .nsec.remember, .notewrap > article > .nsec.mistakes { border: 0; border-radius: 8px; padding: 18px 20px; margin: 18px 0 8px; }
.notewrap > article > .nsec.remember { background: var(--tint); } .notewrap > article > .nsec.mistakes { background: var(--mist-bg); }
.notewrap > article .ex { background: transparent; border-radius: 0; padding: 0; margin: 0 0 22px; }
.notewrap > article .ex h4 { margin: 0 0 8px; }
@media (max-width: 700px) { .notewrap > article { padding: 18px 16px 22px; } .notewrap > article > .nsec { padding: 18px 0 6px; } .notewrap > article > .nsec.remember, .notewrap > article > .nsec.mistakes { padding: 14px; } }
.nmeta .pill { background: var(--tint); color: var(--headink); border: 1px solid var(--bdr); font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.nmeta .pill.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }

/* the left column stays in view while the note scrolls: the worksheet panel on top, the notes of the level below it (scrolls inside its own space) */
@media (min-width: 701px) {
  .hmrail { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); }
  .hmrail .slip { position: static; flex: none; }
  .hmrail .rnotes { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 150px; overflow: hidden; }
  .hmrail .rnotes h3 { flex: none; }
  .hmrail #rnlist { overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--bdr) transparent; position: relative; }
  .hmrail #homeside { flex: none; }
}
.hnart .notenav2 { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
/* the worksheet panel folds down to its Start button as the note scrolls, and unfolds again at the top */
.slipx { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .32s ease, opacity .22s ease; }
.slipx-in { min-height: 0; overflow: hidden; }
.hmrail .slip { transition: padding .32s ease; }
@media (min-width: 701px) {
  .hmrail.compact .slipx { grid-template-rows: 0fr; opacity: 0; }
  .hmrail.compact .slip { padding-top: 12px; padding-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { .slipx, .hmrail .slip { transition: none; } }
}
.quick .ql { font-size: 14px; }
.hmrail .quick { gap: 2px 10px; flex-wrap: nowrap; } .hmrail .quick .ql { font-size: 13px; white-space: nowrap; }
@media (max-width: 700px) { .hmrail .quick { flex-wrap: wrap; } }
/* the three step buttons always share one row, even on a narrow phone */
.wch-bar { flex-wrap: nowrap; }
.wch-bar .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; white-space: nowrap; }
.wch-bar .btn[data-a="next"] { flex: 1.25 1 0; }
@media (max-width: 380px) { .wch-bar { gap: 6px; } .wch-bar .btn { font-size: 15px; padding: 0 4px; } }

/* ---------- Notes on a phone ---------- */
@media (max-width: 560px) {
  #notes main { padding-left: 12px; padding-right: 12px; }
  .notewrap > article { padding: 16px 14px 20px; }
  .hmnote { padding-left: 14px; padding-right: 14px; }
  #notes .noterow .nrside .pill:not(.ok) { display: none; }       /* "You are here" already shows on the highlighted row; it was squeezing the title into a narrow column */
  #notes .noterow { gap: 12px; padding: 14px 14px; }
}
@media (max-width: 430px) { .wch-bar .btn { font-size: 14px; padding: 0 4px; } .wch-bar { gap: 6px; } }
@media (max-width: 560px) { .wch { padding: 10px 8px 12px; border-radius: 10px; } .wch-head { padding: 0 4px; } .wch-say, .wch-bar { padding-left: 4px; padding-right: 4px; } }
@media (max-width: 430px) { .wch-bar .btn[data-a="back"] { flex: 0.8 1 0; } .wch-bar .btn[data-a="replay"], .wch-bar .btn[data-a="next"] { flex: 1.3 1 0; } }
@media (max-width: 340px) { .wch-bar .btn { font-size: 13px; padding: 0 2px; } }
/* on a phone the Watch it picture reaches nearly to the edges of the note card, so its numbers and words are a little bigger */
@media (max-width: 560px) { .wch { margin-left: -10px; margin-right: -10px; } }

/* zoom: phones only */
.wch-zoom { display: none; }
@media (max-width: 560px) {
  .wch-pic { overflow-x: auto; -webkit-overflow-scrolling: touch; cursor: zoom-in; }
  .wch.zoomed .wch-pic { cursor: zoom-out; }
  .wch.zoomed .wch-svg { width: 600px; max-width: none; margin: 0; }
  .wch-zoom { display: block; width: 100%; background: none; border: 0; padding: 4px 4px 8px; font: 500 13px var(--body); color: var(--muted); text-align: center; min-height: 44px; }
}

/* Eraser: the button stays pressed while it is on, and the writing boxes show a rubber cursor */
#eraser.on, #eraser[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
#work.erasing .ans canvas { cursor: cell; }
#eraser, #undo, #clear { display: inline-flex; align-items: center; justify-content: center; gap: 7px; } #eraser svg, #undo svg, #clear svg { flex: none; }

/* Try it pencil areas: buttons under the pad (Eraser, Undo, Clear, Submit) and the marks */
.npad-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.npad-acts .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.npad-acts [data-a="eraser"], .npad-acts [data-a="undo"], .npad-acts [data-a="clear"] { display: inline-flex; align-items: center; justify-content: center; gap: 7px; } .npad-acts svg { flex: none; }
.npad-acts [data-a="eraser"].on, .npad-acts [data-a="eraser"][aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.npad.erasing .npad-paper canvas { cursor: cell; }
@media (max-width: 560px) { .npad-acts .btn { padding: 0 12px; flex: 1 1 0; } }

/* Try it: with the pencil areas showing, the revealed answer is written in the bottom right corner of that question's pad */
.trysec.pads-on .try .ta { display: none; }
.npad-ans { position: absolute; right: 10px; bottom: 8px; max-width: 70%; padding: 6px 14px; border-radius: 10px; background: var(--ok-bg); color: var(--ok-ink); font: 800 20px var(--head); text-align: right; overflow-wrap: anywhere; pointer-events: none; animation: ansIn .18s ease-out; }
.npad-ans[hidden] { display: none; }
.npad-ans .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .npad-ans { animation: none; } }

/* Try it on phones: question, then the pad with Show answer on its header line (above the corner where the answer appears), then Eraser, Undo, Clear */
.npad-top .npad-show { display: none; }
.trysec .try.shown .npad-show { background: var(--tint); }
@media (max-width: 720px) {
  .npad-top { min-height: 40px; gap: 8px; }
  .npad-top .npad-show { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 128px; min-height: 40px; padding: 0 14px; font-size: 14px; }
  .trybar { flex-wrap: nowrap; gap: 10px; } .trybar .trycount[data-none] { display: none; } .trybar .btn { margin-left: auto; } .trybar .trycount { flex: 1 1 0; min-width: 0; font-size: 13.5px; line-height: 1.35; }
  .trybar .btn { flex: none; white-space: nowrap; min-height: 40px; padding: 0 14px; font-size: 14px; }
  .npad-bar { gap: 8px; align-items: stretch; } .npad-bar .btn { flex: 1 1 0; min-width: 0; min-height: 42px; padding: 0 10px; font-size: 14px; white-space: nowrap; margin: 0; } .npad-bar > span { flex: 1 1 100%; font-size: 13px; }
  .trybar:has(.trycount[data-none]) { display: none; }
}
@media (max-width: 400px) { .npad-q { display: none; } }
/* Show all answers carries the .small class (margin 2px 0 12px from .nsec .small): the two buttons on the Try it bar must line up exactly */
.npad-bar { align-items: center; } .npad-bar .btn, .npad-bar .btn.small { margin: 0; min-height: 44px; font-size: 15px; padding: 0 18px; }
@media (max-width: 720px) { .npad-bar .btn, .npad-bar .btn.small { min-height: 42px; font-size: 14px; padding: 0 10px; } }
/* Watch it buttons on phones: "Replay" without the word "step" so the label never crowds its button */
@media (max-width: 430px) { .wch-bar [data-a="replay"] .wch-sfx { display: none; } .wch-bar .btn { padding: 0 8px; } .wch-bar .btn[data-a="back"] { flex: 0.9 1 0; } }

/* ---- audit fixes (27 Nov 2026) ---- */
/* the Watch it buttons: drop the word "step" from Replay whenever the player itself is narrow (the Home note on an iPad as well as phones) */
.wch { container-type: inline-size; }
@container (max-width: 420px) { .wch-bar [data-a="replay"] .wch-sfx { display: none; } .wch-bar .btn { padding: 0 8px; } }
/* the note's contents bar must not make the page wider than the screen */
@media (max-width: 720px) { .toc { min-width: 0; max-width: 100%; box-sizing: border-box; } }
/* result card buttons: same height whether a link or a button */
.rbtns { align-items: stretch; } .rbtns .btn { box-sizing: border-box; min-height: 52px; justify-content: center; }
/* small tap targets */
#login .ctoggle { min-height: 44px; } .lp-top a[href$="blog/"] { padding-left: 10px; padding-right: 10px; }

/* landing: plain links inside the sections use the brand colour, not the browser's blue */
#landing section a:not(.btn):not([class]), #landing .lp-pcta a { color: var(--accent); }
/* the 404 page */
.nf-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; } .nf-btns .btn { text-decoration: none; }
/* footer: on a phone the second column gets the room for "Contact us / Report a mistake" */
@media (max-width: 560px) { .sf-main { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }

/* ---- app audit fixes (27 Nov 2026) ---- */
/* the Previous / Next note cards: stacked and full width on a phone (they used to be a sideways carousel that cut the cards off) */
@media (max-width: 720px) { .nnrow { display: flex; flex-direction: column; overflow: visible; margin: 0; padding: 0; gap: 10px; } .nncard, .nncard.next, .nncard.prev { flex: none; width: 100%; box-sizing: border-box; } }
.nncard.next:only-child { grid-column: 1 / -1; }
/* the notes list beside the Home note fades while more notes are hidden below */
#rnlist.more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
/* on the iPad side bar the hint is just "n of N answered" */
@media (min-width: 600px) and (pointer: coarse) { .subhint-more { display: none; } }
/* dashboard: the calendar card is as wide as the chart when they stack */
@media (max-width: 820px) { .dcal .chart { max-width: none; } }
.calgrid { gap: 6px; } .calgrid .day.star small { font-size: 10px; }
/* notes hub: the stage name and its count always sit on two lines on a phone */
@media (max-width: 560px) { .nstage { flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 2px 8px; } .nstage::before { flex: none; } .nstage span { flex-basis: 100%; white-space: nowrap; margin-left: 18px; text-align: left; } }
/* settings: balanced wrapping for the card headings and help lines */
#settings h3, #settings .card > p { text-wrap-style: balance; }      /* the longhand only: the text-wrap shorthand would also switch off white-space: nowrap on the .nw ranges */
/* the two result-card buttons (a link and a button) line up and centre their text the same way */
#result .rbtns a.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.sf-col a, .sf-col .sf-btn { min-width: 44px; }
.calgrid .day.star small { font-size: 11px; }

/* Settings, Level row: on a phone the long level name takes the whole line under its label instead of three ragged right-aligned lines */
@media (max-width: 560px) { .srow:has(#slevel) { flex-direction: column; align-items: flex-start; gap: 4px; } .srow:has(#slevel) b { text-align: left; } }
/* Change my level: the "You are here" tag drops under the level name on a phone so the name keeps its width */
@media (max-width: 560px) { .wcard { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px 12px; align-items: start; } .wcard .wbd { grid-row: 1; } .wcard .wt { grid-column: 2; grid-row: 1; min-width: 0; } .wcard .wtag { grid-column: 2; grid-row: 2; justify-self: start; } }

.rbtns .btn, #result .rbtns a.btn { margin: 0; }
.nf-btns a.btn { color: #fff; } .nf-btns a.btn.ghost { color: var(--accent); }

/* Try it: the Pen only choice on the pencil-area bar */
.npad-pen { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.npad-pen input { width: 20px; height: 20px; accent-color: var(--purple); }
@media (max-width: 560px) { .npad-bar .npad-pen { flex: 0 0 auto; } }

/* the Try it section is for writing: no text highlighting or iOS callout here, so a resting palm (or a long press) cannot start one on the questions or the buttons */
.trysec, #try-it, .npad, .npad-bar { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.trysec .btn, #try-it .btn, .npad .btn { -webkit-touch-callout: none; }
/* Watch it in a longer language (Bahasa Malaysia): the buttons may take two lines and the heading may wrap, so nothing is wider than the card */
.wch-head { flex-wrap: wrap; row-gap: 2px; }
@media (max-width: 520px) { .wch-bar .btn { white-space: normal; line-height: 1.15; font-size: 14px; padding: 0 6px; } .wch-n { white-space: normal; flex: 0 1 auto; } }
.cr-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(127,127,127,.55); text-underline-offset: 3px; } .cr-link:hover, .cr-link:focus-visible { text-decoration-color: currentColor; }

/* ---------- UI polish: buttons, hit areas and borders (both languages) ---------- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }          /* the old lavender ring was hard to see */
/* the three quick links under today's worksheet are real buttons now: a 44px hit area, one border style, a press state, and they wrap instead of clipping (Bahasa Malaysia is longer) */
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ql { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--bdr); border-radius: 10px; background: var(--white); color: var(--accent); font: 600 15px/1.2 var(--body); text-decoration: none; transition: background .12s, border-color .12s, transform .1s; }
.ql:hover { background: var(--tint); border-color: var(--accent); } .ql:active { transform: scale(.98); }
/* the two Start buttons: the bold line never wraps (a lone "75" on a second line), and each has a visible focus ring and a press state */
.hmrail .slip .tstart .sb b, .hmrail .slip .tstartps .sb b { white-space: nowrap; font-size: 16px; }
.hmrail .slip .tstart, .hmrail .slip .tstartps { padding: 0 14px; gap: 8px; }
.slip .tstart:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; } .slip .tstartps:focus-visible { outline: 3px solid var(--ps-btn); outline-offset: 3px; }
.slip .tstart:active, .slip .tstartps:active { transform: scale(.985); box-shadow: none; }
@media (max-width: 700px) { .hmrail .slip .tstart .sb b, .hmrail .slip .tstartps .sb b { font-size: 18px; } .hmrail .slip .tstart, .hmrail .slip .tstartps { padding: 0 18px; gap: 10px; } }
/* every outlined button shares the 1.5px border and darkens its border on hover and press */
.btn.ghost:hover, .slip .btn.outline:hover, .lrow .btn.small:hover { border-color: var(--accent); }
.btn.ghost:active, .slip .btn.outline:active { transform: scale(.98); }
/* touch screens: every control has at least a 44px hit area */
@media (pointer: coarse) { .btn, .btn.small, .lrow .btn.small, .srow .btn.small, .ql, .hsx-link, .rnl, .rs.lk, .bk-h { min-height: 44px; } }
/* Watch it buttons: labels wrap inside their button instead of being cut off (Bahasa Malaysia: "Main semula langkah") */
.wch-bar { flex-wrap: nowrap; }
.wch-bar .btn { flex: 1 1 auto; min-width: 0; white-space: normal; line-height: 1.15; text-align: center; padding: 6px 10px; font-size: 15px; }
.wch-bar .btn[data-a="next"] { flex: 1.3 1 auto; }
.hmrail .quick { flex-wrap: wrap; gap: 8px; margin-top: 12px; } .hmrail .quick .ql { font-size: 14px; white-space: normal; }
@media (max-width: 700px) { .btn.small, .btn.ghost.small, #recclear, .srow .btn.small { min-height: 44px; } }
.tgl { position: relative; } .tgl::after { content: ""; position: absolute; inset: -6px -4px; }          /* the switch looks 52x32 but its hit area is 60x44 */

/* ---------- UI polish, round 2 ---------- */
/* worksheet header: the title wraps into two clean lines (level, then worksheet) instead of being cut off, and the chips never break in two */
#wlevel .nw + .nw { margin-left: .5em; font-weight: 500; opacity: .92; }
#score, #sct, #timer { white-space: nowrap; }
@media (max-width: 720px) { #wlevel { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; } #wlevel .nw { display: block; } #wlevel .nw + .nw { margin-left: 0; } }
/* Settings: on a phone a row's button goes under its text at full width (the text was squeezed into a narrow column), and the hint under the topic switches matches the other small print */
#settings #trkbox > p { font-size: 14px; line-height: 1.5; }
@media (max-width: 560px) {
  #settings .srow:has(> .btn) { flex-direction: column; align-items: stretch; gap: 10px; }
  #settings .srow:has(> .btn) > .btn { width: 100%; justify-content: center; text-align: center; }
}

/* ---------- Tracks on Home: one chip per track, one map, one Start button, one colour per track ---------- */
/* Level purple, Problem Solving orange, Vectors teal, Matrices pink, Probability gold, Statistics blue. Colour says which track; the fill says the state (solid passed, ringed now, pale still to come). */
.t-L { --tc: #6d3fc4; --tc-bg: #efe9fb; --tc-ink: #3a2179; }
.t-PS { --tc: #c2610d; --tc-bg: #fdebd8; --tc-ink: #7a3d00; }
.t-VEC { --tc: #0b7a7c; --tc-bg: #d8f1f0; --tc-ink: #064f51; }
.t-MAT { --tc: #b3306f; --tc-bg: #fbe1ee; --tc-ink: #7a1b49; }
.t-PRB { --tc: #946200; --tc-bg: #faefcc; --tc-ink: #5c3d00; }
.t-STA { --tc: #2257b8; --tc-bg: #dce8fb; --tc-ink: #173a7a; }
:root[data-theme="dark"] .t-L { --tc: #8a63dc; --tc-bg: #2d2548; --tc-ink: #d9ccff; }
:root[data-theme="dark"] .t-PS { --tc: #d9731a; --tc-bg: #3d2a17; --tc-ink: #ffd2a3; }
:root[data-theme="dark"] .t-VEC { --tc: #14a3a6; --tc-bg: #12373a; --tc-ink: #9de6e7; }
:root[data-theme="dark"] .t-MAT { --tc: #d6498b; --tc-bg: #43192f; --tc-ink: #ffc2dd; }
:root[data-theme="dark"] .t-PRB { --tc: #c28a0a; --tc-bg: #3d3010; --tc-ink: #ffe29a; }
:root[data-theme="dark"] .t-STA { --tc: #4b7fe0; --tc-bg: #1c2b4d; --tc-ink: #b8d0ff; }
.slip .lvbadge { background: var(--tc); } .slip .prog i { background: var(--tc); }
.slip .tstart { background: var(--tc); box-shadow: 0 6px 16px color-mix(in srgb, var(--tc) 35%, transparent); }
.slip .tstart:hover { background: var(--tc); filter: brightness(.92); box-shadow: 0 9px 20px color-mix(in srgb, var(--tc) 42%, transparent); }
.slip .tstart:focus-visible { outline-color: var(--tc); }
.wsgrid span { background: var(--tc-bg); color: var(--tc-ink); }
.wsgrid span.done { background: var(--tc); color: #fff; font-weight: 600; }
.wsgrid span.now { background: var(--tc-bg); color: var(--tc-ink); font-weight: 700; box-shadow: inset 0 0 0 2px var(--tc); }
.maplegend .k { background: var(--tc-bg); border: 0; } .maplegend .k.done { background: var(--tc); } .maplegend .k.now { background: var(--tc-bg); box-shadow: inset 0 0 0 2px var(--tc); }
.slip .lvbadge { font-size: 22px; } .slip.t-L .lvbadge { font-size: 26px; }

/* ---------- Track switcher: the worksheet header is the switch (no row of chips) ---------- */
.slip .lvline { width: 100%; text-align: left; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 12px; transition: background .12s, box-shadow .12s; }
.slip .lvline:hover:not(:disabled) { background: var(--tc-bg); box-shadow: 0 0 0 8px var(--tc-bg); }
.slip .lvline:focus-visible { outline: 3px solid var(--tc); outline-offset: 6px; }
.slip .lvline:disabled { opacity: 1; cursor: default; }
.trkchev { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--tc); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
#trkbtn[aria-expanded="true"] .trkchev { transform: rotate(180deg); } #trkbtn.one .trkchev { display: none; }
.trkmenu { display: grid; gap: 6px; margin: 12px 0 4px; } .trkmenu[hidden] { display: none; }
.trkopt { position: relative; overflow: hidden; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 9px 12px 11px; border: 1.5px solid var(--bdr); border-radius: 12px; background: var(--white); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s, transform .1s; }
.trkopt:hover { border-color: var(--tc); } .trkopt:active { transform: scale(.985); } .trkopt:focus-visible { outline: 3px solid var(--tc); outline-offset: 2px; }
.trkopt[aria-current="true"] { border-color: var(--tc); background: var(--tc-bg); }
.trkopt .to-b { width: 38px; height: 38px; border-radius: 10px; background: var(--tc); color: #fff; display: grid; place-items: center; font: 800 15px var(--head); }
.trkopt .to-t b { display: block; font-size: 15px; line-height: 1.2; } .trkopt .to-t small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.trkopt .to-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--tc-bg); } .trkopt .to-bar b { display: block; height: 100%; background: var(--tc); }
.trkopt .to-ok { width: 22px; height: 22px; fill: none; stroke: var(--tc); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* the three links under the map: one quiet line of text links (not three buttons); a 44px hit area; hidden on phones, where the bottom bar has them */
.hmrail .quick { display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: 6px; }
.hmrail .quick .ql { flex: none; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: none; font-size: 13px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--bdr); text-underline-offset: 4px; }
.hmrail .quick .ql:hover { background: none; text-decoration-color: var(--accent); }
@media (max-width: 560px) { .hmrail .quick { display: none; } }

/* the track switch stays when the panel folds on scroll (only the label above it, the progress bar and the topic line fold); the folded map is a little larger */
.hmrail.compact .slip .lvbadge { width: 40px; height: 40px; font-size: 18px; } .hmrail.compact .slip .ttitle { font-size: 15px; } .hmrail.compact .slip .wsline { font-size: 13.5px; }
.slip .slipk { margin: 0; } .slip .slipx:first-child .slipx-in { padding-bottom: 12px; } .hmrail.compact .slip .slipx:first-child .slipx-in { padding-bottom: 0; }
@media (min-width: 701px) { .hmrail.compact .wsgrid { grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 3px; } .hmrail.compact .wsgrid span { font-size: 10.5px; padding: 3px 0; } }
.hmrail.compact .slip .lvline { margin-bottom: 10px; }

/* ---------- Home rail, round 4: purple level card, orange Problem Solving card, then the advanced topics in a closed accordion ---------- */
#trksecs .slip { margin-top: 14px; }
.slip.flat { border: 0; background: none; padding: 0; margin: 0; box-shadow: none; max-width: none; }
.hsx { margin-top: 18px; }
.acch { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.acc { margin: 0 0 6px; border: 1.5px solid var(--bdr); border-radius: 12px; background: var(--white); overflow: hidden; }
.acc:has(.acc-h[aria-expanded="true"]) { border-color: var(--tc); }
.acc-h { position: relative; width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr) 24px; align-items: center; gap: 12px; min-height: 56px; padding: 9px 12px 11px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.acc-h:hover { background: var(--tc-bg); } .acc-h:focus-visible { outline: 3px solid var(--tc); outline-offset: -3px; }
.acc-h .to-b { width: 38px; height: 38px; border-radius: 10px; background: var(--tc); color: #fff; display: grid; place-items: center; font: 800 15px var(--head); }
.acc-h .to-t b { display: block; font-size: 15px; line-height: 1.2; } .acc-h .to-t small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.acc-h .to-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--tc-bg); } .acc-h .to-bar b { display: block; height: 100%; background: var(--tc); }
.acc-chev { width: 24px; height: 24px; fill: none; stroke: var(--tc); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.acc-h[aria-expanded="true"] .acc-chev { transform: rotate(180deg); }
.acc-b { padding: 6px 14px 14px; } .acc-b[hidden] { display: none; }
.acc-b .wsmap { margin-top: 12px; }
.tnote { display: inline-block; margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: underline; text-decoration-color: var(--bdr); text-underline-offset: 3px; background: none; border: 0; padding: 0; }
.tnote.hidden { display: none; }
.hmrail > .quick { margin-top: 10px; }

/* the left column is plain flowing content now (two track cards, the accordion and the notes list are taller than a screen): not sticky, no folding */
@media (min-width: 701px) { .hmrail { position: static; max-height: none; align-self: start; } .hmrail.compact .slipx { grid-template-rows: 1fr; opacity: 1; } }
main.hm .hmrail > .slip { order: 1; } main.hm #trksecs { order: 2; } main.hm .hmrail > #homeside { order: 3; } main.hm .hmrail > .quick { order: 4; } main.hm .hmrail > .rnotes { order: 6; } main.hm .hmnote { order: 5; }
@media (min-width: 701px) { main.hm .hmnote { order: 0; } }
#trksecs .slip { margin-top: 0; }
.tsec .herobtns { margin-top: 12px; }
#homeside.hsx { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
#homeside .acc + .acc { margin-top: 8px; } #homeside .acc { margin-bottom: 0; }
.tnote { display: inline-flex; align-items: center; min-height: 44px; margin: 0; }

/* the accordion opens and closes smoothly: the body animates from 0 to its height (grid rows 0fr -> 1fr), the content fades, the chevron turns */
.acc-b { display: grid; grid-template-rows: 0fr; padding: 0; transition: grid-template-rows .32s cubic-bezier(.4, 0, .2, 1); }
.acc.open > .acc-b { grid-template-rows: 1fr; }
.acc-bi { min-height: 0; overflow: hidden; opacity: 0; visibility: hidden; padding: 0 14px; transition: opacity .22s ease, visibility 0s linear .32s, padding .32s cubic-bezier(.4, 0, .2, 1); }
.acc.open > .acc-b > .acc-bi { opacity: 1; visibility: visible; padding: 6px 14px 14px; transition: opacity .28s ease .08s, visibility 0s, padding .32s cubic-bezier(.4, 0, .2, 1); }
.acc { transition: border-color .2s ease; } .acc-h { transition: background .12s; }
@media (prefers-reduced-motion: reduce) { .acc-b, .acc-bi, .acc.open > .acc-b > .acc-bi, .acc-chev { transition: none; } }

/* ---------- Button polish round (English and Bahasa Malaysia, every page) ---------- */
/* Watch it buttons on a phone: Back and Replay share the first row, Next step takes the full width below (three Malay labels do not fit in one row, so "Kembali" and "Main semula" were squeezed and overlapped) */
@media (max-width: 560px) {
  .wch-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .wch-bar .btn, .wch-bar .btn[data-a="back"], .wch-bar .btn[data-a="replay"], .wch-bar .btn[data-a="next"] { flex: none; width: 100%; min-width: 0; min-height: 44px; padding: 6px 10px; font-size: 15px; white-space: normal; line-height: 1.15; }
  .wch-bar .btn[data-a="next"] { grid-column: 1 / -1; order: 3; }
  .wch-bar [data-a="replay"] .wch-sfx { display: none; }
  .wch-bar { grid-auto-rows: minmax(48px, auto); align-items: stretch; } .wch-bar .btn { min-height: 48px; height: 100%; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
}
/* Try it bar and pencil bar (notes): labels wrap instead of overlapping, 44px high, the "Pen only" tick and the hint get their own line on a phone */
.trybar .btn, .npad-bar .btn, .npad-bar .btn.small, .npad-top .npad-show { min-height: 44px; }
@media (max-width: 720px) {
  .trybar { flex-wrap: wrap; } .trybar .btn { white-space: normal; text-align: center; line-height: 1.15; min-height: 44px; padding: 6px 14px; margin-left: auto; }
  .npad-bar { flex-wrap: wrap; align-items: stretch; } .npad-bar .btn, .npad-bar .btn.small { flex: 1 1 140px; min-height: 44px; padding: 6px 10px; white-space: normal; text-align: center; line-height: 1.15; }
  .npad-bar .npad-pen { flex: 1 1 100%; min-height: 44px; } .npad-bar > span { flex: 1 1 100%; }
  .npad-top .npad-show { min-height: 44px; width: auto; min-width: 128px; white-space: normal; line-height: 1.15; }
}
/* the worksheet's header icon buttons are 44px on a phone */
@media (max-width: 720px) {
  #work .top #back, #work .top #notesbtn, #work .top .themebtn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  #work .top #pausebtn { width: 44px; height: 44px; }
}
/* small buttons in Settings and rows are 44px high at every width (they were 40 to 41 on a computer) */
.btn.small, .srow .btn.small, #recclear { min-height: 44px; }

/* ---- Dashboard as a profile ---- */
.pcover { position: relative; height: 150px; margin: 0 -24px; border-radius: 0 0 22px 22px; overflow: hidden; background-color: #5a31ad; background-image: linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px); background-size: 28px 28px; }
.pcover img { position: absolute; right: 28px; bottom: -4px; height: 138px; width: auto; }
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; margin: -48px 0 0; position: relative; padding: 0 4px; }
.pav { position: relative; flex: none; width: 104px; height: 104px; border-radius: 50%; background: var(--tint); border: 5px solid var(--paper); box-sizing: border-box; display: grid; place-items: center; font: 800 46px var(--head); color: var(--purple); }
.pav[data-lv]:not([data-lv=""])::after { content: attr(data-lv); position: absolute; right: -14px; bottom: 2px; background: var(--purple); color: #fff; border: 3px solid var(--paper); border-radius: 999px; padding: 2px 9px; font: 600 12px var(--body, inherit); white-space: nowrap; }
.pwho { flex: 1 1 260px; min-width: 0; padding-bottom: 4px; } .pwho h2 { margin: 0; font-size: 32px; } #dashboard .pwho .sub { margin: 4px 0 0; }
.pact { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 6px; } .pact .btn { min-height: 46px; }
.pnext { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 22px 0 18px; padding: 18px 22px; background: var(--tint); border: 1.5px solid var(--bdr); border-radius: 18px; }
.pnext > div { flex: 1 1 260px; min-width: 0; } .pnext .btn { min-height: 50px; padding: 0 26px; font-size: 17px; }
.pnl { font: 600 12px var(--body, inherit); letter-spacing: .08em; text-transform: uppercase; color: var(--purple); }
.pnt { font: 800 22px/1.25 var(--head); margin-top: 3px; } .pns { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pwk { display: flex; gap: 8px; } .pwd { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pwd b { font-size: 13px; } .pwd small { color: var(--muted); font-size: 12px; min-height: 15px; text-align: center; }
.pdisc { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; box-sizing: border-box; }
.pwd.on .pdisc { background: var(--purple); color: #fff; } .pwd.off .pdisc { background: var(--tint); border: 2px dashed var(--bdr); } .pwd.now .pdisc { background: var(--tint); border: 2px solid var(--purple); }
.pbadges { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 16px 12px; }
.pbd { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; } .pbd b { font-size: 13px; line-height: 1.3; font-weight: 600; } .pbd small { color: var(--muted); font-size: 12px; }
.pbdisc { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font: 800 18px var(--head); box-sizing: border-box; }
.pbd.got .pbdisc { background: var(--tint); border: 2.5px solid var(--purple); color: var(--headink); } .pbd.todo .pbdisc { background: var(--white); border: 2px dashed var(--bdr); color: var(--muted); } .pbd.todo { opacity: .85; }
.prules { margin: 12px 2px 0; color: var(--muted); font-size: 14px; } .prules summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--headink); font-weight: 600; } .prules p { margin: 0 0 8px; max-width: 62ch; line-height: 1.55; }
.pfr { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); } .pfr:first-child { border-top: 0; }
.pfr > div { flex: 1 1 auto; min-width: 0; } .pfr b { display: block; font-weight: 600; font-size: 15px; } .pfr small { color: var(--muted); font-size: 13px; } .pfw { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pfd { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; } .pfd.ok { background: var(--purple); color: #fff; } .pfd.no { background: var(--tint); color: var(--headink); border: 2px dashed var(--bdr); }
@media (max-width: 700px) { .pcover { margin: 0 -14px; height: 120px; } .pcover img { height: 112px; right: 14px; } .pav { width: 88px; height: 88px; font-size: 38px; } .pwho h2 { font-size: 27px; } .pact { width: 100%; } .pact .btn { flex: 1 1 0; } .pbadges { grid-template-columns: repeat(3, 1fr); } .pwk { gap: 4px; } .pdisc { width: 36px; height: 36px; font-size: 13px; } }
#preport { display: none; }
@media print {
  body > *:not(#preport) { display: none !important; }
  #preport { display: block !important; padding: 0; color: #000; font: 14px/1.5 system-ui, sans-serif; }
  #preport h1 { font-size: 28px; margin: 0; } #preport h1 span { color: #666; } #preport h2 { font-size: 16px; margin: 22px 0 6px; border-bottom: 1px solid #999; padding-bottom: 3px; }
  #preport .prm { margin: 4px 0 18px; color: #444; font-size: 15px; } #preport .prf { margin-top: 28px; color: #555; font-size: 12px; }
  #preport table { width: 100%; border-collapse: collapse; } #preport th { text-align: left; font-size: 12px; color: #555; font-weight: 600; padding: 4px 8px 4px 0; } #preport td { padding: 5px 8px 5px 0; font-size: 16px; }
  #preport .prl td { font-size: 14px; border-top: 1px solid #ddd; }
}
.pwho { padding-top: 54px; } .pact { padding-top: 54px; }
@media (max-width: 700px) { .pwho { padding-top: 50px; flex-basis: 100%; } .pact { padding-top: 0; } #pstart { display: none; } .pnext .btn { width: 100%; } }
.phead { align-items: flex-start; }
/* mockup polish: tabs, two columns, cards with their own headings */
#dashboard main { max-width: 1180px; }
.pcover { height: 210px; } .pcover img { height: 196px; right: 36px; }
.pdate { position: absolute; left: 32px; top: 24px; color: #e9e2f8; font-size: 14px; font-weight: 500; }
.pav { width: 132px; height: 132px; font-size: 58px; } .pav[data-lv]:not([data-lv=""])::after { font-size: 13px; padding: 3px 11px; bottom: 6px; }
.phead { margin-top: -62px; padding: 0 12px; gap: 14px 26px; } .pwho { padding-top: 70px; } .pact { padding-top: 70px; }
.pwho h2 { font-size: 38px; letter-spacing: -.02em; line-height: 1.1; } #dashboard .pwho .sub { font-size: 16px; line-height: 1.45; max-width: 60ch; }
.ptabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 26px 0 22px; padding: 0 12px; border-bottom: 1.5px solid var(--line); }
.ptabs button { min-height: 46px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1.5px; background: none; border-radius: 12px 12px 0 0; font: 500 15px var(--body, inherit); color: var(--muted); cursor: pointer; }
.ptabs button:hover { background: var(--tint); } .ptabs button.on { color: var(--headink); font-weight: 600; border-bottom-color: var(--purple); }
.pcols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; } .pleft { flex: 1 1 320px; max-width: 390px; min-width: 0; display: flex; flex-direction: column; gap: 18px; } .pright { flex: 999 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.prc { padding: 20px 22px; border-radius: 18px; border: 1.5px solid var(--line); } .prc h3 { margin: 0; font: 800 20px var(--head); color: var(--ink); }
.pch { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .pcn { color: var(--muted); font-size: 14px; } .pcsub { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.pab { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; } .prc h3 + div > .pab:first-child { margin-top: 10px; } .pab span { color: var(--muted); } .pab b { font-weight: 500; text-align: right; }
.ptr { margin-top: 16px; } .ptr > div:first-child { display: flex; align-items: center; gap: 10px; } .ptr i { width: 12px; height: 12px; border-radius: 50%; background: var(--tc); flex: none; } .ptr b { flex: 1 1 auto; font-weight: 600; font-size: 15px; } .ptr span { color: var(--muted); font-size: 13px; }
.pbar2 { height: 8px; border-radius: 8px; background: var(--tint); margin-top: 8px; overflow: hidden; } .pbar2 i { display: block; height: 100%; width: 3%; border-radius: 8px; background: var(--tc); }
.pweek { margin-top: 16px; } .pfeed { margin-top: 10px; } .pbadges { margin-top: 14px; }
.pnext { margin: 0; } .dstats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .dnudge { margin: -4px 2px 0; }
@media (max-width: 900px) { .dstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .pcover { height: 150px; } .pcover img { height: 140px; right: 12px; } .pdate { left: 16px; top: 14px; } .pav { width: 96px; height: 96px; font-size: 42px; } .phead { margin-top: -48px; padding: 0 2px; } .pwho { padding-top: 54px; } .pwho h2 { font-size: 30px; } .ptabs { padding: 0; margin: 18px 0; } .ptabs button { flex: 1 1 0; padding: 0 8px; } .pleft { max-width: none; } .prc { padding: 16px 18px; } }
.pleft .pbadges { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pbd b { font-size: 12.5px; } .ptr b { white-space: nowrap; } .ptr span { white-space: nowrap; }
@media (max-width: 700px) { .pwho { padding-top: 0; } .pcols { flex-direction: column; flex-wrap: nowrap; gap: 18px; } .pright { order: -1; width: 100%; flex: none; } .pleft { width: 100%; flex: none; } }
@media (max-width: 700px) { .pact { padding-top: 0; } .phead { row-gap: 8px; } }
/* profile polish round 2 */
.pchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .pch1 { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--white); border: 1.5px solid var(--bdr); color: var(--headink); font-size: 13.5px; font-weight: 600; }
.pch1 svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; } .pch1.hot { background: var(--ps-bg); border-color: #f0c493; color: var(--ps-ink); }
.pnb { height: 8px; border-radius: 8px; background: #fff; margin-top: 12px; overflow: hidden; max-width: 420px; } .pnb i { display: block; height: 100%; border-radius: 8px; background: var(--purple); }
.pnext { background: linear-gradient(135deg, var(--tint), #fff 140%); box-shadow: 0 1px 0 rgba(58,33,121,.04), 0 8px 24px -14px rgba(58,33,121,.35); }
.dstat { transition: transform .15s, box-shadow .15s; } .dstat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgba(58,33,121,.5); }
.dstat:nth-child(2) .dsi { background: #fbefc9; color: #5c3d00; } .dstat:nth-child(3) .dsi { background: var(--ps-bg); color: var(--ps-ink); } .dstat:nth-child(4) .dsi { background: #d8f1f0; color: #064f51; }
.g-p { --bc: #6d3fc4; --bb: #efe9fb; --bi: #3a2179; } .g-m { --bc: #946200; --bb: #faefcc; --bi: #5c3d00; } .g-s { --bc: #c2610d; --bb: #fdebd8; --bi: #7a3d00; } .g-o { --bc: #0b7a7c; --bb: #d8f1f0; --bi: #064f51; }
.pbd.got .pbdisc { background: var(--bb); border-color: var(--bc); color: var(--bi); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bc) 14%, transparent); } .pbd.todo .pbdisc { border-color: var(--bdr); }
.pnbd { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; padding: 14px; border-radius: 14px; background: var(--bb); border: 1.5px solid color-mix(in srgb, var(--bc) 30%, transparent); } .pnbd > div { flex: 1 1 auto; min-width: 0; } .pnbd b { display: block; font-size: 15px; color: var(--bi); margin: 1px 0 6px; } .pnbd small { color: var(--bi); font-size: 12.5px; opacity: .85; display: block; }
.pnbd .pbdisc { flex: none; background: #fff; border: 2.5px solid var(--bc); color: var(--bi); } .pnbd .pbar2 { background: #fff; margin: 0 0 6px; } .pnbd .pbar2 i { background: var(--bc); }
.pwd.now b { color: var(--purple); } .pwd.on .pdisc { box-shadow: 0 0 0 4px rgba(109,63,196,.14); }
.pfr { border-radius: 10px; transition: background .12s; } .pfr:hover { background: var(--soft); }
:root[data-theme="dark"] .pch1 { background: #2a2540; } :root[data-theme="dark"] .pnb, :root[data-theme="dark"] .pnbd .pbdisc, :root[data-theme="dark"] .pnbd .pbar2 { background: #2a2540; }
@media (prefers-reduced-motion: reduce) { .dstat { transition: none; } .dstat:hover { transform: none; } }
/* profile polish round 3 */
.pmini { max-width: 520px; margin-top: 14px; gap: 6px; } .pmini .dow { font-size: 12px; } .pmini .day { font-size: 14px; aspect-ratio: 1.15; border-radius: 12px; } .pmini .day.star { background: var(--purple); }
.pmopen { margin-top: 14px; min-height: 44px; } .pbdisc { position: relative; }
.pnew { position: absolute; top: -6px; right: -12px; font: 700 10px/1 var(--body, inherit); font-style: normal; letter-spacing: .04em; text-transform: uppercase; background: var(--ps-btn); color: #fff; padding: 4px 6px; border-radius: 999px; border: 2px solid var(--white); animation: pnewpop .5s ease-out both; }
@keyframes pnewpop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
#dashboard .ppanel:not(.hidden) .prc, #dashboard .ppanel:not(.hidden) .pnext { animation: prise .35s ease-out both; } #dashboard .ppanel:not(.hidden) .prc:nth-child(2) { animation-delay: .05s; } #dashboard .ppanel:not(.hidden) .prc:nth-child(3) { animation-delay: .1s; }
@keyframes prise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pnew, #dashboard .ppanel .prc, #dashboard .ppanel .pnext { animation: none !important; } }
.pmini i { aspect-ratio: auto !important; } .pmini .day { height: 40px; } .pmini .dow { height: 22px; padding: 0; }
.ptr > div:first-child { flex-wrap: wrap; row-gap: 2px; } .ptr b { white-space: normal; } .ptr span { white-space: normal; margin-left: auto; text-align: right; }
.pmini .day.star { font-size: 0; } .pmini .day.star small { position: static; font-size: 14px; font-weight: 600; opacity: 1; }
/* profile in dark mode */
:root[data-theme="dark"] .pnext { background: linear-gradient(135deg, #2b2350, #1f1b33 140%); border-color: #4a3d82; }
:root[data-theme="dark"] .pnl { color: #b9a4f0; } :root[data-theme="dark"] .pnt { color: #f1ecff; } :root[data-theme="dark"] .pnext .pnb { background: #3a3160; } :root[data-theme="dark"] .pnb i { background: #9a79ea; }
:root[data-theme="dark"] .g-p { --bc: #9a79ea; --bb: #2c2350; --bi: #dccffa; } :root[data-theme="dark"] .g-m { --bc: #c28a0a; --bb: #3d3010; --bi: #ffe29a; }
:root[data-theme="dark"] .g-s { --bc: #d9731a; --bb: #3d2a17; --bi: #ffd2a3; } :root[data-theme="dark"] .g-o { --bc: #14a3a6; --bb: #12373a; --bi: #9de6e7; }
:root[data-theme="dark"] .pbd.todo .pbdisc { background: #1f1b33; color: #a9a4bd; }
:root[data-theme="dark"] .dstat:nth-child(2) .dsi { background: #3d3010; color: #ffe29a; } :root[data-theme="dark"] .dstat:nth-child(3) .dsi { background: #3d2a17; color: #ffd2a3; } :root[data-theme="dark"] .dstat:nth-child(4) .dsi { background: #12373a; color: #9de6e7; }
:root[data-theme="dark"] .pch1.hot { background: #3d2a17; border-color: #7a4a1a; color: #ffd2a3; }
/* ---- Who is learning (several learners on one sign-in) ---- */
#who { min-height: 100vh; box-sizing: border-box; color: #fff; background-color: #5a31ad; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 32px 32px; display: flex; flex-direction: column; }
.whotop { display: flex; align-items: center; justify-content: space-between; padding: 18px max(20px, 4vw); }
.whologo { font: 800 28px var(--head); letter-spacing: -.02em; } .whologo span { color: var(--lav); }
.whoout { min-height: 44px; padding: 0 6px; background: none; border: 0; color: #e9e2f8; font: 500 15px inherit; cursor: pointer; } .whoout:hover { text-decoration: underline; }
.whomain { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px 20px 64px; }
.whomain h1 { margin: 0; font: 800 clamp(30px, 5vw, 52px)/1.1 var(--head); letter-spacing: -.02em; } .whosub { margin: 12px 0 0; color: #e0d7f6; font-size: 18px; max-width: 52ch; }
.whogrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 34px 30px; margin-top: 48px; max-width: 980px; }
.wtile { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 150px; padding: 0; background: none; border: 0; color: #fff; cursor: pointer; font: inherit; }
.wtile b { font-weight: 600; font-size: 19px; } .wtile small { color: #e0d7f6; font-size: 13.5px; margin-top: -8px; }
.wavbox { position: relative; display: block; width: 140px; height: 140px; }
.wav { width: 140px; height: 140px; border-radius: 24px; display: grid; place-items: center; overflow: hidden; font: 800 60px var(--head); transition: transform .15s, box-shadow .15s; box-sizing: border-box; }
.wav img { width: 100%; height: 100%; object-fit: cover; object-position: top; } .wav svg { width: 48px; height: 48px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.wadd .wav { background: none !important; border: 3px dashed var(--lav); }
.wtile:hover .wav, .wtile:focus-visible .wav { transform: translateY(-4px); box-shadow: 0 0 0 4px #fff; } .wtile:focus-visible { outline: none; } .wtile.cur .wav { box-shadow: 0 0 0 4px #fff; }
.wpen { position: absolute; inset: 0; border-radius: 24px; background: rgba(30,20,60,.55); display: grid; place-items: center; } .wpen svg { width: 42px; height: 42px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.whobar { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 48px; } .whobar .btn { min-height: 48px; padding: 0 28px; }
.whobar .btn.ghost { background: none; color: #fff; border: 2px solid var(--lav); } .whobar .btn.ghost:hover { background: rgba(255,255,255,.14); } .whobar #whodone { background: #fff; color: var(--deep); }
.whocount { margin: 20px 0 0; color: var(--lav); font-size: 14px; }
.whoform { width: 100%; max-width: 540px; margin-top: 28px; background: #fff; color: var(--ink); border-radius: 22px; padding: 30px 30px 26px; box-sizing: border-box; text-align: left; }
.whoform h2 { margin: 0; font: 800 30px var(--head); letter-spacing: -.02em; color: var(--ink); } .wfsub { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.whoform label:not(.rad), .wflabel { display: block; margin-top: 22px; font-weight: 600; font-size: 15px; }
.whoform input[type=text], .whoform select { width: 100%; box-sizing: border-box; margin-top: 8px; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--bdr); border-radius: 12px; font: 17px inherit; color: var(--ink); background: #fff; }
.wfnote { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.wfav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; } .wfa { padding: 0; border: 0; background: none; border-radius: 16px; cursor: pointer; min-width: 44px; min-height: 44px; } .wfa .wav { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; } .wfa.on .wav { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--purple); } .wfa:hover .wav { transform: scale(1.06); box-shadow: none; } .wfa.on:hover .wav { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--purple); }
.wflang { display: flex; gap: 10px; margin-top: 10px; } .wferr { margin: 14px 0 0; color: var(--bad); font-weight: 600; min-height: 0; }
.wfbtns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; } .wfbtns .btn { min-height: 52px; flex: 1 1 180px; } .wfbtns .btn.ghost { flex: 0 1 160px; }
.wfdel { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); } .wfrm { min-height: 44px; background: none; border: 0; color: var(--bad); font: 600 15px inherit; cursor: pointer; padding: 0; } .wfrm:hover { text-decoration: underline; }
.wfconf p { margin: 0 0 10px; color: var(--muted); font-size: 14px; } .wfconf .btn { margin-top: 10px; min-height: 48px; } .wfconf .btn:disabled { opacity: .45; }
.slrnbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 560px) { .whogrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; margin-top: 32px; } .wtile { width: auto; } .wavbox, .wav { width: min(140px, 100%); height: auto; aspect-ratio: 1; } .wavbox { width: 100%; max-width: 150px; } .whoform { padding: 22px 18px; } .wflang { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .wav { transition: none; } .wtile:hover .wav { transform: none; } }
@media (max-width: 560px) { .whogrid { width: 100%; max-width: 400px; } .wtile small { font-size: 12.5px; } }
/* add / edit learner: form card with a live preview and a side panel */
.wfwrap { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 28px; width: 100%; max-width: 940px; margin-top: 12px; }
.wfwrap .whoform { flex: 1 1 520px; max-width: 560px; margin-top: 0; }
.wfside { flex: 1 1 280px; max-width: 320px; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.wfcard { background: rgba(255,255,255,.12); border-radius: 18px; padding: 20px 22px; color: #e0d7f6; font-size: 15px; line-height: 1.55; } .wfcard h3 { margin: 0 0 10px; font: 800 19px var(--head); color: #fff; } .wfcard p { margin: 0; }
.wfslots { display: flex; gap: 8px; margin-bottom: 12px; } .wfslots i { flex: 1 1 0; height: 10px; border-radius: 6px; background: rgba(255,255,255,.28); } .wfslots i.on { background: #fff; } .wfslots i.new { background: #fff; opacity: .55; box-shadow: 0 0 0 2px #fff; }
.wfback { min-height: 44px; margin: -8px 0 6px -8px; padding: 0 8px; background: none; border: 0; color: var(--headink); font: 600 15px inherit; cursor: pointer; } .wfback:hover { text-decoration: underline; }
.wfprev { display: flex; align-items: center; gap: 18px; } .wfprev > span .wav { width: 84px; height: 84px; border-radius: 20px; font-size: 38px; } .wfprev h2 { margin: 0; } .wfprev .wfsub { margin-top: 4px; }
.whoform .wflang .rad { flex: 1 1 0; } .whoform .wflang .rad span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--bdr); background: #fff; color: var(--muted); font-weight: 500; cursor: pointer; padding: 0 12px; text-align: center; } .whoform .wflang .rad input:checked + span { background: var(--tint); border: 2px solid var(--purple); color: var(--deep); font-weight: 600; } .whoform .wflang .rad input:focus-visible + span { outline: 3px solid #9a79ea; outline-offset: 2px; }
.whoform select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6877' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 20px; padding-right: 44px; }
.whoform input[type=text]:focus-visible, .whoform select:focus-visible { outline: 3px solid #9a79ea; outline-offset: 1px; border-color: var(--purple); }
.wfbtns .btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 700px) { .wfwrap { gap: 18px; } .wfside { max-width: none; flex-basis: 100%; } .wfprev > span .wav { width: 64px; height: 64px; font-size: 28px; } }
/* onboarding polish: three steps, person icon, wider skip button */
.whosteps { justify-content: center; margin: 0 0 18px; } .whosteps:empty { display: none; }
.whosteps li { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #e9e2f8; } .whosteps li b { background: rgba(255,255,255,.25); color: #fff; }
.whosteps li.on { background: #fff; border-color: #fff; color: var(--deep); } .whosteps li.on b { background: var(--purple); color: #fff; }
.whosteps li.done { background: rgba(255,255,255,.14); color: #fff; } .whosteps li.done b { background: #fff; color: var(--ok-ink); }
.wfkick { font: 600 12px var(--body, inherit); letter-spacing: .08em; text-transform: uppercase; color: var(--purple); } .wfkick:empty { display: none; }
.wperson { width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; opacity: .9; }
.wfbtns .btn.ghost { flex: 0 1 210px; white-space: nowrap; }
@media (max-width: 640px) { .whosteps li span { display: none; } .whosteps li { padding-right: 5px; } .whosteps li.on span { display: inline; padding-right: 8px; } }

/* Scratch paper: a floating sheet for working out on a tablet or desktop (never on a phone). Nothing is saved or sent. */
#scratchbtn { order: 5; } #scratchbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
@media (max-width: 767px), (max-height: 540px) { #scratchbtn, .scratch, .spchip { display: none !important; } }
.scratch { position: fixed; z-index: 13; left: 0; top: 0; width: 440px; height: 520px; min-width: 300px; min-height: 340px; display: flex; flex-direction: column; background: #fffef8; color: #1c1b22; border: 1px solid var(--lav); border-radius: 18px; box-shadow: 0 2px 0 var(--lav), 0 24px 60px rgba(40,20,90,.35); overflow: hidden; }
.sphead { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 6px 0 14px; background: #efe9fb; border-bottom: 1px solid var(--lav); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.sphead:active { cursor: grabbing; } .sphead b { flex: 1; font-family: var(--head); font-weight: 800; font-size: 18px; color: var(--deep); }
.spgrip { fill: #8f7cc4; }
.scratch svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .scratch .spgrip { fill: #8f7cc4; stroke: none; }
.spib { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--deep); border: 1.5px solid transparent; background: transparent; }
.spib svg { width: 22px; height: 22px; } .sphead .spib:hover { background: #e2d9f6; }
.sptools { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-bottom: 1px solid #ece6f8; flex-wrap: wrap; }
.sptools .spib { border-color: var(--lav); background: #fff; color: #5d5a68; } .sptools .spib.on { border: 2px solid var(--purple); background: #efe9fb; color: var(--deep); }
.spsep { width: 1px; height: 28px; background: #e2dbf3; margin: 0 2px; } .spgrow { flex: 1; }
.spcol { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--lav); } .spcol.on { box-shadow: 0 0 0 3px var(--purple); }
.sptools { min-height: 60px; } .spclr { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--lav); background: #fff; color: #5d5a68; font-weight: 600; font-size: 14px; }
.spbody { position: relative; flex: 1 1 auto; min-height: 0; background-color: #fffef8; background-image: radial-gradient(#d9d2ec 1.2px, transparent 1.4px); background-size: 24px 24px; }
#spcv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.spask { position: absolute; inset: 0; background: rgba(255,254,248,.94); display: grid; align-content: center; justify-items: center; gap: 14px; padding: 20px; text-align: center; } .spask p { margin: 0; font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--deep); } .spask div { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.spfoot { display: flex; align-items: center; gap: 8px; padding: 10px 44px 10px 16px; background: #efe9fb; border-top: 1px solid var(--lav); color: var(--deep); font-size: 14px; font-weight: 500; } .spfoot svg { flex: none; }
.spresize { position: absolute; right: 0; bottom: 0; width: 40px; height: 40px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 55%, #8f7cc4 55%, #8f7cc4 62%, transparent 62%, transparent 72%, #8f7cc4 72%, #8f7cc4 79%, transparent 79%); }
.spchip { position: fixed; z-index: 13; min-height: 56px; padding: 0 22px 0 16px; border-radius: 28px; background: var(--purple); color: #fff; font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 10px 28px rgba(40,20,90,.4); } .spchip svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#work .top .link, #scratchbtn { white-space: nowrap; }
@media (max-width: 1180px) { #scratchbtn .nt { display: none; } #scratchbtn { width: 44px; min-height: 44px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; } }
