/* Horuph system kit (SPEC section 7).
   Cascade layers in fixed order — theme is the final normal-declaration authority.
   Every visual value is a token; themes override tokens, never selectors.
   Logical properties only: RTL/LTR follows the document dir attribute. */

@layer reset, base, components, addon, theme;

@view-transition { navigation: auto; }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  img, svg, video { display: block; max-inline-size: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  /* `hidden` must always win. The browser's own rule for it is weaker than any author
     rule that sets display — `textarea { display: block }` two layers down would beat it —
     so it is stated here as important. An important declaration in the first layer beats
     every later one, which is exactly the precedence a hidden element needs. */
  [hidden] { display: none !important; }
}

@layer components {
  /* Core's occupied sticky-start space. Public surfaces may read this value so their own sticky chrome
     sits below Horuph's toolbar; only Core defines it. Anonymous pages have no reserved space. */
  :root { --hb-toolbar-block-size: 0px; }
  :root:has(body > .hb-toolbar-host) { --hb-toolbar-block-size: 2.4rem; }

  /* A docked Modal presentation: ordinary page controls stay interactive and wide layouts
     reserve its logical-end space. The browser module owns only lifetime and stored width.
     The toolbar keeps the full width over that space, so its toggles stay put and the dock hangs beneath it. */
  body[data-hb-dock-open] { padding-inline-end: var(--hb-dock-width, 26.25rem); }
  body[data-hb-dock-open] > .hb-toolbar-host { margin-inline-end: calc(-1 * var(--hb-dock-width, 26.25rem)); }
  .hb-dock {
    background: var(--hb-card);
    block-size: calc(100dvh - var(--hb-toolbar-block-size));
    border-inline-start: 1px solid var(--hb-border);
    box-shadow: var(--hb-shadow);
    color: var(--hb-fg);
    display: flex;
    flex-direction: column;
    inline-size: var(--hb-dock-width, 26.25rem);
    inset-block-start: var(--hb-toolbar-block-size);
    inset-inline-end: 0;
    overflow: hidden;
    position: fixed;
    view-transition-name: hb-docked-window;
    z-index: 900;
  }
  .hb-dock > .hb-modal-head { cursor: default; touch-action: auto; }
  .hb-dock > .hb-modal-head:active { cursor: default; }
  .hb-dock > .hb-modal-body { flex: 1; min-block-size: 0; }
  .hb-dock-loading { margin: auto; padding: var(--hb-space); }
  .hb-dock-resize {
    background: transparent;
    block-size: 100%;
    border: 0;
    border-radius: 0;
    cursor: ew-resize;
    inline-size: .7rem;
    inset-block: 0;
    inset-inline-start: -.35rem;
    padding: 0;
    position: absolute;
    touch-action: none;
    z-index: 1;
  }
  .hb-dock-resize::after {
    background: transparent;
    block-size: 100%;
    content: '';
    inline-size: 2px;
    inset-block: 0;
    inset-inline-start: calc(50% - 1px);
    position: absolute;
  }
  .hb-dock-resize:is(:hover, :focus-visible)::after { background: var(--hb-accent); }
  .hb-dock-resize:focus-visible { outline: none; }

  @media (max-width: 47.99rem) {
    body[data-hb-dock-open] { padding-inline-end: 0; }
    body[data-hb-dock-open] > .hb-toolbar-host { margin-inline-end: 0; }
    .hb-dock {
      border-block-start: 1px solid var(--hb-border);
      border-inline-start: 0;
      box-shadow: none;
      inline-size: 100%;
      inset-inline: 0;
    }
    .hb-dock-resize { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) { animation-duration: .01ms; animation-iteration-count: 1; }
  }
}

@layer base {
  :root {
    --hb-bg: #f7f6f3;
    --hb-fg: #23211c;
    --hb-muted: #8a8578;
    --hb-card: #ffffff;
    --hb-border: #e3e0d8;
    --hb-accent: #b58900;
    --hb-accent-fg: #ffffff;
    --hb-danger: #b3402a;
    --hb-danger-bg: #fbeae5;
    --hb-radius: 8px;
    --hb-font: system-ui, "Segoe UI", Tahoma, sans-serif;
    --hb-shadow: 0 2px 12px rgb(0 0 0 / 8%);
    --hb-space: 1rem;
    /* Avatar hues are tokens so the toolbar's shadow tree paints the same person the same way. */
    --hb-avatar-hue-1: #3b82f6;
    --hb-avatar-hue-2: #14b8a6;
    --hb-avatar-hue-3: #8b5cf6;
    --hb-avatar-hue-4: #ec4899;
    --hb-avatar-hue-5: #f97316;
  }
  /* Derived tokens. They are declared wherever a theme sets its colors, so they follow light and dark.
     Text tints mix toward the text color in OKLCH: the hue stays vivid while contrast follows the theme. */
  :root, [data-color-scheme] {
    --hb-radius-lg: calc(var(--hb-radius) + 4px);
    --hb-soft: color-mix(in srgb, var(--hb-fg) 5%, var(--hb-card));
    --hb-hover: color-mix(in srgb, var(--hb-fg) 7%, var(--hb-card));
    --hb-line: color-mix(in srgb, var(--hb-border) 70%, transparent);
    --hb-accent-soft: color-mix(in srgb, var(--hb-accent) 15%, var(--hb-card));
    --hb-accent-text: color-mix(in oklch, var(--hb-accent) 72%, var(--hb-fg));
    --hb-danger-text: color-mix(in oklch, var(--hb-danger) 72%, var(--hb-fg));
  }

  /* Native controls (time/date pickers, scrollbars) must follow the same scheme as the theme tokens. */
  html { color-scheme: light dark; }
  [data-color-scheme="light"] { color-scheme: light; }
  [data-color-scheme="dark"] { color-scheme: dark; }

  body {
    background: var(--hb-bg);
    color: var(--hb-fg);
    font-family: var(--hb-font);
    line-height: 1.6;
    min-block-size: 100vh;
  }

  h1, h2, h3 { line-height: 1.25; margin-block-end: 0.6em; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  p { margin-block-end: 0.8em; }
  a { color: var(--hb-accent); text-decoration: none; }
  a:hover { text-decoration: underline; }
  code {
    background: color-mix(in srgb, var(--hb-border) 45%, transparent);
    border-radius: 4px;
    font-size: 0.9em;
    padding-block: 0.1em;
    padding-inline: 0.35em;
  }
  hr { border: none; border-block-start: 1px solid var(--hb-border); margin-block: var(--hb-space); }
  /* A long preformatted line scrolls inside its own block and never widens the page or window. */
  pre { max-inline-size: 100%; overflow-x: auto; }
  progress {
    appearance: none;
    background: var(--hb-soft);
    block-size: .5rem;
    border: 0;
    border-radius: 999px;
    display: block;
    inline-size: 100%;
    overflow: hidden;
  }
  progress::-webkit-progress-bar { background: var(--hb-soft); border-radius: 999px; }
  progress::-webkit-progress-value { background: var(--hb-accent); border-radius: 999px; }
  progress::-moz-progress-bar { background: var(--hb-accent); border-radius: 999px; }

  label { display: block; font-weight: 600; margin-block-end: 0.75rem; }
  input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    display: block;
    font-weight: 400;
    inline-size: 100%;
    margin-block-start: 0.25rem;
    padding-block: 0.5rem;
    padding-inline: 0.75rem;
  }
  /* Chromium draws a select at line-height: normal whatever is set, so without this it sits
     shorter than a text input beside it. 1rem + 2px is the padding and border above. */
  select { min-block-size: calc(1lh + 1rem + 2px); }
  /* A field is sized by whoever laid the form out. A drag handle in the corner invites
     the reader to break that, and inside a modal it can push the window past the screen. */
  textarea { resize: none; }
  input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: 2px solid var(--hb-accent);
    outline-offset: 1px;
  }
  button {
    background: var(--hb-accent);
    border: none;
    border-radius: var(--hb-radius);
    color: var(--hb-accent-fg);
    cursor: pointer;
    font-weight: 600;
    padding-block: 0.5rem;
    padding-inline: 1.1rem;
  }
  button:hover { filter: brightness(1.05); }
  button:disabled,
  input:is([type="submit"], [type="image"], [type="button"]):disabled {
    cursor: not-allowed;
    filter: none;
    opacity: 0.5;
  }
  [aria-busy="true"] button:disabled,
  [aria-busy="true"] input:is([type="submit"], [type="image"], [type="button"]):disabled { cursor: wait; }
}

@layer components {
  /* Input-descriptor-driven schema field authoring. Domain addons provide only the
     schema owner/revision and capability names; Core owns this grammar. */
  .hb-schema-label,
  .hb-schema-settings {
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: .85rem;
  }
  .hb-schema-label,
  [data-schema-settings] { display: grid; gap: .75rem; }
  .hb-schema-label > legend { font-weight: 700; padding-inline: .3rem; }
  .hb-schema-settings > summary { cursor: pointer; font-weight: 700; }
  .hb-schema-settings[open] > summary { margin-block-end: .75rem; }
  .hb-schema-localized,
  .hb-schema-translations { display: grid; gap: .65rem; }
  .hb-schema-translations {
    border-inline-start: 2px solid var(--hb-border);
    padding-inline-start: .75rem;
  }
  .hb-schema-caption { color: var(--hb-muted); font-size: .85rem; font-weight: 700; }
  .hb-schema-control { display: grid; gap: .3rem; min-inline-size: 0; }
  .hb-schema-control > span { color: var(--hb-muted); font-size: .85rem; }
  .hb-schema-options { display: grid; gap: .65rem; }
  .hb-schema-option {
    align-items: start;
    border-block-end: 1px solid var(--hb-border);
    display: grid;
    gap: .65rem;
    grid-template-columns: minmax(8rem, .6fr) minmax(12rem, 1fr) auto;
    padding-block-end: .75rem;
  }
  .hb-schema-label > .hb-help { margin: 0; }
  .hb-schema-add-option { justify-self: start; }
  .hb-schema-remove-option { align-self: end; }
  @media (max-width: 42rem) {
    .hb-schema-option { grid-template-columns: 1fr; }
    .hb-schema-remove-option { justify-self: start; }
  }
}

@layer components {
  .hb-card {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-lg);
    box-shadow: var(--hb-shadow);
    padding: calc(var(--hb-space) * 1.25);
  }

  /* A bounded Admin section with stable header, body and footer rhythm. Addons own the section's
     meaning and contents; Core owns its chrome and responsive actions. */
  .hb-panel {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-lg);
    min-inline-size: 0;
    overflow: hidden;
  }
  .hb-panel-head {
    align-items: center;
    border-block-end: 1px solid var(--hb-line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-block: .8rem;
    padding-inline: 1.15rem;
  }
  /* A panel that is only its head has nothing below to divide from. */
  .hb-panel-head:last-child { border-block-end: 0; }
  .hb-panel-head h2 { font-size: .95rem; font-weight: 700; margin: 0; }
  /* A section on a page is headed a step larger than one inside a window, whose head is also tighter. */
  .hb-admin-view h2 { font-size: 1.08rem; letter-spacing: -.005em; }
  /* A sub-section heading. Zero specificity, so any component that styles its own h3 keeps it. */
  :where(.hb-admin-view, dialog.hb-modal, .hb-dock) h3 { font-size: .85rem; margin-block: .75rem .35rem; }
  :is(dialog.hb-modal, .hb-dock) .hb-panel-head { padding-block: .6rem; }
  .hb-panel-head a { font-size: .8rem; font-weight: 600; white-space: nowrap; }
  .hb-panel-body { padding: .35rem; }
  .hb-panel-foot {
    border-block-start: 1px solid var(--hb-line);
    font-size: .82rem;
    padding-block: .65rem;
    padding-inline: 1.15rem;
  }
  .hb-panel-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
  .hb-panel-foot.hb-panel-actions { font-size: inherit; gap: .5rem; justify-content: flex-end; }
  .hb-panel-sub { color: var(--hb-muted); font-size: .8rem; line-height: 1.4; margin: .15rem 0 0; }
  .hb-panel-pad { display: grid; gap: 1rem; padding-block: 1rem; padding-inline: 1.15rem; }
  .hb-panel-pad > p { margin: 0; }
  .hb-panel-pad > .hb-panel-empty { padding: 0; }
  .hb-panel-pad h3 { font-size: .88rem; margin: 0 0 .4rem; }
  .hb-panel.hb-panel-pad > h3 { font-size: .95rem; margin: 0; }
  .hb-panel-empty {
    color: var(--hb-muted);
    font-size: .88rem;
    margin: 0;
    padding-block: 1rem;
    padding-inline: 1.15rem;
  }
  .hb-panel-body > .hb-data-list-empty { background: transparent; border: 0; padding-block: 1.25rem; }
  /* A window stacks many panels, so its empty panels are one quiet line with their actions beside it. */
  :is(dialog.hb-modal, .hb-dock) .hb-panel-body > .hb-data-list-empty { align-items: center; display: flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: space-between; padding: 0; text-align: start; }
  :is(dialog.hb-modal, .hb-dock) .hb-panel-body > .hb-data-list-empty::before,
  :is(dialog.hb-modal, .hb-dock) .hb-panel-body > .hb-data-list-empty::after { content: none; }
  :is(dialog.hb-modal, .hb-dock) .hb-panel-body > .hb-data-list-empty > p { font-size: .88rem; }
  :is(dialog.hb-modal, .hb-dock) .hb-panel-body > .hb-data-list-empty > .hb-data-list-empty-actions { gap: .4rem; justify-content: flex-start; }
  /* A panel's records, one row each: a mark, a title over a muted line, then meta and actions. A row that is
     a button or link opens its record; a plain row only holds content and its own controls. */
  .hb-panel-list { display: grid; gap: 1px; list-style: none; margin: 0; padding: 0; }
  .hb-panel-row {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--hb-radius);
    color: var(--hb-fg);
    cursor: default;
    display: grid;
    font-weight: 400;
    gap: .75rem;
    grid-auto-columns: auto;
    grid-auto-flow: column;
    grid-template-columns: auto minmax(0, 1fr);
    inline-size: 100%;
    padding-block: .6rem;
    padding-inline: .75rem;
    text-align: start;
    text-decoration: none;
  }
  .hb-panel-row:has(> .hb-panel-row-main:first-child) { grid-template-columns: minmax(0, 1fr); }
  :is(a, button).hb-panel-row:not([disabled]) { cursor: pointer; }
  :is(a, button).hb-panel-row:not([disabled]):hover { background: var(--hb-hover); filter: none; text-decoration: none; }
  .hb-panel-row:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: -2px; }
  .hb-panel-row-main { display: grid; gap: .1rem; min-inline-size: 0; }
  .hb-panel-row-title, .hb-panel-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hb-panel-row-title { font-size: .9rem; font-weight: 600; }
  .hb-panel-row-sub { color: var(--hb-muted); font-size: .8rem; }
  .hb-panel-row-meta { color: var(--hb-muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .hb-panel-row-meta-stack { display: grid; gap: .1rem; justify-items: end; }
  .hb-panel-row-meta-stack strong { color: var(--hb-fg); font-size: .88rem; }
  .hb-panel-row-chevron { color: var(--hb-muted); font-size: 1.2rem; line-height: 1; }
  /* A panel list may be a tree: dataListTreeCell() leads a row, and its guides run the full row height. */
  .hb-panel-list:has(> li > .hb-panel-row > .hb-tree-cell) { gap: 0; }
  .hb-panel-row:has(> .hb-tree-cell) { grid-template-columns: minmax(0, 1fr); position: relative; }
  .hb-panel-row > .hb-tree-cell > .hb-tree-content { align-items: center; display: grid; gap: .75rem; grid-template-columns: auto minmax(0, 1fr); }
  .hb-panel-row > .hb-tree-cell > .hb-tree-content:has(> .hb-panel-row-main:first-child) { grid-template-columns: minmax(0, 1fr); }
  /* A label over a group of tiles or of panel rows. */
  :is(h2, h3).hb-group-label { color: var(--hb-muted); font-size: .72rem; font-weight: 700; letter-spacing: .07em; margin: 0; text-transform: uppercase; }
  .hb-group-label[data-tone="danger"] { color: var(--hb-danger-text); }
  .hb-panel-body > .hb-group-label { margin: .65rem .75rem .3rem; }
  /* A record's view opens with its identity: an optional mark, the name over lines of facts, then the
     record's actions at the logical end of the available width. The head spans its parent so
     margin-inline-start: auto has room; capping the actions keeps them wrapping onto more rows
     until the view is too narrow, when they move below the name. */
  .hb-record-head { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem 1rem; inline-size: 100%; }
  .hb-record-head > * { flex: none; }
  .hb-record-head > .hb-record-head-main { display: grid; flex: 1 1 12rem; gap: .3rem; min-inline-size: 0; }
  .hb-record-head-main > h2 { font-size: 1.4rem; letter-spacing: -.01em; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
  .hb-record-head-sub { align-items: center; color: var(--hb-muted); display: flex; flex-wrap: wrap; font-size: .82rem; gap: .35rem .6rem; margin: 0; }
  .hb-record-head-sub a { font-weight: 600; }
  .hb-record-head > .hb-record-head-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; margin-inline-start: auto; max-inline-size: max(50%, 22rem); }
  /* Under its head, a record's work sits beside its reference facts. The bases keep the 1.65:1 ratio, so the
     two columns stack exactly when they no longer fit (47.5rem) with no container query. */
  .hb-record-columns { align-items: start; display: flex; flex-wrap: wrap; gap: 1rem; }
  .hb-record-columns > :is(.hb-record-main, .hb-record-side) { align-content: start; display: grid; gap: 1rem; min-inline-size: 0; }
  .hb-record-columns > .hb-record-main { flex: 1.65 1 29rem; }
  .hb-record-columns > .hb-record-side { flex: 1 1 17.5rem; }
  /* A page opens with its title and one line on what it is for. */
  .hb-page-head h1 { font-size: 1.6rem; letter-spacing: -.015em; line-height: 1.2; margin: 0 0 .25rem; }
  .hb-page-head p { color: var(--hb-muted); font-size: .92rem; margin: 0; max-inline-size: 70ch; }
  .hb-admin-view-content > .hb-page-head { margin-block-end: var(--hb-space); }
  /* End-of-title actions (Help, Edit, …) sit on the title row; the line under the title keeps its width. */
  .hb-page-head:has(> .hb-page-head-actions),
  .hb-page-head:has(> .hb-page-help) { column-gap: 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .hb-page-head:has(> .hb-page-head-actions) > :not(.hb-page-head-actions) { grid-column: 1; }
  .hb-page-head:has(> .hb-page-help):not(:has(> .hb-page-head-actions)) > :not(.hb-page-help) { grid-column: 1; }
  .hb-page-head > .hb-page-head-actions { align-self: start; display: flex; flex-wrap: wrap; gap: .4rem; grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .hb-page-head > .hb-page-help { align-self: start; grid-column: 2; grid-row: 1; }
  /* A page that leads elsewhere: labelled groups of tiles, each an icon, a title and what lies behind it.
     A place wears an icon in one calm color; colored initials stay reserved for people (.hb-avatar). */
  .hb-tile-group { display: grid; gap: .7rem; }
  .hb-stack:has(> .hb-tile-group) { gap: 1.6rem; }
  .hb-tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
  .hb-tiles > .hb-tile {
    align-items: center;
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-lg);
    color: var(--hb-fg);
    display: grid;
    gap: .85rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-block: .9rem;
    padding-inline: 1rem;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  }
  .hb-tile:hover { border-color: color-mix(in srgb, var(--hb-accent) 55%, var(--hb-border)); box-shadow: 0 6px 18px rgb(0 0 0 / 12%); text-decoration: none; transform: translateY(-1px); }
  .hb-tile:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 2px; }
  .hb-tile-icon { background: color-mix(in srgb, var(--hb-accent) 10%, var(--hb-card)); block-size: 2.6rem; border-radius: calc(var(--hb-radius) + 2px); color: var(--hb-accent); display: grid; inline-size: 2.6rem; place-items: center; }
  .hb-tile-icon .hb-icon { block-size: 1.3rem; inline-size: 1.3rem; }
  .hb-tile-body { display: grid; gap: .2rem; min-inline-size: 0; }
  .hb-tile-title { align-items: center; display: flex; font-size: .95rem; font-weight: 700; gap: .5rem; }
  .hb-tile-desc { color: var(--hb-muted); font-size: .82rem; line-height: 1.4; }
  /* A back link points toward the start edge, which is on the right in a right-to-left interface. */
  [dir="rtl"] a > .hb-icon:has(> use[href$="#arrow-left"]) { scale: -1 1; }
  /* A muted line after a panel's records, such as how many are shown, lines up with the rows. */
  .hb-panel-list + .hb-panel-sub { margin: .35rem .75rem; }
  /* A record's history: one entry per item along a quiet rule, its details in <small>. */
  .hb-timeline { display: grid; gap: .55rem; list-style: none; margin: 0; padding: 0; }
  .hb-timeline > li { border-inline-start: 2px solid var(--hb-line); display: grid; font-size: .85rem; gap: .1rem; padding-inline-start: .7rem; }
  .hb-timeline small { color: var(--hb-muted); font-size: .75rem; }
  /* DataList cell content: a title over a muted line; figures and times in tabular digits. */
  .hb-cell-text { display: grid; gap: .1rem; min-inline-size: 0; }
  .hb-cell-title { font-weight: 600; overflow-wrap: break-word; }
  .hb-cell-sub { color: var(--hb-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hb-cell-sub code { background: none; font-size: .76rem; padding: 0; }
  .hb-cell-number { font-variant-numeric: tabular-nums; font-weight: 650; }
  .hb-cell-time { color: var(--hb-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .hb-cell-progress { align-items: center; display: grid; gap: .6rem; grid-template-columns: minmax(2.5rem, 6rem) auto; }
  .hb-cell-time[data-tone="danger"] { color: var(--hb-danger-text); font-weight: 600; }
  /* Short fields side by side, as many as fit, one per line on a narrow view. */
  .hb-field-row { align-items: start; display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
  .hb-stack > .hb-field-row { row-gap: var(--hb-space); }
  .hb-stack > .hb-field-row > .hb-field,
  .hb-stack > .hb-field-row > [data-horuph-input] > .hb-field { margin-block-end: 0; }
  /* A field made of several controls is a fieldset; its legend reads as the field's label. */
  fieldset.hb-field { border: 0; margin-inline: 0; min-inline-size: 0; padding: 0; }
  fieldset.hb-field > legend { font-weight: 600; margin-block-end: .35rem; padding: 0; }
  /* Radio or checkbox choices shown as one-click pills. */
  .hb-choice-pills .hb-choices { display: flex; flex-wrap: wrap; gap: .35rem; }
  .hb-choice-pills .hb-choice { border: 1px solid var(--hb-border); border-radius: 999px; cursor: pointer; font-size: .82rem; padding-block: .3rem; padding-inline: .75rem; }
  .hb-choice-pills .hb-choice:has(input:checked) { background: var(--hb-accent-soft); border-color: color-mix(in srgb, var(--hb-accent) 60%, var(--hb-border)); color: var(--hb-accent-text); font-weight: 600; }
  .hb-choice-pills .hb-choice:has(input:focus-visible) { outline: 2px solid var(--hb-accent); outline-offset: 1px; }
  .hb-choice-pills .hb-choice input { block-size: 1px; inline-size: 1px; opacity: 0; position: absolute; }
  /* Optional fields folded under one link-like summary. */
  .hb-disclosure > summary { color: var(--hb-accent-text); cursor: pointer; font-size: .85rem; font-weight: 600; margin-block-end: .6rem; }
  @media (width < 35rem) {
    .hb-panel-foot.hb-panel-actions > button { flex: 1; justify-content: center; }
  }

  .hb-alert {
    background: color-mix(in srgb, var(--hb-muted) 10%, var(--hb-card));
    border: 1px solid color-mix(in srgb, var(--hb-muted) 30%, transparent);
    border-radius: var(--hb-radius);
    margin-block-end: var(--hb-space);
    padding-block: 0.6rem;
    padding-inline: 0.9rem;
  }
  .hb-stack > .hb-alert { margin-block-end: 0; }
  /* An alert that offers a way forward holds its text in a <p> with its actions after it, on one row. */
  .hb-alert:has(> p) { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; }
  .hb-alert > p { flex: 1 1 18rem; margin: 0; }
  .hb-alert-error { background: var(--hb-danger-bg); border-color: transparent; color: var(--hb-danger); }
  :is(.hb-alert-info, .hb-alert-warning, .hb-alert-success) {
    background: color-mix(in srgb, var(--hb-alert-hue) 14%, transparent);
    border-color: color-mix(in srgb, var(--hb-alert-hue) 32%, transparent);
    color: color-mix(in oklch, var(--hb-alert-hue) 55%, var(--hb-fg));
  }
  .hb-alert-info { --hb-alert-hue: #3b82f6; }
  .hb-alert-warning { --hb-alert-hue: #e2a03f; }
  .hb-alert-success { --hb-alert-hue: #22a06b; }
  .hb-field.is-invalid > label { color: var(--hb-danger); }
  .hb-field.is-invalid :is(input:not([type="hidden"], .hb-date-segment), select, textarea, .hb-date-field) {
    border-color: var(--hb-danger);
    box-shadow: 0 0 0 1px var(--hb-danger);
  }

  .hb-muted { color: var(--hb-muted); }
  .hb-pre-wrap { white-space: pre-wrap; }

  .hb-table { border-collapse: collapse; inline-size: 100%; }
  .hb-table th, .hb-table td {
    border-block-end: 1px solid var(--hb-border);
    padding-block: 0.5rem;
    padding-inline: 0.6rem;
    text-align: start;
  }
  .hb-table th { color: var(--hb-muted); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
  .hb-table td { vertical-align: middle; }
  .hb-table tbody tr { transition: background-color .12s ease; }
  .hb-table tbody tr:hover { background: var(--hb-soft); }
  /* Tree guides span the whole cell height so they join across rows of any height: each line is
     positioned against the cell and keeps its guide's inline position. */
  .hb-table td:has(> .hb-tree-cell) { position: relative; }
  .hb-tree-cell { align-items: center; display: flex; }
  .hb-tree-guides { align-self: stretch; display: flex; flex: none; }
  .hb-tree-guide { flex: none; inline-size: 1.6rem; }
  .hb-tree-guide::before, .hb-tree-guide::after {
    border-color: var(--hb-muted);
    border-style: solid;
    border-width: 0;
    margin-inline-start: 0.6rem;
    position: absolute;
  }
  .hb-tree-guide:is([data-guide="rail"], [data-guide="tee"], [data-guide="elbow"])::before { border-inline-start-width: 1px; content: ""; inset-block: 0; }
  .hb-tree-guide[data-guide="elbow"]::before { inset-block-end: 50%; }
  .hb-tree-guide:is([data-guide="tee"], [data-guide="elbow"])::after { border-block-start-width: 1px; content: ""; inline-size: 0.8rem; inset-block-start: 50%; }
  .hb-tree-content { min-inline-size: 0; }

  /* Admin tabs scroll horizontally without a visible scrollbar (no flash before JavaScript enhances them).
     Overflow chevrons overlay the physical edges on the page background, so a hidden chevron never reserves space. */
  .hb-tabs-frame {
    background: var(--hb-bg);
    border-block-end: 1px solid var(--hb-border);
    direction: ltr;
    flex: none;
    min-inline-size: 0;
    position: relative;
  }
  .hb-tabs {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    min-inline-size: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-block-start: calc(var(--hb-space) * 0.7);
    padding-inline: calc(var(--hb-space) * 1.5);
    scroll-behavior: smooth;
    scrollbar-width: none;
  }
  .hb-tabs::-webkit-scrollbar { display: none; }
  html[dir="rtl"] .hb-tabs { direction: rtl; }
  html[dir="ltr"] .hb-tabs { direction: ltr; }
  .hb-tabs-scroll {
    align-items: center;
    background: var(--hb-bg);
    border: 0;
    border-radius: 0;
    color: var(--hb-muted);
    display: flex;
    inline-size: 2.25rem;
    inset-block: 0;
    justify-content: center;
    padding: 0;
    padding-block-start: calc(var(--hb-space) * 0.7);
    position: absolute;
    transition: color 120ms ease;
    visibility: hidden;
    z-index: 1;
  }
  .hb-tabs-scroll-previous { left: 0; }
  .hb-tabs-scroll-next { right: 0; }
  /* A short fade on the inner edge so tab text tucks under the chevron instead of being cut hard. */
  .hb-tabs-scroll::before { content: ""; inline-size: 0.8rem; inset-block: 0; pointer-events: none; position: absolute; }
  .hb-tabs-scroll-previous::before { background: linear-gradient(to right, var(--hb-bg), transparent); left: 100%; }
  .hb-tabs-scroll-next::before { background: linear-gradient(to left, var(--hb-bg), transparent); right: 100%; }
  /* A right-to-left bar starts on the right, so previous sits on the right edge and next on the left. */
  html[dir="rtl"] .hb-tabs-scroll-previous { left: auto; right: 0; }
  html[dir="rtl"] .hb-tabs-scroll-next { left: 0; right: auto; }
  html[dir="rtl"] .hb-tabs-scroll-previous::before { background: linear-gradient(to left, var(--hb-bg), transparent); left: auto; right: 100%; }
  html[dir="rtl"] .hb-tabs-scroll-next::before { background: linear-gradient(to right, var(--hb-bg), transparent); left: 100%; right: auto; }
  html[dir="rtl"] .hb-tabs-scroll .hb-icon { scale: -1 1; }
  .hb-tabs-scroll[hidden] { display: none; }
  .hb-tabs-scroll.is-visible { visibility: visible; }
  .hb-tabs-scroll:hover { color: var(--hb-fg); filter: none; }
  .hb-tabs-scroll:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: -2px; }
  .hb-tabs-scroll .hb-icon { block-size: 1rem; inline-size: 1rem; }
  .hb-tabs a {
    border-block-end: 2px solid transparent;
    flex: none;
    color: var(--hb-muted);
    padding-block: 0.4rem;
    padding-inline: 0.8rem;
  }
  .hb-tabs a.is-active { border-color: var(--hb-accent); color: var(--hb-fg); }
  .hb-tabs a:hover { text-decoration: none; color: var(--hb-fg); }
  /* A loading tab already reads as selected; every other tab dims and waits until it opens. */
  .hb-tabs a.is-pending { border-color: var(--hb-accent); color: var(--hb-fg); cursor: wait; }
  .hb-tabs[aria-busy="true"] a:not(.is-pending) { border-color: transparent; cursor: wait; opacity: .35; }

  .hb-dl { display: grid; gap: 0.4rem; grid-template-columns: max-content minmax(0, 1fr); }
  .hb-dl dt { color: var(--hb-muted); padding-inline-end: var(--hb-space); }
  .hb-dl dd { min-inline-size: 0; overflow-wrap: anywhere; }
  /* On a phone a label leaves its value too little room, so each label sits above its value. */
  @media (max-width: 42rem) {
    .hb-dl { gap: 0.1rem; grid-template-columns: minmax(0, 1fr); }
    .hb-dl dt { padding-inline-end: 0; }
    .hb-dl dd + dt { margin-block-start: 0.6rem; }
  }
  /* A stacked list puts each term above its value, for a narrow column of a record's details. */
  .hb-dl-stacked { gap: .1rem; grid-template-columns: minmax(0, 1fr); margin: 0; }
  .hb-dl-stacked dt { font-size: .74rem; font-weight: 600; padding-inline-end: 0; }
  .hb-dl-stacked dd { align-items: baseline; display: flex; font-size: .88rem; gap: .5rem; justify-content: space-between; margin: 0; min-inline-size: 0; overflow-wrap: anywhere; }
  .hb-dl-stacked dd + dt { margin-block-start: .65rem; }
  .hb-dl-stacked dd a { font-weight: 600; }

  .hb-stats { display: grid; gap: var(--hb-space); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
  .hb-stat { text-align: center; }
  .hb-stat strong { display: block; font-size: 1.8rem; }
  .hb-stat span { color: var(--hb-muted); font-size: 0.85rem; }

  .hb-summary-grid {
    display: grid;
    gap: var(--hb-space);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    margin-block-end: var(--hb-space);
  }
  .hb-stack > .hb-summary-grid { margin-block-end: 0; }
  .hb-summary-card { display: flex; flex-direction: column; gap: 0.75rem; min-inline-size: 0; overflow: hidden; padding-block: 1rem; padding-inline: 1.15rem; position: relative; }
  .hb-summary-card[data-card-tone]::before { background: var(--hb-accent); content: ''; inline-size: 3px; inset-block: 0; inset-inline-start: 0; position: absolute; }
  .hb-summary-card[data-card-tone="success"]::before { background: #22a06b; }
  .hb-summary-card[data-card-tone="warning"]::before { background: #e2a03f; }
  .hb-summary-card[data-card-tone="warning"] .hb-summary-metric strong { color: color-mix(in oklch, #e2a03f 72%, var(--hb-fg)); }
  .hb-summary-card[data-card-tone="danger"]::before { background: var(--hb-danger); }
  .hb-summary-card[data-card-tone="danger"] .hb-summary-metric strong { color: var(--hb-danger); }
  a.hb-summary-card { color: var(--hb-fg); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
  a.hb-summary-card:hover { border-color: color-mix(in srgb, var(--hb-accent) 55%, var(--hb-border)); text-decoration: none; transform: translateY(-1px); }
  .hb-summary-card-head { align-items: center; display: flex; gap: 0.45rem; min-inline-size: 0; }
  .hb-summary-card-head h3 { font-size: 0.9rem; margin: 0; min-inline-size: 0; }
  .hb-summary-card-head .hb-icon { block-size: 1rem; color: var(--hb-muted); inline-size: 1rem; }
  .hb-summary-status { border: 1px solid var(--hb-border); border-radius: 999px; color: var(--hb-muted); font-size: 0.75rem; margin-inline-start: auto; padding: 0.1rem 0.45rem; white-space: nowrap; }
  .hb-summary-status[data-tone="success"] { color: var(--hb-fg); }
  .hb-summary-status[data-tone="warning"] { border-color: var(--hb-accent); color: var(--hb-accent); }
  .hb-summary-status[data-tone="danger"] { border-color: var(--hb-danger); color: var(--hb-danger); }
  .hb-summary-metric strong { display: block; font-size: 1.9rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.2; }
  .hb-summary-metric span { color: var(--hb-muted); font-size: 0.8rem; }
  /* A value too long to sit beside its label, such as an email address, drops whole to the next line;
     only a value wider than the card breaks. */
  .hb-summary-rows { display: grid; font-size: 0.85rem; gap: 0.3rem; }
  .hb-summary-rows > div { column-gap: 0.7rem; display: flex; flex-wrap: wrap; justify-content: space-between; }
  .hb-summary-rows dt { color: var(--hb-muted); }
  .hb-summary-rows dd { font-weight: 600; margin: 0; margin-inline-start: auto; min-inline-size: 0; overflow-wrap: break-word; text-align: end; }
  /* In a window the summary is a compact strip of figures: the window is already the raised surface. */
  :is(dialog.hb-modal, .hb-dock) .hb-summary-grid { gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); margin-block-end: 0; }
  :is(dialog.hb-modal, .hb-dock) .hb-summary-card { background: var(--hb-soft); box-shadow: none; gap: 0.15rem; padding-block: 0.7rem; padding-inline: 0.9rem; }
  :is(dialog.hb-modal, .hb-dock) .hb-summary-card-head h3 { color: var(--hb-muted); font-size: 0.75rem; font-weight: 600; }
  :is(dialog.hb-modal, .hb-dock) .hb-summary-metric { display: grid; gap: 0.15rem; min-inline-size: 0; }
  :is(dialog.hb-modal, .hb-dock) .hb-summary-metric strong { font-size: 1.15rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :is(dialog.hb-modal, .hb-dock) .hb-summary-metric span { font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hb-summary-actions { display: grid; gap: 0.5rem; margin-block-start: auto; }
  .hb-summary-action-form { inline-size: 100%; margin: 0; }
  .hb-summary-action {
    align-items: center;
    background: transparent;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    color: var(--hb-fg);
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 600;
    inline-size: 100%;
    justify-content: flex-start;
    min-block-size: 2rem;
    padding-block: 0.4rem;
    padding-inline: 0.7rem;
    text-align: start;
  }
  .hb-summary-action > .hb-icon { color: var(--hb-accent); }
  .hb-summary-action:hover {
    background: color-mix(in srgb, var(--hb-accent) 7%, transparent);
    border-color: var(--hb-accent);
    color: var(--hb-accent);
    text-decoration: none;
  }

  .hb-align-left { text-align: left; }
  .hb-align-right { text-align: right; }
  .hb-align-center { text-align: center; }
  .hb-align-justify { text-align: justify; }

  /* Rich-text tables carry one canonical class from the sanitizer, so stored documents
     render consistently without styling Horuph's unrelated data tables. */
  .hb-rich-table { border-collapse: collapse; inline-size: 100%; margin-block: 0.75rem; table-layout: fixed; }
  .hb-rich-table :is(th, td) { border: 1px solid var(--hb-border); padding: 0.45rem; vertical-align: top; }
  .hb-rich-table th { background: var(--hb-bg); font-weight: 700; text-align: start; }
  .hb-rich-table caption { color: var(--hb-muted); margin-block-end: 0.35rem; text-align: start; }
  .hb-rich-table :is(th, td) > :first-child { margin-block-start: 0; }
  .hb-rich-table :is(th, td) > :last-child { margin-block-end: 0; }

  /* Form fields — the one layout every registered input type renders into. */
  .hb-field { margin-block-end: var(--hb-space); }
  .hb-field > label { margin-block-end: 0.25rem; }
  .hb-required { color: var(--hb-danger); }
  .hb-help { color: var(--hb-muted); font-size: 0.85rem; margin-block: 0.3rem 0; }
  .hb-input-suffixed { align-items: center; display: flex; gap: 0.5rem; margin-block-start: 0.25rem; }
  .hb-input-suffixed > input { flex: 1 1 auto; margin-block-start: 0; min-inline-size: 0; }
  .hb-input-suffix { color: var(--hb-muted); flex: none; }
  .hb-choices { display: grid; gap: 0.25rem; }
  .hb-choice { align-items: center; display: flex; font-weight: 400; gap: 0.45rem; margin: 0; }
  .hb-choice input { inline-size: auto; margin: 0; }
  .hb-swatch {
    border: 1px solid var(--hb-border);
    border-radius: 3px;
    display: inline-block;
    block-size: 0.9em;
    inline-size: 0.9em;
    vertical-align: -0.1em;
  }
  .hb-thumb { border-radius: var(--hb-radius); max-block-size: 4rem; }
  .hb-field-error { color: var(--hb-danger); font-size: 0.85rem; margin-block-start: 0.3rem; }
  /* List Input: one entry per row, an icon-only remove beside each, then a secondary Add. */
  .hb-list { display: grid; gap: 0.4rem; margin-block-start: 0.25rem; }
  .hb-list:empty { display: none; }
  .hb-list-row { align-items: center; display: flex; gap: 0.4rem; }
  .hb-list-row > input { flex: 1 1 auto; margin-block-start: 0; min-inline-size: 0; }
  .hb-list-row > .hb-row-action { flex: none; }
  button.hb-list-add {
    align-items: center;
    background: transparent;
    border: 1px solid var(--hb-border);
    color: var(--hb-fg);
    display: inline-flex;
    gap: 0.4rem;
    margin-block-start: 0.5rem;
  }
  button.hb-list-add:hover:not(:disabled) { border-color: var(--hb-accent); color: var(--hb-accent); filter: none; }

  /* Admin actions stay compact everywhere. Fixed bottom action bars are the one exception:
     their primary Save/Apply controls keep the normal button size. */
  .hb-admin-view button { font-size: 0.85rem; padding-block: 0.25rem; padding-inline: 0.7rem; }
  .hb-admin-view .hb-admin-view-footer button { font-size: inherit; padding-block: 0.5rem; padding-inline: 1.1rem; }
  .hb-settings-page { display: grid; gap: calc(var(--hb-space) * 1.75); }
  .hb-settings-intro { margin: 0; }
  .hb-settings-form { display: grid; gap: calc(var(--hb-space) * 1.75); }
  .hb-settings-section { min-inline-size: 0; }
  .hb-settings-section > h2 { margin-block-end: 0.35rem; }
  .hb-settings-section > .hb-help { margin: 0; }
  .hb-settings-section > .hb-help + .hb-settings-section-content { margin-block-start: 0.75rem; }
  .hb-settings-section-content > .hb-field:last-child { margin-block-end: 0; }
  .hb-settings-actions { margin-block-start: 0.65rem; }
  .hb-settings-task .hb-settings-actions { justify-content: flex-end; }

  /* The rich text editor. The toolbar, the writing surface, and the textarea that is the
     real form field share one border, so the three read as a single control however many
     of them happen to be showing. */
  .hb-editor {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    margin-block-start: 0.25rem;
    overflow: hidden;
    position: relative;
  }
  .hb-editor:focus-within { outline: 2px solid var(--hb-accent); outline-offset: 1px; }
  /* The wrapper draws the frame, so the parts inside must not draw one of their own. */
  .hb-editor > .hb-editor-source {
    border: none;
    border-radius: 0;
    font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
    font-size: 0.85rem;
    margin: 0;
  }
  .hb-editor > .hb-editor-source:focus-visible { outline: none; }

  .hb-editor-bar {
    align-items: center;
    background: var(--hb-bg);
    border-block-end: 1px solid var(--hb-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding: 0.3rem;
  }
  .hb-editor-bar button {
    background: none;
    border-radius: var(--hb-radius);
    color: var(--hb-fg);
    line-height: 0;
    padding: 0.35rem;
  }
  .hb-editor-bar button:hover { background: var(--hb-card); filter: none; }
  .hb-editor-bar button[aria-pressed="true"] { background: var(--hb-accent); color: var(--hb-accent-fg); }
  .hb-editor-bar button:disabled { cursor: not-allowed; opacity: 0.4; }
  .hb-editor-bar button:disabled:hover { background: none; }
  .hb-editor-gap {
    background: var(--hb-border);
    block-size: 1.1rem;
    inline-size: 1px;
    margin-inline: 0.2rem;
  }

  .hb-editor-table-bar {
    align-items: center;
    background: var(--hb-bg);
    border-block-end: 1px solid var(--hb-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.3rem 0.45rem;
  }
  .hb-editor-table-bar[hidden] { display: none; }
  .hb-editor-table-bar button { font-size: 0.78rem; padding: 0.25rem 0.5rem; }

  .hb-editor-image-resize {
    block-size: 0.85rem;
    border: 2px solid var(--hb-card);
    border-radius: 2px;
    cursor: nwse-resize;
    inline-size: 0.85rem;
    padding: 0;
    position: absolute;
    touch-action: none;
    transform: translate(-50%, -50%);
    z-index: 3;
  }

  .hb-editor-area {
    /* Writing starts at the top and grows down, however tall the box is asked to be. */
    align-content: start;
    max-block-size: 60vh;
    min-block-size: 9rem;
    overflow-wrap: break-word;
    overflow-y: auto;
    padding-block: 0.6rem;
    padding-inline: 0.75rem;
  }
  .hb-editor-area:focus-visible { outline: none; }
  /* The placeholder cannot be :empty — an emptied editor still holds <p><br></p>. */
  .hb-editor-area.is-empty::before {
    color: var(--hb-muted);
    content: attr(data-placeholder);
    pointer-events: none;
  }
  .hb-editor-area > :first-child { margin-block-start: 0; }
  .hb-editor-area > :last-child { margin-block-end: 0; }
  .hb-editor-area img { block-size: auto; max-inline-size: 100%; }
  .hb-editor-area table { max-inline-size: 100%; }
  .hb-editor-area blockquote {
    border-inline-start: 3px solid var(--hb-border);
    color: var(--hb-muted);
    margin-inline: 0;
    padding-inline-start: var(--hb-space);
  }
  .hb-editor-area :is(ul, ol) { padding-inline-start: 1.5rem; }

  /* The two layout utilities: a vertical rhythm and a horizontal group. */
  /* One column as wide as the stack: no child, such as a wide table or a long line, can widen it. */
  .hb-stack { display: grid; gap: var(--hb-space); grid-template-columns: minmax(0, 1fr); }
  .hb-stack > .hb-field,
  .hb-stack > [data-horuph-input] > .hb-field { margin-block-end: 0; }
  .hb-stack > .hb-help { margin-block-start: 0; }
  .hb-admin-view .hb-stack > :is(button, .hb-quiet-button, .hb-primary-button) { justify-self: start; }
  .hb-row { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5rem; }

  .hb-inline-form { display: inline; }
  .hb-inline-form button { font-size: 0.85rem; padding-block: 0.25rem; padding-inline: 0.7rem; }

  .hb-link-button {
    background: none;
    color: var(--hb-accent);
    font-weight: 400;
    padding: 0;
  }
  .hb-link-button:hover { filter: none; text-decoration: underline; text-underline-offset: 3px; }
  /* A list row's name that opens the record: it reads as the row's title and shows it is a link on hover.
     It breaks between words; `anywhere` would let a table column shrink to a single letter. */
  .hb-title-button {
    align-items: center;
    background: none;
    border: 0;
    color: var(--hb-fg);
    display: inline-flex;
    font: inherit;
    font-weight: 600;
    gap: 0.35rem;
    overflow-wrap: break-word;
    padding: 0;
    text-align: start;
  }
  .hb-title-button:hover { color: var(--hb-accent); filter: none; text-decoration: underline; text-underline-offset: 3px; }
  /* Text-like roles keep no button padding inside the compact Admin button sizing. */
  .hb-admin-view :is(.hb-title-button, .hb-link-button) { padding: 0; }
  .hb-admin-view a.hb-title-button { font-size: 0.85rem; }
  .hb-admin-view .hb-link-button { font-size: inherit; }
  .hb-badge {
    --hb-badge-hue: var(--hb-muted);
    align-items: center;
    background: color-mix(in srgb, var(--hb-badge-hue) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--hb-badge-hue) 28%, transparent);
    border-radius: 999px;
    color: color-mix(in oklch, var(--hb-badge-hue) 75%, var(--hb-fg));
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 650;
    gap: 0.35rem;
    line-height: 1.2;
    padding: 0.18rem 0.55rem;
    white-space: nowrap;
  }
  .hb-badge::before {
    background: currentColor;
    block-size: 0.4rem;
    border-radius: 50%;
    content: '';
    flex: none;
    inline-size: 0.4rem;
    opacity: 0.85;
  }
  .hb-badge[data-tone="info"] { --hb-badge-hue: #3b82f6; }
  .hb-badge[data-tone="success"] { --hb-badge-hue: #22a06b; }
  .hb-badge[data-tone="warning"] { --hb-badge-hue: #e2a03f; }
  .hb-badge[data-tone="accent"] { --hb-badge-hue: var(--hb-accent); }
  .hb-badge[data-tone="danger"] { --hb-badge-hue: var(--hb-danger); }

  .hb-danger-button { background: var(--hb-danger); color: #fff; }
  /* The two action roles a plain button cannot express by where it sits: a quiet (outline) action on a page,
     and the one filled call to action at the head of a window, whose body otherwise draws buttons as outline.
     A link or a menu's summary takes the same role as a button. */
  :is(a, button, summary):is(.hb-quiet-button, .hb-primary-button) {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--hb-radius);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    list-style: none;
    min-block-size: 2rem;
    padding-block: 0.25rem;
    padding-inline: 0.7rem;
    text-decoration: none;
    white-space: nowrap;
  }
  summary:is(.hb-quiet-button, .hb-primary-button)::-webkit-details-marker { display: none; }
  :is(a, button, summary).hb-quiet-button { background: transparent; border-color: var(--hb-border); color: var(--hb-fg); }
  :is(a, button, summary).hb-quiet-button:hover { background: color-mix(in srgb, var(--hb-fg) 6%, transparent); filter: none; text-decoration: none; }
  :is(a, button, summary).hb-primary-button { background: var(--hb-accent); color: var(--hb-accent-fg); }
  :is(a, button, summary).hb-primary-button:hover { filter: brightness(1.05); text-decoration: none; }

  /* A page action menu is a native popover containing ordinary links, buttons or forms. The browser owns
     dismissal and focus; these are not ARIA application menus. */
  .hb-action-menu[popover] {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
    gap: .15rem;
    margin: auto;
    max-block-size: min(70dvh, 30rem);
    max-inline-size: min(22rem, calc(100vw - 2rem));
    min-inline-size: min(15rem, calc(100vw - 2rem));
    overflow-y: auto;
    padding: .35rem;
  }
  .hb-action-menu[popover]:popover-open { display: grid; }
  .hb-action-menu[popover]::backdrop { background: transparent; }
  @supports (position-anchor: --hb-action-menu) {
    .hb-action-menu[popover] {
      inset: auto;
      inset-block-start: anchor(end);
      inset-inline-end: anchor(end);
      margin: 0;
      position: fixed;
      position-anchor: auto;
      position-try-fallbacks: flip-block, flip-inline;
    }
    .hb-action-menu[popover][data-menu-align="start"] { inset-inline-end: auto; inset-inline-start: anchor(start); }
  }
  .hb-action-menu-label {
    color: var(--hb-muted);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    margin: .4rem .7rem .25rem;
    text-transform: uppercase;
  }
  :is(a, button).hb-action-menu-item {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: calc(var(--hb-radius) - 2px);
    color: var(--hb-fg);
    display: flex;
    font-size: .85rem;
    font-weight: 500;
    gap: .55rem;
    inline-size: 100%;
    justify-content: flex-start;
    min-block-size: 2.35rem;
    padding-block: .45rem;
    padding-inline: .65rem;
    text-align: start;
    text-decoration: none;
  }
  :is(a, button).hb-action-menu-item:hover {
    background: color-mix(in srgb, var(--hb-fg) 6%, transparent);
    filter: none;
    text-decoration: none;
  }
  .hb-action-menu-item > .hb-icon { color: var(--hb-muted); flex: none; }
  .hb-action-menu-copy { display: grid; flex: 1 1 auto; gap: .1rem; min-inline-size: 0; }
  .hb-action-menu-copy small { color: var(--hb-muted); font-size: .78rem; font-weight: 400; }
  .hb-action-menu-item:is([aria-current], [aria-pressed="true"]) { background: color-mix(in srgb, var(--hb-accent) 12%, transparent); }
  .hb-action-menu-item:is([aria-current], [aria-pressed="true"]) > .hb-icon { color: var(--hb-accent); }
  .hb-action-menu-item:is([aria-current], [aria-pressed="true"])::after { color: var(--hb-accent); content: "✓"; margin-inline-start: auto; }
  .hb-action-menu-form { border-block-start: 1px solid var(--hb-border); margin: .3rem 0 0; padding-block-start: .3rem; }
  .hb-action-menu-form > .hb-action-menu-item { inline-size: 100%; }

  /* Dismissing never competes with the action it sits beside: Cancel, No and Close read as secondary. */
  button[data-modal-close] { background: transparent; border: 1px solid var(--hb-border); color: var(--hb-fg); }
  button[data-modal-close]:hover { background: color-mix(in srgb, var(--hb-fg) 6%, transparent); filter: none; }

  /* A control that reads as text until you reach for it. Used where the words matter
     more than the affordance — a row of choices about one thing. */
  .hb-text-button {
    background: none;
    border: 1px solid transparent;
    color: var(--hb-accent);
    padding-block: 0.3rem;
    padding-inline: 0.5rem;
  }
  .hb-text-button:hover { border-color: currentColor; text-decoration: none; }
  .hb-text-button.is-danger { color: var(--hb-danger); }

  /* secretReveal: the one-time secret beside its Copy button. */
  .hb-secret { display: flex; gap: 0.5rem; }
  .hb-secret input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-inline-size: 0; }

  /* fileDrop: a drop zone over the real file input. The input stays focusable for the keyboard,
     so the zone shows its focus; the browse buttons are pointer shortcuts to the same input. */
  .hb-file-drop {
    align-content: center;
    background: var(--hb-card);
    border: 2px dashed var(--hb-border);
    border-radius: var(--hb-radius-lg);
    cursor: pointer;
    display: grid;
    gap: .5rem;
    justify-items: center;
    min-block-size: 10rem;
    padding: 1.25rem 1rem;
    position: relative;
    text-align: center;
    transition: border-color .15s, background-color .15s;
  }
  .hb-file-drop.is-dragging { background: var(--hb-bg); border-color: var(--hb-accent); }
  .hb-file-drop:has(.hb-file-drop-input:focus-visible) { outline: 2px solid var(--hb-accent); outline-offset: 2px; }
  .hb-field.is-invalid .hb-file-drop { border-color: var(--hb-danger); }
  .hb-file-drop-empty, .hb-file-drop-chosen { display: grid; gap: .5rem; justify-items: center; max-inline-size: 100%; min-inline-size: 0; }
  .hb-file-drop-icon, .hb-file-drop-file { color: var(--hb-muted); }
  .hb-file-drop-icon .hb-icon { block-size: 2rem; inline-size: 2rem; }
  .hb-file-drop-file .hb-icon { block-size: 2.5rem; inline-size: 2.5rem; }
  .hb-file-drop-title { font-weight: 600; margin: 0; }
  .hb-file-drop-chosen img { border-radius: var(--hb-radius); max-block-size: 11rem; max-inline-size: 100%; object-fit: contain; }
  .hb-file-drop-name { font-weight: 600; max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hb-file-drop-size { color: var(--hb-muted); font-size: .8rem; }
  .hb-file-drop .hb-help { margin: 0; }
  /* Choosing a file is part of the field, never the form's submit, so the browse button is outline wherever the field sits. */
  .hb-file-drop button[data-file-drop-browse]:not(.hb-text-button) { background: transparent; border: 1px solid var(--hb-border); color: var(--hb-fg); }
  .hb-file-drop button[data-file-drop-browse]:not(.hb-text-button):hover { background: color-mix(in srgb, var(--hb-fg) 6%, transparent); filter: none; }
  .hb-file-drop-input { block-size: 1px; inline-size: 1px; inset-block-end: 0; inset-inline-start: 50%; margin: 0; opacity: 0; padding: 0; pointer-events: none; position: absolute; }
  .hb-file-drop-error { color: var(--hb-danger); margin: .4rem 0 0; }

  .hb-addon-note, .hb-addon-warning {
    font-size: 0.82rem;
    line-height: 1.35;
    margin: 0;
    max-inline-size: 60ch;
  }
  .hb-addon-note { color: var(--hb-muted); }
  .hb-addon-warning { color: var(--hb-danger); }

  /* Icons: the vendored Lucide sprite, sized and colored by the text around them.
     Only geometry belongs here — fill and stroke ride on the element itself, because CSS
     would override a symbol that draws itself differently. */
  .hb-icon {
    block-size: 1em;
    display: inline-block;
    flex: none;
    inline-size: 1em;
    vertical-align: -0.125em;
  }
  /* An icon beside a label needs the gap from its container, not a margin of its own —
     an icon used alone must not carry spacing. Headings stay block-level flex so they
     still take the full line; controls sit inline with the text around them. */
  :is(a, button, label, summary):has(.hb-icon, .hb-mark) {
    align-items: center;
    display: inline-flex;
    gap: 0.4rem;
  }
  :is(h1, h2, h3, h4):has(.hb-icon, .hb-mark) { align-items: center; display: flex; gap: 0.5rem; }

  /* An addon's own icon, put inline so it inherits color. The addon chooses the drawing;
     these two rules choose the size, so one addon can never out-shout the others. */
  .hb-mark { display: inline-flex; flex: none; }
  .hb-mark > svg { block-size: 1em; inline-size: 1em; }

  /* Avatars mark actors only: a person is round, an organization or group is a rounded square.
     Any other record wears its type icon in the same footprint (.hb-record-icon). */
  :is(.hb-avatar, .hb-record-icon) {
    --hb-avatar-size: 2.1rem;
    block-size: var(--hb-avatar-size);
    display: inline-grid;
    flex: none;
    font-size: calc(var(--hb-avatar-size) * 0.34);
    inline-size: var(--hb-avatar-size);
    place-items: center;
  }
  :is(.hb-avatar, .hb-record-icon)[data-size="sm"] { --hb-avatar-size: 1.4rem; font-size: 0.56rem; }
  :is(.hb-avatar, .hb-record-icon)[data-size="lg"] { --hb-avatar-size: 3.25rem; }
  .hb-avatar {
    --hb-avatar-hue: var(--hb-accent);
    background: color-mix(in srgb, var(--hb-avatar-hue) 18%, var(--hb-card));
    border-radius: 50%;
    color: color-mix(in oklch, var(--hb-avatar-hue) 70%, var(--hb-fg));
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
  }
  .hb-avatar[data-kind="organization"] { border-radius: calc(var(--hb-avatar-size) * 0.28); }
  .hb-avatar[data-hue="1"] { --hb-avatar-hue: var(--hb-avatar-hue-1); }
  .hb-avatar[data-hue="2"] { --hb-avatar-hue: var(--hb-avatar-hue-2); }
  .hb-avatar[data-hue="3"] { --hb-avatar-hue: var(--hb-avatar-hue-3); }
  .hb-avatar[data-hue="4"] { --hb-avatar-hue: var(--hb-avatar-hue-4); }
  .hb-avatar[data-hue="5"] { --hb-avatar-hue: var(--hb-avatar-hue-5); }
  .hb-avatar[data-redacted] { --hb-avatar-hue: var(--hb-muted); }
  .hb-avatar .hb-icon { block-size: 50%; inline-size: 50%; }
  .hb-record-icon {
    background: color-mix(in srgb, var(--hb-accent) 10%, var(--hb-card));
    border-radius: calc(var(--hb-avatar-size) * 0.28);
    color: var(--hb-accent);
  }
  .hb-record-icon .hb-icon { block-size: 50%; inline-size: 50%; }
  /* The mark beside its name; lines under the name stack in .hb-identity-text and never push the mark away. */
  .hb-identity { align-items: center; display: flex; gap: 0.6rem; min-inline-size: 0; }
  .hb-identity-text { display: grid; gap: 0.15rem; justify-items: start; min-inline-size: 0; }
  /* Start-aligned lines size to their text; capping them at the track makes a one-line name end in its
     ellipsis instead of painting over the next column. */
  .hb-identity-text > * { max-inline-size: 100%; min-inline-size: 0; }
  /* A table sizes each column from its narrowest content, so in a table the lines keep their words:
     a zero minimum would squeeze the name under the mark and over the next column. */
  .hb-table td .hb-identity-text > * { min-inline-size: auto; }

  /* Admin pages own the viewport below Horuph's toolbar. The document itself does not
     scroll: tabs and optional local chrome stay reachable while only the active tab body
     scrolls. This is structural rather than a pile of offset-dependent sticky rules. */
  body.hb-admin-document {
    block-size: 100vh;
    block-size: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-block-size: 100vh;
    min-block-size: 100dvh;
    overflow: hidden;
  }
  .hb-admin-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    inline-size: 100%;
    min-block-size: 0;
    overflow: hidden;
  }
  .hb-tabpanels, .hb-tabpanel, .hb-admin-view { min-block-size: 0; min-inline-size: 0; }
  .hb-tabpanels { overflow: hidden; }
  .hb-tabpanel { block-size: 100%; }
  .hb-tabpanel[hidden] { display: none; }
  .hb-admin-view {
    block-size: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }
  .hb-admin-view-toolbar,
  .hb-admin-view-footer {
    align-items: center;
    background: var(--hb-card);
    display: flex;
    gap: 0.65rem;
    padding-block: 0.65rem;
    padding-inline: calc(var(--hb-space) * 1.5);
    z-index: 3;
  }
  .hb-admin-view-toolbar { border-block-end: 1px solid var(--hb-border); flex-wrap: wrap; grid-row: 1; }
  /* Nested tabs are local navigation inside an Admin tab, not another raised surface.
     Content below owns its own padding, so local tabs do not add bottom padding. */
  .hb-admin-view-toolbar:has(> .hb-admin-inner-tabs-frame) { background: transparent; padding-block-end: 0; }
  /* Sub-tabs (adminSubTabs) are contained tabs, deliberately unlike the underlined Admin tabs above them:
     the current one takes the page background, overlaps the toolbar rule and opens into the content.
     Like Admin tabs they stay on one row and scroll behind the shared overflow chevrons. */
  /* Like the Admin tab frame, the sub-tab frame spans the toolbar's full width so its chevrons sit on the same
     physical edges; the toolbar's inline padding moves into the bar. Inline-size containment keeps the full row
     of sub-tabs from widening the Admin view on narrow screens. */
  .hb-admin-inner-tabs-frame {
    contain: inline-size;
    direction: ltr;
    inline-size: calc(100% + var(--hb-space) * 3);
    margin-inline: calc(var(--hb-space) * -1.5);
    min-inline-size: 0;
    position: relative;
  }
  .hb-admin-inner-tabs-frame > .hb-tabs-scroll { font-size: inherit; padding: 0; }
  .hb-admin-inner-tabs {
    align-items: flex-end;
    display: flex;
    gap: 0.3rem;
    margin: 0;
    margin-block-end: -1px;
    overflow-x: auto;
    padding-inline: calc(var(--hb-space) * 1.5);
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }
  .hb-admin-inner-tabs::-webkit-scrollbar { display: none; }
  html[dir="rtl"] .hb-admin-inner-tabs { direction: rtl; }
  html[dir="ltr"] .hb-admin-inner-tabs { direction: ltr; }
  .hb-admin-inner-tabs a {
    background: color-mix(in srgb, var(--hb-fg) 4%, transparent);
    border: 1px solid transparent;
    border-block-end: 0;
    border-start-end-radius: var(--hb-radius);
    border-start-start-radius: var(--hb-radius);
    color: var(--hb-muted);
    flex: none;
    font-size: 0.9rem;
    padding-block: 0.45rem;
    padding-inline: 0.95rem;
    text-decoration: none;
  }
  .hb-admin-inner-tabs a:hover { background: color-mix(in srgb, var(--hb-fg) 8%, transparent); color: var(--hb-fg); text-decoration: none; }
  .hb-admin-inner-tabs a[aria-current="page"] {
    background: var(--hb-bg);
    border-color: var(--hb-border);
    box-shadow: inset 0 2px 0 var(--hb-accent);
    color: var(--hb-fg);
    font-weight: 650;
    padding-block-end: calc(0.45rem + 1px);
  }
  /* View switch (adminViewSwitch): alternative views of one section, as one segmented control in content. */
  .hb-view-switch {
    background: var(--hb-soft);
    border: 1px solid var(--hb-border);
    /* Half the height of one row of links: a pill on one row, a rounded box once the links wrap. */
    border-radius: calc((0.84rem * 1.6 + 0.8rem) / 2 + 4px);
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    inline-size: fit-content;
    justify-self: start;
    max-inline-size: 100%;
    padding: 3px;
  }
  .hb-view-switch a { border-radius: 999px; color: var(--hb-muted); font-size: 0.84rem; font-weight: 600; line-height: 1.6; padding-block: 0.4rem; padding-inline: 0.95rem; text-decoration: none; white-space: nowrap; }
  .hb-view-switch a:hover { color: var(--hb-fg); text-decoration: none; }
  .hb-view-switch a[aria-current="page"] { background: var(--hb-card); box-shadow: 0 1px 3px rgb(0 0 0 / 18%); color: var(--hb-fg); }
  /* adminPaneSwitch: the same pills as radios; the checked one reads as current. */
  .hb-view-switch label { border-radius: 999px; color: var(--hb-muted); cursor: pointer; font-size: 0.84rem; font-weight: 600; line-height: 1.6; margin: 0; padding-block: 0.4rem; padding-inline: 0.95rem; position: relative; white-space: nowrap; }
  .hb-view-switch label:hover { color: var(--hb-fg); }
  .hb-view-switch label:has(input:checked) { background: var(--hb-card); box-shadow: 0 1px 3px rgb(0 0 0 / 18%); color: var(--hb-fg); }
  .hb-view-switch label:has(input:focus-visible) { outline: 2px solid var(--hb-accent); outline-offset: 1px; }
  .hb-view-switch input { block-size: 1px; inline-size: 1px; margin: 0; opacity: 0; pointer-events: none; position: absolute; }
  /* Drag/move handles are affordances, not actions: never give them button chrome. */
  button.hb-admin-move-handle { background: transparent; border: 0; color: var(--hb-muted); padding: 0.25rem; }
  button.hb-admin-move-handle:hover { color: var(--hb-fg); filter: none; }
  /* Visibility is a standard icon action: eye when visible, the same eye slashed when hidden. */
  .hb-visibility-action { position: relative; }
  .hb-visibility-action[aria-pressed="false"]::after { background: currentColor; block-size: 2px; content: ""; inline-size: 1.35rem; inset-block-start: 50%; inset-inline-start: 50%; position: absolute; transform: translate(-50%, -50%) rotate(-45deg); transform-origin: center; }
  .hb-admin-view-footer {
    block-size: calc(3.9rem + env(safe-area-inset-bottom, 0px));
    flex: none;
    flex-wrap: nowrap;
    grid-row: 3;
    overflow-x: auto;
    border-block-start: 1px solid var(--hb-border);
    justify-content: flex-start;
    padding-block-end: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  }
  .hb-admin-view-footer > * { flex: none; }
  .hb-admin-view-footer > :first-child { margin-inline-start: auto; }
  .hb-admin-view-content {
    grid-row: 2;
    min-block-size: 0;
    min-inline-size: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: calc(var(--hb-space) * 1.5);
  }
  .hb-admin-standalone {
    grid-row: 1 / -1;
    min-block-size: 0;
    overflow: auto;
  }

  /* The toolbar itself is styled inside its shadow root; only its host is placed here. */
  .hb-toolbar-host {
    inset-block-start: 0;
    position: sticky;
    view-transition-name: hb-toolbar;
    z-index: 1000;
  }

  /* Design mode (SPEC section 6a). Regions and blocks are in every page for every
     visitor; only these rules make their chrome visible, and only while designing. So a
     page never renders differently for an admin — it is the same page, annotated. */
  .hb-region-bar, .hb-block-bar { display: none; }
  :root[data-design="on"] .hb-region {
    margin-block: calc(var(--hb-space) * 0.5);
    outline: 1px dashed var(--hb-accent);
    outline-offset: 2px;
    padding: calc(var(--hb-space) * 0.5);
    position: relative;
  }
  :root[data-design="on"] .hb-region-bar,
  :root[data-design="on"] .hb-block-bar {
    align-items: center;
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    display: flex;
    font-size: 0.8rem;
    gap: 0.35rem;
    margin-block-end: 0.4rem;
    padding: 0.2rem 0.4rem;
  }
  :root[data-design="on"] .hb-region-name { font-weight: 700; }
  :root[data-design="on"] .hb-region-scope,
  :root[data-design="on"] .hb-block-note { color: var(--hb-muted); }
  :root[data-design="on"] .hb-region-bar button,
  :root[data-design="on"] .hb-block-bar button {
    background: none;
    border: none;
    color: var(--hb-fg);
    padding: 0.15rem 0.25rem;
  }
  :root[data-design="on"] .hb-region-bar button { margin-inline-start: auto; }
  :root[data-design="on"] .hb-block-bar button:first-of-type { margin-inline-start: auto; }
  :root[data-design="on"] .hb-block { outline: 1px solid var(--hb-border); padding: 0.4rem; }
  :root[data-design="on"] .hb-block[data-block-hidden] { opacity: 0.55; }
  :root[data-design="on"] .hb-block[data-block-hidden] .hb-block-note { color: var(--hb-danger); }

  /* Centered single-card pages (login) */
  .hb-setup { display: grid; min-block-size: 100vh; padding: var(--hb-space); place-items: center; }
  .hb-setup .hb-card { inline-size: min(26rem, 100%); }

  .hb-home { margin-inline: auto; max-inline-size: 42rem; padding: calc(var(--hb-space) * 3) var(--hb-space); }
  /* Not found / no access: one quiet explanation and the way back, start-aligned behind a deliberate margin. */
  .hb-status-page {
    display: grid;
    gap: 0.5rem;
    justify-items: start;
    margin-inline: clamp(0rem, 10vw, 9rem) auto;
    max-inline-size: 32rem;
    padding-block: clamp(2rem, 12vh, 7rem) 2rem;
    padding-inline: var(--hb-space);
  }
  .hb-status-page p { margin: 0; }
  .hb-status-page h1 { font-size: 1.6rem; line-height: 1.25; margin: 0; }
  .hb-status-page-icon {
    align-items: center;
    background: color-mix(in srgb, var(--hb-accent) 12%, var(--hb-card));
    block-size: 3.25rem;
    border-radius: 50%;
    color: var(--hb-accent);
    display: inline-flex;
    inline-size: 3.25rem;
    justify-content: center;
    margin-block-end: 0.75rem;
  }
  .hb-status-page-icon .hb-icon { block-size: 1.5rem; inline-size: 1.5rem; }
  .hb-status-page-code { color: var(--hb-muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
  .hb-status-page-text { color: var(--hb-muted); }
  .hb-status-page .hb-status-page-account { align-items: center; color: var(--hb-muted); display: flex; flex-wrap: wrap; font-size: 0.875rem; gap: 0.4rem; margin-block-start: 0.5rem; }
  .hb-status-page-account .hb-text-button { font-size: inherit; padding-block: 0.1rem; }
  .hb-status-page .hb-status-page-actions { margin-block-start: 1.25rem; }
  .hb-status-page-actions a {
    background: var(--hb-accent);
    border-radius: var(--hb-radius);
    color: var(--hb-accent-fg);
    font-weight: 600;
    padding-block: 0.5rem;
    padding-inline: 1.1rem;
    text-decoration: none;
  }
  .hb-status-page-actions a:hover { filter: brightness(1.05); }

  /* Modal chrome — one implementation for every modal in the system */
  /* The one window chrome (SPEC section 7). `margin: auto` is what centers a dialog in
     the top layer — the reset above zeroes every margin, so it has to be given back here
     or the window sticks to the corner. `display` stays inside [open] so the browser can
     still hide a closed dialog. */
  /* Three widths, because one is never right for both a confirmation and a form. Each is
     capped against the viewport, so "wide" on a phone is simply "as wide as there is".
     A modal declares which it wants; `normal` is the default and needs no declaring. */
  dialog.hb-modal {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    color: var(--hb-fg);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
    inline-size: min(30rem, calc(100vw - 2rem));
    margin: auto;
    max-block-size: calc(100dvh - 3rem);
    overflow: hidden;
    padding: 0;
  }
  dialog.hb-modal[data-size="wide"] { inline-size: min(45rem, calc(100vw - 2rem)); }
  dialog.hb-modal[data-size="full"] { inline-size: min(64rem, calc(100vw - 2rem)); }
  dialog.hb-modal[open] { display: flex; flex-direction: column; }
  dialog.hb-modal[data-maximized][open] {
    /* Fullscreen is Core chrome state, not addon sizing. Addon styles live in a later
       cascade layer, so these geometry invariants are intentionally important: an
       opted-in modal must fill the viewport regardless of its normal workspace size. */
    block-size: 100dvh !important;
    border: 0;
    border-radius: 0;
    inline-size: 100vw !important;
    inset: 0 !important;
    margin: 0 !important;
    max-block-size: none !important;
    max-inline-size: none !important;
  }
  dialog.hb-modal[data-maximized][open] > .hb-modal-body { flex: 1; min-block-size: 0; }
  dialog.hb-modal::backdrop { background: rgb(0 0 0 / 35%); }
  /* The page-wide busy veil: transparent and click-absorbing at once, dimmed with a spinner only after a moment. */
  dialog.hb-busy {
    background: transparent;
    block-size: 100%;
    border: 0;
    cursor: wait;
    inline-size: 100%;
    inset: 0;
    margin: 0;
    max-block-size: none;
    max-inline-size: none;
    outline: none;
    padding: 0;
  }
  dialog.hb-busy[open] { display: grid; place-items: center; }
  dialog.hb-busy::backdrop { background: transparent; transition: background-color .15s; }
  dialog.hb-busy.is-visible::backdrop { background: rgb(0 0 0 / 20%); }
  /* The busy indicator is the Horuph mark composing: the brackets open, three letters rise between
     them, and they close. The mark stands on its own over the dimmed page and takes the theme
     accent, so a theme recolors it with its actions. */
  .hb-busy-plate {
    color: var(--hb-accent);
    display: grid;
    opacity: 0;
    place-items: center;
    transform: scale(.92);
    transition: opacity .15s, transform .2s ease;
  }
  dialog.hb-busy.is-visible .hb-busy-plate { opacity: 1; transform: none; }
  .hb-busy-mark { block-size: 2.6rem; inline-size: 2.8rem; overflow: visible; }
  .hb-busy-mark :is(use, circle) { fill: currentColor; transform-box: fill-box; transform-origin: center; }
  .hb-busy-left { animation: hb-busy-left 2.4s cubic-bezier(.5, -0.4, .3, 1.4) infinite; }
  .hb-busy-right { animation: hb-busy-right 2.4s cubic-bezier(.5, -0.4, .3, 1.4) infinite; }
  .hb-busy-mark circle { animation: hb-busy-letter 2.4s ease-in-out infinite; opacity: 0; }
  .hb-busy-mark circle:nth-of-type(2) { animation-delay: .12s; }
  .hb-busy-mark circle:nth-of-type(3) { animation-delay: .24s; }
  /* Physical X on purpose: the mark is a picture, not text, and reads the same in RTL. */
  @keyframes hb-busy-left {
    0%, 8% { transform: translateX(0); }
    24%, 76% { transform: translateX(-120px); }
    92%, 100% { transform: translateX(0); }
  }
  @keyframes hb-busy-right {
    0%, 8% { transform: translateX(0); }
    24%, 76% { transform: translateX(120px); }
    92%, 100% { transform: translateX(0); }
  }
  @keyframes hb-busy-letter {
    0%, 24% { opacity: 0; transform: translateY(0) scale(.4); }
    32% { opacity: 1; transform: translateY(-34px) scale(1); }
    40%, 56%, 72% { transform: translateY(0) scale(1); }
    48%, 64% { transform: translateY(-34px) scale(1); }
    72% { opacity: 1; }
    80%, 100% { opacity: 0; transform: translateY(0) scale(.4); }
  }
  /* Reduced motion: the brackets stay open and still; the letters only fade in turn. */
  @keyframes hb-busy-letter-calm { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) {
    .hb-busy-left { animation: none; transform: translateX(-120px); }
    .hb-busy-right { animation: none; transform: translateX(120px); }
    .hb-busy-mark circle { animation: hb-busy-letter-calm 1.6s ease-in-out infinite; transform: none; }
    .hb-busy-mark circle:nth-of-type(2) { animation-delay: .25s; }
    .hb-busy-mark circle:nth-of-type(3) { animation-delay: .5s; }
    .hb-busy-plate { transition: opacity .15s; transform: none; }
  }
  /* A local wait (`data-fetch-local`): the submit button keeps its box and a spinner replaces its label, so the layout around it never moves. */
  form[data-fetch-local][aria-busy="true"] button[type="submit"] {
    -webkit-text-fill-color: transparent;
    cursor: progress;
    opacity: 1;
    position: relative;
  }
  form[data-fetch-local][aria-busy="true"] button[type="submit"] > * { visibility: hidden; }
  form[data-fetch-local][aria-busy="true"] button[type="submit"]::before {
    animation: hb-local-busy .8s linear infinite;
    block-size: 1em;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    box-sizing: border-box;
    content: "";
    inline-size: 1em;
    inset: 0;
    margin: auto;
    position: absolute;
  }
  @keyframes hb-local-busy { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) {
    form[data-fetch-local][aria-busy="true"] button[type="submit"]::before { animation-duration: 2.4s; }
  }
  .hb-modal-head {
    align-items: center;
    border-block-end: 1px solid var(--hb-border);
    cursor: grab;
    display: flex;
    flex: none;
    gap: var(--hb-space);
    padding-block: 0.5rem;
    padding-inline: calc(var(--hb-space) * 1.25);
    touch-action: none;
    user-select: none;
  }
  .hb-modal-head:active { cursor: grabbing; }
  .hb-modal-title { font-weight: 700; }
  .hb-modal-controls { align-items: center; display: flex; gap: .15rem; margin-inline-start: auto; }
  .hb-modal-close,
  .hb-modal-tool,
  .hb-modal-maximize {
    background: none;
    color: var(--hb-fg);
    padding: 0.15rem 0.35rem;
  }
  .hb-modal-close:hover,
  .hb-modal-tool:hover,
  .hb-modal-maximize:hover { background: var(--hb-bg); }
  .hb-modal-maximize .hb-modal-restore-icon { display: none; }
  dialog.hb-modal[data-maximized] .hb-modal-maximize .hb-modal-maximize-icon { display: none; }
  dialog.hb-modal[data-maximized] .hb-modal-maximize .hb-modal-restore-icon { display: inline-flex; }
  /* The body is what scrolls, so a tall modal never grows past the screen. */
  .hb-modal-body { overflow-y: auto; padding: calc(var(--hb-space) * 1.25); }
  .hb-modal-footer { align-items: center; border-block-start: 1px solid var(--hb-border); display: flex; flex: none; flex-wrap: wrap; gap: .5rem; padding: .75rem calc(var(--hb-space) * 1.25); }
  /* Secondary actions (delete, archive) sit at the start; the main action always ends the footer. */
  .hb-modal-footer-secondary, .hb-modal-footer-primary { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; }
  .hb-modal-footer-primary { margin-inline-start: auto; }
  /* Only the primary is filled: a footer's other actions never compete with it. Destructive ones stay red. */
  .hb-modal-footer-secondary button:not(.hb-danger-button, .hb-text-button) { background: transparent; border: 1px solid var(--hb-border); color: var(--hb-fg); }
  .hb-modal-footer-secondary button:not(.hb-danger-button, .hb-text-button):hover { background: color-mix(in srgb, var(--hb-fg) 6%, transparent); filter: none; }
  /* The same holds in every modal body: a plain button there (a lookup's Add, a task card's submit) is outline, so
     only a footer primary is ever filled. :where() keeps this at a bare button's weight, so every component's own
     button style still wins. */
  :where(:is(dialog.hb-modal, .hb-dock) .hb-modal-body) button:where(:not([class])) { background: transparent; border: 1px solid var(--hb-border); color: var(--hb-fg); }
  :where(:is(dialog.hb-modal, .hb-dock) .hb-modal-body) button:where(:not([class])):hover:not(:disabled) { background: color-mix(in srgb, var(--hb-fg) 6%, transparent); filter: none; }
  .hb-toast {
    background: var(--hb-fg);
    border: 0;
    border-radius: var(--hb-radius);
    color: var(--hb-bg);
    inline-size: fit-content;
    inset: auto 0 var(--hb-space);
    margin: 0 auto;
    padding-block: 0.5rem;
    padding-inline: 1rem;
    position: fixed;
  }
}

@layer components {
  /* Core lookup: one accessible combobox for embedded and Query-backed option sources. */
  .hb-lookup-control { min-inline-size: 0; }
  .hb-lookup-options {
    position: fixed;
    inset: auto;
    z-index: 1;
    max-inline-size: calc(100vw - 1rem);
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: .3rem;
    background: var(--hb-card);
    box-shadow: var(--hb-shadow);
    color: var(--hb-fg);
  }
  .hb-lookup-options[data-horuph-lookup-fallback-open] { display: block; }
  /* Scoped to its popup so the compact admin button rule never shrinks an option's padding or text. */
  .hb-lookup-options .hb-lookup-option {
    display: grid;
    gap: .1rem;
    inline-size: 100%;
    border: 0;
    border-inline-start: 3px solid transparent;
    border-radius: calc(var(--hb-radius) - 2px);
    padding: .55rem .65rem;
    background: transparent;
    color: inherit;
    font-weight: 400;
    text-align: start;
  }
  .hb-lookup-option:hover,
  .hb-lookup-option.is-active { background: color-mix(in srgb, var(--hb-accent) 10%, transparent); filter: none; }
  .hb-lookup-option[aria-selected="true"] { border-inline-start-color: var(--hb-accent); font-weight: 600; }
  .hb-lookup-option-label { min-inline-size: 0; overflow-wrap: anywhere; }
  .hb-lookup-option-meta { color: var(--hb-muted); font-size: .82rem; font-weight: 400; }
  .hb-lookup-state { padding: .65rem .75rem; color: var(--hb-muted); }
  .hb-lookup-state-error { color: var(--hb-danger); }
}

@layer components {
  /* Core choice tree. A child row is indented by one disclosure button and a leaf leaves room for the
     button it does not have, so every checkbox of one level lines up. */
  .hb-choice-tree-panel { display: grid; gap: .75rem; }
  .hb-choice-tree-heading h2 { font-size: 1rem; margin: 0; }
  .hb-choice-tree-heading p { margin: .2rem 0 0; }
  .hb-choice-tree-presets { display: grid; gap: .35rem; }
  .hb-choice-tree-presets h3 { font-size: .9rem; margin: 0; }
  .hb-choice-tree-presets p { margin: 0; }
  .hb-choice-tree-toolbar { justify-content: flex-end; }
  .hb-choice-tree-toolbar .hb-data-list-search { inline-size: 14rem; min-inline-size: 10rem; }
  .hb-choice-tree { --hb-choice-tree-step: 1.75rem; border: 1px solid var(--hb-border); border-radius: var(--hb-radius); padding: .35rem .5rem; }
  .hb-choice-tree-list { list-style: none; margin: 0; padding: 0; }
  .hb-choice-tree-list .hb-choice-tree-list { padding-inline-start: var(--hb-choice-tree-step); }
  .hb-choice-tree-row,
  .hb-choice-tree-leaf > .hb-choice { align-items: center; border-radius: var(--hb-radius); display: flex; gap: .35rem; min-block-size: 2.1rem; padding-inline: .25rem; }
  .hb-choice-tree-row:hover,
  .hb-choice-tree-leaf > .hb-choice:hover { background: color-mix(in srgb, var(--hb-accent) 6%, transparent); }
  .hb-choice-tree-all { border-block-end: 1px solid var(--hb-border); border-end-end-radius: 0; border-end-start-radius: 0; font-weight: 600; margin-block-end: .25rem; }
  .hb-choice-tree-node > .hb-choice-tree-row > .hb-choice { font-weight: 600; }
  .hb-choice-tree-leaf > .hb-choice { padding-inline-start: calc(var(--hb-choice-tree-step) + .25rem); }
  .hb-choice-tree-row > .hb-choice,
  .hb-choice-tree-leaf > .hb-choice { cursor: pointer; min-inline-size: 0; }
  .hb-choice-tree-leaf code { color: var(--hb-muted); font-size: .75rem; margin-inline-start: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hb-choice-tree-expand { block-size: 1.6rem; color: var(--hb-muted); flex: none; inline-size: 1.6rem; justify-content: center; }
  .hb-choice-tree-expand .hb-icon { transition: transform .15s; }
  html[dir="rtl"] .hb-choice-tree-expand .hb-icon { transform: scaleX(-1); }
  html .hb-choice-tree-expand[aria-expanded="true"] .hb-icon { transform: rotate(90deg); }
  .hb-choice-tree-count { color: var(--hb-muted); flex: none; font-size: .8rem; font-variant-numeric: tabular-nums; font-weight: 400; margin-inline-start: auto; }
}

@layer components {
  /* Core date picker: progressive enhancement around native date/datetime-local controls. */
  .hb-temporal-editor { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: .25rem; }
  .hb-date-field {
    align-items: center;
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    display: flex;
    flex: 1 1 12rem;
    gap: .25rem;
    min-block-size: calc(1lh + 1rem + 2px);
    min-inline-size: 0;
    padding-inline: .25rem;
  }
  .hb-date-field:hover { border-color: color-mix(in srgb, var(--hb-fg) 30%, var(--hb-border)); }
  .hb-date-field:has(.hb-date-segment:focus-visible) { outline: 2px solid var(--hb-accent); outline-offset: 1px; }
  .hb-date-field.is-invalid { border-color: var(--hb-danger); box-shadow: 0 0 0 1px var(--hb-danger); }
  .hb-date-picker-open {
    align-items: center;
    background: transparent;
    color: var(--hb-muted);
    display: flex;
    flex: none;
    font-weight: 400;
    gap: .5rem;
    padding: .3rem .45rem;
    text-align: start;
  }
  .hb-date-picker-open:hover { background: color-mix(in srgb, var(--hb-border) 55%, transparent); color: var(--hb-fg); filter: none; }
  /* Calendars without numbered fields show the chosen date inside the button instead of segments. */
  .hb-date-picker-open:has(> span) { color: var(--hb-fg); flex: 1 1 auto; min-inline-size: 0; }
  .hb-date-picker-open:has(> span) .hb-icon, .hb-date-picker-open.is-empty { color: var(--hb-muted); }
  .hb-date-field-label { color: var(--hb-muted); white-space: nowrap; }
  .hb-date-segments { align-items: center; display: flex; flex: 1 1 auto; min-inline-size: 0; unicode-bidi: isolate; }
  .hb-date-field .hb-date-segments input.hb-date-segment {
    background: transparent;
    border: 0;
    border-radius: .25rem;
    display: inline-block;
    field-sizing: content;
    font-variant-numeric: tabular-nums;
    inline-size: auto;
    margin: 0;
    min-block-size: 0;
    min-inline-size: 2ch;
    padding: .1rem .15rem;
    text-align: center;
  }
  .hb-date-field .hb-date-segments input.hb-date-segment-year { min-inline-size: 4ch; }
  .hb-date-segment::placeholder { color: var(--hb-muted); }
  .hb-date-field .hb-date-segments input.hb-date-segment:focus { background: color-mix(in srgb, var(--hb-accent) 18%, transparent); outline: none; }
  .hb-date-separator { color: var(--hb-muted); }
  .hb-date-field-clear {
    background: transparent;
    block-size: 1.75rem;
    color: var(--hb-muted);
    display: grid;
    flex: none;
    inline-size: 1.75rem;
    margin-inline-start: auto;
    padding: 0;
    place-items: center;
  }
  .hb-date-field-clear:hover { background: color-mix(in srgb, var(--hb-border) 55%, transparent); color: var(--hb-fg); filter: none; }
  .hb-date-field-clear[hidden] { display: none; }
  .hb-temporal-time { inline-size: auto; margin-block-start: 0; min-inline-size: 8rem; }
  /* Centred over a dimmed page; in a list toolbar it opens under its field instead, except on a
     phone or in a browser without anchor positioning. */
  .hb-date-picker[popover] {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: .75rem;
    box-shadow: var(--hb-shadow);
    color: var(--hb-fg);
    inline-size: min(26rem, calc(100vw - 2rem));
    margin: auto;
    max-block-size: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1rem;
  }
  .hb-date-picker[popover]::backdrop { background: rgb(0 0 0 / .35); }
  @supports (position-anchor: --hb-date-picker) {
    @media (min-width: 42rem) {
      .hb-data-list-toolbar .hb-date-picker[popover] {
        inline-size: min(22rem, calc(100vw - 2rem));
        inset: auto;
        inset-block-start: anchor(end);
        inset-inline-start: anchor(start);
        margin: .25rem 0 0;
        position: fixed;
        position-try-fallbacks: flip-block, flip-inline;
      }
      .hb-data-list-toolbar .hb-date-picker[popover]::backdrop { background: transparent; }
    }
  }
  .hb-date-picker-toolbar, .hb-date-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
  .hb-date-picker-weekdays, .hb-date-picker-days { display: grid; grid-template-columns: repeat(7, minmax(2rem, 1fr)); gap: .25rem; text-align: center; }
  .hb-date-picker-weekdays { margin-block: .75rem .35rem; font-size: .8rem; color: var(--hb-muted); }
  .hb-date-picker-day { min-height: 2.25rem; border: 0; border-radius: .4rem; background: transparent; color: inherit; cursor: pointer; }
  .hb-date-picker-day.is-today { background: color-mix(in srgb, var(--hb-accent) 10%, transparent); color: var(--hb-accent); font-weight: 600; }
  .hb-date-picker-day:hover, .hb-date-picker-day:focus-visible { background: color-mix(in srgb, var(--hb-border) 55%, transparent); }
  .hb-date-picker-day.is-selected { outline: 2px solid currentColor; outline-offset: -2px; }
  .hb-date-picker-footer { margin-block-start: .75rem; }
}

@layer components {
  /* DataList: one collection chrome for core and addons. Storage/query semantics stay
     server-side; this layer only lays out its toolbar, table viewport and pagination. */
  .hb-data-list { display: grid; gap: .75rem; min-inline-size: 0; }
  /* A titled list keeps its toolbar on the title row: the title gives way with an ellipsis, never by
     wrapping. Only a phone puts the toolbar under the title. The chips always take a row of their own. */
  .hb-data-list-head { align-items: center; column-gap: 1rem; display: grid; grid-template-columns: minmax(0, max-content) minmax(10rem, 1fr); min-inline-size: 0; row-gap: .6rem; }
  .hb-data-list-title { margin: 0; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hb-data-list-head > .hb-data-list-chips { grid-column: 1 / -1; }
  /* A list with actions keeps them at the toolbar's start, so its title takes the row above instead of sitting beside a button. */
  .hb-data-list-head:has(> .hb-data-list-toolbar > .hb-data-list-actions) { grid-template-columns: minmax(0, 1fr); }
  @media (max-width: 42rem) {
    .hb-data-list-head { grid-template-columns: minmax(0, 1fr); }
  }
  .hb-data-list-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
  }
  /* DataList-local toolbar and pagination are always normal-flow content. Keeping them
     non-sticky avoids competing chrome and makes embedded/full-tab collections behave alike. */
  .hb-data-list-actions { align-items: center; display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: .5rem; min-inline-size: 0; }
  /* The view switch is one segmented control of icon-only links; each link carries its label as aria-label and title. */
  .hb-data-list-views { align-items: center; border: 1px solid var(--hb-border); border-radius: var(--hb-radius); display: inline-flex; flex: none; gap: .15rem; padding: .15rem; }
  .hb-data-list-view { align-items: center; block-size: 1.7rem; border-radius: max(0px, calc(var(--hb-radius) - .15rem)); color: var(--hb-muted); display: inline-flex; inline-size: 1.9rem; justify-content: center; text-decoration: none; }
  .hb-data-list-view:hover { color: var(--hb-fg); text-decoration: none; }
  .hb-data-list-view.is-current { background: color-mix(in srgb, var(--hb-border) 55%, transparent); color: var(--hb-fg); }
  .hb-data-list-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
  .hb-data-list-grid-item { min-inline-size: 0; }
  .hb-data-list-grid-actions { display: flex; gap: .3rem; justify-content: flex-end; padding-block-start: .35rem; }
  .hb-data-list-spacer { flex: 1 1 1rem; min-inline-size: 0; }
  .hb-data-list-controls { align-items: center; display: flex; flex: 1 1 24rem; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; max-inline-size: 100%; min-inline-size: 0; position: relative; }
  .hb-data-list-filters { align-items: center; display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; min-inline-size: 0; }
  /* DataList toolbars are compact controls, regardless of whether an action came from a
     plain button, an inline POST form, or a GET search/filter control. A lookup's floating
     option list is not toolbar chrome: its options keep their full-row hit area. */
  .hb-data-list-toolbar :is(button, input:not([type="checkbox"], [type="radio"], [type="hidden"]), select):where(:not(.hb-lookup-options *)) {
    font-size: .85rem;
    inline-size: auto;
    margin: 0;
    min-block-size: 2rem;
    padding-block: .25rem;
    padding-inline: .7rem;
  }
  .hb-data-list-control { flex: 0 1 9rem; max-inline-size: 10rem; min-inline-size: 5.5rem; }
  /* A filter select is as wide as its chosen value (its longest choice where field-sizing is unsupported), up to a bound, so it never truncates it. */
  select.hb-data-list-control { field-sizing: content; flex: 0 1 auto; max-inline-size: 16rem; }
  /* dataListSelect: one bordered box whose label sits inside it, so the options carry only their own words. */
  .hb-data-list-select {
    align-items: center;
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    cursor: pointer;
    display: inline-flex;
    flex: 0 1 auto;
    font-size: .85rem;
    font-weight: 400;
    margin: 0;
    min-inline-size: 0;
    padding-inline-start: .7rem;
  }
  .hb-data-list-select:has(select:focus-visible) { outline: 2px solid var(--hb-accent); outline-offset: 1px; }
  .hb-data-list-select-label { color: var(--hb-muted); cursor: pointer; flex: none; white-space: nowrap; }
  .hb-data-list-select-label::after { content: ":"; }
  /* The native option list takes the select's own colours, so the select keeps the card background rather than going transparent. */
  .hb-data-list-toolbar .hb-data-list-select > select {
    /* Drop the OS arrow everywhere; the label draws one chevron that can flip (Firefox included). */
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--hb-card);
    border: 0;
    cursor: pointer;
    flex: 1 1 auto;
    min-block-size: calc(2rem - 2px);
    min-inline-size: 0;
    accent-color: var(--hb-accent);
    outline: none;
    padding-inline-end: 0;
    padding-inline-start: .35rem;
  }
  /* Drawn on the label so the full V is outside the select's clip box. Flips with :open, or with
     data-open when the select fires toggle (customizable select) and :open is missing. */
  .hb-data-list-select::after {
    background-color: currentColor;
    block-size: .75rem;
    content: "";
    flex: none;
    inline-size: .75rem;
    margin-inline: .15rem .65rem;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    pointer-events: none;
    transform: none;
    transition: none;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
  }
  .hb-data-list-select:is(:has(> select:open), [data-open])::after { transform: rotate(180deg); transition: none; }
  /* Where the browser lets a select style its own list, the list opens as the same card as the multi-select
     menu, with the chosen and hovered rows marked in the accent colour rather than the system highlight. */
  @supports (appearance: base-select) {
    .hb-data-list-select > select, .hb-data-list-select > select::picker(select) { appearance: base-select; }
    .hb-data-list-toolbar .hb-data-list-select > select {
      align-items: center;
      display: inline-flex;
      gap: .55rem;
    }
    .hb-data-list-select > select::picker-icon { display: none; }
    .hb-data-list-select > select::picker(select) {
      background: var(--hb-card);
      border: 1px solid var(--hb-border);
      border-radius: var(--hb-radius);
      box-shadow: var(--hb-shadow);
      color: var(--hb-fg);
      margin-block: .3rem;
      max-block-size: min(22rem, 60vh);
      padding: .3rem;
    }
    .hb-data-list-select > select option { border-radius: calc(var(--hb-radius) - 3px); gap: .5rem; padding: .4rem .6rem; }
    .hb-data-list-select > select option:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--hb-accent) 14%, transparent); outline: none; }
    .hb-data-list-select > select option:checked { background: color-mix(in srgb, var(--hb-accent) 24%, transparent); font-weight: 600; }
    .hb-data-list-select > select option::checkmark { display: none; }
    .hb-data-list-select > select optgroup legend { color: var(--hb-muted); font-size: .75rem; padding: .45rem .6rem .2rem; }
  }
  .hb-data-list-multiselect { flex: 0 1 auto; position: relative; }
  /* The menu trigger looks like the filter selects beside it: the same field box and a drawn chevron. */
  .hb-data-list-multiselect > summary {
    align-items: center;
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    box-sizing: border-box;
    cursor: pointer;
    display: inline-flex;
    font-size: .85rem;
    gap: .55rem;
    list-style: none;
    max-inline-size: 16rem;
    min-block-size: 2rem;
    padding-block: .25rem;
    padding-inline: .7rem;
    white-space: nowrap;
  }
  .hb-data-list-multiselect > summary::-webkit-details-marker { display: none; }
  .hb-data-list-multiselect > summary::after {
    background-color: currentColor;
    block-size: .75rem;
    content: "";
    flex: none;
    inline-size: .75rem;
    margin-inline-start: auto;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    transform: none;
    transition: none;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
  }
  .hb-data-list-multiselect[open] > summary::after { transform: rotate(180deg); transition: none; }
  .hb-data-list-multiselect > summary:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 1px; }
  .hb-data-list-multiselect-menu {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
    display: grid;
    gap: .15rem;
    inset-block-start: calc(100% + .3rem);
    inset-inline-end: 0;
    max-block-size: min(22rem, 60vh);
    min-inline-size: 12rem;
    overflow: auto;
    padding: .4rem;
    position: absolute;
    z-index: 30;
  }
  .hb-data-list-multiselect-menu > input.hb-data-list-control { margin-block-end: .25rem; max-inline-size: none; }
  .hb-data-list-multiselect-menu label { align-items: center; display: flex; gap: .5rem; padding: .3rem .4rem; white-space: nowrap; }
  .hb-data-list-multiselect-menu input[type="checkbox"] { margin: 0; }
  .hb-data-list-date-filter {
    align-items: center;
    color: var(--hb-muted);
    display: inline-flex;
    flex: 0 1 auto;
    font-size: .875rem;
    gap: .4rem;
    min-inline-size: 0;
    white-space: nowrap;
  }
  /* Once the Core date control mounts, the filter's label moves inside it ("From: Oct 18, 2026"). */
  .hb-data-list-date-filter:has(.hb-temporal-editor) .hb-data-list-date-label { display: none; }
  .hb-data-list-date-filter .hb-temporal-editor { margin: 0; }
  .hb-data-list-toolbar .hb-date-field { flex: 0 1 auto; font-size: .85rem; min-block-size: 2rem; }
  .hb-data-list-toolbar .hb-date-field button.hb-date-picker-open { min-block-size: 0; padding: .2rem .4rem; white-space: nowrap; }
  .hb-data-list-toolbar .hb-date-field button.hb-date-field-clear { block-size: 1.5rem; inline-size: 1.5rem; min-block-size: 0; padding: 0; }
  .hb-data-list-search { flex: 1 1 12rem; max-inline-size: 18rem; min-inline-size: 7rem; }
  /* A lookup among toolbar controls is one compact field that takes the row's free width: its label stays only as the accessible name, so its placeholder names what it searches. */
  .hb-data-list-controls > [data-horuph-lookup] { flex: 1 1 12rem; margin: 0; min-inline-size: 9rem; }
  .hb-data-list-controls > [data-horuph-lookup] > label { block-size: 1px; clip-path: inset(50%); inline-size: 1px; overflow: hidden; position: absolute; white-space: nowrap; }
  .hb-data-list-controls > [data-horuph-lookup] input[type="search"] { inline-size: 100%; }
  .hb-data-list-controls > button { flex: none; white-space: nowrap; }
  .hb-data-list-apply { flex: none; }
  .hb-data-list-clear { align-self: center; font-size: .85rem; white-space: nowrap; }
  /* Clear filters and the sort direction are icon-only toolbar controls with the footprint of a field. */
  .hb-data-list-toolbar :is(.hb-data-list-clear, .hb-data-list-direction) {
    align-items: center;
    block-size: 2rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    color: inherit;
    display: inline-flex;
    flex: none;
    inline-size: 2rem;
    justify-content: center;
    text-decoration: none;
  }
  .hb-data-list-toolbar :is(.hb-data-list-clear, .hb-data-list-direction):hover { background: color-mix(in srgb, var(--hb-fg) 6%, transparent); text-decoration: none; }
  /* The Filters toggle exists only while the script folds the filters into their panel. */
  .hb-data-list-toolbar .hb-data-list-filters-toggle { background: var(--hb-card); border: 1px solid var(--hb-border); color: var(--hb-fg); display: none; flex: none; white-space: nowrap; }
  .hb-data-list-filters-count { background: var(--hb-accent); border-radius: .6rem; color: var(--hb-accent-fg); font-size: .72rem; font-weight: 700; line-height: 1.15rem; min-inline-size: 1.15rem; padding-inline: .3rem; text-align: center; }
  .hb-data-list-chips { display: none; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
  .hb-data-list-chip {
    align-items: center;
    background: color-mix(in srgb, var(--hb-accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--hb-accent) 30%, transparent);
    border-radius: .9rem;
    color: var(--hb-fg);
    display: inline-flex;
    font-size: .8rem;
    gap: .35rem;
    padding-block: .2rem;
    padding-inline: .65rem .45rem;
    text-decoration: none;
  }
  .hb-data-list-chip:hover { border-color: var(--hb-accent); text-decoration: none; }
  .hb-data-list-chip .hb-icon { color: var(--hb-muted); }

  /* With the DataList script the toolbar is fitted (data-fit): one row whose controls shrink to their
     minimums, then the filters fold into the Filters panel (data-fold-filters), then the action buttons
     drop their labels (data-fold-labels), and only then the controls take a row of their own (stacked). */
  .hb-data-list-toolbar[data-fit="row"],
  .hb-data-list-toolbar[data-fit="row"] :is(.hb-data-list-actions, .hb-data-list-controls) { flex-wrap: nowrap; }
  .hb-data-list-toolbar[data-fit="row"] .hb-data-list-controls { flex: 0 1 auto; justify-content: flex-start; }
  .hb-data-list-toolbar[data-fit="row"] .hb-data-list-controls:has(> [data-horuph-lookup]) { flex: 1 1 auto; }
  /* Unfolded filters are plain controls of the row; a nested flex box would misreport its own width. */
  .hb-data-list-toolbar[data-fit]:not([data-fold-filters]) .hb-data-list-filters { display: contents; }
  .hb-data-list-toolbar[data-fit] .hb-data-list-actions > * { flex: none; white-space: nowrap; }
  /* A select is already as wide as its chosen label; shrinking it would clip that label, so the search gives way first. */
  .hb-data-list-toolbar[data-fit] select.hb-data-list-control, .hb-data-list-toolbar[data-fit] .hb-data-list-select { flex-shrink: 0; min-inline-size: auto; }
  .hb-data-list-toolbar[data-fit] .hb-data-list-search { min-inline-size: 8rem; }
  .hb-data-list-toolbar[data-fold-filters] .hb-data-list-filters-toggle { display: inline-flex; }
  .hb-data-list-toolbar[data-fold-filters] .hb-data-list-filters {
    align-items: stretch;
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    inset-block-start: calc(100% + .35rem);
    inset-inline-end: 0;
    max-inline-size: min(24rem, 92vw);
    min-inline-size: min(18rem, 92vw);
    padding: .6rem;
    position: absolute;
    z-index: 30;
  }
  .hb-data-list-toolbar[data-fold-filters] .hb-data-list-filters[data-open] { display: flex; }
  .hb-data-list-toolbar[data-fold-filters] .hb-data-list-filters > * { flex: none; }
  .hb-data-list-toolbar[data-fold-filters] .hb-data-list-filters :is(.hb-data-list-control, .hb-data-list-select, .hb-data-list-multiselect, .hb-data-list-multiselect > summary) { inline-size: 100%; max-inline-size: none; }
  .hb-data-list-toolbar[data-fold-filters] .hb-data-list-date-filter { justify-content: space-between; }
  .hb-data-list-toolbar[data-fold-filters] .hb-data-list-date-filter :is([data-horuph-input], .hb-temporal-editor, .hb-date-field) { flex: 1 1 auto; inline-size: 100%; }
  .hb-data-list-toolbar[data-fold-filters] .hb-data-list-multiselect-menu { box-shadow: none; margin-block-start: .3rem; position: static; }
  .hb-data-list-toolbar[data-fold-filters] + .hb-data-list-chips { display: flex; }
  /* Folding a label keeps it as the accessible name; the script adds it as the title too. */
  .hb-data-list-toolbar[data-fold-labels] .hb-data-list-actions :is(a, button, summary):has(.hb-icon) { font-size: 0; gap: 0; padding-inline: .55rem; }
  .hb-data-list-toolbar[data-fold-labels] .hb-data-list-actions :is(a, button, summary):has(.hb-icon) .hb-icon { block-size: 1rem; inline-size: 1rem; }
  .hb-data-list-toolbar[data-fold-labels] .hb-data-list-filters-toggle > span:not(.hb-data-list-filters-count) { block-size: 1px; clip-path: inset(50%); inline-size: 1px; overflow: hidden; position: absolute; white-space: nowrap; }
  .hb-data-list-toolbar[data-fit="stacked"] .hb-data-list-controls { flex: 1 1 100%; justify-content: flex-start; }
  .hb-data-list-toolbar[data-fit="stacked"] .hb-data-list-search { flex: 1 1 100%; max-inline-size: none; order: -1; }
  .hb-table-scroll {
    inline-size: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
  .hb-table-scroll:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 2px; }
  .hb-data-list-column-fit { inline-size: 1%; white-space: nowrap; }
  .hb-data-list-row-actions-column { text-align: end; }
  .hb-data-list-switch-column { text-align: center; }
  .hb-data-list-switch-column > .hb-row-action-form { vertical-align: middle; }
  /* A DataList is cards, never a table to scroll sideways: the DataList script sets data-cards while
     the list's own width is 40rem or less or its table cannot fit. A row's card leads with its title, badge-only and unlabelled cells, then its row actions; every other cell follows as
     a label and value pair. */
  .hb-table-scroll[data-cards] {
    .hb-data-list-table, .hb-data-list-table tbody { display: block; }
    .hb-data-list-table thead { display: none; }
    .hb-data-list-table tbody { display: grid; gap: .6rem; }
    .hb-data-list-table tr {
      align-items: center;
      background: var(--hb-card);
      border: 1px solid var(--hb-border);
      border-radius: var(--hb-radius);
      display: flex;
      flex-wrap: wrap;
      gap: .4rem .6rem;
      padding: .7rem .8rem;
    }
    .hb-data-list-table td { border: 0; inline-size: auto; min-inline-size: 0; padding: 0; white-space: normal; }
    .hb-data-list-table td.hb-data-list-card-title { flex: 1 1 8rem; font-weight: 600; order: 1; overflow-wrap: anywhere; }
    .hb-data-list-table td .hb-identity-text > * { min-inline-size: 0; }
    .hb-data-list-table td:not([data-label], .hb-data-list-card-title, .hb-data-list-row-actions-column),
    .hb-data-list-table td[data-label]:has(> .hb-badge:only-child) { display: block; flex: none; order: 2; }
    .hb-data-list-table td[data-label]:has(> .hb-badge:only-child)::before { content: none; }
    .hb-data-list-table td.hb-data-list-row-actions-column { flex: none; margin-inline-start: auto; order: 3; }
    .hb-data-list-table td[data-label] {
      column-gap: .75rem;
      display: grid;
      flex: 1 1 100%;
      grid-template-columns: minmax(5.5rem, 35%) minmax(0, 1fr);
      order: 4;
      overflow-wrap: anywhere;
    }
    .hb-data-list-table td[data-label]::before { color: var(--hb-muted); content: attr(data-label); font-size: .85rem; }
    .hb-data-list-table td[data-label] > * { min-inline-size: 0; }
    .hb-data-list-table td[data-label] > :is(a, button, code, span) { justify-self: start; }
    .hb-data-list-table td.hb-data-list-switch-column { text-align: start; }
    .hb-data-list-table td.hb-data-list-switch-column > form { justify-self: start; }
    .hb-data-list-table td pre { overflow-wrap: anywhere; white-space: pre-wrap; }
  }
  .hb-row-actions {
    align-items: center;
    display: flex;
    gap: .3rem;
    justify-content: flex-end;
    min-inline-size: max-content;
  }
  .hb-row-action-form { display: inline-flex; margin: 0; }
  button.hb-row-switch {
    align-items: center;
    background: color-mix(in srgb, var(--hb-muted) 35%, transparent);
    border: 1px solid var(--hb-border);
    border-radius: 999px;
    block-size: 1.55rem;
    cursor: pointer;
    display: inline-flex;
    inline-size: 2.75rem;
    margin: 0;
    padding: .14rem;
    transition: background-color .12s ease, border-color .12s ease;
  }
  button.hb-row-switch:hover { border-color: var(--hb-accent); filter: none; }
  button.hb-row-switch:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 2px; }
  button.hb-row-switch[aria-checked="true"] { background: var(--hb-accent); border-color: var(--hb-accent); }
  .hb-row-switch-thumb {
    background: var(--hb-bg);
    border-radius: 50%;
    block-size: 1.1rem;
    inline-size: 1.1rem;
    transform: translateX(0);
    transition: transform .12s ease;
  }
  [dir="rtl"] .hb-row-switch-thumb { transform: translateX(0); }
  button.hb-row-switch[aria-checked="true"] .hb-row-switch-thumb { transform: translateX(1.15rem); }
  [dir="rtl"] button.hb-row-switch[aria-checked="true"] .hb-row-switch-thumb { transform: translateX(-1.15rem); }
  button.hb-row-switch.is-danger { border-color: color-mix(in srgb, var(--hb-danger) 55%, var(--hb-border)); }
  :is(a, button, summary).hb-row-action {
    align-items: center;
    background: transparent;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    color: var(--hb-fg);
    cursor: pointer;
    display: inline-flex;
    font-weight: 600;
    block-size: 2rem;
    inline-size: 2rem;
    justify-content: center;
    padding: 0;
    text-decoration: none;
  }
  :is(a, button, summary).hb-row-action:hover {
    border-color: var(--hb-accent);
    color: var(--hb-accent);
    filter: none;
    text-decoration: none;
  }
  :is(a, button, summary).hb-row-action.is-danger { color: var(--hb-danger); }
  .hb-row-action-menu[popover] {
    background: var(--hb-card);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
    gap: .2rem;
    margin: auto;
    max-block-size: min(70dvh, 24rem);
    min-inline-size: 10rem;
    overflow-y: auto;
    padding: .35rem;
  }
  .hb-row-action-menu[popover]:popover-open { display: grid; }
  .hb-row-action-menu[popover]::backdrop { background: transparent; }
  @supports (position-anchor: --hb-row-action-menu) {
    .hb-row-action-menu[popover] {
      inset: auto;
      inset-block-start: anchor(end);
      inset-inline-end: anchor(end);
      margin: 0;
      position: fixed;
      position-anchor: auto;
      position-try-fallbacks: flip-block, flip-inline;
    }
  }
  @supports (position-anchor: --hb-row-action-menu) {
    .hb-row-action-menu[popover][data-menu-align="start"] { inset-inline-end: auto; inset-inline-start: anchor(start); }
  }
  .hb-data-list-more { display: flex; flex: none; }
  .hb-row-action-menu-form { display: block; }
  :is(a, button).hb-row-action-menu-item {
    block-size: auto;
    gap: .45rem;
    inline-size: 100%;
    justify-content: flex-start;
    padding-block: .35rem;
    padding-inline: .5rem;
    white-space: nowrap;
  }
  /* Install / Uninstall tabs share the same four-column visual grid. Keep the
     trailing columns stable so switching Addons/Languages does not shift the table. */
  /* Status carries the availability switch beside its label in both lists, so it needs more
     room than a status word alone. */
  [data-data-list="addons"] .hb-table-scroll:not([data-cards]) .hb-table :is(th, td):nth-child(3),
  [data-data-list="languages"] .hb-table-scroll:not([data-cards]) .hb-table :is(th, td):nth-child(3) { inline-size: 16%; }
  [data-data-list="addons"] .hb-table-scroll:not([data-cards]) .hb-table :is(th, td):nth-child(4) { inline-size: 12%; }
  .hb-sort { color: inherit; display: inline-flex; gap: .25rem; text-decoration: none; }
  .hb-sort:hover { color: var(--hb-fg); text-decoration: underline; }
  .hb-data-list-empty {
    background: color-mix(in srgb, var(--hb-card) 55%, transparent);
    border: 1.5px dashed var(--hb-border);
    border-radius: var(--hb-radius);
    justify-items: center;
    margin: 0;
    padding-block: 2.25rem;
    padding-inline: 1rem;
    text-align: center;
  }
  /* A window whose whole body is the empty state keeps the mark, without the dashed frame. */
  :is(dialog.hb-modal, .hb-dock) .hb-modal-body > .hb-data-list-empty {
    background: transparent;
    border: 0;
  }
  /* The circle and Horuph's animated mark share the first grid cell; the text flows below. */
  .hb-data-list-empty::before,
  .hb-data-list-empty::after { content: ''; grid-column: 1; grid-row: 1; }
  .hb-data-list-empty::before {
    background: var(--hb-accent-soft);
    block-size: 2.6rem;
    border-radius: 50%;
    inline-size: 2.6rem;
  }
  .hb-data-list-empty::after {
    background: var(--hb-accent-text);
    block-size: 1.3rem;
    inline-size: 1.3rem;
    mask: url('/assets/icons/horuph-animated.svg') center / contain no-repeat;
    place-self: center;
  }
  .hb-data-list-empty > p { margin: 0; max-inline-size: 46ch; }
  .hb-data-list-empty-actions { justify-content: center; }
  .hb-data-list-footer {
    align-items: center;
    color: var(--hb-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .88rem;
    gap: .75rem;
    justify-content: space-between;
  }
  .hb-data-list-pages { align-items: center; display: flex; flex-wrap: wrap; gap: .45rem; }
  .hb-data-list-page { min-inline-size: 1.75rem; text-align: center; }
  .hb-data-list-page.is-current { color: var(--hb-fg); font-weight: 700; }
  .hb-data-list-gap { padding-inline: .15rem; }

  /* Without the script (and for hand-built toolbars) a phone stacks every control in one column. */
  @media (max-width: 42rem) {
    .hb-data-list-toolbar:not([data-fit]) { align-items: stretch; flex-direction: column; }
    .hb-data-list-toolbar:not([data-fit]) .hb-data-list-actions { flex-wrap: wrap; }
    .hb-data-list-toolbar:not([data-fit]) .hb-data-list-spacer { display: none; }
    .hb-data-list-toolbar:not([data-fit]) :is(.hb-data-list-controls, .hb-data-list-filters) { align-items: stretch; flex-direction: column; inline-size: 100%; }
    .hb-data-list-toolbar:not([data-fit]) .hb-data-list-date-filter { align-items: stretch; flex-direction: column; white-space: normal; }
    /* In the stacked column a desktop flex-basis would become a height; children keep their natural block size. */
    .hb-data-list-toolbar:not([data-fit]) > *, .hb-data-list-toolbar:not([data-fit]) :is(.hb-data-list-controls, .hb-data-list-filters) > * { flex: none; }
    .hb-data-list-toolbar:not([data-fit]) :is(.hb-data-list-control, .hb-data-list-select, .hb-data-list-search, .hb-data-list-apply, [data-horuph-lookup]) { inline-size: 100%; max-inline-size: none; }
    .hb-data-list-toolbar:not([data-fit]) .hb-data-list-multiselect { inline-size: 100%; }
    .hb-data-list-toolbar:not([data-fit]) .hb-data-list-multiselect-menu { inset-inline: 0; min-inline-size: 0; }
  }
}
