/* =========================================================
   PathwayPro Revise

   Built for an iPad on a desk: big targets, one question at a time,
   and room to write. The PathwayPro palette does the chrome; each
   subject brings one colour, used sparingly.
   ========================================================= */

:root {
  --ink: #253238;
  --ink-2: #3a4a52;
  --ink-3: #56666e;
  --muted: #7a878d;
  --paper: #f6f4ef;
  --card: #ffffff;
  --card-2: #f0ede6;
  --line: #e2ddd3;
  --line-2: #ece8e0;

  --gold: #cca300;
  --gold-deep: #8f7300;
  --gold-soft: rgba(204, 163, 0, .13);
  --terra: #c76639;
  --terra-deep: #983400;
  --terra-soft: rgba(199, 102, 57, .12);
  --sage: #5f8a7a;
  --sage-soft: rgba(95, 138, 122, .14);
  --blue: #2f6690;
  --blue-soft: rgba(47, 102, 144, .12);

  --good: #3f7d4e;
  --good-soft: rgba(63, 125, 78, .13);
  --warn: #b7791f;
  --warn-soft: rgba(183, 121, 31, .14);
  --bad: #b3261e;
  --bad-soft: rgba(179, 38, 30, .1);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(37, 50, 56, .06), 0 6px 20px rgba(37, 50, 56, .06);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Montserrat", var(--font);

  --subject: var(--ink);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.stack.loose { gap: 20px; }
.between { justify-content: space-between; }
.center { text-align: center; }

.ic {
  width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 16px; height: 16px; stroke-width: 2; }
.ic-lg { width: 28px; height: 28px; stroke-width: 1.6; }

/* ---------- wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center; font-family: var(--display);
  font-weight: 900; letter-spacing: -.035em; font-size: 20px; line-height: 1; white-space: nowrap;
  text-decoration: none;
}
.wm-pathway { color: transparent; -webkit-text-stroke: 1.2px var(--ink-3); paint-order: stroke fill; }
.wm-pro { color: var(--ink); }
.wm-tm {
  display: inline-grid; place-items: center; width: .58em; height: .58em; margin: 0 .04em;
  border: .055em solid var(--ink); border-radius: 99px; color: var(--ink);
  font-size: .62em; font-weight: 800; letter-spacing: -.04em; align-self: flex-start; transform: translateY(-.14em);
}
.wm-tm span { font-size: .52em; }
.wm-app { color: var(--terra); letter-spacing: -.02em; margin-left: .2em; }
.wordmark-lg { font-size: 34px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 20px;
  padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }
.who { font-size: 14px; color: var(--ink-3); text-align: right; line-height: 1.25; }
.who b { color: var(--ink); display: block; font-weight: 700; }

.shell { display: flex; min-height: calc(100vh - 64px); }
.rail {
  width: 232px; flex: none; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--card);
  position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto;
}
.rail a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; margin-bottom: 2px;
}
.rail a:hover { background: var(--card-2); }
.rail a.on { background: var(--ink); color: #fff; }
.rail a .count { margin-left: auto; background: var(--terra); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 8px; }
.rail .sect { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; font-weight: 700; }
.main { flex: 1; min-width: 0; padding: 26px 28px 80px; max-width: 1240px; }
.main.narrow { max-width: 880px; margin: 0 auto; }

@media (max-width: 900px) {
  .rail {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; width: auto; z-index: 40;
    display: flex; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: none; border-top: 1px solid var(--line);
    overflow-x: auto;
  }
  .rail .sect { display: none; }
  .rail a { flex-direction: column; gap: 3px; font-size: 11px; padding: 7px 10px; margin: 0; flex: 1; min-width: 64px; text-align: center; }
  .rail a .count { position: absolute; margin: 0; transform: translate(14px, -4px); }
  .main { padding: 18px 16px 110px; }
  .topbar { padding: 0 16px; }
  .hide-sm { display: none !important; }
}

/* ---------- type ---------- */
h1 { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 700; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.lede { color: var(--ink-3); font-size: 16px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .grow h1 { margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 600; text-decoration: none; font-size: 14px; margin-bottom: 8px; }

/* ---------- surfaces ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 20px;
}
.card.flat { box-shadow: none; }
.card.tight { padding: 14px 16px; }
.card h2 + * { margin-top: 12px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.daybars { display: flex; gap: 8px; align-items: flex-end; height: 110px; margin-top: 10px; }
.daybars .db { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.daybars .db-track { flex: 1; width: 100%; max-width: 26px; background: var(--line); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.daybars .db-track i { display: block; width: 100%; border-radius: 6px; min-height: 2px; }
.daybars span { font-size: 11px; color: var(--muted); }
.time-big { font-size: 28px; font-weight: 800; line-height: 1.1; }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid > * { min-width: 0; }
.grid.wide-right { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); }
@media (max-width: 900px) { .grid.two, .grid.three, .grid.wide-right { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .who { display: none; } .wordmark { font-size: 17px; } .card { padding: 16px; } .qcard { padding: 18px; } }
.check > span, .check > div { min-width: 0; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

a.card, button.card { display: block; text-decoration: none; text-align: left; width: 100%; transition: transform .08s ease, box-shadow .15s ease; }
a.card:hover, button.card:hover { box-shadow: 0 2px 4px rgba(37,50,56,.08), 0 12px 30px rgba(37,50,56,.1); }
a.card:active, button.card:active { transform: scale(.985); }

.subject-bar { border-left: 5px solid var(--subject); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 15px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: transform .06s ease, filter .15s ease, background .15s ease; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1d2426; }
.btn-terra { background: var(--terra); border-color: var(--terra); color: #fff; }
.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 17px; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--ink-2); }
.icon-btn:hover { background: var(--card-2); }

/* ---------- forms ---------- */
.f { display: flex; flex-direction: column; gap: 6px; }
.f > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.in, select.in, textarea.in {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.in { min-height: 110px; resize: vertical; line-height: 1.5; }
.in:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(37, 50, 56, .08); }
.in.big { font-size: 26px; letter-spacing: .12em; text-transform: uppercase; text-align: center; font-weight: 800; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; background: var(--card-2); color: var(--ink-2); white-space: nowrap;
}
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.gold { background: var(--gold-soft); color: var(--gold-deep); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.terra { background: var(--terra-soft); color: var(--terra-deep); }
.chip.dark { background: var(--ink); color: #fff; }
.chip.subject { background: color-mix(in srgb, var(--subject) 13%, white); color: var(--subject); }
button.chip { cursor: pointer; }
button.chip.on { background: var(--ink); color: #fff; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list > .li {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-2);
  text-decoration: none; color: inherit;
}
.list > .li:last-child { border-bottom: none; }
a.li:hover { background: #fbfaf7; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; margin-bottom: 8px; color: var(--line); stroke-width: 1.4; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 700; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }
.bar .good { background: var(--good); }
.bar .gold { background: var(--gold); }
.bar .terra { background: var(--terra); }
.bar .ink { background: var(--ink-3); }

/* ---------- toast / modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 100;
  transition: all .2s ease; pointer-events: none; max-width: calc(100vw - 32px); box-shadow: var(--shadow);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); }
@media (max-width: 900px) { .toast { bottom: 96px; } }

.modal-back {
  position: fixed; inset: 0; background: rgba(20, 28, 32, .45); z-index: 80;
  display: grid; place-items: center; padding: 20px; animation: fade .15s ease;
}
.modal {
  background: var(--card); border-radius: var(--r-lg); width: min(560px, 100%); max-height: calc(100vh - 40px);
  overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal.wide { width: min(880px, 100%); }
@keyframes fade { from { opacity: 0; } }

.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink);
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px 0; }

/* =========================================================
   Sign in
   ========================================================= */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(460px, 100%); }
.gate .brand-mark { width: 64px; height: 64px; border-radius: 18px; background: var(--ink); display: grid; place-items: center; color: var(--gold); margin-bottom: 18px; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; padding: 2px; }
.names button { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 600; padding: 6px 10px; }
.names button:active { transform: scale(.97); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 8px 0 16px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.keypad button { height: 60px; border-radius: 16px; background: var(--card-2); font-size: 24px; font-weight: 700; }
.keypad button:active { background: var(--line); transform: scale(.96); }
.staff-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; color: var(--ink-3); font-weight: 600; font-size: 14px; }

/* =========================================================
   Learner home
   ========================================================= */
.hero {
  background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 24px; margin-bottom: 20px;
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap; position: relative; overflow: hidden;
}
.hero h1 { color: #fff; }
.hero .lede { color: rgba(255, 255, 255, .72); }
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  border: 36px solid rgba(204, 163, 0, .16);
}
.stat { min-width: 110px; }
.stat b { display: block; font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 12.5px; color: rgba(255, 255, 255, .7); }

.task, a.card.task {
  display: flex; gap: 14px; align-items: center; padding: 16px 18px;
}
.task .dot { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--subject) 13%, white); color: var(--subject); flex: none; }
.task h3 { font-size: 16.5px; }
.task .meta { font-size: 13.5px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.task .progress { width: 120px; }
@media (max-width: 600px) { .task .progress { display: none; } }

.tabs { display: inline-flex; background: var(--card-2); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.tabs button { padding: 8px 16px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink-3); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* =========================================================
   Question runner
   ========================================================= */
.runner-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.qdots { display: flex; gap: 6px; flex-wrap: wrap; }
.qdots button {
  width: 34px; height: 34px; border-radius: 10px; font-weight: 700; font-size: 13px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-3);
}
.qdots button.done { background: var(--sage-soft); border-color: transparent; color: var(--sage); }
.qdots button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.qcard { padding: 26px; }
.qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.qnum { font-family: var(--display); font-weight: 800; font-size: 15px; background: var(--ink); color: #fff; border-radius: 9px; padding: 3px 10px; }
.stem { font-size: 19px; line-height: 1.55; font-weight: 500; white-space: pre-wrap; }
.marks { color: var(--ink-3); font-weight: 700; }
.context {
  background: #faf8f3; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin: 14px 0;
  font-size: 15px; white-space: pre-wrap; font-family: var(--font); overflow-x: auto;
}
.context.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; }
.step-label { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--ink-2); margin: 20px 0 8px; }
.step-label .n { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #1d2426; display: grid; place-items: center; font-size: 13px; }
.step-label.locked { color: var(--muted); }
.step-label.locked .n { background: var(--line); color: var(--muted); }

.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; text-align: left; font-size: 17px; line-height: 1.45;
  transition: border-color .12s, background .12s, transform .06s;
}
.opt:active { transform: scale(.99); }
.opt .l { width: 32px; height: 32px; border-radius: 10px; background: var(--card-2); display: grid; place-items: center; font-weight: 800; flex: none; }
.opt.on { border-color: var(--ink); background: #f8f9fa; }
.opt.on .l { background: var(--ink); color: #fff; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .l { background: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .l { background: var(--bad); color: #fff; }
.options.locked { position: relative; }
.options.locked .opt { filter: blur(6px); pointer-events: none; user-select: none; }
.lock-note {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  color: var(--ink-2); font-weight: 700; z-index: 2;
}
.lock-note > div { background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }

/* ---------- ink pad ---------- */
.inkpad { border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; overflow: hidden; position: relative; }
.ink-tools { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line-2); background: #fcfbf8; flex-wrap: wrap; position: relative; }
.ink-tools .tgroup { display: flex; align-items: center; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line-2); position: relative; }
.ink-tools .tgroup:empty { display: none; }
.ink-tools .tsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.ink-tools .tool { height: 38px; min-width: 38px; padding: 0 9px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.ink-tools .tool:hover { background: var(--card-2); }
.ink-tools .tool.on { background: var(--ink); color: #fff; }
.ink-tools .tool.size i { display: block; border-radius: 50%; background: currentColor; }
.ink-tools .tool.size i.ring { background: transparent; border: 1.5px solid currentColor; }
.ink-tools .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); margin: 0 2px; }
.ink-tools .sw.on { box-shadow: 0 0 0 2.5px var(--ink); }
.ink-tools .status { margin-left: auto; font-size: 12.5px; color: var(--muted); padding: 0 6px; }
.ink-menu { position: absolute; top: 42px; right: 0; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 140px; display: flex; flex-direction: column; }
.ink-menu button { text-align: left; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.ink-menu button.on { background: var(--gold-soft); color: var(--gold-deep); }
.ink-area { position: relative; touch-action: none; }
.ink-area canvas { display: block; width: 100%; touch-action: none; }
.ink-area .ink-fg { position: absolute; left: 0; top: 0; cursor: crosshair; }
.ink-area .hint { position: absolute; left: 60px; top: 12px; color: #b8b2a6; font-size: 14px; pointer-events: none; }
.ink-text-input { position: absolute; z-index: 5; min-height: 2.4em; border: 1.5px dashed var(--gold); border-radius: 6px; background: rgba(255, 255, 255, .92); padding: 2px 4px; outline: none; resize: both; font-family: Inter, sans-serif; line-height: 1.3; }
.eraser-ring { position: absolute; border: 1.5px solid var(--ink-3); border-radius: 50%; background: rgba(255, 255, 255, .45); transform: translate(-50%, -50%); pointer-events: none; z-index: 4; }
.ink-grow { display: flex; justify-content: center; border-top: 1px dashed var(--line); }
.ink-grow button { font-size: 13px; color: var(--ink-3); padding: 6px 10px; font-weight: 600; }
.inkpad.full { position: fixed; inset: 0; z-index: 95; border-radius: 0; display: flex; flex-direction: column; border: none; }
.inkpad.full .ink-tools { padding: 10px max(12px, env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top)); }
.inkpad.full .ink-area { flex: 1; overflow-y: auto; touch-action: pan-y; }
.inkpad.full .ink-area canvas { touch-action: none; }
.inkpad.full .ink-grow { padding-bottom: env(safe-area-inset-bottom); }
body.ink-fullscreen { overflow: hidden; }

/* ---------- label diagrams ---------- */
.label-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .label-wrap { grid-template-columns: 1fr; } }
.diagram { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.diagram svg { display: block; width: 100%; height: auto; }
.badge {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center;
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .1s;
}
.badge.filled { background: var(--sage); }
.badge.on { background: var(--gold); color: #1d2426; transform: scale(1.18); }
.badge.right { background: var(--good); }
.badge.wrong { background: var(--bad); }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line); background: #fff;
  text-align: left; min-height: 44px; font-size: 15px;
}
.slot .n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: 12px; display: grid; place-items: center; flex: none; }
.slot.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.slot .empty-v { color: var(--muted); font-style: italic; }
.wordbank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.word {
  min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14.5px;
}
.word.used { opacity: .4; }
.word:active { transform: scale(.96); }

/* ---------- spreadsheet ---------- */
.sheet-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff; }
.fx-bar { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--line); }
.fx-bar .name { width: 70px; text-align: center; font-weight: 700; font-size: 14px; border-right: 1px solid var(--line); padding: 12px 0; background: #f7f7f5; }
.fx-bar .fx { padding: 0 10px; font-style: italic; font-weight: 700; color: var(--ink-3); font-family: Georgia, serif; }
.fx-bar input { flex: 1; border: none; outline: none; padding: 12px 10px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 16px; min-width: 0; }
table.sheet { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.sheet th { background: #f2f2ef; color: var(--ink-3); font-weight: 600; font-size: 12px; padding: 4px 8px; border: 1px solid #e3e3de; min-width: 34px; }
.sheet td { border: 1px solid #e3e3de; padding: 5px 8px; min-width: 84px; height: 30px; white-space: nowrap; }
.sheet td.n { text-align: right; font-variant-numeric: tabular-nums; }
.sheet td.target { outline: 2px solid var(--good); outline-offset: -2px; background: #f3faf5; font-weight: 700; }
.sheet td.fill { background: #f7faf8; color: var(--good); }
.sheet td.err { color: var(--bad); }
.sheet-note { font-size: 13px; color: var(--ink-3); padding: 8px 12px; border-top: 1px solid var(--line-2); background: #fcfbf8; }

/* ---------- saved / nav ---------- */
.runner-nav { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.saved { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.feedback-box { border-radius: var(--r-md); padding: 14px 16px; margin-top: 16px; }
.feedback-box.good { background: var(--good-soft); }
.feedback-box.part { background: var(--gold-soft); }
.feedback-box.bad { background: var(--bad-soft); }
.feedback-box h4 { font-size: 14px; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.memo { background: #faf8f3; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 14.5px; white-space: pre-wrap; }
.ink-img { max-width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: block; }

/* =========================================================
   Report
   ========================================================= */
.ring { width: 118px; height: 118px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 28px; font-weight: 800; }
.band { border-top: 4px solid var(--band); }
.band.know { --band: var(--good); }
.band.developing { --band: var(--gold); }
.band.struggling { --band: var(--terra); }
.band h2 { display: flex; align-items: center; gap: 8px; }
.srow { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.srow:last-child { border-bottom: none; }
.srow .t { font-size: 12px; color: var(--muted); font-weight: 600; }
.srow .s { font-weight: 600; font-size: 14.5px; }
.focus-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.focus-item:last-child { border-bottom: none; }
.focus-item .rank { width: 32px; height: 32px; border-radius: 10px; background: var(--terra); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; }
.sched-day { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.sched-day:last-child { border-bottom: none; }
.sched-day .d { font-weight: 800; line-height: 1.2; }
.sched-day .d span { display: block; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.session { border-left: 4px solid var(--subject); background: #fbfaf7; border-radius: 0 10px 10px 0; padding: 8px 12px; margin-bottom: 6px; }
.session:last-child { margin-bottom: 0; }
.session b { display: block; font-size: 14.5px; }
.session .a { font-size: 13.5px; color: var(--ink-2); }
.week-head { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 0 2px; }

/* ---------- heat map ---------- */
.heat td.c { text-align: center; font-weight: 700; font-size: 13px; min-width: 70px; }
.heat .h0 { background: var(--bad-soft); color: var(--bad); }
.heat .h1 { background: var(--warn-soft); color: var(--warn); }
.heat .h2 { background: var(--gold-soft); color: var(--gold-deep); }
.heat .h3 { background: var(--good-soft); color: var(--good); }
.heat .hp { font-style: italic; }
.heat th.rot { font-size: 11.5px; text-transform: none; letter-spacing: 0; max-width: 120px; white-space: normal; }

/* ---------- review ---------- */
.review-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1050px) { .review-grid { grid-template-columns: 1fr; } }
.review-item { margin-bottom: 16px; }
.review-item .side { background: #fcfbf8; border-left: 1px solid var(--line-2); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: 42px; height: 42px; font-size: 20px; font-weight: 700; color: var(--ink-2); }
.stepper button:active { background: var(--card-2); }
.stepper input { width: 64px; height: 42px; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-weight: 800; font-size: 17px; outline: none; }
.conf { font-size: 12px; font-weight: 700; }
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.sticky-foot {
  position: sticky; bottom: 0; background: rgba(246, 244, 239, .95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding: 12px 0; margin-top: 18px; z-index: 5;
}
@media (max-width: 900px) { .sticky-foot { bottom: 70px; } }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--r-md); padding: 22px; text-align: center; background: #fcfbf8; cursor: pointer;
}
.dropzone.has { border-style: solid; border-color: var(--sage); background: var(--sage-soft); }

.item-preview { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: #fff; }
.item-preview .opts { margin: 6px 0 0 18px; font-size: 14px; }
.item-preview .opts li.ans { color: var(--good); font-weight: 700; }

/* =========================================================
   Print: the error report
   ========================================================= */
@media print {
  body { background: #fff; }
  .topbar, .rail, .no-print, .toast { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .hero { background: #fff; color: var(--ink); border: 1px solid var(--line); }
  .hero h1, .hero .stat b { color: var(--ink); }
  .hero .lede, .hero .stat span { color: var(--ink-3); }
  .hero::after { display: none; }
  .sched-day { break-inside: avoid; }
  @page { margin: 14mm; }
}

/* ---------- maths notation (same look as Evaluate) ---------- */
.m-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 3px; line-height: 1.2; }
.m-frac .m-num { border-bottom: 1px solid currentColor; padding: 0 4px 1px; font-size: .9em; }
.m-frac .m-den { padding: 1px 4px 0; font-size: .9em; }
.m-radicand { border-top: 1px solid currentColor; padding: 0 2px; margin-left: 1px; }
.m-rootindex { font-size: .7em; vertical-align: super; margin-right: -3px; }
.m-stack { display: inline-flex; flex-direction: column; vertical-align: middle; line-height: 1; font-size: .72em; margin-left: 1px; }
.m-stack-sup { transform: translateY(-.15em); }
.m-stack-sub { transform: translateY(.2em); }
.m-var { font-family: Georgia, "Times New Roman", serif; }
sup, sub { font-size: .72em; line-height: 0; }

/* ---------- charts ---------- */
.pie { position: relative; flex: none; }
.pie svg { width: 100%; height: 100%; display: block; }
.pie-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.pie-c b { font-family: var(--display); font-size: 26px; font-weight: 800; }
.pie-c span { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.spark { display: block; }

/* ---------- learner dashboard ---------- */
.subj-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; margin: 0 4px; }
.rail a.on .subj-dot { box-shadow: 0 0 0 2px #fff; }
.motivate {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap; border-radius: var(--r-lg); padding: 24px;
  background: var(--ink); color: #fff; margin-bottom: 16px; position: relative; overflow: hidden;
}
.motivate::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .06); pointer-events: none; }
.motivate h1 { color: #fff; font-size: 26px; }
.motivate p { color: rgba(255, 255, 255, .8); margin-top: 6px; max-width: 640px; }
.motivate .eyebrow { color: rgba(255, 255, 255, .6); }
.motivate-ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--gold); flex: none; }
.motivate.tone-terra .motivate-ic { color: #f0a27d; }
.motivate.tone-good .motivate-ic { color: #8fd3a0; }
.motivate.tone-blue .motivate-ic { color: #9cc6ea; }
.streak { text-align: center; min-width: 150px; position: relative; z-index: 1; }
.streak-n { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); }
.streak-n b { font-family: var(--display); font-size: 34px; color: #fff; }
.streak .small { color: rgba(255, 255, 255, .7); }
.streak .dots { display: grid; grid-template-columns: repeat(7, 12px); gap: 4px; justify-content: center; margin-top: 8px; }
.streak .dots i { width: 12px; height: 12px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.streak .dots i.on { background: var(--gold); }
.nudge { border-left: 4px solid var(--ink-3); }
.nudge.tone-good { border-left-color: var(--good); }
.nudge.tone-gold { border-left-color: var(--gold); }
.nudge.tone-terra { border-left-color: var(--terra); }
.nudge.tone-blue { border-left-color: var(--blue); }
.nudge .ic { margin-top: 2px; }
.legend.col { flex-direction: column; gap: 8px; }
.chart-card h3 { font-size: 15px; }
.subject-card { border-top: 5px solid var(--subject); }
.subject-hero {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 24px; border-radius: var(--r-lg); margin-bottom: 18px;
  background: var(--subject); color: #fff;
}
.subject-hero h1 { color: #fff; }
.subject-hero p { color: rgba(255, 255, 255, .85); margin-top: 4px; }
.subject-hero .eyebrow { color: rgba(255, 255, 255, .7); }
.subject-hero .pie-c b { color: #fff; }
.subject-hero .pie-c span { color: rgba(255, 255, 255, .75); }
.subject-hero .pie svg circle:first-child { stroke: rgba(255, 255, 255, .2); }
.quote { text-align: center; color: var(--muted); font-style: italic; margin: 26px 0 0; }
@media (max-width: 900px) {
  .rail .sect { display: none; }
  .motivate { padding: 18px; }
  .streak { min-width: 0; width: 100%; }
}

/* ---------- learner profile ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head > .grow { min-width: 260px; }
.profile-head .actions { flex-basis: 100%; padding-top: 12px; border-top: 1px solid var(--line-2); }
.profile-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 26px; }
.avatar { width: 64px; height: 64px; border-radius: 20px; background: var(--ink); color: var(--gold); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px; flex: none; }
.plan-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.plan-row .in { min-height: 40px; padding: 6px 10px; font-size: 14px; }
@media (max-width: 700px) { .plan-row { flex-wrap: wrap; } }
.email-frame { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: #f6f4ef; }

/* ---------- print views ---------- */
.print-bar { position: sticky; top: 0; z-index: 10; display: flex; gap: 12px; align-items: center; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.print-page { max-width: 900px; margin: 20px auto 60px; background: #fff; padding: 32px; border-radius: 12px; box-shadow: var(--shadow); }
.print-page .hero { margin-top: 16px; }
.doc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 16px; text-align: right; }
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; }
.doc-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.doc-grid span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.doc-banner { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 10px; font-weight: 700; margin-bottom: 10px; }
.doc-banner.bad { background: var(--bad-soft); color: var(--bad); }
.doc-banner.warn { background: var(--warn-soft); color: var(--warn); }
.doc-h { margin: 18px 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.print-page p { margin: 4px 0 8px; }
.signs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; margin-top: 40px; }
.signs > div { display: flex; flex-direction: column; gap: 2px; font-weight: 700; font-size: 13px; }
.sign-line { border-bottom: 1px solid var(--ink); height: 36px; }

.cards-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; max-width: 820px; margin: 20px auto; background: #fff; }
.login-card { border: 1px dashed #b8b2a6; padding: 16px 18px; min-height: 250px; break-inside: avoid; }
.lc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lc-head .wordmark { font-size: 16px; }
.lc-grade { font-size: 12px; color: var(--muted); font-weight: 700; }
.lc-name { font-family: var(--display); font-weight: 800; font-size: 22px; margin-bottom: 10px; }
.lc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.lc-row b { font-size: 15px; }
.lc-code { letter-spacing: .08em; }
.lc-pin { font-family: var(--display); font-size: 26px !important; letter-spacing: .25em; }
.lc-all { font-size: 11px; color: var(--muted); margin-top: 6px; }

@media print {
  .print-page { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .cards-sheet { margin: 0; max-width: none; }
  .login-card { min-height: 64mm; }
  .print-page .hero { background: #fff; color: var(--ink); border: 1px solid var(--line); }
}

.pw-wrap { position: relative; }
.pw-wrap .in { padding-right: 52px; font-size: 18px; }
.pw-wrap .icon-btn { position: absolute; right: 2px; top: 1px; }

.qfig { margin: 14px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.qfig img { display: block; max-width: 100%; margin: 0 auto; max-height: 70vh; }
.qfig .crop-view { width: 100%; background-repeat: no-repeat; }
.qfig figcaption { display: flex; justify-content: flex-end; border-top: 1px solid var(--line-2); padding: 2px 6px; }
.unpack { background: var(--blue-soft); border-radius: var(--r-md); padding: 4px 14px 14px; margin-top: 14px; }
.unpack small { font-weight: 700; }
.gated { opacity: .35; pointer-events: none; filter: grayscale(.6); }
.rubric { margin: 12px 0; font-size: 14px; }
.rubric .tbl td { padding: 5px 8px; }

/* demo learner strip */
.demo-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #fff4d6; color: #5c4700; border-bottom: 1px solid #ecd9a0; font-size: 14px; font-weight: 600; }
.demo-bar select.in { width: auto; min-height: 34px; padding: 4px 8px; }
@media (max-width: 600px) { .demo-bar span.grow { font-size: 12px; } }
.found-row { align-items: center; }
.found-row .grow { min-width: 0; }
.grid.four-up { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.four-up { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid.four-up { grid-template-columns: 1fr; } }
.stackbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); margin-top: 4px; }
.stackbar i { display: block; height: 100%; }
.warn-card { border-color: var(--warn); }
/* resources: lessons and simulations */
.learn-btn .count { margin-left: 4px; background: var(--terra-deep); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.res-li { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 6px; }
.sim-card { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; font: inherit; color: inherit; }
.sim-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: var(--line); }
.sim-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; margin-top: 8px; }
.sim-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage-track { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.stage-track span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--line); color: var(--muted); }
.stage-track span.on { background: var(--terra-deep); color: #fff; }
.stage-track span.done { background: #dfe9e1; color: #3f7d4e; }
.lesson-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--card, #fff); font-size: 16px; line-height: 1.55; }
.lesson-card h3 { margin-bottom: 6px; }
.lesson-card ul { margin: 8px 0 0 20px; }
.lesson-expr { margin: 10px 0; padding: 10px 14px; background: #f6f1e6; border-radius: 10px; font-size: 18px; text-align: center; }
