/* ============================================================
   RECEIPTS SITE: THE PAPER SYSTEM
   Shared by every page except the home page's black poster hero and
   the app, which carry the same tokens inline. Warm stone desk, cream
   sheet, near-black ink. Colour is spent in two places only: the red
   seal dot, and one amber for the things that need a second look.
   ============================================================ */
:root {
  --bg: #ECE9E1; --sheet: #FBFAF6; --receipt: #FFFDF6; --raise: #E3DFD4;
  --ink: #16150F; --ink2: #33312B; --ink3: #5E5A52;
  --line: #D6D2C7; --line2: #C4BFB2; --line-soft: #EAE6DD;
  --rec: #AE2E1B; --flag: #9A4A15; --flag-soft: #F7E8D9;
  --shadow: rgba(40, 35, 20, .16); --shadow-deep: rgba(40, 35, 20, .28);
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.16, .84, .34, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121210; --sheet: #1C1B18; --receipt: #211F1A; --raise: #191815;
    --ink: #F1EEE6; --ink2: #BDB8AD; --ink3: #9C9890;
    --line: #33312C; --line2: #44413A; --line-soft: #2A2925;
    --rec: #E8543C; --flag: #E0894A; --flag-soft: #3B2A1B;
    --shadow: rgba(0, 0, 0, .45); --shadow-deep: rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121210; --sheet: #1C1B18; --receipt: #211F1A; --raise: #191815;
  --ink: #F1EEE6; --ink2: #BDB8AD; --ink3: #9C9890;
  --line: #33312C; --line2: #44413A; --line-soft: #2A2925;
  --rec: #E8543C; --flag: #E0894A; --flag-soft: #3B2A1B;
  --shadow: rgba(0, 0, 0, .45); --shadow-deep: rgba(0, 0, 0, .65);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip;
}
::selection { background: var(--flag-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line2); }
a:hover { text-decoration-color: var(--ink); }

/* ---------- the bar ---------- */
.sitebar {
  position: sticky; top: 0; z-index: 20;
  background: var(--sheet); border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease);
}
.sitebar.stuck { box-shadow: 0 10px 24px -20px var(--shadow-deep); }
.sitebar .in {
  max-width: 1120px; margin: 0 auto; padding: 10px 22px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink);
}
.brand small { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); font-weight: 400; }
.seal {
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink); position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: none; transform: translateY(5px);
}
.seal::before { content: 'R'; color: var(--sheet); font-family: var(--serif); font-weight: 700; font-size: 16px; }
.seal::after {
  content: ''; position: absolute; top: 1px; right: 0; width: 6px; height: 6px; border-radius: 50%;
  background: var(--rec); box-shadow: 0 0 0 2px var(--sheet);
}
.topnav { margin: 0 0 0 auto; display: flex; gap: 0; flex-wrap: wrap; align-items: center; }
.topnav a {
  font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink2); text-decoration: none; padding: 12px 11px 10px; border-bottom: 2px solid transparent;
  margin-bottom: -11px; white-space: nowrap;
}
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.topnav a[href="/app"], .topnav a[href="/app?signin=1"] {
  background: var(--ink); color: var(--sheet); border-radius: 6px; padding: 9px 13px; margin: 0 0 0 8px;
  border-bottom: 0; font-weight: 600;
}
.topnav a[href="/app"]:hover, .topnav a[href="/app?signin=1"]:hover { opacity: .86; }
.topnav a[href="/privacy"] { color: var(--ink3); }
@media (max-width: 720px) {
  .sitebar .in { padding: 10px 14px; gap: 8px; }
  .topnav { margin-left: 0; width: 100%; max-width: 100%; min-width: 0; flex: 1 1 100%; overflow: visible; flex-wrap: wrap; gap: 0 2px; }
  .topnav a { padding: 12px 9px 10px; margin-bottom: 0; min-height: 44px; display: inline-flex; align-items: center; }
  .topnav a[href="/app"], .topnav a[href="/app?signin=1"] { margin-left: 0; }
}
@media (max-width: 420px) {
  .topnav { gap: 0; }
  .topnav a { padding-left: 7px; padding-right: 7px; font-size: 13px; letter-spacing: .08em; }
}
.navtoggle { display: none; }
.navpanel { display: none; }
/* Below 640px a topnav wrapped onto its own row would eat two rows of the
   viewport before any content, so one row shows the wordmark, the Open app
   action and a Menu button; the other routes drop down in a panel under the
   header, matching the home page's compact mobile header. */
@media (max-width: 640px) {
  .sitebar .in { flex-wrap: nowrap; padding: 5px 14px; }
  .brand small { display: none; }
  .topnav {
    margin-left: auto; width: auto; max-width: none; flex: 0 0 auto; min-width: 0;
    flex-wrap: nowrap; gap: 0; overflow: visible;
  }
  .topnav a:not([href="/app"]):not([href="/app?signin=1"]) { display: none; }
  .topnav a[href="/app"], .topnav a[href="/app?signin=1"] { margin-left: 0; }
  .navtoggle {
    display: inline-block; font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink2); background: transparent; border: 1px solid var(--line2); border-radius: 100px;
    padding: 8px 14px; margin-left: 8px; cursor: pointer; white-space: nowrap; line-height: 1.2;
  }
  .navpanel:not([hidden]) {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
    background: var(--sheet); border-bottom: 1px solid var(--line);
    padding: 4px 22px 8px;
  }
  .navpanel a {
    font-family: var(--serif); font-size: 15px; color: var(--ink); text-decoration: none;
    padding: 13px 4px; border-bottom: 1px solid var(--line-soft); min-height: 44px;
    display: flex; align-items: center;
  }
  .navpanel a:last-child { border-bottom: 0; }
}

/* The public site has five destinations. Resource pages stay discoverable in
   their relevant journeys and the footer, rather than competing in every
   header. */
.path-note {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 14px 16px; margin: 24px 0 28px; border: 1px solid var(--line-soft);
  border-radius: 8px; background: var(--receipt);
}
.path-note strong { margin-right: 4px; }
.path-note a { font-size: 14px; }
.decision-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  margin: 20px 0 28px;
}
.decision-grid > div {
  padding: 18px 18px 16px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: var(--receipt);
}
.decision-grid h2, .decision-grid h3 { border: 0; padding: 0; margin: 0 0 7px; font-size: 17px; }
.decision-grid p { margin: 0; font-size: 14.5px; }
.decision-grid a { display: inline-block; margin-top: 10px; font-weight: 600; }
.quick-steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0 28px; }
.quick-steps li { position: relative; padding: 0 0 18px 42px; max-width: 68ch; }
.quick-steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--sheet); font: 600 13px/26px var(--mono); text-align: center; }
.record-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 28px; }
.record-groups > div { padding: 18px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--receipt); }
.record-groups h2 { border: 0; padding: 0; margin: 0 0 7px; font-size: 17px; }
.record-groups p { margin: 0; font-size: 14.5px; }
@media (max-width: 680px) {
  .decision-grid, .record-groups { grid-template-columns: 1fr; }
}

/* ---------- the sheet ---------- */
main {
  max-width: 880px; margin: 34px auto 96px; padding: 56px 72px 64px;
  background: var(--sheet); border: 1px solid var(--line-soft); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 18, 10, .04), 0 28px 56px -40px var(--shadow-deep);
  position: relative;
}
main::before {
  /* the sheet's perforated top edge, the receipt's signature */
  content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 8px; pointer-events: none;
  background:
    linear-gradient(135deg, var(--bg) 50%, transparent 50%) 0 0 / 12px 8px repeat-x,
    linear-gradient(225deg, var(--bg) 50%, transparent 50%) 0 0 / 12px 8px repeat-x;
}
@media (max-width: 720px) { main { margin: 14px 12px 60px; padding: 30px 20px 36px; border-radius: 8px; } }

h1 {
  font-family: var(--sans); font-weight: 600; font-size: clamp(36px, 5.2vw, 54px);
  letter-spacing: -0.03em; line-height: 1.04; margin: 8px 0 16px; text-wrap: balance; position: relative;
}
h1::after {
  content: ''; display: block; height: 2px; width: 56px; background: var(--ink); margin-top: 18px;
  transform-origin: left; transform: scaleX(0); animation: rule .7s var(--ease) .25s forwards;
}
@keyframes rule { to { transform: scaleX(1); } }
.sub { color: var(--ink2); margin: 0 0 40px; font-size: 20px; line-height: 1.5; max-width: 60ch; letter-spacing: -0.005em; }
h2 {
  font-family: var(--sans); font-weight: 600; font-size: 27px; letter-spacing: -0.02em; line-height: 1.2;
  margin: 56px 0 12px; padding-top: 24px; border-top: 1px solid var(--line-soft);
}
h3 { font-family: var(--sans); font-size: 16px; font-weight: 650; letter-spacing: -0.005em; margin: 24px 0 7px; }
p, li { margin: 0 0 14px; color: var(--ink2); }
ul, ol { padding-left: 22px; }
li { margin-bottom: 10px; }
li::marker { color: var(--ink3); }
strong, b { color: var(--ink); }
code { font-family: var(--mono); font-size: .9em; background: var(--raise); padding: 1px 5px; border-radius: 3px; color: var(--ink); }
video { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); background: #000; }

/* School decision page: make the pilot scope scannable before the detail. */
.page-schools main { max-width: 1080px; }
.pilot-strip {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 26px 0 30px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--receipt); overflow: hidden;
}
.pilot-strip div { padding: 18px 14px; text-align: center; border-right: 1px solid var(--line-soft); }
.pilot-strip div:last-child { border-right: 0; }
.pilot-strip b { display: block; font: 600 30px/1 var(--serif); color: var(--ink); }
.pilot-strip span { display: block; margin-top: 7px; font: 13px/1.3 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--ink3); }
.page-schools .feature-grid, .page-schools .question-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  list-style: none; padding: 0; margin: 16px 0 22px;
}
.page-schools .feature-grid li, .page-schools .question-grid li {
  margin: 0; padding: 20px 22px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--receipt);
}
.page-schools .feature-grid li:nth-child(odd):last-child,
.page-schools .question-grid li:nth-child(odd):last-child { grid-column: 1 / -1; }
.page-schools main > p:not(.sub):not(.foot),
.page-schools main > .honest { max-width: 72ch; }
@media (max-width: 680px) {
  .pilot-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pilot-strip div { border-bottom: 1px solid var(--line-soft); }
  .pilot-strip div:nth-child(2n) { border-right: 0; }
  .pilot-strip div:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .page-schools .feature-grid, .page-schools .question-grid { grid-template-columns: 1fr; }
  .page-schools .feature-grid li:nth-child(odd):last-child,
  .page-schools .question-grid li:nth-child(odd):last-child { grid-column: auto; }
}

/* ---------- buttons ---------- */
.cta, .guide-action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  padding: 0 20px; border-radius: 6px; background: var(--ink); color: var(--sheet);
  font-family: var(--sans); font-weight: 600; text-decoration: none; font-size: 15px; letter-spacing: -0.005em;
  margin: 6px 10px 10px 0; border: 1px solid var(--ink); cursor: pointer;
  transition: opacity .18s ease, background .18s ease, color .18s ease, transform .06s ease;
}
.cta:hover { opacity: .86; }
.cta:active, .guide-action:active { transform: scale(.985); }
.cta.ghost, .guide-action { background: transparent; color: var(--ink); border-color: var(--line2); }
.cta.ghost:hover, .guide-action:hover { opacity: 1; border-color: var(--ink); background: var(--receipt); }
.guide-action { min-height: 40px; padding: 0 14px; font-size: 13.5px; font-weight: 600; }
.guide-action:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.guide-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.guide-status { color: var(--ink3); font-size: 13px; min-height: 1.5em; width: 100%; }

/* ---------- receipt cards ---------- */
.honest, .copy, .kv, .parent-guide {
  background: var(--receipt); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 20px 24px; margin: 28px 0;
}
.honest { border-left: 3px solid var(--ink); }
.honest p:last-child, .copy p:last-child { margin-bottom: 0; }
.copy { border-style: dashed; font-family: var(--sans); }
.kv { padding: 4px 22px; }
.kv p { padding: 12px 0; margin: 0; border-bottom: 1px dotted var(--line2); }
.kv p:last-child { border-bottom: none; }
.kv b { display: block; color: var(--ink); font-size: 14.5px; font-family: var(--mono); font-weight: 600; letter-spacing: .01em; margin-bottom: 2px; }
.parent-guide { margin: 44px 0 0; padding: 26px 26px 22px; scroll-margin-top: 80px; }
.parent-guide h2 { margin: 0 0 6px; padding-top: 0; border-top: 0; font-size: 26px; }
.parent-guide h3 { margin: 22px 0 7px; }
.guide-kicker { font-family: var(--mono); color: var(--ink3); font-size: 13px; letter-spacing: .16em; margin: 0 0 8px; text-transform: uppercase; }
.guide-meta, .source-list, .src, .small, .alt { color: var(--ink3); font-size: 14px; }
.alt { display: block; margin-bottom: 26px; }
.alt a { color: var(--ink2); }
.parent-note { border-left: 3px solid var(--line2); margin: 12px 0 18px; padding: 2px 0 2px 15px; }

/* ---------- tables ---------- */
.prices, .cmp { width: 100%; border-collapse: collapse; margin: 16px 0 8px; font-size: 14.5px; }
.prices th, .prices td, .cmp th, .cmp td {
  text-align: left; padding: 11px 12px 11px 0; border-bottom: 1px dotted var(--line2); color: var(--ink2); vertical-align: top;
}
.prices th, .cmp th {
  font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink2);
  font-weight: 500; border-bottom: 1px solid var(--ink);
}
.prices td b, .cmp td b { color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .prices, .cmp { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prices tr, .cmp tr { min-width: 520px; }
}

/* ---------- foot ---------- */
.foot {
  margin-top: 52px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--ink3); font-family: var(--mono); font-size: 13px; letter-spacing: .04em; line-height: 2;
}
.foot a { color: var(--ink2); text-decoration: none; border-bottom: 1px solid var(--line2); }
.foot a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- motion ---------- */
.js .rv { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }
.sitebar { animation: dropIn .6s var(--ease) both; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
main { animation: sheetIn .7s var(--ease) .1s both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  .sitebar, main { animation: none; }
  h1::after { animation: none; transform: none; }
  html { scroll-behavior: auto; }
}

@media print {
  html, body { background: #fff !important; color: #000 !important; }
  .sitebar { display: none !important; }
  main { box-shadow: none; border: 0; margin: 0; max-width: none; padding: 0; animation: none; }
  main, .honest, .copy, .kv, .parent-guide { background: #fff !important; }
  .honest, .copy, .kv, .parent-guide { border-color: #000 !important; }
  h1::after { background: #000 !important; }
  main::before { display: none; }
  .js .rv { opacity: 1 !important; transform: none !important; }
  .cta, .guide-actions { display: none !important; }
  video { display: none !important; }
}

/* plain-receipt.js's own (i) buttons (the home sample card, the dashboard
   drawer): 22x22, short of the 32x32 a finger needs below 420px. It
   injects its base .prc-i rule into <head> itself, after this file on
   these two pages, so a same-specificity override here would lose --
   `body .prc-i` outranks its plain `.prc-i` regardless of that order. */
@media (max-width: 420px) {
  body .prc-i { width: 32px; height: 32px; font-size: 13px; line-height: 30px; }
}

/* The copyright line at the foot of every page: quiet, never a headline.
   --ink3 (no hyphen; --ink-3 is not defined here and its #8a8a8a fallback
   falls under the 4.5:1 floor for 12px text) is the ink of every other
   quiet caption (nav, kickers, source lists). */
.copyright { display: block; margin-top: 18px; font-size: 12px; color: var(--ink3); }
