@layer htmxo {
/* === Generic behavior conventions === */
/* Any element triggering an htmx action is clickable. */
[hx-get], [hx-post], [hx-put], [hx-patch], [hx-delete] { cursor: pointer; }

/* Rich generated option cards keep valid sibling DOM (radio + label +
   semantic article). The associated label covers only rich cards, making the
   whole presentational surface a native selection target without JavaScript;
   concise fallback labels stay visible when no semantic card exists. */
.htmxo-semantic-card { position: relative; }
.htmxo-semantic-card[data-rich="true"] > input[type="radio"] {
    position: relative;
    z-index: 2;
}

/* A `presentation=:tabs` page: a tab's own inputs sit side by side above its
   result, each as wide as a field rather than the whole column; a row of
   pills takes its own width. */
.htmxo-semantic-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    align-items: flex-start;
}
.htmxo-semantic-inputs > .htmxo-semantic-controls { display: contents; }
.htmxo-semantic-inputs > *,
.htmxo-semantic-inputs > .htmxo-semantic-controls > * {
    flex: 0 1 16rem;
    min-width: 0;
}
.htmxo-semantic-inputs fieldset,
.htmxo-semantic-inputs .htmxo-relevant:has(> fieldset) { flex-basis: auto; }
/* A long choice list is one field wide, as the select it replaces was. */
.htmxo-semantic-inputs .htmxo-choice-list,
.htmxo-semantic-inputs .htmxo-relevant:has(> .htmxo-choice-list) { flex-basis: 16rem; }
/* Declared input sections (`semantic_app(…; sections)`): a heading over its
   fields, which stack; short fields (a number, a checkbox, two pills) share a
   row. A field whose input does not apply (`@relevant`) is hidden, and so is
   a section none of whose fields applies. The input's own wrapper carries
   `hidden`, directly in the field or one refreshing region (`[hx-trigger]`)
   down. In a tab the sections take the full width, their fields a field's. */
.htmxo-input-section { margin: 0 0 var(--pico-spacing, 1rem); padding: 0; border: 0; min-width: 0; }
/* Pico's unlayered `legend` rule reads its weight from this variable. */
.htmxo-input-section > legend { --pico-form-label-font-weight: 700; font-weight: 700; }
/* A field alone in its section, labelled as the heading: its own label is
   read but not shown twice. */
.htmxo-heading-named {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.htmxo-input-section-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
    align-items: flex-end;
}
.htmxo-input-section-fields > .htmxo-input-field { flex: 1 1 100%; min-width: 0; }
.htmxo-input-section-fields > .htmxo-input-field[data-htmxo-width="short"] { flex: 1 1 8rem; }
.htmxo-input-section-fields > .htmxo-input-field[data-htmxo-width="short"]:has(fieldset) { flex-basis: auto; }
.htmxo-input-field:has(> .htmxo-relevant[hidden], > [hx-trigger] > .htmxo-relevant[hidden]) { display: none; }
.htmxo-input-section:not(:has(
    > .htmxo-input-section-fields > .htmxo-input-field > :not(.htmxo-relevant, [hx-trigger]),
    > .htmxo-input-section-fields > .htmxo-input-field > .htmxo-relevant:not([hidden]),
    > .htmxo-input-section-fields > .htmxo-input-field > [hx-trigger] > :not(.htmxo-relevant),
    > .htmxo-input-section-fields > .htmxo-input-field > [hx-trigger] > .htmxo-relevant:not([hidden]))) {
    display: none;
}
.htmxo-semantic-inputs > .htmxo-input-section,
.htmxo-semantic-inputs > .htmxo-semantic-controls > .htmxo-input-section { flex: 1 1 100%; }
.htmxo-semantic-inputs .htmxo-input-section-fields > .htmxo-input-field { flex: 0 1 16rem; }
.htmxo-semantic-inputs .htmxo-input-section-fields > .htmxo-input-field[data-htmxo-width="short"] { flex: 0 1 8rem; }
.htmxo-semantic-inputs .htmxo-input-section-fields > .htmxo-input-field[data-htmxo-width="short"]:has(fieldset) { flex-basis: auto; }
/* A server fault's cause (`__show_error_cause__`): the message wraps; the log
   entry scrolls in its own box. */
.htmxo-error-cause { white-space: pre-wrap; overflow-wrap: anywhere; }
/* A control's help text (`@help`, a docstring's later paragraphs) and the
   message of a fault about its input, under it; a result whose inputs are at
   fault stays, faded, until an answer for corrected inputs replaces it
   (`semantic_follow_script`). Pico styles a `<small>` right after a field. */
.htmxo-help, .htmxo-field-error { display: block; }
.htmxo-help { color: var(--pico-muted-color, inherit); }
.htmxo-field-error { color: var(--pico-del-color, #b71c1c); }
/* A glossary term in the message keeps its link; its definition, when open,
   reads as the page's text, not as part of the fault. */
.htmxo-field-error .htmxo-term-def { color: var(--pico-color, CanvasText); }
[data-htmxo-follow][data-htmxo-stale] { opacity: 0.45; }
/* A list of records (`Records`): a bordered card per record; its head holds
   the fold control, the on/off box, the label, Duplicate and Remove. Pico's
   unlayered field and button rules read the spacing variables set here: a
   card's fields sit closer, and its inputs are lower, than a section's, so
   several cards fit in a sidebar with every field shown. Short fields,
   a two-pill choice among them, share a row. A record that is off is faded
   below its head. A field's help text the cards share is under them, once. */
.htmxo-records { min-width: 0; }
.htmxo-record {
    border: 1px solid var(--pico-muted-border-color, #d0d7de);
    border-radius: var(--pico-border-radius, 0.25rem);
    padding: 0.5rem 0.75rem 0;
    margin-bottom: 0.75rem;
    --pico-spacing: 0.5rem;
    --pico-form-element-spacing-vertical: 0.375rem;
    --pico-form-element-spacing-horizontal: 0.625rem;
}
.htmxo-record .htmxo-input-section-fields { column-gap: 0.75rem; }
.htmxo-record-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    --pico-spacing: 0;
    --pico-form-element-spacing-vertical: 0.25rem;
    --pico-form-element-spacing-horizontal: 0.5rem;
}
.htmxo-record-head > .htmxo-record-label { flex: 1 1 6rem; min-width: 0; margin: 0; }
.htmxo-record-head > .htmxo-record-on { flex: 0 0 auto; margin: 0; }
.htmxo-record-head > button { flex: 0 0 auto; width: auto; margin: 0; font-size: 0.85em; }
.htmxo-semantic-inputs .htmxo-records { flex: 1 1 100%; }
.htmxo-record .htmxo-input-section-fields > .htmxo-input-field[data-htmxo-width="short"] { flex-basis: 6rem; }
.htmxo-record .htmxo-input-section-fields > .htmxo-input-field[data-htmxo-width="short"]:has(fieldset) { flex-basis: auto; }
.htmxo-record:has(> .htmxo-record-head input[type="checkbox"]:not(:checked)) > :not(.htmxo-record-head),
.htmxo-record:has(> .htmxo-record-head input[type="checkbox"]:not(:checked)) > .htmxo-record-head > .htmxo-record-summary {
    opacity: 0.5;
}
.htmxo-record-add { width: auto; font-size: 0.85em; }
.htmxo-semantic-reset { width: auto; font-size: 0.85em; }
.htmxo-record-help { margin-bottom: 0.25rem; }
/* A card's fold control, first in its head, is a button showing the chevron
   the disclosures draw (`pico_bridge`): down while the card is open, right
   while it is folded, as tall as the head's other buttons. A folded card
   (`data-htmxo-folded`) is its fold control, on/off box and label, then a
   summary of its values, beside the label where the row has room and on the
   next line where it has not; its fields, Duplicate and Remove give way.
   These rules hide them, not the `hidden` attribute, which marks an input
   that does not apply: a folded card's values are still sent and kept in the
   address. */
.htmxo-record-head > .htmxo-record-fold {
    display: flex;
    --pico-form-element-spacing-horizontal: 0.375rem;
}
/* One text line high, as the label of the head's other buttons is. */
.htmxo-record-fold::before {
    content: "";
    width: 1rem;
    height: calc(var(--pico-line-height, 1.5) * 1em);
    background-image: var(--pico-icon-chevron, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"));
    background-position: center;
    background-size: 1rem auto;
    background-repeat: no-repeat;
    transition: transform var(--pico-transition, 0.2s ease-in-out);
}
.htmxo-record-fold[aria-expanded="false"]::before { transform: rotate(-90deg); }
.htmxo-record[data-htmxo-folded] > .htmxo-input-section-fields,
.htmxo-record[data-htmxo-folded] > .htmxo-record-head > button:not(.htmxo-record-fold),
.htmxo-record:not([data-htmxo-folded]) > .htmxo-record-head > .htmxo-record-summary { display: none; }
.htmxo-record-head > .htmxo-record-summary {
    flex: 1 1 12rem;
    min-width: 0;
    font-size: 0.875em;
    color: var(--pico-muted-color, inherit);
    overflow-wrap: anywhere;
}
.htmxo-record-summary > span { display: inline-block; max-width: 100%; }
/* A choice drawn as a table: the legend is the first column's header, so it
   is read but not shown twice; a row is chosen by a click, and the chosen
   row is marked along its left edge and in bold. */
.htmxo-choice-table { min-width: 0; }
.htmxo-choice-table > legend {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.htmxo-choice-table [data-htmxo-choice-row] { cursor: pointer; }
.htmxo-choice-table [data-htmxo-choice-row] label { margin: 0; cursor: pointer; }
/* Pico's unlayered cell rule reads these variables. */
.htmxo-choice-table [data-htmxo-choice-row]:has(input[type="radio"]:checked) {
    --pico-font-weight: 600;
    --pico-background-color: color-mix(in srgb, var(--pico-primary, #0172ad) 12%, transparent);
    --pico-table-row-stripped-background-color: color-mix(in srgb, var(--pico-primary, #0172ad) 12%, transparent);
}
.htmxo-choice-table [data-htmxo-choice-row]:has(input[type="radio"]:checked) > td {
    font-weight: 600;
}
.htmxo-choice-table [data-htmxo-choice-row]:has(input[type="radio"]:checked) > td:first-child {
    box-shadow: inset 3px 0 0 var(--pico-primary, currentColor);
}
.htmxo-error-log { max-height: 30rem; overflow: auto; font-size: 0.8em; }
.htmxo-semantic-card[data-rich="true"] > label {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
}
.htmxo-semantic-card[data-rich="true"] > input:disabled + label {
    cursor: not-allowed;
}
.htmxo-semantic-card[data-rich="true"] > label > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.htmxo-semantic-status[data-status="ok"],
.htmxo-semantic-status[data-status="available"] { color: var(--htmxo-success); }
.htmxo-semantic-status[data-status="warn"],
.htmxo-semantic-status[data-status="blocked"] { color: var(--htmxo-warning); }
.htmxo-semantic-status[data-status="fail"] { color: var(--htmxo-error); }
.htmxo-semantic-status[data-status="pending"] { color: var(--htmxo-muted); }

/* `SemanticGroup` is an untitled RUN of siblings, and it is the one element in
   the vocabulary whose meaning no HTML element carries — every other one picks
   the element whose native rendering already says it (`article` for a card,
   `section` for a division, `dl` for fields, `details` for a disclosure,
   `pre>code` for code), which is why those classes need no rule here (`dl`
   gets the generic definition-list rule below, on every `dl`; an artifact's
   `a` would read as one more link, and its download-button look is in
   `pico_bridge()`, because only an unlayered rule restyles Pico's links). A group
   falls to a bare `div`, so without this rule it renders as nothing at all and
   its children merely stack. Laid out as a row that WRAPS: siblings share the
   width and each keeps a minimum before the row breaks, so a pair of figures
   sits side by side on a wide viewport and stacks on a narrow one with no
   consumer input — which is what a "run" reads like. `min-width: 0` lets a wide
   child (a table, a `pre`) scroll inside its own box instead of blowing the row
   out. Each sibling is also a size container, so what it holds can lay out by
   its width: a definition list in a narrow card stacks (the `@container` rule
   below the `dl` rules). Its width comes from the row, not its content, so the
   container changes nothing in an ordinary layout; in a parent that sizes to
   its content (an inline-block, an auto-width table cell) a container's
   content would count as zero width, so it counts as one basis instead. Apps
   that want a different run width set the variables in their own scoped
   stylesheet — never inline:
       .my-app-wide-run { --htmxo-semantic-group-min: 30rem; } */
.htmxo-semantic-group {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: var(--htmxo-semantic-group-gap, 1rem);
}
.htmxo-semantic-group > * {
    flex: 1 1 var(--htmxo-semantic-group-min, 20rem);
    min-width: 0;
    container-type: inline-size;
    contain-intrinsic-inline-size: var(--htmxo-semantic-group-min, 20rem);
}

/* `SemanticMetric` is the OTHER element with no HTML counterpart (see the group
   comment above): a label/value pair lowers to a `span` next to a `strong`, and
   adjacent inline elements carry no separation of their own — so without this
   rule `SemanticMetric("draws", 4000)` renders as the run-together `draws4000`.
   The separator is a GAP, not a literal colon in the markup: the text peers
   already say `draws: 4000` in their own idiom, and keeping it out of the HTML
   leaves the label and value independently styleable, and scrapeable without a
   punctuation strip. `baseline` keeps the value's baseline on the label's when
   an app scales one of them up; `wrap` lets a long label drop the value to its
   own line rather than overflow. Apps wanting a figure-over-caption metric set
   `flex-direction: column` in their own scoped stylesheet — never inline. */
.htmxo-semantic-metric {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--htmxo-semantic-metric-gap, 0.4rem);
}

/* A definition list reads as its terms beside their values. Pico styles no
   `dt` or `dd`, so a bare `dl` fell to the browser's look: each term on its
   own line in body weight, its value indented 40 px beneath it, nothing
   setting one pair off from the next — and apps re-rolled their own lists.
   Every `dl` is a two-column grid instead: bold terms in a column as wide as
   the longest term, capped at `--htmxo-dl-label-width` and at 40% of the list
   in a narrow column, and the values beside them. A longer term wraps, a
   one-word one too: `fit-content` never narrows a column below its content's
   longest unbreakable run, and Pico's `overflow-wrap: break-word` does not
   shorten that run, so a German compound such as "Leistungsbeschreibung" kept
   its full width and squeezed its values to a few pixels. `overflow-wrap:
   anywhere` lets the cap hold, and `hyphens: auto` puts the break at a
   syllable, with a hyphen, in the page's language (`htmx(...; lang)`). A
   term with several values puts each on its own row of the value column, and
   a `div` around a pair (valid HTML) is a `subgrid` row, so grouped pairs
   share the columns. A paragraph or list inside a value drops its outer
   margins, so its first line sits on its term's line and the row gap alone
   spaces the rows (without Pico a `p` keeps a 1em top margin, which pushed
   both the value and its baseline-aligned term down). `:not([hidden])` keeps
   a hidden list hidden on a page without Pico, whose own `[hidden]` rule is
   `!important`. Apps tune the
   variables, or keep a stacked list, in their own scoped stylesheet — never
   inline:
       .my-app-sources, .my-app-sources > div { display: block; } */
dl:not([hidden]) {
    display: grid;
    grid-template-columns: fit-content(min(var(--htmxo-dl-label-width, 16rem), 40%)) minmax(0, 1fr);
    gap: var(--htmxo-dl-row-gap, 0.5rem) var(--htmxo-dl-column-gap, 1.25rem);
    align-items: baseline;
}
dl > div:not([hidden]) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    row-gap: var(--htmxo-dl-row-gap, 0.5rem);
    align-items: baseline;
}
:is(dl, dl > div) > dt { grid-column: 1; font-weight: 600; hyphens: auto; overflow-wrap: anywhere; }
:is(dl, dl > div) > dd { grid-column: 2; margin: 0; }
:is(dl, dl > div) > dd > :first-child { margin-top: 0; }
:is(dl, dl > div) > dd > :last-child { margin-bottom: 0; }
/* In a narrow container (a `SemanticGroup` card, or an app's own column that
   declares `container-type: inline-size`) the two columns leave the values
   too little width to read, so each term sits above its value, unindented,
   with the pairs spaced apart. 24rem is where a 40% term column and the
   values beside it both stop reading as ordinary lines; a container condition
   cannot read a variable, so it is fixed. */
@container (width < 24rem) {
    dl:not([hidden]), dl > div:not([hidden]) { display: block; }
    :is(dl, dl > div) > dd { margin-top: 0.15rem; }
    :is(dl, dl > div) > dd + dt, dl > div + div { margin-top: 0.75rem; }
}

/* `data-status` on a leaf text element (cells, badges, pills) colors the
   text by status; on a container with `.htmxo-status-banner` it colors the
   left border instead (see banner rules below). Under Pico, a cell takes these
   from `pico_bridge()`, because Pico's own cell rule is unlayered. */
td[data-status], th[data-status], span[data-status], small[data-status] { font-weight: bold; }
[data-status="success"]:not(.htmxo-status-banner) { color: var(--htmxo-success); }
[data-status="error"]:not(.htmxo-status-banner)   { color: var(--htmxo-error); }
[data-status="warning"]:not(.htmxo-status-banner) { color: var(--htmxo-warning); }
[data-status="muted"]:not(.htmxo-status-banner)   { color: var(--htmxo-muted); }

.u-hidden { display: none; }
.u-inline { display: inline; }
.u-inline-block { display: inline-block; }
.u-block { display: block; }
.u-flex { display: flex; align-items: center; gap: 0.5rem; }
.u-flex-tight { display: flex; align-items: center; gap: 0.25rem; }
.u-flex-wide { display: flex; align-items: center; gap: 1rem; }
.u-flex-wrap { flex-wrap: wrap; }
.u-flex-between { display: flex; justify-content: space-between; align-items: center; }
.u-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.u-stack-tight { display: flex; flex-direction: column; gap: 0.25rem; }
.u-stack-wide { display: flex; flex-direction: column; gap: 1rem; }
.u-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.u-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
/* Sidebar + main page layout. Stacks on phone-sized viewports (<768px);
   becomes a 2-col grid above. Pair with `app_layout(sidebar, content)`.
   As the page's shell it is at least as tall as the window, so the sidebar's
   divider reaches the window's bottom. A semantic app's layout
   (`semantic_app(…; presentation=:tabs)`) is one part of a page, under its
   title or between paragraphs, and is as tall as its inputs and results. */
.htmxo-app-layout { display: block; min-height: 100vh; }
.htmxo-semantic-app .htmxo-app-layout { min-height: auto; }
.htmxo-app-layout > aside { padding: 1rem 0; }
.htmxo-app-layout > main { min-width: 0; padding: 1rem 0; }
@media (min-width: 768px) {
    .htmxo-app-layout {
        display: grid;
        grid-template-columns: var(--htmxo-sidebar-width, 12rem) 1fr;
        grid-template-areas: "sidebar content";
        column-gap: 2rem;
    }
    .htmxo-app-layout > aside { grid-area: sidebar; padding: 1rem 1rem 1rem 0; border-right: 1px solid var(--pico-muted-border-color); }
    .htmxo-app-layout > main { grid-area: content; }
    .htmxo-app-layout > aside > nav { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
.u-bg-soft { background: var(--pico-card-background-color, #f8f8f8); }
.u-btn-sm { padding: 0.3rem 0.8rem; }
.u-btn-xs { padding: 0.2rem 0.6rem; }
.u-input-grow { flex: 1; min-width: 20rem; max-width: 500px; }
.u-link-plain { text-decoration: none; color: inherit; }
.u-my-2 { margin: 0.5rem 0; }
.u-my-1 { margin: 0.25rem 0; }
.u-my-4 { margin: 1rem 0; }
.u-pointer { cursor: pointer; }
.u-w-full { width: 100%; }
.u-grow { flex: 1; min-width: 0; }
.u-min-w-0 { min-width: 0; }
.u-narrow { max-width: 900px; }
.u-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-pre-wrap { white-space: pre-wrap; }
.u-mono { font-family: monospace; }
.u-no-border { border: none; }
.u-text-bold { font-weight: bold; }
.u-text-normal { font-weight: normal; }
.u-text-xs { font-size: 0.75em; }
.u-text-sm { font-size: 0.85em; }
.u-text-lg { font-size: 1.1em; }
.u-text-muted { color: var(--htmxo-muted); }
.u-text-success { color: var(--htmxo-success); }
.u-text-error { color: var(--htmxo-error); }
.u-text-warning { color: var(--htmxo-warning); }
.u-text-accent { color: var(--htmxo-accent); }
.u-text-center { text-align: center; }
.u-text-left { text-align: left; }
.u-text-right { text-align: right; }
.u-mt-0 { margin-top: 0; }
.u-mt-1 { margin-top: 0.25rem; }
.u-mt-2 { margin-top: 0.5rem; }
.u-mt-3 { margin-top: 0.75rem; }
.u-mt-4 { margin-top: 1rem; }
.u-mt-5 { margin-top: 1.5rem; }
.u-mt-6 { margin-top: 2rem; }
.u-mb-0 { margin-bottom: 0; }
.u-mb-1 { margin-bottom: 0.25rem; }
.u-mb-2 { margin-bottom: 0.5rem; }
.u-mb-3 { margin-bottom: 0.75rem; }
.u-mb-4 { margin-bottom: 1rem; }
.u-mb-5 { margin-bottom: 1.5rem; }
.u-mb-6 { margin-bottom: 2rem; }
.u-ml-1 { margin-left: 0.25rem; }
.u-ml-2 { margin-left: 0.5rem; }
.u-ml-4 { margin-left: 1rem; }
.u-mr-1 { margin-right: 0.25rem; }
.u-mr-2 { margin-right: 0.5rem; }
.u-mr-3 { margin-right: 0.75rem; }
.u-m-0 { margin: 0; }
.u-p-0 { padding: 0; }
.u-p-2 { padding: 0.5rem; }
.u-p-4 { padding: 1rem; }
.u-sticky-top { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
.u-scroll-y { max-height: 300px; overflow: auto; }
.u-scroll-y-lg { max-height: 400px; overflow: auto; }
.u-card { background: var(--pico-card-background-color, transparent); padding: 1rem; border-radius: 0.5rem; }
.u-code-block { background: var(--pico-code-background-color, #f6f8fa); padding: 1rem; border-radius: 0.5rem; overflow-x: auto; }
/* Wide-table scroll container emitted by `sortable_table` (which covers
   `render_table` and `master_detail_table` too): a table wider than its
   column scrolls inside this wrapper instead of widening the page. */
.table-wrap { overflow-x: auto; }
/* Status banner — colored left-border callout. State via data-status. */
.htmxo-status-banner { padding: 0.5rem 1rem; margin-bottom: 0.5rem; min-width: 0; overflow: hidden; background: var(--pico-card-background-color, transparent); border-left: 4px solid var(--htmxo-border); }
.htmxo-status-banner[data-status="success"] { border-left-color: var(--htmxo-success); }
.htmxo-status-banner[data-status="error"]   { border-left-color: var(--htmxo-error); }
.htmxo-status-banner[data-status="warning"] { border-left-color: var(--htmxo-warning); }
.htmxo-status-banner[data-status="accent"]  { border-left-color: var(--htmxo-accent); }

/* Breadcrumb nav. Build with `htmxo_breadcrumb([("Home", "/", "/"), ...])`.
   Children are <span> (current page, marked aria-current) or <a> (link).
   Separators are generated via ::before — no separator element in markup. */
.htmxo-breadcrumb { font-size: 0.85em; margin-bottom: 1rem; padding: 6px 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.htmxo-breadcrumb > * + *::before { content: ' / '; color: var(--pico-muted-color); margin: 0 6px; }
.htmxo-breadcrumb [aria-current="page"] { color: var(--pico-color); font-weight: 500; }
.htmxo-breadcrumb a { text-decoration: none; color: var(--pico-primary); }
.htmxo-breadcrumb a:hover { text-decoration: underline; }
.u-badge { display: inline-block; padding: 0.15em 0.5em; border-radius: 3px; font-size: 0.8em; font-weight: 600; line-height: 1.2; color: var(--htmxo-bg, #fff); background: var(--htmxo-muted); }
.u-badge.u-badge-success { background: var(--htmxo-success); }
.u-badge.u-badge-error   { background: var(--htmxo-error); }
.u-badge.u-badge-warning { background: var(--htmxo-warning); }
.u-badge.u-badge-accent  { background: var(--htmxo-accent); }
.u-badge.u-badge-muted   { background: var(--htmxo-muted); }
.u-badge-soft { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 1rem; font-size: 0.8em; line-height: 1.2; cursor: pointer; user-select: none; border: 1px solid transparent; background: color-mix(in srgb, var(--htmxo-muted) 25%, transparent); }
.u-badge-soft.u-badge-success { background: color-mix(in srgb, var(--htmxo-success) 35%, transparent); }
.u-badge-soft.u-badge-error   { background: color-mix(in srgb, var(--htmxo-error)   35%, transparent); }
.u-badge-soft.u-badge-warning { background: color-mix(in srgb, var(--htmxo-warning) 35%, transparent); }
.u-badge-soft.u-badge-accent  { background: color-mix(in srgb, var(--htmxo-accent)  35%, transparent); }

/* Generic equal-column grid. Column count and gap are tunable per
   instance via CSS variables on the element itself or an ancestor:
       <div class="htmxo-grid" style="--htmxo-grid-cols:16">…</div>   /* DON'T — inline */
   Apps should set the variables in their own scoped stylesheet:
       .my-app-dense-grid { --htmxo-grid-cols: 16; --htmxo-grid-gap: 0.25rem; }
       <div class="htmxo-grid my-app-dense-grid">…</div> */
.htmxo-grid {
    display: grid;
    grid-template-columns: repeat(var(--htmxo-grid-cols, 4), 1fr);
    gap: var(--htmxo-grid-gap, 0.5rem);
}

/* "← Back" link. Subtler than a primary link; sits above content as a
   navigation hint. Pair with `<a class="htmxo-back-link" href="…">← Back</a>`. */
.htmxo-back-link {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.9em;
    text-decoration: none;
    color: var(--htmxo-muted, currentColor);
}
.htmxo-back-link:hover { text-decoration: underline; }

/* `pico_page`'s frame. The skip link is out of sight until the keyboard
   reaches it, then sits above the header. The header's link to the page
   being read is bold; Pico underlines it as on hover. */
.htmxo-skip-link:not(:focus, :focus-visible) {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}
.htmxo-skip-link { display: inline-block; margin: 0.5rem 1rem; }
body > header nav a[aria-current="page"] { font-weight: 600; }

/* `private` content as a private reader sees it (the live app, a private
   export): outlined and labelled, so the reader can tell what no public
   answer holds. The label is in the element's language. A table row or row
   group carries its label in its first cell. Private content shown inside
   private content (a fragment loaded into it) is marked once. An app restyles
   it in its own stylesheet: `--htmxo-private-color`, `--htmxo-private-label`.
   Pico's own `nav li::before` beats these rules: `pico_bridge()` sets the label
   of a `nav li` again. */
:root { --htmxo-private-label: "not public"; }
[lang|="en"] { --htmxo-private-label: "not public"; }
[lang|="de"] { --htmxo-private-label: "nicht \0000f6ffentlich"; }
.htmxo-private {
    outline: 1px dashed var(--htmxo-private-color, var(--htmxo-muted, currentColor));
    outline-offset: 2px;
}
.htmxo-private::before,
tr.htmxo-private > :first-child::before,
:is(thead, tbody, tfoot).htmxo-private > tr:first-child > :first-child::before {
    content: var(--htmxo-private-label);
    display: inline-block;
    margin-inline-end: .5em;
    padding: 0 .4em;
    border: 1px solid var(--htmxo-private-color, var(--htmxo-muted, currentColor));
    border-radius: .25rem;
    color: var(--htmxo-private-color, var(--htmxo-muted, currentColor));
    font-size: .75rem;
    font-style: normal;
    font-weight: normal;
    line-height: 1.5;
    vertical-align: .1em;
    white-space: nowrap;
}
div.htmxo-private::before { display: table; margin-block-end: .35rem; }
:is(tr, thead, tbody, tfoot, colgroup, col, option, optgroup, script, style, head, html, body).htmxo-private::before { content: none; }
.htmxo-private .htmxo-private { outline: none; }
.htmxo-private .htmxo-private::before,
.htmxo-private tr.htmxo-private > :first-child::before { content: none; }

/* A glossary term's use (`link_terms`), and an explained column's ⓘ: the
   explanation shows beside it while the pointer is on the term or its box, or
   the link has keyboard focus. The box stays out of the line's layout and of
   the link's accessible name; the link names the definition in it as its
   description (`aria-describedby`). */
.htmxo-term { position: relative; }
.htmxo-term-def {
    display: none;
    position: absolute;
    inset-inline-start: 0;
    top: 100%;
    z-index: 20;
    width: max-content;
    max-width: min(28rem, calc(100vw - 2rem));
    padding: .4rem .6rem;
    border: 1px solid var(--htmxo-muted, currentColor);
    border-radius: .25rem;
    background: var(--htmxo-bg, Canvas);
    box-shadow: 0 .25rem .75rem rgb(0 0 0 / 15%);
    font-size: .875rem;
    font-style: normal;
    font-weight: normal;
    line-height: 1.4;
    text-align: start;
    text-indent: 0;
    text-transform: none;
    white-space: normal;
}
.htmxo-term:hover > .htmxo-term-def,
.htmxo-term:focus-within > .htmxo-term-def { display: block; }
/* With `glossary_script` the runtime opens it, in the window's coordinates,
   so a scrolling table cannot clip it and it stays inside the window. */
.htmxo-terms .htmxo-term:is(:hover, :focus-within) > .htmxo-term-def { display: none; }
.htmxo-terms .htmxo-term[data-htmxo-term-open] > .htmxo-term-def { display: block; position: fixed; }
/* A tap pins a term's box open; the box then shows the link to the entry,
   the tap's way to the glossary (a tap on the term itself stays on the page). */
.htmxo-term-more { display: none; }
.htmxo-term[data-htmxo-term-pinned] .htmxo-term-more { display: block; margin-top: .25rem; }
/* An explained column's ⓘ: a target of its own beside the label's sort button. */
.htmxo-column-help-mark { cursor: help; padding: 0 .2em; }
.htmxo-glossary > dt { font-weight: bold; }
.htmxo-glossary > dt > dfn { font-style: normal; }
/* A glossary entry's other names and its related entries sit on lines of
   their own under the definition. The entry a link opens is highlighted. A
   private entry's term and definition are both outlined; the term alone
   carries the label. */
.htmxo-glossary > dd > small { display: block; }
.htmxo-glossary > dt:target,
.htmxo-glossary > dt:target + dd { background: var(--pico-mark-background-color, Mark); }
.htmxo-glossary > dt.htmxo-private + dd.htmxo-private::before { content: none; }
}

/* Unlayered so it beats Pico's unlayered link colour: a term's use reads as
   the surrounding text, marked by a dotted underline. */
.htmxo-term > a {
    color: inherit;
    text-decoration: underline dotted;
    text-underline-offset: .2em;
}
.htmxo-term > a:hover,
.htmxo-term > a:focus-visible { text-decoration-style: solid; }

/* While its request is in flight, htmx itself adds `htmx-request` to the
   triggering element (core `requestClass` — no HTMXObjects JS needed), so
   this rule fires on every page carrying this block, including hand-built
   shells that skip `request_feedback()`. `cursor: progress` plus a subtle
   dim, in plain literals so it holds without `htmxo_theme()`. Requests the
   page sends by itself — pollers (`hx-trigger` containing `every`) and
   elements whose trigger is `load` (lazy fragments), `revealed` or
   `intersect` — keep their resting style: the reader started nothing. The
   `request_feedback` script applies the same exclusion per request; CSS sees
   only the attribute, so a trigger list counts as `load` when it begins with
   it. A part that sent its own request and now shows it is being replaced
   (`.htmxo-loading`, from `request_feedback`) takes that rule's dim instead.
   INTENTIONALLY UNLAYERED: Pico styles `<button>` (and other controls)
   unlayered, and an unlayered declaration beats every layered one
   regardless of specificity — inside `@layer htmxo` the cursor would never
   apply on buttons (the opacity would, Pico sets none). The resting `[hx-*]`
   rule above stays layered: at rest it agrees with Pico's `pointer`, so
   there is nothing to beat. */
[hx-get]:not([hx-trigger*="every"], [hx-trigger^="load"], [hx-trigger*="revealed"], [hx-trigger*="intersect"], .htmxo-loading).htmx-request,
[hx-post]:not([hx-trigger*="every"], [hx-trigger^="load"], [hx-trigger*="revealed"], [hx-trigger*="intersect"], .htmxo-loading).htmx-request,
[hx-put]:not([hx-trigger*="every"], [hx-trigger^="load"], [hx-trigger*="revealed"], [hx-trigger*="intersect"], .htmxo-loading).htmx-request,
[hx-patch]:not([hx-trigger*="every"], [hx-trigger^="load"], [hx-trigger*="revealed"], [hx-trigger*="intersect"], .htmxo-loading).htmx-request,
[hx-delete]:not([hx-trigger*="every"], [hx-trigger^="load"], [hx-trigger*="revealed"], [hx-trigger*="intersect"], .htmxo-loading).htmx-request {
    cursor: progress;
    opacity: 0.7;
}

/* A choice among a few options is a row of pills, one per option, the chosen
   one filled in the text colour (never Pico's azure): a `fieldset` whose
   labels wrap radios, as `radio_group` and a generated single-choice control
   write it, and as an app writes one by hand. The radios stay in the label,
   invisible, so the group submits with its form, Tab reaches it and the arrow
   keys choose; the pill of the radio with keyboard focus carries the focus
   ring. Pills wrap in a narrow column. A `fieldset` with a `role` keeps
   Pico's look (`role="group"` joins its children into one bar), and option
   cards (`presentation=:cards`) put their radio beside the label, so neither
   matches. UNLAYERED: Pico styles `label` and radios unlayered. Pico's
   contrast colours follow the theme; without Pico the pills take the text
   and page colours. An app restyles them in its own stylesheet with a
   selector at least as specific as these. */
fieldset:not([role]) > label:has(> input[type="radio"]),
fieldset[data-htmxo-checkbox-group] > label {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: auto;
    margin: 0 .35rem .35rem 0;
    padding: .25em .85em;
    border: 1px solid var(--pico-form-element-border-color, color-mix(in srgb, currentColor 35%, transparent));
    border-radius: 1rem;
    background: transparent;
    color: inherit;
    font-weight: inherit;
    line-height: 1.5;
    cursor: pointer;
}
fieldset:not([role]) > label:has(> input[type="radio"]) > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    pointer-events: none;
}
fieldset:not([role]) > label:has(> input[type="radio"]:not(:disabled)):hover,
fieldset[data-htmxo-checkbox-group] > label:has(> input:not(:disabled)):hover {
    border-color: var(--pico-contrast, currentColor);
}
fieldset:not([role]) > label:has(> input[type="radio"]:focus-visible),
fieldset[data-htmxo-checkbox-group] > label:has(> input:focus-visible) {
    outline: 2px solid var(--pico-contrast, currentColor);
    outline-offset: 2px;
}
fieldset:not([role]) > label:has(> input[type="radio"]:checked),
fieldset[data-htmxo-checkbox-group] > label:has(> input:checked) {
    border-color: var(--pico-contrast-background, CanvasText);
    background: var(--pico-contrast-background, CanvasText);
    color: var(--pico-contrast-inverse, Canvas);
}
fieldset:not([role]) > label:has(> input[type="radio"]:disabled),
fieldset[data-htmxo-checkbox-group] > label:has(> input:disabled) {
    opacity: .5;
    cursor: not-allowed;
}
/* A switch (`cinput(…; switch=true)`, and the `Bool` control of a form that
   applies a change at once): Pico draws the box as a switch, and its "on"
   track takes the text colour with a knob in the page colour, as a chosen
   pill is filled, never Pico's azure; its focus ring is the text colour's
   too. UNLAYERED, like the pills. Without Pico it stays a box, ticked in the
   text colour. */
input[type="checkbox"][role="switch"] {
    --pico-switch-checked-background-color: var(--pico-contrast-background, CanvasText);
    --pico-form-element-focus-color: var(--pico-contrast-focus, color-mix(in srgb, currentColor 25%, transparent));
    accent-color: currentColor;
}
input[type="checkbox"][role="switch"]:checked {
    --pico-switch-color: var(--pico-contrast-inverse, Canvas);
}
/* In a card of a list of records (`Records`) the pills are smaller and
   closer, so a choice among a few options takes fewer rows. */
.htmxo-record fieldset:not([role]) > label:has(> input[type="radio"]),
.htmxo-record fieldset[data-htmxo-checkbox-group] > label {
    margin: 0 .25rem .25rem 0;
    padding: .1em .6em;
    font-size: .875em;
}

/* A choice among many options (`choice_list`, and a generated single choice
   past `radio_max`): a field showing the chosen option, styled as an input,
   that opens a popover with a search field and one row per option, the
   chosen row filled in the text colour like a pill. The rows hold the radios,
   invisible, as the pills do. UNLAYERED: Pico styles buttons, labels, radios
   and search fields unlayered. The field reads Pico's form-element tokens,
   which Pico does not rewrite on buttons (it rewrites `--pico-color` and the
   background ones), and sets every property Pico's button rules set through
   those. Without Pico it takes the page's colours. */
/* As wide as its container, as a field is, whatever option is chosen (a
   fieldset is otherwise as wide as its widest content); complete labels wrap. */
.htmxo-choice-list { min-inline-size: 0; }
.htmxo-choice-list > .htmxo-choice-field {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin: 0;
    padding: var(--pico-form-element-spacing-vertical, .4em) var(--pico-form-element-spacing-horizontal, .75em);
    border: var(--pico-border-width, 1px) solid var(--pico-form-element-border-color, color-mix(in srgb, currentColor 35%, transparent));
    border-radius: var(--pico-border-radius, .25rem);
    background: var(--pico-form-element-background-color, Canvas);
    color: var(--pico-form-element-color, CanvasText);
    font: inherit;
    line-height: var(--pico-line-height, 1.5);
    text-align: start;
    box-shadow: none;
    cursor: pointer;
}
.htmxo-choice-list > .htmxo-choice-field:focus-visible {
    outline: 2px solid var(--pico-contrast, currentColor);
    outline-offset: 2px;
}
.htmxo-choice-list > .htmxo-choice-field > .htmxo-choice-current {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 1.5em;
    overflow-wrap: anywhere;
    white-space: normal;
}
.htmxo-choice-list > .htmxo-choice-field > .htmxo-choice-caret { flex: none; opacity: .6; }
.htmxo-choice-panel {
    position: fixed;
    inset: auto;
    box-sizing: border-box;
    max-width: min(28rem, calc(100vw - 8px));
    margin: 0;
    padding: .5rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
    border-radius: var(--pico-border-radius, .375rem);
    background: var(--pico-background-color, Canvas);
    color: var(--pico-color, CanvasText);
    box-shadow: 0 .25rem 1rem rgb(0 0 0 / .2);
}
.htmxo-choice-panel:popover-open { display: flex; flex-direction: column; }
.htmxo-choice-panel > .htmxo-choice-search { flex: none; width: 100%; margin: 0 0 .4rem; }
.htmxo-choice-panel > .htmxo-choice-options {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.htmxo-choice-panel .htmxo-choice-option {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: .5em;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: .3em .6em;
    border-radius: .3rem;
    color: inherit;
    font-weight: inherit;
    cursor: pointer;
}
.htmxo-choice-panel .htmxo-choice-option > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    pointer-events: none;
}
fieldset[data-htmxo-checkbox-group] > label > input[type="checkbox"],
.htmxo-choice-panel .htmxo-choice-option > input[type="checkbox"] {
    appearance: auto;
    flex: none;
    width: 1em;
    height: 1em;
    margin: 0 .35em 0 0;
    background: none;
    box-shadow: none;
    accent-color: currentColor;
}
.htmxo-choice-panel .htmxo-choice-label { flex: 1; overflow-wrap: anywhere; }
.htmxo-choice-panel .htmxo-choice-option > small { flex-basis: 100%; opacity: .75; }
.htmxo-choice-panel .htmxo-choice-option:hover,
.htmxo-choice-panel .htmxo-choice-option.htmxo-choice-active {
    background: color-mix(in srgb, currentColor 10%, transparent);
}
.htmxo-choice-panel .htmxo-choice-option.htmxo-choice-active {
    outline: 2px solid color-mix(in srgb, currentColor 45%, transparent);
    outline-offset: -2px;
}
.htmxo-choice-panel .htmxo-choice-option:has(> input:checked) {
    background: var(--pico-contrast-background, CanvasText);
    color: var(--pico-contrast-inverse, Canvas);
}
.htmxo-choice-panel .htmxo-choice-option:has(> input:focus-visible) {
    outline: 2px solid var(--pico-contrast, currentColor);
    outline-offset: -2px;
}
.htmxo-choice-panel .htmxo-choice-option:has(> input:disabled) {
    opacity: .5;
    cursor: not-allowed;
}
.htmxo-choice-panel .htmxo-choice-out { display: none; }
.htmxo-choice-panel .htmxo-choice-heading {
    padding: .4em .6em .1em;
    font-size: .85em;
    font-weight: 600;
    opacity: .75;
}
.htmxo-choice-panel > .htmxo-choice-empty { margin: .3em .6em; opacity: .75; }
/* Options loading from an address (`choice_list(nv, url)`), or why they did
   not load: under the chosen rows, scrolling when an error answer is long. */
.htmxo-choice-panel > .htmxo-choice-loading {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin: .3em .6em;
    opacity: .75;
}
.htmxo-choice-panel > .htmxo-choice-loading.htmxo-choice-failed { opacity: 1; }

/* sortable_table header labels are native <button>s: read as heading text on
   every shell. Unlayered to beat Pico's `button`; no --pico-* colour tokens
   (Pico rewrites them on buttons — htmxo-semantic-styling pattern 9). */
.htmxo-sortable-table thead th > .htmxo-sort-control {
    width: auto; margin: 0; padding: 0; border: none; background: transparent;
    color: inherit; font: inherit; text-align: inherit; box-shadow: none;
}
.htmxo-sortable-table thead th > .htmxo-sort-control:focus-visible {
    outline: 2px solid var(--htmxo-accent, currentColor); outline-offset: .15em;
}
/* A column with several sort keys: the ▾ beside its label and the menu it
   opens (a popover in the top layer, placed by `htmxoSortMenu`), one row per
   key with ▲/▼; the pressed one is the order in force. Buttons reset as above. */
.htmxo-sort-menu-holder { white-space: nowrap; }
.htmxo-sortable-table thead th .htmxo-sort-menu-toggle,
.htmxo-sortable-table thead th .htmxo-sort-menu .htmxo-sort-pick {
    width: auto; margin: 0; border: none; background: transparent; color: inherit;
    font: inherit; box-shadow: none; cursor: pointer; line-height: inherit;
}
.htmxo-sortable-table thead th .htmxo-sort-menu-toggle { padding: 0 .2em; margin-left: .15em; opacity: .65; }
.htmxo-sortable-table thead th .htmxo-sort-menu-toggle:is(:hover, [aria-expanded="true"]) { opacity: 1; }
.htmxo-sort-menu {
    position: fixed; inset: auto; margin: 0; padding: .4rem .5rem; min-width: 12em;
    border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .375rem;
    background: var(--pico-background-color, Canvas); color: var(--pico-color, CanvasText);
    box-shadow: 0 .25rem 1rem rgb(0 0 0 / .2); font-size: .875rem; font-weight: normal;
    text-align: left; white-space: nowrap;
}
.htmxo-sort-menu-title { font-weight: 600; opacity: .75; margin-bottom: .2rem; }
.htmxo-sort-menu-row { display: flex; align-items: center; gap: .25rem; }
.htmxo-sort-menu-row > span { flex: 1; padding-right: .75rem; }
.htmxo-sortable-table thead th .htmxo-sort-menu .htmxo-sort-pick { padding: .1rem .45rem; border-radius: .25rem; }
.htmxo-sortable-table thead th .htmxo-sort-menu .htmxo-sort-pick:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.htmxo-sortable-table thead th .htmxo-sort-menu .htmxo-sort-pick[aria-pressed="true"] {
    background: color-mix(in srgb, currentColor 18%, transparent); font-weight: 700;
}
.htmxo-sortable-table thead th .htmxo-sort-menu-toggle:focus-visible,
.htmxo-sortable-table thead th .htmxo-sort-menu .htmxo-sort-pick:focus-visible {
    outline: 2px solid var(--htmxo-accent, currentColor); outline-offset: .1em;
}
.htmxo-sort-caret .htmxo-sort-key { font-weight: normal; opacity: .8; }
/* Columns a reader hides (`column_menu`): their cells leave the table's grid.
   The *Columns* menu sits at the end of the table's toolbar and opens a
   popover (placed by `htmxoMenuOpen`) of checkboxes, one per column, a
   heading's columns in a box of their own. Buttons reset as above. */
table[data-htmxo-columns] > :is(thead, tbody) > tr > [data-htmxo-column-hidden] { display: none !important; }
.htmxo-table-toolbar > .htmxo-column-menu-holder { margin-inline-start: auto; }
.htmxo-column-menu-holder > .htmxo-column-menu-toggle,
.htmxo-column-menu > .htmxo-column-reset { width: auto; margin: 0; padding: .15em .7em; font-size: .875em; }
.htmxo-column-menu-holder > .htmxo-column-menu-toggle::after { content: " ▾"; }
.htmxo-column-menu {
    position: fixed; inset: auto; margin: 0; padding: .5rem .75rem; min-width: 12em;
    max-height: min(70vh, 32rem); overflow: auto;
    border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: .375rem;
    background: var(--pico-background-color, Canvas); color: var(--pico-color, CanvasText);
    box-shadow: 0 .25rem 1rem rgb(0 0 0 / .2); font-size: .875rem; font-weight: normal; text-align: left;
}
.htmxo-column-menu label { display: flex; align-items: center; gap: .45rem; width: auto; margin: .15rem 0; font-size: inherit; cursor: pointer; }
.htmxo-column-menu input[type="checkbox"] { flex: none; margin: 0; }
.htmxo-column-menu label:has(> input:disabled) { opacity: .65; cursor: default; }
.htmxo-column-menu fieldset { margin: .25rem 0; padding: 0 0 0 1.4rem; border: 0; }
.htmxo-column-menu fieldset > legend { margin: 0 0 0 -1.4rem; padding: 0; font-weight: 600; }
.htmxo-column-menu > .htmxo-column-reset { margin-top: .5rem; }
.htmxo-column-menu-title { font-weight: 600; opacity: .75; margin-bottom: .2rem; }

/* A table's own controls (the search field with its count, Group by,
   Expand/Collapse all, the selection bar) share one line, wrapping only when
   the table's column is too narrow. The search label wraps too (its text,
   the field and the count each move to a further line only when they no
   longer fit), and the field and the count shrink with the column, so a
   narrow column (a sidebar, a split pane) keeps them inside it instead of
   widening the page. With `sticky=true` (the default) the line stays
   at the top of the window while its table is in view, with the column
   headers just below it; `--htmxo-sticky-top` moves both below an app's own
   sticky header. The table runtime measures the line
   (`--htmxo-table-toolbar-h`) and the header (`--htmxo-table-head-h`), and
   marks a `.table-wrap` whose table fits it `data-htmxo-width="fits"` (no
   sideways scroll box, so the header sticks to the window) or `"wide"` (a
   window-tall box scrolling both ways, its header stuck at the box top);
   without the runtime the wrapper keeps its sideways scroll. A table inside
   another table's cell does not stick to the window; a wide one is that box
   too, as tall as the window below the outer table's line and header, with
   its header at the box top beneath the outer one, on the line's background
   (Pico's translucent row stripes reach a nested header through the outer
   row). A stuck header is opaque from top to bottom, its rules included:
   Pico collapses table borders, and the browser paints a collapsed border
   with the table, not with the header stuck above it, so the rows scrolled
   beneath showed through the strip between a `header_groups` heading and
   its leaves, and the header's bottom rule scrolled away with them. Separate
   borders with no spacing belong to their cells and stick with them; Pico's
   cells draw only a bottom border, so a table that is not stuck looks the
   same. UNLAYERED: Pico styles `label`, `input`, `small` and `table`
   unlayered. */
.htmxo-table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; margin: 0 0 calc(var(--pico-spacing, 1rem) / 2); }
.htmxo-table-toolbar[hidden], .htmxo-table-toolbar > label[hidden] { display: none; }
.htmxo-table-toolbar > * { margin: 0; }
.htmxo-table-toolbar > label { display: flex; flex: 1 1 22rem; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; font-size: .875em; }
.htmxo-table-toolbar > label > input[type="search"] { flex: 1 1 8rem; width: auto; min-width: min(8rem, 100%); height: auto; margin: 0; padding-block: .3em; font-size: inherit; }
.htmxo-table-toolbar > label > small { display: inline; width: auto; margin: 0; font-size: inherit; }
.htmxo-table-toolbar > .htmxo-tree-controls, .htmxo-table-toolbar > .htmxo-selection-bar { margin: 0; }
.htmxo-table-toolbar[data-htmxo-sticky] { position: sticky; top: var(--htmxo-sticky-top, 0px); z-index: 3; padding-block: .35rem; background: var(--htmxo-sticky-bg, var(--pico-background-color, Canvas)); }
table[data-htmxo-sticky] { border-collapse: separate; border-spacing: 0; }
table[data-htmxo-sticky] > thead { position: sticky; top: calc(var(--htmxo-sticky-top, 0px) + var(--htmxo-table-toolbar-h, 0px)); z-index: 2; }
table[data-htmxo-sticky] > tbody > tr { scroll-margin-top: calc(var(--htmxo-sticky-top, 0px) + var(--htmxo-table-toolbar-h, 0px) + var(--htmxo-table-head-h, 0px)); }
.table-wrap[data-htmxo-width="fits"] { overflow: visible; }
.table-wrap[data-htmxo-width="wide"] { overflow: auto; max-height: calc(var(--htmxo-frame-height, 100vh - var(--htmxo-sticky-top, 0px)) - var(--htmxo-table-toolbar-h, 0px)); max-height: calc(var(--htmxo-frame-height, 100dvh - var(--htmxo-sticky-top, 0px)) - var(--htmxo-table-toolbar-h, 0px)); }
.table-wrap[data-htmxo-width="wide"] > table[data-htmxo-sticky] > thead { top: 0; }
.table-wrap[data-htmxo-width="wide"] > table[data-htmxo-sticky] > tbody > tr { scroll-margin-top: var(--htmxo-table-head-h, 0px); }
:is(td, th) .htmxo-table-toolbar[data-htmxo-sticky], :is(td, th) table[data-htmxo-sticky] > thead { position: static; }
:is(td, th) .table-wrap[data-htmxo-width="wide"] { max-height: calc(var(--htmxo-frame-height, 100vh - var(--htmxo-sticky-top, 0px)) - var(--htmxo-table-toolbar-h, 0px) - var(--htmxo-table-head-h, 0px)); max-height: calc(var(--htmxo-frame-height, 100dvh - var(--htmxo-sticky-top, 0px)) - var(--htmxo-table-toolbar-h, 0px) - var(--htmxo-table-head-h, 0px)); }
:is(td, th) .table-wrap[data-htmxo-width="wide"] > table[data-htmxo-sticky] > thead { position: sticky; z-index: 1; }
:is(td, th) .table-wrap[data-htmxo-width="wide"] > table[data-htmxo-sticky] > thead th { background-color: var(--htmxo-sticky-bg, var(--pico-background-color, Canvas)); }
:is(td, th) .table-wrap[data-htmxo-width="wide"] > table[data-htmxo-sticky] > tbody > tr { scroll-margin-top: calc(var(--htmxo-sticky-top, 0px) + var(--htmxo-table-toolbar-h, 0px) + var(--htmxo-table-head-h, 0px)); }
/* A `presentation=:tabs` page's result taller than its bound
   (`semantic_app(…; result_height)`: the window's height less
   `--htmxo-sticky-top` by default, else the app's CSS length) scrolls inside
   itself instead of lengthening the page, so the inputs beside it and the text
   around it stay where they are. The page runtime marks a result that fits
   `data-htmxo-result-fits`: it stays in the page, so nothing in it (a glossary
   term's explanation, a focus ring) is cut at its edge. Inside the box a
   table's controls and header stick to the box top (`--htmxo-sticky-top` is
   0 below it, not on it, so the bound reads the page's), and a wide table's
   own box fits inside it (`--htmxo-frame-height`). */
[data-htmxo-result-height] { --htmxo-frame-height: var(--htmxo-result-height, calc(100dvh - var(--htmxo-sticky-top, 0px))); max-height: var(--htmxo-frame-height); overflow: auto; }
@supports not (height: 1dvh) { [data-htmxo-result-height] { --htmxo-frame-height: var(--htmxo-result-height, calc(100vh - var(--htmxo-sticky-top, 0px))); } }
[data-htmxo-result-height][data-htmxo-result-fits] { overflow: visible; }
[data-htmxo-result-height]:not([data-htmxo-result-fits]) > * { --htmxo-sticky-top: 0px; }

/* A table's columns keep their widths while its rows open, load and filter
   (`data-htmxo-columns`, held by the table runtime). While the runtime sizes
   them ("sizing"), the hidden rows take part, collapsed, so the widths fit
   every row the table holds; detail rows stay out. A table too wide for its
   room only because of an over-long word is measured once more with words
   breaking anywhere (`data-htmxo-columns-break`), to know how narrow those
   columns can be. Held, the layout is fixed, and a word too long for its
   column breaks inside its cell instead of running into the next one; in a
   row's own cells that includes a word in an inline block, such as Pico's
   `code`. A detail row's content never sizes the columns, held or not: it
   fills the width they give it, and its words break only where they must
   (`break-word`), so a table inside it keeps the widths its words give it.
   `!important` beats Pico's `[hidden] { display: none !important }`. */
table[data-htmxo-columns="sizing"] > tbody > tr[hidden]:not([id^="detail-"]) { display: table-row !important; visibility: collapse; }
table[data-htmxo-columns="sizing"][data-htmxo-columns-break] > tbody > tr:not([id^="detail-"]) > td { overflow-wrap: anywhere; }
table[data-htmxo-columns="held"] { table-layout: fixed; }
table[data-htmxo-columns="held"] > tbody > tr > td { overflow-wrap: break-word; }
table[data-htmxo-columns="held"] > tbody > tr:not([id^="detail-"]) > td { overflow-wrap: anywhere; }
tr[id^="detail-"] > td > :is(.htmxo-md-detail, .htmxo-md-detail-slot) { contain: inline-size; }

/* A number input with a range (`number_domain`): the slider, then the number
   field and its unit (`.htmxo-number-entry`). Semantic-app sidebars give the
   slider a full row to keep its drag precision (snag preserve-the-ori-d1133e38).
   Elsewhere its minimum basis keeps fitting rows inline and wraps narrower
   ones. A unit too wide beside the field wraps below it; no part leaves the
   column (snag number-control-u-68445236). The field comes first in the
   document, so the label names it and Tab reaches it first. UNLAYERED:
   Pico styles `input` unlayered. */
.htmxo-number { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; margin: calc(var(--pico-spacing, 1rem) * .25) 0 var(--pico-spacing, 1rem); }
.htmxo-number input { margin: 0; }
.htmxo-number > input[type="range"] { order: 0; flex: 1 1 5rem; width: auto; min-width: min(5rem, 100%); }
.htmxo-semantic-sidebar .htmxo-number > input[type="range"] { flex-basis: 100%; }
.htmxo-number > .htmxo-number-entry { order: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.htmxo-number-entry > input[type="number"] { flex: 0 1 7rem; width: 7rem; min-width: 0; }
.htmxo-number-entry > .htmxo-number-unit { overflow-wrap: anywhere; }
/* A field with `digits` (`.htmxo-number-value`): while the reader is not
   editing it, its value rounded to them is drawn over it and the field's own
   text is hidden; the field keeps the exact value. Only on a page that
   `number_control_script` marked, which keeps the text on the field. */
.htmxo-number-entry > .htmxo-number-value { flex: 0 1 7rem; width: 7rem; min-width: 0; position: relative; display: flex; }
/* No colour transition (Pico fades `color`): editing shows the value at once. */
.htmxo-number-value > input[type="number"] { width: 100%; margin: 0;
  transition: background-color var(--pico-transition), border-color var(--pico-transition), box-shadow var(--pico-transition); }
.htmxo-number-value > .htmxo-number-shown { display: none; }
:root[data-htmxo-number-display] .htmxo-number-value[data-htmxo-number-shown]:not(:focus-within) > input[type="number"] { color: transparent; }
:root[data-htmxo-number-display] .htmxo-number-value[data-htmxo-number-shown]:not(:focus-within) > .htmxo-number-shown {
  display: flex; align-items: center; position: absolute; inset: 0; pointer-events: none;
  padding: 0 calc(var(--pico-form-element-spacing-horizontal, 1rem) + var(--pico-border-width, 1px));
  overflow: hidden; white-space: nowrap; color: var(--pico-color, inherit); font-size: 1rem;
  font-weight: var(--pico-font-weight, 400);
}

/* A numbered document's contents list (`contents`): a bordered box, each line
   a section number in a column of its own and the title linking to the
   section, deeper levels indented under their section's title, no list
   markers. UNLAYERED: Pico lays out every `nav`, `nav ol` and `nav li` as a
   horizontal menu, unlayered. */
nav.htmxo-contents { display: block; margin: 0 0 var(--pico-spacing, 1rem); padding: .75rem 1rem; border: var(--pico-border-width, 1px) solid var(--pico-muted-border-color, #d0d7de); border-radius: var(--pico-border-radius, .25rem); }
nav.htmxo-contents > .htmxo-contents-title { margin: 0 0 .5rem; font-weight: 600; }
nav.htmxo-contents ol { display: block; margin: 0; padding: 0; list-style: none; }
nav.htmxo-contents ol ol { padding-inline-start: 2.75em; }
nav.htmxo-contents li { display: block; margin: 0; padding: 0; list-style: none; }
nav.htmxo-contents li > a { display: flex; gap: .5em; margin: 0; padding: .2rem 0; border-radius: 0; text-decoration: none; }
nav.htmxo-contents li > a:hover > span:last-child { text-decoration: underline; }
nav.htmxo-contents .htmxo-section-number { flex: 0 0 2.25em; font-variant-numeric: tabular-nums; }
nav.htmxo-contents ol ol .htmxo-section-number { flex-basis: 2.75em; }
nav.htmxo-contents ol ol ol .htmxo-section-number { flex-basis: 3.5em; }
