/* ═══ DEPTH (2026-11-17, Barry's brief, design lead's spec; third pass the same day: matched to Astra's rendering of Training).
   ONE layer, loaded LAST (after surface_roles.css) on the member app (scoped body.h3n), and on /clinic, /admin and /login
   (scoped body.dp-staff). Elevation is given BY ROLE: every first-level card class and every control class of the app is
   listed once below (cards in §3, controls in §6); a surface NESTED inside another card is opted OUT (border only). The audit
   (a script over every page and sheet at 390 / 820 / 1180 / 1440, light and dark) lists any first-level card or control whose
   computed box-shadow is "none": a new card or control class goes into these lists, or the audit names it.
   What it does, and what it never does:
   - the page: warm ivory with a very soft light from the top right and slightly deeper toward the lower left, drawn ONCE by a
     fixed layer behind everything (body::before, position:fixed, z-index:-1): it never scrolls, so it never repaints on scroll,
     and there is no image file and no background-attachment:fixed (iOS ignores it and repaints)
   - cards: their 1 px border, a crisp white top edge (inset highlight), a contact shadow and a wider, softer ambient one --el-card
   - the ONE lead card per page (the forest card): a gentle diagonal gradient (lighter top left, deeper bottom right, about 6%
     lightness span, drawn as an overlay so the card's own fill stays), a fine lighter inner ring, a deeper soft shadow --el-lead
   - controls (buttons, pills, chips, segments, the log row, the top-bar pills): a 1-2 px bottom shadow and a top highlight,
     a 2% vertical tone on the light pills (no gloss); pressed = down 1 px with an inset shadow; focus ring; disabled flat
   - inner tiles stay flat, except today's and the selected day in a week strip (control elevation)
   - no backdrop-filter, no glow, no heavy bevel, no shadow animation
   - layout untouched: only box-shadow, background-image, background-color of page frames (to transparent), outline and a press
     transform. Shadows, outlines and transforms take no layout space. Radii are not changed. ═══ */

/* ─── 1. Tokens ─── */
html:not([data-theme="dark"]){
  --el-ink:23,60,49;                                     /* forest ink, the shadow colour in light */
  /* sampled from Astra's rendering (2026-11-17, fourth pass) and matched point by point in a capture (depth4_colour_table.txt):
     page centre #EDEAE0, top centre #DAE2D6, top right #ECEEE4, lower left #EFEAE0; card face #FCF9F1-F3, card edge #C5C5BA;
     the lead #1E4836 at the top to #03291E at the bottom. The sage at the top of Training is the tab's own wash
     (#tab-fitness::before) over this page, so the page tokens are the warm ivory under it. */
  --el-page:#F1EDE3;                                     /* warm ivory page (gold text 4.76:1, muted ink 5.06:1) */
  --el-page-hi:#FAF8F1;                                  /* the light from the top right */
  --el-page-lo:#F2EDE3;                                  /* the lower left (the rendering is not deeper there) */
  --el-page-flat:#EFEBE1;                                /* the page as ONE colour: html's own fill, under the layer (iOS fallback) */
  --el-card-face:#FCF9F2;                                /* card face (rendering #FCF9F1 / #FCF9F3) */
  --el-card-edge:#C5C5BA;                                /* a neutral card's 1 px edge (rendering) */
  --el-card-border:#D9DFD1;                              /* sage-gray hairline (= --ln): nested tiles' ring */
  --el-tile-ring:inset 0 0 0 1px #D9DFD1;
  --el-dock:#F2EDE3;                                     /* the day column's sticky log row: page-lo 75% + page, precomputed (no color-mix) */
  --el-seg-on:#CFDCCC;                                   /* the chosen segment, pressed in (rendering #BCCDBC to #C7D5C5, under the 7% sunk overlay) */
  --el-hi:inset 0 1px 0 rgba(255,255,255,.9);            /* the crisp white top edge */
  --el-card:var(--el-hi),0 1px 2px rgba(var(--el-ink),.11),0 12px 30px rgba(var(--el-ink),.10);
  --el-card-ringed:inset 0 0 0 1px var(--el-card-border),var(--el-card);
  /* the lead: the rendering's forest, lighter at the top and deep at the bottom (over the fill), a fine lighter ring, a deeper soft shadow */
  --el-lead-grad:linear-gradient(180deg,#1E4836 0%,#083025 44%,#03291E 100%);   /* the rendering's lead, top to bottom: eyebrow #D0AA55 4.70:1 at the top */
  --el-lead:inset 0 1px 0 rgba(255,255,255,.10),inset 0 0 0 1px rgba(255,255,255,.16),0 3px 6px rgba(var(--el-ink),.16),0 18px 40px rgba(var(--el-ink),.16);
  --gold-text:#866218;                                   /* gold TEXT on light surfaces; #A67B22 stays for marks */
  --el-control:inset 0 1px 0 rgba(255,255,255,.85),0 1px 1px rgba(var(--el-ink),.16),0 2px 6px rgba(var(--el-ink),.12);
  --el-control-dk:inset 0 1px 0 rgba(255,255,255,.14),0 1px 1px rgba(var(--el-ink),.24),0 2px 5px rgba(var(--el-ink),.16);
  --el-control-on-dark:inset 0 1px 0 rgba(255,255,255,.6),0 1px 0 rgba(0,0,0,.24),0 2px 4px rgba(0,0,0,.18);
  --el-tone:linear-gradient(180deg,rgba(255,255,255,.3),rgba(134,98,24,.05));
  --el-group:inset 0 1px 0 rgba(255,255,255,.85),0 1px 2px rgba(var(--el-ink),.12),0 4px 10px rgba(var(--el-ink),.10);
  --el-pressed:inset 0 1px 2px rgba(var(--el-ink),.18);
  --el-sunk:inset 0 1px 3px rgba(var(--el-ink),.22),inset 0 0 0 1px rgba(var(--el-ink),.08);
  --el-sunk-fill:linear-gradient(rgba(var(--el-ink),.07),rgba(var(--el-ink),.07));
  --el-sheet:var(--el-hi),0 1px 3px rgba(var(--el-ink),.08),0 18px 44px rgba(var(--el-ink),.14);
  --el-sheet-up:var(--el-hi),0 -1px 3px rgba(var(--el-ink),.06),0 -12px 32px rgba(var(--el-ink),.10);
  --el-focus:#173C31;
  --ctl-fill:#F8EDDB;                                    /* outlined (secondary) controls: the rendering's log-button cream, ink 10.5:1 */
  --ctl-edge:#BCB6A3;                                    /* the rendering's tan line (1.93:1 on a #FCF9F2 card; see §7) */
}
html[data-theme="dark"]{
  --el-page:var(--sf-page,#131A17);
  --el-page-hi:#18211D;                                  /* the faint light, top right */
  --el-page-lo:#101613;                                  /* slightly deeper, lower left */
  --el-card-border:rgba(214,229,208,.12);
  --el-hi:inset 0 1px 0 rgba(255,255,255,.07);
  --el-card:var(--el-hi),0 1px 2px rgba(0,0,0,.45),0 12px 30px rgba(0,0,0,.50);
  --el-card-ringed:inset 0 0 0 1px var(--el-card-border),var(--el-card);
  --el-lead-grad:linear-gradient(135deg,rgba(0,0,0,0) 0%,rgba(0,0,0,.04) 45%,rgba(0,0,0,.18) 100%);
  --el-lead:inset 0 1px 0 rgba(255,255,255,.08),inset 0 0 0 1px rgba(241,239,231,.13),0 3px 6px rgba(0,0,0,.55),0 20px 42px rgba(0,0,0,.60);
  --el-control:inset 0 1px 0 rgba(255,255,255,.07),0 1px 1px rgba(0,0,0,.45),0 2px 5px rgba(0,0,0,.34);
  --el-control-dk:var(--el-control);
  --el-control-on-dark:var(--el-control);
  --el-tone:linear-gradient(180deg,rgba(255,255,255,.02),rgba(0,0,0,.04));
  --el-group:inset 0 1px 0 rgba(255,255,255,.06),0 1px 2px rgba(0,0,0,.45),0 4px 10px rgba(0,0,0,.34);
  --el-pressed:inset 0 1px 2px rgba(0,0,0,.45);
  --el-sunk:inset 0 1px 3px rgba(0,0,0,.50),inset 0 0 0 1px rgba(0,0,0,.22);
  --el-sunk-fill:none;
  --el-sheet:var(--el-hi),0 1px 3px rgba(0,0,0,.40),0 18px 44px rgba(0,0,0,.50);
  --el-sheet-up:var(--el-hi),0 -1px 3px rgba(0,0,0,.35),0 -12px 32px rgba(0,0,0,.45);
  --el-focus:#F1EFE7;
  --el-page-flat:#131A17;
  --el-dock:#111714;
  --el-tile:#28332E;                                     /* a nested tile: 3.5% lighter than its #1F2A26 card (text 11.4:1) */
  --el-tile-ring:inset 0 0 0 1px rgba(255,255,255,.10);
  --ctl-fill:#2A2A22;                                    /* warm dark; text #F1EFE7 12.6:1 */
  --ctl-edge:#55503F;                                    /* a faint lighter warm line (1.84:1 on a #1F2A26 card) */
}

/* ─── 2. The page. ONE fixed layer behind everything; the page frames above it are transparent so it shows through.
   Sticky bands (the pinned Today zone, sheet headers) keep their solid page colour: they must hide what scrolls under them. ─── */
html:not([data-theme="dark"]) body.h3n{--sf-page:var(--el-page)}
body.h3n{background:transparent}
/* html's own fill is the page tone, so if the fixed layer is ever not painted (an old WebKit, a stale sheet) the page is the
   warm ivory, never the near-white #F4F3ED of the template */
html:has(>body.h3n){background-color:var(--el-page-flat)}
/* the light theme's card face and neutral card edge (rendering); tinted role cards keep theirs (surface_roles wins on specificity) */
html:not([data-theme="dark"]) body.h3n{--sf-card:var(--el-card-face)}
body.h3n::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background:radial-gradient(120% 60% at 62% 0%,var(--el-page-hi) 0%,rgba(0,0,0,0) 100%),
    radial-gradient(85% 70% at 0% 100%,var(--el-page-lo) 0%,rgba(0,0,0,0) 100%),var(--el-page)}
body.h3n :is(.tab-view.active,.tab-view.md2-on),
body.h3n #tab-progress :is(#mpView,.cs-body,.cs-main){background:transparent}
/* Plan's frame (#ilPlan) is the page on the redesigned app, so its cards are the first level */
body.h3n #ilPlan.ilx-plan{background:transparent;border-color:transparent}
/* the Your day column (1200 px and up) is fixed beside the page: transparent, so the same light runs behind it. Its sticky
   log row must stay opaque (the column scrolls under it); it sits at the lower left, so it takes the lower-left tone. */
@media(min-width:1200px){
  body.h3n.rail-on #dayRail{background:transparent}
  body.h3n.rail-on #dayRail .dv-dock:not(.fx){background:var(--el-dock)}
}

/* ─── 3. Cards, by role (first level). Tinted role cards keep their tint and edge (surface_roles.css). ─── */
body.h3n :is(.hb-card,.bd3-card,.c-card,.p3-card,.p3-cu,.lb3-zone,.lb3-since,.md2-card,.md3-card,.rv2-tile,.h3-goal,.wkl3-sr,
  .lb3-gl,.lb3-grp,.lb3-pat,.lv2-next,.lv2-card,.ua-zone,.md3-wk,.lk3-foot,
  .h3-today,.h3-tiles,.jy-card,.jy-bill,.gs-card,.as3-card,.as3-pri,.as3-ver,.ilx-card,.ilx-feat,.ilx-fold,.me3-card,.me3-grp,.ak1-card:not(button)),
body.dp-staff :is(.card,.gx-card,.tiles,.lst,.band){box-shadow:var(--el-card)}
/* the pinned Today card: home3.css sets its shadow with !important (none inside the pin band; page bands when not pinned) */
body.h3n .h3 .h3-today{box-shadow:var(--el-card),0 -12px 0 0 var(--bg-canvas),0 14px 0 0 var(--bg-canvas)!important}
body.h3n .h3 .h3-pin .h3-today{box-shadow:var(--el-card)!important}
/* the journey card when it sits in the Getting started slot (today.css flattens it there) */
body.h3n .td-wrap.td2 #gsSlot .jy-card.jy-float{box-shadow:var(--el-card)}
/* nested: a card inside a card is border-only */
body.h3n :is(.hb-card,.bd3-card,.c-card,.p3-card,.p3-cu,.p3-lead,.lb3-zone,.md2-card,.md3-card,.h3-see,.hb-mat,.ss3-sh,.md2-sheet,.ask-panel,
  .lb3-gl,.lb3-grp,.lb3-pat,.lv2-next,.lv2-card,.ua-zone,.md3-wk,.lk3-foot,.h3-today,.h3-tiles,.jy-card,.gs-card,.as3-card,.as3-pri,
  .ilx-card,.me3-card,.me3-grp)
  :is(.hb-card,.bd3-card,.c-card,.p3-card,.p3-cu,.lb3-zone,.lb3-since,.md2-card,.md3-card,.rv2-tile,.h3-goal,.wkl3-sr,
    .lb3-gl,.lb3-grp,.lb3-pat,.lv2-next,.lv2-card,.ua-zone,.md3-wk,.lk3-foot,.h3-tiles,.jy-card,.jy-bill,.gs-card,.as3-card,.as3-ver,
    .ilx-card,.ilx-feat,.ilx-fold,.me3-card,.me3-grp),
body.dp-staff :is(.card,.gx-card,.tiles,.lst,.band) :is(.card,.gx-card,.tiles,.lst,.band){box-shadow:none}
body.h3n .md3-more .md2-card,body.h3n #tab-bloodwork .bm-host .c-card{box-shadow:none}

/* ─── 4. The lead (the forest card; one per page). Always the same forest whatever its finding's state (no await / done fill);
   the gradient is an overlay on it. ─── */
body.h3n :is(.rec.hb .hb-card.hb-mat,.h3-see,#ilPlan .p3-lead,.hb-c-is-it-working,.ss3-done){
  background-image:var(--el-lead-grad);box-shadow:var(--el-lead)}
/* the Record panel selector: the tile of the panel you are on is the lead; a pressed tile goes 1 px down into the page */
html[data-theme="dark"] body.h3n #ilPlan .p3-lead{box-shadow:inset 0 0 0 1px rgba(208,170,85,.55),inset 0 1px 0 rgba(255,255,255,.08),0 3px 6px rgba(0,0,0,.55),0 20px 42px rgba(0,0,0,.60)}
body.h3n :is(.rec.hb .hb-card.hb-mat,.h3-see,#ilPlan .p3-lead,.hb-c-is-it-working,.ss3-done){--gold-text:initial}
body.h3n :is(.ss3-sh,.md2-sheet,.ask-panel,.hb-card:not(.hb-mat),.bd3-card) :is(.h3-see,.ss3-done){box-shadow:none}

/* ─── 5. Sheets ─── */
body.h3n :is(.md2-sheet,.ss3-sh,.wkl3-sh){box-shadow:var(--el-sheet-up)}
@media(min-width:700px){body.h3n .md2-sheet{box-shadow:var(--el-sheet)}}
body.h3n .ask-panel{box-shadow:var(--el-sheet)}

/* ─── 6. Controls, by role. Text links (no fill, no outline) are left alone: a shadow under an invisible box reads as a
   stray line. Light-filled pills also take the 2% vertical tone. ─── */
body.h3n :is(.h3-btn,.bd3-btn,.t3-btn,.c-btn,.md2-btn,.ilx-v:not(.q):not([data-not]),.rv2-lb,.ss3-b,.wk-act,.r3-b,.dc-btn,.h3-wyx,.h3-pill,.ctx-chip,.p42-pill,.rv2-me>button,
  .h3-pillr,.h3-tile,.chb-btn,.cs-corr-btn,.b45-chip,.wk-chip,.md3-chip,.md3-wkgo,.md3-fold,.lg3-ab,.lg3-go,.ask-sug,.akt-new,.b2-btn,.bd3-ckp,
  .lv2-btn,.lr-b,.lr-x,.ask-about,.h2-util-avatar,.bm-nm,.lg3-nb,.lg3-ol,.dr-close,.md2-ans>button,.ss3-c,.ask-b,.lb3-all,.lb3-zt,.ak1-mem,.p3-e),
.ha-ov.as3 .as3-b,
body.dp-staff :is(.btn,.lnk,.chip,.seg,.hqnav,.opn,.ca-ask-c,.lay,.bz-days,.theme-btn){box-shadow:var(--el-control)}
body.dp-staff :is(.lay button[aria-pressed="true"],.bz-days button.on){box-shadow:0 0 0 1px var(--stroke-default),var(--el-control)}
/* forest-filled controls: a dimmer highlight and a deeper bottom (the two :not() only lift the specificity over the list above) */
body.h3n :is(.h3-nb:not(.sm),.h3-mp,.jy-btn,.t3-btn,.c-btn--primary,.h3-btn.pri,.lr-b.go):not(.el-x):not(.el-y){box-shadow:var(--el-control-dk)}
body.h3n #navBar .nb.on{box-shadow:var(--el-control-dk)}
body.h3n .h3-nb.sm{box-shadow:var(--el-control)}
/* Plan's outlined actions (plan3.css / home3.css flatten them with !important) */
body.h3n #ilPlan .p3 :is(.p3-card,.p3-lead) .b47-acts .ilx-v:not([data-not]),body.h3n #ilPlan .b47-one .ilx-v:not([data-not]),
body.h3n #ilPlan .b47-f:not([open])~.b47-acts .ilx-v:not([data-not]){box-shadow:var(--el-control)!important}
body.h3n #ilPlan .p3 .p3-lead .b47-acts .ilx-v:not([data-not]){box-shadow:var(--el-control-on-dark)!important}
body.h3n :is(.h3-pill,.bd3-btn:not(.pri),.h3-pillr,.ctx-chip,.h3-btn:not(.pri),.chb-btn:not(.chb-dark),.cs-corr-btn,.md2-btn:not(.pri),.b2-btn:not(.ghost)){background-image:var(--el-tone)}
body.dp-staff :is(.seg,.hqnav) button.on{box-shadow:var(--el-control)}
/* on the forest lead the bottom shadow is a darker forest, never a pale line */
body.h3n :is(.hb-mat,.h3-see,.p3-lead,.hb-c-is-it-working,.ss3-done) :is(.h3-btn,.bd3-btn,.t3-btn,.c-btn,.ilx-v:not(.q):not([data-not]),.ss3-b){box-shadow:var(--el-control-on-dark)}
/* segmented controls: the strip is a raised group. Record's Labs / Body / Training / Meds strip: the chosen item is pressed IN
   (its sage fill, an inset shadow); the kg/lb and other small switches keep their chosen item raised. */
body.h3n :is(.rv2-strip,.rec-dn.rv2-strip,.tr-seg,.md2-seg,.g1-rg){box-shadow:var(--el-group)}
body.h3n .rv2-strip a.on{box-shadow:var(--el-sunk);background-image:var(--el-sunk-fill)!important}
html body.h3n :is(.tr-seg button.on,.md2-seg button.on,.me-tab.on,.g1-rg button.on):not(.el-x){box-shadow:0 0 0 1px var(--stroke-default),var(--el-control)}
/* week strips: today's tile and the chosen day are small raised tiles; the other days stay flat */
body.h3n .t3-day:is(.m-today,.now,.on){box-shadow:inset 0 0 0 1px rgba(var(--el-ink,0,0,0),.08),var(--el-control);background-color:var(--el-tile,#FFFDF7);background-image:var(--el-tone)}
html[data-theme="dark"] body.h3n .t3-day:is(.m-today,.now,.on){--el-tile:rgba(255,255,255,.06)}
/* pressed: down 1 px, the shadow moves inside */
body.h3n :is(.h3-btn,.bd3-btn,.t3-btn,.c-btn,.md2-btn,.ilx-v:not(.q):not([data-not]),.rv2-lb,.ss3-b,.wk-act,.r3-b,.dc-btn,.h3-wyx,.h3-pill,.rv2-me>button,
  .h3-pillr,.h3-tile,.h3-nb,.h3-mp,.jy-btn,.chb-btn,.cs-corr-btn,.b45-chip,.wk-chip,.md3-chip,.lg3-ab,.lg3-go,.ask-sug,.b2-btn,.lv2-btn,.lr-b,.t3-day):active:not(:disabled):not([aria-disabled="true"]),
.ha-ov.as3 .as3-b:active:not(:disabled),
body.dp-staff :is(.btn,.lnk,.chip,.opn,.ca-ask-c):active:not(:disabled){transform:translateY(1px);box-shadow:var(--el-pressed)}
/* focus: a visible ring that takes no space */
body.h3n :is(.h3-btn,.bd3-btn,.t3-btn,.c-btn,.md2-btn,.ilx-v,.rv2-lb,.ss3-b,.wk-act,.r3-b,.dc-btn,.h3-wyx,.h3-pill,.rv2-me>button,.tr-seg button,.md2-seg button,.me-tab,
  .h3-pillr,.h3-tile,.h3-nb,.h3-mp,.jy-btn,.chb-btn,.cs-corr-btn,.b45-chip,.lg3-ab,.ask-sug,.b2-btn,.lr-b,.t3-day):focus-visible,
body.dp-staff :is(.btn,.lnk,.chip,.seg button,.hqnav a,.hqnav button):focus-visible{outline:2px solid var(--el-focus);outline-offset:2px}
body.h3n :is(.hb-mat,.h3-see,.p3-lead,.hb-c-is-it-working,.ss3-done) :is(.h3-btn,.bd3-btn,.t3-btn,.c-btn,.ilx-v,.ss3-b):focus-visible{outline-color:#F3EFE3}
/* disabled: flat */
body.h3n :is(.h3-btn,.bd3-btn,.t3-btn,.c-btn,.md2-btn,.ilx-v,.rv2-lb,.ss3-b,.wk-act,.r3-b,.dc-btn,.h3-wyx,.h3-pill,.h3-pillr,.h3-nb,.chb-btn,.lg3-ab,.b2-btn,.lr-b):is(:disabled,[aria-disabled="true"]),
body.dp-staff :is(.btn,.lnk,.chip):is(:disabled,[aria-disabled="true"]){box-shadow:none;transform:none}
@media(prefers-reduced-motion:reduce){body.h3n :is(.h3-btn,.bd3-btn,.t3-btn,.c-btn,.md2-btn,.ilx-v,.rv2-lb,.ss3-b,.h3-pill,.h3-pillr,.h3-tile,.h3-nb,.t3-day):active{transform:none}}

/* ─── 7. Outlined (secondary) controls wear the rendering's warm cream fill and fine tan edge, ink text (design lead,
   2026-11-17). The primary (forest) control is untouched; a chosen or pressed item keeps its sunk / raised look as built; the
   lead card's own controls are left as they are; text-only links (no border) are not touched.
   Contrast: ink 10.5:1 light, 12.6:1 dark. The edge is the rendering's own tan, sampled: 1.93:1 on a #FCF9F2 card (1.84:1 dark),
   under the 3:1 of WCAG 1.4.11: kept because every one of these controls carries a text label, a fill that differs from the card
   and a raised shadow, and the 3:1 tan (#A98D4A) reads as a gold outline, not the rendering's line. Design lead to confirm. ─── */
body.h3n :is(.h3-pill,.h3-pillr,.bd3-btn:not(.pri),.h3-btn:not(.pri),.md2-btn:not(.pri),.b2-btn,.chb-btn:not(.chb-dark),.cs-corr-btn,
  .ctx-chip,.lg3-ab:not(.pri),.rv2-lb,.ss3-b:not(.pri):not(.lite):not(.sel),.dc-btn:not(.pri):not(.ghost),.b45-chip,.ask-sug,
  .rv2-strip,.tr-seg,.md2-seg,.g1-rg):not(.on):not([aria-pressed="true"]):not([aria-selected="true"]):not(:is(.hb-mat,.h3-see,.p3-lead,.hb-c-is-it-working,.ss3-done) *){
  background-color:var(--ctl-fill);border-color:var(--ctl-edge)}
/* Plan's outlined actions in its cards (plan3.css sets them transparent with !important) */
body.h3n #ilPlan .p3 .p3-card .b47-acts .ilx-v:not(.pri):not([data-not]){background-color:var(--ctl-fill)!important;border-color:var(--ctl-edge)!important}

/* ─── 8. Neutral first-level cards: the rendering's edge (light). :where keeps it under the tinted roles and page-specific edges. ─── */
html:not([data-theme="dark"]) body.h3n :where(.hb-card,.bd3-card,.c-card,.p3-card,.lb3-zone,.md2-card,.md3-card,.rv2-tile,.h3-goal,
  .h3-today,.h3-tiles,.lv2-card,.ilx-card,.me3-card,.as3-card){border-color:var(--el-card-edge)}
/* the chosen segment of Record's Labs / Body / Training / Meds strip: the rendering's sage, still pressed in */
html:not([data-theme="dark"]) body.h3n .rv2-strip a.on{background-color:var(--el-seg-on)!important}

/* ─── 9. Nested tiles (owner: "the Last night in dark lacks separation"). No shadow; a 1 px inset edge in both themes (light the
   sage-gray hairline, dark white 10%), drawn as an inset ring so nothing moves; in dark a surface 3.5% lighter than the card.
   Tiles that already have a 1 px border keep it and only take the dark surface. ─── */
body.h3n :is(.rv2-c,.rv2-ox){box-shadow:var(--el-tile-ring)}
html[data-theme="dark"] body.h3n :is(.rv2-c,.rv2-ox,.h3-tile,.p42-mini,.bio-ev){background-color:var(--el-tile)}
html[data-theme="dark"] body.h3n :is(.h3-tile,.p42-mini,.bio-ev){border-color:rgba(255,255,255,.10)}

/* ─── 10. A measure's line icon beside its label (cadence.js ilCadence.icon): 16 px, the card role's label ink ─── */
.ilm-ic,body.h3n svg.ilm-ic{width:16px;height:16px;max-width:none;flex:none;display:inline-block;vertical-align:-3px;margin:0 6px 0 0;color:var(--ik-label,currentColor)}
/* the chart halos on the lead are cut in the card's colour: with the rendering's top-to-bottom lead they take its lower tone */
html:not([data-theme="dark"]) body.h3n .h3-see .h3-chart :is(.h3-halo,.h3-fhalo){stroke:#072E22}

/* ─── 11. Tappable tiles and rows are raised (Barry 11-22: "Buttons that are clickable should be designed graphically to have a 3d
   effect which visually indicates that it's actionable"). Anything that opens a sheet or a page looks pressable, even nested inside a
   card (the §3 "nested cards are flat" rule is for information, not for things you can tap). Information that does nothing stays flat.
   A) A boxed tile (its own border and radius): a soft top tone, a white top edge, a contact and a short ambient shadow; lifts 1 px under
      a mouse; pressed = 1 px down with an inset shadow.
   B) A row inside a list (full width, divided by hairlines): raising each row would break the list, so the row's chevron becomes the
      domed ILAI disc (the same 3D cue as the pill buttons), and the whole row presses in on touch. ─── */
html:not([data-theme="dark"]) body.h3n{--el-tap:inset 0 1px 0 rgba(255,255,255,.95),inset 0 -2px 0 rgba(var(--el-ink),.05),0 1px 2px rgba(var(--el-ink),.20),0 6px 16px rgba(var(--el-ink),.14);
  --el-tap-hi:inset 0 1px 0 rgba(255,255,255,.95),inset 0 -2px 0 rgba(var(--el-ink),.05),0 2px 4px rgba(var(--el-ink),.22),0 10px 22px rgba(var(--el-ink),.16);
  --el-tap-tone:linear-gradient(180deg,rgba(255,255,255,.7),rgba(255,255,255,0) 50%,rgba(var(--el-ink),.04))}
html[data-theme="dark"] body.h3n{--el-tap:inset 0 1px 0 rgba(255,255,255,.10),inset 0 -2px 0 rgba(0,0,0,.18),0 1px 2px rgba(0,0,0,.55),0 6px 16px rgba(0,0,0,.45);
  --el-tap-hi:inset 0 1px 0 rgba(255,255,255,.10),0 2px 4px rgba(0,0,0,.55),0 8px 18px rgba(0,0,0,.42);
  --el-tap-tone:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,0) 55%,rgba(0,0,0,.06))}
body.h3n :is(.bd4-mi,.lpx-lv,.lpx-lm,.lpx-hc,.lpx-gt,.lbg-t,.lb3-card,.lk3-act,.mdb-row,.h3-g1,button.md3-tdm,.wk2-gl1){
  box-shadow:var(--el-tap);background-image:var(--el-tap-tone);
  transition:transform .12s ease,box-shadow .12s ease;-webkit-tap-highlight-color:transparent}
/* the goal's own header sits inside the goal card: it opens the goal, so it reads as the top of a raised card, not a separate tile */
body.h3n .lpx-gcard{box-shadow:var(--el-tap)}
body.h3n .lpx-gcard>.lpx-gt{box-shadow:none;background-image:none}
@media(hover:hover) and (pointer:fine){
  body.h3n :is(.bd4-mi,.lpx-lv,.lpx-lm,.lpx-hc,.lbg-t,.lb3-card,.lk3-act,.mdb-row,.h3-g1,button.md3-tdm,.wk2-gl1):hover{transform:translateY(-1px);box-shadow:var(--el-tap-hi)}
}
body.h3n :is(.bd4-mi,.lpx-lv,.lpx-lm,.lpx-hc,.lbg-t,.lb3-card,.lk3-act,.mdb-row,.h3-g1,button.md3-tdm,.wk2-gl1):active{transform:translateY(1px);box-shadow:var(--el-pressed)}
body.h3n .lpx-gcard>.lpx-gt:active{transform:none;background-color:rgba(var(--el-ink),.04)}
/* B) rows in a list: a domed chevron disc, and the row presses in */
body.h3n :is(.bd4-row,.bd3-nr,.bd3-prow,.tb3-row,.r4-row,.r4-rr,.rp3-row,.hb-mwr,.lb4-frh,.lb4-row,.as-rowb,.akc,.me3-tgb,.lv2-mk,.bm-lc) .gi-chev{
  width:28px;height:28px;flex:none;border-radius:50%;-webkit-mask:none;mask:none;justify-self:end;   /* in a 14 px chevron column: grow into the gap, never past the row */
  background:var(--el-tap-tone),var(--bg-surface,#FFFDF7);box-shadow:var(--el-tap),inset 0 0 0 1px var(--el-card-border,var(--stroke-default));position:relative}
body.h3n :is(.bd4-row,.bd3-nr,.bd3-prow,.tb3-row,.r4-row,.r4-rr,.rp3-row,.hb-mwr,.lb4-frh,.lb4-row,.as-rowb,.akc,.me3-tgb,.lv2-mk,.bm-lc) .gi-chev::after{content:"";position:absolute;inset:0;margin:auto;width:14px;height:14px;
  background:currentColor;-webkit-mask:var(--gi-chev) center/contain no-repeat;mask:var(--gi-chev) center/contain no-repeat;color:var(--ink-secondary)}
body.h3n :is(.bd4-row,.bd3-nr,.bd3-prow,.tb3-row,.r4-row,.r4-ar,.r4-rr,.rp3-row,.hb-mwr,.lb4-frh,.lb4-row,.as-rowb,.akc,.me3-tgb,.lv2-mk,.bm-lc){-webkit-tap-highlight-color:transparent;transition:background-color .12s ease}
body.h3n :is(.bd4-row,.bd3-nr,.bd3-prow,.tb3-row,.r4-row,.r4-ar,.r4-rr,.rp3-row,.hb-mwr,.lb4-frh,.lb4-row,.as-rowb,.akc,.me3-tgb,.lv2-mk,.bm-lc):active{background-color:rgba(var(--el-ink),.05)}
html[data-theme="dark"] body.h3n :is(.bd4-row,.bd3-nr,.bd3-prow,.tb3-row,.r4-row,.r4-ar,.r4-rr,.rp3-row,.hb-mwr,.lb4-frh,.lb4-row,.as-rowb,.akc,.me3-tgb,.lv2-mk,.bm-lc):active{background-color:rgba(255,255,255,.05)}
body.h3n :is(.bd4-row,.bd3-nr,.bd3-prow,.tb3-row,.r4-row,.r4-ar,.r4-rr,.rp3-row,.hb-mwr,.lb4-frh,.lb4-row,.as-rowb,.akc,.me3-tgb,.lv2-mk,.bm-lc):active .gi-chev{box-shadow:var(--el-pressed),inset 0 0 0 1px var(--el-card-border,var(--stroke-default))}
@media (prefers-reduced-motion:reduce){body.h3n :is(.bd4-mi,.lpx-lv,.lpx-lm,.lpx-hc,.lbg-t,.lb3-card,.lk3-act,.mdb-row,.h3-g1,button.md3-tdm,.wk2-gl1){transition:none}}
/* a dose you can answer or change: the square sits on a raised tile (a dose that cannot be answered is a span and stays flat) */
body.h3n button.md3-tdm{background-color:var(--bg-surface,#FFFDF7);box-shadow:var(--el-tap),inset 0 0 0 1px var(--el-card-border,var(--stroke-default))}
body.h3n button.md3-tdm:active{box-shadow:var(--el-pressed),inset 0 0 0 1px var(--el-card-border,var(--stroke-default))}

/* ═══ Night mode (Barry 2026-11-22: "convert dark mode to night mode") ═══
   ILAI has ONE design, the light one. At night a warm, even dim layer sits over the whole page and every sheet (top of the stack,
   never takes a tap), so nothing is redesigned twice and every colour keeps its meaning. Muted and secondary inks are darkened
   under it so small text stays readable on the dimmed cream (measured under the layer: muted #57534A 5.3:1 on the page, gold text #6B4E12 5.4:1, amber #8A4C0E 4.9:1). */
html.night::after{content:"";position:fixed;inset:0;pointer-events:none;z-index:2147483646;background:rgba(32,22,8,.2)}
html.night,html.night body,html.night body.h3n{--ink-muted:#57534A!important;--ink-secondary:#3E3C35!important;--gold-text:#6B4E12!important;--jd-out-mk:#8A4C0E!important;--sig-warn:#8A4C0E!important}
