/* ==========================================================================================
   BOLD STYLE PACKAGE r5b  --  v38-r5b build: Designer's package + Manager rulings C1 C2 E1-E4 R1 R2 R4 (see v38-r5b-change-list.md)
   primeworldofsports.org   Plain CSS, CSP-safe: no @import, no external url(), no data: URIs,
   no inline-style dependence, no scripts, no new font files (Jost 300/400/700 already ship).
   Load LAST, after styles.css / bmi.css / sleep-guide.css / nav.css / bg-*.css.
   DOM order untouched: every rule keys on existing selectors. No CSS order/grid-area reordering.
   Design only. Not medical advice. No new copy is created by this file (no content: strings).
   Rules this file obeys (Clinical bold-style rulings, Dec 1 2026):
     - a hue may NAME a thing (page/section/source); it never shows an amount, status, verdict,
       category or progress. No red/green meaning. Brand green #13fb0c is unchanged and is
       decoration only (never body text on a light surface, never a status).
     - BMI #result, #outlines, category table: plain. No fill, no color on the user's number.
     - No ring/donut/pie/gauge/dial for health numbers; no animation of bars (chart styles are
       owned by the Dashboard Designer; see spec.md section 7).
   ========================================================================================== */

:root {
  /* ---- legacy site tokens (values unchanged) ---- */
  --navy:   #253c57;
  --ink:    #18293d;
  --green:  #13fb0c;   /* brand green: UNCHANGED, decoration only */
  --yellow: #eeff42;
  --blue:   #bee1e6;
  --ice:    #d3f1f5;
  --gray:   #f2f2f2;
  --muted:  #456974;   /* never on --blue (4.28:1 fails) */
  --white:  #ffffff;

  /* ---- new bold tokens ---- */
  --bold-line:       #5c7184;  /* 1px rules for tables/panels: 5.06:1 on white, 4.26:1 on ice */
  --bold-navy-hover: #34506f;  /* hover/expanded fill on the dark header */
  --bold-focus-light:#18293d;  /* focus ring on light surfaces */
  --bold-focus-dark: #eeff42;  /* focus ring on dark surfaces (ink, navy, deep indigo) */

  /* ---- sleep identity hue (names the sleep page; never an amount or status) ---- */
  --sleep-deep:     #1b1f3b;
  --sleep-indigo:   #3f43a0;
  --sleep-lavender: #e8eaf6;
  --sleep-sec:      #4a4f66;
  --sleep-outline:  #595e78;

  /* ---- type (Jost only; weights 300/400/700 are the shipped files) ---- */
  --font: "Jost", "Futura", "Trebuchet MS", sans-serif;
  --fs-body: 1.125rem;     /* 18px */
  --lh-body: 1.5;
  --fs-small: 1rem;        /* 16px, the smallest text on the site */
  --fs-h3: 1.375rem;       /* 22px */
  --fs-h2: 1.75rem;        /* 28px phone */
  --fs-h1: 2rem;           /* 32px phone */
  --fw-body: 400;
  --fw-strong: 700;

  /* ---- spacing scale (px) ---- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* ---- band slots (a page may re-point these; sleep does below) ---- */
  --band-bg:   var(--navy);
  --band-fg:   var(--white);
  --band-rule: var(--yellow);
  --head-bg:   var(--ink);
  --head-fg:   var(--white);
}
@media (min-width: 720px) {
  :root { --fs-h2: 2.25rem; --fs-h1: 3rem; }   /* 36px / 48px */
}

/* ------------------------------------------------------------------ base */
body { color: var(--ink); font-family: var(--font); font-weight: var(--fw-body); }
main p, main li, main label, main legend { font-size: var(--fs-body); font-weight: var(--fw-body); line-height: var(--lh-body); }
a { color: var(--ink); text-underline-offset: 3px; }
main h2 { color: var(--ink); font-size: var(--fs-h2); font-weight: var(--fw-strong); line-height: 1.15; }
main h3 { color: var(--ink); font-size: var(--fs-h3); font-weight: var(--fw-strong); line-height: 1.25; }
:focus-visible { outline: 3px solid var(--bold-focus-light); outline-offset: 3px; }

/* ------------------------------------------------------------------ 1. SITE HEADER */
.site-header { background: var(--head-bg); color: var(--head-fg); border-bottom: 0; min-height: 72px; }
@media (min-width: 721px) { .site-header { border-bottom: 6px solid var(--green); } }   /* brand green rule: decoration */
.site-header .brand { color: var(--head-fg); font-size: 1.25rem; font-weight: var(--fw-strong); text-decoration-thickness: 2px; }
.site-header .menu-toggle { color: var(--head-fg); font-size: 1.125rem; font-weight: var(--fw-strong); }
.site-header .menu-toggle:hover,
.site-header .menu-toggle[aria-expanded="true"] { background: var(--bold-navy-hover); }
.site-header .menu-toggle:active { background: var(--navy); }
.site-header .menu-toggle-icon span { background: var(--head-fg); height: 3px; }
.site-header .brand:focus-visible,
.site-header .menu-toggle:focus-visible { outline: 3px solid var(--bold-focus-dark); outline-offset: 3px; }
/* the dropdown panel stays a white surface with navy/ink text (existing nav.css), so its focus ring stays dark */
.site-header .nav a:focus-visible,
.site-header .nav .menu-close:focus-visible,
.site-header .nav .nav-group-toggle:focus-visible { outline: 3px solid var(--bold-focus-light); outline-offset: 3px; }
.nav-group-title { color: var(--muted); }                       /* 5.96:1 on white */
.nav a[aria-current="page"] { border-left-color: var(--ink); background: var(--ice); }
@media (max-width: 720px) { .site-header { min-height: 56px; } .site-header .brand { font-size: 1.0625rem; } }   /* 56px = as built; keeps the first viewport short */

/* ------------------------------------------------------------------ 2. PAGE HERO BAND (tool pages)
   Full-bleed navy band made from the existing <h1> only (spread shadow, clipped so nothing scrolls sideways).
   Band rule (8px yellow) sits under the LAST band element: h1 alone, or .sg-subtitle on the sleep page. */
main > h1 {
  margin: 0 0 0;
  padding: var(--sp-5) 0;
  color: var(--band-fg); background: var(--band-bg);
  font-size: var(--fs-h1); font-weight: var(--fw-strong); line-height: 1.125; letter-spacing: -0.01em;   /* E4: whole-pixel band height so the 8px rule is 8 solid rows */
  box-shadow: 0 -100vw 0 100vw var(--band-bg), 0 8px 0 100vw var(--band-rule);   /* E4: first shadow paints upward only so the rule shows */
  clip-path: inset(0 -100vw -8px -100vw);
  position: relative;
}
main { padding-top: 0; }
main > h1 + .top-block { margin-top: var(--sp-6); }
@media (min-width: 720px) { main > h1 { padding: var(--sp-6) 0; } }

/* ------------------------------------------------------------------ 3. COMPACT "Education only. Not medical advice." BLOCK
   Static, in <main>, after the h1/band. Not sticky, not collapsed, not dismissible, no icon, body-text size (18px),
   fully visible at 390 px (bottom of block at or above ~y 650: measured in qa/geometry.txt).
   White panel, 3px ink border, 10px navy left bar: reads as a notice, not as an alert or a status. */
.top-block, .five-home-panel {
  background: var(--white);
  border: 3px solid var(--ink);
  border-left: 10px solid var(--navy);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);   /* margin-left/right untouched (home panel stays centered by five-home.css) */
  color: var(--ink);
}
.top-block .top-s1,
.five-home-panel .disclaimer {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-body);        /* body-text size, per Privacy P1 */
  font-weight: var(--fw-strong);    /* GUESS: weight 700; set to 400 if Privacy objects (size is what P1 fixes) */
  line-height: 1.4; color: var(--ink);
}
.top-block .disc-link, .five-home-panel .disc-link { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-body); }
.top-block .disc-link a, .five-home-panel .disc-link a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; min-height: 44px; display: inline-block; padding: 10px 0; }
/* S1 directly under a first result number stays PLAIN body text (no panel): see section 5 */

/* ------------------------------------------------------------------ SECTION BANDS (reusable surfaces)
   Pick by role; text colors are fixed per band (all pairs in qa/contrast-table.md). */
.notices, .gate, .limitations, .text-alt, .sg-disclaimer, .sg-meta {
  background: var(--ice); color: var(--ink);
  border-left: 8px solid var(--navy);
  padding: var(--sp-5);
}
.panel, .sg-selector {                      /* tool inputs */
  background: var(--ice); color: var(--ink);
  border: 0; border-top: 8px solid var(--navy);
  padding: var(--sp-5);
}
.support { background: var(--white); color: var(--ink); border: 3px solid var(--navy); padding: var(--sp-5); }   /* support/988 block: always visible, never grayed */
fieldset { border: 2px solid var(--bold-line); background: var(--white); padding: var(--sp-3) var(--sp-4) var(--sp-4); }
legend { color: var(--ink); font-weight: var(--fw-strong); }

/* section heading marker: navy bar, same on every page */
main h2 { padding-left: var(--sp-4); border-left: 10px solid var(--navy); margin: var(--sp-7) 0 var(--sp-4); }

/* reference/disclosure header (BMI #reference summary): navy bar, may be bold; contains only copies */
summary {
  display: list-item; list-style-position: inside; min-height: 56px; padding: var(--sp-3) var(--sp-4);   /* E2: keep the disclosure marker */
  background: var(--navy); color: var(--white); font-size: var(--fs-h3); font-weight: var(--fw-strong);
}
summary:focus-visible { outline: 3px solid var(--bold-focus-dark); outline-offset: 3px; }
.nt-details summary { color: var(--white); }   /* nutrition.css sets dark ink on the same element; navy bar needs white (7+:1) */

/* ------------------------------------------------------------------ BUTTONS AND INPUTS */
/* the site ships many 300-weight classes; Jost 300 is too thin on bands, so 400 is the floor for body copy */
main .privacy-line, main .disc-link, main .calc-disclosure, main .caption, main .sg-picker-privacy,
main .sg-notes p, main .sg-meta p, main .sg-helper, main .limitations p, main .notices p { font-weight: var(--fw-body); }
.action, .sg-toggle, .btn-navy, .calc-button {
  min-height: 52px; padding: 12px 24px; background: var(--ink); color: var(--white);
  font-size: var(--fs-body); font-weight: var(--fw-strong); border: 0; border-radius: 0;
}
.action:hover, .sg-toggle:hover, .btn-navy:hover, .calc-button:hover { background: var(--navy); border-color: var(--navy); }
.calc-button { border: 2px solid var(--ink); border-radius: 0; letter-spacing: 0; }   /* replaces the forest-green (#1A4A3C) fill: green-reading fills near a result are avoided */
.calc-button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sg-clear { border: 3px solid var(--ink); background: var(--white); color: var(--ink); font-weight: var(--fw-strong); border-radius: 0; }
input[type="text"] { border: 2px solid var(--ink); border-radius: 0; background: var(--white); color: var(--ink); min-height: 48px; font-size: var(--fs-body); }
input[type="text"]:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--ink); width: 22px; height: 22px; }
/* E1 (Privacy): heart-rate buttons sit on the navy band; give them a boundary and keep every state readable */
.calc-band .action { border: 3px solid var(--white); }
.calc-band .action:hover, .calc-band .action:focus-visible { background: var(--white); color: var(--ink); }
.calc-band .action-secondary { background: transparent; color: var(--white); }
.calc-band .top-block :focus-visible { outline-color: var(--bold-focus-light); }   /* white panel on the navy band: ink ring, not ice (1.19:1) */
.calc-band input[type="text"]:focus-visible { outline-color: var(--ice); }   /* age field on the navy band: ice ring, not ink (1.31:1) */
.btn-green { background: var(--green); color: var(--ink); }   /* existing: ink on brand green 10.42:1 */
.btn-yellow { background: var(--yellow); color: var(--ink); }

/* ------------------------------------------------------------------ 4. HOME */
/* >= 1000px the hero is a photo with a dark overlay (existing layout): brand green text is allowed there only (worst case 14.83:1).
   <= 999px the existing layout puts the h1 on a light gray band in black; this file leaves that untouched (green text on light gray would fail, 1.2:1). */
@media (min-width: 1000px) { .hero-copy h1 { color: var(--green); font-weight: var(--fw-strong); font-size: clamp(28px, 2.4vw, 40px); } }
.five-home { padding-top: var(--sp-7); }
@media (max-width: 999px) { .five-home { padding-top: var(--sp-5); padding-bottom: 0; } .five-home-panel { padding: var(--sp-3) var(--sp-4); } }   /* phone: panel bottom stays above ~y 650 */
.five-link { font-size: 1.375rem; font-weight: var(--fw-strong); }
.five-link a { color: var(--ink); text-decoration-thickness: 3px; }
.story { background: var(--yellow); }
.story-panel { background: var(--yellow); }
.story-panel p { color: var(--ink); font-weight: var(--fw-body); }
.contact-band { background: var(--navy); }
.contact-band h2 { color: var(--white); font-weight: var(--fw-strong); border: 0; padding: 0; margin: 0; }   /* size stays as built (65px desktop) */
.site-footer .info h2 { color: var(--ink); font-weight: var(--fw-strong); border: 0; padding: 0; }
.site-footer .info p, .site-footer .email-note, .site-footer p { font-weight: var(--fw-body); color: var(--ink); }
.email-us { background: var(--ink); color: var(--white); font-weight: var(--fw-strong); }
.email-us:focus-visible { outline-color: var(--bold-focus-light); }   /* E3: was brand green on ice, 1.19:1 */
.site-summary { background: var(--white); color: var(--ink); border-top: 6px solid var(--navy); }
.site-summary a { color: var(--ink); }
.legal { background: var(--green); color: var(--ink); font-weight: var(--fw-strong); }

/* ------------------------------------------------------------------ 5. BMI: RESULT AND OUTLINES STAY PLAIN
   Everything below is deliberately neutral. The user's number, the table row and the outlines get NO color, fill,
   badge, icon, gauge, bar or marker. S1 under #bmi-line is plain body text. The category table has no row colors,
   no zebra, no highlighted row; header cells only are dark (they label columns and say nothing about the reading). */
#result, #outlines, #personal, #personal-list {
  background: var(--white); color: var(--ink);
  border: 1px solid var(--bold-line); border-left: 1px solid var(--bold-line);
  box-shadow: none; padding: var(--sp-5);
}
#bmi-line { font-size: var(--fs-body); font-weight: var(--fw-body); color: var(--ink); line-height: var(--lh-body); }   /* same style as surrounding copy (P17) */
#result .disclaimer { font-size: var(--fs-body); font-weight: var(--fw-body); color: var(--ink); background: none; border: 0; padding: 0; }
#result table, .table-wrap table { border-collapse: collapse; width: 100%; background: var(--white); }
#result th, #result td, .table-wrap th, .table-wrap td { border: 1px solid var(--bold-line); padding: var(--sp-3) var(--sp-4); background: var(--white); color: var(--ink); font-weight: var(--fw-body); text-align: left; }
#result thead th, .table-wrap thead th { background: var(--ink); color: var(--white); font-weight: var(--fw-strong); }
#result tbody tr, #result tbody tr:nth-child(odd), #result tbody tr:nth-child(even) { background: var(--white); }
@media (min-width: 641px) and (max-width: 900px) { #outlines { padding: var(--sp-4); } }   /* r5c fix 1: keeps the 24px figure clearance at 641-900px */
/* r5d fix (option c): bmi.css switches the figure row to four-across at 768px, where the 24px figure clearance cannot hold with the
   bordered #outlines panel (20.1px at 768-799px with 16px padding). Keep the existing <= 767px scrolling layout (bmi.css lines 419-468)
   for the outlines panel only up to 849px; four-across starts at 850px (worst case 26.2px). Screen only: print keeps its own rules. */
@media screen and (min-width: 768px) and (max-width: 849px) {
  #outlines .timeline-hint { display: block; }
  #outlines .figures-scroller { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 8px; }
  #outline-figures .figures-panel { display: grid; grid-template-columns: repeat(4, 240px); grid-template-rows: auto auto auto; grid-auto-flow: row; width: calc(32px + 4 * 240px + 3 * 16px); min-width: calc(32px + 4 * 240px + 3 * 16px); max-width: none; gap: 0 16px; }
  #outline-figures .outline-figure { scroll-snap-align: start; min-width: 0; }
  #outline-figures .svg-host { max-width: 140px; }
  #outline-figures .stage-chevron { width: 52px; }
  #outline-figures .stage-chevron svg.arrow-lg { display: none; }
  #outline-figures .stage-chevron svg.arrow-sm { position: absolute; left: 0; top: calc(46.60926% - 22px); display: block; width: 52px; height: 44px; overflow: visible; animation: none; transition: none; }
}
#outlines svg, #outline-figures svg { background: none; }   /* approved single muted outline palette (spec 4.2) is not touched */

/* ------------------------------------------------------------------ 3. SLEEP: ONE-HUE BAND
   The hue (indigo family) names "this is the sleep guide". It is the same on every age group and every result, and it is
   never an amount or a status. No red/orange/yellow/green on the sleep page chrome: the yellow band rule is swapped for
   lavender, and the brand-green header rule is the only green (site header, unchanged; see spec.md Q3). */
.page[data-page="sleep"] { --band-bg: var(--sleep-deep); --band-rule: var(--sleep-lavender); --head-bg: var(--ink); }
/* C1 (Clinical, Manager): no green header rule and no green accent bars on the sleep page; BMI and the other pages keep the green rule */
.page[data-page="sleep"] .site-header { border-bottom-color: var(--sleep-lavender); }
.page[data-page="sleep"] .accent-bar { background: var(--sleep-indigo); }
.page[data-page="sleep"] main > h1 { box-shadow: 0 0 0 100vw var(--band-bg); clip-path: inset(0 -100vw -2px -100vw); margin-bottom: 0; padding-bottom: var(--sp-2); line-height: 1.125; }   /* R2: whole-pixel edges, no seam */
.page[data-page="sleep"] .sg-subtitle {
  margin: -1px 0 var(--sp-6); padding: 1px 0 var(--sp-5); color: var(--sleep-lavender); background: var(--band-bg);
  font-size: 1.25rem; font-weight: var(--fw-body); line-height: 1.35;
  box-shadow: 0 -100vw 0 100vw var(--band-bg), 0 8px 0 100vw var(--band-rule); clip-path: inset(0 -100vw -8px -100vw); position: relative;
}
.page[data-page="sleep"] main > h2, .page[data-page="sleep"] main section > h2 { border-left-color: var(--sleep-indigo); }
.sg-selector { border-top-color: var(--sleep-indigo); background: var(--sleep-lavender); }
.sg-selector legend { color: var(--sleep-deep); font-weight: var(--fw-strong); }
.sg-chip { border: 2px solid var(--sleep-outline); border-radius: 0; background: var(--white); color: var(--sleep-deep); font-weight: var(--fw-body); }
.sg-chip:has(input:checked) { background: var(--sleep-lavender); border: 4px solid var(--sleep-deep); box-shadow: none; font-weight: var(--fw-strong); }   /* selected = thick border + bold + existing mark; not hue alone */
.sg-chip input:checked { background: var(--sleep-deep); border-color: var(--sleep-deep); }
.sg-chip:has(input:focus-visible) { outline: 3px solid var(--sleep-deep); outline-offset: 3px; }
.sg-card-head { background: var(--sleep-deep); }
.sg-card-head h2 { color: var(--white); font-weight: var(--fw-strong); border: 0; padding: 0; margin: 0; }
.sg-edu { font-size: var(--fs-body); font-weight: var(--fw-body); }   /* r5c fix 2: S1 under the sleep status is plain 18px/400 (sleep-guide.css .sg-edu is 700) */
.sg-status { background: var(--sleep-lavender); border-left: 6px solid var(--sleep-indigo); color: var(--sleep-deep); }   /* never colored by agree/differ */
.sg-sub, .sg-nsf, .sg-axis-cap, .sg-tick { color: var(--sleep-sec); }
.table-wrap thead th { background: var(--sleep-deep); }
/* Chart shapes/hatch/markers: owned by the Dashboard Designer; approved spec 5.5-5.7 stays (one indigo, shapes + text carry identity). */

/* Reflow safety (r5b, not in the Designer file): at 200% zoom on a phone (<= 320 CSS px) the bold padding and bars must not widen the page beyond r5 */
@media (max-width: 320px) {
  .top-block, .five-home-panel { padding: var(--sp-3); border-left-width: 6px; }
  .notices, .gate, .limitations, .text-alt, .sg-disclaimer, .sg-meta, .panel, .sg-selector, .support, #result, #outlines, #personal, #personal-list { padding: var(--sp-3); }
  fieldset { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
  main h2 { padding-left: var(--sp-2); border-left-width: 6px; }
  main li, main p, main h2, main h3, .support a, .story-panel p { overflow-wrap: anywhere; }
}

/* C2 (Clinical): the sleep bars must not grow/sweep. Source animation removed from sleep-guide.css; this is the fallback. */
.sg-band { animation: none; }

/* R1 (Privacy): required lines at or below weight 300 or under 16px come up to 16px/400 (chart text .sg-nsf/.sg-axis-cap stays with the chart owner) */
main caption, main figcaption, main .shading-note, main .bmi-limit-note, main .hint, main #outline-figures .caption, main .timeline-hint,
.required-note, .zone-talk, .zone-scale, .bracket-note, .hint, .privacy-line { font-weight: var(--fw-body); }   /* heart-rate zone panels and hero sit outside <main>, so those selectors carry no "main" */
.privacy-line, .sg-sub, .bracket-note { font-size: var(--fs-small); }
/* Clinical r5d R1 leftovers (design judgment, non-blocking): sentences and table figures come up to 16px/400; chart tick and axis labels stay 14px */
@media (max-width: 999px) { .table-wrap table, .week .table-wrap th[scope="row"], .week .table-wrap thead td:first-child { font-size: var(--fs-small); } }
.glance li, .text-alt td { font-weight: var(--fw-body); }
.nt-small, .sg-nsf { font-size: var(--fs-small); }

/* ------------------------------------------------------------------ reduced motion, forced colors, print */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (forced-colors: active) {
  main > h1, .page[data-page="sleep"] .sg-subtitle { box-shadow: none; clip-path: none; border-bottom: 4px solid CanvasText; }
  .top-block, .five-home-panel, .support, fieldset, #result, #outlines { border: 2px solid CanvasText; }
  .site-header { border-bottom: 4px solid CanvasText; }
  summary { border: 2px solid CanvasText; }
}
@media print {
  .site-header, .nav, main > h1, .page[data-page="sleep"] .sg-subtitle, .contact-band, summary, .legal, .story, .story-panel,
  .top-block, .five-home-panel, .notices, .panel, .support, .gate, .limitations, .sg-disclaimer, .sg-meta, .sg-selector,
  #result thead th, .table-wrap thead th, .sg-card-head {
    background: #fff !important; color: #000 !important; box-shadow: none !important; clip-path: none !important;
  }
  main > h1, .top-block, .five-home-panel, summary { border: 2px solid #000 !important; }
  #result th, #result td, .table-wrap th, .table-wrap td { padding: 6px; }   /* r5 five-steps print padding; keeps the print tables fitting */
  .top-block, .five-home-panel { border-left-width: 10px !important; }
  .top-block, .top-block *, .five-home-panel, .five-home-panel * { visibility: visible !important; }   /* S1 + link must print exactly once, with address (nav.css) */
  .hero h1, .contact-band h2, .sg-card-head h2, .site-header .brand { color: #000 !important; }
}
