/* Teachers Bet — chalk on chalkboard. Content in chalk print, annotations handwritten,
   answers circled in yellow chalk. Minimal chrome: chalk rules, not boxes. */

@font-face {
  font-family: 'Caveat';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('vendor/fonts/caveat-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('vendor/fonts/caveat-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('vendor/fonts/caveat-latin-700-normal.woff2') format('woff2');
}

:root {
  /* the board */
  --board: #212327;
  --board-raised: #26282d;
  --input-bg: #1d1f23;
  /* chalk */
  --chalk: #eae8dc;
  --chalk-soft: #cfcdc0;
  --pencil: #9c9c8e;         /* dim chalk — secondary text */
  --faint: #6a6d62;
  --rule: rgba(234, 232, 220, .17);
  --rule-soft: rgba(234, 232, 220, .09);
  /* colored chalk */
  --blue: #8fb3f2;
  --blue-hover: #a9c4f6;
  --blue-soft: rgba(143, 179, 242, .10);
  --green: #7fd4c9;          /* teal chalk — positives, edges */
  --red: #f2a0a5;            /* pink chalk — warnings, stale */
  --amber: #e3b45c;
  --yellow: #f5dd7a;         /* yellow chalk — marks */
  --on-accent: #1c1e22;
  /* chalk marks are DRAWN, not filled: rough underline + box, run through a
     turbulence filter so the edges crumble like chalk on slate */
  --chalkline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-10%25' y='-60%25' width='120%25' height='220%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.11 0.7' numOctaves='2' seed='7' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.6' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.9' numOctaves='2' seed='3' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.25' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M3 6 Q 30 3 60 5.5 T 117 5' fill='none' stroke='%23f5dd7a' stroke-width='4.4' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E");
  --chalkline-strong: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-10%25' y='-60%25' width='120%25' height='220%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.11 0.7' numOctaves='2' seed='11' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.6' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.9' numOctaves='2' seed='5' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.3' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M3 6 Q 30 3 60 5.5 T 117 5' fill='none' stroke='%23f5dd7a' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E");
  --chalkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 44' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-8%25' y='-15%25' width='116%25' height='130%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.09 0.28' numOctaves='2' seed='9' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.4' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4 0.6' numOctaves='2' seed='4' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.28' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M7 9 Q 60 4 113 8 Q 117 22 113 36 Q 60 41 7 37 Q 4 22 7 9 Z' fill='none' stroke='%23f5dd7a' stroke-width='3.8' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
  /* teal chalk underline — the graded "best price" mark */
  --chalkline-teal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-10%25' y='-60%25' width='120%25' height='220%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.11 0.7' numOctaves='2' seed='4' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.6' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.9' numOctaves='2' seed='8' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.3' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M3 6 Q 30 3.5 60 5.5 T 117 5' fill='none' stroke='%237fd4c9' stroke-width='4.2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
  /* hand-drawn yellow chalk frame (border-image) — the teacher circles a whole card */
  --chalkframe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cfilter id='r' x='-14%25' y='-14%25' width='128%25' height='128%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.13 0.13' numOctaves='2' seed='14' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='3' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.5' numOctaves='2' seed='6' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.32' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M21 9 Q 48 6.5 75 9 Q 87 10 87 21 Q 89.5 48 87 75 Q 87 86 75 87 Q 48 89.5 21 87 Q 9 86 9 75 Q 6.5 48 9 21 Q 9 10 21 9 Z' fill='none' stroke='%23f5dd7a' stroke-width='3.6' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E");
  /* same rough box as --chalkbox, drawn white for use as a mask: painted with
     currentColor it becomes the verdict stamp behind result badges */
  --chalkbox-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 44' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-8%25' y='-15%25' width='116%25' height='130%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.09 0.28' numOctaves='2' seed='9' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.4' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4 0.6' numOctaves='2' seed='4' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.28' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M7 9 Q 60 4 113 8 Q 117 22 113 36 Q 60 41 7 37 Q 4 22 7 9 Z' fill='none' stroke='%23fff' stroke-width='3.8' stroke-linecap='round'/%3E%3C/svg%3E");
  --axis: #b9b7a8;
  --ruling: rgba(234, 232, 220, .10);
  --ruling-strong: rgba(234, 232, 220, .13);
  --margin-line: rgba(242, 160, 165, .40);
  --red-wash: rgba(242, 160, 165, .09);
  --green-wash: rgba(127, 212, 201, .06);
  --green-border: rgba(127, 212, 201, .45);
  --banner-bg: rgba(245, 221, 122, .04);
  --banner-border: rgba(245, 221, 122, .40);
  --ink-wash: rgba(234, 232, 220, .06);
  --overlay: rgba(12, 14, 12, .86);
  /* derivation quantity chalk: purple, amber, teal */
  --qp: #b9a5ef;
  --qb: #e3b45c;
  --qf: #7fd4c9;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --hand: 'Caveat', 'Segoe Print', cursive;
  /* hand-drawn chalk squiggle underline */
  --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-10%25' y='-60%25' width='120%25' height='220%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.13 0.8' numOctaves='2' seed='6' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.2' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55 0.9' numOctaves='2' seed='2' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.3' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M2 5 Q 25 2 50 4.5 T 98 4' fill='none' stroke='%23eae8dc' stroke-width='3' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--chalk);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* slate with eraser smudges and a soft vignette */
  background:
    radial-gradient(1100px 520px at 12% 6%, rgba(234, 232, 220, .035), transparent 60%),
    radial-gradient(900px 620px at 88% 28%, rgba(234, 232, 220, .022), transparent 55%),
    radial-gradient(760px 520px at 38% 92%, rgba(234, 232, 220, .028), transparent 60%),
    radial-gradient(135% 100% at 50% 45%, transparent 62%, rgba(0, 0, 0, .30) 100%),
    var(--board);
  background-attachment: fixed;
}
::selection { background: rgba(245, 221, 122, .30); color: var(--chalk); }
:focus-visible { outline: 2px dashed var(--blue); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }

/* ---------- Simple / Quant modes ---------- */
body:not([data-mode="quant"]) .quant-only { display: none !important; }
body[data-mode="quant"] .simple-only { display: none !important; }

/* ---------- header ---------- */
.site-header { padding: 32px 24px 0; max-width: 1020px; margin: 0 auto; }
.header-inner { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.header-spacer { flex: 1; }
.brand { display: flex; align-items: baseline; gap: 13px; }
.logomark { height: 46px; width: auto; flex: none; align-self: center; }
.gate-logo { height: 84px; width: auto; display: block; margin-bottom: 4px; }
.wordmark {
  font-family: var(--hand); font-weight: 700; font-size: 36px; color: var(--chalk); letter-spacing: .01em;
  text-shadow: 0 0 10px rgba(234, 232, 220, .22);
}
.wm-dot { color: var(--amber); }
.brand-tag { font-family: var(--hand); font-size: 16px; color: var(--pencil); border: 1px solid var(--rule); padding: 0 9px; border-radius: 99px; }
.tagline { font-family: var(--hand); color: var(--pencil); margin: 0; font-size: 20px; }
.mode-seg { margin-bottom: 0; align-self: center; }

.tabs { display: flex; gap: 24px; margin-top: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--rule-soft); padding: 0 2px 9px; }
.tab {
  background: none; border: none; padding: 2px 1px 10px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--pencil); letter-spacing: .02em;
  transition: color .15s ease;
}
.tab:hover { color: var(--chalk); }
.tab.active {
  color: var(--chalk);
  background: var(--squiggle) no-repeat bottom / 100% 9px;
}

/* ---------- layout ---------- */
main { max-width: 1020px; margin: 0 auto; padding: 28px 24px; }
.panel { display: none; animation: fadein .25s ease; }
.panel.active { display: block; }
/* sub-tabs inside the Tools panel (Bet Sizer / Fair Price / Value Check / Arb) */
.subtabs { display: flex; gap: 20px; flex-wrap: wrap; margin: 2px 0 22px; padding: 0 2px 8px; border-bottom: 1px dashed var(--rule-soft); }
.subtab { background: none; border: none; padding: 2px 1px 8px; cursor: pointer; font-family: var(--hand); font-size: 18.5px; color: var(--pencil); letter-spacing: .01em; transition: color .15s ease; }
.subtab:hover { color: var(--chalk); }
.subtab.active { color: var(--amber); background: var(--chalkline) no-repeat bottom / 100% 8px; }
.subpanel { display: none; }
.subpanel.active { display: block; animation: fadein .25s ease; }

/* board coverage notice — MLB only for now, more sports in the fall */
.board-banner {
  margin: 14px 0 2px; padding: 11px 16px; font-size: 14.5px; line-height: 1.45;
  color: var(--chalk-soft); background: rgba(245, 221, 122, .06);
  border-left: 3px solid var(--amber); border-radius: 0 10px 10px 0;
}
.board-banner strong { color: var(--amber); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.grid { display: grid; grid-template-columns: 370px 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--board-raised);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .28);
  transition: border-color .2s ease;
}
.card:hover { border-color: var(--rule); }
.card h2 { margin: 0 0 2px; font-size: 19px; letter-spacing: -.01em; text-shadow: 0 0 8px rgba(234, 232, 220, .14); }
.card-sub { font-family: var(--hand); color: var(--pencil); font-size: 18.5px; line-height: 1.35; margin: 3px 0 18px; }

/* ---------- forms ---------- */
label { display: block; font-size: 12.5px; color: var(--chalk-soft); margin-bottom: 13px; font-weight: 600; }
input, select {
  display: block; width: 100%; margin-top: 5px;
  background: var(--input-bg); color: var(--chalk);
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 9px 11px; font-size: 15px; font-family: var(--mono);
  transition: border-color .15s ease, box-shadow .15s ease;
}
select {
  font-family: inherit;
  appearance: none; -webkit-appearance: none;
  padding-right: 30px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23cfcdc0' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 11px;
}
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.row-actions { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block; border-radius: 8px; padding: 10px 18px; font-size: 14.5px; font-weight: 700;
  cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: all .15s ease;
}
.btn-primary { background: var(--blue); color: var(--on-accent); width: 100%; margin-top: 4px; box-shadow: 0 2px 10px rgba(143, 179, 242, .18); }
.btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(143, 179, 242, .25); }
.btn-primary:disabled { opacity: .6; transform: none; }
.btn-ghost { background: transparent; color: var(--pencil); border-color: var(--rule); font-size: 13px; padding: 7px 12px; }
.btn-ghost:hover { color: var(--chalk); border-color: var(--pencil); }

.seg { display: inline-flex; background: rgba(0, 0, 0, .18); border: 1px solid var(--rule-soft); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 16px; }
.seg button { background: transparent; border: none; color: var(--pencil); font-size: 13px; font-weight: 700; padding: 5px 13px; border-radius: 6px; cursor: pointer; transition: all .15s ease; font-family: inherit; }
.seg button.active { background: var(--blue); color: var(--on-accent); }

.slate-head { display: grid; grid-template-columns: 1.1fr .9fr .9fr .8fr 28px; gap: 6px; font-size: 10.5px; color: var(--pencil); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.slate-row { display: grid; grid-template-columns: 1.1fr .9fr .9fr .8fr 28px; gap: 6px; margin-bottom: 8px; align-items: center; }
.slate-row input { margin-top: 0; padding: 8px 8px; font-size: 13.5px; }
.slate-row .del, .quote-row .del { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 15px; padding: 2px; }
.slate-row .del:hover, .quote-row .del:hover { color: var(--red); }

.quote-head { display: grid; grid-template-columns: 1.2fr 1fr 1fr 32px; gap: 8px; font-size: 11px; color: var(--pencil); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.quote-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.quote-row input { margin-top: 0; font-size: 13px; padding: 8px 8px; }

/* ---------- results ---------- */
.placeholder { font-family: var(--hand); color: var(--pencil); font-size: 20px; line-height: 1.4; padding: 36px 14px; text-align: center; }

/* Report Card A+ — the smartest bet is zero, so an empty card is a perfect one */
.report-aplus { text-align: center; padding: 30px 14px 26px; }
.report-aplus .aplus-head { justify-content: center; margin-bottom: 6px; }
.report-aplus .big { font-size: 68px; line-height: 1; }
.aplus-line { font-family: var(--hand); font-size: 23px; color: var(--chalk); margin: 14px auto 0; max-width: 40ch; }
.aplus-sub { color: var(--pencil); font-size: 15px; line-height: 1.55; margin: 12px auto 20px; max-width: 52ch; }

.headline { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.headline .big {
  font-family: var(--mono); font-size: 38px; font-weight: 700; letter-spacing: -.01em; color: var(--chalk);
  text-shadow: 0 0 12px rgba(234, 232, 220, .18);
  position: relative; padding: 16px 34px;
}
.chalk-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.big.pos { color: var(--green); } .big.neg { color: var(--red); } .big.accent { color: var(--chalk); }

.badge { font-family: var(--hand); font-size: 19px; font-weight: 600; padding: 0 4px; border-radius: 3px; }
.badge.pos { color: var(--green); }
.badge.neg { color: var(--red); }
.badge.accent { color: var(--blue); }
.badge.neutral { color: var(--pencil); }
/* verdict stamp: the teacher's mark next to the answer — handwriting inside a
   rough chalk box drawn in the verdict's own color, set at a slight tilt */
.headline .badge:not(.neutral) {
  position: relative; padding: 5px 19px 7px;
  font-size: 20px; line-height: 1.12; transform: rotate(-2.4deg);
  text-shadow: 0 0 10px rgba(234, 232, 220, .1);
}
.headline .badge:not(.neutral)::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: currentColor; opacity: .85;
  -webkit-mask: var(--chalkbox-mask) no-repeat center / 100% 100%;
  mask: var(--chalkbox-mask) no-repeat center / 100% 100%;
}
/* the jackpot moment: an arb result earns the slot machine, chalk-sketched on the right */
.headline .result-art {
  height: 96px; width: auto; margin-left: auto; align-self: center;
  transform: rotate(-2.5deg);
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .4));
}

.headline-sub { color: var(--pencil); font-size: 14px; margin: 8px 0 0; }
.plain { color: var(--chalk-soft); font-size: 15px; margin: 12px 0 0; line-height: 1.6; max-width: 60ch; }
.plain .mono { font-family: var(--mono); color: var(--chalk); font-weight: 600; }

.timestamp { font-family: var(--hand); font-size: 17.5px; color: var(--pencil); margin-top: 16px; }
.timestamp::before { content: "✎ "; color: var(--faint); }

/* the quantities behind the headline: small chalk index cards, label over value,
   instead of a dotted ledger — each number reads at a glance */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 9px; margin-top: 18px; }
.statgrid::before {
  content: "given & derived —"; grid-column: 1 / -1;
  font-family: var(--hand); font-size: 17.5px; color: var(--pencil); margin-bottom: -2px;
}
.stat {
  display: block; padding: 8px 12px 9px;
  background: linear-gradient(180deg, rgba(234, 232, 220, .05), rgba(234, 232, 220, .018));
  border: 1px solid var(--rule-soft); border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.stat .k { display: block; font-family: var(--hand); font-size: 15.5px; line-height: 1.2; color: var(--pencil); }
.stat .v { display: block; font-family: var(--mono); font-size: 15.5px; font-weight: 600; color: var(--chalk); white-space: nowrap; margin: 3px 0 0; }

table.mini { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
table.mini th { text-align: left; color: var(--pencil); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; padding: 6px 8px; border-bottom: 1px solid var(--rule); font-weight: 700; }
table.mini td { padding: 7px 8px; border-bottom: 1px solid var(--rule-soft); font-family: var(--mono); font-size: 13px; }
table.mini td:first-child { font-family: inherit; }
table.mini th:not(:first-child), table.mini td:not(:first-child) { text-align: right; }
table.mini tr.hl td { color: var(--blue); }

/* ---------- derivation: a ruled worksheet laid on the board ---------- */
.workbtn {
  margin-top: 20px; background: var(--chalkline) no-repeat bottom / 100% 8px;
  border: none; padding: 2px 8px 10px 2px; cursor: pointer;
  font-family: var(--hand); font-size: 22px; font-weight: 600; color: var(--blue);
}
.workbtn:hover { color: var(--blue-hover); }
.workbtn-arrow { font-family: -apple-system, sans-serif; font-size: .55em; margin-left: 6px; vertical-align: 2px; }
/* the open worksheet: visible rulings, a double pink margin line, and the steps
   numbered in the margin — composition paper, chalked onto slate */
.work {
  display: none; margin-top: 12px; padding: 12px 18px 16px 60px;
  border-radius: 4px 12px 12px 4px;
  background:
    linear-gradient(90deg,
      transparent 0 41px, var(--margin-line) 41px 42.5px,
      transparent 42.5px 45.5px, rgba(242, 160, 165, .16) 45.5px 46.5px, transparent 46.5px),
    repeating-linear-gradient(to bottom, transparent 0 27px, var(--ruling-strong) 27px 28px),
    rgba(0, 0, 0, .16);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(234, 232, 220, .05);
}
.work.open { display: block; }
.work-controls { display: flex; align-items: baseline; gap: 12px; margin: 2px 0; flex-wrap: wrap; }
.replaybtn { background: none; border: none; padding: 0; font-family: var(--hand); font-size: 17.5px; font-weight: 600; color: var(--pencil); cursor: pointer; }
.replaybtn:hover { color: var(--chalk); }
.skiphint { font-family: var(--hand); font-size: 16px; color: var(--pencil); }

.step { position: relative; margin: 16px 0 20px; }
.step .lbl { font-family: var(--hand); font-size: 18px; color: var(--pencil); margin-bottom: 2px; opacity: 0; transition: opacity .3s ease; }
/* hand-circled step numbers sit in the pink margin, like numbering homework */
.stepnum {
  position: absolute; left: -52px; top: -2px;
  width: 28px; height: 27px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--pencil); line-height: 1;
  border: 1.5px solid rgba(156, 156, 142, .55);
  border-radius: 58% 42% 52% 48% / 46% 60% 40% 56%;
  transform: rotate(-5deg);
}
.step:nth-of-type(even) .stepnum { transform: rotate(4deg); border-radius: 44% 56% 47% 53% / 55% 43% 57% 45%; }
/* the last line of the work: the answer, written larger */
.frag.res.final .katex { font-size: 1.32em; }
.step.started .lbl { opacity: 1; }
.step .eq { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; row-gap: 6px; padding: 3px 0; overflow-x: auto; }
.step .eq .katex { font-size: 1.12em; }
.frag { opacity: 0; transform: translateY(8px); transition: opacity .38s ease, transform .38s ease; padding: 1px 4px; }
.frag.on { opacity: 1; transform: none; }
/* results get a yellow chalk underline drawn in */
.frag.res { --mark: var(--chalkline); background: var(--mark) no-repeat 0 100% / 0% 9px; padding-bottom: 7px; }
.frag.res.on { animation: hlswipe .55s ease .12s forwards; }
@keyframes hlswipe { to { background-size: 100% 9px; } }
/* …and the final answer gets boxed, the way the teacher asked */
.frag.res.final { background: none; position: relative; padding: 3px 12px 7px; }
.frag.res.final::after {
  content: ""; position: absolute; inset: -2px -3px; pointer-events: none;
  background: var(--chalkbox) no-repeat center / 100% 100%;
  opacity: 0; transition: opacity .5s ease .35s;
}
.frag.res.final.on::after { opacity: 1; }
.step .note { font-family: var(--hand); font-size: 16.5px; color: var(--pencil); margin-top: 1px; opacity: 0; transition: opacity .45s ease; }
.step .note.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .frag, .step .lbl, .step .note { transition: none; }
  .frag.res.on { animation: none; background-size: 100% 9px; }
}

/* derivation quantity colors — colored chalk */
.q-p { color: var(--qp); } .q-b { color: var(--qb); } .q-f { color: var(--qf); }

/* warnings are the teacher's margin notes: red handwriting on a red-washed
   strip, each line at its own slight tilt */
.warnlist {
  margin: 20px 0 0; padding: 10px 16px 11px 18px; list-style: none; max-width: 64ch;
  background: var(--red-wash); border-left: 3px solid rgba(242, 160, 165, .55);
  border-radius: 0 12px 12px 0;
}
.warnlist::before {
  content: "margin notes — execution risk"; display: block;
  font-family: var(--hand); font-size: 18.5px; font-weight: 600; color: var(--red);
  text-decoration: underline wavy rgba(242, 160, 165, .45); text-underline-offset: 5px;
  margin-bottom: 6px;
}
.warnlist li {
  font-family: var(--hand); font-size: 17.5px; line-height: 1.32; color: var(--red);
  margin: 8px 0; padding-left: 20px; position: relative;
}
.warnlist li::before { content: "✱"; position: absolute; left: 0; top: 2px; font-size: 13px; opacity: .85; }
.warnlist li:nth-child(odd) { transform: rotate(-.35deg); }
.warnlist li:nth-child(even) { transform: rotate(.3deg); }

.error { color: var(--red); font-size: 14px; padding: 12px; background: var(--red-wash); border-radius: 8px; margin-top: 8px; }

/* ---------- live board ---------- */
/* the header is the top of a real chalkboard: the lesson title handwritten,
   the housekeeping (timestamps, chips, links) on a quieter second line */
.board-head { margin-bottom: 8px; }
.board-head .timestamp { margin-top: 0; }
.board-head .spacer { flex: 1; }
.board-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 4px 0 10px; }
.bt-name {
  font-family: var(--hand); font-weight: 700; font-size: 36px; line-height: 1.1; color: var(--chalk);
  letter-spacing: .01em; text-shadow: 0 0 12px rgba(234, 232, 220, .22);
  background: var(--squiggle) no-repeat bottom left / 100% 8px; padding: 0 6px 12px 40px;
  position: relative;
}
/* a chalk apple on the teacher's desk, drawn beside the title */
.bt-name::before {
  content: ""; position: absolute; left: 0; bottom: 12px; width: 30px; height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 66 74'%3E%3Cfilter id='r' x='-10%25' y='-10%25' width='120%25' height='120%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.7' numOctaves='2' seed='7' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.4'/%3E%3C/filter%3E%3Cg filter='url(%23r)' fill='none' stroke='%23eae8dc' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M33 22 C 20 12, 6 22, 7 38 C 8 56, 20 68, 32 67 C 45 68, 57 55, 58 38 C 59 21, 45 12, 33 22 Z'/%3E%3Cpath d='M33 21 C 33 14, 35 9, 40 5'/%3E%3Cpath d='M40 6 C 48 4, 53 8, 54 13 C 47 15, 41 12, 40 6 Z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
  opacity: .9;
}
.bt-date { font-family: var(--hand); font-size: 20px; color: var(--pencil); }
.board-title .btn-ghost { align-self: center; }
.board-meta { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
/* the tour re-run is a chalk link, not a button — bell (stateful) and Refresh (action) keep button weight */
.board-head #tour-again { border: none; background: none; font-family: var(--hand); font-size: 16.5px; color: var(--pencil); padding: 0 4px; cursor: pointer; }
.board-head #tour-again:hover { color: var(--chalk); text-decoration: underline dotted; }

/* the day's tally, chalked large under the title */
.board-summary {
  display: flex; align-items: baseline; gap: 8px 30px; flex-wrap: wrap;
  border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft);
  padding: 12px 4px 10px; margin-bottom: 26px; font-size: 13.5px;
}
.board-summary .count { display: flex; align-items: baseline; gap: 9px; font-family: var(--hand); font-size: 19px; font-weight: 600; color: var(--chalk-soft); }
.board-summary .count .n { font-size: 33px; font-weight: 700; line-height: 1; color: var(--faint); }
.board-summary .c-arb.live .n { color: var(--yellow); text-shadow: 0 0 12px rgba(245, 221, 122, .35); }
.board-summary .c-ev.live .n { color: var(--green); text-shadow: 0 0 12px rgba(127, 212, 201, .3); }
.board-summary .count.live { color: var(--chalk); }
.board-summary .dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; align-self: center; }
.board-summary .dot.pos { background: var(--yellow); box-shadow: 0 0 7px rgba(245, 221, 122, .5); }
.board-summary .dot.accent { background: var(--green); box-shadow: 0 0 7px rgba(127, 212, 201, .45); }
.board-summary .dot.none { background: var(--faint); }

/* ---------- "what you're missing": the delay shown honestly ---------- */
.missed { margin: -6px 0 26px; }
.missed-quiet {
  display: flex; align-items: baseline; gap: 9px; padding: 2px 4px 20px;
  font-family: var(--hand); font-size: 17.5px; color: var(--pencil);
  border-bottom: 1px solid var(--rule-soft); margin-bottom: 24px;
}
.missed-dot.none { width: 8px; height: 8px; border-radius: 99px; background: var(--faint); align-self: center; flex: none; }
.missed.card { padding: 18px 20px 16px; border-color: rgba(245, 221, 122, .28); background:
  linear-gradient(180deg, rgba(245, 221, 122, .05), transparent 60%); }
.missed-eyebrow { font-family: var(--hand); font-size: 15.5px; color: var(--amber); letter-spacing: .02em; }
.missed-head h3 { margin: 2px 0 0; font-size: 21px; letter-spacing: -.01em; color: var(--chalk); }
.missed-list { list-style: none; margin: 14px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.missed-row {
  display: grid; grid-template-columns: 52px 1fr auto auto; align-items: baseline; gap: 12px;
  padding: 8px 6px; border-bottom: 1px solid var(--rule-soft);
}
.missed-row:last-child { border-bottom: none; }
.missed-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-align: center; padding: 2px 0; border-radius: 4px; border: 1px solid var(--rule);
}
.missed-arb .missed-badge { color: var(--yellow); border-color: rgba(245, 221, 122, .5); }
.missed-ev .missed-badge { color: var(--green); border-color: rgba(127, 212, 201, .5); }
.missed-game { color: var(--chalk-soft); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.missed-mag { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.missed-arb .missed-mag { color: var(--yellow); }
.missed-ev .missed-mag { color: var(--green); }
.missed-when { font-family: var(--hand); font-size: 15px; color: var(--pencil); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--green);
  box-shadow: 0 0 0 0 rgba(127, 212, 201, .5); animation: livepulse 1.8s ease-out infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(127, 212, 201, .5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(127, 212, 201, 0); } }
.missed-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.missed-note { margin: 0; flex: 1 1 300px; font-family: var(--hand); font-size: 16.5px; line-height: 1.35; color: var(--pencil); }
.missed-foot .btn { flex: none; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ---------- sharp-consensus panel (the fair line, shown transparently) ---------- */
.consensus { margin-top: 14px; border-top: 1px solid var(--rule-soft); padding-top: 12px; }
.consensus-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.c-fair { font-family: var(--hand); font-size: 20px; color: var(--chalk); }
.c-fair .mono { font-family: var(--mono); font-size: 15.5px; font-weight: 600; }
.c-conf { font-family: var(--hand); font-size: 17px; margin-left: auto; }
.c-conf.conf-tight { color: var(--green); }
.c-conf.conf-moderate { color: var(--amber); }
.c-conf.conf-wide { color: var(--red); }
.consensus-sub { font-family: var(--hand); font-size: 16px; color: var(--pencil); margin-top: 2px; }
.consensus-sub .shade { color: var(--red); }
.consensus-work { margin-top: 8px; }
.consensus-work summary { font-family: var(--hand); font-size: 16.5px; color: var(--blue); cursor: pointer; }
.con-table { width: 100%; border-collapse: collapse; margin: 10px 0 4px; }
.con-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--pencil); padding: 4px 8px; border-bottom: 1px solid var(--rule-soft); font-weight: 700; }
.con-table td { padding: 5px 8px; border-bottom: 1px solid var(--rule-soft); font-size: 13px; }
.con-table td:first-child { font-family: inherit; }
.con-table .mono { font-family: var(--mono); }
.con-table tr.con-down td { opacity: .45; }
.con-merged { font-family: var(--hand); font-size: 13px; color: var(--faint); margin-left: 6px; }
.con-note { font-family: var(--hand); font-size: 16px; color: var(--pencil); margin: 4px 0 0; line-height: 1.35; }

/* ---------- billing (Stripe) ---------- */
.billing-banner {
  padding: 12px 20px; text-align: center; font-family: var(--hand); font-size: 20px;
  color: var(--on-accent); background: var(--green); position: sticky; top: 0; z-index: 50;
}
.billing-banner.err { background: var(--red); }
.billing-banner a { color: var(--on-accent); font-weight: 700; text-decoration: underline; }
.tier-manage { display: inline-block; margin-top: 10px; font-family: var(--hand);
  font-size: 17px; color: var(--pencil); }
[data-plan] { margin-top: 8px; }
.board-summary .muted { font-family: var(--hand); color: var(--pencil); font-weight: 400; font-size: 16.5px; }

.board-empty { text-align: center; padding: 56px 20px 48px; }
.board-empty h3 { margin: 0 0 6px; font-family: var(--hand); font-size: 31px; font-weight: 700; text-shadow: 0 0 10px rgba(234, 232, 220, .18); }
.board-empty p { color: var(--pencil); font-size: 14px; max-width: 520px; margin: 6px auto 20px; }
.board-empty code { font-family: var(--mono); font-size: 12.5px; background: var(--ink-wash); border: 1px solid var(--rule-soft); border-radius: 6px; padding: 2px 7px; }
.board-empty .btn-primary { width: auto; }

/* event cards: quiet games sit back; flagged games come forward */
.event-card {
  margin-bottom: 26px; padding: 24px 26px;
  background: linear-gradient(180deg, #292b30, #24262a 72%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 10px 26px rgba(0, 0, 0, .32);
}
.event-card.has-edge {
  border-color: var(--green-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 12px 30px rgba(0, 0, 0, .36), 0 0 30px rgba(127, 212, 201, .06);
}
/* an arb is the board's siren: the teacher frames the whole card in yellow chalk */
.event-card.arb-card {
  position: relative; border-color: transparent;
  background: linear-gradient(180deg, #2c2d2f, #242527 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 14px 34px rgba(0, 0, 0, .42), 0 0 52px rgba(245, 221, 122, .07);
}
.chalk-frame {
  position: absolute; inset: -8px; pointer-events: none;
  border: 13px solid transparent;
  border-image: var(--chalkframe) 31 / 13px round;
  filter: drop-shadow(0 0 6px rgba(245, 221, 122, .15));
}
.event-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.event-head h3 { margin: 0; font-size: 18.5px; letter-spacing: -.01em; text-shadow: 0 0 8px rgba(234, 232, 220, .12); }
.event-head .commence { font-family: var(--hand); color: var(--pencil); font-size: 16.5px; }
.event-head .spacer { flex: 1; }
/* line history reads as chalk marginalia, not chrome */
.event-head .histbtn {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  font-family: var(--hand); font-size: 17.5px; font-weight: 600; color: var(--blue);
}
.event-head .histbtn:hover { color: var(--blue-hover); text-decoration: underline dotted; text-underline-offset: 4px; }

.edge-badge { font-family: var(--hand); font-size: 18.5px; font-weight: 700; white-space: nowrap; padding: 0 7px; border-radius: 4px; }
.edge-badge.arb {
  position: relative; display: inline-block; color: var(--yellow);
  font-size: 21px; padding: 3px 16px; transform: rotate(-2deg);
  text-shadow: 0 0 12px rgba(245, 221, 122, .4);
}
.edge-badge.ev { color: var(--green); text-shadow: 0 0 9px rgba(127, 212, 201, .3); }

.arb-banner {
  display: flex; align-items: center; gap: 20px;
  margin: 14px 0 2px; padding: 13px 18px 13px 15px; border-radius: 6px 10px 10px 6px;
  font-size: 13.5px; line-height: 1.55; color: var(--chalk-soft);
  background: linear-gradient(90deg, rgba(245, 221, 122, .075), rgba(245, 221, 122, .015) 78%);
  border: none; border-left: 3px solid rgba(245, 221, 122, .75);
}
.arb-banner .arb-copy { flex: 1; min-width: 0; }
.arb-banner .mono { font-family: var(--mono); font-weight: 700; color: var(--chalk); }

table.board { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13.5px; }
table.board th { text-align: right; color: var(--pencil); font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; padding: 6px 10px 7px; border-bottom: 1px solid var(--rule); }
table.board th:first-child { text-align: left; }
/* in simple mode the column heads are the team names — chalked, not shouted */
table.board th .simple-only { font-family: var(--hand); font-size: 15.5px; font-weight: 600; text-transform: none; letter-spacing: .01em; color: var(--chalk-soft); }
table.board td { padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); font-family: var(--mono); font-size: 13px; text-align: right; white-space: nowrap; }
table.board td:first-child { text-align: left; font-family: inherit; }
table.board tbody tr:hover td { background: rgba(234, 232, 220, .025); }
/* the benchmark row is the answer key — set off in blue chalk */
table.board tr.bench-row td { background: var(--blue-soft); border-bottom-color: rgba(143, 179, 242, .28); }
table.board tr.bench-row td:first-child { box-shadow: inset 3px 0 0 rgba(143, 179, 242, .7); font-weight: 600; }
table.board tr.bench-row:hover td { background: rgba(143, 179, 242, .13); }
.bookchip { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: 1px; }
.benchtag { font-size: 9px; color: var(--blue); border: 1px solid rgba(143, 179, 242, .55); background: rgba(143, 179, 242, .12); border-radius: 99px; padding: 1px 6px; margin-left: 8px; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; font-family: var(--mono); }
/* best price on each side: a graded mark — chalk underline + check, not a clean rule */
.bestmark { color: var(--green); font-weight: 700; text-shadow: 0 0 9px rgba(127, 212, 201, .3); }
table.board td.bestmark, table.mini td.bestmark {
  background: var(--chalkline-teal) no-repeat right 7px bottom 4px / 52px 7px;
}
/* the answer-key wash must not erase the graded underline */
table.board tr.bench-row td.bestmark {
  background: var(--chalkline-teal) no-repeat right 7px bottom 4px / 52px 7px var(--blue-soft);
}
table.board td.bestmark::after, table.mini td.bestmark::after {
  content: "\2713"; font-family: var(--hand); font-size: 13px; color: var(--green);
  margin-left: 5px; opacity: .85; vertical-align: 1px;
}
td.edge-cell { font-weight: 700; }
.hlmark { background: var(--chalkbox) no-repeat center / 100% 100%; padding: 3px 9px; margin: -3px -9px; color: var(--yellow); text-shadow: 0 0 10px rgba(245, 221, 122, .3); }
.ev-pos { color: var(--green); font-weight: 700; }
.ev-neg { color: var(--faint); }
.stale { font-family: var(--hand); color: var(--red); font-size: 15px; }
.fairline { font-family: var(--hand); color: var(--pencil); font-size: 17px; margin: 10px 0 0; }
.fairline .mono { font-family: var(--mono); font-size: 12.5px; color: var(--chalk); }

.edge-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.edge-chip {
  font-size: 13.5px; padding: 8px 13px; border-radius: 6px; line-height: 1.5;
  border-left: 3px solid var(--green); background: var(--green-wash); color: var(--chalk-soft);
}
.edge-chip .mono { font-family: var(--mono); font-weight: 700; color: var(--green); }

/* line-history chart */
.hist { margin-top: 14px; border-top: 1px solid var(--rule-soft); padding-top: 12px; }
.hist-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hist-controls .seg { margin-bottom: 0; padding: 2px; }
.hist-controls .seg button { font-size: 11.5px; padding: 3px 10px; }
.hist-controls .seg button.active { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.hist-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--pencil); }
.hist-legend .item { display: flex; align-items: center; gap: 6px; }
.hist-legend .swatch { width: 14px; height: 3px; border-radius: 2px; }
.chartwrap { position: relative; overflow-x: auto; }
.chartwrap svg { display: block; width: 100%; min-width: 520px; height: auto; }
.chart-tip {
  position: absolute; pointer-events: none; display: none; z-index: 5;
  background: var(--board-raised); border: 1px solid var(--rule); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; min-width: 150px; box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
.chart-tip .t { font-family: var(--mono); color: var(--pencil); margin-bottom: 5px; font-size: 11px; }
.chart-tip .row { display: flex; align-items: center; gap: 6px; justify-content: space-between; margin: 2px 0; }
.chart-tip .row .name { display: flex; align-items: center; gap: 6px; color: var(--pencil); }
.chart-tip .row .val { font-family: var(--mono); color: var(--chalk); }
.hist-table-wrap { overflow-x: auto; }

/* freshness chip + delay badge */
.fresh-chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--hand); font-size: 16.5px; color: var(--pencil); }
.fresh-chip .fdot { width: 9px; height: 9px; border-radius: 99px; }
.fresh-chip.pos .fdot { background: #86d99a; box-shadow: 0 0 7px rgba(134, 217, 154, .5); }
.fresh-chip.warn .fdot { background: var(--yellow); box-shadow: 0 0 7px rgba(245, 221, 122, .5); }
.fresh-chip.bad .fdot { background: var(--red); box-shadow: 0 0 7px rgba(242, 160, 165, .5); }
.badge.neutral { border: 1px solid var(--rule); border-radius: 99px; padding: 0 10px; font-size: 16px; }

/* loggable prices + report card */
td.loggable { cursor: pointer; }
td.loggable:hover { color: var(--yellow); }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 60;
  font-family: var(--hand); font-size: 19px; color: var(--chalk);
  background: var(--board-raised); border: 1px solid var(--rule); border-radius: 10px;
  padding: 8px 18px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: toastfade 1.8s ease forwards;
}
@keyframes toastfade { 0% { opacity: 0; transform: translate(-50%, 8px); } 12% { opacity: 1; transform: translate(-50%, 0); } 78% { opacity: 1; } 100% { opacity: 0; } }

.gpa-line { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 8px 0 4px; }
table.report { width: 100%; min-width: 560px; border-collapse: collapse; margin-top: 14px; font-size: 13.5px; }
table.report td:first-child { min-width: 150px; }
.clv-neg { color: var(--red); }
table.report th { text-align: left; color: var(--pencil); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
table.report td { padding: 8px; border-bottom: 1px solid var(--rule-soft); font-family: var(--mono); font-size: 13px; vertical-align: middle; }
table.report td:first-child { font-family: inherit; }
/* grade letters get report-card presence: big handwriting, hand-circled in the
   letter's own color, set at a marking-pen tilt with a faint chalk-dust glow */
.gradeletter {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 42px; padding: 0 5px;
  font-family: var(--hand); font-size: 31px; font-weight: 700; line-height: 1;
  border: 2px solid; border-color: color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 56% 44% 52% 48% / 44% 60% 40% 58%;
  transform: rotate(-6deg);
  text-shadow: 0 0 12px color-mix(in srgb, currentColor 45%, transparent);
}
table.report tr:nth-child(4n+3) .gradeletter { transform: rotate(4deg); border-radius: 45% 55% 48% 52% / 58% 42% 60% 44%; }
.grade-A { color: #86d99a; } .grade-B { color: var(--blue); } .grade-C { color: var(--chalk-soft); }
.grade-D { color: var(--amber); } .grade-F { color: var(--red); }
table.report .del { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 15px; }
table.report .del:hover { color: var(--red); }

/* the eraser: repriced cells smudge, then the new number is written */
td.rewrote { animation: chalkerase 1s ease; }
@keyframes chalkerase {
  0% { filter: blur(5px); opacity: .15; background: rgba(234, 232, 220, .16); border-radius: 6px; }
  55% { filter: blur(2px); opacity: .5; background: rgba(234, 232, 220, .07); }
  100% { filter: none; opacity: 1; background: transparent; }
}

/* share button: a yellow-chalk pill with a little lift, not a flat ghost */
.sharebtn {
  margin-top: 16px; font-family: var(--hand); font-size: 17.5px; font-weight: 600;
  color: var(--yellow); border: 1px solid rgba(245, 221, 122, .45); border-radius: 999px;
  padding: 6px 18px 7px; background: rgba(245, 221, 122, .06);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.sharebtn:hover {
  color: var(--yellow); border-color: rgba(245, 221, 122, .8); background: rgba(245, 221, 122, .12);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3), 0 0 16px rgba(245, 221, 122, .14);
}

/* pop quiz */
.quiz-q { margin: 14px 0; padding: 16px 18px; border: 1px solid var(--rule-soft); border-radius: 10px; background: var(--board-raised); }
.quiz-q .prompt { font-family: var(--hand); font-size: 21px; color: var(--chalk); margin-bottom: 10px; }
.quiz-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.quiz-row input { width: 130px; margin-top: 0; }
.quiz-row .btn-primary { width: auto; margin: 0; padding: 8px 16px; }
.quiz-verdict { font-family: var(--hand); font-size: 19px; margin-top: 10px; }
.quiz-verdict.right { color: #86d99a; }
.quiz-verdict.wrong { color: var(--red); }
.quiz-score { margin-top: 16px; }

/* ---------- prose / learn ---------- */
.prose { max-width: 720px; margin: 0 auto; }
.prose a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--blue-hover); }
.prose h3 { font-family: var(--hand); margin: 48px 0 6px; font-size: 25px; font-weight: 700; color: var(--chalk); text-shadow: 0 0 8px rgba(234, 232, 220, .15); border-top: 1px solid var(--rule-soft); padding-top: 26px; }
.prose h3:first-of-type { border-top: none; padding-top: 0; }
.prose p { color: var(--chalk-soft); font-size: 15px; }
.prose em { font-family: var(--mono); font-style: normal; font-size: 13.5px; color: var(--chalk); }
.prose figure { margin: 16px 0 6px; }
.prose figure img { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.prose figcaption { font-family: var(--hand); font-size: 16.5px; color: var(--pencil); margin-top: 5px; text-align: center; }

.howto { color: var(--chalk-soft); font-size: 15px; padding-left: 20px; }
.howto li { margin: 10px 0; line-height: 1.6; }
.howto strong { color: var(--chalk); }

.tablewrap { overflow-x: auto; margin: 14px 0; }
table.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
table.compare th { text-align: left; font-family: var(--hand); font-size: 20px; font-weight: 700; color: var(--chalk); padding: 6px 12px; border-bottom: 1px solid var(--rule); }
table.compare td { padding: 9px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; line-height: 1.5; }
table.compare td:first-child { color: var(--pencil); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding-top: 12px; }
table.compare td.us { color: var(--chalk); border-left: 3px solid var(--green); background: var(--green-wash); }
table.compare td.them { color: var(--pencil); }

/* phones: the worksheet keeps its margin + numbers, just tighter */
@media (max-width: 520px) {
  .work {
    padding: 10px 12px 14px 46px;
    background:
      linear-gradient(90deg, transparent 0 32px, var(--margin-line) 32px 33.5px, transparent 33.5px),
      repeating-linear-gradient(to bottom, transparent 0 27px, var(--ruling-strong) 27px 28px),
      rgba(0, 0, 0, .16);
  }
  .stepnum { left: -40px; width: 24px; height: 23px; font-size: 14px; }
  .headline .result-art { height: 70px; }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
}

/* narrow viewports: selects and book names must never clip */
@media (max-width: 480px) {
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .quote-row, .quote-head { grid-template-columns: 1.5fr .85fr .85fr 24px; }
  .quote-row input { font-size: 12.5px; padding: 8px 6px; }
  .agegate-actions { flex-direction: column; }
  .agegate-actions .btn { width: 100%; text-align: center; }
}

/* phones: compact header chrome, board tables that fit, legible chalk tray */
@media (max-width: 640px) {
  .site-header { padding-top: 20px; }
  .tabs { margin-top: 14px; gap: 24px; row-gap: 4px; }
  .tab { padding-bottom: 8px; }
  /* stale note stacks under the book name so both moneyline columns fit at 390px */
  table.board td:first-child .stale { display: block; margin-left: 17px; line-height: 1.3; }
  /* board header: title row keeps the bell + refresh; meta wraps beneath */
  .board-title { gap: 8px 12px; margin-bottom: 6px; }
  .bt-name { font-size: 29px; padding-bottom: 10px; }
  .bt-date { font-size: 17px; }
  .board-meta { gap: 5px 10px; }
  .board-meta .spacer { display: none; }
  .board-head .badge.neutral { font-size: 14px; padding: 0 8px; }
  .board-head .fresh-chip { font-size: 14px; }
  .board-head .btn-ghost { font-size: 12px; padding: 5px 10px; }
  /* the check mark costs width the two moneyline columns need at 390px */
  table.board td.bestmark::after { content: none; }
  table.board td.bestmark { background-position: right 4px bottom 4px; background-size: 44px 6px; }
  .board-summary { gap: 6px 22px; padding: 10px 2px 8px; margin-bottom: 20px; }
  .board-summary .count .n { font-size: 27px; }
  .event-card { padding: 20px 18px; margin-bottom: 22px; }
  .chalk-frame { inset: -6px; border-width: 10px; border-image-width: 10px; }
  /* board screenshots pan at legible size instead of shrinking to mush */
  .proof figure:first-of-type, figure.figure-board { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
  .proof figure:first-of-type img, figure.figure-board img { width: 640px; max-width: none; }
  /* compare table scrolls at readable line lengths instead of crushing */
  table.compare { min-width: 520px; }
  table.compare td:first-child { font-size: 10.5px; padding: 9px 8px; }
}

/* quant-mode board: anchor book names, fade the right edge to signal scroll */
@media (max-width: 700px) {
  table.board th:first-child, table.board td:first-child { position: sticky; left: 0; background: var(--board-raised); z-index: 1; }
  table.board tr.bench-row td:first-child { background: #262c37; }
  .tablewrap {
    -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent);
    mask-image: linear-gradient(90deg, #000 94%, transparent);
  }
  /* history chart opens on the newest data; the left fade says earlier history exists */
  .chartwrap {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%);
    mask-image: linear-gradient(90deg, transparent 0, #000 5%);
  }
}

/* landing header on phones: brand + tagline only; the hero carries the CTA */
@media (max-width: 560px) {
  body.landing .site-header .btn-ghost { display: none; }
}

/* ---------- landing page ---------- */
.landing {
  /* recolored chalk marks for the landing copy — same strokes, different sticks */
  --chalkline-teal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-10%25' y='-60%25' width='120%25' height='220%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.11 0.7' numOctaves='2' seed='7' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.6' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.9' numOctaves='2' seed='3' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.25' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M3 6 Q 30 3 60 5.5 T 117 5' fill='none' stroke='%237fd4c9' stroke-width='4.4' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E");
  --chalkline-blue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-10%25' y='-60%25' width='120%25' height='220%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.11 0.7' numOctaves='2' seed='5' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.6' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.9' numOctaves='2' seed='2' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.25' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M3 6 Q 30 3 60 5.5 T 117 5' fill='none' stroke='%238fb3f2' stroke-width='4.4' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E");
  --squiggle-pink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cfilter id='r' x='-10%25' y='-60%25' width='120%25' height='220%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.13 0.8' numOctaves='2' seed='6' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.2' result='rough'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55 0.9' numOctaves='2' seed='2' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0.3' result='ga'/%3E%3CfeComposite in='rough' in2='ga' operator='in'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M2 5 Q 25 2 50 4.5 T 98 4' fill='none' stroke='%23f2a0a5' stroke-width='3' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
  /* hand-drawn chalk rings for the lesson numbers */
  --ring-teal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cfilter id='r' x='-15%25' y='-15%25' width='130%25' height='130%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.16 0.4' numOctaves='2' seed='4' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.8'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M46 10 C 32 3, 13 9, 8 24 C 3 40, 14 55, 31 56 C 48 57, 59 46, 57 30 C 55 17, 46 9, 33 10' fill='none' stroke='%237fd4c9' stroke-width='3.2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
  --ring-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cfilter id='r' x='-15%25' y='-15%25' width='130%25' height='130%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.16 0.4' numOctaves='2' seed='9' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.8'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M18 12 C 32 3, 52 9, 56 25 C 60 41, 49 55, 32 56 C 15 57, 5 45, 7 29 C 9 16, 18 9, 31 9' fill='none' stroke='%23f5dd7a' stroke-width='3.2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
  --ring-blue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cfilter id='r' x='-15%25' y='-15%25' width='130%25' height='130%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.16 0.4' numOctaves='2' seed='13' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='2.8'/%3E%3C/filter%3E%3Cpath filter='url(%23r)' d='M32 8 C 47 6, 58 17, 57 32 C 56 48, 44 57, 29 56 C 14 55, 5 43, 7 28 C 9 15, 19 8, 32 8' fill='none' stroke='%238fb3f2' stroke-width='3.2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E");
}
.landing main { max-width: 1020px; }

/* chalk marks used inside running copy — the board's own marking language */
.cm { padding: 0 2px; }
.cm-teal { background: var(--chalkline-teal) no-repeat 0 100% / 100% 8px; padding-bottom: 5px; color: var(--chalk); }
.cm-blue { background: var(--chalkline-blue) no-repeat 0 100% / 100% 8px; padding-bottom: 5px; color: var(--chalk); }
.cm-pink { background: var(--squiggle-pink) no-repeat 0 100% / 100% 6px; padding-bottom: 5px; color: var(--chalk); }
.cm-goldbox { background: var(--chalkbox) no-repeat center / 100% 100%; padding: 2px 8px; color: var(--chalk); white-space: nowrap; }
.cm-goldline { background: var(--chalkline) no-repeat 0 96% / 100% 9px; padding: 0 4px 4px; }

/* section headers: handwritten kicker over a printed title — the lesson outline */
.sec-head { text-align: center; margin: 0 0 26px; }
.sec-kicker {
  font-family: var(--hand); font-size: 19px; color: var(--pencil); margin: 0 0 4px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.sec-kicker::before, .sec-kicker::after {
  content: ''; width: 46px; height: 6px; flex: none; opacity: .55;
  background: var(--squiggle) no-repeat center / 100% 5px;
}
.sec-title {
  font-family: var(--hand); font-size: clamp(27px, 4vw, 36px); font-weight: 700; margin: 0;
  color: var(--chalk); text-shadow: 0 0 12px rgba(234, 232, 220, .18);
}

/* ---- hero ---- */
.hero { text-align: center; padding: 50px 10px 34px; position: relative; }
/* animated chalk sketches live behind the hero content, side margins only */
.hero > :not(.hero-chalkart) { position: relative; z-index: 1; }
.hero-chalkart {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none; overflow: visible;
}
/* JS (hero-chalk.js) draws corner sketches on mobile ≥360px; only hide when too tight */
@media (max-width: 359px) { .hero-chalkart { display: none; } }
.hero-logo { height: 150px; width: auto; margin-bottom: 18px; }
/* the slot machine is a wider illustration than the card mark — give it presence */
.hero-fig { position: relative; display: inline-block; margin-bottom: 20px; }
.hero-fig::before {
  content: ''; position: absolute; inset: -46px -90px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(245, 221, 122, .10), rgba(245, 221, 122, .035) 55%, transparent 75%);
}
.hero-slot { position: relative; height: 200px; width: auto; display: block;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, .45)); }
.hero-note {
  position: absolute; right: calc(100% + 14px); top: 4px; width: 172px; text-align: right;
  font-family: var(--hand); font-size: 19.5px; line-height: 1.15; color: var(--pencil);
  transform: rotate(-3.5deg);
}
.hero-note .note-arrow { display: block; width: 74px; height: auto; margin: 6px 4px 0 auto; opacity: .85; }
@media (max-width: 900px) { .hero-note { display: none; } }
@media (max-width: 560px) { .hero-slot { height: 152px; } .hero-fig::before { inset: -30px -50px; } }
.hero-eyebrow {
  font-family: var(--hand); color: var(--amber); font-size: clamp(21px, 3.4vw, 29px);
  line-height: 1.15; margin: 0 0 6px; letter-spacing: .01em;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 56px); line-height: 1.12; margin: 0 0 16px; letter-spacing: -.015em;
  text-shadow: 0 0 14px rgba(234, 232, 220, .16);
}
.hero-circled { position: relative; padding: 4px 20px; margin: 0 -16px; white-space: nowrap; display: inline-block; }
.hero-sub { color: var(--chalk-soft); font-size: 18px; max-width: 56ch; margin: 0 auto 26px; line-height: 1.6; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-ctas .btn-primary { width: auto; padding: 12px 26px; font-size: 15.5px; }
.hero-ctas .btn-ghost { padding: 12px 22px; font-size: 14.5px; }
.hero-hand { font-family: var(--hand); color: var(--pencil); font-size: 20px; margin-top: 22px; }

/* ---- features: three numbered lessons, each marked with its own chalk ---- */
.features-sec { margin: 44px 0 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; margin: 0 0 26px; }
.feature { position: relative; padding-top: 22px; }
.feature-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-bottom: 10px;
  font-family: var(--hand); font-size: 24px; font-weight: 700; color: var(--chalk);
  background: var(--ring) no-repeat center / contain;
}
.f-teal { --ring: var(--ring-teal); }
.f-gold { --ring: var(--ring-gold); }
.f-blue { --ring: var(--ring-blue); }
.f-teal .feature-no { color: var(--green); }
.f-gold .feature-no { color: var(--yellow); }
.f-blue .feature-no { color: var(--blue); }
.feature h3 { font-family: var(--hand); font-size: 24px; margin: 0 0 6px; color: var(--chalk); }
.feature p { color: var(--chalk-soft); font-size: 14.5px; line-height: 1.75; margin: 0; }

/* ---- proof: derivations taped to the board ---- */
.proof { margin: 56px 0 0; }
.proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin: 0 0 34px; align-items: center; }
@media (max-width: 760px) { .proof-grid { grid-template-columns: 1fr; } }
.proof figure { margin: 0; position: relative; }
.proof img { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); display: block; }
.proof figcaption { font-family: var(--hand); font-size: 17.5px; color: var(--pencil); margin-top: 10px; text-align: center; }
@media (min-width: 761px) {
  .proof figure.tilt-l { transform: rotate(-1.1deg); }
  .proof figure.tilt-r { transform: rotate(.9deg); }
  .proof figure { transition: transform .25s ease; }
  .proof figure:hover { transform: rotate(0deg); }
  /* strips of tape holding each printout to the slate */
  .proof figure::before, .proof figure::after {
    content: ''; position: absolute; top: -11px; width: 72px; height: 22px; z-index: 2;
    background: rgba(234, 232, 220, .14);
    border: 1px solid rgba(234, 232, 220, .10);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  }
  .proof figure::before { left: 9%; transform: rotate(-5deg); }
  .proof figure::after { right: 9%; transform: rotate(4deg); }
}

/* ---- pricing: the Pro card is the one the teacher circled ---- */
.pricing { text-align: center; padding: 52px 0 6px; }
.pricing h2 { font-family: var(--hand); font-size: clamp(26px, 4vw, 34px); font-weight: 700; margin: 0; text-shadow: 0 0 10px rgba(234, 232, 220, .15); }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 20px; max-width: 1000px; margin: 6px auto 0; text-align: left; }
.tier { display: flex; flex-direction: column; }
@media (min-width: 940px) {
  .tiers { grid-template-columns: 1fr 1.16fr 1fr; align-items: start; }
  .tier-pro { transform: translateY(-14px); }
}
.tier-pro {
  border: 1.5px solid rgba(245, 221, 122, .55); position: relative;
  background:
    linear-gradient(180deg, rgba(245, 221, 122, .06), rgba(245, 221, 122, 0) 46%),
    var(--board-raised);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .40), 0 2px 30px rgba(245, 221, 122, .10);
}
.tier-pro:hover { border-color: rgba(245, 221, 122, .75); }
.tier-flag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-1deg);
  font-family: var(--hand); font-size: 17px; font-weight: 600; color: var(--yellow);
  background: var(--board); padding: 0 12px; white-space: nowrap;
}
.tier-name { font-family: var(--hand); font-size: 26px; font-weight: 700; color: var(--chalk); }
.tier-price { font-family: var(--mono); font-size: 34px; font-weight: 700; margin: 2px 0 12px; }
.tier-pro .tier-price { margin: 2px 0 10px; }
.price-circle { position: relative; display: inline-block; padding: 10px 20px 10px 16px; margin: -8px 4px -6px -12px; }
.tier-price .per { font-size: 15px; color: var(--pencil); font-weight: 400; }
.tier-price .annual { font-family: var(--hand); font-size: 17px; color: var(--pencil); font-weight: 400; margin-left: 6px; }
.tier-price .tba { font-family: var(--hand); font-size: 23px; font-weight: 600; color: var(--pencil); }
.tier-list { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }
.tier-list li { font-size: 14px; color: var(--chalk-soft); padding: 6px 0 6px 26px; position: relative; border-bottom: 1px dotted var(--rule-soft); }
.tier-list li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 700; }
.tier-pro .tier-list li::before { color: var(--yellow); }
.tier .btn { text-align: center; }
.tier .btn:disabled { opacity: .55; cursor: default; transform: none; }
.tier-note { font-family: var(--hand); font-size: 16px; color: var(--pencil); margin: 10px 0 0; text-align: center; }
.tier-sharp { border-style: dashed; border-color: var(--rule); background: transparent; box-shadow: none; }
.tier-sharp .tier-list li::before { color: var(--pencil); }
.pricing .fineprint { max-width: 640px; margin: 26px auto 0; }

/* the gold CTA — chalk-yellow, reserved for Pro moments */
.btn-gold { background: var(--yellow); color: var(--on-accent); width: 100%; box-shadow: 0 2px 12px rgba(245, 221, 122, .22); }
.btn-gold:hover { background: #f9e694; transform: translateY(-1px); box-shadow: 0 4px 18px rgba(245, 221, 122, .30); }
.btn-gold:disabled { opacity: .6; transform: none; }

/* waitlist capture — an email, a button, a handwritten receipt */
.notify-form input { font-family: var(--mono); }
.notify-form .notify-msg { font-family: var(--hand); font-size: 17.5px; color: var(--green); margin: 8px 0 0; text-align: center; min-height: 0; }
.notify-form .notify-msg:empty { display: none; }
.notify-form .notify-msg.err { color: var(--red); }
.notify-form.done input, .notify-form.done button { display: none; }
.notify-form.done .notify-msg { font-size: 19px; }
.tier .notify-form input { margin: 0 0 10px; }
.notify-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.notify-row input { width: auto; flex: 1 1 230px; max-width: 320px; margin: 0; }
.notify-row .btn { width: auto; flex: none; padding: 10px 22px; }
.notify-row .notify-msg { flex-basis: 100%; }

/* ---- faq ---- */
.faq { max-width: 680px; margin: 58px auto 0; }
.faq .sec-head { margin-bottom: 12px; }
.faq details { border-bottom: 1px solid var(--rule-soft); padding: 13px 2px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 15.5px; color: var(--chalk); list-style: none; display: flex; align-items: baseline; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q."; font-family: var(--hand); font-size: 21px; font-weight: 700; color: var(--blue); flex: none; }
.faq summary::after { content: "+"; font-family: var(--hand); font-size: 24px; color: var(--pencil); margin-left: auto; flex: none; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--blue); }
.faq p {
  color: var(--chalk-soft); font-size: 14.5px; line-height: 1.65; margin: 10px 0 4px 8px;
  padding-left: 20px; border-left: 2px solid var(--margin-line);
}

/* ---- waitlist band: a note pinned above the chalk tray ---- */
.notify-band {
  max-width: 720px; margin: 60px auto 8px; padding: 34px 30px 30px; text-align: center;
  border: 1.5px dashed rgba(245, 221, 122, .45); border-radius: 16px;
  background: rgba(245, 221, 122, .035); transform: rotate(-.3deg);
}
.notify-band h2 { font-family: var(--hand); font-size: clamp(26px, 4vw, 33px); font-weight: 700; margin: 6px 0 8px; color: var(--chalk); text-shadow: 0 0 10px rgba(234, 232, 220, .15); }
.notify-band .band-sub { color: var(--chalk-soft); font-size: 15px; max-width: 46ch; margin: 0 auto; line-height: 1.6; }
@media (max-width: 560px) { .notify-band { padding: 26px 18px 24px; margin-top: 44px; } }

/* ---------- chalk tray ---------- */
.tray-wrap { max-width: 1020px; margin: 52px auto -6px; padding: 0 24px; overflow: hidden; }
.tray-wrap svg { display: block; width: 100%; height: auto; }
/* phones: the chalk pieces render near desktop size, tray rail cropped at the sides */
@media (max-width: 640px) {
  .tray-wrap svg { width: 640px; position: relative; left: 50%; transform: translateX(-50%); }
}

/* ---------- footer ---------- */
.site-footer {
  max-width: 1020px; margin: 0 auto; padding: 20px 24px 46px;
  color: var(--pencil); font-size: 13px;
}
.site-footer a { color: var(--blue); }
.fineprint { font-size: 12px; color: var(--pencil); opacity: .85; }

/* ---------- first-visit tour ---------- */
#tour { position: fixed; inset: 0; z-index: 40; }
.tour-hole {
  position: fixed; border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--blue), 0 0 0 9999px var(--overlay);
  transition: all .3s ease;
}
.tour-card {
  position: fixed; background: var(--board-raised); border: 1px solid var(--rule);
  border-radius: 12px; padding: 16px 18px; z-index: 41;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5); transition: top .3s ease, left .3s ease;
}
.tour-count { font-family: var(--hand); font-size: 15px; color: var(--faint); }
.tour-title { font-family: var(--hand); font-size: 24px; font-weight: 700; color: var(--chalk); margin: 2px 0 2px; }
.tour-card p { margin: 4px 0 12px; font-size: 14px; color: var(--chalk-soft); line-height: 1.55; }
.tour-actions { display: flex; gap: 8px; align-items: center; }
.tour-actions .btn-primary { width: auto; margin: 0; padding: 7px 16px; font-size: 13.5px; }

/* ---------- age gate ---------- */
.agegate[hidden] { display: none; }
.agegate {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: var(--overlay); backdrop-filter: blur(8px); padding: 20px;
}
.agegate-card {
  max-width: 520px; background: var(--board-raised); border: 1px solid var(--rule);
  border-radius: 14px; padding: 34px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.agegate-card h2 { margin: 14px 0 8px; }
.agegate-card p { color: var(--chalk-soft); font-size: 14.5px; }
.agegate-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; align-items: stretch; }
.agegate-actions .btn { padding: 10px 18px; }
.nowrap { white-space: nowrap; }
.agegate-actions .btn-primary { width: auto; }

/* ---------- Report Card: manual entry + the lesson ---------- */
#report-form { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--rule-soft); }
#report-form .btn-primary { width: auto; padding: 9px 22px; }
.lessonbtn {
  background: none; border: none; cursor: pointer; padding: 2px 6px;
  font-family: var(--hand); font-size: 16px; color: var(--blue);
}
.lessonbtn:hover { color: var(--blue-hover); }
.teachrow > td { padding: 0 8px 14px !important; border-bottom: 1px solid var(--rule-soft); }
.teach {
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, var(--ruling) 27px 28px),
    var(--ink-wash);
  border-left: 3px solid var(--yellow); border-radius: 0 10px 10px 0;
  padding: 12px 16px; font-size: 14px; line-height: 1.6; color: var(--chalk-soft);
  white-space: normal;
  /* the table scrolls horizontally on small screens; the lesson stays pinned
     to the visible viewport instead of scrolling off with the columns */
  position: sticky; left: 0; max-width: min(620px, calc(100vw - 96px));
}
/* the per-bet lesson gets a named anchor — a yellow handwritten tab */
.teach::before {
  content: "the lesson —"; display: block; margin-bottom: 2px;
  font-family: var(--hand); font-size: 17px; font-weight: 600; color: var(--yellow); opacity: .9;
}
.teach-line { margin: 4px 0; }
.teach-line b { color: var(--chalk); }
.teach .grade-line { margin-top: 9px; padding-top: 8px; border-top: 1px dotted var(--rule); font-family: var(--hand); font-size: 15.5px; }
.gpa-math { font-size: 16px; }
.stale.prov { margin-left: 7px; font-size: 12.5px; }

/* ---------- margin doodles: the board has been taught on all day ---------- */
.doodle-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .3;
}
.doodle-layer svg { width: 100%; height: 100%; }

/* ---------- the wordmark: plain white chalk, red pen circling "Bet" ---------- */
/* graded-paper markup: the teacher's imperfect red circle around the answer */
.wm-bet { position: relative; display: inline-block; padding: 0 .05em; }
.wm-circle {
  position: absolute; left: -16%; top: -16%; width: 133%; height: 134%;
  overflow: visible; pointer-events: none; transform: rotate(-2.5deg);
}
.wm-circle path {
  stroke: #cf3f2e; stroke-width: 4.2; fill: none;                 /* deep apple-red pen */
  stroke-linecap: round; stroke-linejoin: round; opacity: .95;
  vector-effect: non-scaling-stroke;
}

/* arbitrage positioning headline — honest that winning arbs gets you limited,
   so the product leads with the durable edge instead */
.arb-headline {
  margin: 0 0 22px; padding: 15px 20px 14px;
  border-left: 3px solid var(--amber); border-radius: 0 12px 12px 0;
  background: rgba(245, 221, 122, .06);
}
.arb-headline-title {
  font-family: var(--hand); font-size: clamp(20px, 3vw, 26px);
  line-height: 1.15; color: var(--amber); margin: 0 0 7px;
}
.arb-headline-body { margin: 0; font-size: 15px; line-height: 1.5; color: var(--chalk-soft); max-width: 72ch; }

/* animated hero slot machine (hero-slot.js swaps the static img in) */
.hero-slot-anim { height: 210px; width: auto; margin-bottom: 20px; overflow: visible; }
@media (max-width: 560px) { .hero-slot-anim { height: 165px; } }

/* ---------- the wood frame: chalkboards are framed, so is the site ---------- */
/* a border-image tile: shaded wood with grain along each side, mitered
   corner joints, an inner bevel (lit top/left, shadowed bottom/right) and a
   dark outer rim. Fixed over everything, never interactive; the inset
   shadow settles the board into the frame. */
.board-frame {
  position: fixed; inset: 0; pointer-events: none; z-index: 90;
  border: 16px solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cdefs%3E%3ClinearGradient id='w' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%238a6844'/%3E%3Cstop offset='.5' stop-color='%23755a3b'/%3E%3Cstop offset='1' stop-color='%235d452e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 0 H120 V120 H0 Z M26 26 V94 H94 V26 Z' fill='url(%23w)' fill-rule='evenodd'/%3E%3Cg stroke='rgba(50,35,19,.42)' stroke-width='1.5' fill='none'%3E%3Cpath d='M4 9 C 30 7.6 70 10 116 8.4'/%3E%3Cpath d='M2 17.5 C 45 16 85 18.6 118 16.5'/%3E%3Cpath d='M4 111 C 30 112.4 70 110 116 111.6'/%3E%3Cpath d='M2 102.5 C 45 104 85 101.4 118 103.5'/%3E%3Cpath d='M9 4 C 7.6 30 10 70 8.4 116'/%3E%3Cpath d='M17.5 2 C 16 45 18.6 85 16.5 118'/%3E%3Cpath d='M111 4 C 112.4 30 110 70 111.6 116'/%3E%3Cpath d='M102.5 2 C 104 45 101.4 85 103.5 118'/%3E%3C/g%3E%3Cpath d='M0 0 L26 26 M120 0 L94 26 M120 120 L94 94 M0 120 L26 94' stroke='rgba(38,26,14,.55)' stroke-width='1.6'/%3E%3Cpath d='M26 94 L26 26 L94 26' stroke='rgba(255,232,190,.30)' stroke-width='2.4' fill='none'/%3E%3Cpath d='M26 94 L94 94 L94 26' stroke='rgba(25,16,8,.5)' stroke-width='2.4' fill='none'/%3E%3Crect x='1.1' y='1.1' width='117.8' height='117.8' fill='none' stroke='%23392a18' stroke-width='2.2'/%3E%3C/svg%3E") 26 / 16px stretch;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, .55);
}
@media (max-width: 640px) {
  .board-frame { border-width: 9px; border-image-width: 9px; box-shadow: inset 0 0 14px rgba(0, 0, 0, .5); }
}
@media print { .board-frame, .doodle-layer { display: none; } }

/* tray docked to the frame's bottom rail on big screens */
.tray-wrap.tray-fixed {
  position: fixed; left: 0; right: 0; bottom: 4px; z-index: 91;
  margin: 0 auto; pointer-events: none;
}
body.tray-docked { padding-bottom: 96px; }
body.tray-docked .site-footer { padding-bottom: 26px; }

/* ---------- Learn: the Kelly derivation, hill chart, and season sim ---------- */
.learn-derivation { margin: 18px 0 8px; }
.lstep { padding: 14px 0 12px; border-bottom: 1px solid var(--rule-soft); }
.lstep-label { font-family: var(--hand); font-size: 19px; color: var(--chalk); margin-bottom: 8px; }
.lstep-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-right: 8px; border: 1.6px solid var(--yellow);
  border-radius: 50%; font-size: 14px; color: var(--yellow); transform: rotate(-4deg);
}
.lstep-eq { overflow-x: auto; padding: 4px 2px 6px; font-size: 17px; }
.lstep-eq .lfrag { margin-right: 10px; }
/* circle the answer instead of underlining it — an underline clips fractions &
   underbraces (Kelly derivation steps 7-8); the box clears them and matches the
   brand ("answers circled in yellow chalk") */
.lstep-eq .res-mark {
  display: inline-block; position: relative; padding: 3px 14px 5px;
  background: var(--chalkbox) no-repeat center / 100% 100%;
}
/* mobile: shrink the equations so more fit, and stop the circled result from
   clipping. inline-block (above) lets the circle grow the line box instead of
   bleeding into .lstep-eq's overflow clip; the widest steps still scroll. */
@media (max-width: 640px) {
  .lstep-eq { font-size: 14px; padding: 6px 2px 10px; -webkit-overflow-scrolling: touch; }
  .lstep-eq .res-mark { padding: 2px 10px 4px; }
  .lstep-label { font-size: 16.5px; }
  .lstep-note { font-size: 13.5px; }
}
.lstep-note { font-size: 14.5px; color: var(--chalk-soft); margin-top: 6px; max-width: 660px; }
.learn-chart { margin: 16px 0 6px; }
.learn-chart svg { width: 100%; height: auto; max-width: 680px; display: block; }
.learn-sim { margin: 16px 0 4px; }
.sim-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.sim-count { font-size: 16px; }
#sim-canvas { display: block; width: 100%; border: 1px solid var(--rule-soft); border-radius: 10px; background: rgba(0,0,0,.14); }
.sim-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 2px 6px; font-size: 13.5px; color: var(--chalk-soft); }
.sim-key { display: inline-flex; align-items: center; gap: 7px; }
.sim-key i { width: 14px; height: 3.5px; border-radius: 2px; display: inline-block; }
.sim-key b { color: var(--chalk); font-family: var(--mono); font-weight: 600; }

/* ---------- Learn: the three-lesson course ---------- */
.lesson-index {
  display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap;
  margin: 26px 0 6px; padding: 12px 16px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--banner-bg);
}
.lesson-index-kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); }
.lesson-index a { color: var(--blue); text-decoration: none; font-size: 14.5px; }
.lesson-index a:hover { color: var(--blue-hover); text-decoration: underline; }
.lesson-banner {
  margin: 42px 0 4px; padding-top: 26px; border-top: 2px solid var(--rule);
  font-family: var(--hand); font-weight: 700; font-size: 27px; color: var(--chalk);
}
.lesson-banner .lesson-num {
  display: inline-block; margin-right: 12px; padding: 1px 12px 2px;
  border: 1.8px solid var(--yellow); border-radius: 99px; transform: rotate(-2deg);
  font-size: 17px; color: var(--yellow); vertical-align: middle;
}

/* ---------- board search ---------- */
.board-search { display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; }
.board-search input {
  flex: 0 1 340px; padding: 8px 13px; font-size: 14.5px;
  background: var(--input-bg); color: var(--chalk);
  border: 1px solid var(--rule); border-radius: 9px;
}
.board-search input:focus { outline: none; border-color: var(--blue); }
.board-search input::placeholder { color: var(--faint); }
@media (max-width: 640px) { .board-search input { flex-basis: 100%; } }
