/* PORTED, do not edit. Source of record: ops/galadriel/component-library-v1.1g/lib.css
   sha256 bb73b91dc02c81644cb8e0bb266e6dd5608a5e5f6f682bd76824169b5aee41e8; index.html ff41f650c9265f105aea1c1e4bcf847637202bacf01fb41f621d147d10314dfb; implementation GATE-20261014-333.
   Regenerate with: python -I ops/legolas/port-library-v1.1g-2026-10-14.py */
/* =====================================================================
   HDI app component library v1.1g: "bright side" (Galadriel, 2026-10-07; v1.1g 2026-10-14, PROPOSED)
   Source of truth for the paid app shell. Primitives are copied from the live
   public site tokens (site-build-2026-09-24/css/tokens.css, identical to
   hdi.vision/css/tokens.css by sha256 on 2026-10-07). App additions are marked APP.
   Every class is prefixed hd- so it cannot collide with the old dark shell.
   Light is the default. Dark is a later, opt-in variant (see NOTES.md).
   ===================================================================== */
@import url("/fonts/hdi-bright/fonts.css");
:root{
  color-scheme: light;

  /* --- primitives (site) ---------------------------------------------- */
  --ink:#002231; --ink-2:#2C4653; --ink-3:#526772;
  --paper:#FAF7F0; --paper-2:#F2ECE0; --paper-3:#FFFDF8;
  --harbour:#0B6A7E; --harbour-dk:#084F5E; --harbour-lt:#D7ECEF;
  --ochre:#8A5300; --rule:#D9D1C1; --rule-ui:#7E7565;
  --cyan-heritage:#06B6D4;             /* graphics only, never text */
  --firefly-lamp:#FCD34D; --firefly-glow:#F59E0B;  /* the bright-side light: decoration only */

  /* --- surfaces and roles (site semantics) ------------------------------ */
  --surface-base:var(--paper); --surface-card:var(--paper-2); --surface-elevated:var(--paper-3);
  --text-primary:var(--ink); --text-secondary:var(--ink-2); --text-muted:var(--ink-3); --text-inverse:var(--paper-3);
  --border-default:var(--rule-ui); --border-subtle:var(--rule);
  --brand-accent:var(--harbour); --brand-accent-hover:var(--harbour-dk); --brand-on-accent:var(--paper-3);

  /* --- APP: status ------------------------------------------------------ */
  --status-info:var(--harbour); --status-success:#2E6B3F; --status-warning:#8A5300; --status-error:#A2322A;
  --status-info-wash:#E3F0F2; --status-success-wash:#E6F0E6; --status-warning-wash:#F6EBD6; --status-error-wash:#F7E3E0;

  /* --- APP: bands (ReportDisplayLaw semantics and labels; bright-side colours) */
  --band-good:#2E6B3F;   /* In good shape  (>= 80) */
  --band-steady:#4F6A12; /* Steady         (>= 60) */
  --band-watch:#8A5300;  /* Worth watching (>= 40) */
  --band-strain:#A3461A; /* Under strain   (>= 20) */
  --band-care:#A2322A;   /* Needs your care (< 20) */
  /* group sides (Bombadil A3): fine = good+steady, watch, strain = strain+care */
  --side-fine:var(--band-good); --side-watch:var(--band-watch); --side-strain:var(--band-strain);
  --masked:#6E6658;      /* "not shown" cells: hatched, never a number */

  /* --- APP: constructs (not semantic: never read as good/bad) ------------ */
  --c-3M:#0B6A7E; --c-3E:#7A3E9D;
  --c-3O:#9D3A76; --c-3A:#806200; --c-3B:#3B7458; --c-3S:#4B4FA6; --c-3F:#24609B;

  /* --- APP: data-viz neutrals ------------------------------------------- */
  --track:#E4DCCB;       /* unfilled part of a bar or ring */
  --skeleton:#E9E2D4;

  /* --- focus / touch (site) --------------------------------------------- */
  --focus-ring-color:var(--harbour); --focus-ring-width:3px; --focus-ring-offset:2px; --touch-min:44px;

  /* --- type (site families; APP scale for dense screens) ----------------- */
  --font-display:"Newsreader","Iowan Old Style","Palatino Linotype",Georgia,serif;
  --font-body:"Atkinson Hyperlegible Next","Segoe UI","Helvetica Neue",sans-serif;
  --font-mono:ui-monospace,"Cascadia Mono",Consolas,monospace;
  --fs-h1:clamp(2rem,1.55rem + 1.9vw,2.875rem);
  --fs-h2:clamp(1.5rem,1.3rem + .9vw,2rem);
  --fs-h3:1.25rem;
  --fs-lead:1.1875rem;
  --fs-body:1.0625rem;   /* 17px app body (site: 18px) */
  --fs-small:1rem;       /* 16px: floor for any reader text */
  --fs-label:.875rem;    /* 14px caps labels and chips only, weight 600 */
  --fs-num:1.5rem;       /* stat numbers */
  --lh-head:1.15; --lh-body:1.55;
  --measure:66ch;

  /* --- space, radius, shadow -------------------------------------------- */
  --space-1:.25rem; --space-2:.5rem; --space-3:1rem; --space-4:1.5rem; --space-5:2.5rem; --space-6:4rem;
  --radius:2px;          /* site: sharp, editorial */
  --radius-pill:999px;   /* APP: chips, switch, segmented only */
  --shadow-none:none;
  --shadow-raise:0 1px 0 rgba(0,34,49,.08);
  --shadow-pop:0 12px 32px -18px rgba(0,34,49,.35);  /* site menu panel */

  /* --- motion (site/Tamdoma) -------------------------------------------- */
  --motion-fast:150ms; --motion-base:300ms; --motion-slow:600ms;
  --ease-out:cubic-bezier(.16,1,.3,1); --ease-in-out:cubic-bezier(.65,0,.35,1);
}
@media (prefers-reduced-motion: reduce){ :root{ --motion-fast:.01ms; --motion-base:.01ms; --motion-slow:.01ms } }

/* ---------- base ---------- */
*,*::before,*::after{ box-sizing:border-box }
html{ -webkit-text-size-adjust:100% }
body.hd{ margin:0; background:var(--surface-base); color:var(--text-primary); font-family:var(--font-body);
  font-size:var(--fs-body); line-height:var(--lh-body); -webkit-font-smoothing:antialiased; overflow-x:clip }
.hd h1,.hd h2,.hd h3{ font-family:var(--font-display); color:var(--ink); font-weight:420; letter-spacing:-.012em; line-height:var(--lh-head); margin:0; text-wrap:balance }
.hd h1{ font-size:var(--fs-h1) } .hd h2{ font-size:var(--fs-h2) } .hd h3{ font-size:var(--fs-h3); font-weight:500 }
.hd p{ margin:0 0 .8em; text-wrap:pretty }
/* links: :where() keeps specificity at one class, so every component (.hd-btn …) overrides it */
.hd :where(a){ color:var(--harbour); text-decoration-thickness:1px; text-underline-offset:.2em }
.hd :where(a):hover{ color:var(--harbour-dk); text-decoration-thickness:2px }
.hd :focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset) }
.hd-wrap{ width:min(1120px,100% - 32px); margin-inline:auto }
.hd-stack>*+*{ margin-top:var(--space-3) }
.hd-grid{ display:grid; gap:var(--space-3) }
@media (min-width:760px){ .hd-grid--2{ grid-template-columns:1fr 1fr } .hd-grid--3{ grid-template-columns:repeat(3,1fr) } }
.hd-lede{ font-size:var(--fs-lead); color:var(--text-secondary); max-width:var(--measure) }
.hd-meta{ font-size:var(--fs-small); color:var(--text-muted) }
.hd-kicker{ font-size:var(--fs-label); font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--harbour) }
.hd-sr{ position:absolute!important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap }
.hd-skip{ position:absolute; left:16px; top:-60px; background:var(--ink); color:var(--paper-3)!important; padding:.75rem 1rem; z-index:50; text-decoration:none }
.hd-skip:focus{ top:12px }

/* ---------- labels: pilot, sample ---------- */
.hd-label{ display:inline-flex; align-items:center; gap:.4rem; font-size:var(--fs-label); font-weight:600; letter-spacing:.06em;
  text-transform:uppercase; border:1.5px solid currentColor; border-radius:var(--radius-pill); padding:.15rem .65rem; line-height:1.3 }
.hd-label--pilot{ color:var(--harbour-dk) }
.hd-label--sample{ color:#8A2F63; border-style:dashed }

/* ---------- buttons ---------- */
.hd-btn{ display:inline-flex; align-items:center; justify-content:center; gap:.55rem; min-height:48px; padding:0 1.3rem;
  font:600 1rem/1 var(--font-body); text-decoration:none; border-radius:var(--radius); border:1.5px solid var(--ink); cursor:pointer;
  transition:transform var(--motion-fast) var(--ease-out), background-color var(--motion-fast), color var(--motion-fast) }
.hd a.hd-btn{ text-decoration:none }
.hd-btn--primary{ background:var(--ink); color:var(--paper-3) }
.hd-btn--primary:hover,.hd-btn--primary.is-hover{ background:var(--harbour-dk); border-color:var(--harbour-dk); color:var(--paper-3); transform:translateY(-2px) }
.hd-btn--secondary{ background:transparent; color:var(--ink) }
.hd-btn--secondary:hover,.hd-btn--secondary.is-hover{ background:var(--paper-2); color:var(--ink); transform:translateY(-2px) }
.hd-btn--quiet{ background:transparent; border-color:transparent; color:var(--harbour); text-decoration:underline; text-underline-offset:.2em; padding:0 .6rem }
.hd-btn--quiet:hover,.hd-btn--quiet.is-hover{ color:var(--harbour-dk); text-decoration-thickness:2px }
.hd-btn--danger{ background:transparent; border-color:var(--status-error); color:var(--status-error) }
.hd-btn--danger:hover,.hd-btn--danger.is-hover{ background:var(--status-error-wash) }
.hd-btn--sm{ min-height:var(--touch-min); padding:0 .9rem; font-size:.9375rem }
.hd-btn--icon{ width:var(--touch-min); min-height:var(--touch-min); padding:0 }
.hd-btn svg{ width:1.1em; height:1.1em; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round }
.hd-btn.is-focus{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset) }
.hd-btn:active{ transform:translateY(0) }
.hd-btn:disabled,.hd-btn[aria-disabled="true"]{ background:var(--paper-2); border-color:var(--rule); color:var(--ink-3); cursor:not-allowed; transform:none }
.hd-btn[aria-busy="true"]{ cursor:progress }
.hd-spin{ width:1em; height:1em; border:2px solid currentColor; border-top-color:transparent; border-radius:50%; animation:hdspin .8s linear infinite }
@keyframes hdspin{ to{ transform:rotate(360deg) } }
@media (prefers-reduced-motion: reduce){ .hd-spin{ animation-duration:3s } }

/* ---------- form fields ---------- */
.hd-field{ display:grid; gap:.35rem; max-width:32rem }
.hd-field>label,.hd-field legend{ font-weight:600; font-size:var(--fs-small) }
.hd-hint{ font-size:var(--fs-small); color:var(--text-muted); margin:0 }
.hd-error{ font-size:var(--fs-small); color:var(--status-error); margin:0; display:flex; gap:.35rem; align-items:flex-start }
.hd-error::before{ content:"!"; flex:none; width:1.15rem; height:1.15rem; border-radius:50%; background:var(--status-error); color:var(--paper-3);
  font-weight:700; font-size:.75rem; display:inline-flex; align-items:center; justify-content:center; margin-top:.15rem }
.hd-input,.hd-select,.hd-textarea{ width:100%; min-height:48px; padding:.65rem .8rem; font:inherit; font-size:var(--fs-small); color:var(--ink);
  background:var(--paper-3); border:1.5px solid var(--rule-ui); border-radius:var(--radius) }
.hd-textarea{ min-height:7rem; resize:vertical }
.hd-select{ appearance:none; padding-right:2.4rem;
  background-image:linear-gradient(45deg,transparent 50%,var(--ink) 50%),linear-gradient(135deg,var(--ink) 50%,transparent 50%);
  background-position:calc(100% - 18px) 52%,calc(100% - 12px) 52%; background-size:6px 6px; background-repeat:no-repeat }
.hd-input:hover,.hd-select:hover,.hd-textarea:hover,.hd-input.is-hover{ border-color:var(--ink) }
.hd-input:focus-visible,.hd-select:focus-visible,.hd-textarea:focus-visible,.hd-input.is-focus{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset); border-color:var(--ink) }
.hd-input[aria-invalid="true"],.hd-select[aria-invalid="true"]{ border-color:var(--status-error); border-width:2px }
.hd-input:disabled,.hd-select:disabled,.hd-textarea:disabled{ background:var(--paper-2); color:var(--ink-3); border-color:var(--rule); cursor:not-allowed }
.hd-input[readonly]{ background:var(--paper-2); border-style:dashed }
.hd-input::placeholder{ color:var(--ink-3) }
.hd-pass{ position:relative } .hd-pass .hd-input{ padding-right:5.2rem }
.hd-pass .hd-btn{ position:absolute; right:2px; top:2px; min-height:44px }

/* checkbox / radio */
.hd-check{ display:flex; gap:.7rem; align-items:flex-start; min-height:var(--touch-min); padding:.55rem 0; cursor:pointer; font-size:var(--fs-small) }
.hd-check input{ appearance:none; flex:none; width:1.375rem; height:1.375rem; margin:.1rem 0 0; border:2px solid var(--rule-ui); background:var(--paper-3); border-radius:var(--radius); display:grid; place-content:center; cursor:pointer }
.hd-check input[type=radio]{ border-radius:50% }
.hd-check input::after{ content:""; width:.7rem; height:.4rem; border:2.5px solid var(--paper-3); border-top:0; border-right:0; transform:rotate(-45deg) translate(1px,-1px); opacity:0 }
.hd-check input[type=radio]::after{ width:.6rem; height:.6rem; border:0; border-radius:50%; background:var(--paper-3); transform:none }
.hd-check input:checked{ background:var(--ink); border-color:var(--ink) } .hd-check input:checked::after{ opacity:1 }
.hd-check input:hover{ border-color:var(--ink) }
.hd-check input:focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset) }
.hd-check input:disabled{ background:var(--paper-2); border-color:var(--rule); cursor:not-allowed } .hd-check:has(input:disabled){ color:var(--ink-3); cursor:not-allowed }
.hd-check input[aria-invalid="true"]{ border-color:var(--status-error) }

/* consent tickbox: the one box that carries a decision */
.hd-consent{ display:flex; gap:.9rem; align-items:flex-start; padding:1rem 1.1rem; background:var(--paper-3); border:1.5px solid var(--rule-ui); border-radius:var(--radius); cursor:pointer; max-width:40rem }
.hd-consent:hover{ border-color:var(--ink) }
.hd-consent:has(input:checked){ border-color:var(--ink); border-width:2px; background:var(--harbour-lt) }
.hd-consent:has(input:focus-visible){ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset) }
.hd-consent:has(input[aria-invalid="true"]){ border-color:var(--status-error); border-width:2px }
.hd-consent input{ appearance:none; flex:none; width:1.6rem; height:1.6rem; margin:.05rem 0 0; border:2px solid var(--ink); background:var(--paper-3); border-radius:var(--radius); display:grid; place-content:center; cursor:pointer }
.hd-consent input::after{ content:""; width:.8rem; height:.45rem; border:3px solid var(--paper-3); border-top:0; border-right:0; transform:rotate(-45deg) translate(1px,-1px); opacity:0 }
.hd-consent input:checked{ background:var(--ink) } .hd-consent input:checked::after{ opacity:1 }
.hd-consent input:focus-visible{ outline:none }
.hd-consent b{ display:block; margin-bottom:.15rem }

/* switch */
.hd-switch{ display:inline-flex; align-items:center; gap:.7rem; min-height:var(--touch-min); cursor:pointer; font-size:var(--fs-small) }
.hd-switch input{ appearance:none; width:3rem; height:1.75rem; border-radius:var(--radius-pill); background:var(--paper-3); border:2px solid var(--rule-ui); position:relative; cursor:pointer; margin:0; flex:none;
  transition:background-color var(--motion-fast) }
.hd-switch input::after{ content:""; position:absolute; top:2px; left:2px; width:1.2rem; height:1.2rem; border-radius:50%; background:var(--ink-3); transition:transform var(--motion-base) var(--ease-out) }
.hd-switch input:checked{ background:var(--ink); border-color:var(--ink) } .hd-switch input:checked::after{ transform:translateX(1.25rem); background:var(--paper-3) }
.hd-switch input:focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset) }
.hd-switch input:disabled{ background:var(--paper-2); border-color:var(--rule); cursor:not-allowed } .hd-switch:has(input:disabled){ color:var(--ink-3) }
.hd-switch .state{ font-weight:600; min-width:2.2rem }

/* segmented control / scope switch */
.hd-seg{ display:inline-flex; flex-wrap:wrap; border:1.5px solid var(--ink); border-radius:var(--radius-pill); overflow:hidden; background:var(--paper-3) }
.hd-seg button{ appearance:none; border:0; background:none; color:var(--ink); font:600 var(--fs-small)/1 var(--font-body); min-height:var(--touch-min); padding:0 1rem; cursor:pointer }
.hd-seg button+button{ border-left:1.5px solid var(--ink) }
.hd-seg button:hover{ background:var(--paper-2) }
.hd-seg button[aria-pressed="true"]{ background:var(--ink); color:var(--paper-3) }
.hd-seg button:focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:-5px }
.hd-seg button:disabled{ color:var(--ink-3); cursor:not-allowed; background:var(--paper-2) }
.hd-seg--sm button{ min-height:36px; padding:0 .8rem; font-size:var(--fs-label) }

/* answer scale (test statements, keys 1-5) */
.hd-scale{ display:grid; grid-template-columns:repeat(5,1fr); gap:.4rem; max-width:40rem }
.hd-scale button{ appearance:none; min-height:56px; border:1.5px solid var(--rule-ui); background:var(--paper-3); color:var(--ink); border-radius:var(--radius);
  font:600 var(--fs-small)/1.2 var(--font-body); cursor:pointer; padding:.4rem; display:grid; gap:.15rem; place-items:center }
.hd-scale button small{ font-weight:400; font-size:.8125rem; color:var(--ink-2) }
.hd-scale button:hover{ border-color:var(--ink) }
.hd-scale button[aria-pressed="true"]{ background:var(--ink); color:var(--paper-3); border-color:var(--ink) }
.hd-scale button[aria-pressed="true"] small{ color:var(--paper-3) }
.hd-scale button:focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset) }
.hd-scale button:disabled{ background:var(--paper-2); color:var(--ink-3); border-color:var(--rule) }
@media (max-width:420px){ .hd-scale button small{ display:none } }

/* ---------- chips ---------- */
.hd-chip{ display:inline-flex; align-items:center; gap:.35rem; font-size:var(--fs-label); font-weight:600; line-height:1.25; white-space:nowrap;
  color:var(--chip,var(--ink-2)); border:1.5px solid currentColor; border-radius:var(--radius-pill); padding:.12rem .6rem; background:var(--paper-3) }
.hd-chip::before{ content:""; width:.55rem; height:.55rem; border-radius:50%; background:currentColor }
.hd-chip--dot{ gap:0; padding:.3rem .42rem } /* colour-only band chip (band words withdrawn as reader labels, GATE-163/251) */
.hd-chip--good{ --chip:var(--band-good) } .hd-chip--steady{ --chip:var(--band-steady) } .hd-chip--watch{ --chip:var(--band-watch) }
.hd-chip--strain{ --chip:var(--band-strain) } .hd-chip--care{ --chip:var(--band-care) }
.hd-chip--fine{ --chip:var(--side-fine) }
.hd-chip--level{ --chip:var(--harbour-dk) } .hd-chip--level::before{ display:none }
.hd-chip--empty{ --chip:var(--ink-3); border-style:dashed } .hd-chip--empty::before{ display:none }
.hd-chip--masked{ --chip:var(--masked); border-style:dashed } .hd-chip--masked::before{ background:repeating-linear-gradient(45deg,currentColor 0 2px,transparent 2px 4px) }

/* ---------- bar row (facet row) ---------- */
.hd-barrow{ display:grid; grid-template-columns:1fr; gap:.3rem; padding:.7rem 0; border-bottom:1px solid var(--rule) }
@media (min-width:640px){ .hd-barrow{ grid-template-columns:minmax(0,15rem) 1fr 3.5rem 9.5rem; align-items:center; gap:.9rem } }
.hd-barrow .name{ font-weight:600 }
.hd-barrow .name small{ display:block; font-weight:400; color:var(--text-muted); font-size:var(--fs-small) }
.hd-barrow .pct{ font-weight:700; font-variant-numeric:tabular-nums; color:var(--bar,var(--ink)); text-align:right }
.hd-barrow .gloss{ grid-column:1/-1; font-size:var(--fs-small); color:var(--text-secondary); margin:0 }
.hd-barrow .note{ grid-column:2/-1; font-size:var(--fs-small); color:var(--text-muted); font-style:italic }
.hd-track{ position:relative; height:12px; background:var(--track); border-radius:var(--radius-pill); overflow:hidden; min-width:60px }
.hd-track>i{ position:absolute; left:0; top:0; bottom:0; width:var(--v,0%); background:var(--bar,var(--ink)); border-radius:var(--radius-pill) }
.hd-track.is-loading,.hd-ring.is-loading circle:last-child{ animation:hdpulse 1.4s var(--ease-in-out) infinite }
.hd-track.is-loading>i{ display:none }
@keyframes hdpulse{ 50%{ opacity:.45 } }

/* ---------- ring gauge ---------- */
.hd-ring{ position:relative; width:88px; height:88px; margin:.3rem auto }
.hd-ring svg{ width:100%; height:100% }
.hd-ring .val{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:1.125rem;
  color:var(--bar,var(--ink)); font-variant-numeric:tabular-nums }
.hd-ring.is-empty .val,.hd-ring.is-masked .val{ font-size:.8125rem; font-weight:600; color:var(--ink-3); text-align:center; line-height:1.15; padding:0 .9rem }

/* ---------- distribution bar (3 sides, masked cells merged into one hatched segment) */
.hd-dist{ display:grid; gap:.35rem }
.hd-dist .bar{ display:flex; height:16px; border-radius:var(--radius); overflow:hidden; background:var(--track) }
.hd-dist .bar>span{ height:100%; width:var(--w); background:var(--seg) }
.hd-dist .bar>span+span{ border-left:2px solid var(--paper-3) }
.hd-dist .bar>.masked{ --seg:repeating-linear-gradient(45deg,var(--masked) 0 3px,var(--track) 3px 7px) }
.hd-dist ul{ display:flex; flex-wrap:wrap; gap:.3rem .9rem; margin:0; padding:0; list-style:none; font-size:var(--fs-small) }
.hd-dist li{ position:relative; padding-left:1.1rem; color:var(--ink-2) } /* hanging indent: wrapped lines align with the text, not under the square (F7) */
.hd-dist li i{ position:absolute; left:0; top:calc((1em*var(--lh-body,1.6) - .75rem)/2); width:.75rem; height:.75rem; border-radius:2px; background:var(--seg) }
.hd-dist li b{ color:var(--ink); font-variant-numeric:tabular-nums }
.hd-dist li .ns{ font-style:italic; color:var(--masked) }

/* ---------- coper mix bar ---------- */
.hd-mix .bar{ display:flex; height:28px; border-radius:var(--radius); overflow:hidden }
.hd-mix .bar>span{ width:var(--w); background:var(--seg); color:var(--paper-3); font:700 .8125rem/28px var(--font-body); text-align:center; overflow:hidden; white-space:nowrap }
.hd-mix .bar>span+span{ border-left:2px solid var(--paper-3) }
.hd-mix ul{ display:flex; flex-wrap:wrap; gap:.3rem 1rem; margin:.5rem 0 0; padding:0; list-style:none; font-size:var(--fs-small); color:var(--ink-2) }
.hd-mix li i{ display:inline-block; width:.8rem; height:.8rem; border-radius:2px; background:var(--seg); margin-right:.35rem; vertical-align:-.08em }

/* ---------- delta bar (change between two measurements) ---------- */
.hd-delta{ display:grid; grid-template-columns:minmax(0,12rem) 1fr 4.5rem; gap:.8rem; align-items:center; padding:.5rem 0 }
.hd-delta .axis{ position:relative; height:14px; background:var(--track); border-radius:var(--radius-pill) }
.hd-delta .axis::before{ content:""; position:absolute; left:50%; top:-4px; bottom:-4px; width:2px; background:var(--ink); transform:translateX(-1px) }
.hd-delta .axis>i{ position:absolute; top:0; bottom:0; border-radius:var(--radius-pill) }
.hd-delta .axis>i.up{ left:50%; width:var(--d); background:var(--band-good) }
.hd-delta .axis>i.down{ right:50%; width:var(--d); background:var(--band-strain) }
.hd-delta .num{ font-weight:700; font-variant-numeric:tabular-nums; text-align:right }
.hd-delta .num.up{ color:var(--band-good) } .hd-delta .num.down{ color:var(--band-strain) } .hd-delta .num.flat{ color:var(--ink-2) }
@media (max-width:520px){ .hd-delta{ grid-template-columns:1fr 4rem } .hd-delta .name{ grid-column:1/-1 } }

/* ---------- stat card ("where it hurts") ---------- */
.hd-stat{ background:var(--paper-3); border:1.5px solid var(--rule); border-top:4px solid var(--band-strain); border-radius:var(--radius); padding:.9rem 1rem }
.hd-stat .what{ font-weight:600 }
.hd-stat .num{ font-family:var(--font-display); font-size:2rem; line-height:1.1; color:var(--band-strain); font-variant-numeric:tabular-nums; margin:.25rem 0 0 }
.hd-stat .num small{ font-family:var(--font-body); font-size:var(--fs-small); color:var(--ink-2); font-weight:400 }
.hd-stat .num.ns{ font-size:1.25rem; font-style:italic; color:var(--masked) }
.hd-stat .sub{ font-size:var(--fs-small); color:var(--text-muted); margin:0 }
.hd-stat .caveat{ font-size:var(--fs-small); color:var(--status-warning); margin:.4rem 0 0 }

/* ---------- table ---------- */
.hd-table-wrap{ overflow-x:auto; border:1px solid var(--rule); border-radius:var(--radius); background:var(--paper-3) }
.hd-table{ width:100%; border-collapse:collapse; font-size:var(--fs-small) }
.hd-table caption{ text-align:left; padding:.7rem .9rem; font-weight:600; color:var(--ink) }
.hd-table th,.hd-table td{ padding:.6rem .9rem; border-top:1px solid var(--rule); text-align:left; vertical-align:top }
.hd-table thead th{ font-size:var(--fs-label); letter-spacing:.06em; text-transform:uppercase; color:var(--ink-2); background:var(--paper-2) }
.hd-table td.num,.hd-table th.num{ text-align:right; font-variant-numeric:tabular-nums }
.hd-table td.ns{ font-style:italic; color:var(--masked); text-align:right }
.hd-table tbody tr:hover{ background:var(--paper) }
/* v1.1e APP: inline month calendar (CALENDAR-FIT-SPEC-001). Put .hd-cal on the calendar container
   (not inside another .hd-card); it holds the usual .hd-table-wrap > .hd-table. Day cells lose the
   table's text padding and each day button fills its cell, never narrower than the touch target.
   Under 760px (one-column grid) the wrap uses the parent card's side padding (.hd-card: 1.2rem). */
.hd-cal .hd-table th,.hd-cal .hd-table td{ padding:.125rem; text-align:center; vertical-align:middle }
.hd-cal .hd-table th{ padding-block:.5rem }
.hd-cal .hd-table .hd-btn{ width:100%; min-width:var(--touch-min); padding:0 }
@media (max-width:759px){
  .hd-cal .hd-table-wrap{ margin-inline:-1.2rem; border-inline:0; border-radius:0 }
}

/* ---------- cards ---------- */
.hd-card{ background:var(--paper-3); border:1px solid var(--rule); border-radius:var(--radius); padding:1.1rem 1.2rem; min-width:0 }
.hd-card--panel{ background:var(--paper-2) }
.hd-card--accent{ border-top:4px solid var(--harbour) }
.hd-card>h3+*{ margin-top:.4rem }
.hd-construct{ border-top:4px solid var(--c,var(--harbour)) }
.hd-construct .code{ font-size:var(--fs-label); font-weight:700; letter-spacing:.08em; color:var(--c,var(--harbour)) }
.hd-construct h3{ margin-top:.15rem }
.hd-construct .triad{ font-size:.9375rem; font-weight:700; letter-spacing:.02em; color:var(--c,var(--ink)); margin:.2rem 0 0 }
.hd-construct .what{ font-size:var(--fs-small); color:var(--text-secondary); margin:.15rem 0 0 }
.hd-construct .madeof{ font-size:var(--fs-small); color:var(--text-muted); margin:.45rem 0 .6rem; padding-left:.7rem; border-left:2px solid var(--rule) }
.hd-construct .madeof q{ color:var(--ink-2); font-style:italic }
.hd-construct .row{ display:flex; align-items:center; gap:.7rem; margin:.5rem 0 }
.hd-construct .row .hd-track{ flex:1 }
.hd-construct .row .pct{ font-weight:700; font-variant-numeric:tabular-nums; color:var(--c,var(--ink)) }
.hd-direction{ margin-top:.8rem; padding:.2rem 0 .2rem .9rem; border-left:3px solid var(--harbour) }
.hd-direction .hd-kicker{ display:block; margin-bottom:.2rem }
.hd-direction .answers{ font-size:var(--fs-small); color:var(--text-muted); margin:0 0 .3rem }
.hd-direction .answers b{ color:var(--ink); font-weight:600 }
.hd-direction .answers b.hit{ color:var(--band-strain) }

/* empty / lock card */
.hd-empty{ background:var(--paper); border:1.5px dashed var(--rule-ui); border-radius:var(--radius); padding:1.4rem 1.3rem; text-align:left }
.hd-empty .glyph{ width:44px; height:44px; margin-bottom:.4rem; stroke:var(--harbour); fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round }
.hd-empty--lock .glyph{ stroke:var(--ink) }

/* firefly glyph (bright-side mark, decorative) */
.hd-firefly{ width:56px; height:28px; display:inline-block; vertical-align:middle }
.hd-firefly .lamp{ fill:var(--firefly-lamp) } .hd-firefly .body{ fill:var(--ink) } .hd-firefly .wing{ fill:var(--ink); opacity:.3 }
.hd-firefly .ant{ fill:none; stroke:var(--ink); stroke-width:1; stroke-linecap:round }
.hd-firefly .halo{ animation:hdbreathe 4.2s ease-in-out infinite }
@keyframes hdbreathe{ 50%{ opacity:.55 } }
@media (prefers-reduced-motion: reduce){ .hd-firefly .halo{ animation:none } }

/* details / accordion */
.hd-details{ border:1px solid var(--rule); border-radius:var(--radius); background:var(--paper-3) }
.hd-details>summary{ list-style:none; cursor:pointer; min-height:var(--touch-min); padding:.8rem 1rem; font-weight:600; display:flex; align-items:center; justify-content:space-between; gap:1rem; color:var(--ink) }
.hd-details>summary::-webkit-details-marker{ display:none }
.hd-details>summary::after{ content:""; width:.55rem; height:.55rem; border-right:2px solid var(--ink); border-bottom:2px solid var(--ink); transform:rotate(45deg); transition:transform var(--motion-base) var(--ease-out); flex:none; margin-right:.3rem }
.hd-details[open]>summary::after{ transform:rotate(-135deg) }
.hd-details>summary:hover{ background:var(--paper) }
.hd-details>summary:focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:-3px }
.hd-details>.body{ padding:0 1rem 1rem }
.hd-details--inline{ border:0; background:none }
.hd-details--inline>summary{ min-height:36px; padding:.3rem 0; color:var(--harbour); justify-content:flex-start; font-size:var(--fs-small) }
.hd-details--inline>summary::after{ border-color:var(--harbour); width:.45rem; height:.45rem }
.hd-details--inline>.body{ padding:0 0 .4rem .8rem }

/* plan week card */
.hd-week{ background:var(--paper-3); border:1px solid var(--rule); border-radius:var(--radius); padding:1rem 1.1rem; display:flex; flex-direction:column; gap:.35rem }
.hd-week .wk{ align-self:flex-start; font-size:var(--fs-label); font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--paper-3); background:var(--ink); padding:.15rem .6rem; border-radius:var(--radius-pill) }
.hd-week .tied{ font-size:var(--fs-small); color:var(--text-muted); margin:0 }
.hd-week .tied b{ color:var(--ink-2) }
.hd-week .practice{ font-size:var(--fs-small); color:var(--ink-2); border-top:1px solid var(--rule); padding-top:.55rem; margin:.3rem 0 0 }
.hd-week .practice q{ font-family:var(--font-display); font-style:italic; font-size:1.0625rem; color:var(--ink) }
.hd-week--after{ background:var(--paper); border-style:dashed; border-color:var(--rule-ui) }
.hd-week--after .wk{ background:var(--paper-3); color:var(--ink); border:1.5px solid var(--ink) }
.hd-week--now{ border:2px solid var(--ink) }

/* toast / status */
.hd-status{ display:flex; gap:.7rem; align-items:flex-start; padding:.8rem 1rem; border-radius:var(--radius); border:1.5px solid var(--st); background:var(--stw); color:var(--ink); font-size:var(--fs-small); max-width:40rem }
.hd-status::before{ flex:none; width:1.4rem; height:1.4rem; border-radius:50%; background:var(--st); color:var(--paper-3); font-weight:700; font-size:.85rem; display:inline-flex; align-items:center; justify-content:center; margin-top:.05rem }
.hd-status--info{ --st:var(--status-info); --stw:var(--status-info-wash) } .hd-status--info::before{ content:"i" }
.hd-status--success{ --st:var(--status-success); --stw:var(--status-success-wash) } .hd-status--success::before{ content:"\2713" }
.hd-status--warning{ --st:var(--status-warning); --stw:var(--status-warning-wash) } .hd-status--warning::before{ content:"!" }
.hd-status--error{ --st:var(--status-error); --stw:var(--status-error-wash) } .hd-status--error::before{ content:"\00d7" }
.hd-status b{ display:block }
.hd-status p{ margin:0 }
.hd-toast{ position:fixed; left:50%; bottom:1rem; transform:translateX(-50%); z-index:40; box-shadow:var(--shadow-pop); width:min(32rem,100% - 32px); background:var(--paper-3) }

/* ---------- shell ---------- */
.hd-head{ position:sticky; top:var(--hd-top-offset,0); z-index:20; background:color-mix(in srgb,var(--paper) 94%,transparent); backdrop-filter:blur(8px); border-bottom:1px solid var(--rule) }
.hd-head .hd-wrap{ display:flex; align-items:center; justify-content:space-between; min-height:64px; gap:1rem }
.hd-wordmark{ min-height:var(--touch-min); font-family:var(--font-display); font-size:1.4rem; line-height:1; color:var(--ink)!important; text-decoration:none!important; display:inline-flex; align-items:center; gap:.4rem }
.hd-wordmark b{ font-weight:640 } .hd-wordmark span{ font-style:italic; font-weight:400 }
.hd-nav{ display:flex; gap:.15rem; align-items:center }
.hd-nav a{ color:var(--ink)!important; text-decoration:none!important; font-size:var(--fs-small); padding:.5rem .7rem; min-height:var(--touch-min); display:inline-flex; align-items:center }
.hd-nav a[aria-current="page"]{ text-decoration:underline!important; text-decoration-thickness:2px!important; text-underline-offset:.45em }
.hd-nav a:hover{ color:var(--harbour)!important }
.hd-account{ display:inline-flex; align-items:center; gap:.5rem }
.hd-avatar{ width:36px; height:36px; border-radius:50%; background:var(--paper-2); border:1.5px solid var(--ink); display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:.875rem; color:var(--ink) }
.hd-menu{ display:none; position:relative }
.hd-menu>summary{ list-style:none; cursor:pointer; min-height:var(--touch-min); min-width:var(--touch-min); display:inline-flex; align-items:center; gap:.5rem; font-weight:600; padding:0 .9rem; border:1.5px solid var(--rule-ui); border-radius:var(--radius); color:var(--ink) }
.hd-menu>summary::-webkit-details-marker{ display:none }
.hd-menu>summary:focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset) }
.hd-menu .panel{ position:absolute; right:0; top:52px; background:var(--paper-3); border:1px solid var(--rule-ui); padding:.5rem; display:grid; min-width:230px; box-shadow:var(--shadow-pop); z-index:30 }
.hd-menu .panel a{ color:var(--ink)!important; text-decoration:none!important; padding:.7rem .8rem; min-height:var(--touch-min) }
.hd-menu .panel button{ color:var(--ink); text-decoration:none; padding:.7rem .8rem; min-height:var(--touch-min); background:transparent; border:0; text-align:left; width:100%; font:inherit; font-weight:400; cursor:pointer; border-radius:0 } /* v1.1c: the sign-out form button in the phone menu reads like the other rows */
.hd-menu .panel a[aria-current="page"]{ background:var(--paper-2); font-weight:600 }
@media (max-width:860px){ .hd-nav,.hd-head .hd-account .name{ display:none } .hd-menu{ display:block } }
/* v1.1d APP: admin header (HEADER-WRAP-SPEC-001). The account (avatar, name, role) takes a slim second
   line, right-aligned, so the nav row holds only gated words and never wraps mid-label. Desktop only:
   below 861px the v1.1 phone menu rule above is untouched. */
@media (min-width:861px){
  .hd-head--admin .hd-wrap{ flex-wrap:wrap; row-gap:0; padding-block:.5rem .375rem }
  .hd-head--admin nav.hd-nav{ margin-right:auto }
  .hd-head--admin span.hd-nav{ margin-left:auto }
  .hd-head--admin .hd-nav a,
  .hd-head--admin .hd-nav .hd-btn{ white-space:nowrap }
  .hd-head--admin .hd-account{ order:1; flex:1 0 100%; min-width:0; justify-content:flex-end }
}
.hd-pagehead{ padding:var(--space-5) 0 var(--space-3); display:grid; gap:.7rem }
.hd-pagehead .crumbs{ font-size:var(--fs-small); color:var(--text-muted) }
.hd-pagehead .crumbs a{ color:var(--ink-2) }
.hd-pagehead .labels{ display:flex; flex-wrap:wrap; gap:.4rem }
.hd-pagehead .tools{ display:flex; flex-wrap:wrap; align-items:center; gap:.7rem 1rem; justify-content:space-between }
.hd .hd-section,.hd-section{ margin-top:var(--space-5) }
.hd-section>.hd-kicker{ display:block; margin-bottom:.25rem }
.hd-section>h2{ margin-bottom:.4rem }
.hd-foot{ margin-top:var(--space-6); border-top:2px solid var(--ink); padding:2rem 0 2.5rem; font-size:var(--fs-small); color:var(--text-secondary) }
.hd-foot .hd-wrap{ display:grid; gap:1rem 3rem; grid-template-columns:1.3fr 1fr }
.hd-foot a{ color:var(--ink) }
.hd-foot .legal{ grid-column:1/-1; display:flex; flex-wrap:wrap; gap:.25rem 1.25rem; border-top:1px solid var(--rule); padding-top:1rem }
@media (max-width:760px){ .hd-foot .hd-wrap{ grid-template-columns:1fr } }
.hd-participation{ display:grid; gap:.4rem }
.hd-participation p{ margin:0 }
.hd-participation .n{ font-family:var(--font-display); font-size:1.6rem; line-height:1.1 }
.hd-participation .hd-track>i{ background:var(--harbour) }
.hd-privacy{ display:flex; gap:.6rem; align-items:flex-start; font-size:var(--fs-small); color:var(--ink-2) }
.hd-privacy svg{ flex:none; width:22px; height:22px; stroke:var(--harbour); fill:none; stroke-width:1.8; margin-top:.1rem }

/* ---------- impersonation banner (APP, super admin viewing as a client admin) ---------- */
.hd-impersonation{ position:sticky; top:0; z-index:25; container-type:inline-size; background:var(--status-warning-wash); color:var(--ink);
  border-bottom:2px solid var(--status-warning); font-size:var(--fs-small) }
.hd-impersonation .hd-wrap{ display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; min-height:var(--touch-min); padding-top:.45rem; padding-bottom:.45rem }
.hd-impersonation svg{ flex:none; width:22px; height:22px; stroke:var(--status-warning); fill:none; stroke-width:1.8; stroke-linejoin:round }
.hd-impersonation p{ margin:0; flex:1 1 14rem; min-width:0 }
.hd-impersonation .hd-btn{ margin-left:auto }
@container (max-width:480px){ .hd-impersonation .hd-btn{ flex:1 1 100%; margin-left:0 } }
/* .hd-head reads top:var(--hd-top-offset,0); HD.offset() sets it on the banner's parent (body) in px */

/* ---------- dialog (native <dialog>) ---------- */
.hd-dialog{ background:var(--paper-3); color:var(--ink); border:1px solid var(--rule); border-radius:var(--radius); padding:1.4rem 1.5rem;
  width:min(32rem,100% - 32px); box-shadow:var(--shadow-pop); font-size:var(--fs-small) }
.hd-dialog::backdrop{ background:rgba(0,34,49,.45) } /* --ink at 45% (::backdrop cannot read the custom property everywhere) */
.hd-dialog h2{ font-size:1.375rem; margin:0 0 .6rem }
.hd-dialog p{ margin:0 0 .6rem; color:var(--ink-2) }
.hd-dialog .hd-field{ margin-top:1rem; max-width:none }
.hd-dialog .actions{ display:flex; flex-wrap:wrap; gap:.6rem; justify-content:flex-end; margin-top:1.2rem }

/* ---------- pager ---------- */
.hd-pager{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.6rem 1rem }
.hd-pager .page{ font-size:var(--fs-small); color:var(--ink-2); font-variant-numeric:tabular-nums }
.hd-pager [aria-disabled="true"]{ color:var(--ink-3); border-color:var(--rule); cursor:not-allowed; pointer-events:none }
.hd-pager[hidden]{ display:none }

/* skeleton */
.hd-skel{ display:block; height:1em; background:var(--skeleton); border-radius:var(--radius); animation:hdpulse 1.4s var(--ease-in-out) infinite }
@media (prefers-reduced-motion: reduce){ .hd-skel,.hd-track.is-loading{ animation:none } }

/* v1.1g APP: the personal results page (MY-RESULTS-OVERHAUL-SPEC-001). ADDITIVE ONLY: no v1.1e rule
   is changed. Inserted at the end of lib.css (after the .hd-skel reduced-motion rule). Every colour,
   size and space is a v1.1e token; no new token and no new colour. */

/* tabs drawn as a segmented control: role="tab" carries aria-selected, not aria-pressed */
.hd-seg [role="tab"][aria-selected="true"]{ background:var(--ink); color:var(--paper-3) }
.hd-seg [role="tab"] .t-dot{ display:none }

/* a status line whose sentence already carries its own glyph (the pilot line starts with one) */
.hd-status--plain::before{ display:none }

/* a row of controls that wraps; 44px targets come from the controls themselves */
.hd-toolbar{ display:flex; flex-wrap:wrap; align-items:center; gap:.6rem 1rem; margin:var(--space-3) 0 }
.hd-toolbar .hd-select{ width:auto; min-width:14rem; max-width:100% }

/* second page head inside the page (the first one carries the crumbs) */
.hd-pagehead--flush{ padding-top:var(--space-3) }

/* inline figure: a number that stands in a heading or a list; --fig carries a band or fixed colour */
.hd-fig{ font-family:var(--font-display); font-size:var(--fs-num); line-height:1; font-weight:500;
  color:var(--fig,var(--ink)); font-variant-numeric:tabular-nums lining-nums }

/* card head: monochrome icon + an h3 that may hold a figure and a note */
.hd-cardhead{ display:flex; align-items:flex-start; gap:.75rem; margin-bottom:.6rem }
.hd-cardhead>svg{ flex:none; width:28px; height:28px; margin-top:.1rem; fill:none; stroke:var(--harbour); stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round }
.hd-cardhead h3{ display:flex; flex-wrap:wrap; align-items:baseline; gap:.3rem .6rem }
.hd-cardhead .hd-chip{ font-family:var(--font-body); white-space:normal; letter-spacing:0 }

/* numbered short list: rank, name, figure (the figure may carry a band colour through --fig) */
.hd-toplist{ list-style:none; margin:.7rem 0 0; padding:0; counter-reset:hdtop }
.hd-toplist li{ counter-increment:hdtop; display:grid; grid-template-columns:1.75rem minmax(0,1fr) auto; align-items:center;
  gap:.6rem; padding:.45rem 0; border-top:1px solid var(--rule); font-size:var(--fs-small) }
.hd-toplist li::before{ content:counter(hdtop); width:1.6rem; height:1.6rem; border-radius:50%; border:1.5px solid var(--rule-ui);
  color:var(--ink-2); font-size:var(--fs-label); font-weight:700; display:inline-flex; align-items:center; justify-content:center }
.hd-toplist .fname{ font-weight:600; color:var(--ink) }
.hd-toplist .fpct{ font-weight:700; font-variant-numeric:tabular-nums; color:var(--fig,var(--ink)); text-align:right }

/* a card that spans every column of its .hd-grid */
.hd-span-all{ grid-column:1/-1 }

/* plane card: tag, title, ring, optional chip, centred */
.hd-plane{ text-align:center; display:flex; flex-direction:column; align-items:center; gap:.3rem }
.hd-plane h3{ font-size:1.125rem; min-height:2.6em; display:flex; align-items:center; justify-content:center }
.hd-plane .hd-chip[title]{ cursor:help }

/* facet group head and its list of expandable facet rows */
.hd-planehead{ display:flex; flex-wrap:wrap; align-items:baseline; gap:.2rem .8rem; margin:var(--space-5) 0 .6rem }
.hd-facets{ background:var(--paper-3); border:1px solid var(--rule); border-radius:var(--radius); padding:0 1rem }
.hd-facet+.hd-facet{ border-top:1px solid var(--rule) }
.hd-facet>summary{ list-style:none; cursor:pointer; border-bottom:0; min-height:var(--touch-min) }
.hd-facet>summary::-webkit-details-marker{ display:none }
.hd-facet>summary:hover{ background:var(--paper) }
.hd-facet>summary:focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:-3px }
.hd-facet .caret{ grid-column:-2; grid-row:1; justify-self:end; width:.55rem; height:.55rem; margin-right:.35rem;
  border-right:2px solid var(--ink); border-bottom:2px solid var(--ink); transform:rotate(-45deg);
  transition:transform var(--motion-base) var(--ease-out) }
.hd-facet[open] .caret{ transform:rotate(45deg) }
.hd-facet .subs{ margin:0 0 .7rem .25rem; padding:0 0 0 1rem; border-left:2px solid var(--rule) }
.hd-facet .subs .hd-barrow{ border-bottom:0; padding:.45rem 0 }
.hd-facet .subs .hd-barrow .name{ font-weight:400 }
@media (min-width:640px){
  .hd-facet>summary.hd-barrow,.hd-facet .subs .hd-barrow{ grid-template-columns:minmax(0,17rem) 1fr 3.5rem 1.25rem }
  .hd-facet .hd-barrow .note{ grid-column:2/4 }
}
@media (max-width:639px){
  .hd-facet>summary.hd-barrow,.hd-facet .subs .hd-barrow{ grid-template-columns:minmax(0,1fr) 3.5rem 1.25rem; column-gap:.6rem }
  .hd-facet .hd-barrow .hd-track,.hd-facet .hd-barrow .note{ grid-column:1/-1; grid-row:2 }
}

/* bar row without the chip column (recharge rows); the name carries the construct colour */
.hd-barrow--nochip .name{ color:var(--bar,var(--ink)) }
.hd-barrow--nochip .note{ grid-column:auto }
@media (min-width:640px){ .hd-barrow--nochip{ grid-template-columns:minmax(0,17rem) 1fr 3.5rem } }
@media (max-width:639px){
  .hd-barrow--nochip{ grid-template-columns:minmax(0,1fr) 3.5rem; column-gap:.6rem }
  .hd-barrow--nochip .hd-track{ grid-column:1/-1; grid-row:2 }
}

/* setting row: what it is, who sees what, the state in words, the switch (v1.2 request #4, brought forward) */
.hd-setting{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.6rem 1.2rem; align-items:center; margin-top:var(--space-4);
  background:var(--paper-3); border:1px solid var(--rule); border-radius:var(--radius); padding:1.1rem 1.2rem }
.hd-setting h4{ margin:0 0 .25rem; font:600 var(--fs-body)/1.3 var(--font-body); color:var(--ink) }
.hd-setting p{ margin:0; font-size:var(--fs-small); color:var(--text-secondary) }
.hd-setting .state{ display:block; margin-top:.45rem; font-size:var(--fs-small); font-weight:600; color:var(--ink) }
.hd-setting form{ display:flex; flex-direction:column; align-items:flex-end; gap:.3rem }
@media (max-width:520px){ .hd-setting{ grid-template-columns:1fr } .hd-setting form{ align-items:flex-start } }
.hd-switchbtn{ appearance:none; position:relative; flex:none; width:3.5rem; height:var(--touch-min); padding:0; border:0; background:none; cursor:pointer }
.hd-switchbtn::before{ content:""; position:absolute; left:.25rem; top:50%; width:3rem; height:1.75rem; transform:translateY(-50%);
  border-radius:var(--radius-pill); background:var(--paper-3); border:2px solid var(--rule-ui); transition:background-color var(--motion-fast) }
.hd-switchbtn::after{ content:""; position:absolute; left:calc(.25rem + 4px); top:50%; width:1.2rem; height:1.2rem; transform:translateY(-50%);
  border-radius:50%; background:var(--ink-3); transition:transform var(--motion-base) var(--ease-out) }
.hd-switchbtn[aria-checked="true"]::before{ background:var(--ink); border-color:var(--ink) }
.hd-switchbtn[aria-checked="true"]::after{ transform:translate(1.25rem,-50%); background:var(--paper-3) }
.hd-switchbtn:focus-visible{ outline:var(--focus-ring-width) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset) }

/* one test's start / continue card (the DW tab shows it only before a result exists: no score state) */
.hd-hubhead{ text-align:center; max-width:var(--measure); margin:var(--space-4) auto 0 }
.hd-hubhead .hd-lede{ margin-inline:auto }
.hd-hub{ max-width:26rem; margin:var(--space-4) auto 0; text-align:center; display:flex; flex-direction:column; align-items:center; gap:.5rem }
.hd-hub>svg{ width:2.5rem; height:2.5rem; fill:none; stroke:var(--harbour); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round }
.hd-hub .hd-track{ align-self:stretch; --bar:var(--harbour) }
.hd-hub .ghost{ width:56px; height:56px; border-radius:50%; border:2px dashed var(--rule-ui); display:inline-flex; align-items:center;
  justify-content:center; color:var(--ink-3); font-weight:700 }

/* provenance line: release and checksum; wraps anywhere so the 64-character hash never scrolls */
.hd-prov{ margin-top:var(--space-4); font-size:var(--fs-small); color:var(--text-muted); overflow-wrap:anywhere }

/* contained legacy island: a block that keeps its own dark styles until it is re-skinned or ruled out */
.hd-legacy-dark{ background:var(--ink); color:var(--paper-3); border-radius:var(--radius); padding:1.2rem; margin-top:var(--space-5) }
.hd-card>.hd-barrow--nochip:last-child{ border-bottom:0 }

/* v1.1g APP: the three DW5 flow pages (DW5-FLOW-PAGES-SPEC-001). ADDITIVE ONLY: no v1.1f rule
   is changed. Inserted at the end of lib.css (after the last v1.1f rule). Every colour, size and
   space is an existing token; no new token and no new colour. */

/* a reading column for a page that is one decision long: lede, a list of points, one form.
   Lists keep bare <li> (tests count them), so the list is styled from the column. */
.hd-read{ max-width:var(--measure) }
.hd-read>ul,.hd-read>ol{ margin:0 0 var(--space-4); padding-left:1.4rem }
.hd-read>ul>li,.hd-read>ol>li{ margin:0 0 .8rem; padding-left:.25rem }
.hd-read>ol>li::marker{ font-weight:600; color:var(--ink-2) }
.hd-read>ul>li::marker{ color:var(--ink-2) }
/* a one-decision form in the column (consent): box, its error, the closing line, the button, the wait line */
.hd-read>form:not(.hd-choice)>*+*{ margin-top:var(--space-4) }
.hd-read>form:not(.hd-choice)>.hd-error{ margin-top:.5rem }

/* two choices of exactly equal weight (RUL-0306-A): one class for both buttons, equal columns,
   same height; side by side at every width so neither is "the first one down the page" */
.hd-choice{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3); max-width:26rem; margin:0 }
.hd-choice>.hd-btn{ width:100%; padding-inline:.6rem; text-align:center; line-height:1.2 }

/* a wait line shown after a long press: spinner + sentence; [hidden] must still win */
.hd .hd-wait{ display:flex; gap:.6rem; align-items:center; margin:var(--space-3) 0 0; font-size:var(--fs-small); color:var(--ink) }
.hd .hd-wait[hidden],.hd-status[hidden]{ display:none }
.hd-wait>.hd-spin{ flex:none }

/* a status block that holds more than one sentence and a form (documents page) */
.hd-status>.hd-stack{ min-width:0 }

/* a short list of documents in reading order: name, one line, its download */
.hd-docs{ list-style:none; margin:var(--space-4) 0 0; padding:0; display:grid; gap:var(--space-3); max-width:48rem }
.hd-doc{ background:var(--paper-3); border:1px solid var(--rule); border-radius:var(--radius); padding:1.1rem 1.2rem;
  display:grid; gap:.4rem 1.5rem; align-items:center }
.hd-doc h2{ font-size:var(--fs-h3); font-weight:500; margin:0 }
.hd-doc p{ margin:0; color:var(--ink-2) }
.hd-doc .hd-btn{ justify-self:start; margin-top:.4rem }
@media (min-width:640px){
  .hd-doc{ grid-template-columns:minmax(0,1fr) auto }
  .hd-doc h2,.hd-doc p{ grid-column:1 }
  .hd-doc .hd-btn{ grid-column:2; grid-row:1 / span 2; margin-top:0 }
}

/* compat alias: markup pinned by DocumentsIndexCopyTest keeps class="sr-only"; same declarations as
   the page's own rule today (clip-path form, GATE-20261006-213 P13). Only ever used inside body.hd. */
.hd .sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); clip-path:inset(50%); white-space:nowrap; border:0 }
