/* ============================================================================
   DIATRAKR - sheet.css
   One world: the clinical treatment record. A sheet of print stock on a desk,
   ruled hairline columns, tabular figures, two spot inks, no glass.
   Type: Archivo (letterhead/headings), Spline Sans (prose), Spline Sans Mono
   (every numeral, unit and field label).
   ========================================================================= */

/* --- faces ---------------------------------------------------------------- */
@font-face{font-family:"Archivo";src:url("../fonts/archivo-latin.woff2?v=15") format("woff2-variations");
  font-weight:400 700;font-stretch:62% 125%;font-style:normal;font-display:swap;font-named-instance:auto;}
@font-face{font-family:"Spline Sans";src:url("../fonts/spline-sans-latin.woff2?v=15") format("woff2-variations");
  font-weight:400 700;font-style:normal;font-display:swap;}
@font-face{font-family:"Spline Sans Mono";src:url("../fonts/spline-sans-mono-latin.woff2?v=15") format("woff2-variations");
  font-weight:400 700;font-style:normal;font-display:swap;}

/* --- tokens --------------------------------------------------------------- */
:root{
  color-scheme:light;
  --desk:#E4E6E2;
  --sheet:#FCFCFA;
  --sheet-2:#F4F5F2;
  --sheet-3:#EDEFEA;
  --ink:#14181D;
  --ink-2:#566069;
  --ink-3:#6B747D;
  --rule:#C9CFD6;
  --rule-2:#DDE2E6;
  --rule-strong:#98A2AB;
  --spot:#0B6B4F;
  --spot-hi:#08563F;
  --spot-tint:#E6F0EB;
  --on-spot:#FCFCFA;
  --signal:#A8281E;
  --signal-tint:#F8E9E6;
  --focus:#14181D;
  --mark-open:#FCFCFA;
  --sheet-edge:0 1px 0 rgba(20,24,29,.05), 0 20px 44px -32px rgba(20,24,29,.42);
  --sticky-edge:0 1px 0 rgba(20,24,29,.07);

  --f-display:"Archivo","Helvetica Neue",Helvetica,Arial,sans-serif;
  --f-prose:"Spline Sans","Segoe UI",system-ui,-apple-system,sans-serif;
  --f-fig:"Spline Sans Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;

  --step--1:0.8125rem;
  --step-0:1rem;
  --step-1:1.1875rem;
  --step-2:1.5rem;
  --step-3:2rem;
  --step-4:clamp(2.1rem,5.2vw,3.4rem);
  --step-5:clamp(2.6rem,7vw,4.6rem);

  --gut:clamp(1rem,3.2vw,2.25rem);
  --measure:68ch;
  --rad:2px;
  --page:78rem;
}

@media (prefers-color-scheme:dark){
  /* no explicit choice stored: follow the system. The :not() is what lets an
     explicit light choice survive on a dark machine. */
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --desk:#0E1116;
    --sheet:#14181D;
    --sheet-2:#1B2027;
    --sheet-3:#20262E;
    --ink:#EDEFEC;
    --ink-2:#A7B0B8;
    --ink-3:#9BA4AC;
    --rule:#333C45;
    --rule-2:#2A323A;
    --rule-strong:#54606B;
    --spot:#4FBF95;
    --spot-hi:#6FD2AC;
    --spot-tint:#16241E;
    --on-spot:#0A1F17;
    --signal:#E8837A;
    --signal-tint:#2A1917;
    --focus:#EDEFEC;
    --mark-open:#14181D;
    --sheet-edge:0 1px 0 rgba(0,0,0,.4), 0 24px 50px -34px rgba(0,0,0,.9);
    --sticky-edge:0 1px 0 rgba(255,255,255,.06);
  }
}

/* The reader's own choice, set by the toggle in the header. Same values as the
   media query above: that block is what a visitor without JavaScript still gets,
   and it cannot be shared with a selector list, so the palette appears twice on
   purpose. This rule wins over :root (two class-level selectors against one), so
   an explicit choice always beats the operating system. */
:root[data-theme="dark"]{
  color-scheme:dark;
    --desk:#0E1116;
    --sheet:#14181D;
    --sheet-2:#1B2027;
    --sheet-3:#20262E;
    --ink:#EDEFEC;
    --ink-2:#A7B0B8;
    --ink-3:#9BA4AC;
    --rule:#333C45;
    --rule-2:#2A323A;
    --rule-strong:#54606B;
    --spot:#4FBF95;
    --spot-hi:#6FD2AC;
    --spot-tint:#16241E;
    --on-spot:#0A1F17;
    --signal:#E8837A;
    --signal-tint:#2A1917;
    --focus:#EDEFEC;
    --mark-open:#14181D;
    --sheet-edge:0 1px 0 rgba(0,0,0,.4), 0 24px 50px -34px rgba(0,0,0,.9);
    --sticky-edge:0 1px 0 rgba(255,255,255,.06);
}

/* --- the colour-scheme toggle -------------------------------------------- */
/* Hidden until the head script has run: without JavaScript the control would do
   nothing, and the system preference still drives the palette on its own. */
.theme-toggle{
  display:none;align-items:center;justify-content:center;
  width:40px;height:40px;margin-left:.15rem;padding:0;
  background:transparent;border:1px solid transparent;border-radius:var(--rad);
  color:var(--ink-2);cursor:pointer;
  transition:color .16s ease-out,background-color .16s ease-out;
}
html.theme-js .theme-toggle{display:inline-flex;}
.theme-toggle:hover{color:var(--ink);background:var(--sheet-2);}
.theme-toggle svg{width:17px;height:17px;}
.theme-toggle .i-moon{display:block;}
.theme-toggle .i-sun{display:none;}
/* the icon shows the scheme you would switch to */
:root[data-theme="dark"] .theme-toggle .i-moon{display:none;}
:root[data-theme="dark"] .theme-toggle .i-sun{display:block;}

/* --- base ----------------------------------------------------------------- */
*,*::before,*::after{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body{
  margin:0;
  background:var(--desk);
  color:var(--ink);
  font-family:var(--f-prose);
  font-size:var(--step-0);
  line-height:1.62;
  font-weight:400;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}
img,svg{max-width:100%;height:auto;display:block;}
h1,h2,h3,h4{
  font-family:var(--f-display);
  font-stretch:94%;
  font-variation-settings:"wdth" 94;
  font-weight:620;
  line-height:1.03;
  letter-spacing:-0.022em;
  margin:0;
  text-wrap:balance;
  color:var(--ink);
}
h1{font-size:var(--step-5);}
h2{font-size:var(--step-4);}
h3{font-size:var(--step-2);line-height:1.12;letter-spacing:-0.014em;}
h4{font-size:var(--step-1);line-height:1.2;letter-spacing:-0.008em;}
p{margin:0 0 .9em;max-width:var(--measure);text-wrap:pretty;}
p:last-child{margin-bottom:0;}
a{color:var(--spot);text-underline-offset:.22em;text-decoration-thickness:1px;}
a:hover{color:var(--spot-hi);}
strong{font-weight:620;}
hr{border:0;border-top:1px solid var(--rule);margin:2rem 0;}

/* --- browser surfaces: the parts we did not draw -------------------------- */
::selection{background:var(--spot);color:var(--on-spot);}
:root{caret-color:var(--spot);}
*{scrollbar-color:var(--rule-strong) transparent;scrollbar-width:thin;}
::-webkit-scrollbar{width:11px;height:11px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(--rule-strong);border:3px solid var(--sheet);border-radius:6px;}
::-webkit-scrollbar-thumb:hover{background:var(--ink-3);}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:2px solid var(--focus);
  outline-offset:2px;
  border-radius:var(--rad);
}
input,textarea,select{font:inherit;color:inherit;}

.skip{
  position:absolute;left:-999px;top:0;z-index:99;
  background:var(--sheet);color:var(--ink);border:1px solid var(--ink);
  padding:.6rem 1rem;font-family:var(--f-fig);font-size:var(--step--1);
}
.skip:focus{left:.5rem;top:.5rem;}
.vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;}

/* --- the sheet ------------------------------------------------------------ */
.sheet{
  background:var(--sheet);
  border:1px solid var(--rule);
  border-radius:var(--rad);
  box-shadow:var(--sheet-edge);
}
.wrap{width:100%;max-width:var(--page);margin-inline:auto;padding-inline:var(--gut);}

/* letterhead band */
.head{
  position:sticky;top:0;z-index:20;
  background:var(--sheet);
  border-bottom:1px solid var(--ink);
  box-shadow:var(--sticky-edge);
}
.head-in{
  display:grid;grid-template-columns:auto 1fr;align-items:center;
  gap:.35rem clamp(.8rem,2.4vw,1.6rem);
  padding-block:.6rem;
}
.head-nav{justify-self:end;display:flex;flex-wrap:wrap;align-items:center;gap:.15rem;}
.wordmark{
  font-family:var(--f-display);font-stretch:88%;font-variation-settings:"wdth" 88;
  font-weight:660;font-size:1.3rem;letter-spacing:.03em;line-height:1;
  color:var(--ink);text-decoration:none;
}
.wordmark:hover{color:var(--ink);}
.head-nav a{
  display:inline-flex;align-items:center;min-height:40px;
  font-family:var(--f-fig);font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;
  color:var(--ink-2);text-decoration:none;padding:.5rem .6rem;border-radius:var(--rad);
  white-space:nowrap;
}
.head-nav a:hover{color:var(--ink);background:var(--sheet-2);}
/* the page you are on: the header is shared, so the marker is too */
.head-nav a{border-bottom:1px solid transparent;}
.head-nav a[aria-current="page"]{color:var(--ink);border-bottom-color:var(--spot);}
.share-url { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  margin: .3rem 0 .6rem; }
.share-url .in { flex: 1 1 14rem; min-width: 0;
  font-family: var(--f-fig); font-size: .8rem; }
@media (max-width:640px){
  .head-in{grid-template-columns:1fr;}
  /* the three in-page links are duplicated in the footer and a phone scrolls
     anyway; dropping them keeps the header to one row and the CTA higher up */
  .head-nav a[href^="#"]{display:none;}
  .head-nav{justify-self:stretch;border-top:1px solid var(--rule-2);padding-top:.4rem;margin-top:.1rem;}
}

/* ruled band: section header. The heading carries itself; no eyebrow. */
.band{
  display:flex;align-items:baseline;justify-content:space-between;gap:1rem;
  border-bottom:1px solid var(--ink);padding:.55rem 0;margin-bottom:1.5rem;
}
.band h2,.band h3{margin:0;}
.band .sheet-mark{
  font-family:var(--f-fig);font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--ink-2);text-align:right;
}
.band-rule{border-bottom:1px solid var(--rule-2);padding:.5rem 0;margin-bottom:1.25rem;}
/* a band that opens a block partway down a page, and a band whose heading is
   a section heading rather than a document one. Both were inline styles. */
.band--gap{margin-top:2.5rem;}
.h-sub{font-size:var(--step-2);}
/* question list: the control is the summary row, so the glyph is decoration */
.faq-q{cursor:pointer;font-family:var(--f-display);font-stretch:96%;
  font-size:1.05rem;font-weight:560;list-style:none;}
.faq-plus{color:var(--spot);margin-right:.5rem;display:inline-block;
  transition:transform .18s ease-out;}
details[open] .faq-plus{transform:rotate(45deg);}
.faq-a{margin-top:.6rem;}

/* field label: data label on the sheet, never an eyebrow over a heading */
.lbl{
  font-family:var(--f-fig);font-size:.7rem;letter-spacing:.13em;text-transform:uppercase;
  color:var(--ink-2);font-weight:500;
}
.fig{
  font-family:var(--f-fig);font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1,"zero" 0;letter-spacing:-0.01em;
}
.unit{font-size:.82em;color:var(--ink-2);margin-left:.12em;}

/* perforation */
.perf{
  height:1px;border:0;margin:2.5rem 0;
  background-image:repeating-linear-gradient(to right,var(--rule-strong) 0 6px,transparent 6px 12px);
}

/* stamp: an outline notice, part of the form's own language */
.stamp{
  display:inline-block;border:1px solid var(--ink-2);color:var(--ink-2);
  font-family:var(--f-fig);font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;
  padding:.22rem .5rem;border-radius:var(--rad);
}
.stamp--spot{border-color:var(--spot);color:var(--spot);}

/* Example blocks. Every block on the landing page that shows made-up figures
   carries a stamp, so none of it can be read as the reader's own record. */
.ex-head{display:flex;justify-content:flex-end;margin-bottom:.55rem;}
.report-head .rh-row{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;}

/* --- controls ------------------------------------------------------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  min-height:44px;padding:.6rem 1.1rem;
  font-family:var(--f-fig);font-size:.8rem;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;
  background:var(--spot);color:var(--on-spot);border:1px solid var(--spot);
  border-radius:var(--rad);text-decoration:none;cursor:pointer;
  transition:background-color .16s ease-out,border-color .16s ease-out,color .16s ease-out;
}
.btn:hover{background:var(--spot-hi);border-color:var(--spot-hi);color:var(--on-spot);}
.btn:active{transform:translateY(1px);}
.btn--quiet{background:transparent;color:var(--ink);border-color:var(--rule-strong);}
.btn--quiet:hover{background:var(--sheet-2);color:var(--ink);border-color:var(--ink);}
.btn--danger{background:transparent;color:var(--signal);border-color:var(--signal);}
.btn--danger:hover{background:var(--signal);color:var(--sheet);border-color:var(--signal);}
.btn[disabled],.btn[aria-disabled="true"]{
  background:var(--sheet-3);border-color:var(--rule);color:var(--ink-3);cursor:not-allowed;
}
.btn--sm{min-height:34px;padding:.32rem .6rem;font-size:.7rem;}
.btn--wide{width:100%;}

/* Flex column with the control pushed to the bottom: in a grid row every field
   stretches to the same height, so a label that wraps to two lines pushes ITS
   box down and leaves its neighbours' boxes 18px higher. Pushing the control to
   the bottom of the box lines every control in a row up, whatever the label
   does. (Seen on "on treatment", where "blood flow rate ml/min" wraps but
   "duration min" does not.) */
.field{display:flex;flex-direction:column;margin-bottom:1rem;}
.field>.lbl{display:block;margin-bottom:.3rem;}
.field>.in,.field>.sel,.field>.ta{margin-top:auto;}
.in,.sel,.ta{
  width:100%;min-height:44px;padding:.5rem .6rem;
  background:var(--sheet);color:var(--ink);
  border:1px solid var(--rule-strong);border-radius:var(--rad);
  font-family:var(--f-fig);font-variant-numeric:tabular-nums;
  transition:border-color .14s ease-out,box-shadow .14s ease-out;
}
.ta{min-height:6rem;font-family:var(--f-prose);font-variant-numeric:normal;line-height:1.55;resize:vertical;}
.in::placeholder,.ta::placeholder{color:var(--ink-3);opacity:1;}
.in:hover,.sel:hover,.ta:hover{border-color:var(--ink-3);}
.in:focus-visible,.sel:focus-visible,.ta:focus-visible{outline:2px solid var(--focus);outline-offset:1px;}
.in[aria-invalid="true"]{border-color:var(--signal);box-shadow:inset 0 0 0 1px var(--signal);}
.hint{
  display:block;margin-top:.28rem;font-size:.78rem;color:var(--ink-2);
  font-family:var(--f-prose);
}
.hint--bad{color:var(--signal);font-weight:500;}
.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));gap:0 1.1rem;}
.grid-3{display:grid;grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));gap:0 1.1rem;}

/* a half-typed form was put back: say so, and offer a blank one */
.restore{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem;
  border:1px solid var(--rule);border-left:3px solid var(--ink-2);background:var(--sheet-2);
  padding:.6rem .8rem;margin-bottom:1.2rem;font-size:.92rem;}

/* switch: a ticked cell, not a toggle pill */
.check{display:flex;align-items:flex-start;gap:.55rem;min-height:44px;padding:.45rem 0;cursor:pointer;}
.check input{
  appearance:none;-webkit-appearance:none;flex:0 0 auto;
  width:20px;height:20px;margin:.18rem 0 0;background:var(--sheet);
  border:1px solid var(--rule-strong);border-radius:var(--rad);cursor:pointer;
}
.check input:checked{background:var(--spot);border-color:var(--spot);}
.check input:checked::after{
  content:"";display:block;width:11px;height:6px;margin:5px 0 0 3px;
  border-left:2px solid var(--on-spot);border-bottom:2px solid var(--on-spot);
  transform:rotate(-45deg);
}
.check input:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}
.check span{font-size:.94rem;line-height:1.4;}

/* index rail: sheet tabs */
.rail{display:flex;flex-wrap:wrap;gap:0;border-bottom:1px solid var(--ink);}
.rail button{
  appearance:none;background:transparent;border:0;border-right:1px solid var(--rule);
  font-family:var(--f-fig);font-size:.72rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--ink-2);padding:.6rem .85rem;min-height:40px;cursor:pointer;
}
.rail button:hover{background:var(--sheet-2);color:var(--ink);}
.rail button[aria-pressed="true"]{
  background:var(--ink);color:var(--sheet);border-right-color:var(--ink);
}

/* --- the record table ----------------------------------------------------- */
.rec{width:100%;border-collapse:collapse;font-size:.9rem;}
.rec caption{
  caption-side:top;text-align:left;padding-bottom:.5rem;
  font-family:var(--f-fig);font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--ink-2);
}
.rec th,.rec td{
  text-align:right;padding:.42rem .5rem;border-bottom:1px solid var(--rule-2);
  vertical-align:baseline;
}
.rec thead th{
  border-bottom:1px solid var(--ink);border-top:1px solid var(--ink);
  font-family:var(--f-fig);font-size:.66rem;font-weight:500;letter-spacing:.09em;
  text-transform:uppercase;color:var(--ink-2);white-space:nowrap;padding-block:.4rem;
}
.rec th:first-child,.rec td:first-child{text-align:left;}
.rec td[colspan]{text-align:left;font-family:var(--f-prose);color:var(--ink-2);}
.rec tbody td{font-family:var(--f-fig);font-variant-numeric:tabular-nums;}
.rec tbody tr:hover{background:var(--sheet-2);}
.rec .date{white-space:nowrap;color:var(--ink);}
.rec .pv{display:inline-block;min-width:3.7ch;text-align:right;}
.rec .gain{
  display:inline-block;min-width:4.9ch;text-align:right;
  font-size:.86em;letter-spacing:.02em;color:var(--ink-2);
}
.rec .dash{color:var(--ink-3);}
.rec .over{color:var(--signal);font-weight:500;}
.rec .derived{background:var(--spot-tint);}
.rec tbody tr.is-absent{background:var(--sheet-2);}
.rec tbody tr.is-absent td{
  border-bottom:1px dashed var(--rule-strong);padding-top:.5rem;padding-bottom:.5rem;
}
.rec tbody tr.is-absent:hover{background:var(--sheet-2);}
/* state marker: ink weight plus a filled or open mark, so it survives greyscale */
.mark{display:inline-block;width:8px;height:8px;border:1px solid var(--ink-2);
  border-radius:50%;margin-right:.35em;vertical-align:middle;}
.mark.is-in{background:var(--spot);border-color:var(--spot);}
.mark.is-drift{background:var(--mark-open);border-color:var(--ink-2);}
.mark.is-out{background:var(--signal);border-color:var(--signal);}
.rec-wrap{overflow-x:auto;}

@media (max-width:660px){
  .rec thead{display:none;}
  .rec,.rec tbody,.rec tr,.rec td{display:block;width:100%;}
  .rec tr{border-top:2px solid var(--ink);padding:.4rem 0 .6rem;margin-bottom:.9rem;}
  .rec tr:first-child{border-top:0;}
  .rec td{
    display:grid;grid-template-columns:8.5rem 1fr;gap:.5rem;text-align:left;
    border-bottom:0;padding:.2rem .1rem;
  }
  .rec td::before{
    content:attr(data-l);
    font-family:var(--f-fig);font-size:.66rem;letter-spacing:.09em;
    text-transform:uppercase;color:var(--ink-2);padding-top:.15rem;
  }
  .rec td.date{font-family:var(--f-prose);font-weight:620;}
  .rec td.date::before{content:none;}
  /* A cell with no data-l has no label to show. content:none alone was not
     enough: the ::before still existed as a grid item and reserved its 8.5rem
     column, so on a phone the label AND the value both started 136px in, behind
     a dead gutter. That is what "the Your targets box is misaligned" was.
     Key/value tables get label-left, value-right; list-shaped tables just use
     the full width. */
  .rec td:not([data-l]){display:block;}
  .rec td:not([data-l])::before{content:none;}
  /* The label and the value are two separate cells, so the flex has to be on the
     ROW: on the cell it just left-aligns each on its own line. width:auto is
     needed because the base rule above sets every .rec cell to width:100%. */
  .rec--kv tr{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;
    border-top:1px solid var(--rule);margin-bottom:0;padding:.5rem .1rem;}
  .rec--kv tr:first-child{border-top:0;}
  .rec--kv td{width:auto;}
  .rec--kv td:not([data-l])::before{content:none;}
  .rec tr.is-absent td[colspan]{display:block;padding-left:.1rem;font-style:normal;}
  .rec caption{font-size:.64rem;letter-spacing:.07em;}
  .rec tbody tr:hover{background:transparent;}
}

/* --- landing: the first viewport is one document -------------------------- */
.hero{padding-block:clamp(1.5rem,4vw,3rem);}
.hero-sheet{overflow:hidden;}
.hero-band{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:"id mark" "title title";
  gap:.5rem 2rem;align-items:baseline;
  padding:clamp(1rem,3vw,1.7rem) clamp(1rem,3vw,1.9rem);
  border-bottom:1px solid var(--ink);
}
.band-id{grid-area:id;display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem .7rem;}
.wordmark-sm{
  font-family:var(--f-display);font-stretch:88%;font-variation-settings:"wdth" 88;
  font-weight:660;font-size:1.05rem;letter-spacing:.04em;line-height:1;
}
.doc-title{
  font-family:var(--f-fig);font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--ink-2);border-left:1px solid var(--rule);padding-left:.7rem;
}
.hero-band .sheet-mark{grid-area:mark;}
/* 28ch, not 24: a 34-character headline fits one line at this measure, and 24 forced
   it onto two with "the" stranded at the end of the first. Still a guard rail for
   longer copy, which wraps rather than running the width of the card. */
.hero-band h1{grid-area:title;font-size:clamp(1.9rem,5vw,3.5rem);max-width:28ch;padding-top:.35rem;}
.hero-band .sheet-mark{text-align:right;line-height:1.5;}
.hero-body{display:grid;grid-template-columns:minmax(0,4.6fr) minmax(0,7.4fr);}
/* the claim is deliberately short; centre it against the record rather than
   leaving the space stranded under the buttons. In a single-column layout the
   cell is content-height, so this is a no-op on a phone. */
.hero-claim{padding:clamp(1rem,3vw,1.9rem);border-right:1px solid var(--rule);
  display:flex;flex-direction:column;justify-content:center;}
.hero-record{
  padding:clamp(1rem,3vw,1.9rem);min-width:0;
  display:flex;flex-direction:column;
}
@media (max-width:900px){
  /* headline before the small print: on a phone the h1 is the point */
  .hero-band{grid-template-columns:1fr;grid-template-areas:"id" "title" "mark";}
  .hero-band .sheet-mark{text-align:left;}
  .hero-body{grid-template-columns:1fr;}
  .hero-claim{border-right:0;border-bottom:1px solid var(--rule);}
}
.lede{font-size:var(--step-1);color:var(--ink-2);max-width:34ch;}
.lede b{color:var(--ink);font-weight:620;}

/* at a glance: the four facts, in one pass, just below the first viewport */
.glance{padding-block:clamp(1.4rem,3.5vw,2.4rem);}
.glance-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1px;margin:0;background:var(--rule);
  border:1px solid var(--rule);border-radius:var(--rad);overflow:hidden;
}
.glance-grid>div{background:var(--sheet);padding:clamp(.75rem,1.7vw,1.05rem);}
.glance-grid dt{
  font-family:var(--f-fig);font-size:.68rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--ink-2);margin-bottom:.35rem;
}
.glance-grid dd{margin:0;font-size:.92rem;line-height:1.5;text-wrap:pretty;}
@media (max-width:900px){.glance-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:520px){.glance-grid{grid-template-columns:1fr;}}


.act{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin:1.5rem 0 .9rem;}
.aside-note{font-size:.85rem;color:var(--ink-2);max-width:36ch;text-wrap:pretty;}

.rail-note{margin-left:auto;align-self:center;padding-left:.8rem;white-space:nowrap;}
.legend{
  display:flex;flex-wrap:wrap;gap:.25rem 1.1rem;align-items:center;
  padding:.5rem 0;border-bottom:1px solid var(--rule);margin-bottom:.7rem;
}
.legend span{
  display:inline-flex;align-items:center;font-size:.78rem;color:var(--ink-2);
}
.legend .mark{margin-right:.4em;}
.legend-note{font-family:var(--f-fig);font-size:.72rem;letter-spacing:.03em;}
.rec tr.is-absent td[colspan]>span{
  display:inline-block;font-family:var(--f-fig);font-size:.68rem;letter-spacing:.13em;
  text-transform:uppercase;color:var(--ink-2);
  border-bottom:1px dashed var(--rule-strong);padding:0 .35rem .18rem;
}

.sample-foot{
  display:flex;justify-content:space-between;gap:.5rem 1rem;flex-wrap:wrap;
  padding:.6rem clamp(1rem,3vw,1.9rem);
  border-top:1px dashed var(--rule-strong);
  font-family:var(--f-fig);font-size:.7rem;letter-spacing:.07em;color:var(--ink-2);
}
.sample-foot .r{text-align:right;}

.calc{
  margin-top:.9rem;border:1px solid var(--rule);border-radius:var(--rad);
  background:var(--sheet-2);padding:.7rem .8rem;
}
.calc .l{font-family:var(--f-fig);font-size:.68rem;letter-spacing:.11em;
  text-transform:uppercase;color:var(--ink-2);margin-bottom:.35rem;}
.calc-line{
  font-family:var(--f-fig);font-variant-numeric:tabular-nums;font-size:.86rem;
  display:flex;flex-wrap:wrap;gap:.4rem;align-items:baseline;padding:.16rem 0;
}
.calc-line .op{color:var(--ink-2);}
.calc-line .res{color:var(--spot);font-weight:620;}

/* sections */
.sec{padding-block:clamp(2.5rem,7vw,5rem);}
.sec + .sec{border-top:1px solid var(--rule);}
.sec-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.55fr);
  gap:clamp(1.5rem,4vw,3rem);align-items:start;}
@media (max-width:900px){.sec-grid{grid-template-columns:1fr;}}

.logsheet{display:grid;grid-template-columns:repeat(auto-fit,minmax(13rem,1fr));gap:0;}
.logcol{border-left:1px solid var(--rule);padding:0 1rem .5rem;}
.logcol:first-child{border-left:0;padding-left:0;}
.logcol h4{padding-bottom:.45rem;border-bottom:1px solid var(--ink);margin-bottom:.6rem;
  font-family:var(--f-fig);font-size:.72rem;font-weight:500;letter-spacing:.12em;
  text-transform:uppercase;color:var(--ink);font-stretch:100%;}
.flist{list-style:none;margin:0;padding:0;}
.flist li{
  display:flex;justify-content:space-between;gap:.6rem;align-items:baseline;
  padding:.3rem 0;border-bottom:1px solid var(--rule-2);font-size:.9rem;
}
.flist .n{font-family:var(--f-fig);font-variant-numeric:tabular-nums;color:var(--ink);}
.flist .u{color:var(--ink-2);font-size:.8rem;font-family:var(--f-fig);}

/* the sent report preview */
.report{border:1px solid var(--rule);border-radius:var(--rad);overflow:hidden;}
.report-head{padding:.8rem 1rem;border-bottom:1px solid var(--ink);}
.report-head .rh-t{font-family:var(--f-fig);font-size:.7rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--ink-2);}
.report-head .rh-n{font-family:var(--f-display);font-stretch:92%;font-variation-settings:"wdth" 92;
  font-size:1.15rem;font-weight:620;letter-spacing:-0.01em;}
.report-sum{display:grid;grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));gap:0;
  border-bottom:1px solid var(--ink);}
.report-sum div{padding:.6rem .9rem;border-left:1px solid var(--rule-2);}
.report-sum div:first-child{border-left:0;}
.report-sum .l{font-family:var(--f-fig);font-size:.62rem;letter-spacing:.11em;
  text-transform:uppercase;color:var(--ink-2);display:block;}
.report-sum .n{font-family:var(--f-fig);font-variant-numeric:tabular-nums;
  font-size:1.05rem;font-weight:500;}
.report-body{padding:.3rem .6rem .8rem;}
.report-foot{padding:.6rem 1rem;border-top:1px dashed var(--rule-strong);
  font-family:var(--f-fig);font-size:.68rem;letter-spacing:.06em;color:var(--ink-2);}

/* architecture: your phone, your server, your unit */
.flow{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
  border-top:1px solid var(--ink);border-bottom:1px solid var(--ink);}
.flow div{padding:1rem;border-left:1px solid var(--rule);}
.flow div:first-child{border-left:0;}
.flow .l{font-family:var(--f-fig);font-size:.66rem;letter-spacing:.12em;
  text-transform:uppercase;color:var(--ink-2);display:block;margin-bottom:.4rem;}
.flow p{font-size:.92rem;margin:0;}
.flow .no{color:var(--signal);font-weight:620;}

/* closing */
.close-block{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2rem;align-items:end;}
@media (max-width:760px){.close-block{grid-template-columns:1fr;align-items:start;}}

/* footer */
.foot{border-top:1px solid var(--ink);background:var(--sheet);}
.foot-in{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
  gap:1.5rem;padding-block:2rem;}
.foot h4{font-family:var(--f-fig);font-size:.68rem;font-weight:500;letter-spacing:.12em;
  text-transform:uppercase;color:var(--ink-2);margin-bottom:.6rem;}
.foot ul{list-style:none;margin:0;padding:0;}
.foot li{margin-bottom:.3rem;}
.foot a{font-size:.88rem;color:var(--ink);text-decoration:none;border-bottom:1px solid var(--rule);}
.foot a:hover{border-bottom-color:var(--spot);color:var(--spot);}
.foot-legal{border-top:1px solid var(--rule);padding-block:1rem;
  display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  font-family:var(--f-fig);font-size:.68rem;letter-spacing:.07em;color:var(--ink-2);}

/* --- motion: one authored moment ------------------------------------------ */
.print-in{opacity:1;}
html.js .print-in{opacity:0;}
html.js .print-in.is-printed{animation:printin .62s cubic-bezier(.16,1,.3,1) forwards;}
@keyframes printin{from{opacity:0;clip-path:inset(0 0 100% 0);}to{opacity:1;clip-path:inset(0 0 -1px 0);}}
html.js .rec tbody tr{opacity:0;}
html.js .rec tbody tr.is-printed{animation:rowin .42s cubic-bezier(.16,1,.3,1) forwards;}
@keyframes rowin{from{opacity:0;clip-path:inset(0 100% 0 0);}to{opacity:1;clip-path:inset(0 -1px 0 0);}}
html.js .draw{stroke-dasharray:var(--len,200);stroke-dashoffset:var(--len,200);}
html.js .draw.is-printed{animation:draw .9s cubic-bezier(.16,1,.3,1) forwards;}
@keyframes draw{to{stroke-dashoffset:0;}}
html.js .tick{transition:color .2s ease-out;}

@media (prefers-reduced-motion:reduce){
  html.js .print-in,html.js .rec tbody tr,html.js .draw{
    animation:none!important;opacity:1!important;clip-path:none!important;stroke-dashoffset:0!important;
  }
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;
    transition-duration:.001ms!important;scroll-behavior:auto!important;}
}

/* --- app shell ------------------------------------------------------------ */
.app-frame{display:grid;grid-template-columns:15.5rem minmax(0,1fr);gap:0;
  max-width:var(--page);margin-inline:auto;min-height:100vh;background:var(--sheet);
  border-inline:1px solid var(--rule);}
@media (max-width:880px){.app-frame{grid-template-columns:1fr;border-inline:0;}}
.app-nav{border-right:1px solid var(--rule);padding:1.1rem .9rem 2rem;background:var(--sheet);}
@media (max-width:880px){.app-nav{border-right:0;border-bottom:1px solid var(--ink);}}
.app-nav ul{list-style:none;margin:0 0 1.2rem;padding:0;}
.app-nav a{
  display:block;padding:.55rem .6rem;min-height:40px;text-decoration:none;color:var(--ink);
  font-family:var(--f-fig);font-size:.76rem;letter-spacing:.08em;text-transform:uppercase;
  border-bottom:1px solid var(--rule-2);border-radius:var(--rad);
}
.app-nav a:hover{background:var(--sheet-2);}
.app-nav a[aria-current="page"]{background:var(--ink);color:var(--sheet);border-bottom-color:var(--ink);}
.app-main{padding:1.4rem clamp(1rem,3vw,2rem) 4rem;min-width:0;}
.app-title{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;
  border-bottom:1px solid var(--ink);padding-bottom:.5rem;margin-bottom:1.25rem;}
.panel{border:1px solid var(--rule);border-radius:var(--rad);background:var(--sheet);margin-bottom:1.5rem;}
.panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;
  padding:.6rem .9rem;border-bottom:1px solid var(--ink);background:var(--sheet-2);}
.panel-head h3{font-family:var(--f-fig);font-size:.74rem;font-weight:500;letter-spacing:.12em;
  text-transform:uppercase;font-stretch:100%;font-variation-settings:normal;}
.panel-body{padding:.9rem;}
.fs{padding:1rem;border:1px solid var(--rule);border-radius:var(--rad);}
.empty{border:1px dashed var(--rule-strong);border-radius:var(--rad);padding:1.2rem;
  text-align:center;color:var(--ink-2);}
.empty .l{font-family:var(--f-fig);font-size:.7rem;letter-spacing:.12em;
  text-transform:uppercase;display:block;margin-bottom:.4rem;}
.toast{
  position:fixed;left:50%;bottom:1.2rem;transform:translateX(-50%);z-index:60;
  background:var(--ink);color:var(--sheet);border-radius:var(--rad);
  padding:.6rem 1rem;font-family:var(--f-fig);font-size:.78rem;letter-spacing:.04em;
  box-shadow:0 14px 30px -18px rgba(0,0,0,.7);max-width:min(92vw,32rem);
}
.toast[hidden]{display:none;}
.toast.is-bad{background:var(--signal);color:var(--sheet);}
.toast.is-good{background:var(--spot);color:var(--on-spot);}
.auth-wrap{max-width:27rem;margin:clamp(1.5rem,6vw,4.5rem) auto;padding-inline:var(--gut);}
.auth-tabs{display:flex;border-bottom:1px solid var(--ink);}
.auth-tabs button{
  appearance:none;background:transparent;border:0;border-right:1px solid var(--rule);
  min-height:44px;padding:.6rem .9rem;cursor:pointer;
  font-family:var(--f-fig);font-size:.74rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--ink-2);
}
.auth-tabs button[aria-selected="true"]{background:var(--ink);color:var(--sheet);}
.auth-tabs button:hover{color:var(--ink);}
.auth-tabs button[aria-selected="true"]:hover{color:var(--sheet);}
.sig{display:flex;justify-content:space-between;gap:2rem;align-items:flex-end;
  border-top:1px solid var(--rule);margin-top:2rem;padding-top:.8rem;}
.sig .line{flex:1;border-bottom:1px solid var(--ink);height:1.6rem;}
.sig .lbl{display:block;margin-top:.25rem;}

/* --- print ---------------------------------------------------------------- */
@media print{
  :root{--sheet:#fff;--desk:#fff;--ink:#000;--rule:#999;--rule-2:#bbb;--ink-2:#333;}
  body{background:#fff;font-size:10.5pt;}
  .head,.app-nav,.no-print,.btn,.toast{display:none!important;}
  .rail button{display:none!important;}
  .sheet,.panel,.app-frame{border:0;box-shadow:none;max-width:none;margin:0;}
  .wrap{padding-inline:0;max-width:none;}
  .sec{padding-block:.8rem;}
  .rec{font-size:9pt;}
  .rec thead{display:table-header-group;}
  .rec tr{break-inside:avoid;}
  a{color:#000;text-decoration:none;}
  .report,.panel{break-inside:avoid;}
  @page{margin:14mm;}
}
