/* GEJFA Rules — art direction per DESIGN.md (project root): collegiate athletic apparel.
   Forest green garment base, opaque-white "plastisol ink" graphics, light-grey secondary print,
   collegiate block serif (Graduate) display, athletic sans (Barlow) body, banner/stripe motifs.
   Two-color by design — hierarchy comes from type and the stripe, not extra hues. */

@font-face {
  font-family: "Graduate";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/graduate-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/barlow-700.woff2") format("woff2");
}

:root {
  --ink: #050705;            /* chrome black — header/search bar */
  --field: #16281c;          /* dark forest green — sweatshirt base */
  --field-deep: #101f15;     /* shadowed seam */
  --field-raised: #1f3627;   /* tee green — card surface */
  --field-press: #28442f;    /* pressed/active surface */
  --chalk: #f5f3ec;          /* opaque white plastisol ink */
  --chalk-dim: #b7c2b6;      /* light grey print */
  --chalk-faint: #7e8f80;    /* worn print — meta text */
  --display: "Graduate", "Arial Black", sans-serif;
  --body: "Barlow", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  color: var(--chalk);
  padding-bottom: env(safe-area-inset-bottom);
  /* Non-solid background per DESIGN.md "Palette" — a top-down gridiron:
     full-width horizontal yard lines every 384px, plus two dashed vertical
     HASH-MARK LANES running the length of the page at 30% / 70% (like a real
     field's inbounds hash columns between the sidelines). Pure CSS gradients:
     each layer is a self-repeating gradient in a no-repeat box, so there's no
     viewport anchoring, no position:fixed (which conflicts with
     position:sticky in Safari — see DESIGN.md), and it stays correct on long
     scrollable pages. Visible below the search bar, where the black header
     chrome doesn't paint over it. */
  background-color: var(--field);
  background-image:
    repeating-linear-gradient(to bottom, rgba(40, 68, 47, .45) 0 4px, transparent 4px 384px), /* yard lines */
    repeating-linear-gradient(to bottom, rgba(40, 68, 47, .45) 0 16px, transparent 16px 48px), /* left hash lane */
    repeating-linear-gradient(to bottom, rgba(40, 68, 47, .45) 0 16px, transparent 16px 48px); /* right hash lane */
  background-size: 100% 100%, 4px 100%, 4px 100%;
  background-position: 0 0, 30% 0, 70% 0;
  background-repeat: no-repeat;
}
@media (prefers-reduced-transparency: reduce) {
  body { background-image: none; } /* flat field color is the safe fallback */
}

/* ---- Hero: the Collegiate Arc chest print (scrolls away) ---- */
.hero {
  position: relative;
  /* Real bottom padding (not reliance on a child's trailing margin) both
     gives the header room to breathe and prevents margin collapse from
     leaking the body's green grid through the black chrome as a stray line. */
  padding: calc(22px + env(safe-area-inset-top)) 16px 26px;
  text-align: center;
  background: var(--ink);
}
.pdf-link {
  position: absolute; top: calc(10px + env(safe-area-inset-top));
  right: max(12px, calc((100% - 696px) / 2)); /* aligns to .results' true inner edge (720 box - its own 12px padding) */
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 12px;
  font-family: var(--display); font-size: .66rem; letter-spacing: .12em;
  text-transform: uppercase; text-decoration: none;
  color: var(--chalk-dim); background: var(--field-raised);
  border: 2px solid var(--field-press); border-radius: 10px;
}
.pdf-link:active { color: var(--field); background: var(--chalk); }
.hero .logo { display: block; height: 64px; width: auto; margin: 0 auto 2px; }
.hero .arc { display: block; width: min(300px, 78vw); margin: 0 auto -6px; overflow: visible; }
.hero .arc text {
  font-family: var(--display);
  font-size: 42px;
  fill: var(--chalk);
  letter-spacing: 5px;
}
.banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--body); font-weight: 600; font-size: .72rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--chalk-dim);
  max-width: 340px; margin: 10px auto 0;
}
.banner .year {
  font-family: var(--display); font-size: .82rem; letter-spacing: .12em;
  color: var(--field); background: var(--chalk);
  padding: 3px 12px; line-height: 1.3;
}
.stripe {
  height: 4px; background: var(--chalk); border: none;
  max-width: 340px; margin: 16px auto 0; opacity: .92;
}
/* Bold mark on the left, caption on the right, as two columns in one row —
   sized to fit together on a phone-width screen without wrapping. */
.hero-title-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; max-width: 340px; margin: 16px auto 0;
}
.hero .sub {
  flex: 0 0 auto;
  font-family: var(--display); font-size: .95rem; letter-spacing: .14em;
  color: var(--chalk); margin: 0; text-transform: uppercase; white-space: nowrap;
}
.hero .tagline {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--body); font-weight: 600; font-size: .56rem;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--chalk-faint); margin: 0; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Sticky search row ----
   Mobile (default): the search field gets its own full-width row so it's
   as large a tap/type target as possible; level + browse controls wrap to
   a second row beneath it. Desktop (≥640px): everything sits inline, since
   there's room and stacking would waste vertical space. */
.searchwrap {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px;
  /* full-width sticky background, but contents align to the 720px content column */
  padding: 10px max(12px, calc((100% - 696px) / 2)) 16px;
  background: var(--ink);
  box-shadow: 0 8px 16px -10px transparent;
  transition: box-shadow .15s ease;
}
/* Only cast a shadow once the bar actually has content scrolled beneath it —
   shown unconditionally it reads as a hard, out-of-place line across the
   Game Time grid on an unscrolled page. */
body.scrolled .searchwrap { box-shadow: 0 8px 16px -10px var(--field-deep); }
.search-field { position: relative; flex: 1 1 100%; min-width: 0; }
.search-controls { flex: 1 1 100%; display: flex; gap: 8px; }
@media (min-width: 640px) {
  .search-field { flex: 1 1 auto; }
  .search-controls { flex: 0 0 auto; }
}
.search {
  display: block; width: 100%; box-sizing: border-box;
  font-family: var(--body); font-size: 1.1rem; font-weight: 400;
  color: var(--chalk); background: var(--field-raised);
  border: 2px solid var(--field-press); border-radius: 10px;
  padding: 13px 40px 13px 14px; min-height: 54px;
  outline: none; -webkit-appearance: none; appearance: none;
}
.search::placeholder { color: var(--chalk-faint); }
.search:focus { border-color: var(--chalk-dim); }
.search::-webkit-search-cancel-button { display: none; }
.clear-btn {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 36px; height: 36px;
  border: none; border-radius: 8px;
  background: var(--field-press); color: var(--chalk-dim);
  font-size: 1.25rem; line-height: 1; cursor: pointer; z-index: 1;
}
.level-btn {
  flex: 1 1 auto; min-height: 54px; padding: 0 14px;
  font-family: var(--display); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--chalk); background: var(--field-raised);
  border: 2px solid var(--field-press); border-radius: 10px; cursor: pointer;
}
.level-btn.active { background: var(--chalk); border-color: var(--chalk); color: var(--field); }
@media (min-width: 640px) { .level-btn { flex: 0 0 auto; } }

/* ---- Category filter: the only filter now (a level filter was removed —
   it only meaningfully narrowed results for one category out of twelve,
   see SPEC.md). #browseBtn and the option buttons below keep the
   ".level-btn"/".level-sheet"/".level-option" class names for historical
   reasons; nothing about them is level-specific anymore. ---- */

/* category sheet: 13 options need to scroll on short screens */
.cat-sheet .level-sheet-inner { max-height: min(80vh, 640px); overflow-y: auto; }
.cat-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-option-all { grid-column: 1 / -1; }

/* ---- Bottom-sheet shell (used by the category filter) ---- */
.level-sheet { position: fixed; inset: 0; background: rgba(8, 14, 10, .72); z-index: 50; }
.level-sheet-inner {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--field-raised);
  border-top: 4px solid var(--chalk);
  border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
}
.level-sheet-inner h2 {
  margin: 0 0 14px; font-family: var(--display); font-size: .85rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--chalk-dim);
  text-align: center;
}
.level-option {
  padding: 14px; min-height: 52px;
  font-family: var(--body); font-weight: 700; font-size: .95rem;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--chalk); background: var(--field-press);
  border: none; border-radius: 8px; cursor: pointer;
}
.level-option.active { background: var(--chalk); color: var(--field); }

/* ---- Results ---- */
.results { padding: 18px 12px 24px; max-width: 720px; margin: 0 auto; }

/* banner-bar divider, echoing the year banner on the sweatshirt */
.result-count {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 2px 12px;
  font-family: var(--display); font-size: .68rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--chalk-dim);
}
.result-count::before, .result-count::after {
  content: ""; flex: 1; height: 2px; background: var(--field-press);
}
.reset-chip {
  flex: 0 0 auto; min-height: 34px; padding: 6px 12px;
  font-family: var(--body); font-weight: 700; font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--chalk-faint); background: none;
  border: 1.5px solid var(--field-press); border-radius: 999px; cursor: pointer;
}
.reset-chip:active { color: var(--field); background: var(--chalk); border-color: var(--chalk); }
.hero { cursor: pointer; }

.card {
  background: var(--field-raised);
  border: none; border-radius: 10px;
  padding: 14px 16px 6px; margin-bottom: 10px;
  cursor: pointer;
  scroll-margin-top: calc(78px + env(safe-area-inset-top)); /* clears sticky search */
  transition: background .2s ease;
}
.card.situation { box-shadow: inset 4px 0 0 var(--chalk); }
.card.open { background: var(--field-press); }
.card .q {
  font-family: var(--body); font-weight: 700; font-size: 1.04rem;
  line-height: 1.3; margin: 0 0 6px; color: var(--chalk);
}
/* at a glance: clamp the answer to two lines until opened */
.card .a {
  margin: 0; line-height: 1.5; color: var(--chalk-dim); font-size: .95rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card.open .a { display: block; -webkit-line-clamp: none; overflow: visible; }
.card .peek {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0 6px; min-height: 34px;
}
.cite-mini {
  font-family: var(--display); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--chalk-faint);
}
.peek-actions { display: flex; align-items: center; gap: 12px; }
.share-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  color: var(--chalk-faint); background: none; border: none; border-radius: 6px;
  cursor: pointer;
}
.share-btn:active { color: var(--chalk); background: var(--field-press); }
.card .chev { color: var(--chalk-faint); font-size: .9rem; transition: transform .2s ease; }
.card.open .chev { transform: rotate(180deg); }
.card .detail { padding-top: 10px; }
.card .meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 2px; }
.cite {
  font-family: var(--display); font-size: .66rem; letter-spacing: .1em;
  color: var(--field); background: var(--chalk);
  padding: 4px 9px 3px; border-radius: 3px; text-transform: uppercase;
}
.levels-tag {
  font-family: var(--body); font-weight: 600; font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--chalk-faint);
}
/* Advanced disclosure: official rule text stays hidden until asked for */
.adv { margin: 10px -4px 4px; }
.adv summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 14px;
  font-family: var(--body); font-weight: 700; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--chalk-faint); background: var(--field-deep); border-radius: 8px;
}
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: "▸"; font-size: .8rem; }
.adv[open] summary { border-radius: 8px 8px 0 0; color: var(--chalk-dim); }
.adv[open] summary::before { content: "▾"; }
.adv .fulltext { margin: 0; border-radius: 0 0 8px 8px; }
.fulltext {
  background: var(--field-deep); border-radius: 8px;
  margin: 10px -4px 4px; padding: 12px 14px;
  font-size: .9rem; line-height: 1.55; color: var(--chalk-dim); white-space: pre-line;
}
.fulltext .ft-title {
  font-family: var(--display); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--chalk); margin-bottom: 6px;
}

/* ---- Chalk diagrams ---- */
.dgm-wrap {
  background: var(--field-deep); border-radius: 8px;
  margin: 2px -4px 0; padding: 12px 8px 8px;
}
.dgm { display: block; width: 100%; height: auto; }
.dgm text { font-family: var(--body); }
.dgm-turf { fill: none; stroke: var(--chalk-dim); stroke-width: 1.5; }
.dgm-ez { fill: var(--field-press); stroke: var(--chalk-dim); stroke-width: 1.5; }
.dgm-band { fill: var(--field-press); }
.dgm-line { stroke: var(--chalk-faint); stroke-width: 1; }
.dgm-line-mid { stroke: var(--chalk); stroke-width: 2; }
.dgm-dash { stroke: var(--chalk-faint); stroke-width: 1.5; stroke-dasharray: 5 5; }
.dgm-yardnum { fill: var(--chalk-faint); font-size: 9px; font-weight: 600; }
.dgm-ezlabel { fill: var(--chalk-faint); font-size: 8px; font-weight: 700; letter-spacing: .15em; }
.dgm-ball { fill: var(--chalk); }
.dgm-label { fill: var(--chalk); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.dgm-small { fill: var(--chalk-dim); font-size: 9.5px; font-weight: 600; }
.dgm-note { fill: var(--chalk-faint); font-size: 9.5px; font-weight: 600; }
.dgm-big { fill: var(--chalk); font-size: 30px; font-weight: 700; font-family: var(--display); }
.dgm-arrow { stroke: var(--chalk); stroke-width: 2; fill: none; }
.dgm-arrowhead { fill: var(--chalk); }
.dgm-flowarrow { stroke: var(--chalk-dim); stroke-width: 1.5; fill: none; }
.dgm-box { fill: var(--field-press); stroke: var(--chalk-dim); stroke-width: 1; }
.dgm-boxtext { fill: var(--chalk); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; }
.dgm-boxsub { fill: var(--chalk-dim); font-size: 9px; font-weight: 600; }
.dgm-bar { fill: var(--chalk-dim); }
.dgm-barnum { fill: var(--field); font-size: 9.5px; font-weight: 700; }
.dgm-post { stroke: var(--chalk); stroke-width: 2.5; fill: none; }
.dgm-x { fill: var(--chalk-dim); }
.dgm-o { fill: none; stroke: var(--chalk); stroke-width: 2; }

.empty { text-align: center; color: var(--chalk-dim); padding: 40px 20px; line-height: 1.55; }
.empty strong { color: var(--chalk); }

.foot { padding: 8px 12px calc(20px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.foot p { color: var(--chalk-faint); font-size: .75rem; line-height: 1.45; }

/* Slim, unobtrusive credit line under the footer — half-opaque, tiny type */
.credit {
  margin: 0; padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  max-width: 720px; margin-inline: auto;
  font-family: var(--body); font-size: 10px; letter-spacing: .04em;
  color: var(--chalk); opacity: .5; text-align: center;
}

/* ---- Real-time answer aids ---- */
mark { background: var(--chalk); color: var(--field); padding: 0 2px; border-radius: 2px; }
.card.spotlight { box-shadow: 0 0 0 2px var(--chalk); }
.best {
  font-family: var(--display); font-size: .62rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--field);
  background: var(--chalk); display: inline-block;
  padding: 3px 10px 2px; border-radius: 3px; margin: 0 0 8px;
}
.quick-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.quick {
  min-height: 56px; padding: 10px;
  font-family: var(--body); font-weight: 700; font-size: .92rem;
  letter-spacing: .03em; text-transform: uppercase;
  color: var(--chalk); background: var(--field-raised);
  border: none; border-radius: 10px; cursor: pointer;
  box-shadow: inset 0 -3px 0 var(--field-press);
}
.quick:active { background: var(--field-press); }
.recent-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.recent {
  text-align: left; padding: 11px 14px; min-height: 44px;
  font-family: var(--body); font-weight: 600; font-size: .88rem;
  color: var(--chalk-dim); background: none;
  border: none; border-radius: 8px; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--field-press);
}
.back-home {
  display: block; width: 100%; margin: 4px 0 20px; padding: 14px; min-height: 52px;
  font-family: var(--body); font-weight: 700; font-size: .9rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--chalk); background: var(--field-raised);
  border: none; border-radius: 10px; cursor: pointer;
}
.mic-btn {
  flex: 0 0 auto; width: 54px; min-height: 54px;
  display: flex; align-items: center; justify-content: center;
  color: var(--chalk-dim); background: var(--field-raised);
  border: 2px solid var(--field-press); border-radius: 10px; cursor: pointer;
}
.mic-btn.listening { color: var(--field); background: var(--chalk); border-color: var(--chalk); }
.reset-home {
  flex: 0 0 auto; width: 54px; min-height: 54px;
  display: flex; align-items: center; justify-content: center;
  color: var(--chalk-dim); background: var(--field-raised);
  border: 2px solid var(--field-press); border-radius: 10px; cursor: pointer;
}
.reset-home:active { color: var(--chalk); background: var(--field-press); }
/* Non-interactive status message (offline-saved confirmation, downloading
   indicator) — sits below the sticky search bar so it never collides with
   the install banner or the What's New sheet, both anchored to the bottom. */
.toast-info {
  position: fixed; left: 12px; right: 12px;
  top: calc(70px + env(safe-area-inset-top)); z-index: 45;
  padding: 12px 16px; text-align: center;
  font-family: var(--body); font-weight: 600; font-size: .82rem;
  color: var(--field); background: var(--chalk);
  border-radius: 10px; cursor: default;
  box-shadow: 0 8px 20px rgba(8, 14, 10, .5);
}
/* Actionable status message (currently: "Rulebook updated — tap to reload") —
   stays until tapped, unlike .toast-info which auto-dismisses. Bottom-
   positioned; safe from colliding with .toast-info (top) or the install
   banner (bottom, but only ever shown to a first-time visitor, who by
   definition has no prior version to update from). */
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 60; padding: 15px; min-height: 52px;
  font-family: var(--body); font-weight: 700; font-size: .92rem;
  color: var(--field); background: var(--chalk);
  border: none; border-radius: 10px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(8, 14, 10, .6);
}

/* ---- one-time install prompt ---- */
.install-banner {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 55;
  background: var(--field-raised); border-radius: 12px;
  border-top: 4px solid var(--chalk);
  padding: 14px 16px;
  box-shadow: 0 12px 34px rgba(8, 14, 10, .65);
}
.install-msg { margin: 0 0 12px; font-size: .92rem; line-height: 1.45; color: var(--chalk-dim); }
.install-msg strong { color: var(--chalk); }
.install-actions { display: flex; gap: 10px; }
.install-yes {
  flex: 1; min-height: 50px; padding: 12px;
  font-family: var(--body); font-weight: 700; font-size: .9rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--field); background: var(--chalk);
  border: none; border-radius: 10px; cursor: pointer;
}
.install-later {
  flex: 0 0 auto; min-height: 50px; padding: 12px 18px;
  font-family: var(--body); font-weight: 700; font-size: .9rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--chalk-dim); background: var(--field-press);
  border: none; border-radius: 10px; cursor: pointer;
}
.install-steps {
  margin: 0 0 12px; padding-left: 22px;
  color: var(--chalk-dim); font-size: .95rem; line-height: 1.7;
}
.install-steps strong { color: var(--chalk); }
.ios-share {
  display: inline-block; transform: rotate(90deg);
  color: var(--chalk); font-weight: 700;
}
.install-note { color: var(--chalk-faint); font-size: .82rem; margin: 0 0 14px; }
.install-foot {
  display: block; width: 100%; margin: 0 0 12px; padding: 13px; min-height: 48px;
  font-family: var(--body); font-weight: 700; font-size: .85rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--chalk); background: var(--field-raised);
  border: none; border-radius: 10px; cursor: pointer;
}

/* ---- Guided flow: Score check ----
   Same chalk-on-green language as the cards. Values are printed as spec-sheet
   stat rows (label ···· value), never as filled bars. The only chalk fills are
   small badge labels (STOP eyebrow, OVER 32 tag), like the .best / .cite badges. */
.flow { margin-bottom: 8px; }
.flow-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.flow-edit {
  min-height: 40px; padding: 8px 12px;
  font-family: var(--body); font-weight: 700; font-size: .85rem;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--chalk); background: var(--field-raised);
  border: 1.5px solid var(--field-press); border-radius: 999px; cursor: pointer;
}
.flow-edit-x { color: var(--chalk-faint); margin-left: 4px; }
.flow-prompt {
  margin: 4px 2px 10px; font-family: var(--display); font-size: 1.05rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--chalk);
}
.flow-score { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.flow-num {
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--display); font-size: .66rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--chalk-dim);
}
.flow-num input {
  width: 100%; min-height: 76px; padding: 0 8px;
  font-family: var(--display); font-size: 2.2rem; text-align: center;
  color: var(--chalk); background: var(--field-raised);
  border: 2px solid var(--field-press); border-radius: 10px; outline: none;
  -moz-appearance: textfield; appearance: textfield;
}
.flow-num input::-webkit-outer-spin-button,
.flow-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.flow-num input:focus { border-color: var(--chalk-dim); }
.flow-go {
  grid-column: 1 / -1; min-height: 56px; padding: 12px;
  font-family: var(--body); font-weight: 700; font-size: .95rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--field); background: var(--chalk);
  border: none; border-radius: 10px; cursor: pointer;
}
.flow-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flow-opt { text-transform: none; font-size: .98rem; }
.flow-launch {
  display: block; width: 100%; text-align: left; margin: 0 0 12px; padding: 14px 16px;
  font-family: var(--body); font-weight: 700; font-size: 1rem; line-height: 1.3;
  color: var(--chalk); background: var(--field-raised);
  border: none; border-radius: 10px; box-shadow: inset 4px 0 0 var(--chalk); cursor: pointer;
}
.flow-launch-eyebrow {
  display: block; margin-bottom: 4px;
  font-family: var(--display); font-size: .62rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--chalk-dim);
}
.flow-status {
  background: var(--field-raised); border-top: 4px solid var(--chalk);
  border-radius: 10px; padding: 14px 16px; margin: 0 0 10px;
}
.flow-score-line {
  margin: 0; font-family: var(--display); font-size: 1.9rem; line-height: 1.1;
  letter-spacing: .06em; text-transform: uppercase; color: var(--chalk);
}
.flow-regime {
  margin: 4px 0 0; font-family: var(--body); font-weight: 700; font-size: .95rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--chalk);
}
.flow-detail { margin: 6px 0 0; color: var(--chalk-dim); font-size: .92rem; line-height: 1.45; }
.flow-table { background: var(--field-raised); border-radius: 10px; padding: 12px 16px 8px; margin: 0 0 10px; }
.flow-table-title {
  margin: 0 0 6px; font-family: var(--display); font-size: .66rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--chalk-dim);
}
.flow-stat { display: flex; align-items: baseline; gap: 8px; min-height: 36px; }
.flow-stat-label {
  font-family: var(--body); font-weight: 600; font-size: .85rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--chalk-dim); white-space: nowrap;
}
.flow-pts { color: var(--chalk-faint); }
.flow-leader { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--chalk-faint); transform: translateY(-4px); }
.flow-stat-val { font-family: var(--body); font-weight: 700; font-size: 1rem; color: var(--chalk); white-space: nowrap; }
.flow-ok, .flow-over {
  display: inline-block; margin-left: 8px; padding: 2px 8px 1px; border-radius: 3px;
  font-family: var(--display); font-weight: 400; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
}
.flow-ok { color: var(--chalk); border: 1.5px solid var(--chalk-dim); }
.flow-over { color: var(--field); background: var(--chalk); }
.flow-call {
  background: var(--field-raised); border-radius: 10px; padding: 12px 16px; margin: 0 0 10px;
  box-shadow: inset 4px 0 0 var(--field-press);
}
.flow-call.tone-stop { box-shadow: inset 4px 0 0 var(--chalk); }
.flow-call.tone-go { box-shadow: inset 4px 0 0 var(--chalk-dim); }
.flow-eyebrow {
  margin: 0 0 6px; font-family: var(--display); font-size: .6rem;
  letter-spacing: .24em; text-transform: uppercase; color: var(--chalk-faint);
}
.tone-stop .flow-eyebrow {
  display: inline-block; padding: 3px 10px 2px; border-radius: 3px;
  color: var(--field); background: var(--chalk);
}
.tone-go .flow-eyebrow { color: var(--chalk-dim); }
.flow-call-head { margin: 0 0 4px; font-family: var(--body); font-weight: 700; font-size: 1.02rem; line-height: 1.3; color: var(--chalk); }
.flow-call-text { margin: 0; color: var(--chalk-dim); font-size: .93rem; line-height: 1.5; }
.flow-rule {
  margin: 8px 0 0; min-height: 36px; padding: 6px 10px;
  font-family: var(--display); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--chalk-faint); background: none;
  border: 1.5px solid var(--field-press); border-radius: 999px; cursor: pointer;
}
.flow-rule[aria-expanded="true"] { color: var(--chalk); border-color: var(--chalk-dim); }
.flow-rule-card .fulltext { margin: 10px 0 0; }
.flow-open-rule {
  display: block; margin: 6px 0 2px; min-height: 40px; padding: 8px 0;
  font-family: var(--body); font-weight: 700; font-size: .8rem;
  letter-spacing: .08em; text-transform: uppercase; text-decoration: underline;
  color: var(--chalk-dim); background: none; border: none; cursor: pointer;
}
.flow-share {
  display: block; width: 100%; margin: 4px 0 10px; padding: 14px; min-height: 52px;
  font-family: var(--body); font-weight: 700; font-size: .9rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--chalk-dim); background: var(--field-raised);
  border: 1.5px solid var(--field-press); border-radius: 10px; cursor: pointer;
}
.flow-share:active, .flow-edit:active, .flow-launch:active, .flow-rule:active { background: var(--field-press); color: var(--chalk); }
.flow-go:active { background: var(--chalk-dim); }

/* ---- Rollover (hover) states for every button/interactive item ----
   Scoped to real pointer devices only (mouse/trackpad) so touchscreens never
   get a "stuck" hover look after a tap — touch already has its own :active
   feedback throughout, defined alongside each element above. */
@media (hover: hover) and (pointer: fine) {
  .pdf-link:hover { color: var(--field); background: var(--chalk); }
  .level-btn:hover:not(.active) { background: var(--field-press); border-color: var(--chalk-dim); }
  .clear-btn:hover { background: var(--field-raised); color: var(--chalk); }
  .level-option:hover:not(.active) { background: var(--field-press); }
  .reset-chip:hover { color: var(--field); background: var(--chalk); border-color: var(--chalk); }
  .card:hover { background: var(--field-press); }
  .share-btn:hover { color: var(--chalk); background: var(--field-press); }
  .quick:hover { background: var(--field-press); }
  .recent:hover { color: var(--chalk); background: var(--field-press); }
  .back-home:hover { background: var(--field-press); }
  .mic-btn:hover { background: var(--field-press); color: var(--chalk); }
  .adv summary:hover { color: var(--chalk); background: var(--field-press); }
  .install-yes:hover { background: var(--chalk-dim); }
  .install-later:hover { background: var(--field-raised); }
  .install-foot:hover { background: var(--field-press); }
  .toast:hover { background: var(--chalk-dim); }
  .reset-home:hover { background: var(--field-press); }
  .flow-edit:hover, .flow-launch:hover, .flow-share:hover, .flow-rule:hover { background: var(--field-press); color: var(--chalk); }
  .flow-go:hover { background: var(--chalk-dim); }
  .flow-open-rule:hover { color: var(--chalk); }
}

/* ---- quality floor ---- */
:focus-visible { outline: 3px solid var(--chalk); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
