/* letx: chalkboard meets modern notebook. Paper with a faint grid in light mode, slate-green chalkboard in
   dark mode. System fonts only; maths in the system's math font via native MathML. */
:root {
  --bg: #f8f6ef; --bg2: #f1eee3; --fg: #1d2433; --muted: #5d6475; --faint: #8a8f9c;
  --card: #fffefa; --line: #e3dfd2; --line2: #d4cfbe; --grid: rgba(70, 110, 170, .075);
  --ink: #1d2433; --accent: #2457c5; --accent-2: #1b46a3; --accent-fg: #fff;
  --blue: #2a62d4; --coral: #df5a36; --yellow: #e2a800; --green: #23866a; --violet: #7b4fc9;
  --blue-t: rgba(42, 98, 212, .14); --coral-t: rgba(223, 90, 54, .14); --yellow-t: rgba(226, 168, 0, .2); --green-t: rgba(35, 134, 106, .14);
  --margin: #e9a3a3; --hl: #fff1b8;
  --board: #22332e; --board-fg: #eef0e8; --board-line: rgba(255, 255, 255, .1);
  --radius: 16px; --shadow: 0 1px 2px rgba(29, 36, 51, .05), 0 6px 20px rgba(29, 36, 51, .06);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --math: "STIX Two Math", "Cambria Math", "Latin Modern Math", "Noto Sans Math", math, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d2b27; --bg2: #18241f; --fg: #eceee6; --muted: #b3bcb3; --faint: #8b978f;
    --card: #23332e; --line: rgba(236, 240, 232, .12); --line2: rgba(236, 240, 232, .2); --grid: rgba(236, 240, 232, .035);
    --ink: #f4f3ea; --accent: #f2d974; --accent-2: #f7e49a; --accent-fg: #1d2b27;
    --blue: #9ccaf3; --coral: #f4a596; --yellow: #f2d974; --green: #a6dfb9; --violet: #cbb4f5;
    --blue-t: rgba(156, 202, 243, .16); --coral-t: rgba(244, 165, 150, .16); --yellow-t: rgba(242, 217, 116, .18); --green-t: rgba(166, 223, 185, .15);
    --margin: rgba(244, 165, 150, .55); --hl: rgba(242, 217, 116, .2);
    --board: #172420; --board-fg: #eef0e8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d2b27; --bg2: #18241f; --fg: #eceee6; --muted: #b3bcb3; --faint: #8b978f;
  --card: #23332e; --line: rgba(236, 240, 232, .12); --line2: rgba(236, 240, 232, .2); --grid: rgba(236, 240, 232, .035);
  --ink: #f4f3ea; --accent: #f2d974; --accent-2: #f7e49a; --accent-fg: #1d2b27;
  --blue: #9ccaf3; --coral: #f4a596; --yellow: #f2d974; --green: #a6dfb9; --violet: #cbb4f5;
  --blue-t: rgba(156, 202, 243, .16); --coral-t: rgba(244, 165, 150, .16); --yellow-t: rgba(242, 217, 116, .18); --green-t: rgba(166, 223, 185, .15);
  --margin: rgba(244, 165, 150, .55); --hl: rgba(242, 217, 116, .2);
  --board: #172420; --board-fg: #eef0e8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font: 17px/1.6 var(--sans); color: var(--fg); background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px;
  overflow-wrap: break-word;
}
.js .nojs { display: none; }
html:not(.js) .js-only { display: none !important; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--round); line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.8rem); margin: .3em 0 .25em; font-weight: 800; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .55em; font-weight: 750; }
h3 { font-size: 1.08rem; margin: 1.2em 0 .4em; }
p { margin: 0 0 .9em; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: .05em .35em; }
math { font-family: var(--math); font-size: 1.08em; }
math[display="block"] { margin: .4em 0; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-fg); padding: .5em 1em; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 46em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kicker { font: 700 .78rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--coral); margin: 0 0 .4em; }
.kicker a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .4em; }
.kicker .ticon { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; gap: .45em; min-height: 44px; padding: .55em 1.05em; border-radius: 999px; border: 1.5px solid var(--accent);
  background: var(--accent); color: var(--accent-fg); font: 650 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-2); color: var(--accent-fg); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn .uicon { width: 18px; height: 18px; }
.uicon { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------------ header */
.top { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { border-radius: 9px; }
.wm { font: 800 1.42rem/1 var(--round); letter-spacing: -.02em; }
.wm i { font-family: var(--math); font-style: italic; font-weight: 500; margin-left: .06em; font-size: 1.15em; color: var(--coral); }
.wm b { font-weight: 700; color: var(--yellow); margin-left: .12em; }
.brand.small .wm { font-size: 1.15rem; }
.mainnav { display: flex; gap: 4px; }
.mainnav a { padding: .45em .75em; border-radius: 999px; color: var(--fg); text-decoration: none; font-weight: 600; font-size: .95rem; }
.mainnav a:hover { background: var(--bg2); }
.mainnav a[aria-current] { background: var(--ink); color: var(--bg); }
.qs { position: relative; flex: 1; max-width: 360px; margin-left: auto; display: flex; align-items: center; }
.qs > .uicon { position: absolute; left: 12px; color: var(--faint); pointer-events: none; width: 18px; height: 18px; }
.qs input, .filter input { width: 100%; min-height: 44px; font: 16px var(--sans); padding: .5em .9em .5em 2.4em; border-radius: 999px;
  border: 1.5px solid var(--line2); background: var(--card); color: var(--fg); }
.qs input:focus, .filter input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--blue-t); }
.qs-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line2); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; z-index: 30; max-height: 70vh; overflow: auto; min-width: 280px; }
.qs-list a { display: block; padding: .5em .7em; border-radius: 9px; text-decoration: none; color: var(--fg); }
.qs-list a b { display: block; font-weight: 650; }
.qs-list a span { display: block; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-list a:hover, .qs-list a.on { background: var(--blue-t); }
.qs-none { margin: .4em .6em; color: var(--muted); font-size: .92rem; }
.theme-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--card); color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer; }
.theme-btn:hover { border-color: var(--accent); }
.topicnav { border-top: 1px solid var(--line); }
.tn-scroll { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-top: 4px; padding-bottom: 4px; }
.tn-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 1021px) { .tn-scroll { flex-wrap: wrap; overflow: visible; } }
.topicnav a { display: inline-flex; align-items: center; gap: .4em; white-space: nowrap; padding: .35em .7em; border-radius: 999px; font-size: .88rem;
  font-weight: 600; color: var(--muted); text-decoration: none; }
.topicnav a .ticon { width: 17px; height: 17px; }
.topicnav a:hover { color: var(--ink); background: var(--bg2); }
.topicnav a[aria-current] { color: var(--ink); background: var(--yellow-t); }

/* ------------------------------------------------------------------ footer */
.foot { margin-top: 64px; border-top: 1px solid var(--line); background: var(--bg2); padding: 32px 0 40px; font-size: .92rem; color: var(--muted); }
.footgrid { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr; gap: 32px; }
.foot a { color: var(--fg); }
.foot .brand { margin-bottom: .6em; }

/* ------------------------------------------------------------------ breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3em; margin: 18px 0 0; padding: 0; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .3em; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ------------------------------------------------------------------ hero */
.hero { padding: 36px 0 30px; border-bottom: 1px solid var(--line); background:
  radial-gradient(1200px 400px at 85% -10%, var(--yellow-t), transparent 60%), radial-gradient(900px 380px at -10% 110%, var(--blue-t), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 40px; align-items: center; }
.hero-kicker { font: 600 1rem/1.3 var(--mono); color: var(--coral); margin: 0 0 .4em; }
.hero h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4rem); margin: 0 0 .25em; letter-spacing: -.03em; }
.chalk { color: var(--accent); position: relative; white-space: nowrap; }
.chalk::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .2em; background: var(--yellow); opacity: .55; border-radius: 6px; z-index: -1; transform: rotate(-1deg); }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-search { max-width: 520px; margin: 1.2em 0 1em; }
.hero-search input { min-height: 54px; font-size: 17px; box-shadow: var(--shadow); }
.hero-stats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: .95rem; }
.hero-stats b { color: var(--ink); font-family: var(--round); font-size: 1.1rem; }
.board { background: var(--board); color: var(--board-fg); border-radius: 22px; padding: 18px 18px 14px; box-shadow: 0 14px 40px rgba(20, 30, 26, .28), inset 0 0 0 6px #3b2f24, inset 0 0 0 7px rgba(0,0,0,.3);
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 6px 6px; }
.board-label { font: 600 .82rem/1.2 var(--mono); color: #f2d974; margin: 6px 6px 0; text-transform: lowercase; }
.board-math { font-size: 1.35rem; text-align: center; color: #fff; padding: 2px 0; }
.board .graph { margin: 0; }
.board .plotbox { background: transparent; border: 0; }
.board .graph figcaption { color: #cdd5cd; }
.board .g-cap { color: #f2d974; }
.board .sliders .slider output, .board .sl-sym { color: #fff; }
.board-link { display: inline-flex; align-items: center; gap: .3em; color: #f2d974; font-weight: 650; margin: 4px 6px; text-decoration: none; }
.board-link:hover { color: #fff; }
.board-link .uicon { width: 18px; height: 18px; }
/* the hero board always looks like a chalkboard, so give its plot chalk colours */
.board .plot { --ink: #eef0e8; --muted: #c4cdc4; --blue: #9ccaf3; --coral: #f4a596; --yellow: #f2d974; --green: #a6dfb9; --bg: #22332e;
  --line: rgba(255,255,255,.1); --line2: rgba(255,255,255,.28); --grid: rgba(255,255,255,.06); --blue-t: rgba(156,202,243,.18); }

/* ------------------------------------------------------------------ home */
.sec-h { margin-top: 1.5em; }
.grid { display: grid; gap: 16px; }
.grid.topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* 9 topics: 3 / 1 columns (PARK-56) */
@media (max-width: 640px) { .grid.topics { grid-template-columns: minmax(0, 1fr); } }
.tcard { display: flex; gap: 14px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none;
  color: var(--fg); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.tcard:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--fg); }
.t-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--yellow-t); color: var(--ink); display: grid; place-items: center; }
.t-icon .ticon { width: 28px; height: 28px; }
.tc-body { display: flex; flex-direction: column; gap: 2px; }
.tc-title { font: 750 1.08rem/1.25 var(--round); color: var(--ink); }
.tc-blurb { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.tc-count { font: 600 .8rem var(--mono); color: var(--coral); margin-top: 4px; }
.home-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.home-two .card, .home-check { padding: 22px 24px; }
.home-two h2, .home-check h2 { margin-top: 0; }
.weekly-math { font-size: 1.4rem; padding: .3em 0; overflow-x: auto; }
.promo-list { padding-left: 1.1em; margin: 0 0 1em; }
.promo-list li { margin: .3em 0; }
.home-check { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: center; margin-top: 16px; }
.checknums { display: grid; gap: 10px; margin: 0; }
.checknums div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.checknums dt { font-size: .85rem; color: var(--muted); }
.checknums dd { margin: 0; font: 800 1.6rem/1.2 var(--round); color: var(--green); }

/* ------------------------------------------------------------------ formula cards */
.grid.cards { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.grid.cards > * { flex: 0 1 calc((100% - 2 * 16px) / 3); min-width: 0; }   /* 3/2/1 at the old auto-fill widths, short last row centred (PARK-56) */
@media (max-width: 934px) { .grid.cards > * { flex-basis: calc((100% - 16px) / 2); } }
@media (max-width: 628px) { .grid.cards > * { flex-basis: 100%; } }
.fcard { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 14px 26px; text-decoration: none; color: var(--fg); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; overflow: hidden; }
.fcard::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--margin); }
.fcard:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--fg); }
.fc-title { margin: 0 0 .3em; font-size: 1.05rem; }
.fc-math { font-size: 1.05rem; overflow-x: auto; overflow-y: hidden; padding: .15em 0 .3em; color: var(--ink); scrollbar-width: thin; }
.fc-math math[display="block"] { margin: 0; text-align: left; }
.fc-short { color: var(--muted); font-size: .92rem; line-height: 1.45; margin: .2em 0 0; }

/* ------------------------------------------------------------------ topic page */
.t-head { display: flex; gap: 18px; align-items: flex-start; margin-top: 8px; }
.t-head .t-icon { width: 64px; height: 64px; margin-top: 18px; border-radius: 18px; }
.t-head .t-icon .ticon { width: 36px; height: 36px; }
.t-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------------ formula page */
.f-head { margin-top: 6px; }
.f-head h1 { margin-top: .1em; }
.fbox { position: relative; margin: 14px 0 22px; padding: 22px 22px 18px 44px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow); background-image: linear-gradient(transparent calc(100% - 1px), var(--grid) 1px); background-size: 100% 30px; }
.fbox::before { content: ""; position: absolute; left: 24px; top: 0; bottom: 0; width: 2px; background: var(--margin); }
.fbox-math { font-size: clamp(1.35rem, 1.1rem + 1.4vw, 2.1rem); overflow-x: auto; overflow-y: hidden; color: var(--ink); padding: .1em 0; scrollbar-width: thin; }
.fbox-math math[display="block"] { margin: .1em 0; }
.forms { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line2); }
.form { min-width: 0; max-width: 100%; overflow-x: auto; }
.form-l { display: block; font: 600 .75rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form math[display="block"] { margin: .2em 0 0; text-align: left; font-size: 1.1em; }
.copy { position: absolute; top: 10px; right: 10px; font: 600 .78rem var(--sans); color: var(--muted); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 999px; padding: .35em .8em; cursor: pointer; min-height: 32px; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.ok { color: var(--green); border-color: var(--green); }
.play { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.play.solo { grid-template-columns: minmax(0, 760px); }
.play > .card { padding: 18px 20px 20px; }
.play h2 { margin: 0 0 .5em; font-size: 1.15rem; }

/* calculator */
.calc-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.calc-title { display: flex; align-items: center; gap: .4em; }
.solvefor { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sf-label { font: 600 .8rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 2px; }
.sf-label math { text-transform: none; font-size: 1.15rem; }
.sf-n { text-transform: none; font: 600 .92rem var(--sans); letter-spacing: 0; color: var(--ink); }
.solvefor button, .angle button { min-height: 44px; min-width: 48px; padding: .3em .85em; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--bg);
  color: var(--fg); cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; font: 600 .9rem var(--sans); }
.solvefor button math { font-size: 1.2rem; }
.sf-name { font-size: .68rem; font-weight: 600; color: var(--muted); max-width: 9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.solvefor button[aria-checked="true"], .angle button[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.solvefor button[aria-checked="true"] .sf-name { color: var(--bg); opacity: .8; }
.angle { display: inline-flex; gap: 0; align-self: flex-start; border-radius: 12px; }
.angle button { border-radius: 0; min-width: 88px; }
.angle button:first-child { border-radius: 12px 0 0 12px; }
.angle button:last-child { border-radius: 0 12px 12px 0; border-left: 0; }
.calc-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 12px; }
.field label { display: flex; align-items: baseline; gap: .45em; font-size: .86rem; color: var(--muted); margin-bottom: 4px; min-height: 1.6em; }
.field label math { font-size: 1.2rem; color: var(--ink); }
.field.wide { grid-column: 1 / -1; }
.f-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-in { position: relative; display: flex; align-items: center; }
.f-in input, .f-in textarea { width: 100%; min-height: 50px; font: 500 18px/1.3 var(--mono); padding: .55em .8em; border: 1.5px solid var(--line2);
  border-radius: 12px; background: var(--bg); color: var(--fg); }
.f-in textarea { min-height: 76px; resize: vertical; font-size: 16px; }
.f-in input:focus, .f-in textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--blue-t); }
.f-unit { position: absolute; right: 12px; font-size: .8rem; color: var(--faint); pointer-events: none; background: var(--bg); padding-left: 4px; }
.calc-out { margin: 16px 0 6px; min-height: 3.2em; }
.calc-ans { font-size: 1.5rem; margin: 0; padding: .45em .7em; border-radius: 12px; background: var(--hl); color: var(--ink); overflow-x: auto; }
.calc-ans math { font-size: 1.15em; }
.calc-note { color: var(--muted); font-size: .9rem; margin: .4em 0 0; }
.calc-err { margin: 0; padding: .7em .9em; border-radius: 12px; background: var(--coral-t); color: var(--ink); border-left: 4px solid var(--coral); }
.calc-steps summary { cursor: pointer; font-weight: 650; color: var(--accent); padding: .4em 0; min-height: 44px; display: flex; align-items: center; }
.calc-hint { font-size: .82rem; color: var(--muted); margin: 10px 0 0; }
.calc-hint code { font-size: .8rem; }
.nojs { color: var(--muted); }

/* steps (calculator and worked example) */
.steps { list-style: none; counter-reset: st; padding: 0; margin: .4em 0 0; }
.steps > li { counter-increment: st; position: relative; padding: 2px 0 12px 38px; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font: 700 .8rem var(--sans); }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 12.5px; top: 32px; bottom: 2px; width: 1px; background: var(--line2); }
.steps p { margin: 0 0 .2em; font-size: .97rem; }
.chain { overflow-x: auto; overflow-y: hidden; padding: 2px 0; scrollbar-width: thin; }
.chain math[display="block"], .steps math[display="block"] { text-align: left; margin: .25em 0; font-size: 1.12em; }
.cl { white-space: nowrap; margin: .3em 0; font-size: 1.1em; }
.cl.cont { padding-left: 1.4em; }
.steps > li > math[display="block"] { text-align: left; }

/* graph */
.graph { margin: 0; }
.plotbox { border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.plot { display: block; width: 100%; height: auto; touch-action: pan-y; font-family: var(--sans); }
.plot .pg { stroke: var(--grid); stroke-width: 1; fill: none; }
.plot .pg { stroke: var(--line); }
.plot .pa { stroke: var(--line2); stroke-width: 1.6; fill: none; }
.plot .pt text { font-size: 14.5px; fill: var(--muted); }
.plot .c1, .plot .c2, .plot .c3, .plot .c4 { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.plot .c1 { stroke: var(--blue); } .plot .c2 { stroke: var(--coral); } .plot .c3 { stroke: var(--yellow); } .plot .c4 { stroke: var(--green); }
.plot .thick { stroke-width: 3.4; } .plot .thin { stroke-width: 1.4; } .plot .dash { stroke-dasharray: 6 5; }
.plot .f0 { fill: none; } .plot .f1 { fill: var(--blue-t); } .plot .f2 { fill: var(--coral-t); } .plot .f3 { fill: var(--yellow-t); }
.plot .d1 { fill: var(--ink); } .plot .d2 { fill: var(--coral); } .plot .d3 { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.5; }
.plot text.pl { font-size: 15px; font-weight: 650; fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.plot text.pl2 { font-size: 13px; fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.plot .ra { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.plot .pk { fill: var(--muted); font-family: var(--mono); }
.plot .pk.row { fill: var(--ink); font-weight: 700; }
.plot .pk.hit { fill: var(--coral); font-weight: 800; }
.sliders { display: grid; gap: 6px; margin-top: 12px; }
.slider { display: grid; grid-template-columns: minmax(2.4em, max-content) minmax(0, 1fr) 4.4em; align-items: center; gap: 10px; min-height: 44px; }
.sl-sym { font: italic 600 1.1rem var(--math); color: var(--ink); white-space: nowrap; }
.slider output { font: 600 .95rem var(--mono); text-align: right; color: var(--ink); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--line2); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 99px; background: var(--line2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform .12s ease; }
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 3px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--blue-t), 0 1px 4px rgba(0,0,0,.3); }
.board input[type="range"]::-webkit-slider-thumb { background: #f2d974; border-color: #22332e; }
.board input[type="range"]::-moz-range-thumb { background: #f2d974; border-color: #22332e; }
.board input[type="range"]::-webkit-slider-runnable-track { background: rgba(255,255,255,.25); }
.board input[type="range"]::-moz-range-track { background: rgba(255,255,255,.25); }
.graph figcaption { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.g-cap { margin: 0 0 .3em; font-weight: 600; }
.info { list-style: none; padding: 0; margin: 0; }
.info li { padding: .15em 0 .15em 1.1em; position: relative; }
.info li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }

/* reading column */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; margin-top: 10px; }
.prose { max-width: 760px; }
.prose.narrow { max-width: 760px; }
.prose h2 { border-bottom: 1px solid var(--line); padding-bottom: .25em; }
.prose ul { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.syms { margin: 0; display: grid; gap: 2px; }
.syms > div { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 12px; padding: .5em 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.syms dt { font-size: 1.25rem; text-align: center; color: var(--ink); }
.syms dd { margin: 0; }
.example { padding: 4px 22px 18px; margin-top: 28px; border-left: 4px solid var(--yellow); }
.example h2 { border: 0; margin-top: .8em; }
.ex-q { font-weight: 600; font-size: 1.05rem; }
.ex-a { margin: 8px 0 0; padding: .7em .9em; border-radius: 12px; background: var(--hl); font-weight: 600; }
.ex-tag { font: 700 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; background: var(--ink); color: var(--bg); padding: .2em .55em; border-radius: 6px; margin-right: .4em; vertical-align: .1em; }
.mistakes { list-style: none; padding: 0 !important; }
.mistakes li { position: relative; padding: .5em .8em .5em 2.2em; background: var(--coral-t); border-radius: 12px; margin: .55em 0 !important; }
.mistakes li::before { content: "✗"; position: absolute; left: .8em; top: .5em; color: var(--coral); font-weight: 800; }
.side h2 { font-size: 1.05rem; margin-top: 1.4em; }
.side .side-h2 { margin-top: 1.4em; }
.rel { display: grid; gap: 12px; }
.rel .fcard { padding: 12px 14px 10px 24px; }
.rel .fc-title { font-size: .98rem; }
.rel .fc-math { font-size: .95rem; }
.rel .fc-short { display: none; }
.plain-links { padding-left: 1.1em; margin: 0; }
.tested { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 12px 14px; border-radius: 12px; background: var(--green-t); font-size: .9rem; }
.tested .uicon { color: var(--green); margin-top: 2px; }
.side-links { display: grid; gap: 8px; margin-top: 14px; }
.side-links a { display: inline-flex; gap: .5em; align-items: center; font-weight: 600; min-height: 36px; }

/* ------------------------------------------------------------------ A–Z, finder, glossary */
.filter { position: relative; display: flex; align-items: center; max-width: 560px; margin: 12px 0 14px; }
.filter .uicon { position: absolute; left: 13px; color: var(--faint); width: 18px; height: 18px; }
.filter input { min-height: 50px; }
.az-letter h2 { font-size: 1.6rem; color: var(--coral); margin: 1.2em 0 .3em; }
.az-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 6px 22px; }
.az-list li { display: flex; flex-direction: column; padding: .55em 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.az-list a { text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.az-t { font-weight: 650; }
.az-m { color: var(--ink); overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; font-size: .95rem; }
.az-g { font-size: .78rem; color: var(--muted); }
.fd-controls { position: sticky; top: 104px; z-index: 5; background: var(--bg); padding: 4px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: .35em .9em; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--card); color: var(--fg); font: 600 .88rem var(--sans); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fd-count { margin: 8px 0 0; font-size: .88rem; }
.fd-group h2 { display: flex; align-items: center; gap: .45em; }
.fd-group h2 .ticon { width: 24px; height: 24px; color: var(--coral); }
.tasks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.task a { display: flex; flex-direction: column; gap: 2px; padding: .65em .9em; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--fg); min-height: 44px; }
.task a:hover { border-color: var(--accent); }
.task-f { font-size: .82rem; color: var(--accent); font-weight: 600; }
.gl-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.gl-jump a { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 700; }
.glossary { margin: 18px 0 0; max-width: 820px; }
.gl { padding: 12px 0; border-bottom: 1px dashed var(--line); scroll-margin-top: 120px; }
.gl dt { font: 750 1.1rem var(--round); color: var(--ink); }
.gl dd { margin: .2em 0 0; }
.gl dd p { margin: 0 0 .3em; }
.gl-links { display: flex; flex-wrap: wrap; gap: 6px; }
.gl-links a { font-size: .85rem; padding: .2em .65em; border-radius: 999px; background: var(--blue-t); text-decoration: none; }
.gl:target { background: var(--hl); border-radius: 10px; padding-left: 10px; }

/* ------------------------------------------------------------------ methodology */
.valid { padding: 6px 22px 18px; }
.valid .checknums { grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* 4 numbers: 4 / 2 columns (PARK-56) */
@media (max-width: 700px) { .valid .checknums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vt { width: 100%; border-collapse: collapse; margin: 16px 0 6px; font-size: .95rem; }
.vt th, .vt td { text-align: left; padding: .45em .5em; border-bottom: 1px solid var(--line); }
.vt td + td, .vt th + th { text-align: right; font-variant-numeric: tabular-nums; }
.vt-all summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.vt-list { columns: 2 260px; padding-left: 1.1em; font-size: .92rem; }

/* ------------------------------------------------------------------ cheat sheet */
.sheet-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 20px; }
.sheet-head .lede { flex: 1 1 420px; }
.sheet { columns: 2 380px; column-gap: 18px; margin-top: 16px; }
.sh-card { break-inside: avoid; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; }
.sh-card h2 { font-size: 1rem; margin: 0 0 .2em; }
.sh-card h2 a { color: var(--ink); text-decoration: none; }
.sh-math { overflow-x: auto; overflow-y: hidden; font-size: 1.05rem; }
.sh-math math[display="block"] { text-align: left; }
.sh-form { font-size: .9rem; overflow-x: auto; }
.sh-form span { font: 600 .7rem var(--mono); text-transform: uppercase; color: var(--muted); }
.sh-form math[display="block"] { text-align: left; margin: .1em 0 .3em; }
.sh-syms { list-style: none; padding: 0; margin: .3em 0 0; font-size: .85rem; color: var(--muted); }
.sh-syms li { margin: .15em 0; }
.sh-syms li > math:first-child { color: var(--ink); font-size: 1.05rem; margin-right: .2em; }
.sheet-foot { margin-top: 10px; font-size: .85rem; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { border-top: 1px solid var(--line); margin-top: 24px; }
  .rel { display: flex; flex-wrap: wrap; justify-content: center; }
  .rel > * { flex: 0 1 calc((100% - 2 * 12px) / 3); min-width: 0; }   /* 3/2/1 at the old auto-fill widths, short last row centred (PARK-56) */
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .home-check { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .play { grid-template-columns: minmax(0, 1fr); }
  .home-two { grid-template-columns: minmax(0, 1fr); }
  .footgrid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mainnav { display: none; }
  .fd-controls { top: 112px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .bar { gap: 8px; min-height: 58px; }
  .brand img { width: 30px; height: 30px; }
  .wm { font-size: 1.25rem; }
  .qs { max-width: none; }
  .qs input { padding-left: 2.2em; }
  .qs-list { position: fixed; left: 8px; right: 8px; top: 108px; min-width: 0; }
  .hero { padding-top: 22px; }
  .hero-sub { font-size: 1.04rem; }
  .board { padding: 12px 10px 10px; border-radius: 18px; }
  .board-math { font-size: 1.1rem; }
  .fbox { padding: 18px 14px 14px 32px; }
  .fbox-math { font-size: 1.2rem; }
  .fbox::before { left: 16px; }
  .copy { position: static; margin-top: 8px; }
  .play > .card { padding: 14px 12px 16px; }
  .calc-inputs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .calc-ans { font-size: 1.28rem; }
  .solvefor button { padding: .3em .6em; }
  .steps > li { padding-left: 34px; }
  .example { padding: 2px 14px 14px; }
  .syms > div { grid-template-columns: 3.2em minmax(0, 1fr); gap: 8px; }
  .az-list, .tasks { grid-template-columns: minmax(0, 1fr); }
  .t-head { flex-direction: column; gap: 0; }
  .t-head .t-icon { margin-top: 12px; }
  .slider { grid-template-columns: minmax(2em, max-content) minmax(0, 1fr) 3.8em; gap: 8px; }
}
@media (max-width: 380px) {
  .calc-inputs { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* related formulas below 1020px: 3/2/1 at the old auto-fill widths (PARK-56) */
@media (max-width: 776px) { .rel > * { flex-basis: calc((100% - 12px) / 2); } }
@media (max-width: 524px) { .rel > * { flex-basis: 100%; } }
