/* class.ui.css: the design system of class.ui.js. Every colour is hsl: a dial, a token derived from dials, or hsl(from a token). Nothing else is allowed. Dials (--hp-*) set the look, tokens (--ui-*) are computed from them, rules read tokens only.
 * Dials and derivation are the PublonLean edition (see notes.ui.md). A theme overrides dials, never rules. Dark mode is one dial, --dark. */
@import url('../Client-ExternalLibraries/fonts/fonts.css');	/* the three default faces, bundled: the page reads the same with no internet and from a file */
/* ---- 1. Hyper-parameters: every dial ---- */
:root {
    --dark: 0;  /* 0 light, 1 dark; set by the person's scheme unless the page names its theme */
    --hp-font-body: "IBM Plex Sans", "Helvetica Neue", system-ui, sans-serif; --hp-font-heading: "Source Serif 4", Georgia, serif;
    --hp-font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
    /* Shapes and chrome a theme may turn: a control's corner, the top bar's ink, and the widths of a side column, a page and a reading column. */
    --hp-control-radius: var(--ui-radius-md); --hp-chrome-fg: var(--ui-on-primary); --hp-chrome-fg-muted: var(--hp-on-primary-muted); --hp-chrome-accent: var(--hp-chrome-fg);
    /* A control's size and weight (buttons, tabs, fields), the primary colour's own lightness and that of its strong step, how much of the
       page's tint the text, the quiet text and the borders take, and the tracking of headings. */
    --hp-control-pad-y: var(--ui-space-1); --hp-control-text: var(--ui-text-sm); --hp-control-weight: 500;
    --hp-l-1: 45%; --hp-l-1-strong: calc(var(--hp-l-1) - 7%);
    --hp-sat-fg: min(calc(var(--hp-sat-bg) * 1.5), 18%); --hp-sat-muted: min(calc(var(--hp-sat-bg) * 0.85), 12%); --hp-sat-border: min(var(--hp-sat-bg), 30%);	/* a strongly tinted page keeps near-neutral ink */
    --hp-heading-tracking: 0em; --hp-eyebrow-transform: uppercase; --hp-eyebrow-tracking: 0.09em;
    --hp-side-width: 17rem; --hp-page-width: 80rem; --hp-read-width: 46rem;
    --hp-weight-body: 400; --hp-weight-heading: 600;
    --hp-text-scale: 0.95; --hp-text-ratio: 1.22; --hp-line-height: 1.55;
    --hp-label-transform: none; --hp-label-tracking: 0.01em;	/* capitals would garble labels that carry case: pH, mL, E. coli */
    --hp-density: 1; --hp-pad-base: 0.5rem;
    --hp-corner-scale: 0.6; --hp-border-scale: 1; --hp-shadow-scale: 1; --hp-shadow-intensity: calc(0.05 + 0.4 * var(--dark)); --hp-transition-speed: 1;
    --hp-avatar-size: 2.4rem; --hp-modal-max-w: 600px; --hp-active-marker-w: 3px; --hp-tab-underline-w: 2px;
    --hp-hue-1: 205; --hp-sat-1: 68%; --hp-l-shift-1: 0%;
    --hp-hue-danger: 4; --hp-sat-danger: 82%; --hp-hue-warn: 32; --hp-sat-warn: 94%;
    --hp-hue-2: 35; --hp-sat-2: 78%;
    --hp-hue-bg: 205; --hp-sat-bg: 12%;  /* the hue and tint of the page, surfaces, borders and text */
    --hp-hue-success: 142; --hp-sat-success: 72%; --hp-hue-info: 200; --hp-sat-info: 82%;
    --hp-l-paper: 96.5%;	/* the page's lightness in the light scheme; the dark scheme's page is derived from it */
    --hp-l-bg: calc(var(--hp-l-paper) - (var(--hp-l-paper) - 8%) * var(--dark)); --hp-l-elev: calc(100% - 88% * var(--dark) - min(var(--hp-sat-bg), 30%) * 0.08 * (1 - var(--dark)));  /* raised surfaces take a little of the background tint */ --hp-l-sunken: calc(var(--hp-l-paper) - 2.5% - (var(--hp-l-paper) - 7.5%) * var(--dark));
    --hp-l-fg: calc(11% + 84% * var(--dark)); --hp-l-muted: calc(36% + 29% * var(--dark)); --hp-l-border: calc(87% - 65% * var(--dark)); --hp-l-border-input: calc(68% - 28% * var(--dark));
    --hp-chrome-bg: hsl(var(--hp-hue-bg), calc(var(--hp-sat-bg) * 0.7), 10%);
    --hp-on-primary-muted: hsl(0 0% 100% / 0.92);
    /* Layout parameters. Each is a plain CSS value a theme may set; uiHyperParams offers them as named choices (UI_CHOICES).
       Navigation: where the bar of a uiNavBar sits (top, side, bottom) and how its links run. */
    --hp-nav-flow: column; --hp-nav-flow-narrow: column; --hp-nav-bar-flow: row; --hp-nav-bar-width: auto; --hp-nav-bar-align: center; --hp-nav-bar-wrap: wrap;
    --hp-nav-bar-position: static; --hp-nav-actions-margin: 0 0 0 auto; --hp-nav-tab-justify: center; --hp-nav-bar-height: auto;
    /* Surfaces: a card's ground and which of its edges are drawn. Page: the ground behind a page, the page's own ground and shadow, a view's width. */
    --hp-card-bg: var(--ui-bg-elev); --hp-card-line-width: var(--ui-border-width);
    --hp-desk: var(--ui-bg); --hp-page-bg: transparent; --hp-page-shadow: none; --hp-view-width: none; --hp-page-radius: 0; --hp-page-line: 0;
    /* Tabs: the corner of a tab, the ground of the selected one (in a view and in the top bar), and the line under a bar of tabs. */
    --hp-tab-radius: 0; --hp-tab-selected-bg: transparent; --hp-tab-selected-chrome-bg: transparent; --hp-tab-selected-chrome-fg: var(--hp-chrome-fg); --hp-tab-bar-line: var(--ui-line);
    /* Bar: its shadow, the line beneath it, and what is written before each of its tabs (counter(tab) numbers them). Headings: the colour and the capitals of a section's heading. */
    --hp-chrome-shadow: var(--ui-shadow-sm); --hp-chrome-line: 0; --hp-nav-number: none;
    /* Categorical series, in fixed order: the validated reference palette, each stepped for the dark surface by the dark dial. A theme sets its own. */
    --hp-series-1: hsl(213, calc(68% + 9% * var(--dark)), calc(50% + 6% * var(--dark))); --hp-series-2: hsl(17, calc(82% - 12% * var(--dark)), calc(56% - 6% * var(--dark))); --hp-series-3: hsl(159, 73%, calc(40% - 4% * var(--dark))); --hp-series-4: hsl(41, 100%, calc(46% - 7% * var(--dark))); --hp-series-5: hsl(337, calc(70% - 9% * var(--dark)), calc(70% - 12% * var(--dark))); --hp-series-6: hsl(120, 100%, 26%); --hp-series-7: hsl(248, calc(63% + 7% * var(--dark)), calc(58% + 14% * var(--dark))); --hp-series-8: hsl(0, 73%, calc(59% + 6% * var(--dark)));
    --hp-heading-color: currentColor; --hp-heading-caps: normal;
    /* A view's parts (Service.view): each part's surface (ground, padding, corner, edge, shadow), the room between parts, and the face, size and
       weight of a part's heading. By default a part has no surface of its own. */
    --hp-part-bg: transparent; --hp-part-pad: 0; --hp-part-radius: 0; --hp-part-line: 0; --hp-part-shadow: none; --hp-part-gap: var(--ui-space-4);
    --hp-part-heading-font: var(--hp-font-heading); --hp-part-heading-size: var(--ui-text-lg); --hp-part-heading-weight: var(--hp-weight-heading);
    /* Tables: the ground and shadow, the rule above and below the whole table, the line under the heads and under each row, the ground of every second row, and the heads' ink, size and weight. */
    --hp-table-bg: var(--ui-bg-elev); --hp-table-shadow: var(--ui-shadow-sm); --hp-table-rule: 0; --hp-table-head-line: var(--ui-line); --hp-table-row-line: var(--ui-line); --hp-table-stripe: var(--ui-bg-sunken);
    --hp-table-head-fg: var(--ui-fg-muted); --hp-table-head-text: var(--ui-text-xs); --hp-table-head-weight: 500;
}
@media (prefers-color-scheme: dark) { :root { --dark: 1; } }
:root[data-theme="light"] { --dark: 0; color-scheme: light; }
:root[data-theme="dark"] { --dark: 1; color-scheme: dark; }
/* ---- 2. Derived tokens: redeclared on every theme anchor, so an override of a dial there re-derives them ---- */
:root, [class*="ui-theme-"], [data-theme] {
    --ui-text-xs: calc(0.75rem * var(--hp-text-scale)); --ui-text-sm: calc(0.875rem * var(--hp-text-scale)); --ui-text-base: calc(1rem * var(--hp-text-scale));
    --ui-text-lg: calc(var(--ui-text-base) * var(--hp-text-ratio)); --ui-text-xl: calc(var(--ui-text-lg) * var(--hp-text-ratio));
    --ui-space-1: calc(var(--hp-pad-base) * 0.5 * var(--hp-density)); --ui-space-2: calc(var(--hp-pad-base) * var(--hp-density)); --ui-space-3: calc(var(--hp-pad-base) * 1.5 * var(--hp-density));
    --ui-space-4: calc(var(--hp-pad-base) * 2 * var(--hp-density));
    --ui-radius-sm: calc(0.25rem * var(--hp-corner-scale)); --ui-radius-md: calc(0.375rem * var(--hp-corner-scale)); --ui-radius-lg: calc(0.5rem * var(--hp-corner-scale)); --ui-radius-full: 9999px;
    --ui-border-width: calc(1px * var(--hp-border-scale));
    --ui-shadow-sm: 0 calc(1px * var(--hp-shadow-scale)) calc(3px * var(--hp-shadow-scale)) hsl(var(--hp-hue-bg) 30% 10% / calc(var(--hp-shadow-intensity) * 1.6));
    --ui-shadow-lg: 0 calc(6px * var(--hp-shadow-scale)) calc(20px * var(--hp-shadow-scale)) hsl(var(--hp-hue-bg) 30% 10% / calc(var(--hp-shadow-intensity) * 2.5));
    --ui-transition-fast: calc(120ms * var(--hp-transition-speed)); --ui-transition-base: calc(200ms * var(--hp-transition-speed));
    --ui-primary-50: hsl(var(--hp-hue-1), calc(var(--hp-sat-1) - 38% * var(--dark)), calc(97% - 83% * var(--dark) + var(--hp-l-shift-1)));
    --ui-primary-100: hsl(var(--hp-hue-1), calc(var(--hp-sat-1) - 33% * var(--dark)), calc(92% - 74% * var(--dark) + var(--hp-l-shift-1)));
    --ui-primary-600: hsl(var(--hp-hue-1), var(--hp-sat-1), calc(var(--hp-l-1) + 10% * var(--dark) + var(--hp-l-shift-1)));
    --ui-primary-700: hsl(var(--hp-hue-1), var(--hp-sat-1), calc(var(--hp-l-1-strong) + 36% * var(--dark) + var(--hp-l-shift-1)));
    --ui-primary: var(--ui-primary-600); --ui-on-primary: hsl(0, 0%, 100%);
    --ui-focus-ring: 0 0 0 3px var(--ui-primary-100); --ui-focus-outline: 2px solid var(--ui-primary);
    --ui-secondary: hsl(var(--hp-hue-2), var(--hp-sat-2), calc(38% + 17% * var(--dark))); --ui-secondary-100: hsl(var(--hp-hue-2), calc(var(--hp-sat-2) - 43% * var(--dark)), calc(92% - 74% * var(--dark))); --ui-secondary-700: hsl(var(--hp-hue-2), var(--hp-sat-2), calc(28% + 46% * var(--dark)));
    --ui-danger: hsl(var(--hp-hue-danger), var(--hp-sat-danger), calc(45% + 20% * var(--dark))); --ui-danger-100: hsl(var(--hp-hue-danger), calc(var(--hp-sat-danger) - 47% * var(--dark)), calc(95% - 77% * var(--dark)));
    --ui-warn: hsl(var(--hp-hue-warn), var(--hp-sat-warn), calc(30% + 35% * var(--dark))); --ui-warn-100: hsl(var(--hp-hue-warn), calc(var(--hp-sat-warn) - 59% * var(--dark)), calc(95% - 77% * var(--dark)));
    --ui-success: hsl(var(--hp-hue-success), var(--hp-sat-success), calc(26% + 34% * var(--dark))); --ui-success-100: hsl(var(--hp-hue-success), calc(var(--hp-sat-success) - 37% * var(--dark)), calc(94% - 76% * var(--dark)));
    --ui-info: hsl(var(--hp-hue-info), var(--hp-sat-info), calc(34% + 31% * var(--dark))); --ui-info-100: hsl(var(--hp-hue-info), calc(var(--hp-sat-info) - 47% * var(--dark)), calc(94% - 76% * var(--dark)));
    --ui-gray-100: hsl(var(--hp-hue-bg), var(--hp-sat-bg), calc(96% - 80% * var(--dark)));
    --ui-bg: hsl(var(--hp-hue-bg), var(--hp-sat-bg), var(--hp-l-bg)); --ui-bg-elev: hsl(var(--hp-hue-bg), var(--hp-sat-bg), var(--hp-l-elev)); --ui-bg-sunken: hsl(var(--hp-hue-bg), var(--hp-sat-bg), var(--hp-l-sunken));
    --ui-fg: hsl(var(--hp-hue-bg), var(--hp-sat-fg), var(--hp-l-fg)); --ui-fg-muted: hsl(var(--hp-hue-bg), var(--hp-sat-muted), var(--hp-l-muted)); --ui-border: hsl(var(--hp-hue-bg), var(--hp-sat-border), var(--hp-l-border));
    --ui-border-input: hsl(var(--hp-hue-bg), var(--hp-sat-border), var(--hp-l-border-input));	/* an input's edge, unselected: plainer to see than a card's line */
    --ui-line: var(--ui-border-width) solid var(--ui-border);
    --ui-series-1: var(--hp-series-1); --ui-series-2: var(--hp-series-2); --ui-series-3: var(--hp-series-3); --ui-series-4: var(--hp-series-4); --ui-series-5: var(--hp-series-5); --ui-series-6: var(--hp-series-6); --ui-series-7: var(--hp-series-7); --ui-series-8: var(--hp-series-8);
}
/* ---- 3. Reset and base ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
input, select, textarea, button { margin: 0; }	/* browsers add margins to native controls, which push a full-width slider past its container */
html { color-scheme: light dark; }
body { margin: 0; font-family: var(--hp-font-body); font-size: var(--ui-text-base); font-weight: var(--hp-weight-body); line-height: var(--hp-line-height); color: var(--ui-fg); background: var(--hp-desk); }
b { font-weight: 600; }
.ui-clickable { cursor: pointer; }
:focus-visible { outline: var(--ui-focus-outline); outline-offset: 1px; }
.ui-icon { margin-right: var(--ui-space-1); }
.ui-icon-only { margin-right: 0; }
.ui-empty { padding: var(--ui-space-4); text-align: center; color: var(--ui-fg-muted); }
.ui-spinner::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: var(--ui-space-2); vertical-align: -0.15em; border: 2px solid var(--ui-border); border-top-color: var(--ui-primary); border-radius: var(--ui-radius-full); animation: ui-spin 800ms linear infinite; }
.ui-shake { animation: ui-shake 300ms; }
span.ui-spinner { display: inline-block; padding: var(--ui-space-1) 0; font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-pending { opacity: 0.55; cursor: progress; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
/* Tones: colour words a ui can carry. */
.ui-tone-info { color: var(--ui-info); --ui-tone-fg: var(--ui-info); --ui-tone-bg: var(--ui-info-100); }
.ui-tone-secondary { color: var(--ui-secondary-700); --ui-tone-fg: var(--ui-secondary-700); --ui-tone-bg: var(--ui-secondary-100); }
.ui-tone-success { color: var(--ui-success); --ui-tone-fg: var(--ui-success); --ui-tone-bg: var(--ui-success-100); }
.ui-tone-warn { color: var(--ui-warn); --ui-tone-fg: var(--ui-warn); --ui-tone-bg: var(--ui-warn-100); }
.ui-tone-danger { color: var(--ui-danger); --ui-tone-fg: var(--ui-danger); --ui-tone-bg: var(--ui-danger-100); }
.ui-tone-muted { color: var(--ui-fg-muted); --ui-tone-fg: var(--ui-fg-muted); --ui-tone-bg: var(--ui-gray-100); }
/* ---- 4. Atomic ---- */
.ui-button { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: var(--hp-control-text); font-weight: var(--hp-control-weight); padding: var(--hp-control-pad-y) var(--ui-space-3); color: var(--ui-on-primary); background: var(--ui-primary); border: var(--ui-border-width) solid transparent; border-radius: var(--hp-control-radius); cursor: pointer; transition: filter var(--ui-transition-fast); box-shadow: var(--ui-shadow-sm); }
.ui-button:hover:not(:disabled) { filter: brightness(1.08); }
.ui-button:disabled { opacity: 0.45; cursor: not-allowed; }
.ui-button-secondary { background: var(--ui-secondary); }
.ui-button-quiet { color: var(--ui-primary-700); background: transparent; border-color: var(--ui-border); box-shadow: none; }
.ui-button-quiet:hover:not(:disabled) { background: var(--ui-secondary-100); color: var(--ui-secondary-700); filter: none; }
.ui-pill { display: inline-block; padding: 0 var(--ui-space-2); font-size: var(--ui-text-xs); font-weight: 500; border-radius: var(--ui-radius-full); background: var(--ui-tone-bg, var(--ui-gray-100)); }
.ui-pill.ui-pill-chosen { font-weight: 600; box-shadow: inset 0 0 0 calc(var(--ui-border-width) * 2) currentColor; }	/* a toned pill chosen: its tone kept, the choice a ring */
/* A chip: its class colour, pale with black words until chosen, then full with white words; the same box either way, so nothing moves. */
.ui-pill-solid { padding: calc(var(--ui-space-1) / 2) var(--ui-space-2); color: hsl(0 0% 10%); background: hsl(from var(--mark, var(--ui-secondary)) h calc(s * 0.45) 86%); }
.ui-pill-solid[aria-selected="true"] { color: hsl(0 0% 100%); background: hsl(from var(--mark, var(--ui-secondary)) h s min(l, 38)); }
.ui-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: var(--hp-avatar-size); height: var(--hp-avatar-size); overflow: hidden; font-size: calc(var(--hp-avatar-size) * 0.38); font-weight: 600; line-height: 1; color: hsl(0 0% 100%); background: hsl(from var(--mark, var(--ui-secondary)) h s min(l, 32)); border-radius: var(--ui-radius-full); }
.ui-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ui-avatar-sm { width: calc(var(--hp-avatar-size) * 0.65); height: calc(var(--hp-avatar-size) * 0.65); font-size: calc(var(--hp-avatar-size) * 0.26); }
.ui-avatar-lg { width: calc(var(--hp-avatar-size) * 1.6); height: calc(var(--hp-avatar-size) * 1.6); font-size: calc(var(--hp-avatar-size) * 0.6); }
.ui-with-avatar { display: flex; align-items: center; }
.ui-with-avatar > .ui-avatar { order: -1; margin-right: var(--ui-space-2); }
td > .ui-avatar { margin-right: var(--ui-space-2); vertical-align: middle; }
.ui-metric { color: var(--ui-fg); display: inline-flex; align-items: baseline; gap: var(--ui-space-2); padding: var(--ui-space-1) var(--ui-space-3); background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-sm); }
.ui-metric .ui-port-value { color: var(--ui-secondary-700); font-family: var(--hp-font-mono); font-size: var(--ui-text-lg); font-weight: 500; }
.ui-metric .ui-port-label { font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
.ui-progress { width: 100%; height: var(--ui-space-2); accent-color: var(--ui-primary); }
.ui-callout, .ui-port-messages { padding: var(--ui-space-2) var(--ui-space-3); background: var(--ui-tone-bg, var(--ui-gray-100)); border-left: var(--hp-active-marker-w) solid currentColor; border-radius: var(--ui-radius-sm); font-size: var(--ui-text-sm); }
.ui-image { max-width: 100%; display: block; }
.ui-image-fill { width: 100%; height: auto; border-radius: var(--ui-radius-sm); }	/* a picture that is the view's subject fills its column */
.ui-card { display: flex; flex-direction: column; background: var(--hp-card-bg); border: var(--ui-line); border-width: var(--hp-card-line-width); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-sm); }
.ui-card > .ui-port-header { padding: var(--ui-space-2) var(--ui-space-4); font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); border-bottom: var(--ui-line); }
.ui-card > .ui-port-body { padding: var(--ui-space-3) var(--ui-space-4); flex: 1 1 auto; min-height: 0; }
.ui-card > .ui-port-footer:not(:empty) { padding: var(--ui-space-2) var(--ui-space-4); border-top: var(--ui-line); display: flex; gap: var(--ui-space-2); justify-content: flex-end; }
/* A section's heading takes its colour and capitals from dials. The selectors carry no weight, so a rule that colours a heading still does. */
:where(.ui-card:not(.ui-card-tile) > .ui-port-header, .ui-datatable > .ui-port-title, .ui-form > .ui-port-title, .ui-marks > .ui-port-title, .ui-marks > .ui-port-top > .ui-port-title, .ui-shelf-title) { color: var(--hp-heading-color); }
:where(.ui-card > .ui-port-header, .ui-datatable > .ui-port-title, .ui-form > .ui-port-title, .ui-shelf-title) { font-variant-caps: var(--hp-heading-caps); }
.ui-card > .ui-port-header :is(input, select, textarea), .ui-datatable > .ui-port-title :is(input, select, textarea), .ui-form > .ui-port-title :is(input, select, textarea) { font-variant-caps: normal; }	/* what is typed in a field beside a heading keeps its own letters */
.ui-grid { display: flex; gap: var(--ui-space-4); align-items: stretch; min-height: 0; }
.ui-grid > * { flex: 1 1 0; min-width: 0; }
.ui-grid-LM > .ui-port-left, .ui-grid-MR > .ui-port-right { flex: 1 1 0; }
.ui-grid-LM > .ui-port-mid, .ui-grid-MR > .ui-port-mid { flex: 2 1 0; }
@media (max-width: 720px) { .ui-grid { flex-direction: column; } .ui-grid > [class] { flex: 0 0 auto; } }
.ui-modal { width: min(var(--hp-modal-max-w), 90vw); padding: 0; color: var(--ui-fg); background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-lg); }
.ui-modal::backdrop { background: hsl(var(--hp-hue-bg) 30% 5% / 0.45); }
.ui-modal-bar { display: flex; align-items: center; justify-content: space-between; padding: var(--ui-space-2) var(--ui-space-4); font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); border-bottom: var(--ui-line); }
.ui-modal-close { color: var(--ui-fg-muted); background: transparent; box-shadow: none; }
.ui-modal > .ui-port-content > .ui-port-body { padding: var(--ui-space-4); }
/* ---- 4b. Publishing surfaces: variants of the types above and four types of their own (uiCover, uiShelf, uiMasthead, uiToolbar), for a
   page of books, a person's channel and a writing desk. Every one is a template or a new type: the default look of a type is unchanged.
   All of it reads the tokens, so it follows the dials and the dark dial. ---- */
.ui-button-outline { color: var(--ui-fg); background: var(--ui-bg-elev); border-color: var(--ui-border-input); box-shadow: none; }
.ui-button-outline:hover:not(:disabled) { border-color: var(--ui-fg); filter: none; }
.ui-button-link { padding: 0; color: var(--ui-primary-700); background: none; border-color: transparent; border-radius: 0; box-shadow: none; font-weight: 600; }
.ui-button-link:hover:not(:disabled) { text-decoration: underline; filter: none; }
.ui-metric-plain, .ui-metric-stacked { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.ui-metric-stacked { flex-direction: column; align-items: flex-start; gap: 0; }
.ui-metric-plain .ui-port-value, .ui-metric-stacked .ui-port-value { color: var(--ui-fg); font-family: var(--hp-font-heading); font-weight: var(--hp-weight-heading); font-size: var(--ui-text-xl); line-height: 1.1; }
.ui-avatar-xl { width: calc(var(--hp-avatar-size) * 2.7); height: calc(var(--hp-avatar-size) * 2.7); font-size: calc(var(--hp-avatar-size) * 0.85); }
.ui-progress-thin { appearance: none; -webkit-appearance: none; display: block; height: var(--ui-space-1); border: 0; border-radius: var(--ui-radius-full); background: var(--ui-bg-sunken); overflow: hidden; }
.ui-progress-thin::-webkit-progress-bar { background: var(--ui-bg-sunken); }
.ui-progress-thin::-webkit-progress-value { background: var(--ui-primary); border-radius: var(--ui-radius-full); }
.ui-progress-thin::-moz-progress-bar { background: var(--ui-primary); border-radius: var(--ui-radius-full); }
/* Words in three voices: a small label above a title, an opening line, a quiet line of facts. */
.ui-text-eyebrow, .ui-text-lede, .ui-text-meta { margin: 0; }
.ui-text-eyebrow > p, .ui-text-lede > p, .ui-text-meta > p { margin: 0; }
.ui-text-eyebrow { font-size: var(--ui-text-xs); font-weight: 600; letter-spacing: var(--hp-eyebrow-tracking); text-transform: var(--hp-eyebrow-transform); color: var(--ui-primary-700); }
.ui-text-lede { font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); line-height: 1.5; }
.ui-text-meta { font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
/* A list as chips: a row that wraps, the chosen one filled. */
.ui-list-chips > .ui-port-entries { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); }
.ui-list-chips .ui-list-item { padding: var(--ui-space-1) var(--ui-space-3); border: 0; border-radius: var(--ui-radius-full); background: var(--ui-bg-sunken); cursor: pointer; }
.ui-list-chips .ui-list-title { font-size: var(--ui-text-sm); font-weight: 500; }
.ui-list-chips .ui-list-item:hover { background: var(--ui-primary-100); }
.ui-list-chips .ui-list-item.ui-selected { color: var(--ui-on-primary); background: var(--ui-primary); }
.ui-list-chips .ui-list-item.ui-selected .ui-list-title { color: inherit; }
/* A list numbered in order: each entry's place before it. */
.ui-list-ranked > .ui-port-entries { counter-reset: place; }
.ui-list-ranked .ui-list-item { counter-increment: place; display: flex; gap: var(--ui-space-3); align-items: baseline; }
.ui-list-ranked .ui-list-item::before { content: counter(place); font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); color: var(--ui-secondary); }
/* uiCover: a book's face, a picture or type on its series colour. */
.ui-cover { display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 3 / 4; min-width: 0; padding: var(--ui-space-3); overflow: hidden; color: var(--ui-on-primary);
	border-radius: var(--ui-radius-md) var(--ui-radius-lg) var(--ui-radius-lg) var(--ui-radius-md); box-shadow: inset var(--ui-space-1) 0 0 hsl(0 0% 0% / 0.16), var(--ui-shadow-sm);
	background: linear-gradient(160deg, hsl(from var(--mark, var(--ui-primary)) h s min(l, 40)), hsl(from var(--mark, var(--ui-primary)) h s min(l, 24))); }
.ui-cover > .ui-port-series { font-size: var(--ui-text-xs); font-weight: 600; letter-spacing: var(--hp-eyebrow-tracking); text-transform: var(--hp-eyebrow-transform); opacity: 0.82; }
.ui-cover > .ui-port-title { font-family: var(--hp-font-heading); font-weight: var(--hp-weight-heading); font-size: var(--ui-text-lg); line-height: 1.15; }
.ui-cover > .ui-port-foot { font-size: var(--ui-text-xs); opacity: 0.8; }
.ui-cover-plate { padding: 0; }
.ui-cover-plate > .ui-port-plate, .ui-cover-plate .ui-image { width: 100%; height: 100%; object-fit: cover; }
.ui-cover-wide { aspect-ratio: 16 / 10; }
.ui-cover-wide > .ui-port-title { font-size: var(--ui-text-xl); }
.ui-cover-thumb { aspect-ratio: 4 / 3; width: calc(var(--hp-avatar-size) * 3); flex: none; justify-content: flex-end; padding: var(--ui-space-2); }
.ui-cover-thumb > .ui-port-title { font-size: var(--ui-text-sm); }
.ui-cover-thumb > .ui-port-series, .ui-cover-thumb > .ui-port-foot { display: none; }
/* uiCard: an eyebrow above its title and a line of facts beneath its body, and five more shapes. */
.ui-card > .ui-port-media:empty { display: none; }
.ui-card > .ui-port-eyebrow { padding: var(--ui-space-2) var(--ui-space-4) 0; font-size: var(--ui-text-xs); font-weight: 600; letter-spacing: var(--hp-eyebrow-tracking); text-transform: var(--hp-eyebrow-transform); color: var(--ui-primary-700); }
.ui-card > .ui-port-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-1) var(--ui-space-2); padding: 0 var(--ui-space-4) var(--ui-space-3); font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-card.ui-clickable { cursor: pointer; transition: box-shadow var(--ui-transition-fast); }
.ui-card.ui-clickable:hover { box-shadow: var(--ui-shadow-lg); }
/* feature and row: the picture beside the words; feature is the page's opening, row a compact line. */
.ui-card-feature, .ui-card-row { display: grid; align-content: center; overflow: hidden; }
.ui-card-feature { grid-template-columns: 1.25fr 1fr; grid-template-rows: 1fr repeat(5, auto) 1fr; }
.ui-card-feature > .ui-port-eyebrow { grid-row: 2; } .ui-card-feature > .ui-port-header { grid-row: 3; } .ui-card-feature > .ui-port-body { grid-row: 4; } .ui-card-feature > .ui-port-meta { grid-row: 5; } .ui-card-feature > .ui-port-footer { grid-row: 6; }
.ui-card-feature > .ui-port-body, .ui-card-row > .ui-port-body, .ui-card-panel > .ui-port-body { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-card-row > .ui-port-body { gap: var(--ui-space-1); }
.ui-card-row > .ui-port-body:empty { display: none; }
.ui-card-row { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr repeat(5, auto) 1fr; column-gap: var(--ui-space-3); padding: var(--ui-space-3); }
.ui-card-row > .ui-port-eyebrow { grid-row: 2; } .ui-card-row > .ui-port-header { grid-row: 3; } .ui-card-row > .ui-port-body { grid-row: 4; } .ui-card-row > .ui-port-meta { grid-row: 5; } .ui-card-row > .ui-port-footer { grid-row: 6; }
.ui-card-feature > .ui-port-media { grid-column: 1; grid-row: 1 / -1; align-self: stretch; }
.ui-card-row > .ui-port-media { grid-column: 1; grid-row: 1 / -1; }
.ui-card-feature > :not(.ui-port-media), .ui-card-row > :not(.ui-port-media) { grid-column: 2; }
.ui-card-feature > .ui-port-media .ui-image { width: 100%; height: 100%; min-height: calc(var(--hp-side-width) * 1.06); object-fit: cover; }
.ui-card-row > .ui-port-media { align-self: center; }
.ui-card-row > .ui-port-media > .ui-image { width: calc(var(--hp-avatar-size) * 3); aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--ui-radius-md); }
.ui-card-feature > .ui-port-header, .ui-card-row > .ui-port-header, .ui-card-plain > .ui-port-header, .ui-card-tile > .ui-port-header { border-bottom: 0; }
.ui-card-feature > .ui-port-eyebrow, .ui-card-feature > .ui-port-header, .ui-card-feature > .ui-port-body, .ui-card-feature > .ui-port-meta, .ui-card.ui-card-feature > .ui-port-footer:not(:empty) { padding-inline: calc(var(--ui-space-4) * 2.2); }
.ui-card.ui-card-feature > .ui-port-footer:not(:empty) { padding-block: var(--ui-space-2) 0; }
.ui-card-feature > .ui-port-body { gap: var(--ui-space-3); }
.ui-card-feature > .ui-port-header { font-size: calc(var(--ui-text-xl) * 1.77); line-height: 1.15; }
.ui-card-feature > .ui-port-footer:not(:empty), .ui-card-row > .ui-port-footer:not(:empty) { justify-content: flex-start; border-top: 0; }
.ui-card-row > .ui-port-eyebrow, .ui-card-row > .ui-port-header, .ui-card-row > .ui-port-body, .ui-card-row > .ui-port-meta, .ui-card.ui-card-row > .ui-port-footer:not(:empty) { padding: 0; }
.ui-card-row > .ui-port-eyebrow { color: var(--ui-fg-muted); letter-spacing: 0; text-transform: none; font-weight: 500; }
.ui-card-row > .ui-port-header { font-size: calc(var(--ui-text-base) * 1.1); line-height: 1.2; }
.ui-card-row > .ui-port-body { font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-card-row.ui-card-large { column-gap: calc(var(--ui-space-4) * 1.2); }
.ui-card-row.ui-card-large > .ui-port-media > .ui-image { width: calc(var(--hp-avatar-size) * 8.5); aspect-ratio: 3 / 2; }
.ui-card-row.ui-card-large > .ui-port-eyebrow { color: var(--ui-primary-700); font-weight: 600; letter-spacing: var(--hp-eyebrow-tracking); text-transform: var(--hp-eyebrow-transform); }
.ui-card-row.ui-card-large > .ui-port-header { font-size: calc(var(--ui-text-xl) * 1.15); padding-block: var(--ui-space-1) var(--ui-space-2); }
.ui-card-row.ui-card-large > .ui-port-body { font-size: var(--ui-text-base); color: var(--ui-fg); }
.ui-card-row.ui-card-large > .ui-port-meta { padding-top: var(--ui-space-2); }
@media (max-width: 40rem) { .ui-card-row.ui-card-large { grid-template-columns: 1fr; grid-template-rows: none; } .ui-card-row.ui-card-large > * { grid-column: 1; grid-row: auto; } .ui-card-row.ui-card-large > .ui-port-media { order: -1; margin-bottom: var(--ui-space-2); } .ui-card-row.ui-card-large > .ui-port-media > .ui-image { width: 100%; } }
/* plain: no frame, the picture or cover above the words (a book on a shelf). */
.ui-card-plain { background: none; border: 0; border-radius: 0; box-shadow: none; }
.ui-card-plain.ui-clickable:hover { box-shadow: none; }
.ui-card-plain.ui-clickable:hover > .ui-port-media > * { box-shadow: var(--ui-shadow-lg); }
.ui-card-plain > .ui-port-media { order: -1; margin-bottom: var(--ui-space-2); }
.ui-card-plain > .ui-port-eyebrow, .ui-card-plain > .ui-port-header, .ui-card-plain > .ui-port-body, .ui-card-plain > .ui-port-meta { padding: 0; }
.ui-card-plain > .ui-port-header { font-size: var(--ui-text-base); line-height: 1.25; }
.ui-card-plain > .ui-port-body { flex: 0 0 auto; font-size: var(--ui-text-sm); }
.ui-card-plain > .ui-port-meta { order: 1; }
.ui-card-plain > .ui-port-body { order: 2; }
/* tile: filled with its series colour. */
.ui-card-feature { box-shadow: var(--ui-shadow-lg); }
.ui-card-tile { color: var(--ui-on-primary); border: 0; box-shadow: var(--ui-shadow-sm); background: linear-gradient(135deg, hsl(from var(--mark, var(--ui-primary)) h s min(l, 40)), hsl(from var(--mark, var(--ui-primary)) h s min(l, 22))); }
.ui-card-tile { min-height: calc(var(--hp-side-width) * 0.68); padding: var(--ui-space-1) var(--ui-space-1) var(--ui-space-2); }
.ui-card-tile > .ui-port-eyebrow { padding-top: var(--ui-space-4); color: inherit; opacity: 0.8; }
.ui-card-tile > .ui-port-header { font-size: var(--ui-text-xl); }
.ui-card-tile > .ui-port-body { padding-top: 0; flex: 0 0 auto; font-size: var(--ui-text-sm); opacity: 0.92; }
/* panel: a small label for a title (a side column's card). */
.ui-card-panel > .ui-port-header { padding-top: var(--ui-space-3); border-bottom: 0; font-family: var(--hp-font-body); font-size: var(--ui-text-xs); font-weight: 600; letter-spacing: var(--hp-eyebrow-tracking); text-transform: var(--hp-eyebrow-transform); color: var(--ui-fg-muted); }
.ui-card-panel > .ui-port-body { padding-top: var(--ui-space-1); }
/* uiShelf: a heading with a way on, above entries in as many equal columns as fit. */
.ui-shelf { display: flex; flex-direction: column; gap: var(--ui-space-3); min-width: 0; }
.ui-shelf > .ui-port-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ui-space-3); }
.ui-shelf-title { margin: 0; font-family: var(--hp-font-heading); font-weight: var(--hp-weight-heading); font-size: var(--ui-text-xl); line-height: 1.2; }
.ui-shelf-title, .ui-card > .ui-port-header, .ui-masthead-name, .ui-navbar-title, .ui-cover > .ui-port-title { letter-spacing: var(--hp-heading-tracking); }
.ui-shelf > .ui-port-entries { display: grid; gap: var(--ui-space-4); grid-template-columns: repeat(auto-fill, minmax(min(var(--shelf-min, calc(var(--hp-side-width) * 1.1)), 100%), 1fr)); align-items: stretch; }
.ui-shelf > .ui-port-entries > .ui-card-plain { align-self: start; }
.ui-shelf-tight { --shelf-min: calc(var(--hp-side-width) * 0.62); }
.ui-shelf-medium { --shelf-min: calc(var(--hp-side-width) * 0.94); }
/* uiMasthead: a person's or a body's banner, with who they are, their numbers and what may be done. */
.ui-masthead > .ui-port-banner .ui-image { width: 100%; height: calc(var(--hp-avatar-size) * 6); object-fit: cover; border-radius: 0 0 var(--ui-radius-lg) var(--ui-radius-lg); }
.ui-masthead > .ui-port-row { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--ui-space-3) calc(var(--ui-space-4) * 1.5); padding: 0 var(--ui-space-2); }
.ui-masthead > .ui-port-banner + .ui-port-row > .ui-avatar { margin-top: calc(var(--hp-avatar-size) * -1.35); box-shadow: 0 0 0 calc(var(--ui-space-1)) var(--ui-bg); }
.ui-masthead .ui-port-words { flex: 1 1 var(--hp-side-width); min-width: 0; padding-top: var(--ui-space-2); }
.ui-masthead-name { margin: 0; font-family: var(--hp-font-heading); font-weight: var(--hp-weight-heading); font-size: calc(var(--ui-text-xl) * 1.35); line-height: 1.15; }
.ui-masthead-role { color: var(--ui-fg-muted); }
.ui-masthead-about { margin-top: var(--ui-space-2); max-width: min(100%, var(--hp-read-width)); font-family: var(--hp-font-heading); font-size: var(--ui-text-base); }
.ui-masthead .ui-port-stats { display: flex; flex-wrap: wrap; gap: var(--ui-space-2) calc(var(--ui-space-4) * 1.5); padding-top: var(--ui-space-3); }
.ui-masthead .ui-port-acts { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); padding-top: var(--ui-space-3); }
/* uiToolbar: one line across, what is at hand at its start and what is done at its end. */
.ui-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2) var(--ui-space-4); padding: var(--ui-space-2) var(--ui-space-4); background: var(--ui-bg-elev); border-bottom: var(--ui-line); }
.ui-toolbar > .ui-port-start, .ui-toolbar > .ui-port-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); min-width: 0; }
.ui-toolbar > .ui-port-end { margin-left: auto; }
/* uiNavBar, pills: the tabs as pills, the chosen one filled; the bar stays at the top of the page. */
/* A brand: the mark, the title and its accent as one. */
.ui-navbar-brand { display: flex; align-items: center; gap: var(--ui-space-2); }
.ui-navbar-mark { display: grid; place-items: center; width: calc(var(--hp-avatar-size) * 0.8); height: calc(var(--hp-avatar-size) * 0.8); border-radius: var(--ui-radius-sm); color: var(--ui-on-primary); background: var(--ui-primary); font-family: var(--hp-font-heading); font-style: italic; font-weight: var(--hp-weight-heading); font-size: calc(var(--ui-text-base) * 1.32); line-height: 1; }
.ui-navbar-accent { font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); color: var(--hp-chrome-accent); }
.ui-navbar-brand > .ui-navbar-title, .ui-navbar-brand > .ui-navbar-accent { font-size: calc(var(--ui-text-base) * 1.32); line-height: 1; }
.ui-navbar-brand > .ui-navbar-accent { margin-left: calc(var(--ui-space-1) * -0.5); }
.ui-navbar.ui-navbar-pills > .ui-port-topBar { position: sticky; top: 0; z-index: 5; padding: var(--ui-space-2) calc(var(--ui-space-4) * 1.6); gap: var(--ui-space-2) calc(var(--ui-space-4) * 1.4); background: hsl(from var(--hp-chrome-bg) h s l / 0.92); backdrop-filter: blur(var(--ui-space-2)); -webkit-backdrop-filter: blur(var(--ui-space-2)); box-shadow: 0 var(--ui-border-width) 0 var(--ui-border); }
.ui-navbar.ui-navbar-pills > .ui-port-topBar .ui-tab { font-size: var(--ui-text-base); font-weight: 500; }
.ui-navbar.ui-navbar-pills > .ui-port-topBar .ui-tab:hover:not(:disabled):not(.ui-selected) { background: hsl(from var(--hp-chrome-fg) h s l / 0.08); }
.ui-navbar-pills > .ui-port-topBar > .ui-port-actions > .ui-avatar { --mark: var(--ui-primary); cursor: pointer; }
.ui-navbar-pills > .ui-port-topBar > .ui-port-actions > .ui-input { position: relative; }
.ui-navbar-pills > .ui-port-topBar > .ui-port-actions > .ui-input::before { content: "⌕"; position: absolute; left: var(--ui-space-3); top: 50%; translate: 0 -50%; color: var(--ui-fg-muted); font-size: var(--ui-text-lg); line-height: 1; pointer-events: none; }
.ui-navbar-pills > .ui-port-topBar > .ui-port-actions > .ui-input input { padding-left: calc(var(--ui-space-3) * 2 + var(--ui-text-base) * 0.6); background: var(--ui-bg-elev); font-size: var(--ui-text-base); }
.ui-navbar.ui-navbar-pills > .ui-port-topBar .ui-tab { padding: var(--ui-space-1) var(--ui-space-3); border-bottom: 0; border-radius: var(--ui-radius-full); }
.ui-navbar.ui-navbar-pills > .ui-port-topBar .ui-tab.ui-selected { color: var(--hp-chrome-bg); background: var(--hp-chrome-fg); }
.ui-navbar.ui-navbar-pills > .ui-port-topBar > .ui-port-actions { flex: 1 1 auto; justify-content: flex-end; flex-wrap: nowrap; }	/* named twice over, so the bar's later rule does not wrap the avatar under the search */
.ui-navbar-pills > .ui-port-topBar > .ui-port-actions > .ui-input { flex: 0 1 calc(var(--hp-side-width) * 1.7); min-width: calc(var(--hp-side-width) * 0.47); }
.ui-navbar-pills > .ui-port-topBar > .ui-port-actions > .ui-input input { border-radius: var(--ui-radius-full); }
.ui-navbar-pills > .ui-port-stage { padding-top: 0; }
/* uiGrid, fixed sides: the side columns keep a width and the middle takes the rest. */
.ui-grid-fixed > .ui-port-left, .ui-grid-fixed > .ui-port-right { flex: 0 0 var(--hp-side-width); }
.ui-grid-fixed > .ui-port-mid { flex: 1 1 0; }
/* Things one beneath another, with room between: a column's cards, a page's parts. */
.ui-stack { display: flex; flex-direction: column; gap: var(--ui-space-4); min-width: 0; }
/* Things in a line that wraps: a person and their words, a pill and what it is about, a row of numbers. */
.ui-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2) var(--ui-space-4); min-width: 0; }
.ui-inline-tight { gap: var(--ui-space-1) var(--ui-space-2); align-items: baseline; }
.ui-inline > .ui-text { flex: 1 1 calc(var(--hp-side-width) * 0.6); min-width: 0; }
.ui-inline > .ui-pill { flex: none; }
/* A page's width: centred, with room at its sides. */
.ui-page { width: 100%; max-width: var(--hp-page-width); margin-inline: auto; padding: var(--ui-space-4) calc(var(--ui-space-4) * 2) calc(var(--ui-space-4) * 3); display: flex; flex-direction: column; gap: calc(var(--ui-space-4) * 2); }
.ui-page-wide { max-width: none; }
.ui-page, .ui-system-view { background: var(--hp-page-bg); box-shadow: var(--hp-page-shadow); border: var(--hp-page-line); border-radius: var(--hp-page-radius); }
.ui-system-view { width: 100%; max-width: var(--hp-view-width); margin-inline: auto; }
/* uiFooter, page: its words begin where a page's do. */
.ui-footer.ui-footer-page { padding-inline: max(calc(var(--ui-space-4) * 2), calc((100% - var(--hp-page-width)) / 2 + var(--ui-space-4) * 2)); }
@media (max-width: 60rem) {
	.ui-card-feature { grid-template-columns: 1fr; grid-template-rows: none; }
	.ui-card-feature > .ui-port-media, .ui-card-feature > .ui-port-eyebrow, .ui-card-feature > .ui-port-header, .ui-card-feature > .ui-port-body, .ui-card-feature > .ui-port-meta, .ui-card-feature > .ui-port-footer { grid-column: 1; grid-row: auto; }
	.ui-card-feature > .ui-port-media { order: -1; }
	.ui-card-feature > .ui-port-media .ui-image { min-height: 0; max-height: var(--hp-side-width); }
	.ui-card-feature > .ui-port-eyebrow, .ui-card-feature > .ui-port-header, .ui-card-feature > .ui-port-body, .ui-card-feature > .ui-port-meta, .ui-card.ui-card-feature > .ui-port-footer:not(:empty) { padding-inline: var(--ui-space-4); }
	.ui-card.ui-card-feature > .ui-port-footer:not(:empty) { padding-bottom: var(--ui-space-4); }
	.ui-card-feature > .ui-port-header { font-size: var(--ui-text-xl); }
	.ui-grid-fixed { flex-direction: column; }
	.ui-grid-fixed > .ui-port-left, .ui-grid-fixed > .ui-port-right, .ui-grid-fixed > .ui-port-mid { flex: 0 0 auto; }
	.ui-page { padding-inline: var(--ui-space-3); gap: var(--ui-space-4); }
	.ui-footer.ui-footer-page { padding-inline: var(--ui-space-3); }
	.ui-masthead > .ui-port-banner .ui-image { height: calc(var(--hp-avatar-size) * 3.5); }
	.ui-navbar-pills > .ui-port-topBar > .ui-port-actions > .ui-input { flex-basis: calc(var(--hp-side-width) * 0.6); }
}
/* ---- 5. Collections ---- */
.ui-port-search { margin-bottom: var(--ui-space-2); }
.ui-list-item { position: relative; padding: var(--ui-space-2) var(--ui-space-3); border-left: var(--hp-active-marker-w) solid transparent; border-bottom: var(--ui-line); }
.ui-list-item:hover { background: var(--ui-secondary-100); }
.ui-list-text { flex: 1 1 auto; min-width: 0; }
/* An entry that wears a colour: a marker at its start, and its avatar in a dark shade of the same colour. */
.ui-list-item.ui-colored, .ui-list-item.ui-colored.ui-selected { border-left-color: var(--mark); }
.ui-tree-head.ui-colored, .ui-accordion-head.ui-colored { box-shadow: inset var(--hp-active-marker-w) 0 0 var(--mark); }
.ui-tab.ui-colored::before { content: ""; width: 0.55rem; height: 0.55rem; margin-right: var(--ui-space-1); border-radius: var(--ui-radius-full); background: var(--mark); }
.ui-row.ui-colored > td:first-child { box-shadow: inset var(--hp-active-marker-w) 0 0 var(--mark); }
.ui-row[class*="ui-tone-"] > td:first-child { box-shadow: inset calc(var(--hp-active-marker-w) * 2) 0 0 var(--ui-tone-fg); }
.ui-row.ui-selected[class*="ui-tone-"] { color: var(--ui-tone-fg); }	/* chosen, a toned row keeps its tone: the selection is its background alone */	/* a row in a tone (late, flagged): its words in the tone, marked at its start */
.ui-paint { display: flex; width: 100%; min-width: calc(var(--ui-space-4) * 6); height: var(--ui-space-4); color: var(--ui-info); }	/* a painted column (uiDataTable paint): strip, sparkline, range, gauge */
.ui-paint[class*="ui-tone-"] { color: var(--ui-tone-fg); }	/* a tone always wins over the default colour (it ranks above .ui-paint) */
.ui-row[class*="ui-tone-"] .ui-paint:not([class*="ui-tone-"]) { color: var(--ui-info); }	/* a painted cell keeps its own tone inside a toned row */
.ui-row .ui-paint.ui-paint-tag { display: inline-block; width: auto; min-width: 0; height: auto; }	/* a word as a rounded tag (ui-pill), in its own tone or the row's */
.ui-row .ui-paint.ui-paint-tag:not([class*="ui-tone-"]) { color: inherit; }
.ui-paint-strip { gap: var(--ui-border-width); min-width: calc(var(--ui-space-4) * 8); }
.ui-paint-strip > i { flex: 1; min-width: var(--ui-border-width); border-radius: var(--ui-radius-sm); background: var(--ui-border); }
.ui-paint-strip > i[class*="ui-tone-"] { background: var(--ui-tone-fg); }
.ui-paint .ui-paint-line { fill: none; stroke: currentColor; stroke-width: calc(var(--ui-border-width) * 1.5); vector-effect: non-scaling-stroke; }
.ui-paint .ui-paint-band { fill: var(--ui-tone-bg, var(--ui-gray-100)); }
.ui-paint .ui-paint-track { fill: var(--ui-border); }
.ui-paint .ui-paint-fill, .ui-paint .ui-paint-mark { fill: currentColor; }
.ui-list-item.ui-selected { background: var(--ui-primary-100); border-left-color: var(--ui-primary); color: var(--ui-primary-700); }
.ui-list-title { font-weight: 500; font-size: var(--ui-text-sm); }
.ui-list-body { font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
.ui-list-item:has(> .ui-list-links:not([hidden])) { display: flex; align-items: center; }
.ui-list-links { flex: none; display: flex; gap: var(--ui-space-1); margin-left: var(--ui-space-2); }
.ui-list-link { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; border-radius: var(--ui-radius-full); color: var(--ui-fg-muted); font-size: var(--ui-text-sm); text-decoration: none; }
.ui-list-link:hover, .ui-list-link:focus-visible { color: var(--ui-primary); background: var(--ui-primary-100); }
.ui-list-actions { position: absolute; top: var(--ui-space-1); right: var(--ui-space-2); display: flex; gap: var(--ui-space-1); opacity: 0; }
.ui-list-item:hover > .ui-list-actions, .ui-list-actions:focus-within { opacity: 1; }
.ui-tabset, .ui-navbar { display: flex; flex-direction: column; min-height: 0; }
.ui-navbar { flex-direction: var(--hp-nav-flow); }
.ui-navbar > .ui-port-topBar, .ui-navbar > .ui-port-topBar > .ui-port-bar { flex-direction: var(--hp-nav-bar-flow); }
.ui-tabset > .ui-port-bar, .ui-navbar > .ui-port-topBar > .ui-port-bar { display: flex; flex-wrap: nowrap; gap: var(--ui-space-1); min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.ui-tabset > .ui-port-bar > .ui-tab, .ui-navbar > .ui-port-topBar > .ui-port-bar > .ui-tab { flex: 0 0 auto; white-space: nowrap; }	/* one row that scrolls sideways, never a tab alone on a second row */
.ui-tabset > .ui-port-bar { border-bottom: var(--hp-tab-bar-line); }
.ui-tab { color: var(--ui-fg-muted); background: transparent; border-radius: var(--hp-tab-radius); border-bottom: var(--hp-tab-underline-w) solid transparent; box-shadow: none; }
.ui-tab:hover:not(:disabled) { color: var(--ui-fg); filter: none; }
.ui-tab.ui-selected { color: var(--ui-primary-700); border-bottom-color: var(--ui-primary); background: var(--hp-tab-selected-bg); }
.ui-tabset .ui-tabset > .ui-port-bar > .ui-tab.ui-selected, .ui-navbar .ui-tabset > .ui-port-bar > .ui-tab.ui-selected { color: var(--ui-secondary-700); border-bottom-color: var(--ui-secondary); }
.ui-tabset > .ui-port-stage, .ui-navbar > .ui-port-stage { padding-top: var(--ui-space-3); flex: 1 1 auto; min-height: 0; min-width: 0; }
.ui-navbar > .ui-port-topBar { display: flex; flex: 0 0 var(--hp-nav-bar-width); flex-wrap: var(--hp-nav-bar-wrap); align-items: var(--hp-nav-bar-align); position: var(--hp-nav-bar-position); top: 0; bottom: 0; z-index: 5; height: var(--hp-nav-bar-height); gap: var(--ui-space-4); padding: var(--ui-space-2) var(--ui-space-4); color: var(--hp-chrome-fg); background: var(--hp-chrome-bg); box-shadow: var(--hp-chrome-shadow); border-bottom: var(--hp-chrome-line); }
.ui-navbar > .ui-port-topBar > .ui-port-bar { counter-reset: tab; }
.ui-navbar > .ui-port-topBar > .ui-port-bar > .ui-tab { counter-increment: tab; }
.ui-navbar > .ui-port-topBar > .ui-port-bar > .ui-tab:not(.ui-colored)::before { content: var(--hp-nav-number); margin-right: var(--ui-space-2); font-weight: 400; font-variant-numeric: tabular-nums; color: var(--hp-chrome-fg-muted); }
.ui-navbar-title { font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); }
.ui-navbar > .ui-port-topBar .ui-tab { color: var(--hp-chrome-fg-muted); }
.ui-navbar > .ui-port-topBar .ui-tab:hover:not(:disabled), .ui-navbar > .ui-port-topBar .ui-tab.ui-selected { color: var(--hp-chrome-fg); border-bottom-color: var(--hp-chrome-fg); }
.ui-navbar > .ui-port-topBar .ui-tab.ui-selected { background: var(--hp-tab-selected-chrome-bg); }
.ui-navbar > .ui-port-topBar > .ui-port-bar > .ui-tab { justify-content: var(--hp-nav-tab-justify); }
.ui-navbar > .ui-port-topBar > .ui-port-actions { margin: var(--hp-nav-actions-margin); display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); }
/* Grouped tabs (uiTabSet groups): the heads an accordion in the bar, each group's tabs running as the bar's own links do. In the chrome the
   heads are small capitals in its quiet ink, the open group on a faint ground of the chrome's ink. */
.ui-tab-groups { display: flex; flex-direction: var(--hp-nav-bar-flow); gap: var(--ui-space-1); min-width: 0; }
.ui-tab-groups > .ui-port-entries { display: flex; flex-direction: inherit; gap: inherit; }
.ui-tab-groups .ui-accordion-entry { border-bottom: 0; border-radius: var(--ui-radius-lg); }
.ui-tab-groups .ui-accordion-entry > :not(.ui-accordion-head) { display: flex; flex-direction: var(--hp-nav-bar-flow); gap: 2px; padding: 0 0 var(--ui-space-1); }
.ui-tab-groups .ui-accordion-entry > :not(.ui-accordion-head) > .ui-tab { justify-content: var(--hp-nav-tab-justify); white-space: nowrap; }
.ui-navbar > .ui-port-topBar .ui-tab-groups .ui-accordion-head { color: var(--hp-chrome-fg-muted); font-size: var(--ui-text-xs); text-transform: var(--hp-eyebrow-transform); letter-spacing: var(--hp-eyebrow-tracking); padding: var(--ui-space-2) var(--ui-space-3); border-radius: var(--ui-radius-lg); }
.ui-navbar > .ui-port-topBar .ui-tab-groups .ui-accordion-head::after { color: var(--hp-chrome-fg-muted); }
.ui-navbar > .ui-port-topBar .ui-tab-groups .ui-accordion-head.ui-selected { color: var(--hp-chrome-fg); }
.ui-navbar > .ui-port-topBar .ui-tab-groups .ui-accordion-entry:has(> .ui-accordion-head.ui-selected) { background: hsl(from var(--hp-chrome-fg) h s l / 0.06); }
.ui-navbar > .ui-port-topBar .ui-tab-groups .ui-tab { border-bottom: 0; }
.ui-navbar > .ui-port-topBar .ui-tab-groups .ui-tab.ui-selected { color: var(--hp-tab-selected-chrome-fg); }
.ui-navbar > .ui-port-topBar > .ui-port-bar:has(> .ui-tab-groups) { overflow-x: hidden; overflow-y: auto; }
/* On a narrow screen a side bar has no room: the bar returns to a row, at the top unless the theme asks for the bottom. */
@media (max-width: 40rem) { .ui-navbar { flex-direction: var(--hp-nav-flow-narrow); } .ui-navbar > .ui-port-topBar, .ui-navbar > .ui-port-topBar > .ui-port-bar { flex-direction: row; } .ui-navbar > .ui-port-topBar { flex-basis: auto; flex-wrap: wrap; align-items: center; height: auto; } .ui-navbar > .ui-port-topBar > .ui-port-actions { margin: 0 0 0 auto; } .ui-navbar > .ui-port-topBar > .ui-port-bar > .ui-tab { justify-content: center; } }
/* The footer band: dark like the navigation bar, its words turned to read on it. The about block takes two of four columns, the columns
   follow, the closing line runs across; on a phone it is one column. Placed last in a page that fills the screen, it sits at the foot. */
.ui-footer { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(var(--ui-space-4) * 1.5) var(--ui-space-4); margin-top: auto;
    padding: calc(var(--ui-space-4) * 1.5) var(--ui-space-4) var(--ui-space-3); color: var(--hp-chrome-fg-muted); background: var(--hp-chrome-bg); }
.ui-footer > .ui-port-about { grid-column: span 2; display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-footer > .ui-port-entries { display: contents; }
.ui-footer-title { font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); color: var(--hp-chrome-fg); }
.ui-footer-head { margin-bottom: var(--ui-space-2); font-size: var(--ui-text-sm); font-weight: 600; color: var(--hp-chrome-fg); }
.ui-footer-items { display: flex; flex-direction: column; align-items: flex-start; gap: var(--ui-space-1); font-size: var(--ui-text-sm); }
.ui-footer-text { max-width: 36rem; font-size: var(--ui-text-sm); line-height: var(--hp-line-height); }
.ui-footer-link { color: var(--hp-chrome-fg); text-decoration: none; cursor: pointer; }
.ui-footer-item { color: hsl(from var(--hp-chrome-fg) h s l / 0.72); }
.ui-footer-link:hover, .ui-footer-link:focus-visible { text-decoration: underline; text-underline-offset: 0.2em; }
.ui-footer > .ui-port-note { grid-column: 1 / -1; padding-top: var(--ui-space-3); border-top: var(--ui-border-width) solid hsl(from var(--hp-chrome-fg) h s l / 0.2); font-size: var(--ui-text-xs); color: hsl(from var(--hp-chrome-fg) h s l / 0.72); }
@media (max-width: 720px) { .ui-footer { grid-template-columns: minmax(0, 1fr); gap: var(--ui-space-4); } .ui-footer > .ui-port-about { grid-column: auto; } }
.ui-accordion-entry { border-bottom: var(--ui-line); }
.ui-accordion-head { width: 100%; justify-content: flex-start; color: var(--ui-fg); background: transparent; border-radius: 0; padding: var(--ui-space-2) var(--ui-space-1); font-weight: 600; box-shadow: none; }
.ui-accordion-head::after { content: "▸"; margin-left: auto; color: var(--ui-fg-muted); transition: transform var(--ui-transition-base); }
.ui-accordion-head.ui-selected { color: var(--ui-secondary-700); }
.ui-accordion-head.ui-selected::after { transform: rotate(90deg); color: var(--ui-secondary); }
.ui-accordion-entry > :not(.ui-accordion-head) { padding: var(--ui-space-1) var(--ui-space-1) var(--ui-space-3); }
.ui-stepper .ui-progress { accent-color: var(--ui-secondary); }
.ui-stepper > .ui-port-head { font-weight: 600; font-size: var(--ui-text-sm); }
.ui-stepper > .ui-port-stage { padding: var(--ui-space-3) 0; min-height: 3rem; }
.ui-stepper > .ui-port-foot { display: flex; justify-content: space-between; gap: var(--ui-space-2); }
/* A tree node: the caret in its own narrow column, the head and the branch beside it. The caret turns down when the branch is open,
   shows only when the branch has entries, and a closed branch is not drawn. */
.ui-tree-node { display: grid; grid-template-columns: calc(var(--ui-text-sm) * 1.4) minmax(0, 1fr); align-items: start; }
.ui-tree-node > .ui-tree-branch { grid-column: 2; }
.ui-tree-twisty { padding: var(--ui-space-1) 0; font-size: calc(var(--ui-text-sm) * 0.8); line-height: inherit; text-align: center; color: var(--ui-fg-muted); cursor: pointer; user-select: none;
	transform: rotate(90deg); transition: transform var(--ui-transition-fast); }
.ui-tree-twisty:hover { color: var(--ui-primary); }
.ui-tree-closed > .ui-tree-twisty { transform: none; }
.ui-tree-closed > .ui-tree-branch { display: none; }
.ui-tree-node:not(:has(> .ui-tree-branch > *)) > .ui-tree-twisty { visibility: hidden; }
.ui-tree-head { padding: var(--ui-space-1) var(--ui-space-2); border-radius: var(--ui-radius-sm); font-size: var(--ui-text-sm); }
.ui-tree-head:hover { background: var(--ui-secondary-100); }
.ui-tree-head.ui-selected { background: var(--ui-primary-100); color: var(--ui-primary-700); }
.ui-tree-branch .ui-tree-head.ui-selected { background: var(--ui-secondary-100); color: var(--ui-secondary-700); }
.ui-tree-branch:not(:empty) { margin-left: var(--ui-space-3); padding-left: var(--ui-space-2); border-left: var(--ui-border-width) solid var(--ui-secondary); }
.ui-datatable > .ui-port-title { font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); margin-bottom: var(--ui-space-2); }
.ui-datatable { min-width: 0; overflow-x: auto; }
.ui-datatable > .ui-port-table { display: table; width: 100%; border-collapse: collapse; font-size: var(--ui-text-sm); background: var(--hp-table-bg); box-shadow: var(--hp-table-shadow); border-top: var(--hp-table-rule); border-bottom: var(--hp-table-rule); }
.ui-datatable th { padding: var(--ui-space-1) var(--ui-space-2); text-align: left; font-size: var(--hp-table-head-text); font-weight: var(--hp-table-head-weight); color: var(--hp-table-head-fg); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); border-bottom: var(--hp-table-head-line); white-space: nowrap; }
.ui-datatable td { padding: var(--ui-space-1) var(--ui-space-2); border-bottom: var(--hp-table-row-line); vertical-align: top; overflow-wrap: anywhere; }	/* anywhere, not break-word: a long word may break, so a cell never holds the table wider than its room */
.ui-datatable th.ui-sorted-asc, .ui-datatable th.ui-sorted-desc { color: var(--ui-secondary-700); }
/* A column of numbers is set to the right, its digits in equal widths, so places line up; words stay to the left. */
.ui-datatable th.ui-num, .ui-datatable td.ui-num { text-align: right; font-variant-numeric: tabular-nums; }
.ui-sorted-asc::after { content: " ▲"; }
.ui-sorted-desc::after { content: " ▼"; }
.ui-row:hover { background: var(--ui-secondary-100); }
.ui-row.ui-selected { background: var(--ui-primary-100); color: var(--ui-primary-700); }
/* Striped rows, counting only the rows shown, so paging and search keep the stripes; a hovered or selected row shows over them. */
:where(.ui-datatable tbody) > .ui-row:where(:nth-child(even of .ui-row:not([hidden]))) { background: var(--hp-table-stripe); }
/* Responsive: the ▸ that opens a row's hidden columns, and the row beneath that shows them as label and value. */
.ui-datatable-responsive .ui-row > td { white-space: nowrap; }
/* Tight: hiding every column it may still leaves the table too wide (a long word in a kept column), so its words wrap and break inside their cells. */
.ui-datatable-responsive.ui-datatable-tight .ui-row > td { white-space: normal; }
/* A cell holding one long word wraps, breaking inside the word, before any column is hidden for it. */
.ui-datatable-responsive.ui-datatable-wrapwords .ui-row > td.ui-cell-longword { white-space: normal; }
.ui-row-more { margin-right: var(--ui-space-1); padding: 0 var(--ui-space-1); font: inherit; color: var(--ui-primary); background: transparent; border: 0; cursor: pointer; }
.ui-row-detail > td { padding: var(--ui-space-2) var(--ui-space-3); background: var(--ui-bg-sunken); border-bottom: var(--ui-line); border-left: var(--ui-border-width) solid var(--ui-primary); }
.ui-row-detail dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--ui-space-1) var(--ui-space-3); margin: 0; }
.ui-row-detail dt { font-size: var(--ui-text-xs); color: var(--ui-fg-muted); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); }
.ui-row-detail dd { margin: 0; overflow-wrap: anywhere; }
/* At phone width each row is a record, every cell on its own line after its column's label (data-label); the header row stays above them
   as a line of the column names, each pressed to sort by it. uiDataTable.fit reads the table stacked and hides no column. */
@media (max-width: 40rem) {
	.ui-datatable-responsive > .ui-port-table, .ui-datatable-responsive > .ui-port-table > tbody, .ui-datatable-responsive > .ui-port-table > thead { display: block; }
	.ui-datatable-responsive > .ui-port-table > thead > tr { display: flex; flex-wrap: wrap; gap: var(--ui-space-1); padding-bottom: var(--ui-space-1); border-bottom: var(--hp-table-row-line); }
	.ui-datatable-responsive > .ui-port-table > thead th:not([hidden]) { display: inline-flex; padding: 0 var(--ui-space-2); border: var(--ui-line); border-radius: var(--ui-radius-full); font-size: var(--ui-text-xs); }
	.ui-datatable-responsive .ui-row > td[data-label=""]::before { content: none; }
	.ui-datatable-responsive .ui-row:not([hidden]) { display: flex; flex-direction: column; padding: var(--ui-space-1) 0; border-bottom: var(--hp-table-row-line); }
	.ui-datatable-responsive .ui-row > td:not([hidden]) { display: flex; align-items: baseline; gap: var(--ui-space-2); white-space: normal; text-align: left; border-bottom: 0; }
	.ui-datatable-responsive .ui-row > td:empty { display: none; }	/* a blank cell is left out of the record, not shown as a label with nothing after it */
	.ui-datatable-responsive .ui-row > td::before { content: attr(data-label); flex: 0 0 40%; font-size: var(--ui-text-xs); color: var(--ui-fg-muted); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); }
}
.ui-callout + .ui-datatable, .ui-datatable + .ui-datatable { margin-top: var(--ui-space-4); }
.ui-datatable > .ui-port-pager { display: flex; align-items: center; gap: var(--ui-space-2); padding-top: var(--ui-space-2); }
.ui-datatable-count { margin-right: auto; font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
/* ---- 6. Inputs and forms ---- */
.ui-input { display: flex; flex-direction: column; gap: var(--ui-space-1); min-width: 0; }
.ui-input > label { font-size: var(--ui-text-xs); font-weight: 500; color: var(--ui-fg-muted); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); }
.ui-input > input, .ui-input > textarea, .ui-input > select, .ui-datetime-parts > input { width: 100%; font: inherit; font-size: var(--hp-control-text); padding: var(--hp-control-pad-y) var(--ui-space-2); color: var(--ui-fg); background: var(--ui-bg-elev); border: var(--ui-border-width) solid var(--ui-border-input); border-radius: var(--ui-radius-sm); }
.ui-input > input:focus, .ui-input > textarea:focus, .ui-select > select:focus { outline: none; border-color: var(--ui-primary); box-shadow: var(--ui-focus-ring); }
.ui-input > [aria-invalid="true"], .ui-select > [aria-invalid="true"] { border-color: var(--ui-danger); }
.ui-input > input[readonly] { background: var(--ui-bg-sunken); color: var(--ui-fg-muted); }
/* A field shown and not to be changed (a value only the service's verbs set, or one the press works out: D151) reads as such. */
.ui-input > input:disabled, .ui-input > textarea:disabled, .ui-input > select:disabled, .ui-datetime-parts > input:disabled { background: var(--ui-bg-sunken); color: var(--ui-fg-muted); border-style: dashed; cursor: not-allowed; }
.ui-input > input[type="range"], .ui-input > input[type="color"] { padding: 0; accent-color: var(--ui-primary); }
.ui-input-check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: var(--ui-space-2); }
.ui-input-check > label { text-transform: none; letter-spacing: 0; font-size: var(--ui-text-sm); color: var(--ui-fg); font-weight: 400; }
.ui-input-check > input { width: auto; accent-color: var(--ui-primary); }
.ui-input-error { font-size: var(--ui-text-xs); color: var(--ui-danger); flex-basis: 100%; }
.ui-choice-options { display: flex; flex-wrap: wrap; gap: var(--ui-space-1) var(--ui-space-3); font-size: var(--ui-text-sm); }
.ui-choice-options label { display: inline-flex; align-items: center; gap: var(--ui-space-1); cursor: pointer; }
.ui-choice-options input { accent-color: var(--ui-primary); margin: 0; }
.ui-form > .ui-port-title { font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); }
.ui-form > .ui-port-subTitle { font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-form > .ui-port-fields { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-form > .ui-port-buttons:not(:empty) { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); margin-top: var(--ui-space-3); }
.ui-form > .ui-port-messages { margin-top: var(--ui-space-2); }
.ui-form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ui-space-2); }
.ui-form-row > .ui-port-fields { flex-direction: row; flex-wrap: wrap; }
.ui-form-row > .ui-port-buttons:not(:empty) { margin-top: 0; }
.ui-hyperparams label { text-transform: none; letter-spacing: 0; }
.ui-hyperparams > .ui-port-themeCss { margin: var(--ui-space-3) 0 0; padding: var(--ui-space-2); font-family: var(--hp-font-mono); font-size: var(--ui-text-xs); background: var(--ui-bg-sunken); border: var(--ui-line); border-radius: var(--ui-radius-sm); overflow-wrap: anywhere; white-space: pre-wrap; }
/* ---- 7. Figures: every mark reads --mark, which its series or tone class sets ---- */
.ui-series-1 { --mark: var(--ui-series-1); } .ui-series-2 { --mark: var(--ui-series-2); } .ui-series-3 { --mark: var(--ui-series-3); } .ui-series-4 { --mark: var(--ui-series-4); }
.ui-series-5 { --mark: var(--ui-series-5); } .ui-series-6 { --mark: var(--ui-series-6); } .ui-series-7 { --mark: var(--ui-series-7); } .ui-series-8 { --mark: var(--ui-series-8); }
.ui-mark-info { --mark: var(--ui-info); } .ui-mark-secondary { --mark: var(--ui-secondary); } .ui-mark-success { --mark: var(--ui-success); }
.ui-mark-warn { --mark: var(--ui-warn); } .ui-mark-danger { --mark: var(--ui-danger); } .ui-mark-muted { --mark: var(--ui-fg-muted); }
.ui-marks { position: relative; display: flex; flex-direction: column; gap: var(--ui-space-2); min-width: 0; }
/* The probe: sized by the spacing and text tokens, so turning a density, padding or text dial redraws every figure. */
.ui-port-probe { position: absolute; top: 0; left: 0; width: calc(10 * var(--ui-space-2)); height: var(--ui-text-xs); visibility: hidden; pointer-events: none; }
.ui-marks > .ui-port-title, .ui-marks > .ui-port-top > .ui-port-title { font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); }
.ui-port-legend { display: flex; flex-wrap: wrap; gap: var(--ui-space-1); align-items: center; }
.ui-legend-chip { gap: var(--ui-space-1); padding: 0 var(--ui-space-2); font-size: var(--ui-text-xs); font-variant-numeric: tabular-nums; color: var(--ui-fg); background: transparent; border-color: var(--ui-border); border-radius: var(--ui-radius-full); box-shadow: none; }
.ui-legend-chip::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: var(--ui-radius-full); background: var(--mark); }
.ui-legend-chip:hover:not(:disabled) { filter: none; background: var(--ui-secondary-100); }
.ui-legend-chip[aria-pressed="false"] { color: var(--ui-fg-muted); text-decoration: line-through; }
.ui-legend-chip[aria-pressed="false"]::before { background: transparent; box-shadow: inset 0 0 0 1px var(--mark); }
.ui-legend-text, .ui-port-note { font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
.ui-port-figure { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--hp-font-body); font-size: var(--ui-text-xs); user-select: none; }
.ui-figure-axes text { fill: var(--ui-fg-muted); font-variant-numeric: tabular-nums; }
.ui-figure-axes .ui-figure-title { fill: var(--ui-fg); font-weight: 500; }
.ui-figure-grid { fill: none; stroke: var(--ui-border); stroke-width: 1; }
.ui-figure-baseline { stroke: var(--ui-fg-muted); stroke-width: 1; }
.ui-port-figure .ui-mark { cursor: pointer; }
.ui-port-figure .ui-mark:focus-visible { outline: none; }
.ui-port-figure .ui-mark:focus-visible > :not(text):not(title) { stroke: var(--ui-primary); stroke-width: 3; }
.ui-port-figure .ui-mark.ui-selected > :not(text):not(title) { stroke: var(--ui-fg); stroke-width: 2.5; }
/* Plots */
.ui-plot circle { fill: var(--mark); stroke: var(--ui-bg-elev); stroke-width: 1; }
.ui-plot-bar, .ui-plot-slice, .ui-plot-cell { fill: var(--mark); stroke: var(--ui-bg-elev); stroke-width: 1; }
.ui-plot-line { fill: none; stroke: var(--mark); stroke-width: 2; stroke-linejoin: round; }
.ui-plot-area { fill: var(--mark); fill-opacity: 0.14; stroke: none; }
.ui-plot-flow { fill: var(--mark); fill-opacity: 0.38; stroke: none; }
.ui-plot-band { fill: var(--mark); fill-opacity: 0.16; stroke: none; }
.ui-plot-column-title { fill: var(--ui-fg-muted); font-weight: 600; }
.ui-port-figure .ui-mark:hover > .ui-plot-flow { fill-opacity: 0.6; }
.ui-plot-node { fill: var(--ui-fg-muted); }
/* Crosstab: cells a person types into, each edged in its category's colour */
.ui-crosstab > .ui-port-stage { overflow-x: auto; }
.ui-crosstab-table { width: 100%; border-collapse: collapse; font-size: var(--ui-text-sm); font-variant-numeric: tabular-nums; background: var(--hp-table-bg); border-top: var(--hp-table-rule); border-bottom: var(--hp-table-rule); }
.ui-crosstab-table th { padding: var(--ui-space-1) var(--ui-space-2); text-align: left; font-weight: var(--hp-weight-body); border-bottom: var(--hp-table-row-line); }
.ui-crosstab-table thead th { font-size: var(--hp-table-head-text); font-weight: var(--hp-table-head-weight); color: var(--hp-table-head-fg); border-bottom: var(--hp-table-head-line); vertical-align: bottom; }
.ui-crosstab-table thead th.ui-num, .ui-crosstab-table tfoot td { text-align: right; }
.ui-crosstab-table tbody th { white-space: nowrap; }
.ui-crosstab-table tfoot th, .ui-crosstab-table tfoot td { padding: var(--ui-space-1) var(--ui-space-2); font-weight: var(--hp-weight-heading); border-top: var(--hp-table-head-line); }
.ui-crosstab-cell { padding: 0; border-bottom: var(--hp-table-row-line); box-shadow: inset 3px 0 0 var(--mark, transparent); }
.ui-crosstab-empty { box-shadow: none; }
.ui-crosstab-marked { background: var(--ui-secondary-100); }
.ui-crosstab-cell.ui-selected { box-shadow: inset 3px 0 0 var(--mark, transparent), inset 0 0 0 2px var(--ui-fg); }
.ui-crosstab-hidden { opacity: 0.4; }
.ui-crosstab-input { box-sizing: border-box; width: 100%; min-width: 5.5em; padding: var(--ui-space-1) var(--ui-space-2); border: 1px solid transparent; border-radius: var(--ui-radius-sm, 2px); background: transparent; color: var(--ui-fg); font: inherit; text-align: right; }
.ui-crosstab-input:hover:not(:disabled) { border-color: var(--ui-border); }
.ui-crosstab-input:focus { outline: none; border-color: var(--ui-primary); box-shadow: var(--ui-focus-ring); background: var(--ui-bg-elev); }
/* A figure played through time: play, the scrubber, and where it stands */
.ui-binding-play { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); }
.ui-binding-play > .ui-input { flex: 1 1 12rem; min-width: 8rem; }
.ui-binding-play-at { font-variant-numeric: tabular-nums; color: var(--ui-fg-muted); }
.ui-plot-deco .ui-plot-node-label { fill: var(--ui-fg); paint-order: stroke; stroke: var(--ui-bg-elev); stroke-width: 3px; }
.ui-plot-radar { fill: var(--mark); fill-opacity: 0.12; stroke: var(--mark); stroke-width: 2; stroke-linejoin: round; }
.ui-plot-rug { stroke: var(--mark); stroke-width: 1.5; }
.ui-plot-box { fill: hsl(from var(--mark) h s l / 18%); stroke: var(--mark); stroke-width: 1.5; }
.ui-plot-median { stroke: var(--ui-fg); stroke-width: 2; }
.ui-plot-whisker { stroke: var(--ui-fg-muted); stroke-width: 1.5; }
.ui-plot-rule { stroke: var(--mark); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ui-plot-rule-label { fill: var(--ui-fg-muted); }
.ui-plot-deco text { fill: var(--ui-fg-muted); }
/* A heatmap's words in a cell (cellLabel): the page's text over a halo of the ground, so they read on the faintest and the strongest shade. */
.ui-plot-cell-label { fill: var(--ui-fg); paint-order: stroke; stroke: var(--ui-bg-elev); stroke-width: calc(var(--ui-border-width) * 3); stroke-linejoin: round; stroke-opacity: 0.85; pointer-events: none; font-variant-numeric: tabular-nums; }
.ui-plot-deco .ui-plot-total { fill: var(--ui-fg); font-family: var(--hp-font-heading); font-size: var(--ui-text-xl); font-variant-numeric: tabular-nums; }
/* Graphs */
.ui-graph > .ui-port-stage > .ui-port-figure { background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-md); touch-action: none; cursor: grab; box-shadow: var(--ui-shadow-sm); }
.ui-graph-node circle { fill: var(--mark); stroke: var(--ui-bg-elev); stroke-width: 2; }
.ui-graph-label { fill: var(--ui-fg); text-anchor: middle; paint-order: stroke; stroke: var(--ui-bg-elev); stroke-width: 3px; pointer-events: none; }
.ui-graph-link { fill: none; stroke: var(--mark); stroke-width: 1.5; }
.ui-graph-hit { fill: none; stroke: transparent; stroke-width: 10; }
.ui-graph-head { fill: var(--mark); }
.ui-port-figure .ui-graph-edge.ui-selected > .ui-graph-link { stroke: var(--ui-fg); stroke-width: 2.5; }
.ui-port-figure .ui-graph-edge.ui-selected > .ui-graph-hit { stroke: transparent; }
.ui-graph-draft { pointer-events: none; }	/* the link being drawn never hides the node it is dropped on */
.ui-graph-draft path { stroke: var(--ui-primary); stroke-width: 2; stroke-dasharray: 4 3; }
/* Maps: water and land from the tokens, so the ground follows every theme; tiles dim in dark mode so the marks stay the loudest thing */
.ui-map > .ui-port-stage { position: relative; }
.ui-map > .ui-port-stage > .ui-port-figure { overflow: hidden; background: var(--ui-info-100); border: var(--ui-line); border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-sm); touch-action: none; cursor: grab; }
.ui-map-land path { fill: var(--ui-bg-elev); stroke: var(--ui-border); stroke-width: 0.75; vector-effect: non-scaling-stroke; }
.ui-map-tiles { filter: invert(calc(0.92 * var(--dark))) hue-rotate(calc(180deg * var(--dark))) brightness(calc(1 - 0.1 * var(--dark))); }
.ui-map circle { fill: var(--mark); fill-opacity: 0.88; stroke: var(--ui-bg-elev); stroke-width: 1.5; }
.ui-map .ui-map-shape { fill: var(--mark); fill-opacity: 0.88; stroke: var(--ui-bg-elev); stroke-width: 1.5; }	/* a point drawn as a square or a triangle (uiMap marker) */
.ui-map .ui-map-shape.ui-map-unnamed { stroke: var(--ui-fg); stroke-dasharray: 2 1.5; }
.ui-map .ui-map-glyph, .ui-port-figure .ui-mark.ui-selected > .ui-map-glyph { fill: none; stroke: var(--ui-bg-elev); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }	/* the tick or cross a point holds */
.ui-port-figure .ui-mark.ui-selected > .ui-map-leader { stroke: var(--ui-fg-muted); stroke-width: var(--ui-border-width); }
.ui-legend-chip.ui-legend-shape-square::before { border-radius: 0; }
.ui-legend-chip.ui-legend-shape-triangle::before { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ui-legend-chip.ui-legend-shape-tick::before { border-radius: 0; clip-path: polygon(0 55%, 18% 38%, 38% 60%, 82% 8%, 100% 24%, 40% 96%); }
.ui-legend-chip.ui-legend-shape-cross::before { border-radius: 0; clip-path: polygon(0 18%, 18% 0, 50% 32%, 82% 0, 100% 18%, 68% 50%, 100% 82%, 82% 100%, 50% 68%, 18% 100%, 0 82%, 32% 50%); }
.ui-map .ui-map-leader { stroke: var(--ui-fg-muted); stroke-width: var(--ui-border-width); pointer-events: none; }	/* a point spread off a shared spot, led back to its place */
.ui-map .ui-mark.ui-dragging { opacity: 0.6; cursor: grabbing; }
.ui-map-label { fill: var(--ui-fg); paint-order: stroke; stroke: var(--ui-bg-elev); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }	/* a point's name, haloed so it reads over land, water and tiles */
.ui-map circle.ui-map-unnamed { stroke: var(--ui-fg); stroke-dasharray: 2 1.5; }	/* a point whose name had no clear place: it is in the tooltip */
.ui-map-center { pointer-events: none; }
.ui-map-center path { stroke: var(--ui-fg); stroke-width: 1.5; }
.ui-map-center circle { fill: none; stroke: var(--ui-fg); stroke-width: 1.5; }
.ui-map > .ui-port-stage > .ui-port-tools { position: absolute; top: var(--ui-space-2); left: var(--ui-space-2); display: flex; flex-direction: column; gap: var(--ui-space-1); }
.ui-map > .ui-port-stage > .ui-port-tools > .ui-button { min-width: 1.9rem; background: var(--ui-bg-elev); }
.ui-map > .ui-port-stage > .ui-port-credit { position: absolute; right: 1px; bottom: 1px; padding: 0 var(--ui-space-1); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); background: hsl(from var(--ui-bg-elev) h s l / 80%); border-radius: var(--ui-radius-sm); }
/* Calendars: each week is a grid of seven columns; an event's data-col and data-span place it, and dense packing finds its lane */
.ui-calendar > .ui-port-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); }
.ui-calendar-period { margin-right: auto; font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); }
.ui-calendar-moves { display: flex; gap: var(--ui-space-1); }
.ui-calendar > .ui-port-stage { background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-md); overflow: hidden; touch-action: none; box-shadow: var(--ui-shadow-sm); }
.ui-calendar-names, .ui-calendar-weekrow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ui-calendar-names > * { padding: var(--ui-space-1) var(--ui-space-2); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); border-bottom: var(--ui-line); }
.ui-calendar-weekrow { grid-auto-flow: row dense; grid-auto-rows: min-content; align-content: start; row-gap: 2px; min-height: calc(5.5rem * var(--hp-density)); padding-bottom: var(--ui-space-1); border-bottom: var(--ui-line);
    background-image: linear-gradient(to right, var(--ui-border) var(--ui-border-width), transparent var(--ui-border-width)); background-size: calc(100% / 7) 100%; }
.ui-calendar-weekview .ui-calendar-weekrow { min-height: calc(18rem * var(--hp-density)); }
.ui-calendar-day { grid-row: 1; justify-self: start; margin: var(--ui-space-1); padding: 0 var(--ui-space-1); font-size: var(--ui-text-xs); font-variant-numeric: tabular-nums; border-radius: var(--ui-radius-full); }
.ui-calendar-day:hover { background: var(--ui-secondary-100); }
.ui-calendar-other { color: var(--ui-fg-muted); }
.ui-calendar-today { color: var(--ui-on-primary); background: var(--ui-primary); }
.ui-calendar-event { min-width: 0; margin: 0 var(--ui-space-1); padding: 0 var(--ui-space-1); font-size: var(--ui-text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; cursor: grab;
    color: var(--ui-fg); background: hsl(from var(--mark) h s l / 16%); border-left: var(--hp-active-marker-w) solid var(--mark); border-radius: var(--ui-radius-sm); }
.ui-calendar-cont { border-left-style: dotted; }
.ui-calendar-event.ui-selected { background: hsl(from var(--mark) h s l / 34%); box-shadow: inset 0 0 0 1px var(--mark); }
.ui-calendar-event.ui-dragging { opacity: 0.5; }
/* The day view: whole-day events along the top, then half-hour rows with a line each hour; events are placed in the rows by their time */
.ui-calendar-allday { display: flex; flex-wrap: wrap; gap: 2px; padding: var(--ui-space-1) 0; border-bottom: var(--ui-line); }
.ui-calendar-daygrid { --ui-calendar-slot: calc(1.5rem * var(--hp-density)); display: grid; column-gap: 2px; padding-right: var(--ui-space-1);
    background-image: repeating-linear-gradient(to bottom, var(--ui-border) 0 var(--ui-border-width), transparent var(--ui-border-width) calc(2 * var(--ui-calendar-slot))); }
.ui-calendar-hour { grid-column: 1; padding: 0 var(--ui-space-1); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); font-variant-numeric: tabular-nums; }
.ui-calendar-daygrid > .ui-calendar-event { margin: 1px 0; white-space: normal; }
[data-col="1"] { grid-column-start: 1; } [data-col="2"] { grid-column-start: 2; } [data-col="3"] { grid-column-start: 3; } [data-col="4"] { grid-column-start: 4; }
[data-col="5"] { grid-column-start: 5; } [data-col="6"] { grid-column-start: 6; } [data-col="7"] { grid-column-start: 7; }
[data-span="2"] { grid-column-end: span 2; } [data-span="3"] { grid-column-end: span 3; } [data-span="4"] { grid-column-end: span 4; }
[data-span="5"] { grid-column-end: span 5; } [data-span="6"] { grid-column-end: span 6; } [data-span="7"] { grid-column-end: span 7; }
/* Gantt charts: the pale bar is the whole task and the solid part what is done, so what remains reads at a glance */
.ui-gantt > .ui-port-stage { background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-md); overflow: hidden; box-shadow: var(--ui-shadow-sm); }
.ui-gantt-row { fill: transparent; }
.ui-gantt-task:hover .ui-gantt-row { fill: var(--ui-secondary-100); }
.ui-port-figure .ui-gantt-task.ui-selected > .ui-gantt-row { fill: var(--ui-primary-100); stroke: none; }
.ui-gantt-label { fill: var(--ui-fg); font-size: var(--ui-text-sm); }
.ui-gantt-bar { fill: hsl(from var(--mark) h s l / 28%); stroke: var(--mark); stroke-width: 1; cursor: grab; }
.ui-gantt-done { fill: var(--mark); pointer-events: none; }
.ui-gantt-end { fill: transparent; cursor: ew-resize; touch-action: none; }	/* the handle at a bar's end that changes its length; it shows on hover */
.ui-gantt-task:hover .ui-gantt-end { fill: hsl(from var(--mark) h s l / 55%); }
.ui-port-figure .ui-gantt-task.ui-selected > .ui-gantt-end { stroke: none; }
.ui-gantt-milestone { fill: var(--mark); stroke: var(--ui-bg-elev); stroke-width: 1.5; }
.ui-gantt-lane { fill: transparent; }
.ui-gantt-lane-alt { fill: var(--ui-bg-sunken); }
.ui-gantt-lane-label { fill: var(--ui-fg); font-size: var(--ui-text-sm); font-weight: 600; }
.ui-gantt-mark { fill: var(--mark); stroke: var(--ui-bg-elev); stroke-width: 1.5; }
.ui-gantt-stem { stroke: var(--mark); stroke-width: 1.5; stroke-dasharray: 2 2; }
.ui-gantt-links path { fill: none; stroke: var(--ui-fg-muted); stroke-width: 1.25; }
.ui-gantt-links .ui-gantt-head { fill: var(--ui-fg-muted); stroke: none; }
.ui-gantt-today { stroke: var(--ui-danger); stroke-width: 1.5; stroke-dasharray: 3 3; }
/* Treemaps: pale tiles in the category's colour so the words on them read in both modes; groups as a frame with their name along the top */
.ui-plot-tile { fill: hsl(from var(--mark) h s l / 34%); stroke: var(--ui-bg-elev); stroke-width: 1.5; }
.ui-port-figure .ui-mark:hover > .ui-plot-tile { fill: hsl(from var(--mark) h s l / 50%); }
.ui-plot-tile-label { fill: var(--ui-fg); pointer-events: none; }
.ui-plot-tile-amount { fill: var(--ui-fg-muted); font-variant-numeric: tabular-nums; }
.ui-plot-group { fill: var(--ui-bg-sunken); stroke: var(--ui-border); stroke-width: 1; }
.ui-plot-deco .ui-plot-group-label { fill: var(--ui-fg); font-weight: 600; }
.ui-plot-tile-number { font-weight: 600; font-variant-numeric: tabular-nums; }
/* The key beneath a plot: a mark's number, then its words and amount, in columns as wide as the room allows */
.ui-plot > .ui-port-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 2px var(--ui-space-3); padding: var(--ui-space-1) 0; font-size: var(--ui-text-xs); }
.ui-plot-key-item { display: flex; gap: var(--ui-space-1); align-items: baseline; min-width: 0; padding: 1px var(--ui-space-1); border-radius: var(--ui-radius-sm); overflow-wrap: anywhere; }
.ui-plot-key-item:hover { background: var(--ui-secondary-100); }
.ui-plot-key-n { flex: none; min-width: 1.6em; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
/* Map lines, areas and links: an area is a pale fill with its edge, a line and a link a stroke, each in the record's colour */
.ui-map-area { fill: var(--mark); fill-opacity: 0.2; stroke: var(--mark); stroke-width: 1.5; stroke-linejoin: round; }
.ui-map-line { fill: none; stroke: var(--mark); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ui-map-link { fill: none; stroke: var(--mark); stroke-width: 1.75; }
.ui-map-hit { fill: none; stroke: transparent; stroke-width: 12; }
.ui-map-head { fill: var(--mark); }
.ui-map-outline { fill-opacity: 0.08; stroke-width: 1.25; }	/* a record's own outline (GeoJSON), lightly filled, since outlines nest within one another */
.ui-port-figure .ui-mark.ui-selected > .ui-map-area { stroke: var(--ui-fg); stroke-width: 2.5; fill-opacity: 0.35; }	/* the outline picked */
.ui-map-cluster { cursor: zoom-in; }	/* points gathered at this zoom: a circle in the colour most of them wear, with their count */
.ui-map .ui-map-cluster circle { fill: var(--mark); fill-opacity: 0.3; stroke: var(--mark); stroke-width: 2; }
.ui-map-cluster:hover circle { fill-opacity: 0.5; }
.ui-map .ui-map-cluster.ui-selected circle { stroke: var(--ui-fg); stroke-width: 3; }	/* the picked record is among these */
.ui-map-cluster text { fill: var(--ui-fg); font-size: var(--ui-text-xs); font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.ui-port-figure .ui-mark.ui-selected > .ui-map-hit { stroke: transparent; }
.ui-port-figure .ui-mark.ui-selected > .ui-map-line, .ui-port-figure .ui-mark.ui-selected > .ui-map-link { stroke: var(--ui-fg); }
.ui-map-linklabel { fill: var(--ui-fg); font-size: var(--ui-text-xs); paint-order: stroke; stroke: var(--ui-bg-elev); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }	/* a link's words along it, haloed over the line */
/* Timelines: time, a dot on the line, the words; a line before each day and a dashed note where a long pause falls */
.ui-timeline { --ui-timeline-time: calc(var(--ui-text-base) * 5.5); }
.ui-timeline > .ui-port-stage > .ui-port-entries { display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; }	/* a long history scrolls in place rather than running down the page */
.ui-timeline-item { display: grid; grid-template-columns: var(--ui-timeline-time) 1.25rem minmax(0, 1fr); align-items: baseline; padding: 2px var(--ui-space-1); border-radius: var(--ui-radius-sm); cursor: pointer; }
.ui-timeline-item:hover { background: var(--ui-secondary-100); }
.ui-timeline-item.ui-selected { background: var(--ui-primary-100); }
.ui-timeline-time { text-align: right; padding-right: var(--ui-space-2); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-timeline-dot { position: relative; align-self: stretch; }
/* The line runs through every row, day line and pause at one place, so it reads unbroken; across a long pause it is dashed */
.ui-timeline-dot::before, .ui-timeline-day::before, .ui-timeline-gap::before { content: ""; position: absolute; top: -2px; bottom: -2px; width: 0; border-left: 2px solid var(--ui-border); }
.ui-timeline-dot::before { left: calc(50% - 1px); }
.ui-timeline-day::before, .ui-timeline-gap::before { top: 0; bottom: 0; left: calc(var(--ui-timeline-time) + 0.625rem - 1px + var(--ui-space-1)); }
.ui-timeline-gap::before { border-left-style: dashed; }
.ui-timeline-dot::after { content: ""; position: absolute; top: calc(var(--ui-text-sm) * 0.45); left: calc(50% - 0.35rem); width: 0.7rem; height: 0.7rem; border-radius: var(--ui-radius-full); background: var(--mark); box-shadow: 0 0 0 2px var(--ui-bg); }
.ui-timeline-words { font-size: var(--ui-text-sm); overflow-wrap: anywhere; }
.ui-timeline-day { position: relative; padding-top: var(--ui-space-2); padding-bottom: var(--ui-space-1); padding-left: calc(var(--ui-timeline-time) + 1.25rem + var(--ui-space-1)); font-size: var(--ui-text-xs); font-weight: 600; color: var(--ui-fg); }
.ui-timeline-gap { position: relative; padding: var(--ui-space-1) 0 var(--ui-space-1) calc(var(--ui-timeline-time) + 1.25rem + var(--ui-space-1)); font-size: var(--ui-text-xs); font-style: italic; color: var(--ui-fg-muted); }
/* Gauges: the track and bands as a half ring, the needle in ink, the value in its band's tone */
.ui-gauge-cell { fill: transparent; }
.ui-gauge-turnable > .ui-port-stage > .ui-port-figure { touch-action: none; }
.ui-gauge-turnable .ui-gauge-dial { cursor: grab; }
.ui-gauge-turning .ui-gauge-dial { cursor: grabbing; }
.ui-gauge-dial:hover > .ui-gauge-cell { fill: var(--ui-secondary-100); }
.ui-port-figure .ui-gauge-dial.ui-selected > .ui-gauge-cell { fill: var(--ui-primary-100); stroke: none; }
.ui-gauge-track { fill: var(--ui-bg-sunken); stroke: var(--ui-border); stroke-width: 1; }
.ui-gauge-band { fill: var(--mark); fill-opacity: 0.55; stroke: none; }
.ui-gauge-target { stroke: var(--ui-fg); stroke-width: 2.5; stroke-linecap: round; }
.ui-gauge-needle { stroke: var(--ui-fg); stroke-width: 2.5; stroke-linecap: round; }
.ui-gauge-hub { fill: var(--ui-fg); stroke: none; }
.ui-port-figure .ui-gauge-dial.ui-selected > .ui-gauge-band { stroke: none; }
.ui-port-figure .ui-gauge-dial.ui-selected > .ui-gauge-track { stroke: var(--ui-border); stroke-width: 1; }
.ui-gauge-value { fill: var(--mark); font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.ui-gauge-blank { fill: var(--ui-fg-muted); font-size: var(--ui-text-sm); font-style: italic; font-weight: 400; }
.ui-gauge-end { fill: var(--ui-fg-muted); font-variant-numeric: tabular-nums; }
.ui-gauge-label { fill: var(--ui-fg); font-size: var(--ui-text-sm); }
.ui-glyph-cell { fill: transparent; }
.ui-glyph:hover > .ui-glyph-cell { fill: var(--ui-secondary-100); }
.ui-port-figure .ui-glyph.ui-selected > .ui-glyph-cell { fill: var(--ui-primary-100); stroke: none; }
.ui-glyph-petal { fill: var(--mark); stroke: var(--mark); stroke-width: 1; }
.ui-glyph-track { fill: var(--ui-gray-100); stroke: var(--ui-border); stroke-width: 0.75; }
.ui-glyph-blank { fill: none; stroke: var(--ui-fg-muted); stroke-width: 1; stroke-dasharray: 2 2; }
.ui-glyph-core { fill: var(--mark); stroke: var(--ui-bg-elev); stroke-width: 2; }
.ui-glyph-label { fill: var(--ui-fg); font-size: var(--ui-text-sm); }
.ui-glyph-detail, .ui-glyph-petal-label { fill: var(--ui-fg-muted); font-size: var(--ui-text-xs); }
.ui-port-key:has(.ui-glyph-key-item) { display: flex; flex-wrap: wrap; gap: var(--ui-space-1) var(--ui-space-3); font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-glyph-key-item { display: inline-flex; align-items: center; gap: var(--ui-space-1); }
.ui-glyph-ink { --mark: var(--ui-primary); }
.ui-glyph-key-mini { flex: none; }
.ui-glyph-key-mini .ui-glyph-petal { stroke: none; }
/* A selected glyph keeps its petals as they are: the cell is lit and the centre ringed, so the shares stay readable. */
.ui-port-figure .ui-glyph.ui-selected > .ui-glyph-petal { stroke: var(--mark); stroke-width: 1; }
.ui-port-figure .ui-glyph.ui-selected > .ui-glyph-track { stroke: var(--ui-border); stroke-width: 0.75; }
.ui-port-figure .ui-glyph.ui-selected > .ui-glyph-blank { stroke: var(--ui-fg-muted); stroke-width: 1; }
.ui-port-figure .ui-glyph.ui-selected > .ui-glyph-core { stroke: var(--ui-fg); stroke-width: 2.5; }
/* LaTeX: MathJax draws in the current text colour, so formulas follow every theme and both modes. */
.ui-latex { line-height: var(--hp-line-height); overflow-x: auto; }
.ui-latex mjx-container[display="true"] { margin: var(--ui-space-2) 0; }
.ui-latexinput > textarea { font-family: var(--hp-font-mono); }
.ui-latexinput > .ui-port-preview { min-height: 2.5em; padding: var(--ui-space-1) var(--ui-space-2); background: var(--ui-bg-sunken); border-radius: var(--ui-radius-sm); }
.ui-latex mjx-container[jax="SVG"] > svg a { fill: var(--ui-primary); stroke: var(--ui-primary); }  /* an \eqref reads in the primary colour in both modes */
.ui-datetime-parts { display: flex; gap: var(--ui-space-2); }
.ui-datetime-parts > input { flex: 1 1 0; min-width: 0; }
.ui-datetime-parts > input:focus { outline: none; border-color: var(--ui-primary); box-shadow: var(--ui-focus-ring); }
/* The top row of a collection: search, title and the offered edits, with the edits at the right. */
.ui-port-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); margin-bottom: var(--ui-space-2); }
.ui-marks > .ui-port-top { margin-bottom: 0; }
.ui-port-top > .ui-port-search { flex: 1 1 12rem; margin: 0; }
.ui-port-top > .ui-port-title { margin-right: auto; }
.ui-port-actions { display: flex; flex-wrap: wrap; gap: var(--ui-space-1); margin-left: auto; }
.ui-port-actions > .ui-button { padding: 0 var(--ui-space-2); }
.ui-button.ui-tone-danger:not(.ui-button-quiet) { color: var(--ui-on-primary); background: var(--ui-danger); }
/* ---- 8. Drawing (class.ui-draw.js): a stroke reads --ink, which its ink class sets, or an old paper's own colour ---- */
.ui-ink-primary { --ink: var(--ui-primary); } .ui-ink-secondary { --ink: var(--ui-secondary); } .ui-ink-danger { --ink: var(--ui-danger); } .ui-ink-warn { --ink: var(--ui-warn); }
.ui-ink-success { --ink: var(--ui-success); } .ui-ink-info { --ink: var(--ui-info); } .ui-ink-fg { --ink: var(--ui-fg); } .ui-ink-muted { --ink: var(--ui-fg-muted); }
.ui-ink-series-1 { --ink: var(--ui-series-1); } .ui-ink-series-2 { --ink: var(--ui-series-2); } .ui-ink-series-3 { --ink: var(--ui-series-3); } .ui-ink-series-4 { --ink: var(--ui-series-4); }
.ui-ink-series-5 { --ink: var(--ui-series-5); } .ui-ink-series-6 { --ink: var(--ui-series-6); } .ui-ink-series-7 { --ink: var(--ui-series-7); } .ui-ink-series-8 { --ink: var(--ui-series-8); }
.ui-drawing > .ui-port-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-1) var(--ui-space-3); }
.ui-draw-group { display: flex; flex-wrap: wrap; gap: 2px; }
.ui-draw-group > .ui-button { min-height: 1.9rem; padding: 0 var(--ui-space-2); }
.ui-draw-group > .ui-button.ui-on { color: var(--ui-primary-700); background: var(--ui-primary-100); border-color: var(--ui-primary); }
.ui-draw-swatch, .ui-draw-width { min-width: 1.9rem; }
.ui-draw-swatch::before { content: ""; width: 0.95rem; height: 0.95rem; border-radius: var(--ui-radius-full); background: var(--ink); }
.ui-draw-width::before { content: ""; width: 1.1rem; height: var(--ui-draw-w); border-radius: var(--ui-radius-full); background: currentColor; }
.ui-drawing > .ui-port-stage { background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-sm); }
.ui-drawing .ui-port-yLabel { padding: var(--ui-space-1) var(--ui-space-2) 0; font-size: var(--ui-text-sm); }
.ui-drawing .ui-port-xLabel { padding: 0 var(--ui-space-2) var(--ui-space-1) var(--ui-draw-left); text-align: center; font-size: var(--ui-text-sm); }
.ui-port-drawing { display: block; width: 100%; height: auto; font-family: var(--hp-font-body); font-size: var(--ui-text-xs); user-select: none; touch-action: none; cursor: crosshair; }
.ui-draw-readonly .ui-port-drawing { touch-action: auto; cursor: default; }
.ui-draw-background, .ui-draw-axes, .ui-draw-base, .ui-draw-draft { pointer-events: none; }
.ui-draw-background { color: var(--ui-fg-muted); }
.ui-draw-axes text { fill: var(--ui-fg-muted); font-variant-numeric: tabular-nums; }
.ui-draw-grid { stroke: var(--ui-border); stroke-width: 1; }
.ui-draw-frame { fill: none; stroke: var(--ui-fg-muted); stroke-width: 1.25; }
.ui-draw-surface rect { fill: transparent; }
.ui-draw-line, .ui-draw-draft path { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.ui-draw-head, .ui-draw-dot { fill: var(--ink); }
.ui-draw-hit { fill: none; stroke: transparent; stroke-width: 12; stroke-linecap: round; }
.ui-draw-base .ui-draw-line { opacity: 0.7; stroke-dasharray: 6 4; }
.ui-draw-stroke.ui-selected .ui-draw-line { filter: drop-shadow(0 0 2px var(--ui-primary)); }
.ui-draw-vertex { fill: var(--ui-bg-elev); stroke: var(--ui-primary); stroke-width: 1.5; cursor: grab; }
.ui-draw-vertex-on { fill: var(--ui-primary); stroke: var(--ui-bg-elev); stroke-width: 2; }
.ui-port-drawing:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
.ui-draw-focus .ui-draw-hit { stroke: hsl(from var(--ui-primary) h s l / 22%); }	/* the stroke the keyboard is on: a halo along it */
.ui-draw-focus .ui-draw-dot { stroke: hsl(from var(--ui-primary) h s l / 40%); stroke-width: 6; }
.ui-draw-sign { stroke: var(--ui-border-input); stroke-width: 1.25; }
.ui-signature { max-width: calc(var(--ui-text-base) * 34); }	/* a signature box is the width of a signing line on paper, not of the page */
.ui-signature .ui-draw-axes text { fill: var(--ui-fg-muted); font-size: var(--ui-text-sm); }
.ui-signature .ui-draw-axes .ui-draw-signer { fill: var(--ui-fg); font-size: var(--ui-text-xs); }
.ui-signature > .ui-port-signed { font-size: var(--ui-text-sm); font-weight: 500; color: var(--ui-fg); }
.ui-signature > .ui-port-signed.ui-draw-unsigned { color: var(--ui-fg-muted); }
/* The curve editor: values drawn in the primary colour on the input's own surface */
.ui-curve-box { min-width: 0; background: var(--ui-bg-elev); border: var(--ui-border-width) solid var(--ui-border-input); border-radius: var(--ui-radius-sm); }
.ui-curve-svg { display: block; width: 100%; height: auto; font-family: var(--hp-font-body); font-size: var(--ui-text-xs); user-select: none; touch-action: none; cursor: ns-resize; }
.ui-curve-locked .ui-curve-svg { cursor: default; touch-action: auto; }
.ui-curve-svg text { fill: var(--ui-fg-muted); font-variant-numeric: tabular-nums; }
.ui-curve-svg .ui-curve-title { fill: var(--ui-fg); }
.ui-curve-grid { stroke: var(--ui-border); stroke-width: 1; }
.ui-curve-line { fill: none; stroke: var(--ui-primary); stroke-width: 2; stroke-linejoin: round; }
.ui-curve-point { fill: var(--ui-primary); stroke: var(--ui-bg-elev); stroke-width: 1.5; }
.ui-curve-bar { fill: hsl(from var(--ui-primary) h s l / 0.75); }
/* ---- 9. Documents and threads (class.ui-content.js) ---- */
.ui-document { display: flex; flex-direction: column; min-width: 0; }
.ui-document-label { margin-bottom: var(--ui-space-1); font-size: var(--ui-text-xs); font-weight: 500; color: var(--ui-fg-muted); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); }
.ui-document .ui-port-add { display: flex; flex-wrap: wrap; gap: var(--ui-space-1); margin-bottom: var(--ui-space-2); }
.ui-document .ui-port-add > .ui-button { padding: 0 var(--ui-space-2); }
.ui-document-block { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--ui-space-1); padding: var(--ui-space-1) var(--ui-space-2); border: var(--ui-border-width) solid transparent; border-radius: var(--ui-radius-md); }
.ui-document-block:hover:not(.ui-document-editing) { border-color: var(--ui-border); }
.ui-document-view { flex: 1 1 0; min-width: 0; }
.ui-document-view > p { margin: 0 0 var(--ui-space-2); white-space: pre-line; overflow-wrap: break-word; }
.ui-document-view > :last-child { margin-bottom: 0; }
.ui-document-view > ul, .ui-document-view > ol { margin: 0; padding-left: calc(var(--ui-space-4) * 1.5); }
.ui-document-page { display: flex; align-items: flex-start; gap: calc(var(--ui-space-4) * 2); }
.ui-document-main { flex: 1 1 0; min-width: 0; max-width: calc(var(--ui-text-base) * 48); margin-inline: auto; }
.ui-document-outline { position: sticky; top: var(--ui-space-4); flex: 0 0 calc(var(--ui-text-base) * 17); max-height: calc(100vh - var(--ui-space-4) * 2); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: var(--ui-space-3); border-right: var(--ui-line); }
.ui-document-outline:empty { display: none; }
.ui-document-outline .ui-button { display: flex; justify-content: flex-start; align-items: baseline; gap: var(--ui-space-2); height: auto; padding: var(--ui-space-1) var(--ui-space-2); font-size: var(--ui-text-sm); font-weight: 400; line-height: 1.35; text-align: left; white-space: normal; color: var(--ui-fg); border-color: transparent; border-radius: var(--ui-radius-sm); }
.ui-document-outline .ui-button.ui-selected { color: var(--ui-primary-700); background: var(--ui-primary-50); font-weight: 600; }
.ui-document-outline-head { display: flex; flex-direction: column; gap: var(--ui-space-1); padding-bottom: var(--ui-space-3); margin-bottom: var(--ui-space-2); border-bottom: var(--ui-line); }
.ui-document-outline .ui-document-outline-title { padding: 0; font-size: var(--ui-text-lg); font-weight: 600; line-height: 1.25; }
.ui-document-outline-subtitle { font-size: var(--ui-text-sm); line-height: 1.45; color: var(--ui-fg-muted); }
.ui-document-outline-byline { font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
.ui-document-outline-label { margin: var(--ui-space-1) 0; padding: 0 var(--ui-space-2); font-size: var(--ui-text-xs); font-weight: 500; color: var(--ui-fg-muted); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); }
.ui-document-outline-sections { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 var(--ui-space-2) calc(var(--ui-space-4) * 1.5); }
.ui-document-outline .ui-document-outline-section { padding: 2px var(--ui-space-2); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
.ui-document-part-number { flex: 0 0 auto; min-width: 1.4em; font-variant-numeric: tabular-nums; color: var(--ui-fg-muted); }
.ui-selected > .ui-document-part-number { color: inherit; }
.ui-document-bar { display: flex; align-items: center; gap: var(--ui-space-2); padding-bottom: var(--ui-space-2); margin-bottom: var(--ui-space-4); border-bottom: var(--ui-line); }
.ui-document-bar:empty { display: none; }
.ui-document-bar-steps { display: flex; align-items: center; gap: var(--ui-space-2); margin-left: auto; }
.ui-document-bar-place { font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-document-bar .ui-button { border-color: transparent; }
.ui-document-parts:empty, .ui-document-foot:empty { display: none; }
.ui-document-parts { margin-top: calc(var(--ui-space-4) * 1.5); }
.ui-document-parts-label { margin-bottom: var(--ui-space-2); font-size: var(--ui-text-xs); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ui-fg-muted); }
.ui-document-parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--ui-text-base) * 13), 1fr)); gap: var(--ui-space-2); }
.ui-document-part, .ui-document-foot-step { display: flex; flex-direction: column; align-items: flex-start; gap: var(--ui-space-1); height: auto; padding: var(--ui-space-3); text-align: left; white-space: normal; color: var(--ui-fg); background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-md); }
.ui-document-part:hover, .ui-document-foot-step:hover { border-color: var(--ui-primary-600); }
.ui-document-part .ui-document-part-number { font-size: var(--ui-text-sm); font-weight: 600; color: var(--ui-primary-700); }
.ui-document-part-label { font-size: var(--ui-text-base); line-height: 1.35; }
.ui-document-foot { display: flex; justify-content: space-between; gap: var(--ui-space-3); margin-top: calc(var(--ui-space-4) * 1.5); padding-top: var(--ui-space-3); border-top: var(--ui-line); }
.ui-document-foot > * { flex: 1 1 0; min-width: 0; }
.ui-document-foot-after { align-items: flex-end; text-align: right; }
.ui-document-foot-word { font-size: var(--ui-text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ui-fg-muted); }
.ui-document-foot-label { font-size: var(--ui-text-base); color: var(--ui-primary-700); }
@media (max-width: 60rem) { .ui-document-page { flex-direction: column; } .ui-document-outline { position: static; flex: none; width: 100%; max-height: none; border-right: 0; padding-right: 0; } .ui-document-main { max-width: none; width: 100%; } }
.ui-document-block { scroll-margin-top: var(--ui-space-4); }
.ui-document-cover { display: flex; flex-direction: column; gap: var(--ui-space-3); padding: calc(var(--ui-space-4) * 2.5) calc(var(--ui-space-4) * 2.5); color: var(--ui-on-primary); background: linear-gradient(135deg, var(--ui-primary-700), var(--ui-primary-600)); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-lg); }
.ui-document-cover-label { font-size: var(--ui-text-xs); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; }
.ui-document-cover-title { margin: 0; font-family: var(--hp-font-heading); font-weight: var(--hp-weight-heading); font-size: calc(var(--ui-text-xl) * 1.8); line-height: 1.15; }
.ui-document-cover-subtitle { margin: 0; font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-style: italic; line-height: 1.5; }
.ui-document-cover-byline { font-size: var(--ui-text-base); }
.ui-keep-in-view { position: sticky; top: var(--ui-space-4); align-self: flex-start; max-height: calc(100vh - var(--ui-space-4) * 2); overflow-y: auto; }
.ui-document-text > p, .ui-document-view > ul > li, .ui-document-view > ol > li { font-family: var(--hp-font-heading); font-size: var(--ui-text-base); line-height: 1.65; }
.ui-document-view > ul > li, .ui-document-view > ol > li { margin-bottom: var(--ui-space-1); }
h2.ui-document-heading { margin: var(--ui-space-2) 0 var(--ui-space-3); }
h3.ui-document-heading { margin-top: calc(var(--ui-space-4) * 1.5); padding-bottom: var(--ui-space-1); color: var(--ui-primary-700); border-bottom: var(--ui-line); }
.ui-table-words { width: 100%; margin: var(--ui-space-1) 0; border-collapse: collapse; font-family: var(--hp-font-heading); font-size: var(--ui-text-sm); background: var(--ui-bg-elev); box-shadow: var(--ui-shadow-sm); }
.ui-table-words th { padding: var(--ui-space-2); text-align: left; font-weight: 600; background: var(--ui-bg-sunken); border: var(--ui-line); }
.ui-table-words td { padding: var(--ui-space-2); border: var(--ui-line); vertical-align: top; overflow-wrap: anywhere; }
.ui-table-words .ui-table-toned { background: var(--ui-tone-bg); font-weight: 600; }
.ui-document-heading { margin: var(--ui-space-1) 0; font-family: var(--hp-font-heading); font-weight: var(--hp-weight-heading); line-height: 1.25; }
h2.ui-document-heading { font-size: calc(var(--ui-text-xl) * 1.2); } h3.ui-document-heading { font-size: var(--ui-text-lg); } h4.ui-document-heading { font-size: var(--ui-text-base); }
.ui-document-placeholder { font-size: var(--ui-text-sm); font-style: italic; color: var(--ui-fg-muted); }
.ui-document-caption { margin-top: var(--ui-space-1); font-size: var(--ui-text-sm); text-align: center; color: var(--ui-fg-muted); }
.ui-document-view > .ui-image { max-width: 100%; margin: 0 auto; border-radius: var(--ui-radius-sm); }
.ui-document .ui-drawing { width: 100%; max-width: calc(var(--ui-text-base) * 44); margin: 0 auto; }	/* a figure reads at the size of a page's figure, not of the screen */
.ui-document-pencil { opacity: 0; padding: 0 var(--ui-space-2); }
.ui-document-block:hover > .ui-document-pencil, .ui-document-pencil:focus-visible { opacity: 1; }
/* The handle a block is dragged by, shown on hover; the dragged block follows the pointer and the place it would go is marked */
.ui-document-grip { align-self: flex-start; padding: 0 2px; color: var(--ui-fg-muted); line-height: 1.6; cursor: grab; user-select: none; touch-action: none; opacity: 0; }
.ui-document-block:hover > .ui-document-grip, .ui-document-dragging > .ui-document-grip { opacity: 1; }
@media (hover: none) { .ui-document-pencil, .ui-document-grip { opacity: 1; } }
.ui-document-dragging { position: relative; z-index: 1; transform: translateY(var(--ui-document-drag, 0)); background: var(--ui-bg-elev); border-color: var(--ui-border); box-shadow: var(--ui-shadow-lg); cursor: grabbing; }
.ui-document-grip:focus-visible { opacity: 1; border-radius: var(--ui-radius-sm); }
.ui-document-lifted { background: var(--ui-bg-elev); border-color: var(--ui-primary); box-shadow: var(--ui-shadow-lg); }
.ui-spoken { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }	/* said to a screen reader, not shown */
.ui-document-drop { box-shadow: inset 0 2px 0 var(--ui-primary); }
.ui-document-drop-end { box-shadow: inset 0 -2px 0 var(--ui-primary); }
.ui-document-view code { padding: 0 0.25em; font-family: var(--hp-font-mono); font-size: 0.92em; background: var(--ui-bg-sunken); border-radius: var(--ui-radius-sm); }
.ui-document-view a { color: var(--ui-primary-700); }
.ui-document-editing { padding: var(--ui-space-2) var(--ui-space-3); background: var(--ui-bg-elev); border-color: var(--ui-border); box-shadow: var(--ui-shadow-sm); }
.ui-document-editor { flex: 1 1 100%; min-width: 0; display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-document-edithead { font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
.ui-document-axes > .ui-port-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ui-space-1) var(--ui-space-2); }
@media (max-width: 720px) { .ui-document-axes > .ui-port-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ui-document-json textarea { font-family: var(--hp-font-mono); font-size: var(--ui-text-xs); }
/* A thread: the messages in a sunken box that scrolls, day lines in the middle, one's own to the right in the primary tint */
.ui-thread { display: flex; flex-direction: column; gap: var(--ui-space-2); min-width: 0; }
.ui-thread > .ui-port-entries { display: flex; flex-direction: column; gap: 2px; max-height: calc(var(--ui-text-base) * 34); overflow-y: auto; padding: var(--ui-space-2) var(--ui-space-3); background: var(--ui-bg-sunken); border: var(--ui-line); border-radius: var(--ui-radius-md); }
.ui-thread-day { align-self: center; margin: var(--ui-space-2) 0 var(--ui-space-1); padding: 0 var(--ui-space-2); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-full); }
.ui-thread-message { align-self: flex-start; display: flex; flex-direction: column; gap: 2px; max-width: min(36rem, 85%); min-width: 0; padding: var(--ui-space-1) var(--ui-space-3); background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-lg); }
.ui-thread-first { margin-top: var(--ui-space-2); }
.ui-thread-mine { align-self: flex-end; background: var(--ui-primary-100); border-color: hsl(from var(--ui-primary) h s l / 0.35); }
.ui-thread-head { font-size: var(--ui-text-xs); font-weight: 600; }
.ui-thread-head > .ui-avatar { margin-right: var(--ui-space-1); }
.ui-thread-quote { padding: 0 var(--ui-space-2); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--ui-bg-sunken); border-left: var(--hp-active-marker-w) solid var(--ui-secondary); border-radius: var(--ui-radius-sm); }
.ui-thread-text { font-size: var(--ui-text-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.ui-thread-foot { display: flex; align-items: center; gap: var(--ui-space-2); min-height: 1.4rem; font-size: var(--ui-text-xs); color: var(--ui-fg-muted); font-variant-numeric: tabular-nums; }
.ui-thread-actions { display: flex; gap: 2px; margin-left: auto; opacity: 0; }
.ui-thread-message:hover .ui-thread-actions, .ui-thread-actions:focus-within { opacity: 1; }
@media (hover: none) { .ui-thread-actions { opacity: 1; } }
.ui-thread-actions > .ui-button { padding: 0 var(--ui-space-1); font-size: var(--ui-text-xs); border-color: transparent; }
.ui-thread-message:has(> .ui-thread-edit) { width: min(36rem, 85%); }	/* editing a short message gives the words room */
.ui-thread-edit > .ui-port-buttons:not(:empty) { margin-top: var(--ui-space-1); }
.ui-thread > .ui-port-earlier { align-self: center; font-size: var(--ui-text-xs); }
.ui-thread > .ui-port-reply { display: flex; align-items: center; gap: var(--ui-space-2); padding: 0 var(--ui-space-2); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); border-left: var(--hp-active-marker-w) solid var(--ui-secondary); }
.ui-thread-replytext { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-thread > .ui-port-composer { flex-wrap: nowrap; }
.ui-thread > .ui-port-composer > .ui-port-fields { flex: 1 1 auto; min-width: 0; }
.ui-thread > .ui-port-composer > .ui-port-fields > .ui-input { flex: 1 1 auto; }
/* ---- 10. QR codes (class.ui-codes.js): dark modules on a light ground in both modes, since a reader needs the contrast ---- */
.ui-qr { --ui-qr-size: 32mm; --ui-qr-ink: hsl(var(--hp-hue-bg), 30%, 8%); --ui-qr-ground: hsl(0, 0%, 100%); }
.ui-qr-label { margin-bottom: var(--ui-space-1); font-size: var(--ui-text-xs); font-weight: 500; color: var(--ui-fg-muted); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); }
.ui-qr .ui-port-top > .ui-port-tools { margin-left: auto; }
.ui-qr > .ui-port-stage > .ui-port-entries { display: flex; }
.ui-qr-sheet > .ui-port-stage > .ui-port-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--ui-qr-size) + 2 * var(--ui-space-2)), 1fr)); gap: var(--ui-space-2); }
.ui-qr-cell { display: flex; flex-direction: column; align-items: center; gap: var(--ui-space-1); min-width: 0; margin: 0; padding: var(--ui-space-2); border-radius: var(--ui-radius-sm); }
.ui-qr-one .ui-qr-cell { padding: 0; }
.ui-qr-sheet .ui-qr-cell { border: var(--ui-border-width) dashed var(--ui-border); break-inside: avoid; }	/* the dashes are where the labels are cut apart */
.ui-qr-sheet .ui-qr-cell:hover { background: var(--ui-secondary-100); }
.ui-qr-sheet .ui-qr-cell.ui-selected { background: var(--ui-primary-100); border-style: solid; border-color: var(--ui-primary); }
.ui-qr-svg { display: block; flex: 0 0 auto; width: var(--ui-qr-size); height: auto; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.ui-qr-ground { fill: var(--ui-qr-ground); }
.ui-qr-ink { fill: var(--ui-qr-ink); }
.ui-qr-cell > figcaption { display: flex; flex-direction: column; align-items: center; max-width: max(var(--ui-qr-size), 100%); text-align: center; line-height: 1.3; }
.ui-qr-words { font-size: var(--ui-text-sm); font-weight: 500; color: var(--ui-fg); overflow-wrap: anywhere; text-wrap: balance; }
.ui-qr-text { font-family: var(--hp-font-mono); font-size: var(--ui-text-xs); color: var(--ui-fg-muted); overflow-wrap: anywhere; }
.ui-qrscan > .ui-port-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ui-space-2); }
.ui-qrscan > .ui-port-bar > .ui-port-typed { flex: 1 1 14rem; min-width: 0; }
.ui-qrscan .ui-port-typed .ui-port-fields { flex: 1 1 auto; min-width: 0; }
.ui-qrscan .ui-port-typed .ui-port-fields > .ui-input { flex: 1 1 auto; }
.ui-qrscan-view video { display: block; width: 100%; max-width: calc(var(--ui-text-base) * 28); max-height: 50vh; object-fit: cover; background: var(--ui-bg-sunken); border: var(--ui-line); border-radius: var(--ui-radius-md); }
.ui-qrscan > .ui-port-status { padding: var(--ui-space-1) var(--ui-space-2); font-size: var(--ui-text-sm); background: var(--ui-tone-bg, var(--ui-gray-100)); border-left: var(--hp-active-marker-w) solid currentColor; border-radius: var(--ui-radius-sm); overflow-wrap: anywhere; }
/* Print: Print marks one uiQr, and the page prints that alone, with no tools; anything that neither is it nor holds it is left out. */
@media print {
    body:has(.ui-qr-printing) *:not(:has(.ui-qr-printing)):not(.ui-qr-printing):not(.ui-qr-printing *) { display: none !important; }
    .ui-qr .ui-port-tools, .ui-qr > .ui-port-legend, .ui-qr > .ui-port-note { display: none !important; }
    .ui-qr-sheet .ui-qr-cell, .ui-qr-sheet .ui-qr-cell.ui-selected { background: none; border: var(--ui-border-width) dashed hsl(0, 0%, 70%); }
    .ui-qr-words, .ui-qr-text { color: hsl(0, 0%, 0%); }
}

/* uiText, uiTable and uiAssembly */
.ui-text > p { margin: 0 0 var(--ui-space-2); overflow-wrap: break-word; }
.ui-text > p:last-child { margin-bottom: 0; }
.ui-assembly-node { display: contents; }
/* A block of code in a document: on its own panel, kept as written, scrolling across rather than wrapping. */
.ui-assembly pre, .ui-document pre { background: var(--ui-bg-sunken); padding: var(--ui-space-2) var(--ui-space-3); border-radius: var(--ui-radius-md); font-family: var(--hp-font-mono, monospace); font-size: var(--ui-text-sm); white-space: pre; overflow-x: auto; }
/* A document made of elements: the space between its parts, which a block's padding gave before */
.ui-assembly-node > .ui-text:not(li), .ui-assembly-node > .ui-table, .ui-assembly-node > .ui-callout, .ui-assembly-node > .ui-latex { margin: 0 0 var(--ui-space-3); }	/* a node's ui sits in a wrapper with no box (display: contents) */
.ui-document-figure { margin: var(--ui-space-3) 0; }
.ui-document-figure > .ui-image { max-width: 100%; margin: 0 auto; border-radius: var(--ui-radius-sm); }
.ui-assembly-section { display: block; margin-bottom: var(--ui-space-4); }

/* uiAssembly written in place: the element picked, and the panel beside the page */
.ui-assembly-editable .ui-port-entries { cursor: pointer; }
.ui-assembly-picked { outline: 2px solid var(--ui-primary-600); outline-offset: 3px; border-radius: var(--ui-radius-sm); }
.ui-assembly-editor { position: sticky; top: var(--ui-space-4); flex: 0 0 calc(var(--ui-text-base) * 22); max-height: calc(100vh - var(--ui-space-4) * 2); overflow-y: auto; display: flex; flex-direction: column; gap: var(--ui-space-3); padding: var(--ui-space-3); background: var(--ui-bg-elev); border: var(--ui-line); border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-sm); cursor: auto; }
.ui-assembly-editor-hint { font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-assembly-path { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: var(--ui-text-sm); }
.ui-assembly-path > .ui-button { padding: 0 var(--ui-space-1); border-color: transparent; }
.ui-assembly-path > .ui-button::after { content: '›'; margin-left: var(--ui-space-1); color: var(--ui-fg-muted); }
.ui-assembly-path-here { font-weight: 600; }
.ui-assembly-path-kind { font-weight: 400; font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
.ui-assembly-steps, .ui-assembly-actions { display: flex; flex-wrap: wrap; gap: var(--ui-space-1); }
.ui-assembly-steps > .ui-button, .ui-assembly-actions > .ui-button { padding: 0 var(--ui-space-2); font-size: var(--ui-text-sm); }
.ui-assembly-steps { padding-bottom: var(--ui-space-2); border-bottom: var(--ui-line); }
@media (max-width: 60rem) { .ui-assembly-editor { position: static; flex: none; width: 100%; max-height: none; } }
/* uiQuestion: a question in a document; the choices one under another, the verdict beneath Check */
.ui-question { display: flex; flex-direction: column; gap: var(--ui-space-2); padding: var(--ui-space-3) var(--ui-space-4); margin: 0 0 var(--ui-space-3); border: 1px solid var(--ui-border); border-left: var(--hp-active-marker-w) solid var(--ui-primary); border-radius: var(--ui-radius-sm); background: var(--ui-bg-elev); }
.ui-question .ui-question-prompt p { margin: 0; }
.ui-question .ui-question-choices .ui-choice-options { flex-direction: column; flex-wrap: nowrap; gap: var(--ui-space-2); font-size: var(--ui-text-base); }
.ui-question .ui-question-choices .ui-choice-options label { align-items: flex-start; }
.ui-question .ui-question-choices .ui-choice-options input { margin-top: 0.3em; }
.ui-question .ui-question-check { align-self: flex-start; }
.ui-question .ui-question-result:empty { display: none; }
.ui-question .ui-question-result .ui-text p { margin: 0 0 var(--ui-space-1); }
/* uiStage and the scene nodes (class.ui-scene.js): the frame keeps its drawing's proportions; words in a scene use the page's fonts */
.ui-stage { position: relative; width: 100%; aspect-ratio: var(--ui-stage-aspect, 16 / 9); background: var(--ui-bg-elev); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-md); touch-action: none; }
.ui-stage-svg, .ui-stage-canvas { display: block; width: 100%; height: 100%; }
.ui-stage-labels { position: absolute; inset: 0; pointer-events: none; }
.ui-scene-text { font-family: inherit; }
.ui-scene-label { font-family: inherit; white-space: nowrap; }
.ui-scene-draggable { cursor: grab; }
.ui-scene-selected > .ui-scene-part { filter: drop-shadow(0 0 2px var(--ui-primary)) drop-shadow(0 0 5px var(--ui-primary)); }
.ui-scene-picture { display: block; pointer-events: none; object-fit: contain; }
/* a part's drop shadow (its shadow setting, or one passed down from a group or the frame), in the theme's shadow colour and strength */
[data-shadow="sm"] > .ui-scene-part { filter: drop-shadow(0 calc(2px * var(--hp-shadow-scale)) calc(3px * var(--hp-shadow-scale)) hsl(var(--hp-hue-bg) 30% 10% / calc(var(--hp-shadow-intensity) * 4))); }
[data-shadow="md"] > .ui-scene-part { filter: drop-shadow(0 calc(5px * var(--hp-shadow-scale)) calc(8px * var(--hp-shadow-scale)) hsl(var(--hp-hue-bg) 30% 10% / calc(var(--hp-shadow-intensity) * 5))); }
[data-shadow="lg"] > .ui-scene-part { filter: drop-shadow(0 calc(10px * var(--hp-shadow-scale)) calc(18px * var(--hp-shadow-scale)) hsl(var(--hp-hue-bg) 30% 10% / calc(var(--hp-shadow-intensity) * 6))); }
.ui-stagelayer:empty { display: none; }
.ui-stagelayer-over { position: absolute; inset: var(--ui-space-2) var(--ui-space-2) auto; display: flex; flex-direction: column; align-items: flex-start; gap: var(--ui-space-1); pointer-events: none; }
.ui-stagelayer-over > * { pointer-events: auto; }
.ui-stagepanel { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--ui-space-2) var(--ui-space-4); align-items: end; padding: var(--ui-space-3) 0; }
.ui-stagepanel .ui-stage-play { justify-self: start; }
/* uiVoice (class.ui-voice.js): a transport, a caption, a card per line with its waveform, trim points and cues */
.ui-voice { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-voice-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); }
.ui-voice-bar .ui-select { width: auto; }
.ui-voice-where { margin-left: auto; font-size: var(--ui-text-sm); color: var(--ui-fg-muted); font-variant-numeric: tabular-nums; }
.ui-voice-caption { min-height: 2.6em; padding: var(--ui-space-2) var(--ui-space-3); font-size: var(--ui-text-lg); background: var(--ui-bg-sunken); border-radius: var(--ui-radius-md); }
.ui-voice-caption:not(:has(p))::before { content: 'The words appear here as they are spoken.'; color: var(--ui-fg-muted); font-size: var(--ui-text-sm); }
.ui-voice-lines { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-voice-line { display: flex; flex-direction: column; gap: var(--ui-space-2); padding: var(--ui-space-2) var(--ui-space-3); border: 1px solid var(--ui-border); border-left: var(--hp-active-marker-w) solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-bg-elev); }
.ui-voice-line.ui-voice-now { border-left-color: var(--ui-primary); background: var(--ui-primary-50); }
.ui-voice-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--ui-space-2); }
.ui-voice-number { min-width: 1.6em; font-weight: 700; color: var(--ui-fg-muted); padding-top: var(--ui-space-1); }
.ui-voice-text { flex: 1 1 16em; min-width: 0; }
.ui-voice-text textarea { width: 100%; box-sizing: border-box; }
.ui-voice-words { flex: 1; padding-top: var(--ui-space-1); }
.ui-voice-tools { display: flex; gap: var(--ui-space-1); }
.ui-voice-recording { color: var(--ui-danger); border-color: var(--ui-danger); }
.ui-voice-note { font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-voice-svg { display: block; width: 100%; height: 60px; background: var(--ui-bg-sunken); border-radius: var(--ui-radius-sm); cursor: crosshair; }
.ui-voice-peaks { stroke: var(--ui-primary); stroke-width: 1.5; }
.ui-voice-cut { fill: var(--ui-bg); opacity: 0.7; }
.ui-voice-trim { fill: var(--ui-warn); cursor: ew-resize; }
.ui-voice-head-line { fill: var(--ui-danger); }
.ui-voice-flag { fill: var(--ui-success); stroke: var(--ui-success); stroke-width: 1.5; }
.ui-voice-cues { display: flex; flex-wrap: wrap; gap: var(--ui-space-2); }
.ui-voice-cue { display: inline-flex; align-items: center; gap: var(--ui-space-1); padding: 0 var(--ui-space-2); border-radius: var(--ui-radius-full); background: var(--ui-success-100); font-size: var(--ui-text-sm); }
.ui-voice-cue-at { font-variant-numeric: tabular-nums; color: var(--ui-fg-muted); }
.ui-voice-cue-name { width: 9em; }
/* uiLesson (class.ui-lesson.js): the player around the scenes */
.ui-lesson { position: relative; display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-lesson-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-3); }
.ui-lesson-title { font-weight: 800; font-size: var(--ui-text-lg); }
.ui-lesson-scene-label { color: var(--ui-fg-muted); font-size: var(--ui-text-sm); }
.ui-lesson-progress { display: flex; gap: var(--ui-space-1); margin-left: auto; }
.ui-lesson-dot { width: 2.2em; height: 0.55em; min-height: 0; padding: 0; border-radius: var(--ui-radius-full); background: var(--ui-bg-sunken); }
.ui-lesson-dot-done { background: var(--ui-primary-100); }
.ui-lesson-dot-now { background: var(--ui-primary); }
.ui-lesson-scenes { display: flex; flex-direction: column; }
.ui-lessonscene { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-lesson-controls { display: flex; gap: var(--ui-space-2); justify-content: center; }
.ui-lesson-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: hsl(from var(--ui-bg) h s l / 0.72); border-radius: var(--ui-radius-md); }
.ui-lesson-card-body { display: flex; flex-direction: column; align-items: center; gap: var(--ui-space-2); max-width: 32em; padding: var(--ui-space-4); text-align: center; background: var(--ui-bg-elev); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-lg); }
.ui-lesson-card-body h3 { margin: 0; }
/* ---- 11. Bindings (Client-Bindings): the head of a bound element, its hover bar, the side form, and the layout of what a binding composes ---- */
.ui-binding-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--ui-space-2); }
.ui-binding-head-title { justify-content: flex-start; }
.ui-binding-titled, .ui-binding-head > .ui-binding-heading { margin-right: auto; }
.ui-binding-heading { font-family: var(--hp-font-heading); font-size: var(--ui-text-lg); font-weight: var(--hp-weight-heading); }
/* A view's parts, each in its holder: the surface and heading the part dials give. */
.ui-view-top, .ui-grid > .ui-port-left, .ui-grid > .ui-port-mid, .ui-grid > .ui-port-right { display: flex; flex-direction: column; gap: var(--hp-part-gap); min-width: 0; }
.ui-view-top { margin-bottom: var(--hp-part-gap); }
.ui-view-part { background: var(--hp-part-bg); padding: var(--hp-part-pad); border-radius: var(--hp-part-radius); border: var(--hp-part-line); box-shadow: var(--hp-part-shadow); min-width: 0; }
.ui-view-part :is(.ui-binding-heading, .ui-marks > .ui-port-title, .ui-marks > .ui-port-top > .ui-port-title, .ui-datatable > .ui-port-title) { font-family: var(--hp-part-heading-font); font-size: var(--hp-part-heading-size); font-weight: var(--hp-part-heading-weight); }
.ui-view-part:empty { display: none; }
.ui-binding-above { margin-bottom: var(--ui-space-2); }
.ui-binding-actions { display: flex; flex-wrap: wrap; gap: var(--ui-space-1); margin-left: auto; font-family: var(--hp-font-body); font-weight: var(--hp-weight-body); }
.ui-binding-search { flex: 0 1 14rem; margin: 0; font-family: var(--hp-font-body); font-weight: var(--hp-weight-body); }
.ui-binding-bar { position: fixed; z-index: 10; flex-direction: row; gap: var(--ui-space-1); padding: var(--ui-space-1); }
.ui-binding-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--ui-space-3); }
.ui-binding-main { flex: 1 1 32rem; min-width: 0; }
.ui-binding-sideform { flex: 1 1 16rem; max-width: 24rem; padding: var(--ui-space-3); gap: var(--ui-space-2); }
.ui-binding-cell { flex: 1 1 20rem; min-width: 0; }
.ui-binding-stack { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-binding-pager { display: flex; align-items: center; gap: var(--ui-space-2); padding-top: var(--ui-space-2); }
.ui-binding-pager > .ui-datatable-count { margin-right: auto; }
.ui-binding-pills, .ui-binding-legend, .ui-binding-strip { display: flex; flex-wrap: wrap; gap: var(--ui-space-1); }
.ui-binding-legend { margin-bottom: var(--ui-space-2); }
.ui-binding-strip { gap: var(--ui-space-2); }
.ui-binding-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-2); padding: var(--ui-space-2) 0; }
.ui-binding-record { align-items: flex-start; }
.ui-binding-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--ui-space-1) var(--ui-space-3); margin-top: var(--ui-space-2); font-size: var(--ui-text-sm); }
.ui-binding-field-label, .ui-question-label { color: var(--ui-fg-muted); font-size: var(--ui-text-xs); text-transform: var(--hp-label-transform); letter-spacing: var(--hp-label-tracking); }
.ui-question-label { font-weight: 500; }
.ui-binding-field-link { justify-self: start; padding: 0; min-height: 0; }
.ui-binding-field-value { overflow-wrap: anywhere; }
.ui-binding-field-blank { color: var(--ui-fg-muted); }
.ui-question-figure { width: 100%; max-width: calc(var(--ui-text-base) * 44); }
.ui-question-section { font-family: var(--hp-font-heading); font-weight: var(--hp-weight-heading); font-size: var(--ui-text-base); margin-top: var(--ui-space-3); padding-bottom: var(--ui-space-1); border-bottom: var(--ui-line); }

/* ---- 4c. Elements from the mockup review: facts, legend, switch, segmented choice, crumbs, feed, ring, sparkline, numbered captions ---- */
/* Facts: terms at the left in quiet ink, values beside them. */
.ui-facts > .ui-port-entries { display: grid; grid-template-columns: max-content 1fr; gap: var(--ui-space-1) var(--ui-space-4); font-size: var(--ui-text-sm); }
.ui-facts-row { display: contents; }
.ui-facts-term { color: var(--ui-fg-muted); }
.ui-facts-value { font-weight: 500; font-variant-numeric: tabular-nums; }
.ui-facts-value:not([class*="ui-tone-"]) { color: var(--ui-fg); }
.ui-facts-row { cursor: pointer; }
.ui-facts-row.ui-selected > .ui-facts-term { color: var(--ui-primary-700); font-weight: 600; }
/* Legend on its own: the figures' chips in a row; the selected class is marked by its own colour. */
.ui-legend > .ui-port-entries { display: flex; flex-wrap: wrap; gap: var(--ui-space-1) var(--ui-space-2); }
.ui-legend .ui-legend-chip.ui-selected { border-color: var(--mark); background: var(--ui-bg-sunken); font-weight: 600; }
/* Switch: the toggle field type, drawn as a track and a knob that slides. */
.ui-input-toggle input { appearance: none; flex: none; position: relative; width: calc(var(--ui-text-base) * 2.2); height: calc(var(--ui-text-base) * 1.25); border-radius: var(--ui-radius-full); background: var(--ui-border-input); cursor: pointer; transition: background var(--ui-transition-fast); }
.ui-input-toggle input::before { content: ""; position: absolute; top: calc(var(--ui-text-base) * 0.15); left: calc(var(--ui-text-base) * 0.15); width: calc(var(--ui-text-base) * 0.95); height: calc(var(--ui-text-base) * 0.95); border-radius: var(--ui-radius-full); background: var(--ui-bg-elev); box-shadow: var(--ui-shadow-sm); transition: translate var(--ui-transition-fast); }
.ui-input-toggle input:checked { background: var(--ui-primary); }
.ui-input-toggle input:checked::before { translate: calc(var(--ui-text-base) * 0.95) 0; }
.ui-input-toggle input:focus-visible { outline: var(--ui-focus-outline); outline-offset: 2px; }
.ui-input-toggle input:disabled { opacity: 0.5; cursor: default; }
/* Segmented choice: a radio group as one row of options on a sunken track, the chosen one raised. */
.ui-radio-segmented .ui-choice-options { display: inline-flex; align-self: flex-start; width: fit-content; max-width: 100%; flex-wrap: nowrap; gap: 0; padding: calc(var(--ui-space-1) * 0.5); border-radius: var(--hp-control-radius); background: var(--ui-bg-sunken); }
.ui-radio-segmented .ui-choice-options label { gap: 0; padding: var(--ui-space-1) var(--ui-space-3); border-radius: var(--hp-control-radius); font-weight: var(--hp-control-weight); color: var(--ui-fg-muted); white-space: nowrap; }
.ui-radio-segmented .ui-choice-options input { appearance: none; width: 0; height: 0; outline: 0; }
.ui-radio-segmented .ui-choice-options label:has(input:checked) { color: var(--ui-fg); background: var(--ui-bg-elev); box-shadow: var(--ui-shadow-sm); }
.ui-radio-segmented .ui-choice-options label:has(input:focus-visible) { outline: var(--ui-focus-outline); }
/* Crumbs: a list as a path. Each entry is a step back; the last is where one is. */
.ui-list-crumbs > .ui-port-entries { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ui-space-1); }
.ui-list-crumbs .ui-list-item, .ui-list-crumbs .ui-list-item:hover, .ui-list-crumbs .ui-list-item.ui-selected { display: flex; align-items: center; gap: var(--ui-space-1); padding: 0; border: 0; background: none; cursor: pointer; }
.ui-list-crumbs .ui-list-title { font-size: var(--ui-text-sm); color: var(--ui-fg-muted); }
.ui-list-crumbs .ui-list-item:hover .ui-list-title { color: var(--ui-primary-700); text-decoration: underline; }
.ui-list-crumbs .ui-list-item:not(:last-child)::after { content: "›"; color: var(--ui-fg-muted); }
.ui-list-crumbs .ui-list-item:last-child .ui-list-title { color: var(--ui-fg); font-weight: 600; text-decoration: none; }
/* A list entry's quiet last line, and the feed: notices in their tone, newest first, each with its actions in view. */
.ui-list-meta { font-size: var(--ui-text-xs); color: var(--ui-fg-muted); }
.ui-list-feed > .ui-port-entries { display: flex; flex-direction: column; gap: var(--ui-space-2); }
.ui-list-feed .ui-list-item { display: flex; align-items: flex-start; gap: var(--ui-space-3); border: 0; border-left: var(--hp-active-marker-w) solid currentColor; border-radius: var(--ui-radius-sm); background: var(--ui-tone-bg, var(--ui-bg-sunken)); }
.ui-list-feed .ui-list-text { flex: 1 1 auto; min-width: 0; color: var(--ui-fg); }
.ui-list-feed .ui-list-title { font-weight: 600; }
.ui-list-feed .ui-list-actions { position: static; flex: none; opacity: 1; }
/* Ring: a gauge as a whole circle filled to the value's share. */
.ui-gauge-ring-track { fill: none; stroke: var(--ui-bg-sunken); }
.ui-gauge-ring-fill { fill-opacity: 1; }
.ui-gauge-ring .ui-gauge-value { font-size: var(--ui-text-base); }
/* Sparkline: a plot's marks alone, small enough for a table cell or beside a number. */
.ui-plot-spark { display: inline-flex; width: calc(var(--hp-side-width) * 0.45); vertical-align: middle; gap: 0; }
.ui-plot-spark > .ui-port-title, .ui-plot-spark > .ui-port-top, .ui-plot-spark > .ui-port-legend, .ui-plot-spark > .ui-port-note, .ui-plot-spark > .ui-port-key { display: none; }
.ui-plot-spark .ui-mark > circle { display: none; }
.ui-plot-spark .ui-plot-line { stroke-width: 1.5; }
.ui-plot-end-label { fill: var(--ui-fg); font-size: var(--ui-text-xs); }
/* A numbered document: captions count themselves in order. */
.ui-document-numbered { counter-reset: figure table; }
.ui-document-numbered .ui-caption-figure { counter-increment: figure; }
.ui-document-numbered .ui-caption-table { counter-increment: table; }
.ui-document-numbered .ui-caption-figure::before { content: "Figure " counter(figure) ". "; font-weight: 600; color: var(--ui-fg); }
.ui-document-numbered .ui-caption-table::before { content: "Table " counter(table) ". "; font-weight: 600; color: var(--ui-fg); }
