/* Krillion Unblocked: a maths-notebook page with ballpoint doodles. */
@font-face {
  font-family: "Patrick Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/patrick-hand-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Patrick Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/patrick-hand-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --desk: #d9cfb8;
  --paper: #fdfbf4;
  --grid: rgba(64, 120, 190, 0.13);
  --margin: #ec8f86;
  --ink: #23211c;
  --muted: #6a645a;
  --pen: #2546b8;
  --pen-dark: #182f80;
  --red: #d33a2c;
  --sticky: #ffe45c;
  --sticky-dark: #e9c62a;
  --card: #ffffff;
  --t-gem: #ffcf2e;
  --t-deep: #cbb5ff;
  --t-rare: #9fe884;
  --t-school: #a6d1ff;
  --t-clever: #ffbf73;
  --t-plankton: #e4dfd2;
  --t-none: #f7c2bc;
  --hand: "Patrick Hand", "Comic Sans MS", "Chalkboard SE", "Segoe Print", cursive;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sketch: 3px 3px 0 var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--desk) radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px) 0 0 / 6px 6px;
  color: var(--ink);
  font: 17px/1.6 var(--body);
}
a { color: var(--pen); text-underline-offset: 3px; }
a:hover { color: var(--pen-dark); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--hand); font-weight: 400; line-height: 1.15; }

/* ---------- page frame ---------- */
.desk { max-width: 980px; margin: 0 auto; padding: 0 10px 24px; }
.top { position: relative; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 6px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink); font: 28px/1 var(--hand); text-decoration: none; white-space: nowrap; }
.logo svg { width: 46px; height: 30px; flex: none; }
.logo span { padding: 0 4px; background: linear-gradient(transparent 45%, var(--sticky) 45% 90%, transparent 90%); }
.top-nav { display: flex; gap: 4px; margin-left: auto; }
.top-nav a { padding: 6px 10px; border-radius: 6px; color: var(--ink); font: 20px/1 var(--hand); text-decoration: none; }
.top-nav a:hover, .top-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.55); text-decoration: underline wavy var(--pen) 1.5px; }
.menu-wrap { position: relative; }
.menu-wrap > summary { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); box-shadow: 2px 2px 0 var(--ink); font-size: 22px; line-height: 1; list-style: none; cursor: pointer; }
.menu-wrap > summary::-webkit-details-marker { display: none; }
.menu-wrap[open] > summary { background: var(--sticky); }
.menu { position: absolute; right: 0; top: 52px; display: flex; flex-direction: column; gap: 2px; width: 250px; padding: 10px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); box-shadow: var(--sketch); }
.menu a, .menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 20px/1.1 var(--hand); text-align: left; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: rgba(255, 228, 92, 0.55); }
.menu hr { width: 100%; margin: 6px 0; border: 0; border-top: 2px dashed rgba(35, 33, 28, 0.2); }

.notebook {
  position: relative;
  padding: 18px 22px 30px 74px;
  border-radius: 6px 14px 14px 6px;
  background:
    linear-gradient(90deg, transparent 58px, var(--margin) 58px, var(--margin) 60px, transparent 60px),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 14px 30px rgba(60, 45, 20, 0.22);
}
.notebook::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 20px;
  bottom: 20px;
  width: 22px;
  background: radial-gradient(circle at 11px 11px, var(--desk) 7px, rgba(0, 0, 0, 0.18) 8px, transparent 9px) 0 0 / 22px 72px repeat-y;
  pointer-events: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 22px;
  border: 2px solid var(--ink);
  border-radius: 10px 14px 10px 12px;
  background: var(--sticky);
  box-shadow: var(--sketch);
  color: var(--ink);
  font: 23px/1.1 var(--hand);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translate(-1px, -1px) rotate(-0.6deg); box-shadow: 4px 4px 0 var(--ink); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn.big { min-height: 58px; padding: 10px 30px; font-size: 28px; }
.btn.plain { background: var(--card); border-style: dashed; box-shadow: none; font-size: 20px; min-height: 44px; }
.btn.plain:hover { box-shadow: 2px 2px 0 var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 16px 0; }

/* ---------- home (cover page) ---------- */
.app { position: relative; min-height: 420px; }
.cover { position: relative; max-width: 640px; margin: 6px auto 0; padding: 22px 26px 18px; text-align: center; }
.cover h1, .cover .title { margin: 0; font-size: clamp(44px, 9vw, 74px); letter-spacing: 0.01em; }
.cover h1 em, .cover .title em { font-style: normal; color: var(--pen); }
.scribble { display: block; width: min(360px, 80%); height: 14px; margin: 2px auto 10px; }
.sub { margin: 0 0 6px; font: 24px/1.25 var(--hand); color: var(--pen-dark); }
.tag { margin: 0 0 12px; color: var(--muted); }
.kip-hero { position: absolute; right: -6px; top: -4px; width: 110px; transform: rotate(8deg); }
.cover .note { display: inline-block; margin: 6px 0 0; padding: 4px 12px; background: rgba(255, 228, 92, 0.5); font: 19px/1.3 var(--hand); transform: rotate(-1deg); }
.countdown { margin: 8px 0 0; font: 20px/1.2 var(--hand); color: var(--muted); }
.mini-stats { display: inline-flex; gap: 22px; margin: 14px auto 0; padding: 10px 18px; border: 2px dashed rgba(35, 33, 28, 0.35); border-radius: 12px; background: rgba(255, 255, 255, 0.7); cursor: pointer; }
.mini-stats div { display: flex; flex-direction: column; align-items: center; }
.mini-stats b { font: 28px/1 var(--hand); }
.mini-stats span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- ruler (depth) ---------- */
.ruler { position: relative; height: 54px; margin: 34px 6px 18px; border: 2px solid var(--ink); border-radius: 6px; background: linear-gradient(#f6d27a, #eebd55); box-shadow: 2px 2px 0 var(--ink); }
.ruler-ticks { position: absolute; inset: 0 10px; background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px calc(100% / 70)) top / 100% 9px no-repeat, repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px calc(100% / 14)) top / 100% 15px no-repeat; }
.ruler-ticks span { position: absolute; top: 15px; transform: translateX(-50%); font: 13px/1 var(--body); font-weight: 700; }
.ruler-fill { position: absolute; left: 0; bottom: 0; height: 10px; border-radius: 0 0 0 4px; background: repeating-linear-gradient(-45deg, var(--pen) 0 5px, #4e6fd6 5px 10px); transition: width 1.2s ease-in-out; }
.ruler .kip { position: absolute; top: 20px; width: 50px; transform: translateX(-50%); transition: left 1.2s ease-in-out; }
.ruler-read { position: absolute; right: 8px; top: -30px; font: 22px/1 var(--hand); }
.ruler-read b { color: var(--pen); font-weight: 400; }

/* ---------- question card ---------- */
.steps { display: flex; justify-content: center; gap: 6px; margin: 0 0 12px; }
.steps i { width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 4px 6px 5px 4px; background: var(--card); }
.steps i.now { border-color: var(--pen); box-shadow: 0 0 0 3px rgba(37, 70, 184, 0.25); }
.card {
  position: relative;
  max-width: 640px;
  margin: 18px auto 10px;
  padding: 30px 26px 22px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: linear-gradient(var(--card) 46px, #ef9a92 46px 48px, var(--card) 48px) top / 100% 100% no-repeat, var(--card);
  box-shadow: 0 8px 20px rgba(60, 45, 20, 0.18);
  transform: rotate(-0.4deg);
}
.card::before { content: ""; position: absolute; left: 50%; top: -12px; width: 110px; height: 26px; margin-left: -55px; background: rgba(255, 150, 200, 0.55); transform: rotate(2deg); }
.card small.qno { position: absolute; left: 26px; top: 14px; font: 18px/1 var(--hand); color: var(--red); }
.card small.cat { position: absolute; right: 26px; top: 14px; font: 16px/1 var(--hand); color: var(--muted); text-transform: capitalize; }
.card h2 { margin: 20px 0 6px; font-size: clamp(30px, 5.5vw, 42px); color: var(--pen-dark); }
.card .hint { margin: 0; color: var(--muted); font-size: 15px; }

.pencil { display: flex; align-items: center; height: 30px; margin: 18px 0 14px; }
.pencil .eraser { width: 22px; height: 22px; flex: none; border: 2px solid var(--ink); border-right: 0; border-radius: 6px 0 0 6px; background: #ff9db0; }
.pencil .band { width: 10px; height: 22px; flex: none; border: 2px solid var(--ink); background: repeating-linear-gradient(90deg, #b9b9b9 0 3px, #8c8c8c 3px 5px); }
.pencil .wood { position: relative; flex: 1; height: 22px; }
.pencil .body { position: absolute; left: 0; top: 0; bottom: 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: linear-gradient(#ffd84d 0 33%, #f5c400 33% 66%, #e3b100 66%); transition: width 0.1s linear; }
.pencil .tip { position: absolute; top: 0; width: 30px; height: 22px; background: #f2d3a6; clip-path: polygon(0 0, 100% 50%, 0 100%); transition: left 0.1s linear; }
.pencil .tip::after { content: ""; position: absolute; right: 0; top: 7px; width: 9px; height: 8px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.pencil b { width: 48px; flex: none; text-align: right; font: 30px/1 var(--hand); }
.pencil.hurry .body { background: linear-gradient(#ff8a7a 0 33%, #f2604f 33% 66%, #d84636 66%); }
.pencil.hurry b { color: var(--red); }
.pencil.paused b::after { content: " ⏸"; font-size: 18px; }

.answer { display: flex; gap: 10px; align-items: flex-end; }
.answer input {
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  border: 0;
  border-bottom: 3px solid var(--pen);
  background: transparent;
  color: var(--pen-dark);
  font: 30px/1.2 var(--hand);
  outline: none;
}
.answer input::placeholder { color: #9aa6c9; }
.answer input:focus { background: rgba(255, 228, 92, 0.25); }
.answer input.miss { animation: wobble 0.35s; border-bottom-color: var(--red); }
.answer .btn { min-height: 50px; }
.err { min-height: 26px; margin: 10px 0 0; color: var(--red); font: 19px/1.3 var(--hand); }
.tries { font: 17px/1 var(--hand); color: var(--muted); }
@keyframes wobble { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* ---------- verdict ---------- */
.verdict { max-width: 600px; margin: 10px auto; text-align: center; }
.stamp {
  display: inline-block;
  margin: 10px 0 6px;
  padding: 10px 26px;
  border: 4px double currentColor;
  border-radius: 14px;
  font: 40px/1 var(--hand);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  animation: stamp 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.stamp.s-gem { color: #c08a00; background: rgba(255, 207, 46, 0.25); }
.stamp.s-deep { color: #6a3fd6; }
.stamp.s-rare { color: #23862c; }
.stamp.s-school { color: #2463b8; }
.stamp.s-clever { color: #c96a00; }
.stamp.s-plankton { color: #6b6658; }
.stamp.s-none { color: var(--red); }
@keyframes stamp { from { transform: rotate(-6deg) scale(1.8); opacity: 0; } }
.said { margin: 8px 0 2px; font: 30px/1.2 var(--hand); color: var(--pen-dark); }
.pts { font: 26px/1.2 var(--hand); }
.pts em { font-style: normal; padding: 0 6px; background: linear-gradient(transparent 50%, rgba(255, 228, 92, 0.85) 50%); }
.vnote { margin: 8px auto 0; max-width: 520px; color: var(--muted); }
.fact { max-width: 520px; margin: 14px auto 0; padding: 12px 16px; border: 2px solid var(--ink); background: #fff8c9; text-align: left; transform: rotate(0.6deg); box-shadow: 2px 2px 0 var(--ink); }
.fact b { font-family: var(--hand); font-weight: 400; font-size: 20px; }

/* ---------- chips (highlighter) ---------- */
.chip { display: inline-block; padding: 1px 9px; border-radius: 3px 8px 4px 7px; font: 18px/1.35 var(--hand); white-space: nowrap; }
.t-gem { background: var(--t-gem); }
.t-deep { background: var(--t-deep); }
.t-rare { background: var(--t-rare); }
.t-school { background: var(--t-school); }
.t-clever { background: var(--t-clever); }
.t-plankton { background: var(--t-plankton); }
.t-none { background: var(--t-none); text-decoration: line-through; text-decoration-color: var(--red); }
.steps i.t-none { text-decoration: none; }

/* ---------- report card ---------- */
.report { max-width: 680px; margin: 6px auto; }
.report-head { position: relative; padding: 18px 20px 14px; border: 2px solid var(--ink); background: var(--card); box-shadow: var(--sketch); text-align: center; }
.report-head small { display: block; font: 19px/1 var(--hand); color: var(--red); letter-spacing: 0.04em; }
.report-head .depth { margin: 6px 0 0; font: 56px/1 var(--hand); color: var(--pen-dark); }
.report-head .zone { font: 22px/1.2 var(--hand); }
.report-head .score { color: var(--muted); }
.report-head .squares { margin: 8px 0 0; font-size: 24px; letter-spacing: 3px; }
.grade { position: absolute; right: 14px; top: 10px; display: grid; place-items: center; width: 70px; height: 70px; border: 3px solid var(--red); border-radius: 50%; color: var(--red); font: 38px/1 var(--hand); transform: rotate(10deg); }
.beat { min-height: 22px; margin-top: 6px; font: 19px/1.3 var(--hand); color: var(--pen); }
.mode-note { margin: 4px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.tap { margin: 18px 0 8px; color: var(--muted); font: 18px/1.2 var(--hand); text-align: center; }
.rows { border-top: 2px solid var(--ink); }
.qrow { border-bottom: 1px dashed rgba(35, 33, 28, 0.35); }
.qrow > button { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 10px 6px; border: 0; background: none; text-align: left; cursor: pointer; }
.qrow > button:hover { background: rgba(255, 228, 92, 0.25); }
.qrow .n { font: 22px/1 var(--hand); color: var(--red); }
.qrow .q { display: block; font-size: 15px; color: var(--muted); }
.qrow .a { display: block; font: 22px/1.2 var(--hand); color: var(--pen-dark); }
.key { padding: 4px 8px 14px 46px; }
.key h4 { margin: 12px 0 2px; font-size: 19px; }
.key p { margin: 0; font-size: 15px; }
.check { display: flex; gap: 8px; margin-top: 12px; }
.check input { flex: 1; min-width: 0; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 8px; font: 18px/1.2 var(--hand); }
.check button { padding: 6px 14px; border: 2px solid var(--ink); border-radius: 8px; background: var(--sticky); font: 18px/1 var(--hand); cursor: pointer; }
.check-out { margin-top: 6px; min-height: 24px; }

/* ---------- lists (past quizzes) ---------- */
.list-page { max-width: 600px; margin: 0 auto; }
.list-page h2 { margin: 6px 0 12px; font-size: 40px; text-align: center; }
.list { display: grid; gap: 8px; }
.list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); font: 20px/1.2 var(--hand); text-align: left; cursor: pointer; }
.list button:hover { background: #fff7c2; }
.list .date { margin-left: 10px; color: var(--muted); font-size: 16px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 14px; background: rgba(35, 28, 15, 0.45); }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 28px); overflow: auto; padding: 22px 22px 18px; border: 2px solid var(--ink); border-radius: 6px; background: linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px, var(--paper); box-shadow: 5px 5px 0 var(--ink); }
.modal h2 { margin: 0 0 10px; font-size: 34px; }
.modal h3 { margin: 18px 0 6px; font-size: 24px; }
.x { position: absolute; right: 10px; top: 8px; width: 40px; height: 40px; border: 0; background: none; font: 30px/1 var(--hand); cursor: pointer; }
.fine { color: var(--muted); font-size: 14px; }
.opt { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px dashed rgba(35, 33, 28, 0.3); }
.opt b { display: block; font: 21px/1.2 var(--hand); font-weight: 400; }
.opt small { display: block; color: var(--muted); font-size: 14px; }
.opt input { width: 24px; height: 24px; flex: none; accent-color: var(--pen); }
.tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.tabs button { flex: 1; padding: 8px; border: 2px solid var(--ink); border-radius: 8px 8px 0 0; background: var(--card); font: 20px/1 var(--hand); cursor: pointer; }
.tabs button.on { background: var(--sticky); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles div { padding: 8px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); text-align: center; }
.tiles b { display: block; font: 26px/1.1 var(--hand); font-weight: 400; }
.tiles span { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dist { display: grid; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 130px 1fr 34px; gap: 8px; align-items: center; font-size: 14px; }
.dist-row .chip { font-size: 16px; text-align: center; }
.meter { height: 12px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--card); overflow: hidden; }
.meter i { display: block; height: 100%; }
.history ol { margin: 0; padding-left: 22px; font-size: 14px; }
.history li { margin: 3px 0; }
.empty { padding: 16px; border: 2px dashed rgba(35, 33, 28, 0.35); border-radius: 8px; text-align: center; color: var(--muted); }
.tut-art { margin: 6px 0 12px; padding: 14px; border: 2px solid var(--ink); background: var(--card); box-shadow: 2px 2px 0 var(--ink); }
.tut-art .mock-q { font: 26px/1.2 var(--hand); color: var(--pen-dark); }
.tut-art .mock-a { margin-top: 8px; border-bottom: 3px solid var(--pen); font: 24px/1.3 var(--hand); color: var(--pen-dark); }
.ladder { display: grid; gap: 6px; }
.ladder div { display: grid; grid-template-columns: 1fr auto 46px; gap: 8px; align-items: center; font: 20px/1.2 var(--hand); }
.ladder b { font-weight: 400; text-align: right; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair div { padding: 10px; border: 2px dashed var(--ink); border-radius: 8px; }
.pair b { display: block; font: 21px/1.1 var(--hand); font-weight: 400; }
.pair small { font-size: 13px; color: var(--muted); }
.tut-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0; }
.tut-dots i { width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 50%; }
.tut-dots i.on { background: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; max-width: calc(100vw - 30px); padding: 10px 18px; border: 2px solid var(--ink); border-radius: 8px; background: var(--sticky); box-shadow: var(--sketch); font: 19px/1.3 var(--hand); transform: translateX(-50%) rotate(-1deg); }

/* ---------- article text ---------- */
.content { max-width: 720px; margin: 34px auto 0; }
.content h1 { margin: 6px 0 14px; font-size: clamp(38px, 7vw, 54px); }
.content h2 { margin: 34px 0 8px; font-size: 32px; }
.content h2::after { content: ""; display: block; width: 90px; height: 6px; margin-top: 2px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 6'%3E%3Cpath d='M1 4c10-4 18 2 28-1s18-3 28 0 20 1 32-2' fill='none' stroke='%232546b8' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat; }
.content h3 { margin: 22px 0 4px; font-size: 25px; }
.content p, .content li { max-width: 68ch; }
.content table { width: 100%; margin: 12px 0; border-collapse: collapse; background: var(--card); font-size: 15px; }
.content th, .content td { padding: 7px 9px; border: 1.5px solid var(--ink); text-align: left; vertical-align: top; }
.content th { font: 19px/1.2 var(--hand); background: #fff7c2; }
.content details { margin: 8px 0; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); }
.content summary { font: 21px/1.3 var(--hand); cursor: pointer; }
.content details[open] summary { margin-bottom: 4px; }
.callout { margin: 16px 0; padding: 12px 16px; border-left: 5px solid var(--pen); background: rgba(166, 209, 255, 0.35); }
.checklist { padding-left: 0; list-style: none; }
.checklist li { position: relative; padding-left: 32px; margin: 6px 0; }
.checklist li::before { content: "☑"; position: absolute; left: 2px; top: -3px; color: var(--pen); font-size: 22px; }
.cta { margin: 22px 0; text-align: center; }
.lead { font-size: 19px; }
.legal { max-width: 720px; margin: 6px auto 0; }
.legal h1 { font-size: clamp(38px, 7vw, 52px); margin: 6px 0 10px; }
.legal h2 { font-size: 28px; margin: 26px 0 6px; }

/* contact form */
form[data-feedback-form] { display: grid; gap: 12px; margin: 18px 0; padding: 16px; border: 2px solid var(--ink); background: var(--card); box-shadow: var(--sketch); }
.fb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fb-field { display: grid; gap: 4px; }
.fb-field label { font: 19px/1.2 var(--hand); }
.fb-field input, .fb-field textarea { width: 100%; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 6px; font: 16px/1.4 var(--body); background: var(--paper); }
.fb-field textarea { min-height: 150px; resize: vertical; }
.fb-hint { color: var(--muted); font-size: 14px; }
form[data-feedback-form] button[type="submit"] { justify-self: start; padding: 8px 22px; border: 2px solid var(--ink); border-radius: 10px; background: var(--sticky); box-shadow: var(--sketch); font: 22px/1.1 var(--hand); cursor: pointer; }

/* ---------- footer ---------- */
.foot { max-width: 760px; margin: 22px auto 0; padding: 0 12px; text-align: center; font-size: 14px; color: #4b4538; }
.foot p { margin: 6px 0; }
.foot a { color: #2a3b7a; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .top-nav { display: none; }
  .menu-wrap { margin-left: auto; }
  .notebook { padding: 12px 12px 24px 40px; }
  .notebook { background: linear-gradient(90deg, transparent 30px, var(--margin) 30px, var(--margin) 32px, transparent 32px), linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 22px 22px, var(--paper); }
  .notebook::before { left: 4px; width: 20px; background-size: 20px 64px; }
  .logo { font-size: 24px; }
  .kip-hero { width: 76px; right: -10px; top: -14px; }
  .cover { padding: 18px 4px 12px; }
  .card { padding: 28px 16px 16px; }
  .card small.qno { left: 16px; }
  .card small.cat { right: 16px; }
  .answer { flex-direction: column; align-items: stretch; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .fb-row { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .ruler-ticks span { font-size: 11px; }
  .grade { width: 54px; height: 54px; font-size: 30px; right: 8px; }
  .report-head .depth { font-size: 44px; }
  .dist-row { grid-template-columns: 110px 1fr 30px; }
}
@media (max-width: 420px) {
  .ruler-ticks span:nth-child(even) { display: none; }
  .steps i { width: 20px; height: 20px; }
}

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  html:not(.full-motion) *, html:not(.full-motion) *::before, html:not(.full-motion) *::after { animation: none !important; transition: none !important; }
}
.notebook > main.content, .notebook > main.legal { margin-top: 6px; }

/* one promo at a time: the report card has its own */
body.playing .app-promo-strip { display: none; }
