/* Haven shell + layout kit, in the editorial style (2026-10-28, see docs/EDITORIAL-STYLE.md).
   Loaded after /ui.css on every page. The rules in one line: no boxes; things sit on the page between hairline rules;
   one big serif number per view; a number that opens its detail carries a chevron; section tabs are plain words with a brown line under the current one.
   Four parts:
   1. Tokens (light and dark) and base elements.
   2. The editorial layer: sections, numbers, tables, tabs, buttons, fields, tags and the pages' own widgets, unboxed.
      Pages carry their own small <style> blocks (loaded after this file), so the rules that must win are prefixed with :root.
   3. The layout kit pages opt into: .grid-2/3/4, .split, .dock, .filterbar, .table-wrap (and .wrap), .stat, .zoom, .tall.
   4. The chrome that /shell.js builds around the page's <main> (only when html.hv-on is set, so a page without the script still works):
      phone (< 700px): no top bar; the page title is the switcher between the pages of its section; a floating dock (Home, Go to…, Menu) and a sheet.
      tablet (700-1100px): the icon rail alone; tapping a section opens its panel over the page; desktop (> 1100px): the rail plus the section panel (flat list of pages,
      quick actions, Pinned, Recent), a light top bar with breadcrumbs and the search button for the Ctrl-K palette. Three surfaces: menu, canvas, content sheet (see the tokens). */

/* ---------- 1. tokens ---------- */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --canvas: #EFEEE9; --menu: #E2E7D6; --menu-2: #EAEEE0; --menu-line: rgba(37,36,40,.14); --ink-m: rgba(37,36,40,.74);
  --sheet: #FDFCF8; --sheet-line: rgba(37,36,40,.12); --sheet-shadow: 0 1px 2px rgba(37,36,40,.05), 0 10px 28px -14px rgba(37,36,40,.12);
  --bg0: #EFEEE9; --bg: #FDFCF8; --surface: #FDFCF8; --surface-2: #ECEFE2; --pop: #FDFCF8; --scrim: rgba(37,36,40,.22); --hl: rgba(124,99,79,.20);
  --line: rgba(37,36,40,.11); --line-strong: rgba(37,36,40,.24);
  --ink: #252428; --ink2: rgba(37,36,40,.74); --ink-2: rgba(37,36,40,.74); --ink-3: rgba(37,36,40,.65);
  --accent: #5B664D; --sage-line: #768165; --walnut: #768165; --walnut-ink: #7C634F; --walnut-soft: rgba(210,220,190,.55); --rule: #7C634F;
  --btn: #6F5B4A; --btn-hover: #5E4C3D; --btn-ink: #FBF9F4; --btn-grad: #6F5B4A;
  --warn: #B0492F; --amber: #87601F; --up: #5B664D; --down: #B0492F;
  --chrome: rgba(239,238,233,.94); --chrome-solid: #EFEEE9;
  --pop-shadow: 0 18px 40px -16px rgba(37,36,40,.30), 0 1px 3px rgba(37,36,40,.06);
  --orbs: none;
  --focus: #5B664D; --tint: rgba(118,129,101,.13); --tint-warn: rgba(176,73,47,.11); --hover: rgba(37,36,40,.035);
  --disp: ui-serif, "Iowan Old Style", "New York", Charter, Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --ease: cubic-bezier(.22,.61,.21,1); --d1: 150ms; --d2: 260ms;
  --top-h: 56px; --dock-h: 52px; --rail-w: 68px; --panel-w: 300px; --side-w: calc(var(--rail-w) + var(--panel-w)); --sheet-m: 28px; --content-max: 1600px;
  --gut: 20px; --fs: 15px; --h1: 34px; --h2: 21px; --big: 30px; --lead: 46px; --colgap: 36px; --sec-gap: 34px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #141311; --menu: #1F1E1B; --menu-2: #262521; --menu-line: rgba(244,246,236,.12); --ink-m: rgba(244,246,236,.66);
    --sheet: #242320; --sheet-line: rgba(244,246,236,.11); --sheet-shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
    --bg0: #141311; --bg: #242320; --surface: #2B2A27; --surface-2: #2B2A27; --pop: #2A2926; --scrim: rgba(0,0,0,.5); --hl: rgba(176,143,114,.34);
    --line: rgba(244,246,236,.10); --line-strong: rgba(244,246,236,.22);
    --ink: #F4F6EC; --ink2: rgba(244,246,236,.74); --ink-2: rgba(244,246,236,.74); --ink-3: rgba(244,246,236,.60);
    --accent: #D2DCBE; --sage-line: #A9B58F; --walnut: #A07850; --walnut-ink: #C09C7C; --walnut-soft: rgba(160,120,80,.22); --rule: #B08F72;
    --btn: #B08F72; --btn-hover: #C29E7E; --btn-ink: #1A1917; --btn-grad: #B08F72;
    --warn: #E0745A; --amber: #D8A35F; --up: #C9D3B3; --down: #E0745A;
    --chrome: rgba(20,19,17,.94); --chrome-solid: #141311;
    --pop-shadow: 0 22px 48px -18px rgba(0,0,0,.8), 0 2px 6px rgba(0,0,0,.25);
    --orbs: none;
    --focus: #D2DCBE; --tint: rgba(210,220,190,.10); --tint-warn: rgba(224,116,90,.14); --hover: rgba(244,246,236,.035);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #141311; --menu: #1F1E1B; --menu-2: #262521; --menu-line: rgba(244,246,236,.12); --ink-m: rgba(244,246,236,.66);
  --sheet: #242320; --sheet-line: rgba(244,246,236,.11); --sheet-shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
  --bg0: #141311; --bg: #242320; --surface: #2B2A27; --surface-2: #2B2A27; --pop: #2A2926; --scrim: rgba(0,0,0,.5); --hl: rgba(176,143,114,.34);
  --line: rgba(244,246,236,.10); --line-strong: rgba(244,246,236,.22);
  --ink: #F4F6EC; --ink2: rgba(244,246,236,.74); --ink-2: rgba(244,246,236,.74); --ink-3: rgba(244,246,236,.60);
  --accent: #D2DCBE; --sage-line: #A9B58F; --walnut: #A07850; --walnut-ink: #C09C7C; --walnut-soft: rgba(160,120,80,.22); --rule: #B08F72;
  --btn: #B08F72; --btn-hover: #C29E7E; --btn-ink: #1A1917; --btn-grad: #B08F72;
  --warn: #E0745A; --amber: #D8A35F; --up: #C9D3B3; --down: #E0745A;
  --chrome: rgba(20,19,17,.94); --chrome-solid: #141311;
  --pop-shadow: 0 22px 48px -18px rgba(0,0,0,.8), 0 2px 6px rgba(0,0,0,.25);
  --orbs: none;
  --focus: #D2DCBE; --tint: rgba(210,220,190,.10); --tint-warn: rgba(224,116,90,.14); --hover: rgba(244,246,236,.035);
}
@media (min-width: 700px) { :root { --gut: 32px; --h1: 40px; --h2: 22px; --top-h: 58px; --big: 32px; --lead: 52px; --colgap: 44px; --sec-gap: 40px; } }
@media (min-width: 1101px) { :root { --gut: 40px; --fs: 15.5px; --h1: 46px; --h2: 23px; --top-h: 60px; --big: 34px; --lead: 60px; --colgap: 56px; --sec-gap: 44px; } }
@media (min-width: 1500px) { :root { --gut: 48px; } }

/* ---------- base elements (apply with or without the shell script) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: var(--fs)/1.55 var(--ui); -webkit-font-smoothing: antialiased; }
h1 { font: 400 var(--h1)/1.1 var(--disp); letter-spacing: -.018em; margin: 0 0 8px; text-wrap: balance; }
h2 { font: 400 var(--h2)/1.25 var(--disp); letter-spacing: -.008em; margin: 0 0 12px; }
h3 { font: 600 15px/1.3 var(--ui); margin: 20px 0 8px; }
.sub, .k, .det, .when, .src { color: var(--ink-2); }
.sub { font-size: 15px; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--walnut-soft); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
label { color: var(--ink-2); }
.err { color: var(--warn); } .ok, .err.ok { color: var(--up); }
.warn, .neg, .diff, .down { color: var(--warn); } .up { color: var(--up); }
.num, td.num, td.n { font-variant-numeric: tabular-nums lining-nums; }
code, .codes, .secret { font-family: var(--mono); }
.muted-empty { color: var(--ink-3); padding: 18px 0; text-align: center; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; } }

/* ---------- 2. the editorial layer ---------- */

/* SECTIONS: a .card is an open section under a hairline rule. No box, no fill, no shadow, no blur. */
:root .card {
  background: none; background-image: none; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; padding: 18px 0 4px; margin: 0 0 var(--sec-gap); min-width: 0;
}
:root .card .card { border-top-color: var(--line); padding-top: 14px; margin-bottom: 18px; }
:root .card > h2:first-child, :root .card > summary h2 { margin-bottom: 14px; }
/* the section title: serif, with a short brown rule under it (as in the old app's redesign) */
:root .card > h2:first-child::after { content: ""; display: block; width: 22px; height: 1.5px; margin-top: 9px; background: var(--rule); }
:root details.card > summary { cursor: pointer; list-style: none; font: 400 var(--h2)/1.25 var(--disp); padding: 0 0 8px; }
:root details.card > summary::-webkit-details-marker { display: none; }
:root details.card > summary::after { content: "⌄"; font: 400 16px var(--ui); color: var(--ink-3); margin-left: 8px; }
:root details.card[open] > summary::after { content: "⌃"; }

/* NUMBERS: a quiet label above a serif figure. Every stat row (.stat, a page's own .grid of .k + .big tiles, .tiles) loses its tiles:
   each number sits under a hairline, columns are split by vertical hairlines. */
:root .big, :root .stat .stat-value {
  font: 400 var(--big)/1.08 var(--disp); letter-spacing: -.015em; font-variant-numeric: tabular-nums lining-nums; margin: 4px 0 4px; overflow-wrap: break-word;
}
:root .stat, :root .grid > .card, :root .tiles > .card, :root .grid > div:has(> .big) {
  background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 14px 0 12px; margin: 0;
}
:root .stat .stat-label, :root .grid > .card > .k:first-child, :root .tiles > .card > .k:first-child, :root .grid > div > .k:first-child {
  font: 400 13px/1.35 var(--ui); letter-spacing: 0; text-transform: none; color: var(--ink-2); margin: 0 0 2px;
}
:root .stat .stat-sub, :root .grid > * > .big ~ .k, :root .grid > * > .big ~ div { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
:root .grid > * > .big ~ div .k { color: var(--ink-3); }
/* the one big number of the view (shell.js marks it hv-lead: a tile a page marks .lead, else the first number on the page) */
:root .hv-lead .big, :root .hv-lead .stat-value, :root .big.hv-lead { font-size: var(--lead); line-height: 1.02; letter-spacing: -.025em; margin: 6px 0 6px; }
/* stat rows: hairline columns (a 1px rule in the middle of each column gap; the one left of the first column is clipped away) */
:root .grid:has(> * > .big), :root .tiles, :root .grid-2:has(> .stat), :root .grid-3:has(> .stat), :root .grid-4:has(> .stat),
:root .grid-2:has(> .card), :root .grid-3:has(> .card), :root .grid-4:has(> .card), :root .cols:has(> .card) {
  column-gap: var(--colgap) !important; row-gap: 0 !important; clip-path: inset(-60px -60px -60px 0);
}
:root .grid:has(> * > .big) > *, :root .tiles > *, :root :is(.grid-2, .grid-3, .grid-4):has(> .stat) > *, :root :is(.grid-2, .grid-3, .grid-4, .cols):has(> .card) > * { position: relative; }
:root .grid:has(> * > .big) > *::before, :root .tiles > *::before, :root :is(.grid-2, .grid-3, .grid-4):has(> .stat) > *::before, :root :is(.grid-2, .grid-3, .grid-4, .cols):has(> .card) > *::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--colgap) / -2); width: 1px; background: var(--line); pointer-events: none;
}
:root .grid:has(> * > .big) { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
@media (max-width: 699px) { :root .grid:has(> * > .big) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
:root :is(.grid, .tiles, .grid-3, .grid-4) > .hv-lead { grid-column: 1 / -1; }
@media (min-width: 900px) { :root :is(.grid, .tiles, .grid-3, .grid-4) > .hv-lead { grid-column: span 2; } :root .grid-3 > .hv-lead { grid-column: span 1; } }
/* a section made of nothing but a stat row needs no second rule on top */
:root .card > .grid:first-child > *, :root .card > h2 + .grid > * { border-top-color: transparent; }
:root .card > h2 + .grid > *, :root .card > h2 + p + .grid > * { border-top-color: var(--line); }

/* ZOOM: a number you can tap to see its detail. Put .zoom on the link (or on the tile that is a link); the chevron says it opens. */
.zoom, a.zoom { color: inherit; text-decoration: none; cursor: pointer; }
:root .zoom .big::after, :root .zoom .stat-value::after, :root .big.zoom::after, :root a:has(> .big) .big::after {
  content: "›"; display: inline-block; margin-left: .22em; font: 400 .52em/1 var(--ui); color: var(--walnut-ink); vertical-align: .32em; transition: transform var(--d1) var(--ease);
}
@media (hover: hover) { .zoom:hover .big::after, .zoom:hover .stat-value::after, a:hover > .big::after { transform: translateX(3px); } .zoom:hover .k:first-child, .zoom:hover .stat-label { color: var(--ink); } }
a.zoom:focus-visible { outline-offset: 4px; }

/* TABLES: hairlines only. No zebra, no boxes; quiet small-caps headers; totals under a dark rule. */
:root table { width: 100%; border-collapse: collapse; border-spacing: 0; background: none; border: 0; border-radius: 0; overflow: visible; }
:root th { font: 600 11px/1.3 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); background: transparent; border-bottom: 1px solid var(--line-strong); padding-top: 10px; padding-bottom: 8px; vertical-align: bottom; }
:root td { border-bottom: 1px solid var(--line); }
:root tbody tr:last-child td { border-bottom-color: var(--line); }
@media (hover: hover) { :root .wrap tbody tr:hover td, :root .table-wrap tbody tr:hover td { background: var(--hover); } }
:root tr.tot td, :root tr.total td { border-top: 1.5px solid var(--ink); font-weight: 600; }
:root th:first-child, :root td:first-child { padding-left: 0; }
:root th:last-child, :root td:last-child { padding-right: 0; }
:root .wrap td:first-child, :root .wrap th:first-child, :root .table-wrap td:first-child, :root .table-wrap th:first-child { padding-left: 2px; }
:root .wrap td:last-child, :root .wrap th:last-child, :root .table-wrap td:last-child, :root .table-wrap th:last-child { padding-right: 2px; }
.wrap, .table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
/* sticky headers sit on the page colour so the rows slide under them */
.tall { max-height: min(72vh, 900px); overflow: auto; }
:root .tall thead th, :root .sticky-head thead th, :root .wrap thead th[style*="sticky"], :root #ledger thead th, :root .wrap th { background: var(--bg); }
.tall thead th, .sticky-head thead th { position: sticky; top: 0; z-index: 1; }
@media (min-width: 1101px) { :root .wrap th, :root .wrap td, :root .table-wrap th, :root .table-wrap td { padding-left: 14px; padding-right: 14px; } }

/* TABS (they switch whole parts of a page): plain words in one row on a hairline; the current one is bold with a brown line. */
:root .tabs, :root [role="tablist"] {
  display: flex !important; flex-wrap: nowrap !important; align-items: flex-end; gap: 24px !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  margin: 4px 0 22px !important; padding: 0 !important; background: none; border: 0; border-bottom: 1px solid var(--line) !important; border-radius: 0; box-shadow: none;
}
:root .tabs::-webkit-scrollbar, :root [role="tablist"]::-webkit-scrollbar { display: none; }
:root .tabs > button, :root .tabs > a, :root [role="tablist"] > button, :root [role="tab"] {
  flex: none; background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; box-shadow: none !important;
  padding: 10px 0 11px !important; margin: 0 0 -1px !important; min-height: 44px; color: var(--ink-3) !important; font: 500 14.5px/1.2 var(--ui) !important; white-space: nowrap; text-decoration: none; transform: none !important;
}
:root .tabs > button:hover, :root [role="tab"]:hover { color: var(--ink) !important; }
:root .tabs > button.on, :root .tabs > button.active, :root .tabs > button[aria-selected="true"], :root .tabs > a[aria-current], :root [role="tab"][aria-selected="true"], :root [role="tab"].on {
  color: var(--ink) !important; font-weight: 600 !important; border-bottom-color: var(--rule) !important;
}

/* BUTTONS: one restrained filled pill for the main action (an unclassed button); everything else is a hairline pill or plain text. Nothing lifts or glows. */
button {
  font: 600 14px/1.2 var(--ui); background: var(--btn); color: var(--btn-ink); border: 1px solid var(--btn); border-radius: 999px; padding: 10px 20px; min-height: 40px;
  box-shadow: none; text-shadow: none; transition: background-color var(--d1) var(--ease), border-color var(--d1) var(--ease), color var(--d1) var(--ease); cursor: pointer;
}
button:hover { background: var(--btn-hover); border-color: var(--btn-hover); transform: none; }
button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; transform: none; }
:root button.ghost, :root button.sm.ghost, :root button.b, :root .bar button.ghost, :root td button.ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; font-weight: 500;
}
:root button.ghost:hover, :root button.b:hover { background: var(--hover); border-color: var(--ink-3); }
:root button.sm, :root button.small, :root button.btn-s, :root td button { font-size: 13px; padding: 6px 13px; min-height: 32px; }
:root button.b.fill { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
:root a.btn { display: inline-flex; align-items: center; gap: 4px; font: 500 14px var(--ui); border: 0; border-radius: 0; padding: 4px 0; color: var(--walnut-ink); text-decoration: none; }
:root a.btn::after { content: "›"; font-size: 1.15em; line-height: 1; transition: transform var(--d1) var(--ease); }
:root a.btn:hover::after { transform: translateX(2px); }

/* FIELDS: a hairline box on the page colour (no fill); the focused one gets a darker line. */
:root input[type=text], :root input[type=password], :root input[type=email], :root input[type=tel], :root input[type=number], :root input[type=date], :root input[type=time],
:root input[type=month], :root input[type=search], :root input[type=url], :root select, :root textarea, :root input:not([type]) {
  font-family: var(--ui); color: var(--ink); background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: none; max-width: 100%;
  transition: border-color var(--d1) var(--ease), box-shadow var(--d1) var(--ease);
}
:root select { background: transparent; }
:root input:not([type]) { width: 100%; font-size: 16px; padding: 10px 12px; }   /* a few pages leave the type off; they get the text field's size */
:root select option { background: var(--surface); color: var(--ink); }
:root textarea { line-height: 1.5; }
:root input:hover:not(:focus):not(:disabled), :root select:hover:not(:focus), :root textarea:hover:not(:focus) { border-color: var(--ink-3); }
:root input:focus-visible, :root select:focus-visible, :root textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
:root input[type=checkbox], :root input[type=radio] { accent-color: var(--btn); }

/* TAGS and PILLS: small, soft, the same everywhere. */
:root .tag, :root .pill, :root .chip:not(button), :root .state, :root .kind {
  display: inline-block; font: 600 10.5px/1.5 var(--ui); letter-spacing: .07em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--ink); border: 0; vertical-align: .08em;
}
:root .kind { background: none; padding: 0; color: var(--ink-3); }
:root .tag.off, :root .pill.new, :root .pill.warn, :root .tag.needs, :root .tag.cancelled, :root .tag.warn, :root .chip.warn, :root .chip.late, :root .state.on { background: var(--tint-warn); color: var(--warn); }
:root .tag.old, :root .tag.sent, :root .tag.cash, :root .pill.wait, :root .chip.ready, :root .chip.hand { background: var(--walnut-soft); color: var(--ink); }
:root .flag { border: 0; background: var(--tint-warn); color: var(--warn); border-radius: 999px; }

/* CHIPS (filters and choices): hairline pills; the chosen one is filled softly. */
:root .langs button, :root .pills button, :root .seg button, :root .seg label, :root .presets button, :root .chips button, :root .ev button {
  background: none; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: none; padding: 6px 14px; min-height: 34px; font: 500 13px var(--ui); margin: 0;
}
:root .langs button.on, :root .pills button.on, :root .seg button[aria-pressed="true"], :root .seg button.on, :root .seg label:has(input:checked), :root .chips button.on, :root .presets button.on, :root .ev button.on {
  background: var(--walnut-soft); border-color: transparent; color: var(--ink); font-weight: 600; outline: 0;
}
:root .seg { border: 0; border-radius: 0; overflow: visible; gap: 6px; display: inline-flex; flex-wrap: wrap; }
:root .langs, :root .pills { display: flex; gap: 6px; flex-wrap: wrap; }

/* NOTES and BANNERS: a brown (or red) rule down the left, no box. */
:root .banner, :root .flag:not(span), :root .snapshot, :root #warn.card {
  background: none; border: 0; border-left: 2px solid var(--rule); border-radius: 0; box-shadow: none; padding: 4px 0 4px 16px; margin: 0 0 24px;
}
:root .banner.on, :root .banner.warn, :root #warn.card { border-left-color: var(--warn); background: none; }
:root .banner.off { border-left-color: var(--sage-line); background: none; }
:root .banner b { font: 400 21px/1.25 var(--disp); }
:root div.flag { color: var(--ink); }
:root .act { border: 0; border-left: 2px solid var(--line-strong); border-radius: 0; padding: 4px 0 4px 12px; }

/* the pages' own pickers and rows: list rows on hairlines, the chosen one bold with the brown rule */
:root .cpick, :root .pick {
  background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; margin: 0; padding: 12px 4px 12px 14px; color: var(--ink); position: relative; min-height: 48px; font-weight: 400;
}
:root .cpick:hover, :root .pick:hover { background: var(--hover); border-color: var(--line); }
:root .cpick.on, :root .pick.on { background: none; border-color: var(--line); font-weight: 600; }
:root .cpick.on::before, :root .pick.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--rule); }
:root .plist { padding: 0; }
/* progress bars and bracket tracks: a thin line, sage fill */
:root .track { height: 6px; background: var(--line); border: 0; border-radius: 3px; }
:root .track .fill { background: var(--sage-line); border-radius: 3px; }
:root .track .tick { background: var(--ink-3); width: 1px; top: -5px; bottom: -5px; }
/* documents that are meant to look like paper (an invoice, a contract) keep their sheet, but quieter */
:root .paper { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: none; }
:root .codes { background: none; border: 1px solid var(--line-strong); border-radius: 8px; }
:root #qr { border-radius: 6px; }

/* ---------- 3. layout kit (opt in with classes) ---------- */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 var(--colgap); margin-bottom: 8px; align-items: start; }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
.stack > * + * { margin-top: 0; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 899px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 699px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 459px) { .grid-4:not(.tiles):not(:has(> .stat)) { grid-template-columns: minmax(0, 1fr); } }
/* .split: list on the left, detail on the right, a vertical hairline between them; stacks on narrow screens. .split-r puts the narrow column on the right. */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; }
.split > * { min-width: 0; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
  .split.split-r { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); }
  .split.split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split > * + * { border-left: 1px solid var(--line); padding-left: calc(var(--colgap) / 2) !important; margin-left: calc(var(--colgap) / 2) !important; }
  .split-detail, .split .sticky { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; }
}
@media (min-width: 1400px) { .split { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); } .split.split-r { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); } }
/* .dock: main content with a panel docked beside it on wide screens (a hairline between); the panel goes below when narrow or disappears if hidden */
.dock { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; }
.dock > * { min-width: 0; }
.dock > .dock-panel { order: 2; }
@media (min-width: 1101px) {
  .dock { grid-template-columns: minmax(0, 1fr) 340px; }
  .dock > .dock-panel { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--top-h) + 16px); order: 0; border-left: 1px solid var(--line); padding-left: calc(var(--colgap) / 2); margin-left: calc(var(--colgap) / 2); }
  .dock > .dock-main { grid-column: 1; grid-row: 1; }
  .dock:not(:has(> .dock-panel:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
}
/* sticky filter bar: no box, the page colour behind it and a hairline under it */
.filterbar, :root .filterbar { position: sticky; top: 0; z-index: 4; display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: flex-end; padding: 10px 0 12px; margin: 0 0 24px;
  background: var(--bg); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.hv-on .filterbar { top: var(--top-h); }
.filterbar label { margin: 0; } .filterbar button { margin: 0; }
/* the pages' own control rows (.bar with selects and a Show button) read as a quiet line of controls */
:root .bar:not(.filterbar):has(> label, > button, > input) { gap: 10px 16px; margin-bottom: 22px; }
.w-pw { max-width: 560px; }
.split .w-pw, .grid-2 .w-pw { max-width: none; }

/* ---------- 4. chrome (only once shell.js has started) ---------- */
/* Three surfaces (docs/menu-mockups): the menu (rail + panel) on its own tinted surface with a hairline edge, the canvas behind everything in a quiet neutral,
   and the page itself as a clean "sheet" (<main>) with a hairline border and 16px corners. No colour fields, no orbs. Phones have no sheet: the page is the sheet. */
html.hv-on { background: var(--canvas); }
html.hv-on body { padding: 0; min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
html.hv-on main { width: calc(100% - 2 * var(--sheet-m)); max-width: var(--content-max); margin: 0 auto var(--sheet-m); padding: 12px var(--gut) 72px;
  background: var(--sheet); border: 1px solid var(--sheet-line); border-radius: 16px; box-shadow: var(--sheet-shadow); min-height: calc(100vh - var(--top-h) - var(--sheet-m)); min-height: calc(100dvh - var(--top-h) - var(--sheet-m)); }
html.hv-on main.w-narrow { max-width: calc(780px + 2 * var(--gut)); }
html.hv-on main.w-mid { max-width: calc(1240px + 2 * var(--gut)); }
html.hv-on .hv-legacy-nav { display: none !important; }
.hv-skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--sheet); color: var(--ink); padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line-strong); transition: top var(--d1); }
.hv-skip:focus { top: 12px; }
.hv-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hv-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:root .hv-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 0; padding: 0; margin: 0; border-radius: 999px; background: transparent; color: var(--ink-2); border: 0; box-shadow: none; }
:root .hv-iconbtn:hover { background: var(--hover); color: var(--ink); }
.hv-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 400 22px/1 var(--disp); letter-spacing: -.01em; white-space: nowrap; }
.hv-brand i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage-line); }
.hv-kbd, .hv-search kbd, .hv-pal kbd { font: 500 11px/1 var(--ui); color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 6px; background: none; }
.hv-scrim { position: fixed; inset: 0; z-index: 24; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity var(--d2) var(--ease); }
.hv-hidden-item { display: none !important; }
mark { background: var(--hl); color: inherit; border-radius: 3px; padding: 0 1px; }

/* top bar (tablet and desktop): on the canvas, no line under it; breadcrumbs on the left, the search field, who is signed in */
.hv-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--sheet-m) 0;
  background: var(--chrome); }
.hv-top button { margin: 0; }
.hv-title { display: none; }
.hv-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.hv-crumbs ol { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.hv-crumbs li { display: flex; gap: 8px; align-items: center; min-width: 0; }
.hv-crumbs li + li::before { content: "/"; color: var(--line-strong); }
.hv-crumbs a { color: var(--ink-2); text-decoration: none; } .hv-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.hv-crumbs [aria-current] { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.hv-top > * { flex-shrink: 0; } .hv-top > .hv-crumbs, .hv-top > .hv-search { flex-shrink: 1; }
@media (max-width: 1399px) { html.hv-on .hv-who { display: none; } }
/* the search field in the bar is a button that opens the palette */
:root .hv-search { position: relative; display: flex; align-items: center; gap: 10px; width: min(340px, 28vw); min-height: 36px; height: 36px; margin: 0 0 0 auto; padding: 0 12px; text-align: left; font: 400 14px var(--ui);
  color: var(--ink-3); background: var(--sheet); border: 1px solid var(--sheet-line); border-radius: 10px; box-shadow: none; }
:root .hv-search:hover { background: var(--sheet); border-color: var(--line-strong); color: var(--ink-2); }
.hv-search .hv-ico { width: 17px; height: 17px; }
.hv-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-search kbd { margin-left: auto; }
/* the phone sheet's own search (Go to…) is a real field with its results under it */
:root .hv-search-in { display: block; width: 100%; height: auto; padding: 0; background: none; border: 0; margin: 4px 0 8px; }
.hv-search-in .hv-ico { position: absolute; left: 11px; top: 22px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; z-index: 1; }
:root .hv-search-in input[type=search] { width: 100%; min-width: 0; margin: 0; padding: 10px 14px 10px 36px; font-size: 16px; border-radius: 999px; background: transparent; border-color: var(--line-strong); }
.hv-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 60vh; overflow: auto; padding: 6px 14px; margin: 0; list-style: none;
  background: var(--pop); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop-shadow); }
.hv-results[hidden] { display: none; }
.hv-results li + li { border-top: 1px solid var(--line); }
.hv-results li a { display: flex; align-items: center; gap: 10px; padding: 10px 2px; color: var(--ink); text-decoration: none; }
.hv-results li a .hv-ico { display: none; }
.hv-results li a small { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.hv-results li[aria-selected="true"] a, .hv-results li a:hover { color: var(--ink); font-weight: 600; }
.hv-results li[aria-selected="true"] a::before { content: ""; width: 2px; align-self: stretch; background: var(--rule); margin-left: -8px; margin-right: 6px; }
.hv-results .hv-none { padding: 10px 2px; color: var(--ink-3); }
.hv-user { display: flex; align-items: center; gap: 12px; }
.hv-who { text-align: right; line-height: 1.2; font-size: 13.5px; }
.hv-who small { display: block; color: var(--ink-3); font-size: 12px; }
.hv-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 600 12px var(--ui); color: var(--accent);
  background: var(--tint); border: 0; text-decoration: none; flex: none; }
:root .hv-out { background: none; border: 0; color: var(--ink-2); padding: 6px 2px; min-height: 32px; font: 500 13.5px var(--ui); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
:root .hv-out:hover { background: none; color: var(--ink); }

/* THE MENU: the rail (icons for the six sections and Search) and, beside it, the section panel. */
.hv-side { position: fixed; z-index: 25; left: 0; top: 0; bottom: 0; width: var(--side-w); display: flex; }
.hv-rail { width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: calc(14px + env(safe-area-inset-top)) 0 calc(14px + env(safe-area-inset-bottom));
  background: var(--menu); border-right: 1px solid var(--menu-line); overflow-y: auto; scrollbar-width: none; }
.hv-rail::-webkit-scrollbar { display: none; }
.hv-logo { display: block; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--btn); margin: 0 0 14px; }
.hv-logo i { display: none; }
.hv-sp { flex: 1; min-height: 8px; }
:root .hv-rb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex: none; width: 52px; height: 52px; min-height: 0; margin: 0; padding: 0; border-radius: 10px;
  background: none; border: 0; box-shadow: none; color: var(--ink-m); font: 500 10.5px/1.1 var(--ui); text-align: center; }
:root .hv-rb[hidden] { display: none; }
:root .hv-rb:hover { background: var(--hover); color: var(--ink); }
:root .hv-rb.on { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--menu-line); }
.hv-rb.on .hv-ico { stroke: var(--accent); }
.hv-rb[aria-current="true"]:not(.on)::after { content: ""; position: absolute; top: 7px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--rule); }
.hv-rb .hv-ico { width: 19px; height: 19px; }
.hv-panel { width: var(--panel-w); flex: none; display: flex; flex-direction: column; padding: calc(18px + env(safe-area-inset-top)) 14px 0; background: var(--menu-2); border-right: 1px solid var(--menu-line);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; color: var(--ink); }
.hv-panel h2 { font: 400 26px/1.15 var(--disp); letter-spacing: -.01em; margin: 0; padding: 0 10px; }
.hv-panel h2::after { display: none !important; }
.hv-panel h3 { font: 600 10.5px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-m); margin: 0; padding: 0 10px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.hv-panel h3 span { font-weight: 500; letter-spacing: .02em; text-transform: none; }
.hv-panel ul { list-style: none; margin: 0; padding: 0; }
.hv-panel section { flex: none; }
.hv-pmsg { margin: 0; padding: 0 10px; font-size: 12.5px; color: var(--ink-m); }
.hv-pmsg:empty { display: none; }
.hv-pmsg:not(:empty) { padding-bottom: 8px; }
.hv-bl { margin: 4px 0 0; padding: 0 10px 14px; color: var(--ink-m); font-size: 13px; border-bottom: 1px solid var(--menu-line); }
.hv-pinned { padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--menu-line); }
.hv-pinned h3 { padding-top: 2px; }
.hv-pinned ul { max-height: 252px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hv-empty { margin: 0; padding: 0 10px; color: var(--ink-m); font-size: 12.5px; line-height: 1.45; }
.hv-sec ul { padding: 8px 0 6px; }
.hv-panel li { position: relative; }
.hv-pl { display: block; padding: 7px 36px 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.hv-pl b { display: block; font: 600 13.5px/1.3 var(--ui); }
.hv-pl span { display: block; margin-top: 1px; color: var(--ink-m); font-size: 12px; line-height: 1.3; }
@media (hover: hover) { .hv-pl:hover { background: var(--hover); } }
.hv-panel li.on > .hv-pl { background: var(--sheet); box-shadow: inset 3px 0 0 var(--rule), inset 0 0 0 1px var(--menu-line); }
.hv-pinned .hv-pl { padding-top: 5px; padding-bottom: 5px; padding-right: 92px; }
.hv-pinned .hv-pl b { font-weight: 500; font-size: 13.5px; }
.hv-pinned li.on > .hv-pl b { font-weight: 600; }
:root .hv-star, :root .hv-mv button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-height: 0; margin: 0; padding: 0; border-radius: 7px; background: none; border: 0; box-shadow: none; color: var(--ink-m); }
:root .hv-star:hover, :root .hv-mv button:hover { background: var(--hover); color: var(--ink); }
.hv-star .hv-ico, .hv-mv .hv-ico { width: 16px; height: 16px; }
.hv-star { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity var(--d1); }
.hv-panel li:hover > .hv-star, .hv-panel li:focus-within > .hv-star, .hv-star[aria-pressed="true"], .hv-star:focus-visible { opacity: 1; }
.hv-star[aria-pressed="true"] { color: var(--rule); }
.hv-star[aria-pressed="true"] .hv-ico { fill: currentColor; }
@media (hover: none) { .hv-star { opacity: .8; } }
.hv-mv { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); display: flex; opacity: 0; transition: opacity var(--d1); }
.hv-panel li:hover > .hv-mv, .hv-panel li:focus-within > .hv-mv { opacity: 1; }
@media (hover: none) { .hv-mv { opacity: .8; } }
:root .hv-mv button:disabled { opacity: .3; cursor: default; }
.hv-qa { border-top: 1px solid var(--menu-line); padding-top: 14px; margin-top: 6px; }
.hv-qa h3 { padding-bottom: 8px; }
.hv-pill { display: inline-block; padding: 5px 11px; margin: 0 6px 6px 0; border: 1px solid var(--menu-line); border-radius: 999px; background: var(--sheet); color: var(--ink); font-size: 12.5px; line-height: 1.3; text-decoration: none; }
.hv-pills { padding: 0 10px; }
@media (hover: hover) { .hv-pill:hover { border-color: var(--line-strong); } }
.hv-recent { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--menu-line); }
.hv-recent[hidden] { display: none; }
.hv-recent .hv-pl { padding-top: 5px; padding-bottom: 5px; padding-right: 10px; }
.hv-recent .hv-pl b { font-weight: 500; }
.hv-side-foot { margin: auto 0 0; padding: 16px 10px 16px; position: sticky; bottom: 0; background: var(--menu-2); border-top: 1px solid var(--menu-line); display: grid; gap: 10px; }
.hv-recent + .hv-side-foot, .hv-sec + .hv-side-foot { margin-top: auto; }
.hv-panel > .hv-sec { padding-bottom: 18px; }
.hv-seg { display: flex; gap: 6px; flex-wrap: wrap; }
:root .hv-seg button { flex: none; margin: 0; min-height: 32px; padding: 5px 13px; font: 500 12.5px var(--ui); color: var(--ink-2); background: none; border: 1px solid var(--line-strong); box-shadow: none; border-radius: 999px; }
:root .hv-seg button:hover { color: var(--ink); background: none; }
:root .hv-seg button[aria-pressed="true"] { background: var(--walnut-soft); border-color: transparent; color: var(--ink); font-weight: 600; }
:root .hv-help-link { font: 400 13px var(--ui); color: var(--ink-m); background: none; border: 0; box-shadow: none; padding: 4px 0; min-height: 0; text-align: left; border-radius: 0; }
:root .hv-help-link:hover { color: var(--ink); background: none; }
html.hv-pending .hv-panel > *, html.hv-pending .hv-rb[data-sec] { visibility: hidden; }

/* page header: the section's name in small capitals, the serif title, the line under it. On phones the title is the switcher between the section's pages. */
.hv-pagehead { padding: 26px 0 0; margin: 0 0 34px; }
.hv-pagehead h1 { margin: 0; }
.hv-pagehead .sub { margin: 10px 0 0; max-width: 72ch; font-size: 15.5px; }
.hv-eyebrow { font: 600 11px/1 var(--ui); letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.hv-titlerow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hv-titlerow h1 { min-width: 0; }
:root .hv-tswitch { display: none; flex: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0 0 0 -4px; padding: 0; background: none; border: 0; color: var(--walnut-ink); }
:root .hv-tswitch:hover { background: none; }
.hv-tswitch span { display: inline-flex; align-items: center; justify-content: center; height: 26px; width: 34px; border: 1px solid var(--line-strong); border-radius: 999px; }
.hv-tswitch .hv-ico { width: 16px; height: 16px; stroke-width: 1.8; transition: transform var(--d2) var(--ease); }
.hv-tswitch[aria-expanded="true"] .hv-ico { transform: rotate(180deg); }
.hv-tswitch[aria-expanded="true"] span { background: var(--walnut-soft); border-color: transparent; }
/* phone only: the star beside the title pins the page */
:root .hv-pinthis { display: none; flex: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; color: var(--ink-3); border-radius: 999px; }
:root .hv-pinthis:hover { background: none; color: var(--ink); }
.hv-pinthis .hv-ico { width: 20px; height: 20px; }
.hv-pinthis[aria-pressed="true"] { color: var(--rule); }
.hv-pinthis[aria-pressed="true"] .hv-ico { fill: currentColor; }
.hv-tmenu { position: fixed; z-index: 61; left: 14px; right: 14px; max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; background: var(--pop); border: 1px solid var(--line); border-radius: 20px;
  padding: 10px 20px 12px; box-shadow: var(--pop-shadow); transform-origin: 20% 0; animation: hvPop .2s cubic-bezier(.22,.8,.24,1) both; }
.hv-tmenu[hidden], .hv-tscrim[hidden] { display: none; }
.hv-tscrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); animation: hvFade var(--d2) var(--ease) both; }
.hv-tmenu .hv-tmh { font: 600 10.5px/1 var(--ui); letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); padding: 10px 0 10px; border-bottom: 1px solid var(--line); }
.hv-tmenu a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 400 17px/1.2 var(--disp); }
.hv-tmenu a:last-child { border-bottom: 0; }
.hv-tmenu a[aria-current="page"] { font-weight: 600; }
.hv-tmenu a[aria-current="page"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rule); margin-left: auto; }

/* phone dock: a slim floating pill with Home, Go to… and Menu; it slides away while you scroll down and comes back when you scroll up */
.hv-dock { position: fixed; z-index: 30; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: none; gap: 2px; padding: 4px;
  background: var(--pop); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--pop-shadow); transition: transform var(--d2) var(--ease), opacity var(--d2) var(--ease); }
:root .hv-dk { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 16px; margin: 0; border: 0; border-radius: 999px; background: none; color: var(--ink); font: 500 14px/1 var(--ui); text-decoration: none; white-space: nowrap; box-shadow: none; }
:root .hv-dk:hover { background: var(--hover); }
:root .hv-dk .hv-ico { width: 18px; height: 18px; }
:root .hv-dk[aria-current="page"], :root .hv-dk[aria-expanded="true"] { background: var(--walnut-soft); color: var(--ink); }
html.hv-dock-away .hv-dock, html.hv-tm-open .hv-dock { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }

/* the sheet (phone): Menu shows the pinned pages and every page by group in two columns, the look switch, shortcuts and sign out; Go to… opens it on the search */
.hv-sheet { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; }
.hv-sheet[hidden] { display: none; }
.hv-sheet-back { position: absolute; inset: 0; background: var(--scrim); animation: hvFade var(--d2) var(--ease) both; }
.hv-sheet-panel { position: relative; max-height: 88vh; max-height: 88dvh; overflow: auto; overscroll-behavior: contain; background: var(--pop); border-radius: 24px 24px 0 0; border-top: 1px solid var(--line-strong);
  padding: 8px 22px calc(22px + env(safe-area-inset-bottom)); animation: hvRise .3s cubic-bezier(.22,.8,.24,1) both; box-shadow: 0 -10px 30px rgba(0,0,0,.16); }
.hv-sheet-grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 4px auto 12px; }
.hv-sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.hv-sheet-head h2 { margin: 0; flex: 1; font-size: 24px; }
.hv-sheet-head h2::after { display: none; }
.hv-sheet .hv-results { position: static; box-shadow: none; border: 0; border-radius: 0; padding: 0; max-height: none; background: none; }
.hv-sheet .hv-results li a { min-height: 48px; font: 400 17px/1.2 var(--disp); }
.hv-nav h2 { font: 600 10.5px/1 var(--ui); letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); margin: 0; padding: 16px 0 6px; }
.hv-nav h2::after { display: none !important; }
.hv-nav ul { list-style: none; margin: 0; padding: 0 0 8px; }
.hv-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 5px 0; color: var(--ink-2); text-decoration: none; font: 400 15.5px/1.25 var(--disp); }
.hv-link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.hv-sheet .hv-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.hv-sheet .hv-nav section { margin: 0; border-top: 0; min-width: 0; }
.hv-sheet .hv-nav section[data-g="home"], .hv-sheet .hv-nav section[data-g="pinned"] { grid-column: 1 / -1; }
.hv-sheet .hv-nav section[data-g="pinned"] ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.hv-sheet .hv-nav h2 { padding: 14px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.hv-sheet .hv-link { min-height: 44px; padding: 4px 0; font-size: 16.5px; }
.hv-sheet .hv-link .hv-ico { display: none; }
.hv-sheet .hv-link[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 2px; background: var(--rule); }
.hv-sheet-panel.hv-searching .hv-nav, .hv-sheet-panel.hv-searching .hv-sheet-acct, .hv-sheet-panel[data-mode="goto"] .hv-sheet-acct, .hv-sheet-panel[data-mode="goto"] .hv-nav { display: none; }
.hv-sheet-acct { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.hv-sheet-acct .hv-row { display: flex; align-items: center; gap: 12px; }
.hv-sheet-acct .row { gap: 8px; }
.hv-sheet-acct .row button { margin: 0; }
@keyframes hvRise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hvFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hvPop { from { transform: scale(.96) translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* help dialog */
.hv-dialog { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.hv-dialog[hidden] { display: none; }
.hv-dialog-box { position: relative; width: min(560px, 100%); max-height: 86vh; overflow: auto; background: var(--pop); border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px; box-shadow: var(--pop-shadow); animation: hvFade var(--d2) var(--ease) both; }
.hv-dialog-box h2 { margin-right: 40px; }
.hv-dialog-box h2::after { display: none; }
.hv-dialog-box .hv-iconbtn { position: absolute; right: 12px; top: 12px; }
.hv-keys { display: grid; grid-template-columns: auto 1fr; gap: 0 18px; margin: 0; }
.hv-keys dt, .hv-keys dd { padding: 8px 0; border-top: 1px solid var(--line); }
.hv-keys dt { white-space: nowrap; } .hv-keys dd { margin: 0; color: var(--ink-2); }

/* the palette (Ctrl/Cmd-K): names, keywords and descriptions, grouped by section */
.hv-pal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: min(13vh, 120px) 16px 16px; }
.hv-pal[hidden] { display: none; }
.hv-pal-back { position: absolute; inset: 0; background: var(--scrim); animation: hvFade var(--d2) var(--ease) both; }
.hv-pal-box { position: relative; width: min(720px, 100%); max-height: min(600px, 100%); display: flex; flex-direction: column; overflow: hidden; background: var(--pop); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--pop-shadow); animation: hvPop .18s cubic-bezier(.22,.8,.24,1) both; }
.hv-pal-in { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
:root .hv-pal-in input, :root .hv-pal-in input:focus-visible { flex: 1; min-width: 0; width: auto; padding: 4px 0; font: 400 18px var(--ui); color: var(--ink); background: none !important; border: 0 !important; border-radius: 0; box-shadow: none !important; outline: none; }
.hv-pal-in input::placeholder { color: var(--ink-3); opacity: 1; }
.hv-pal-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 120px; }
.hv-pal-h { font: 600 10.5px/1 var(--ui); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); padding: 14px 20px 6px; }
.hv-pal-list [role="option"] { margin: 0 8px; }
.hv-pal-list [role="option"] a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.hv-pal-list [role="option"][aria-selected="true"] a { background: var(--tint); box-shadow: inset 3px 0 0 var(--rule); }
.hv-pal-list .hv-ico { width: 18px; height: 18px; color: var(--ink-2); }
.hv-pal-t { font: 500 14.5px/1.3 var(--ui); white-space: nowrap; }
.hv-pal-d { margin-left: auto; min-width: 0; color: var(--ink-3); font-size: 12.5px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-pal-list .hv-kbd { flex: none; }
.hv-pal-list .hv-none { padding: 18px 20px; color: var(--ink-3); }
.hv-pal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.hv-pal-foot span { display: inline-flex; align-items: center; gap: 4px; }
.hv-pal-foot .hv-pal-r { margin-left: auto; }

/* -- phone: < 700px -- */
@media (max-width: 699px) {
  html.hv-on { background: var(--sheet); }
  html.hv-on body { padding-top: env(safe-area-inset-top); padding-bottom: calc(var(--dock-h) + 36px + env(safe-area-inset-bottom)); background: var(--sheet); }
  html.hv-on main { width: auto; max-width: var(--content-max); margin: 0 auto; background: none; border: 0; border-radius: 0; box-shadow: none; min-height: 0; padding-top: 4px; }
  html.hv-on .hv-top, html.hv-on .hv-side, html.hv-on .hv-scrim { display: none; }
  html.hv-on .hv-dock { display: flex; }
  html.hv-on .hv-tswitch, html.hv-on .hv-pinthis { display: inline-flex; }
  html.hv-on .hv-pagehead h1[data-hv-switch] { cursor: pointer; }
  .hv-pagehead { padding-top: 22px; margin-bottom: 28px; }
  html.hv-on .filterbar { top: 0; }
  .split-detail, .split .sticky { max-height: none; }
  button { min-height: 44px; }
  :root button.sm, :root button.small, :root button.btn-s, :root td button { min-height: 36px; }
  .tabs { gap: 20px; }
  .hv-pal { padding-top: 10vh; }
  .hv-pal-d, .hv-pal-foot .hv-pal-r, .hv-pal-list .hv-kbd { display: none; }
}
/* -- tablet and desktop: no dock, no sheet; the rail is always there -- */
@media (min-width: 700px) {
  html.hv-on .hv-dock, html.hv-on .hv-sheet, html.hv-on .hv-tmenu, html.hv-on .hv-tscrim, html.hv-on .hv-top .hv-brand { display: none; }
  html.hv-on body { padding-left: var(--rail-w); }
}
/* -- tablet: the rail alone; tapping a section opens its panel over the page (Esc or a click outside closes it) -- */
@media (min-width: 700px) and (max-width: 1100px) {
  .hv-side { width: var(--rail-w); }
  .hv-panel { position: fixed; left: var(--rail-w); top: 0; bottom: 0; width: min(340px, calc(100vw - var(--rail-w) - 24px)); visibility: hidden; opacity: 0; transform: translateX(-14px);
    transition: transform var(--d2) var(--ease), opacity var(--d2) var(--ease), visibility 0s linear var(--d2); box-shadow: var(--pop-shadow); }
  html.hv-open .hv-panel { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  html.hv-open .hv-scrim { opacity: 1; pointer-events: auto; }
  .hv-search { width: auto; flex: 1; max-width: 320px; }
}
/* -- desktop: rail + panel; the toggle (or [) folds the panel away -- */
@media (min-width: 1101px) {
  html.hv-on .hv-scrim { display: none; }
  html.hv-on body { padding-left: var(--side-w); }
  html.hv-on.hv-collapsed body { padding-left: var(--rail-w); }
  html.hv-collapsed .hv-side { width: var(--rail-w); }
  html.hv-collapsed .hv-panel { display: none; }
}

/* ---------- login and other pages without the sidebar ---------- */
body.hv-solo { display: flex; align-items: flex-start; justify-content: center; padding: max(56px, 12vh) 20px 32px; }
body.hv-solo main { width: 100%; max-width: 400px; margin: 0; }
body.hv-solo h1 { font-size: 48px; margin-bottom: 4px; }
body.hv-solo h1 + .sub { font: 600 11px/1 var(--ui); letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); margin: 10px 0 28px; }
body.hv-solo .card { padding-top: 22px; }
body.hv-solo button[type=submit] { width: 100%; margin-top: 20px; }

/* ---------- print: the page only, never the chrome ---------- */
@media print {
  .hv-top, .hv-side, .hv-dock, .hv-sheet, .hv-dialog, .hv-pal, .hv-skip, .hv-scrim, .hv-eyebrow, .hv-tswitch, .hv-pinthis, .hv-tmenu, .hv-tscrim { display: none !important; }
  html.hv-on body, body { padding: 0 !important; background: #fff !important; color: #000; }
  html.hv-on main { max-width: none; width: auto; padding: 0; margin: 0; background: none; border: 0; border-radius: 0; box-shadow: none; min-height: 0; }
  .hv-pagehead { border: 0; padding: 0; margin-bottom: 16px; }
  :root .card { border-top-color: #bbb; }
  :root .paper { border: 0; padding: 0; background: #fff; }
  .wrap, .table-wrap, .tall { max-height: none !important; overflow: visible !important; }
  .grid, .tiles, .grid-2, .grid-3, .grid-4 { clip-path: none !important; }
}
