/* src/kliper/adapters/web/static/css/components.css
 *
 * The 30 highest-use gh-* component families measured across the wiremocks
 * (docs/wiremock/*.html), ported onto the token vocabulary tokens.css
 * declares. Everything from gh-select down to gh-plan in the measured family
 * map — the tail below it (gh-mobile, gh-more, gh-avatar, gh-footer, ...) is
 * one-off page usage and stays in the page, per the plan's own commit
 * message.
 *
 * Wrapped in @layer components per the cascade order tokens.css declares
 * (`@layer tokens, base, components, tenant;`): an unlayered rule here would
 * outrank @layer tenant no matter what a tenant stylesheet says.
 *
 * Three corrections made while porting, all measured, none of them optional:
 *
 * 1. `.gh-btn-primary` hardcoded GitHub's green (hex 1f883d) and forced white
 *    text with a priority flag no later rule could beat. It now reads
 *    `var(--brand-primary)` / `var(--brand-on-primary)`, with that forced
 *    priority removed — with it in place no brand token could ever win the
 *    cascade, which is the token doing nothing. Round 1 of review found the
 *    same defect in a different palette: sixteen sites elsewhere in this
 *    file referenced `--kliper-navy-700`/`-100`/`-050` directly — the
 *    *default value* of `--brand-primary`/`--brand-primary-subtle`, not a
 *    neutral, so a tenant's brand override would land everywhere except
 *    those sixteen "active/selected/ours" affordances. All sixteen are
 *    remapped onto the brand scale (see each family's own FIX comment
 *    below), and this file may no longer reference `--kliper-*` at all —
 *    `test_components_css_nao_referencia_kliper_diretamente` is the gate.
 *
 * 2. The outline was nulled to hide the default focus ring in 13 places
 *    across the wiremocks (8 in kliper-github-ui-wiremock.html, 3 in the
 *    backoffice wiremock, 2 in the login wiremock). None of them is
 *    transcribed here. Every family that carried one (gh-select-account,
 *    gh-select-filter, gh-select-btn, gh-btn) has that declaration deleted
 *    outright; the global `:focus-visible` in base.css supplies the ring
 *    instead. `.gh-checkbox` also had its own focus-visible rule redrawing
 *    the same ring in hex 0969da — not a ring-killer, but a hardcoded
 *    duplicate of the same global rule with the wrong (untokenised) colour,
 *    so it is deleted rather than tokenised. The More button (the worst
 *    offender named in the brief) is in the tail and is not ported at all,
 *    so its nulled outline cannot be transcribed by omission.
 *
 * 3. The active-tab underline used hex fd8c73, which measures 2.29:1 against
 *    white — under the 3:1 SC 1.4.11 requires of a non-text indicator, with
 *    font-weight 500->600 as its only other signal. `--color-indicator-active`
 *    (tokens.css) darkens it at constant hue/saturation to hex fc4922,
 *    measured at ~3.23:1 against `--color-canvas-subtle` (hex f6f8fa), the
 *    actual `.gh-tabs-bar` background this underline sits on. It is 2px,
 *    GitHub's measured thickness (it was widened to 3px, then brought back
 *    with the rest of GitHub's UnderlineNav on 2026-09-24),
 *    and the selector adds `[aria-current="page"]` alongside the existing
 *    `.active` class — legal_base.html's `.nav-link[aria-current="page"]` is
 *    the reference for that pattern. The same failing coral drove the
 *    active-dropdown-item bar (`.gh-dropdown-item.active::before`); it gets
 *    the same corrected token since it is the same non-text "current"
 *    signal, though only the tab was asked to widen or gain aria-current.
 *
 * Two wiremock-local variables are renamed to the names tokens.css actually
 * declares, because leaving them as-is would resolve to nothing once this
 * file is the one loaded instead of the wiremock's own <style> block:
 *   var(--color-accent-fg) / var(--color-accent-emphasis) -> var(--color-link-fg)
 *   var(--color-fg-subtle)                                -> var(--color-fg-decorative)
 * Every other var(--color-*)/var(--color-canvas-*) reference the wiremocks
 * already used keeps its name unchanged — tokens.css declares the same name,
 * occasionally with a slightly different exact value, which is what a real
 * token vocabulary replacing several hand-authored ones is expected to do.
 *
 * Five wiremock defects (classes used in markup with no CSS rule) are
 * handled individually where they are ported below, not silently
 * transcribed as gaps: gh-item, gh-connector, gh-tag, gh-answer, gh-filter.
 * See the report for the reasoning on each.
 *
 * Several families are backoffice-only (gh-metric, gh-tenant, gh-channel,
 * gh-table, gh-volume, gh-status, gh-cards, gh-page) or login-only
 * (gh-state): the superadmin control plane and the shared auth portal are
 * never rendered "as" a tenant, since neither route ever loads a tenant's
 * `/{handle}/theme.css`. That means `--brand-*` can only ever resolve to its
 * bare default there — so gh-tenant, gh-state and gh-plan use `--brand-*`
 * the same as every tenant-facing family (see round 1's FIX comments): it
 * renders identically to a hardcoded Kliper navy today, stays the single
 * source of that colour instead of a second copy of it, and would move
 * correctly if either route ever did become theme-aware.
 *
 * Categorical and data-visualisation colour still reference Layer 1
 * primitives directly and are NOT part of the round-1 fix: gh-tag's five
 * category colours (radio/tv/print/web/crisis) and gh-ratio's three
 * sentiment bars are identities with no shared meaning to promote to a
 * semantic token — see tokens.css's header for the exact rule this file
 * follows.
 */
@layer components {

  /* ---- gh-select — 12 variants, kliper-github-ui-wiremock.html ---- */
  .gh-select-account {
    background: var(--color-canvas-default);
    border: 1px solid var(--color-control-border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-fg-default);
    cursor: pointer;
  }
  .gh-select-account:hover { background: var(--color-canvas-subtle); }
  .gh-select-filter {
    background: var(--color-canvas-default);
    border: 1px solid var(--color-control-border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    color: var(--color-fg-default);
    cursor: pointer;
  }
  .gh-select-menu { position: relative; display: inline-block; }
  .gh-select-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: var(--control-medium-size);
    padding: 0 var(--space-3);
    font-size: var(--text-14);
    font-weight: 500;
    line-height: 20px;
    color: var(--color-fg-default);
    /* canvas-default on the canvas-subtle header, as the wiremock draws it,
       so it reads as a button and not as a label. */
    background-color: var(--color-canvas-default);
    border: 1px solid var(--color-control-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 1px 0 color-mix(in oklab, var(--color-fg-default) 4%, transparent);
    /* GitHub's secondary button, measured 2026-09-24. */
    transition: 80ms cubic-bezier(0.65, 0, 0.35, 1);
    transition-property: color, background-color, border-color;
    white-space: nowrap;
  }
  .gh-select-btn:hover { background-color: var(--color-btn-hover); }
  /* GitHub's pressed fill, kept while the menu it opened is open. */
  .gh-select-btn:active,
  .gh-select-btn[aria-expanded="true"],
  .gh-select-btn[aria-pressed="true"] { background-color: var(--color-btn-active); }
  /* The header's organisation switcher, as GitHub's context switcher is: the icon, the
     current `@handle` and a caret. On a phone only the icon and the caret stay. */
  .gh-context-switch { gap: var(--space-1); padding: 0 var(--space-2); }
  .gh-context-switch-handle { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
  @media (max-width: 544px) { .gh-context-switch-handle { display: none; } }
  .gh-select-btn:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; }
  .gh-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 270px;
    background-color: var(--color-canvas-default);
    border: 0;
    border-radius: var(--radius-overlay);
    box-shadow: var(--shadow-overlay);
    z-index: 1050;
    padding: var(--space-2) 0;
    animation: gh-overlay-appear 200ms var(--ease-overlay);
  }
  /* GitHub's overlays fade in and do nothing else: no translate, no scale.
     base.css's prefers-reduced-motion rule switches it off. */
  @keyframes gh-overlay-appear {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .gh-select-dropdown.show { display: block; }
  .gh-select-header {
    padding: 6px var(--space-4) var(--space-2);
    margin-bottom: var(--space-2);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--color-fg-default);
    border-bottom: 1px solid var(--color-border-muted);
  }
  /* ActionList item: 32px, inset 8px from the overlay's edges. */
  .gh-select-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    min-height: 32px;
    margin: 0 var(--space-2);
    padding: 6px var(--space-2);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-fg-default);
    text-decoration: none;
  }
  .gh-select-item:hover { background-color: var(--color-action-hover); }
  .gh-select-item:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; }
  .gh-select-check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--color-fg-default);
    visibility: hidden;
  }
  .gh-select-item.selected .gh-select-check { visibility: visible; }
  /* Primer ActionList's leading visual (`ActionListItem-visual--leading`): an item's own Octicon, muted, always drawn
     (the `+ ▾` menu, the switcher's "See all"), never the check's hidden slot. */
  .gh-select-item-visual { display: inline-flex; flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; color: var(--color-fg-muted); }
  .gh-select-item[aria-disabled="true"] { cursor: not-allowed; }
  .gh-select-item[aria-disabled="true"] .gh-select-item-title { color: var(--color-fg-muted); }
  .gh-select-item[aria-disabled="true"]:hover { background-color: transparent; }
  .gh-select-item-content { flex: 1; min-width: 0; }
  .gh-select-item-title,
  .gh-select-item-desc { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gh-select-item-title { color: var(--color-fg-default); }
  .gh-select-item-desc { font-size: 12px; line-height: 16px; color: var(--color-fg-muted); }
  /* One line per organisation: a long name wrapped each row to 64px. */
  .gh-org-menu { width: min(320px, calc(100vw - 80px)); }
  /* The switcher's entries are forms (ADR 015 step (c)): a button drawn exactly as the ActionList link was. */
  .gh-select-form { margin: 0; }
  /* The wiremock draws the handle bold (a <strong>); Primer's semibold. */
  .gh-org-menu .gh-select-item-title, .gh-account-chooser .gh-select-item-title { font-weight: 600; }
  button.gh-select-item { width: calc(100% - 2 * var(--space-2)); border: 0; background: none; font-family: inherit; text-align: start; }
  /* `/` for a super admin with no active organisation: a heading and a lead over an ActionList. */
  .gh-account-chooser { max-width: 560px; margin: var(--space-6) auto; padding: 0 var(--space-4); }
  .gh-account-chooser-title { margin: 0 0 var(--space-2); font-size: var(--text-20); font-weight: 600; color: var(--color-fg-default); }
  .gh-account-chooser-lead { margin: 0 0 var(--space-4); color: var(--color-fg-muted); }
  .gh-account-chooser-list { list-style: none; margin: 0; padding: 6px; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); }
  .gh-account-chooser-list button.gh-select-item { width: 100%; margin: 0; }

  /* ---- gh-btn — 6 variants, merged from all three app wiremocks ----
     CORRECTION 1: gh-btn-primary below uses the brand tokens, no forced
     priority flag. CORRECTION 2: the base rule's and :focus-visible's
     nulled outline is dropped from both; the global :focus-visible ring
     applies instead. */
  .gh-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Primer medium: 32px, 0 12px, 14px/500, gap 8px (github.com "New issue"). */
    gap: var(--space-2);
    height: var(--control-medium-size);
    padding: 0 var(--space-3);
    font-size: var(--text-14);
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid color-mix(in oklab, var(--color-fg-default) 15%, transparent);
    border-radius: 6px;
    color: var(--color-fg-default);
    background-color: var(--color-canvas-subtle);
    box-shadow: 0 1px 0 color-mix(in oklab, var(--color-fg-default) 4%, transparent),
                inset 0 1px 0 color-mix(in oklab, var(--primer-gray-0) 25%, transparent);
    transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
    transition-property: color, background-color, box-shadow, border-color;
    font-family: inherit;
    text-decoration: none;
  }
  /* The `display` above beats the `hidden` attribute, and a page's own rules
     sit in a nested layer that cannot win it back: onboarding's "Skip for now"
     showed on every step. */
  .gh-btn[hidden] { display: none; }
  .gh-btn:hover {
    background-color: var(--color-btn-hover);
    border-color: color-mix(in oklab, var(--color-fg-default) 15%, transparent);
    text-decoration: none;
  }
  .gh-btn:active {
    background-color: var(--color-btn-active);
    box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-fg-default) 10%, transparent);
    border-color: color-mix(in oklab, var(--color-fg-default) 15%, transparent);
  }
  /* Primer Button focus: one 2px ring, only on :focus-visible. The global
     outline (base.css) plus a 3px box-shadow halo here drew two rings. The
     resting and pressed shadows are left alone. */
  .gh-btn:focus-visible {
    outline: 2px solid var(--brand-focus);
    outline-offset: -2px;
  }
  /* Primer small (28px) and large (40px). Small is for row actions and
     inline flash actions; page-level actions stay medium, as GitHub's do. */
  .gh-btn-sm { height: var(--control-small-size); padding: 0 var(--space-2); font-size: var(--text-12); line-height: 18px; gap: var(--space-1); }
  .gh-btn-lg { height: var(--control-large-size); padding: 0 var(--space-4); font-size: var(--text-14); gap: var(--space-2); }
  .gh-btn-icon { padding: 3px 6px; color: var(--color-fg-muted); }
  /* Primer's invisible button: no fill, no border, the global focus ring. */
  .gh-btn-invisible { background-color: transparent; border-color: transparent; box-shadow: none; color: var(--color-fg-muted); }
  .gh-btn-invisible:hover { background-color: var(--color-canvas-subtle); border-color: transparent; color: var(--color-fg-default); }
  .gh-btn-primary {
    color: var(--brand-on-primary);
    background-color: var(--brand-primary);
    border: 1px solid color-mix(in oklab, var(--color-fg-default) 15%, transparent);
    box-shadow: 0 1px 0 color-mix(in oklab, var(--color-fg-default) 10%, transparent),
                inset 0 1px 0 color-mix(in oklab, var(--primer-gray-0) 3%, transparent);
    /* Herda os 500 do `.gh-btn` em vez de subir para 600. O Primer usa 500 em
       todo o botão, primário incluído, e o 600 era o que fazia o texto parecer
       mais pesado e o botão maior do que o do GitHub — o mesmo defeito que já
       tinha sido corrigido no wiremock do backoffice, mas não aqui, onde
       estava a reentrar em todas as páginas. Medido no Chrome: o wiremock da
       landing calcula w500 neste botão e a produção calculava w600. */
  }
  .gh-btn-primary:hover {
    background-color: var(--brand-primary-hover);
    color: var(--brand-on-primary);
  }
  .gh-btn-primary:active {
    background-color: color-mix(in oklab, var(--brand-primary) 78%, black);
    box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-fg-default) 20%, transparent);
  }
  /* A -2px ring would be navy on navy; Primer offsets the primary's outward. */
  .gh-btn-primary:focus-visible,
  .gh-btn-danger-primary:focus-visible { outline-offset: 2px; }
  /* Primer's disabled button: muted label, no hover or press, not-allowed.
     A VIEWER's configuration page and the description gate disable buttons,
     and without this they looked, and hovered, exactly like live ones. */
  .gh-btn:disabled,
  .gh-btn:disabled:hover,
  .gh-btn:disabled:active {
    color: var(--color-fg-decorative);
    background-color: var(--color-canvas-subtle);
    border-color: color-mix(in oklab, var(--color-fg-default) 10%, transparent);
    box-shadow: none;
    cursor: not-allowed;
  }
  .gh-btn-primary:disabled,
  .gh-btn-primary:disabled:hover,
  .gh-btn-primary:disabled:active {
    color: color-mix(in oklab, var(--brand-on-primary) 80%, transparent);
    background-color: color-mix(in oklab, var(--brand-primary) 45%, var(--color-canvas-default));
    border-color: transparent;
  }
  .gh-btn-danger {
    color: var(--color-danger-fg);
    background-color: var(--color-canvas-subtle);
    border-color: color-mix(in oklab, var(--color-fg-default) 15%, transparent);
    box-shadow: 0 1px 0 color-mix(in oklab, var(--color-fg-default) 4%, transparent);
  }
  .gh-btn-danger:hover {
    color: var(--primer-gray-0);
    background-color: var(--primer-red-700);
    border-color: var(--primer-red-700);
    box-shadow: 0 1px 0 color-mix(in oklab, var(--color-fg-default) 10%, transparent);
  }

  /* ---- gh-row — 6 variants, kliper-github-ui-wiremock.html ---- */
  .gh-row { display: flex; padding: 12px 16px; border-bottom: 1px solid var(--color-border-default); gap: 12px; }
  .gh-row:last-child { border-bottom: none; }
  .gh-row:hover { background-color: var(--color-canvas-subtle); }
  .gh-row-content { flex: 1; min-width: 0; }
  .gh-row-title-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
  .gh-row-title { font-size: 14px; font-weight: 600; color: var(--color-fg-default); text-decoration: none; }
  .gh-row-title:hover { color: var(--color-link-fg); }
  .gh-row-meta { font-size: 12px; color: var(--color-fg-muted); display: flex; gap: 8px; flex-wrap: wrap; }
  /* The compact-row container is gh-row's; its inner content classes
     (gh-compact-vehicle/-title/-meta) are the separate gh-compact tail
     family and are intentionally not ported. */
  .gh-row-compact {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    gap: 12px;
    border-bottom: 1px solid var(--color-border-default);
    font-size: 13px;
    background-color: var(--color-canvas-default);
    transition: background-color 0.1s ease;
  }
  .gh-row-compact:hover { background-color: var(--color-canvas-subtle); }
  .gh-row-compact:last-child { border-bottom: none; }

  /* ---- first-steps — day-zero checklist, task 4. Rows are gh-row itself
     (.first-step carries gh-row alongside it); these two rules are only what
     gh-row lacks: an <ol> reset (it has none — a list of gh-rows would still
     draw browser markers and left padding) and the done-row treatment. ---- */
  .first-steps { list-style: none; margin: 0; padding: 0; }
  .first-step[data-done="true"] { background-color: var(--color-success-subtle); }

  /* ---- gh-row-list — the same <ol> reset as .first-steps above, generalised
     for Task 5's War Room and Dispatch panels: both fill a <ul> of gh-rows
     from JS (panels.js's loaders), which draws browser markers and left
     padding without this. ---- */
  .gh-row-list { list-style: none; margin: 0; padding: 0; }

  /* ---- gh-connector — 14 variants, kliper-landing-page-wiremock.html ----
     DEFECT: the markup uses `.gh-connector-drill-btn` (the "Ver Detalhes"
     link in every card footer); the CSS only ever defined
     `.gh-connector-inspect-trigger`, which no markup anywhere uses. Same
     role, same position (gh-connector-footer, next to gh-connector-status) —
     a rename that only touched one side. Both selectors now share the one
     rule instead of leaving the used one bare.
     FIX (round 1): every accent in this card was hardcoded to
     --kliper-navy-700/-100/-050, the *default value* of the brand tokens,
     not a neutral — a tenant setting --brand-primary would leave every
     hover, active, icon and link state in this card still Kliper navy.
     Remapped onto --brand-primary/--brand-primary-subtle; the two
     barely-tinted surfaces (a light card-active wash, a light icon-box
     border) are derived from --brand-primary with color-mix since no
     stored token exists at that exact tint. */
  /* The admin hub card's meta line (account e-mail or "optional"), beside its
     button: one line, the full text in its title. */
  .gh-connector-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-12); color: var(--color-fg-muted); }
  .gh-connector-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
  @media (max-width: 992px) { .gh-connector-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 560px) { .gh-connector-grid { grid-template-columns: 1fr; } }
  .gh-connector-card {
    background: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    padding: 20px 18px;
    text-align: left;
    position: relative;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px color-mix(in oklab, var(--color-fg-default) 4%, transparent);
    cursor: pointer;
  }
  .gh-connector-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px color-mix(in oklab, var(--brand-primary) 12%, transparent);
  }
  .gh-connector-card.active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand-primary) 20%, transparent);
    background: color-mix(in oklab, var(--brand-primary) 4%, var(--color-canvas-default));
  }
  .gh-connector-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .gh-connector-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px color-mix(in oklab, var(--color-fg-default) 4%, transparent);
    transition: border-color 0.15s ease, background-color 0.15s ease;
  }
  .gh-connector-card:hover .gh-connector-icon-box {
    border-color: var(--brand-primary);
    background: var(--brand-primary-subtle);
  }
  .gh-connector-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    color: var(--color-fg-muted);
    letter-spacing: 0.02em;
  }
  .gh-connector-title { font-weight: 600; font-size: 14px; color: var(--color-fg-default); margin-bottom: 6px; line-height: 1.3; }
  .gh-connector-desc { font-size: 12px; color: var(--color-fg-muted); line-height: 1.45; margin-bottom: 12px; flex: 1; }
  .gh-connector-meta-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
    color: var(--color-fg-muted);
    background: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-muted);
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
  }
  .gh-connector-meta-row { display: flex; justify-content: space-between; align-items: center; }
  .gh-connector-meta-row strong { color: var(--color-fg-default); font-weight: 500; }
  .gh-connector-footer {
    border-top: 1px solid var(--color-border-muted);
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-fg-decorative);
  }
  .gh-connector-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; color: var(--color-success-fg); }
  .gh-connector-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background-color: var(--color-success-fg); }
  /* Review round 1, finding 3: the base rule above is the "connected" look;
     "Not connected" (rendered on every card that isn't .active) was inheriting
     the same success green, colour alone claiming a state that was false. */
  .gh-connector-card:not(.active) .gh-connector-status { color: var(--color-fg-muted); }
  .gh-connector-card:not(.active) .gh-connector-status::before { background-color: var(--color-fg-muted); }
  /* Review round 1, finding 2: a rejected connect/disconnect fetch (a network
     error, not an HTTP status) is announced here — role="alert" on the
     element itself, not only a relabelled button, which a screen reader
     never associates with the action that just failed. Empty when nothing
     has failed, so it renders nothing and takes no space. */
  .gh-connector-error { margin-top: 6px; font-size: 11px; color: var(--color-danger-fg); }
  .gh-connector-error:empty { display: none; }
  .gh-connector-inspect-trigger, .gh-connector-drill-btn {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
  }
  .gh-connector-inspect-trigger:hover, .gh-connector-drill-btn:hover { text-decoration: underline; }
  .gh-connector-drill-panel {
    background: var(--color-canvas-default);
    border: 1px solid var(--brand-primary);
    border-radius: 8px;
    padding: 20px 24px;
    margin-top: 16px;
    box-shadow: 0 4px 16px color-mix(in oklab, var(--brand-primary) 8%, transparent);
    display: none;
    animation: gh-fade-in 0.15s ease;
  }
  @keyframes gh-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ---- gh-tag — 7 variants, kliper-github-ui-wiremock.html ----
     DEFECT: the backoffice wiremock uses `.gh-tag-active` (worker health /
     audit-log rows, e.g. "Saudavel", "Auditado") but never defines it — it
     never even ships its own gh-tag CSS, only the base ui rule. All its
     uses are positive/healthy states, so it gets the family's existing
     success flavour (the same treatment as gh-tag-web) rather than an
     invented sixth colour. */
  .gh-tag { display: inline-flex; align-items: center; padding: 1px 7px; font-size: 11px; font-weight: 500; border-radius: 12px; border: 1px solid transparent; }
  /* A fixed pair, as its four siblings are: the themed link colour turned
     light on this light pill in dark mode (2.72:1). */
  .gh-tag-radio { background-color: var(--color-accent-subtle); color: var(--color-accent-fg); border-color: var(--color-accent-muted); }
  .gh-tag-tv { background-color: var(--color-attention-subtle); color: var(--color-attention-text); border-color: var(--color-attention-muted); }
  .gh-tag-print { background-color: var(--color-done-subtle); color: var(--color-done-fg); border-color: var(--color-done-muted); }
  .gh-tag-web { background-color: var(--color-success-subtle); color: var(--color-success-fg); border-color: var(--color-success-muted); }
  .gh-tag-crisis { background-color: var(--color-danger-subtle); color: var(--color-danger-fg); border-color: var(--primer-red-300); font-weight: 600; }
  .gh-tag-active { background-color: var(--color-success-subtle); color: var(--color-success-fg); border-color: var(--primer-green-400); }
  .gh-tag-positive { background-color: var(--color-success-subtle); color: var(--color-success-fg); border-color: var(--color-success-muted); }
  .gh-tag-negative { background-color: var(--color-danger-subtle); color: var(--color-danger-fg); border-color: var(--color-danger-muted); }
  .gh-tag-secondary { background-color: var(--color-canvas-subtle); color: var(--color-fg-muted); border-color: var(--color-border-default); }
  /* Primer Label--attention: Jev's "possibly not related" (partials/relevance.html). */
  .gh-tag-attention { background-color: var(--color-attention-subtle); color: var(--color-attention-text); border-color: var(--color-attention-muted); }
  .kp-relevance { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  .kp-relevance-reason { font-size: 12px; color: var(--color-fg-muted); }

  /* ---- gh-metric — 4 variants, kliper-github-backoffice-wiremock.html ----
     Task 5's dashboard is the first consumer that also links the card
     (gh-clickable, below) and needs it to fit a small viewport, hence the
     480px rule — same reduction the page-local card it replaced used to
     carry per breakpoint, now owned by the family instead of the page. */
  .gh-metric-card { border: 1px solid var(--color-border-default); border-radius: 6px; padding: 16px; background: var(--color-canvas-default); }
  .gh-metric-label { font-size: 12px; font-weight: 600; color: var(--color-fg-muted); text-transform: uppercase; margin-bottom: 6px; }
  .gh-metric-val { font-size: 26px; font-weight: 600; }
  .gh-metric-sub { font-size: 12px; color: var(--color-fg-muted); margin-top: 4px; }
  .gh-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
  @media (max-width: 480px) {
    .gh-metric-card { padding: 10px 12px; }
    .gh-metric-val { font-size: 20px; }
  }

  /* ---- control plane layout & components ---- */
  .gh-layout { display: flex; max-width: 1400px; margin: 0 auto; padding: 24px 16px; gap: 24px; }
  .gh-layout[hidden] { display: none !important; }
  .gh-layout-main { flex: 1; min-width: 0; }
  .gh-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); gap: var(--space-3); }
  .tab-panel-title { font-size: 20px; font-weight: 600; margin: 0; }
  .gh-avatar-48 { width: 48px; height: 48px; font-size: var(--text-16); box-shadow: 0 0 0 1px var(--color-avatar-ring); }
  .gh-avatar-square { border-radius: var(--radius-md); }
  .gh-list-row-person { align-items: center; gap: var(--space-4); padding: var(--space-4); }
  .gh-list-row-person .gh-list-title { font-size: var(--text-14); line-height: 20px; }
  .gh-list-row-person .gh-list-title a { color: var(--color-link-fg); }
  .gh-list-row-person .gh-list-title a:hover { text-decoration: underline; }
  .gh-list-end { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; flex-shrink: 0; }
  .gh-list-empty { list-style: none; }
  .gh-list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
  .gh-list-toolbar .gh-search { margin-bottom: 0; }
  .gh-search-narrow { width: 320px; max-width: 100%; }
  .gh-table .gh-num { text-align: right; font-variant-numeric: tabular-nums; }
  .gh-section + .gh-section { margin-top: var(--space-6); }

  .gh-progress-track {
    height: 6px;
    background-color: var(--color-canvas-subtle);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid var(--color-border-default);
  }
  .gh-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
  }
  /* .gh-plan-badge and .gh-status-badge take Primer's Label metrics from the Label rule (search "Label (Primer)"). */
  .gh-plan-badge.public { background: var(--color-accent-subtle); color: var(--color-accent-fg); border: 1px solid var(--color-accent-muted); }
  .gh-plan-badge.pro { background: var(--color-attention-subtle); color: var(--color-attention-text); border: 1px solid var(--color-attention-muted); }
  .gh-plan-badge.starter { background: var(--color-canvas-subtle); color: var(--color-fg-muted); border: 1px solid var(--color-border-default); }
  .gh-plan-badge.enterprise { background: var(--color-done-subtle); color: var(--color-done-fg); border: 1px solid var(--color-done-muted); }
  .gh-status-badge.active { background: var(--color-success-subtle); color: var(--color-success-fg); border: 1px solid var(--color-success-muted); }
  .gh-status-badge.suspended { background: var(--color-danger-subtle); color: var(--color-danger-fg); border: 1px solid var(--color-danger-muted); }
  .gh-status-badge.review { background: var(--color-attention-subtle); color: var(--color-attention-text); border: 1px solid var(--color-attention-muted); }
  .gh-status-dot { width: 6px; height: 6px; border-radius: 50%; background-color: currentColor; }

  @media (max-width: 544px) {
    .gh-list-row-person { flex-wrap: wrap; }
    .gh-list-end { margin-left: calc(48px + var(--space-4)); }
    .gh-list-toolbar { flex-direction: column; align-items: stretch; }
    .gh-search-narrow { width: 100%; }
  }

  /* ---- gh-subnav — 7 variants, kliper-github-ui-wiremock.html ----
     The mobile collapse toggle (gh-mobile-subnav-trigger/-chevron) is the
     separate gh-mobile tail family and is not ported; gh-subnav-content
     still collapses correctly on its own under 900px, it just has no
     styled button to drive it here. */
  .gh-subnav { width: 230px; flex-shrink: 0; }
  .gh-subnav-title { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--color-fg-muted); margin-bottom: 8px; padding: 0 8px; }
  .gh-subnav-group { display: flex; flex-direction: column; gap: 2px; margin: 0 0 16px; padding: 0; list-style: none; }
  .gh-subnav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--color-fg-default);
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
  }
  /* Interaction tokens, not gray-150: that primitive has no dark value, and
     the current item's light text sat on it at 1.01:1 in dark mode. */
  .gh-subnav-link:hover { background-color: var(--color-action-hover); }
  .gh-subnav-link.active { font-weight: 600; background-color: var(--color-action-selected); }
  .gh-subnav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background-color: var(--color-link-fg);
    border-radius: 2px;
  }
  .gh-subnav-divider { height: 1px; background-color: var(--color-border-default); margin: 10px 8px 14px; }
  .gh-subnav-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px 4px 22px;
    font-size: 12px;
    color: var(--color-fg-muted);
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    margin: 1px 0;
  }
  .gh-subnav-child:hover { background-color: var(--color-action-hover); color: var(--color-fg-default); }
  .gh-subnav-child.active { font-weight: 600; color: var(--color-fg-default); background-color: var(--color-action-selected); }
  .gh-subnav-content { display: block; }
  /* The Dashboard panel inside `main`: side nav and column 20px apart (16px stacked), as the wiremock's `.gh-layout`;
     `main` already is the 1400px container, so this one adds neither width nor padding. */
  .gh-dash-layout { max-width: none; padding: 0; gap: 20px; }
  @media (max-width: 900px) { .gh-dash-layout { gap: 16px; } }
  .gh-coverage-bar { margin-top: 0; } /* a coverage row centres its bar; `.gh-progress-track` adds 4px above it */
  /* An overlay is never clipped and never a bottom sheet (owner ruling 2026-10-02): on a phone the Dashboard's filter
     menus open 4px under their button too, clamped and height-capped by chassis.js (D41). */
  /* Hit area (Control standards): 44px tall on a screen of 620px or less. */
  @media (max-width: 620px) {
    .gh-quick-filters .gh-select-btn, .gh-export-bar .gh-btn { height: 44px; }
    .gh-quick-filters .gh-select-item { min-height: 44px; align-items: center; }
  }
  /* Two filter menus per row on a phone, as the wiremock lays them out: a long value truncates inside its button. */
  @media (max-width: 900px) {
    .gh-quick-filters .gh-select-menu { min-width: 0; }
    .gh-quick-filters .gh-select-btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .gh-quick-filters .gh-select-btn .octicon { flex-shrink: 0; }
  }
  /* The side nav on a phone: one button that opens it as a Primer Dialog sheet (position "left", full height, a
     backdrop), subnav-collapse.js. The list moves into the native modal <dialog> while open, which brings Esc, the
     focus trap and base.css's scroll lock; inside it the list is a NavList (owner review 2026-10-06): one row size
     for groups, sub-items and the locked entry, leading icons on groups, the selected indicator on the current item,
     full-width group dividers, and a close IconButton in the header instead of a primary "Close" button. */
  .gh-mobile-subnav-trigger { display: none; }
  .gh-subnav-content > .gh-subnav-sheet-head { display: none; } /* outranks .gh-dialog-header's flex, further down */
  @media (max-width: 900px) {
    nav.gh-subnav.gh-subnav-collapsible { padding: 0; } /* after `nav.gh-subnav` below in the cascade: more specific instead */
    .gh-subnav-collapsible .gh-mobile-subnav-trigger {
      display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: var(--space-2);
      padding: 10px 14px; background: var(--color-canvas-subtle); border: 0; font: inherit; font-size: 13px; font-weight: 600; text-align: left;
      color: var(--color-fg-default); cursor: pointer;
    }
    .gh-subnav-collapsible .gh-mobile-subnav-trigger:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; }
    .gh-subnav-collapsible .gh-subnav-content { display: none; }
  }
  .gh-subnav-dialog {
    position: fixed; inset: 0 auto 0 0; margin: 0; padding: 0;
    width: min(320px, calc(100vw - 48px)); max-width: none; height: 100dvh; max-height: none;
    border: 0; border-right: 1px solid var(--color-border-default); border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    overflow-y: auto; overscroll-behavior: contain;
  }
  .gh-dialog.gh-subnav-dialog[open] { animation: gh-sheet-in 200ms var(--ease-overlay); } /* outranks .gh-dialog[open]'s scale-in */
  @keyframes gh-sheet-in { from { transform: translateX(-100%); } }
  @media (prefers-reduced-motion: reduce) { .gh-dialog.gh-subnav-dialog[open] { animation: none; } }
  .gh-subnav-dialog .gh-subnav-content { display: block; padding: 0 var(--space-2) var(--space-4); }
  .gh-subnav-dialog .gh-subnav-sheet-head {
    display: flex; position: sticky; top: 0; z-index: 1; align-items: center; background: var(--color-canvas-default);
    margin: 0 calc(-1 * var(--space-2)) var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-default);
  }
  .gh-subnav-dialog .gh-dialog-close { margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)); min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .gh-subnav-dialog .gh-subnav-group { margin: 0; }
  .gh-subnav-dialog .gh-subnav-divider { height: 1px; border: 0; margin: var(--space-2) calc(-1 * var(--space-2)); background-color: var(--color-border-default); }
  .gh-subnav-dialog :is(.gh-subnav-link, .gh-subnav-child) {
    min-height: 44px; padding: 6px var(--space-2); gap: var(--space-2); margin: 0;
    font-size: var(--text-14); line-height: 20px; color: var(--color-fg-default);
  }
  .gh-subnav-dialog .kp-subgroup { padding-left: 0; }
  .gh-subnav-dialog .gh-subnav-child { padding-left: calc(var(--space-2) + 16px + var(--space-2)); }
  .gh-subnav-dialog .gh-subnav-child.active::before {
    content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background-color: var(--color-link-fg);
  }
  .gh-subnav-dialog .cfg-nav-locked { color: var(--color-fg-muted); }
  .gh-subnav-dialog .cfg-nav-locked > .octicon { position: absolute; left: var(--space-2); }
  .gh-subnav-dialog .cfg-nav-sub { line-height: 18px; }
  /* Under 900px the subnav stacks above its page as a full-width box. Its
     content stays visible: the wiremock hides it behind the gh-mobile toggle,
     which is not ported, so hiding it here left an empty bordered box and no
     way to reach the other sections on a phone. */
  @media (max-width: 900px) {
    .gh-layout { flex-direction: column; gap: 16px; }
    .gh-subnav {
      width: 100%;
      border: 1px solid var(--color-border-default);
      border-radius: 6px;
      background: var(--color-canvas-default);
      margin-bottom: 8px;
      overflow: hidden;
    }
    .gh-subnav-content { padding: 12px 14px; }
    nav.gh-subnav { padding: 12px 8px 0; }
    /* The settings SideNav collapses behind the wiremock's trigger (`.gh-mobile-subnav-trigger`), which names the
       current page; configuration.js opens and closes it. */
    nav#cfg-nav { padding: 0; }
    #cfg-nav .gh-mobile-subnav-trigger {
      display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
      padding: 10px 14px; background: var(--color-canvas-subtle); border: 0; font: inherit; font-size: 13px;
      font-weight: 600; color: var(--color-fg-default); cursor: pointer; text-align: left;
    }
    #cfg-nav .gh-mobile-subnav-trigger:hover { background: var(--color-action-hover); }
    #cfg-nav .gh-mobile-subnav-trigger .octicon { color: var(--color-fg-muted); flex-shrink: 0; transition: transform 0.15s ease; }
    #cfg-nav .gh-mobile-subnav-trigger[aria-expanded="true"] .octicon { transform: rotate(180deg); }
    #cfg-nav .gh-subnav-content { display: none; border-top: 1px solid var(--color-border-default); }
    #cfg-nav .gh-subnav-content.show { display: block; }
  }
  #cfg-nav .gh-mobile-subnav-trigger { display: none; }
  @media (max-width: 900px) { #cfg-nav .gh-mobile-subnav-trigger { display: flex; } }

  /* ---- gh-tab — 2 variants, kliper-github-ui-wiremock.html ----
     CORRECTION 3: darkened indicator token, GitHub's 2px, and the
     [aria-current="page"] selector alongside .active — see file header. */
  .gh-tab-item,
  .gh-tabs-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-2);
    font-size: 14px;
    font-weight: 400;
    line-height: 30px;
    color: var(--color-fg-default);
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background-color 120ms ease-out;
    user-select: none;
    flex-shrink: 0;
  }
  /* "More" is a <button> drawn as a tab, as GitHub's UnderlineNav draws it. */
  .gh-tabs-more-btn { border: 0; background: transparent; font-family: inherit; }
  .gh-tab-item:hover, .gh-tabs-more-btn:hover { background-color: var(--color-action-hover); }
  .gh-tab-item:focus-visible, .gh-tabs-more-btn:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; }
  .gh-tab-item.active,
  .gh-tab-item[aria-current="page"] { font-weight: 600; }
  /* underline-nav.js always keeps the current tab in the bar; when it alone
     is wider than the room (a phone), its label ellipsizes instead of
     the tab hiding in More. */
  .gh-tabs-container > .gh-tab-item.active,
  .gh-tabs-container > .gh-tab-item[aria-current="page"] { flex-shrink: 1; min-width: 0; }
  .gh-tabs-container > .gh-tab-item.active > [data-content],
  .gh-tabs-container > .gh-tab-item[aria-current="page"] > [data-content] { overflow: hidden; text-overflow: ellipsis; }
  /* Reserves the bold label's width, so marking a tab active never shifts
     its neighbours (GitHub's own data-content trick). */
  .gh-tab-item [data-content]::before {
    content: attr(data-content);
    display: block;
    height: 0;
    visibility: hidden;
    font-weight: 600;
  }
  /* The underline sits on the bar's bottom rule: 9px under the 30px pill
     centred in the 48px bar. */
  .gh-tab-item.active::after,
  .gh-tab-item[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -9px;
    height: 2px;
    border-radius: var(--radius-md);
    background-color: var(--color-indicator-active);
  }
  /* A touch target grows its hit area, not the 30px pill: a 44px pill would
     push the underline 7px under the bar, where .gh-tabs-container's
     overflow clips it. */
  @media (pointer: coarse) {
    .gh-tab-item::before, .gh-tabs-more-btn::before { content: ""; position: absolute; inset: -7px 0; }
  }
  /* .gh-tab-badge is Primer's Counter (search "Counter (Primer)"). */
  .gh-tab-badge { flex-shrink: 0; }
  .gh-tab-badge.danger { background-color: var(--color-danger-subtle); color: var(--color-danger-fg); font-weight: 600; }

  /* ---- gh-box — 5 variants, merged ui + backoffice wiremocks ---- */
  .gh-box {
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    background: var(--color-canvas-default);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px color-mix(in oklab, var(--color-fg-default) 4%, transparent);
  }
  .gh-box-header {
    background: var(--color-canvas-subtle);
    border-bottom: 1px solid var(--color-border-default);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--color-fg-muted);
  }
  .gh-box-title-group { display: flex; align-items: center; gap: 8px; }
  .gh-box-title { font-size: 14px; font-weight: 600; color: var(--color-fg-default); }
  .gh-box-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .gh-search-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
  }
  .gh-search-input-wrap .gh-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--color-fg-muted);
    display: inline-flex;
    align-items: center;
    line-height: 0;
  }
  .gh-search-input-wrap .gh-search-icon svg {
    width: 14px;
    height: 14px;
  }
  .gh-search-input-wrap .gh-input-sm {
    height: var(--control-medium-size);
    padding: 0 12px 0 30px;
    font-size: var(--text-14);
    line-height: 20px;
    width: 260px;
    border: 1px solid var(--color-control-border);
    border-radius: 6px;
    background-color: var(--color-canvas-default);
    color: var(--color-fg-default);
    font-family: inherit;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  }
  .gh-search-input-wrap .gh-input-sm::placeholder {
    color: var(--color-fg-muted);
  }
  /* Primer `.form-select` (github.com, 2026-09-27): 32px, 14px/20px, white
     field. The indicator, its padding and the focus ring are the shared
     control-standards rules at the end of this file. */
  .gh-select-sm {
    /* A select is as wide as its longest option: the send-times zone list
       ran 8px past a 375px viewport. Never wider than its container. */
    max-width: 100%;
    height: var(--control-medium-size);
    padding: 0 12px;
    font-size: var(--text-14);
    line-height: 20px;
    border: 1px solid var(--color-control-border);
    border-radius: 6px;
    background-color: var(--color-canvas-default);
    color: var(--color-fg-default);
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--duration-fast);
    /* A select is as wide as its longest option: a long tenant name must
       ellipsize inside the field, never widen the page (390px, /admin). */
    min-width: 0;
    text-overflow: ellipsis;
  }
  @media (max-width: 768px) {
    .gh-box-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .gh-box-header > div { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
    .gh-search-input-wrap, .gh-search-input-wrap .gh-input-sm { width: 100%; }
  }

  /* ---- gh-answer — 7 variants, kliper-github-ui-wiremock.html ----
     DEFECT: the markup renders `.gh-answer-title` / `.gh-answer-kpi` /
     `.gh-answer-desc`; the CSS only ever defined `.gh-answer-header` /
     `.gh-answer-main-val` / `.gh-answer-sub`. Same role, same position in
     the card, just renamed on the markup side only. Both names get the same
     rule rather than leaving three of the four cards' children unstyled.
     gh-executive-answers (the grid wrapper) is the separate gh-executive
     tail family and is not ported. */
  .gh-answer-card { border: 1px solid var(--color-border-default); border-radius: 6px; padding: 14px 16px; background: var(--color-canvas-default); }
  .gh-answer-header, .gh-answer-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-fg-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .gh-answer-main-val, .gh-answer-kpi { font-size: 24px; font-weight: 600; line-height: 1.2; }
  .gh-answer-sub, .gh-answer-desc { font-size: 12px; color: var(--color-fg-muted); margin-top: 6px; }

  /* ---- gh-filter — 13 variants, kliper-github-ui-wiremock.html ----
     `.gh-filter-btn` (the 13th) is a JS hook layered onto `.gh-btn` on the
     toggle button (`class="gh-btn gh-filter-btn"`); it carries no styling of
     its own in the wiremock either, so it is left out rather than invented. */
  .gh-filter-wrapper { position: relative; display: inline-block; }
  .gh-filter-dialog {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 320px;
    background-color: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    box-shadow: 0 8px 24px color-mix(in oklab, var(--primer-gray-400) 20%, transparent);
    z-index: 1100;
    overflow: hidden;
    animation: gh-overlay-appear 200ms var(--ease-overlay);
  }
  .gh-filter-dialog.show { display: block; }
  .gh-filter-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border-default);
    background-color: var(--color-canvas-default);
  }
  .gh-filter-dialog-close { background: none; border: none; color: var(--color-fg-muted); cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1; }
  .gh-filter-dialog-close:hover { color: var(--color-fg-default); }
  .gh-filter-dialog-body { max-height: 340px; overflow-y: auto; padding: 12px 14px; }
  .gh-filter-section-title { font-size: 13px; font-weight: 600; color: var(--color-fg-default); margin-bottom: 2px; }
  .gh-filter-section-desc { font-size: 12px; color: var(--color-fg-muted); margin-bottom: 12px; }
  .gh-filter-check-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; cursor: pointer; }
  .gh-filter-check-row:last-child { margin-bottom: 4px; }
  .gh-filter-check-label { font-size: 13px; font-weight: 600; color: var(--color-fg-default); display: flex; align-items: center; gap: 6px; }
  .gh-filter-check-sub { font-size: 11px; color: var(--color-fg-muted); margin-top: 2px; line-height: 1.3; }
  .gh-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 6px 12px;
    background: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    font-size: 12px;
  }
  .gh-filter-pill-label { font-weight: 600; color: var(--color-fg-muted); margin-right: 4px; }

  /* ---- gh-page — 2 variants, kliper-github-backoffice-wiremock.html ---- */
  .gh-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
  .gh-page-title { display: flex; align-items: center; gap: var(--space-2); font-size: 22px; font-weight: 600; } /* icon centred on the text, as GitHub's Subhead */
  /* A standalone page's column: the chassis the wiremock port brings will own layout for
     tabbed pages; this is for the pages that live outside it (the capture audit page). */
  .gh-page-body { max-width: 1012px; margin: 0 auto; padding: var(--space-6) var(--space-4); }

  /* ---- gh-tenant — 4 variants, kliper-github-backoffice-wiremock.html ----
     FIX (round 1): the avatar tile hardcoded --kliper-navy-100/-200/-700
     directly, the default brand values, not neutrals. Backoffice pages never
     load a tenant's theme.css, so --brand-* here is guaranteed to keep
     resolving to the same Kliper navy it renders today — but the source is
     now the single brand scale, not a second copy of it, so a change to the
     brand defaults (or a future white-labelled admin) moves this too. */
  .gh-tenant-cell { display: flex; align-items: center; gap: 10px; }
  .gh-tenant-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--brand-primary-subtle);
    border: 1px solid color-mix(in oklab, var(--brand-primary) 30%, var(--color-canvas-default));
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
  }
  .gh-tenant-name { font-weight: 600; font-size: 13px; color: var(--color-fg-default); line-height: 1.3; }
  .gh-tenant-desc { font-size: 11px; color: var(--color-fg-muted); margin-top: 1px; }
  /* A long name or one unbroken word wraps in its cell instead of stretching the table. */
  .gh-tenant-cell > div:last-child { min-width: 0; overflow-wrap: anywhere; }
  .gh-handle-badge {
    display: inline-block;
    background: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: 6px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-accent-fg);
    font-weight: 500;
    white-space: nowrap;
  }

  /* ---- Contas gerenciadas (D10, D11), kliper-github-backoffice-wiremock.html #gestoes, #nova-conta-gerenciada ---- */
  .kp-muted-bo { color: var(--color-fg-muted); }
  .kp-lead-bo { color: var(--color-fg-muted); margin: 0 0 16px; max-width: 720px; }
  .kp-form-bo { max-width: 640px; }
  .kp-form-pad { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
  .kp-form-bo .gh-form-input[readonly] { background: var(--color-canvas-subtle); color: var(--color-fg-muted); }
  .kp-form-bo .gh-box-header.kp-form-foot-bo { border-top: 1px solid var(--color-border-default); border-bottom: 0; flex-wrap: wrap; gap: 8px; }
  #mgmtTable td { white-space: nowrap; }
  #mgmtTable th:first-child { min-width: 200px; }
  .kp-actions-bo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  #tenants-managements .gh-page-header, #tenants-new-managed-account .gh-page-header { flex-wrap: wrap; }

  /* ---- gh-channel — 2 variants, kliper-github-backoffice-wiremock.html ---- */
  .gh-channel-pills { display: flex; gap: 4px; flex-wrap: nowrap; }
  .gh-channel-pill { background: var(--color-canvas-subtle); color: var(--color-fg-muted); } /* a Label */

  /* ---- gh-table — 5 variants, kliper-github-backoffice-wiremock.html ---- */
  .gh-table-container { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gh-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
  .gh-table th {
    padding: 8px 10px;
    background: var(--color-canvas-subtle);
    border-bottom: 1px solid var(--color-border-default);
    color: var(--color-fg-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }
  .gh-table td { padding: 10px 10px; border-bottom: 1px solid var(--color-border-muted); vertical-align: middle; color: var(--color-fg-default); }
  .gh-table tr:last-child td { border-bottom: none; }
  /* UI-CONVENTIONS §5: numbers in tables align by digit. */
  .gh-table td { font-variant-numeric: tabular-nums; }
  .gh-table tr:hover td { background-color: var(--color-canvas-subtle); }
  /* A sortable header's link (ui.html sortable_th): reads as the header text,
     the arrow octicon on the sorted column says which way. */
  .gh-table-sort { display: inline-flex; align-items: center; gap: var(--space-1); color: inherit; text-decoration: none; }
  .gh-table-sort:hover { color: var(--color-link-fg); }
  .gh-table-progress-track { width: 100%; height: 4px; background-color: var(--primer-gray-150); border-radius: 2px; overflow: hidden; margin-top: 4px; }
  .gh-table-progress-fill { height: 100%; border-radius: 2px; }
  @media (max-width: 768px) {
    .gh-table-container, .gh-table-responsive { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
  }

  /* ---- gh-volume — 3 variants, kliper-github-backoffice-wiremock.html ---- */
  .gh-volume-cell { min-width: 110px; }
  .gh-volume-text { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--color-fg-default); }
  .gh-volume-limit { font-size: 11px; font-weight: 400; color: var(--color-fg-muted); }

  /* ---- gh-pill — 3 variants, kliper-github-ui-wiremock.html ---- */
  .gh-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: 12px;
    color: var(--color-fg-default);
    font-weight: 500;
    font-size: 12px;
  }
  /* A chip in a settings list (a topic, an exclusion, another name) is the
     configuration wiremock's `.gh-cfg-chip`, as computed: 13px regular, fully
     rounded, 3px 6px 3px 10px, on Primer's subtle grey fill. Scoped: the
     github-ui wiremock's pill elsewhere keeps its own values. */
  .cfg-chips .gh-pill, .cfg-alias-list .gh-pill {
    gap: 6px;
    padding: 3px 6px 3px 10px;
    background: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: 999px;
    font-weight: 400;
    font-size: 13px;
    /* A chip is one line (Primer's Token): the list wraps whole chips, never the text inside one; a name longer
       than the row ends in an ellipsis (2026-10-06, "Hospital Municipal / Novo Cliente" broke over two lines). */
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
  }
  .cfg-chips .gh-pill-text, .cfg-alias-list .gh-pill-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .gh-pill-remove { cursor: pointer; color: var(--color-fg-muted); font-weight: bold; border: none; background: none; padding: 0 2px; line-height: 1; font-size: 13px; }
  .gh-pill-remove:hover { color: var(--color-danger-fg); }
  .gh-pill-clear-all { color: var(--color-link-fg); text-decoration: none; font-weight: 500; cursor: pointer; margin-left: 6px; }
  .gh-pill-clear-all:hover { text-decoration: underline; }

  /* ---- gh-header — 5 variants, merged ui + backoffice + landing ----
     The shared app-toolbar version (identical in ui and backoffice) is
     canonical; the landing page's sticky, backdrop-blurred marketing nav is
     a different UI pattern and stays page-specific for Task 8 to port. */
  .gh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-canvas-subtle);
    border-bottom: 1px solid var(--color-border-default);
    padding: 12px var(--space-4);
    gap: 16px;
  }
  /* GitHub's gutters: 32px from its 1012px breakpoint up, 16px below —
     the same on the tab bar, so the logo lines up with the first tab. */
  @media (min-width: 1012px) { .gh-header { padding-left: 32px; padding-right: 32px; } }
  .gh-header-left { display: flex; align-items: center; gap: 12px; }
  .gh-header-right { display: flex; align-items: center; gap: 12px; min-height: 32px; }
  .gh-header-search { flex: 1; max-width: 440px; position: relative; }
  .gh-header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; }
  @media (max-width: 768px) {
    .gh-header { flex-wrap: wrap; padding: 10px var(--space-4); gap: 10px; }
    .gh-header-left { flex: 1; min-width: 0; }
    .gh-header-search { order: 3; width: 100%; max-width: 100%; }
    .gh-header-right { flex-shrink: 0; gap: 6px; }
    /* `+ ▾` and the repositories icon (GitHub drops them on a phone): the crumb keeps its room; the avatar menu
       carries Todos os monitoramentos instead. */
    .gh-header-right > .kp-header-wide { display: none; }
  }
  @media (max-width: 480px) {
    .gh-header-right #header-account-label { max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
    .gh-header > div:last-child > span { display: none; }
  }

  /* ---- chassis header — kliper-github-ui-wiremock.html:44-195, drawn by
     partials/chassis.html. Menu metrics are GitHub's (plan appendix,
     measured 2026-09-24), not the wiremock's. ---- */
  .gh-header-left { min-width: 0; overflow: hidden; }
  .gh-brand { display: inline-flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
  .gh-brand svg { display: block; flex-shrink: 0; }
  /* Inline (partials/brand.html), so the brand follows a token with a dark
     value: the navy image measured 1.73:1 on the dark header. */
  .gh-brand-tile rect { fill: var(--color-brand-mark); }
  .gh-brand-tile path { fill: var(--color-brand-mark-fg); }
  .gh-brand .gh-brand-wordmark { height: 17px; width: auto; fill: var(--color-brand-mark); }
  .gh-brand:focus-visible, .gh-breadcrumb > a:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; border-radius: var(--radius-sm); }
  .gh-header-sep { color: var(--color-border-default); font-weight: 300; font-size: var(--text-14); margin: 0 var(--space-1); flex-shrink: 0; }
  .gh-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: var(--text-14); min-width: 0; white-space: nowrap; }
  .gh-breadcrumb > a, .gh-breadcrumb > span { flex-shrink: 0; }
  .gh-breadcrumb > a { color: var(--color-link-fg); text-decoration: none; font-weight: 500; }
  .gh-breadcrumb > a:hover { text-decoration: underline; }
  /* Room for "Fu…" at least: with min-width 0 the name collapsed to 0px, no ellipsis. */
  .gh-breadcrumb > strong { color: var(--color-fg-default); min-width: 4ch; overflow: hidden; text-overflow: ellipsis; }
  /* The inner separator is text, not the brand's thin divider (wiremock: fg-muted, weight 400). */
  .gh-breadcrumb .gh-header-sep { margin: 0; color: var(--color-fg-muted); font-weight: 400; }
  /* GitHub collapses the breadcrumb on a phone: the name and its separator go together. */
  @media (max-width: 543.98px) {
    .gh-breadcrumb > strong, .gh-breadcrumb > .gh-header-sep { display: none; }
  }

  /* Live capture (wiremock H5, .kp-icon-btn + .kp-live-dot): a 32px icon link. The icon's shape (broadcast, or
     the alert triangle when degraded) and the sr-only text carry the state; the dot only repeats it. */
  .gh-capture-status { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; color: var(--color-fg-muted); background: var(--color-canvas-default); border: 1px solid var(--color-border-default); border-radius: var(--radius-md, 6px); transition: color 0.12s ease-out, background-color 0.12s ease-out; }
  .gh-capture-status:hover { color: var(--color-fg-default); background: var(--color-canvas-subtle); }
  .gh-capture-status .octicon { margin: 0; color: inherit; }
  .gh-capture-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-success-emphasis); box-shadow: 0 0 0 2px var(--color-canvas-default); }
  .gh-capture-status[data-state="degraded"] .gh-capture-dot { background: var(--color-attention-emphasis); }
  .gh-capture-status[data-state="off"] .gh-capture-dot { background: var(--color-danger-fg); }

  .gh-select-dropdown-end { right: 0; left: auto; }
  button.gh-avatar { border: 0; padding: 0; cursor: pointer; font-family: inherit; transition: opacity 80ms cubic-bezier(0.65, 0, 0.35, 1); }
  /* Outside the disc: an inset navy ring on the dark disc measured 1.47:1. */
  button.gh-avatar:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: 2px; }
  button.gh-avatar:hover { opacity: 0.85; }
  button.gh-avatar:active, button.gh-avatar[aria-expanded="true"] { opacity: 0.7; }
  .gh-avatar-lg { width: 36px; height: 36px; font-size: 13px; }

  .gh-user-menu { min-width: 260px; width: max-content; max-width: calc(100vw - 32px); padding: 6px; }
  .gh-user-menu-id { display: flex; align-items: center; gap: 10px; padding: 6px var(--space-2) 10px; }
  .gh-user-menu-id-text { display: flex; flex-direction: column; min-width: 0; }
  .gh-user-menu-id-text strong { font-size: 14px; line-height: 20px; }
  .gh-user-menu-id-text span { font-size: 12px; color: var(--color-fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* The wiremock's ActionList divider: decorative border, full bleed across the 6px overlay padding. */
  .gh-user-menu-sep { height: 1px; background: var(--color-border-default); margin: 6px -6px; }
  .gh-user-menu-item { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; margin: 0; padding: 6px var(--space-2); border-radius: var(--radius-md); font-size: 14px; line-height: 20px; color: var(--color-fg-default); text-decoration: none; }
  .gh-user-menu-item .octicon { color: var(--color-fg-muted); flex-shrink: 0; }
  .gh-user-menu-item:hover { background-color: var(--color-action-hover); }
  .gh-user-menu-item:hover .octicon { color: var(--color-fg-default); }
  .gh-user-menu-item:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; }
  /* An item with a description, as Primer's ActionList draws one: the
     description on its own line, 12/16 muted, the icon on the first line. */
  .gh-user-menu-item:has(.gh-user-menu-item-text) { align-items: flex-start; }
  .gh-user-menu-item:has(.gh-user-menu-item-text) .octicon { margin-top: 2px; }
  .gh-user-menu-item-text { display: flex; flex-direction: column; min-width: 0; }
  .gh-user-menu-item-desc { font-size: 12px; line-height: 16px; color: var(--color-fg-muted); }

  /* ---- gh-action — 1 variant, ui + backoffice wiremocks ---- */
  .gh-action-strip { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
  @media (max-width: 900px) {
    .gh-action-strip { flex-direction: column; align-items: stretch; gap: 10px; }
  }
  @media (max-width: 480px) {
    .gh-action-strip > div:last-child { width: 100%; flex-direction: column; }
    .gh-action-strip > div:last-child .gh-btn { width: 100%; justify-content: center; }
  }

  /* ---- gh-status — 2 variants, kliper-github-backoffice-wiremock.html ---- */
  .gh-status-badge.active { background: var(--color-success-subtle); color: var(--color-success-fg); border: 1px solid color-mix(in oklab, var(--color-success-fg) 25%, transparent); }
  .gh-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-success-fg); }

  /* ---- gh-nav — 3 variants, kliper-landing-page-wiremock.html ---- */
  .gh-nav-links { display: flex; gap: 20px; align-items: center; }
  .gh-nav-item { font-size: 14px; font-weight: 500; color: var(--color-fg-default); text-decoration: none; padding: 6px 8px; border-radius: 6px; transition: color 0.15s ease, background 0.15s ease; }
  .gh-nav-item:hover { background-color: var(--color-canvas-subtle); color: var(--color-link-fg); text-decoration: none; }
  .gh-nav-actions { display: flex; gap: 10px; align-items: center; }

  /* ---- gh-clickable — 2 variants, kliper-github-ui-wiremock.html +
     Task 5's drill-in metric cards. `-row` is the original wiremock variant
     (a table row that opens a drill-in); the bare modifier is new — it is
     an <a>, not a row, so it owns its own display/decoration reset rather
     than inheriting -row's row-shaped padding and radius. */
  .gh-clickable-row { cursor: pointer; transition: background-color 0.15s ease; border-radius: 4px; padding: 2px 4px; }
  .gh-clickable-row:hover { background-color: color-mix(in oklab, var(--color-link-fg) 8%, transparent); }
  .gh-clickable { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out); }
  .gh-clickable:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-sm); text-decoration: none; }
  .gh-clickable:active { transform: translateY(1px); }

  /* ---- gh-checkbox — 1 variant, kliper-github-ui-wiremock.html ----
     Its own focus-visible rule (redrawing a 2px ring in hex 0969da) is
     dropped: it duplicated the global :focus-visible ring in base.css with a
     hardcoded, untokenised colour instead of deferring to it. */
  .gh-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--color-control-border);
    border-radius: 4px;
    background-color: var(--color-canvas-default);
    cursor: pointer;
    position: relative;
    margin: 0;
    flex-shrink: 0;
    transition: background-color 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
  }
  .gh-checkbox:hover { border-color: var(--color-link-fg); }
  .gh-checkbox:checked { background-color: var(--color-link-fg); border-color: var(--color-link-fg); }
  .gh-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid var(--primer-gray-0);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }

  /* ---- gh-badge — 2 variants, ui (badge-org) + backoffice (badge-control),
     plus a bare `.gh-badge` base for a dispatch outcome
     (`gh-badge dispatch-status-<status>`; first drawn by the retired portal),
     and colour never carries the meaning alone — the badge always sits next
     to its own text (Sent/Failed/Not configured). ---- */
  .gh-badge { color: var(--color-fg-muted); background: var(--color-canvas-subtle); } /* a Label */
  .dispatch-status-sent { color: var(--color-success-fg); background: var(--color-success-subtle); border-color: transparent; }
  .dispatch-status-failed { color: var(--color-danger-fg); background: var(--color-danger-subtle); border-color: transparent; }
  .gh-badge-org { background: var(--color-canvas-default); border: 1px solid var(--color-border-default); border-radius: 20px; padding: 1px 8px; font-size: 12px; font-weight: 500; color: var(--color-fg-muted); }
  .gh-badge-control { background: var(--color-canvas-subtle); border: 1px solid var(--color-border-default); color: var(--color-fg-muted); border-radius: 20px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
  @media (max-width: 480px) { .gh-badge-control { display: none; } }

  /* ---- gh-state — 2 variants, kliper-login-wiremock.html ----
     FIX (round 1): .active hardcoded --kliper-navy-700 directly; the shared
     auth portal never loads a tenant theme.css either, so --brand-primary
     resolves identically today and stops duplicating the brand scale. */
  .gh-state-pills { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .gh-state-pill-btn {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid var(--color-control-border);
    background: var(--color-canvas-default);
    color: var(--color-fg-muted);
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .gh-state-pill-btn.active { background: var(--brand-primary); color: var(--brand-on-primary); border-color: var(--brand-primary); }

  /* ---- gh-dropdown — 2 variants, ui + backoffice wiremocks ---- */
  .gh-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background-color: var(--color-canvas-default);
    border: 0;
    border-radius: var(--radius-overlay);
    box-shadow: var(--shadow-overlay);
    min-width: 270px;
    width: max-content;
    max-width: calc(100vw - 24px);
    z-index: 1000;
    padding: var(--space-2) 0;
    box-sizing: border-box;
    animation: gh-overlay-appear 200ms var(--ease-overlay);
  }
  .gh-dropdown-menu.show { display: block; }
  /* A <details> menu (ui.html sort_menu): opens natively, with no JS, as
     GitHub's own list "Sort" menus do. The summary is the gh-btn. */
  .gh-dropdown { position: relative; display: inline-block; }
  .gh-dropdown > summary { list-style: none; cursor: pointer; }
  .gh-dropdown > summary::-webkit-details-marker { display: none; }
  .gh-dropdown[open] > .gh-dropdown-menu { display: block; }
  .gh-dropdown-item[aria-current="true"] { font-weight: 600; }
  .gh-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 32px;
    margin: 0 var(--space-2);
    padding: 6px var(--space-2);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 20px;
    color: var(--color-fg-default);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
  }
  .gh-dropdown-item:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; }
  .gh-dropdown-item > div:first-child { display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; }
  .gh-dropdown-item span { white-space: nowrap; }
  .gh-dropdown-item:hover { background-color: var(--color-action-hover); }
  .gh-dropdown-item.active { font-weight: 600; }
  .gh-dropdown-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background-color: var(--color-indicator-active);
    border-radius: 2px;
  }
  /* Primer ActionList items whatever their element (Control standards): a <button> or <label> item renders like the
     <a> one; a group carries no fieldset chrome. */
  button.gh-dropdown-item {
    appearance: none; width: calc(100% - 2 * var(--space-2)); border: 0; background-color: transparent;
    font: inherit; text-align: start;
  }
  button.gh-dropdown-item:hover { background-color: var(--color-action-hover); }
  label.gh-dropdown-item { justify-content: flex-start; gap: 8px; }
  label.gh-dropdown-item input[type="radio"] { margin: 0; flex-shrink: 0; }
  .gh-dropdown-group {
    min-width: 0; margin: var(--space-2) 0 0; padding: var(--space-2) 0 0; border: 0;
    border-top: 1px solid var(--color-border-muted);
  }
  .gh-dropdown-header {
    float: inline-start; width: 100%; box-sizing: border-box; padding: 6px var(--space-4);
    font-size: 12px; font-weight: 600; line-height: 18px; color: var(--color-fg-muted);
  }
  .gh-dropdown-header + * { clear: both; }
  @media (max-width: 480px) {
    .gh-dropdown-menu { right: 0; left: auto; max-width: calc(100vw - 32px); min-width: 250px; }
  }

  /* ---- gh-ratio — 4 variants, kliper-github-ui-wiremock.html ---- */
  .gh-ratio-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 10px 0 6px; background: var(--primer-gray-150); }
  .gh-ratio-pos { background: var(--primer-green-500); }
  .gh-ratio-neu { background: var(--primer-gray-400); }
  .gh-ratio-neg { background: var(--color-danger-fg); }

  /* ---- gh-cards — 1 variant, kliper-github-backoffice-wiremock.html ---- */
  .gh-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
  @media (max-width: 900px) { .gh-cards-grid { grid-template-columns: 1fr; } }

  /* ---- gh-tabs — 2 variants, ui + backoffice wiremocks ---- */
  .gh-tabs-bar { background-color: var(--color-canvas-subtle); box-shadow: inset 0 -1px 0 var(--color-border-default); min-height: 48px; padding: 0 var(--space-4); display: flex; align-items: center; gap: var(--space-2); position: relative; }
  .gh-tabs-container { display: flex; align-items: center; align-self: stretch; gap: var(--space-2); overflow: hidden; flex: 1; white-space: nowrap; }
  @media (min-width: 1012px) { .gh-tabs-bar { padding: 0 32px; } }

  /* ---- gh-plan — 1 variant, kliper-github-backoffice-wiremock.html ----
     FIX (round 1): .public hardcoded --kliper-navy-100/-700 directly;
     remapped to --brand-primary-subtle/--brand-primary for the same reason
     as gh-tenant and gh-state above. */
  .gh-plan-badge.public { background: var(--brand-primary-subtle); color: var(--brand-primary); border: 1px solid color-mix(in oklab, var(--brand-primary) 25%, transparent); }
  .gh-plan-badge.pro { background: var(--color-canvas-subtle); color: var(--color-fg-default); border: 1px solid var(--color-border-default); }

  /* ----------------------------------------------------------------------
   * Task 6 — the thirteen families measured 0 across all six wiremocks.
   * The design system above was specified against a landing page (no data,
   * no latency, no failure modes, no authenticated state); these are what
   * the eight portal tabs need instead. Stubs, not a component library —
   * each is the one definition eight tabs share rather than eight they'd
   * each invent.
   * ---------------------------------------------------------------------- */

  /* ---- gh-empty — empty state, not measured in any wiremock ---- */
  .gh-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-7) var(--space-4);
    color: var(--color-fg-muted);
  }
  .gh-empty-icon { font-size: var(--text-38); color: var(--color-fg-decorative); }
  .gh-empty-title { margin: 0; font-size: var(--text-16); font-weight: 600; color: var(--color-fg-default); }
  .gh-empty-action { margin-top: var(--space-2); }

  /* ---- gh-skeleton — loading placeholder, not measured in any wiremock.
     Its animation is covered by base.css's @media (prefers-reduced-motion)
     rule, which already forces every animation off; no second override
     belongs here. ---- */
  .gh-skeleton {
    display: block;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--primer-gray-150) 25%, var(--primer-gray-100) 50%, var(--primer-gray-150) 75%);
    background-size: 200% 100%;
    animation: gh-skeleton-pulse 1.4s ease-in-out infinite;
  }
  @keyframes gh-skeleton-pulse {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
  }

  /* ---- gh-error — inline failure surface, not measured in any wiremock.
     Markup: role="alert" on the container, the same "announce, do not force
     a navigation" posture as .gh-toast below. ---- */
  .gh-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-danger-subtle);
    color: var(--color-danger-fg);
    border: 1px solid color-mix(in oklab, var(--color-danger-fg) 25%, transparent);
    border-radius: var(--radius-md);
    font-size: var(--text-14);
  }
  .gh-error-title { font-weight: 600; }
  .gh-error-retry { margin-left: auto; }

  /* ---- gh-pagination — not measured in any wiremock. Page changes are page
     navigations (bookmarkable, work without JS, open-in-new-tab-able), so
     .gh-pagination-btn is an <a>, not a <button> — which is also why its
     disabled state cannot be CSS :disabled (that pseudo-class never matches
     an anchor). Markup: <nav class="gh-pagination" aria-label="Pagination">
     <a class="gh-pagination-btn" href="?page=2">2</a>
     <a class="gh-pagination-btn" href="?page=3" aria-current="page">3</a>
     <a class="gh-pagination-btn" aria-disabled="true">Next</a></nav> — a
     disabled link drops its href (or a click handler blocks navigation) and
     carries aria-disabled="true" instead. .gh-pagination-btn is a new
     interactive family; base.css's coarse-pointer block sizes it. ---- */
  .gh-pagination { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-12); }
  .gh-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-control-border);
    border-radius: var(--radius-sm);
    background: var(--color-canvas-default);
    color: var(--color-fg-default);
    cursor: pointer;
    text-decoration: none;
  }
  .gh-pagination-btn:hover { background: var(--color-canvas-subtle); }
  .gh-pagination-btn[aria-current="page"] { background: var(--brand-primary); color: var(--brand-on-primary); border-color: var(--brand-primary); }
  .gh-pagination-btn[aria-disabled="true"] { color: var(--color-fg-decorative); cursor: not-allowed; }
  .gh-pagination-btn[aria-current="page"] { cursor: default; }
  .gh-pagination-gap { padding: 0 var(--space-1); color: var(--color-fg-muted); }
  .gh-pagination { flex-wrap: wrap; justify-content: center; margin: var(--space-4) 0; }

  /* ---- gh-bulkbar — sticky bulk-selection bar, not measured in any
     wiremock. Its actions reuse .gh-btn rather than a second button
     family, so it needs no coarse-pointer entry of its own. ---- */
  .gh-bulkbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--brand-primary-subtle);
    border: 1px solid color-mix(in oklab, var(--brand-primary) 25%, transparent);
    border-radius: var(--radius-md);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
  }
  .gh-bulkbar-count { font-weight: 600; color: var(--brand-primary); }
  .gh-bulkbar-actions { display: flex; gap: var(--space-2); }

  /* ---- gh-toast — not measured in any wiremock (aria-live 0 across all
     six). "Notify, never hard-stop" needs a surface a screen reader
     announces without stealing focus. The selector below keys off the
     role="status" attribute itself rather than the class alone, so the
     rule and the requirement are the same fact instead of two things that
     happen to agree by luck. Markup: <div class="gh-toast" role="status"
     aria-live="polite">...</div> — role="status" already implies
     aria-live="polite", the attribute is written explicitly anyway so the
     contract is legible in the markup, not just in the ARIA spec. ---- */
  .gh-toast[role="status"] {
    position: fixed;
    right: var(--space-4);
    bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-canvas-default);
    color: var(--color-fg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px color-mix(in oklab, var(--primer-gray-400) 20%, transparent);
    z-index: var(--z-toast);
  }

  /* ---- gh-dialog — not measured in any wiremock. Styles the native
     <dialog> element rather than a hand-rolled overlay div: showModal()
     gives a focus trap, Escape-to-close and an inert background for free —
     the same "let the platform own it" reasoning as .gh-tooltip below. ---- */
  .gh-dialog {
    /* The UA paints a <dialog> white: in dark mode its text and fields sat on it unreadable. */
    background: var(--color-canvas-default);
    color: var(--color-fg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    max-width: 480px;
    width: calc(100vw - var(--space-6));
    box-shadow: 0 8px 24px color-mix(in oklab, var(--primer-gray-400) 20%, transparent);
  }
  .gh-dialog::backdrop { background: color-mix(in oklab, var(--color-fg-default) 40%, transparent); }
  .gh-dialog-title { font-size: var(--text-16); font-weight: 600; margin: 0 0 var(--space-2); }
  .gh-dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }

  /* ---- gh-field — form field wrapper, not measured in any wiremock.
     .gh-field-input is a new interactive family; base.css's coarse-pointer
     block sizes it. ---- */
  .gh-field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
  .gh-field-label { font-size: var(--text-12); font-weight: 600; color: var(--color-fg-default); }
  /* Primer medium (TextInput, `.form-control`): 32px from 5px + 20px + 5px
     and the border; a min-height, so a textarea still grows by its rows. */
  .gh-field-input {
    min-height: var(--control-medium-size);
    padding: 5px var(--space-3);
    font-size: var(--text-14);
    line-height: 20px;
    font-family: inherit;
    color: var(--color-fg-default);
    background: var(--color-canvas-default);
    border: 1px solid var(--color-control-border);
    border-radius: var(--radius-md);
  }
  /* Primer's disabled control fill; the value stays fg-muted, not Primer's
     fgColor-disabled, because a VIEWER opens this page to read it. */
  .gh-field-input:disabled { color: var(--color-fg-muted); background-color: var(--color-canvas-subtle); cursor: not-allowed; }
  .gh-field-hint { font-size: var(--text-12); color: var(--color-fg-muted); }
  .gh-field-error { font-size: var(--text-12); color: var(--color-danger-fg); }
  .gh-field.has-error .gh-field-input { border-color: var(--color-danger-fg); }

  /* ---- gh-quota — "14 of 20 units used", not measured in any wiremock.
     A native <meter> was tried first and dropped: normalising its track vs.
     fill across engines needs appearance: none plus WebKit-only
     ::-webkit-meter-bar / ::-webkit-meter-optimum-value, and Firefox's
     -moz-meter-bar colours the whole element rather than a separable
     track+fill, so the two engines cannot be brought to one rendering
     without further hacks — accent-color alone (tried initially) does not
     reach Safari at all. That is "kept for the free semantics, rendered
     inconsistently," which is worse than not using <meter>. A plain
     track/fill pair renders identically everywhere; the ARIA below carries
     the semantics explicitly instead of implicitly. Not a clickable
     control, so no coarse-pointer entry. Markup: <div class="gh-quota"
     role="progressbar" aria-valuenow="14" aria-valuemin="0"
     aria-valuemax="20" aria-label="Quota"><div class="gh-quota-fill"
     style="width: 70%"></div></div>. ---- */
  .gh-quota {
    display: block;
    width: 100%;
    height: 8px;
    background: var(--color-canvas-subtle);
    border-radius: var(--radius-full);
    overflow: hidden;
  }
  .gh-quota-fill { display: block; height: 100%; background: var(--brand-primary); border-radius: var(--radius-full); }
  .gh-quota-label { font-size: var(--text-12); color: var(--color-fg-muted); margin-top: var(--space-1); }

  /* ---- gh-avatar — 2 variants (.gh-avatar, .gh-avatar-admin), 2 uses
     (kliper-github-ui-wiremock.html, kliper-github-backoffice-wiremock.html).
     Both wiremocks hardcode the identical rule under two different class
     names; one definition replaces both rather than duplicating it. Not a
     brand or status surface, so its fixed dark chip stays on the Layer-1
     primitive tokens.css added for it, the same as gh-btn-danger:hover
     above. ---- */
  /* Control standard (2026-10-02): an icon on the disc (the first-steps check) takes its on-emphasis colour, not the
     global muted `.octicon`. */
  .gh-avatar .octicon, .gh-avatar-admin .octicon { color: inherit; }
  .gh-avatar, .gh-avatar-admin {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-avatar-bg);
    color: var(--color-avatar-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-11);
    font-weight: 600;
    flex-shrink: 0;
  }

  /* ---- gh-tree — the hierarchy that is the spine of the specification,
     not measured in any wiremock. Nested <details>/<summary> rather than a
     hand-rolled twisty: expand/collapse, keyboard toggling and the
     disclosure role come from the platform, the same reasoning as
     .gh-tooltip and .gh-quota. Markup: <details class="gh-tree-node" open>
     <summary>Node</summary><div class="gh-tree-children"><details
     class="gh-tree-node">...</details></div></details>. The summary row is
     a new interactive family; base.css's coarse-pointer block sizes it. ---- */
  .gh-tree { list-style: none; margin: 0; padding: 0; font-size: var(--text-14); }
  .gh-tree-node > summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    cursor: pointer;
    border-radius: var(--radius-sm);
    list-style: none;
  }
  .gh-tree-node > summary::-webkit-details-marker { display: none; }
  .gh-tree-node > summary:hover { background: var(--color-canvas-subtle); }
  .gh-tree-node[open] > summary { font-weight: 600; }
  .gh-tree-children { padding-left: var(--space-5); border-left: 1px solid var(--color-border-default); }

  /* ---- gh-daterange — not measured in any wiremock. Two native
     <input type="date">s rather than a JS calendar widget: the platform
     owns validation, locale formatting and the picker UI. Its inputs are a
     new interactive family; base.css's coarse-pointer block sizes them. ---- */
  .gh-daterange { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
  .gh-daterange-input {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-12);
    font-family: inherit;
    color: var(--color-fg-default);
    background: var(--color-canvas-default);
    border: 1px solid var(--color-control-border);
    border-radius: var(--radius-sm);
  }
  .gh-daterange-sep { color: var(--color-fg-muted); }

  /* ---- gh-tooltip — via the popover API, not the reverse-engineered CSS
     hover, and not measured in any wiremock. The CSS-first version could
     not work: JavaScript cannot un-hover a :hover state, so Escape had no
     mechanism; touch has neither hover nor Escape; and an
     absolutely-positioned child is clipped by the overflow: auto on every
     table container. The top layer solves the clipping, light-dismiss and
     Escape come free, and SC 1.4.13 does not apply to click-triggered
     content at all — so the hoverable/persistent/dismissible obligation
     dissolves rather than having to be met with more code. Markup:
     <button popovertarget="tt-x" aria-describedby="tt-x">...</button>
     <div id="tt-x" popover class="gh-tooltip">...</div>. The trigger is an
     ordinary button (.gh-btn/.gh-btn-icon), already sized by
     base.css's coarse-pointer block; the popover content itself is not
     clickable, so it needs no entry there. ---- */
  .gh-tooltip[popover] {
    border: 1px solid var(--color-border-default);
    background: var(--color-canvas-default);
    color: var(--color-fg-default);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-12);
    max-width: 280px;
    box-shadow: 0 8px 24px color-mix(in oklab, var(--primer-gray-400) 20%, transparent);
  }
  /* Tooltip (Primer TooltipV2, type label), measured on github.com 2026-10-04: bgColor-emphasis, white 12px,
     `4px 8px`, radius 6px, max 250px, no shadow, 4px from its trigger, a 100ms ease-in fade after 50ms.
     chassis.js gives one to every icon-only control from its aria-label and places it (position: fixed). */
  .gh-tooltip-label[popover] {
    position: fixed; inset: auto; margin: 0;
    max-width: 250px; padding: 4px 8px;
    font: 400 var(--text-12) / 1.625 var(--font-sans); text-align: center; overflow-wrap: break-word;
    color: var(--color-fg-on-emphasis); background: var(--color-tooltip-bg);
    border: 0; border-radius: var(--radius-md);
    pointer-events: none;
    animation: gh-tooltip-appear 100ms ease-in 50ms both;
  }
  @keyframes gh-tooltip-appear { from { opacity: 0; } }

  /* ---- cfg-* — configuration.html (Task 8, tenant-configuration-surface).
     Page-specific rules for the one screen that uses them, kept in THIS
     layer (not the page's own <style>) because an inline <style> needs
     'unsafe-inline' (or a nonce/hash) in style-src, and this page's CSP
     is script-src/style-src 'self' with neither -- an inline block here
     would render unstyled, `.cfg-sr-only` included, which is exactly the
     accessible-name-turned-visible-text defect this fixes. No colour
     literal below: everything comes from the tokens already declared in
     tokens.css. ---- */

    /* The wiremock's page container (`.gh-layout`): 1400px centred, full-bleed below, 20px apart. Its gutters
       are the header's own (16px, 32px from GitHub's 1012px breakpoint), so the side nav starts where the logo
       does; the content column stops at the wiremock's 760px (`.gh-cfg-main`). */
    .cfg-shell { display: flex; gap: 20px; max-width: 1400px; margin: 0 auto; padding: 20px var(--space-4); align-items: flex-start; }
    @media (min-width: 1012px) { .cfg-shell { padding-left: 32px; padding-right: 32px; } }
    .cfg-main { flex: 1; min-width: 0; max-width: 760px; }
    /* gh-subnav turns full-width at 900px; a row shell then left .cfg-main a
       zero-width column pushed past the viewport's right edge. Stack them. */
    @media (max-width: 900px) {
      .cfg-shell { flex-direction: column; align-items: stretch; gap: var(--space-4); }
    }

    .cfg-h1 { font-size: var(--text-20); font-weight: 700; color: var(--color-fg-default); letter-spacing: -0.02em; margin-bottom: var(--space-2); }
    .cfg-h1-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
    .cfg-lead { font-size: var(--text-14); color: var(--color-fg-muted); line-height: 1.55; margin-bottom: var(--space-5); }

    .cfg-block { margin-bottom: var(--space-6); padding-bottom: var(--space-5); border-bottom: 1px solid var(--color-border-muted); }
    .cfg-block:last-of-type { border-bottom: none; }
    .cfg-block-label { display: block; font-size: var(--text-14); font-weight: 600; color: var(--color-fg-default); margin-top: 0; margin-bottom: var(--space-1); }
    /* The wiremock's `.gh-cfg-help`: 13px at 1.5, as wide as the 760px column. */
    .cfg-help { font-size: var(--text-13); color: var(--color-fg-muted); line-height: 1.5; margin-bottom: var(--space-3); }

    .cfg-textarea {
      width: 100%;
      min-height: 96px;
      padding: 10px 14px;
      font-size: var(--text-14);
      line-height: 1.6;
      resize: vertical;
      font-family: inherit;
    }
    #cfg-description { min-height: 96px; }

    .cfg-count-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-top: var(--space-1); }
    .cfg-msg { font-size: var(--text-12); color: var(--color-fg-muted); }
    .cfg-msg.warn { color: var(--color-attention-fg); }
    .cfg-msg.error { color: var(--color-danger-fg); }
    .cfg-counter { font-size: var(--text-12); color: var(--color-fg-muted); white-space: nowrap; }
    .cfg-counter.warn { color: var(--color-attention-fg); }
    .cfg-counter.error { color: var(--color-danger-fg); }
    .cfg-textarea.error { border-color: var(--color-danger-fg); }

    .cfg-callout { background: var(--color-canvas-subtle); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); padding: var(--space-4); font-size: var(--text-12); color: var(--color-fg-default); line-height: 1.55; margin-bottom: var(--space-4); }
    .cfg-callout.warn { background: var(--color-danger-subtle); border-color: color-mix(in oklab, var(--color-danger-fg) 30%, transparent); }
    .cfg-callout strong { font-weight: 600; }

    .cfg-block-header {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      margin-bottom: var(--space-1);
    }
    .cfg-ai-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: var(--text-12);
      padding: 3px 10px;
    }
    .cfg-verified-status {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: var(--text-12);
      color: var(--color-success-fg);
      font-weight: 500;
      margin-top: var(--space-2);
      margin-bottom: var(--space-2);
    }
    .cfg-accordion {
      border: 1px solid var(--color-border-default);
      border-radius: var(--radius-md);
      background: var(--color-canvas-subtle);
      margin-top: var(--space-3);
      margin-bottom: var(--space-4);
      overflow: hidden;
    }
    .cfg-accordion-summary {
      padding: 8px 12px;
      font-size: var(--text-12);
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      user-select: none;
      color: var(--color-fg-default);
    }
    .cfg-accordion-summary:focus-visible {
      outline: 2px solid var(--brand-focus);
      outline-offset: -1px;
    }
    .cfg-accordion-content {
      padding: 10px 12px;
      border-top: 1px solid var(--color-border-default);
      background: var(--color-canvas-default);
      font-size: var(--text-12);
      line-height: 1.5;
      color: var(--color-fg-muted);
    }
    .cfg-accordion-content p {
      margin: 0 0 6px 0;
    }
    .cfg-accordion-content p:last-child {
      margin-bottom: 0;
    }

    .cfg-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-3); }
    .cfg-cmp-bad, .cfg-cmp-good { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--color-canvas-default); border: 1px solid var(--color-border-default); }
    .cfg-cmp-label { display: block; font-size: var(--text-11); font-weight: 700; text-transform: uppercase; margin-bottom: var(--space-1); }
    .cfg-cmp-bad .cfg-cmp-label { color: var(--color-danger-fg); }
    .cfg-cmp-good .cfg-cmp-label { color: var(--color-success-fg); }
    @media (max-width: 640px) { .cfg-cmp { grid-template-columns: 1fr; } }

    /* One box with row dividers (Primer Box + Box-row, the wiremock's `.gh-cfg-rows`), never a stack of cards. */
    .cfg-rows { display: flex; flex-direction: column; border: 1px solid var(--color-border-default); border-radius: 8px; overflow: hidden; margin-bottom: var(--space-3); }
    .cfg-rows:empty { display: none; }
    .cfg-row { display: flex; align-items: center; gap: var(--space-3); padding: 9px var(--space-3); background: var(--color-canvas-default); }
    .cfg-row + .cfg-row { border-top: 1px solid var(--color-border-default); }
    .cfg-rows > .cfg-help { margin: 0; padding: 9px var(--space-3); }
    .cfg-row-body { flex: 1; min-width: 0; }
    .cfg-row-title { font-size: var(--text-14); font-weight: 600; color: var(--color-fg-default); }
    .cfg-row-meta { font-size: var(--text-12); color: var(--color-fg-muted); }
    /* The wiremock's `.gh-cfg-row-kind`: a row's kind or role, right-aligned on its title's line. */
    .cfg-row-kind { font-size: var(--text-12); color: var(--color-fg-muted); flex-shrink: 0; }
    /* A theme row (R-28 PR 1b): the name truncates (full text in its title), the count keeps its width. */
    .cfg-theme-row { flex-wrap: wrap; }
    .cfg-theme-row > .cfg-row-body { flex: 1 1 220px; }
    .cfg-theme-head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
    .cfg-theme-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .cfg-theme-count { flex-shrink: 0; color: var(--color-fg-muted); border-color: var(--color-border-default); }
    .cfg-theme-actions { display: flex; gap: var(--space-1); flex-shrink: 0; align-self: flex-start; }
    .cfg-theme-rename { flex: 1; min-width: 0; }
    .cfg-theme-unsaved { flex-shrink: 0; }
    /* Theme cards (spec 2026-10-06 §1, wiremock ?sec=sector&themes=…): one Box per theme, its words and its anchor. */
    .tc-list { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-3); }
    .tc-card { margin-bottom: 0; }
    .tc-card.is-pending { box-shadow: inset 2px 0 0 var(--color-attention-fg); }
    /* (council C1) The wiremock's header rule whole: one row, wrapping, whatever `gh-box-header` does on a phone. */
    .tc-card > .gh-box-header.tc-head {
      flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px;
    }
    /* (council C21) The wiremock's name rule whole (wiremock:135): a long name ends in an ellipsis, never widens. */
    .tc-name {
      font-size: var(--text-14); font-weight: 600; margin: 0;
      flex: 1 1 8ch; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; /* council C31 */
    }
    /* (council C21) components.css:911 stretches a header's div to full width under 768px; the card's actions stay on
       the name's row down to 620px. */
    .tc-card > .tc-head > .tc-acts {
      width: auto; justify-content: flex-start; margin-left: auto;
      align-self: center; /* council C35: `.cfg-theme-actions` is `align-self: flex-start` (components.css:1860) */
    }
    .tc-part { padding: 12px var(--space-3); }
    .tc-part + .tc-part { border-top: 1px solid var(--color-border-muted); }
    .tc-label { display: block; font-size: var(--text-14); font-weight: 600; }
    .tc-help { margin: 0 0 var(--space-2); font-size: var(--text-12); color: var(--color-fg-muted); }
    /* The field takes the height of its button (32px; 44px where the page grows its buttons on a phone), as the anchor
       field does. */
    .tc-part .cfg-add-inline { max-width: 560px; align-items: stretch; }
    .tc-part .cfg-alias-list { margin: 0 0 8px; }
    .tc-anchor-add { display: flex; gap: var(--space-2); max-width: 360px; margin-top: var(--space-1); }
    .tc-anchor-add .gh-field-input { flex: 1; min-width: 0; }
    @media (max-width: 620px) {
      .tc-card > .tc-head > .tc-acts { margin-left: 0; width: 100%; }
      .tc-acts .gh-btn { min-height: 44px; flex: 1; }
    }
    .tc-part .gh-flash { margin: var(--space-2) 0 0; font-size: var(--text-14); }
    .tc-flash-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
    .tc-all { margin-bottom: var(--space-3); }
    /* Send times: an edition row wraps its messages and checkbox under the time. */
    .cfg-edition { flex-wrap: wrap; align-items: flex-start; }
    .cfg-edition-side { display: flex; align-items: center; gap: var(--space-2); }
    .cfg-edition-side .gh-field-input { width: auto; }
    .cfg-edition-extra { flex-basis: 100%; display: flex; flex-direction: column; gap: var(--space-1); }
    .cfg-check { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-14); }
    .cfg-check input { margin-top: 3px; }
    .cfg-check-help { display: block; margin: 0; }
    .cfg-fieldset { border: none; border-bottom: 1px solid var(--color-border-muted); padding: 0 0 var(--space-5); margin: 0 0 var(--space-6); min-width: 0; }
    .cfg-fieldset > legend { padding: 0; }
    /* The send days are no longer the panel's last block: the monthly report follows them (R-05). */
    .cfg-fieldset.cfg-block:has(+ .cfg-block) { border-bottom: 1px solid var(--color-border-muted); }
    .cfg-days { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); font-size: var(--text-14); }
    .cfg-days label { display: inline-flex; align-items: center; gap: var(--space-1); }
    #schedule .cfg-msg:empty { display: none; }
    .cfg-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); list-style: none; margin: 0 0 var(--space-2); padding: 0; }
    .cfg-alias-list { display: flex; flex-wrap: wrap; gap: var(--space-1); list-style: none; margin: var(--space-1) 0; padding: 0; }

    /* Wraps at 375: the people row (name, role, Add) overflowed the viewport by 127px. */
    .cfg-add-wrap { position: relative; width: 100%; }
    .cfg-add { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
    .cfg-add .gh-field-input { flex: 1 1 140px; min-width: 0; }
    /* Floating suggestion overlay listbox with high z-index */
    .cfg-sug {
      position: absolute;
      top: 100%;
      left: 0;
      width: 100%;
      max-width: 580px;
      z-index: 1050;
      margin-top: 6px;
      border: 1px solid var(--color-border-default);
      border-radius: 8px;
      background: var(--color-canvas-default);
      box-shadow: var(--shadow-overlay);
    }
    .cfg-sug[hidden] { display: none; }
    /* Primer Overlay: suggestions.js `place` flips it above its field, or caps its height, to stay in the viewport. */
    .cfg-sug { overflow-y: auto; overscroll-behavior: contain; }
    .cfg-sug.cfg-sug-above { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 6px; }
    .cfg-sug-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--color-border-muted); font-size: 12px;
      color: var(--color-fg-muted); }
    .cfg-sug-head-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
    .cfg-sug-more { flex-shrink: 0; }
    .cfg-sug-list { list-style: none; margin: 0; padding: 4px 0; max-height: 240px; overflow-y: auto; }
    .cfg-sug-list[hidden] { display: none; }
    .cfg-sug-options { list-style: none; margin: 0; padding: 4px 12px 6px; display: flex; flex-wrap: wrap; gap: 6px; }
    /* Sentence case, as the wiremock's `gh-cfg-sug-band` (owner review 2026-10-06): the uppercase was not Primer's. */
    .cfg-sug-band { display: block; padding: 8px 12px 4px; font-size: 12px; font-weight: 600; color: var(--color-fg-muted); }
    /* A split chip (the wiremock's `gh-cfg-sug-item`): "+ name" accepts, the info IconButton shows why. */
    .cfg-sug-item { display: inline-flex; align-items: stretch; max-width: 100%; min-height: 26px;
      border: 1px solid var(--color-border-default); border-radius: 999px; background: var(--color-canvas-subtle); overflow: hidden; }
    .cfg-sug-option { display: inline-flex; align-items: center; min-width: 0;
      padding: 0 8px 0 8px; font-size: 12px; line-height: 24px; cursor: pointer; color: var(--color-fg-default);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cfg-sug-option::before { content: "+"; margin-right: 5px; font-weight: 600; color: var(--color-fg-muted); }
    .cfg-sug-option:hover { background: var(--color-accent-subtle); color: var(--color-accent-fg); }
    .cfg-sug-item:has(.cfg-sug-option[aria-selected="true"]) { border-color: var(--color-accent-emphasis); box-shadow: inset 0 0 0 1px var(--color-accent-emphasis); }
    .cfg-sug-option[aria-selected="true"] { background: var(--color-accent-subtle); }
    .cfg-sug-info { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 26px; padding: 0 5px;
      border: 0; border-left: 1px solid var(--color-border-muted); background: transparent; color: var(--color-fg-muted); cursor: pointer; }
    .cfg-sug-info .octicon { width: 14px; height: 14px; }
    .cfg-sug-info:hover, .cfg-sug-info[aria-expanded="true"] { background: var(--color-action-hover); color: var(--color-accent-fg); }
    .cfg-sug-info:focus-visible { outline: 2px solid var(--color-accent-emphasis); outline-offset: -2px; }
    .cfg-sug-status { margin: 0; padding: 8px 12px; font-size: 12px; color: var(--color-fg-muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .cfg-sug-status[hidden] { display: none; }
    .cfg-sug-why { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
      padding: 8px 12px; font-size: 12px; border-top: 1px solid var(--color-border-muted); }
    .cfg-sug-why[hidden] { display: none; }
    .cfg-sug-why-text { margin: 0; min-width: 0; overflow-wrap: anywhere; }
    /* R-29 PR 3c: coverage-rule suggestions (day-zero wiremock `gh-cfg-props`/`gh-cfg-rule-sug`, D20). A clause is
       a list row under its textarea, unscored; it wraps, never truncates (up to 500 characters). Corrections: the
       inline `style=` becomes `.cfg-rule-body`, and the buttons keep Primer's small height (no own min-height). */
    .cfg-props { margin-top: var(--space-2); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); overflow: hidden; }
    .cfg-props-head, .cfg-props-foot { padding: 7px 10px; font-size: var(--text-12); color: var(--color-fg-muted); background: var(--color-canvas-subtle); }
    .cfg-props-head { border-bottom: 1px solid var(--color-border-muted); }
    .cfg-props-foot { border-top: 1px solid var(--color-border-muted); }
    .cfg-rule-sug { display: flex; align-items: flex-start; gap: var(--space-2); padding: 8px 10px; border-bottom: 1px solid var(--color-border-muted);
      font-size: 13px; line-height: 1.5; }
    .cfg-rule-sug:nth-last-child(2) { border-bottom: 0; }
    .cfg-rule-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
    .cfg-rule-why { margin-top: 4px; font-size: var(--text-12); color: var(--color-fg-muted); }
    .cfg-rule-acts { display: flex; flex-wrap: wrap; gap: 4px; flex-shrink: 0; }
    .cfg-add-inline { display: flex; gap: var(--space-1); align-items: center; margin-top: var(--space-1); }
    .cfg-add-inline input { flex: 1; font-size: var(--text-12); padding: 4px var(--space-2); }
    /* "+ outro nome" (wiremock `gh-cfg-alias-add`): a small link-coloured button after the alias chips, the
       plus an Octicon, never a glyph; the shared :focus-visible ring. */
    .cfg-alias-item { display: inline-flex; }
    .cfg-alias-add { display: inline-flex; align-items: center; gap: 2px; min-height: 24px; padding: 0 4px; border: 0; border-radius: var(--radius-sm);
      background: none; font: inherit; font-size: var(--text-12); line-height: 18px; color: var(--color-accent-fg); cursor: pointer; white-space: nowrap; }
    .cfg-alias-add > .octicon { width: 12px; height: 12px; }
    .cfg-alias-add:hover { text-decoration: underline; }
    /* The draft (R-29 PR 3a, wiremock `gh-cfg-pending-tag`/`gh-cfg-draft`): an unsaved item says so in text, never
       by colour alone. Since 2026-10-06 the text is said once per section, by a Primer Label--attention beside its
       heading (`.cfg-pending-count`), and by the draft bar; each item carries one quiet marker (a 2px attention
       edge on a row, a dot on a chip) and an `.sr-only` "not saved". No dashed border: on a row with no border of its
       own, `border-style: dashed` drew four medium (3px) borders in the text colour. The bar sits in flow above the
       footer. */
    .cfg-row.is-pending { box-shadow: inset 2px 0 0 var(--color-attention-fg); }
    .gh-pill.is-pending::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--color-attention-fg); }
    :is(h2, .cfg-block-label):has(> .cfg-pending-count) { display: flex; align-items: center; flex-wrap: wrap; }
    .cfg-pending-count { margin-left: 8px; }
    .cfg-pending-count[hidden] { display: none; }
    .cfg-draft { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: var(--space-4); padding: 8px 12px;
      border: 1px solid var(--color-attention-fg); border-radius: var(--radius-md); background: var(--color-canvas-subtle); font-size: 13px; }
    .cfg-draft-count { font-weight: 600; }
    .cfg-draft-note { flex: 1 1 200px; color: var(--color-fg-muted); }

    .cfg-x { cursor: pointer; border: none; background: none; color: var(--color-fg-muted); font-size: var(--text-14); line-height: 1; padding: 2px 4px; border-radius: var(--radius-sm); }
    .cfg-x:hover { color: var(--color-danger-fg); background: var(--color-danger-subtle); }
    /* The remove and add icons are Octicons (R-29 PR 3a): they follow the control's colour, 12px inside a pill. */
    .cfg-x > .octicon, .cfg-add-inline .gh-btn > .octicon { color: inherit; }
    .gh-pill-remove > .octicon { width: 12px; height: 12px; }
    /* A reader who cannot remove anything is not shown a remove control. */
    .cfg-x:disabled, .gh-pill-remove:disabled { visibility: hidden; }

    .cfg-warning { display: flex; gap: var(--space-3); background: var(--color-canvas-subtle); border: 1px solid var(--color-attention-fg); border-radius: var(--radius-md); padding: var(--space-3); margin-bottom: var(--space-3); font-size: var(--text-12); }
    .cfg-warning-acts { display: flex; gap: var(--space-2); margin-top: var(--space-2); }

    .cfg-footer { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap; }
    .cfg-footer-note { font-size: var(--text-12); color: var(--color-fg-muted); max-width: 48ch; }
    .cfg-error-banner { font-size: var(--text-12); color: var(--color-danger-fg); margin-top: var(--space-2); }

    /* Recipients (plan R-25, Task 9): a Box row per group, a member list in the dialog, two legends. */
    .cfg-plain-list { list-style: none; margin-left: 0; padding: 0; }
    .cfg-h2 { font-size: var(--text-16); font-weight: 600; margin: var(--space-5) 0 var(--space-2); }
    .cfg-lock-note { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--color-fg-muted); }
    .cfg-lock-note > .octicon { flex-shrink: 0; margin-top: 2px; }
    .cfg-group { align-items: flex-start; }
    .cfg-group-name { font-size: var(--text-14); font-weight: 600; overflow-wrap: anywhere; }
    .cfg-labels { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
    .cfg-group-actions { display: flex; gap: var(--space-1); align-items: center; flex-shrink: 0; }
    .cfg-icon-btn { display: inline-flex; padding: 6px; border: 0; border-radius: var(--radius-md); background: none; color: var(--color-fg-muted); cursor: pointer; }
    .cfg-icon-btn:hover { background: var(--color-danger-subtle); color: var(--color-danger-fg); }
    .cfg-group details { margin-top: var(--space-2); font-size: var(--text-12); }
    .cfg-group summary { cursor: pointer; color: var(--color-link-fg); }
    .cfg-members { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); }
    .cfg-member { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); font-size: var(--text-12); }
    .cfg-member + .cfg-member { border-top: 1px solid var(--color-border-muted); }
    .cfg-member-text { flex: 1; min-width: 12ch; overflow-wrap: anywhere; }
    .cfg-member-name { font-weight: 600; color: var(--color-fg-default); }
    .cfg-member-mail { color: var(--color-fg-muted); }
    .cfg-member-state { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }
    .cfg-member-empty { padding: var(--space-3); color: var(--color-fg-muted); font-size: var(--text-12); }
    .cfg-input-group { display: flex; gap: var(--space-2); }
    .cfg-input-group .gh-form-input { flex: 1; min-width: 0; }
    .cfg-blankslate { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-4); text-align: center; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); color: var(--color-fg-muted); font-size: var(--text-14); }
    .cfg-blankslate[hidden] { display: none; }
    .cfg-blankslate > .octicon { width: 24px; height: 24px; }
    .cfg-blankslate-title { font-size: var(--text-20); font-weight: 600; color: var(--color-fg-default); margin: 0; }
    .cfg-blankslate p { max-width: 48ch; margin: 0; }
    .cfg-legend { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-3); align-items: baseline; margin: 0 0 var(--space-4); font-size: var(--text-12); color: var(--color-fg-muted); }
    .cfg-legend dd { margin: 0; }
    #recipients .gh-flash { font-size: var(--text-14); }
    #group-dialog fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
    /* The body scrolls inside the viewport; the footer's divider shows only while it does. */
    .cfg-dialog-scroll { max-height: calc(100dvh - 180px); overflow-y: auto; }
    #group-footer.scrolls { border-top: 1px solid var(--color-border-muted); padding-top: var(--space-3); }

    /* Text, so fg-muted: fg-decorative is for icons and measured 3.89:1 on the
       active link's gray-150, under the 4.5:1 text floor. */
    .cfg-optional { font-size: var(--text-11); font-weight: 500; color: var(--color-fg-muted); }
    .cfg-state { display: inline-flex; align-items: center; }
    /* display above outranks the UA's [hidden]; without this both the done
       tick and the to-do dot showed on every section. */
    .cfg-state[hidden] { display: none; }
    .cfg-state-done { color: var(--color-success-fg); }
    /* The shared .octicon rule mutes every icon; a done check keeps the success colour (wiremock `gh-cfg-feito`). */
    .cfg-state-done > .octicon { color: inherit; }
    .cfg-dot { width: 8px; height: 8px; border-radius: var(--radius-full); border: 1.5px solid var(--color-fg-decorative); display: inline-block; }
    .cfg-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

    .cfg-progress { font-size: var(--text-11); color: var(--color-fg-muted); padding: 0 var(--space-2); }

    /* R-29 PR 3a: *Setor e temas* locked until *Sobre a instituição* is settled (ADR 010 d12). Focusable, not
       a link: the lock and the muted second line say why (Control standards, "locked navigation entry"). */
    .cfg-nav-locked { justify-content: flex-start; cursor: default; }
    .cfg-nav-locked:hover { background-color: transparent; }
    .cfg-nav-locked > .octicon { flex-shrink: 0; color: var(--color-fg-muted); }
    /* The day-zero welcome (wiremock `gh-cfg-hand`): in flow above the sections, never over the Save footer. */
    .cfg-hand { border: 1px solid var(--color-success-fg); border-radius: 8px; background: var(--color-canvas-subtle); padding: 14px 16px; margin-bottom: var(--space-5); }
    .cfg-hand-top { display: flex; align-items: flex-start; gap: 10px; }
    .cfg-hand-top > .octicon { color: var(--color-success-fg); flex-shrink: 0; margin-top: 2px; }
    .cfg-hand-txt { flex: 1; min-width: 0; margin: 0; font-size: 13px; line-height: 1.6; color: var(--color-fg-muted); overflow-wrap: anywhere; }
    .cfg-hand-txt strong { color: var(--color-fg-default); font-weight: 600; }
    .cfg-hand-txt code { font-size: var(--text-12); background: var(--color-canvas-default); border: 1px solid var(--color-border-muted); padding: 1px 5px; border-radius: var(--radius-sm); }
    .cfg-bar-wrap { margin-top: var(--space-3); }
    .cfg-bar-track { height: 6px; border-radius: 3px; background: var(--color-border-muted); overflow: hidden; }
    .cfg-bar-fill { height: 100%; width: 0; background: var(--color-success-fg); border-radius: 3px; }
    .cfg-bar-label { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: var(--text-12); color: var(--color-fg-muted); margin-top: 6px; }
    .cfg-nav-sub { display: block; font-size: var(--text-12); font-weight: 400; color: var(--color-fg-muted); overflow: hidden; text-overflow: ellipsis; }

    /* ---- R-29 PR 3b: *Sobre a instituição* — the subject box, the proposal card, the status row and the gate
       box, ported from the configuration wiremock (`gh-cfg-subject`, `gh-cfg-proposal*`, `gh-cfg-meter*`,
       `gh-cfg-gate*`) as `cfg-*`. Tokens only; the wiremock's hex mark colour and hex fallbacks are not ported. ---- */
    .cfg-subject { border: 1px solid var(--color-border-default); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: var(--space-4); }
    .cfg-subject[hidden], .cfg-subject [hidden] { display: none; }
    .cfg-subject-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 13px; }
    .cfg-subject-type { font-weight: 600; }
    .cfg-subject-src { font-size: var(--text-12); color: var(--color-fg-muted); margin-top: var(--space-1); overflow-wrap: anywhere; }
    .cfg-subject .gh-select-dropdown { min-width: 300px; max-width: calc(100vw - 32px); }
    .cfg-subject .gh-select-item-content { display: flex; flex-direction: column; gap: 2px; }
    .cfg-subject .gh-select-item-title, .cfg-subject .gh-select-item-desc { white-space: normal; }
    .cfg-subject-btn { height: var(--control-small-size); padding: 0 var(--space-2); font-size: var(--text-12); gap: var(--space-1); }
    .cfg-subject-error { margin-top: var(--space-1); }
    .cfg-cnpj { margin-top: 10px; }
    .cfg-cnpj .cfg-block-label { margin-bottom: var(--space-1); }
    .cfg-cnpj-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
    .cfg-cnpj-row .gh-field-input { flex: 1; min-width: 180px; max-width: 260px; }
    .cfg-cnpj-row .gh-field-input.error { border-color: var(--color-danger-fg); }
    .cfg-cnpj .cfg-msg { display: block; margin-top: var(--space-1); }
    .gh-btn.is-pending { cursor: progress; }

    .cfg-notice { border: 1px solid var(--color-border-default); border-left: 3px solid var(--color-accent-fg); border-radius: var(--radius-md); padding: 9px 12px; font-size: 13px; margin: 10px 0 var(--space-2); overflow-wrap: anywhere; }
    .cfg-notice[hidden] { display: none; }
    .cfg-notice-attention { border-left-color: var(--color-attention-fg); }
    .cfg-ai-again:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }

    .cfg-proposal {
      border: 1px solid var(--color-accent-fg);
      border-radius: var(--radius-md);
      margin: 12px 0 16px;
      overflow: hidden;
      background: var(--color-canvas-default);
    }
    .cfg-proposal[hidden], .cfg-proposal [hidden] { display: none; }
    .cfg-proposal-head, .cfg-proposal-skeleton, .cfg-proposal-slow { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 10px 14px; font-size: 13px; font-weight: 600; background: var(--color-canvas-subtle); border-bottom: 1px solid var(--color-border-muted); }
    .cfg-proposal-skeleton, .cfg-proposal-slow { border-bottom: 0; font-weight: 400; color: var(--color-fg-muted); }
    .cfg-proposal-cols { display: grid; grid-template-columns: minmax(0, 1fr); }
    .cfg-proposal-card.is-compared .cfg-proposal-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cfg-proposal-col { padding: 12px 14px; font-size: var(--text-14); line-height: 1.6; min-width: 0; }
    .cfg-proposal-col + .cfg-proposal-col { border-left: 1px solid var(--color-border-muted); }
    .cfg-proposal-col h4 { margin: 0 0 6px; font-size: var(--text-12); font-weight: 600; color: var(--color-fg-muted); display: flex; justify-content: space-between; gap: var(--space-2); }
    .cfg-proposal-col p { margin: 0; overflow-wrap: anywhere; }
    .cfg-proposal-text { padding: 12px 14px; font-size: var(--text-14); line-height: 1.6; margin: 0; overflow-wrap: anywhere; }
    .cfg-proposal-yours p { color: var(--color-fg-muted); }
    .cfg-proposal-ev { font-size: var(--text-12); color: var(--color-fg-muted); padding: 8px 14px; border-top: 1px solid var(--color-border-muted); overflow-wrap: anywhere; }
    .cfg-proposal-foot, .cfg-proposal-line { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--color-border-muted); flex-wrap: wrap; align-items: center; background: var(--color-canvas-subtle); }
    .cfg-proposal-line { border-top: 0; font-size: 13px; }
    .cfg-proposal-line-text, .cfg-proposal-slow-text { flex: 1 1 200px; min-width: 0; }
    .cfg-proposal-note { margin-left: auto; font-size: 12px; color: var(--color-fg-muted); }
    .cfg-proposal .gh-btn { white-space: nowrap; }

    .cfg-status-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; min-height: 28px; }
    .cfg-status-row .cfg-msg { flex: 1; min-width: 200px; }
    .cfg-status-row [hidden] { display: none; }
    .cfg-meter { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-12); flex-shrink: 0; }
    .cfg-meter-bar { flex: 0 0 72px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
    .cfg-meter-bar span { height: 6px; border-radius: 3px; background: var(--color-border-default); }
    .cfg-meter[data-band="1"] .cfg-meter-bar span:nth-child(-n+1) { background: var(--color-attention-emphasis); }
    .cfg-meter[data-band="2"] .cfg-meter-bar span:nth-child(-n+2) { background: var(--color-accent-emphasis); }
    .cfg-meter[data-band="3"] .cfg-meter-bar span { background: var(--color-success-emphasis); }
    .cfg-meter-band { font-weight: 600; white-space: nowrap; }
    .cfg-meter-note { color: var(--color-fg-muted); }
    .cfg-meter-hints { margin: var(--space-1) 0 0; padding-left: 18px; font-size: var(--text-12); color: var(--color-fg-muted); overflow-wrap: anywhere; }
    .cfg-meter-hints[hidden] { display: none; }

    .cfg-gate { border: 1px solid var(--color-border-default); border-radius: var(--radius-md); overflow: hidden; margin-top: 10px; }
    .cfg-gate[hidden] { display: none; }
    .cfg-gate-head { display: flex; align-items: center; gap: var(--space-2); padding: 8px 12px; font-size: 13px; font-weight: 600; background: var(--color-canvas-subtle); border-bottom: 1px solid var(--color-border-muted); }
    .cfg-gate-body { padding: 10px 12px; font-size: 13px; line-height: 1.55; color: var(--color-fg-muted); overflow-wrap: anywhere; }
    .cfg-gate-bad { border-color: var(--color-danger-fg); }
    .cfg-gate-bad .cfg-gate-head > .octicon { color: var(--color-danger-fg); }
    .cfg-gate-quote { margin: var(--space-2) 0; padding: 6px 10px; border-left: 3px solid var(--color-danger-fg); background: var(--color-canvas-subtle); color: var(--color-fg-default); }
    .cfg-passage mark { background: var(--color-danger-subtle); color: var(--color-danger-fg); font-weight: 600; }

    /* Hit area (Control standards, council B8): every institution action is at least 24×24, and 44 tall on a
       touch-sized screen. */
    @media (max-width: 620px) {
      .cfg-proposal-card.is-compared .cfg-proposal-cols { grid-template-columns: minmax(0, 1fr); }
      .cfg-proposal-col + .cfg-proposal-col { border-left: 0; border-top: 1px solid var(--color-border-muted); }
      .cfg-proposal-note { margin-left: 0; flex-basis: 100%; }
      .cfg-proposal .gh-btn, .cfg-subject-btn, #cfg-description-propose, .cfg-cnpj-row .gh-btn, .cfg-rule-acts .gh-btn { min-height: 44px; }
      .cfg-cnpj-row .gh-field-input { max-width: none; }
      .cfg-rule-sug { flex-wrap: wrap; }
      .cfg-rule-acts { width: 100%; }
    }


    /* ---- Chassis (Task 1): the shared tab bar and panel states, assembled
       from the families above rather than adding a second empty/skeleton/
       error surface. See templates/partials/ui.html. ---- */

    /* ---- octicon — moved from the page per DESIGN.md §2.4: muted at rest,
       default on hover or on the active tab it sits inside. ---- */
    .octicon {
      display: inline-block;
      vertical-align: text-bottom;
      flex-shrink: 0;
      color: var(--color-fg-muted);
      transition: color var(--duration-fast) var(--ease-out);
    }
    /* A tab's icon stays fg-muted on hover, as GitHub's UnderlineNav does:
       only the tab's background answers the pointer. */
    /* `:where()` keeps this hover rule at (0,2,0), so the filled-button rule
       below can beat it on source order. At its old (0,3,1) it won every
       hover, and the muted rule above won at rest: the icon on a navy primary
       button rendered grey, then near-black on hover. */
    :where(a:not(.gh-tab-item), button:not(.gh-tabs-more-btn):not(:disabled)):hover .octicon { color: var(--color-fg-default); }
    /* Primer `btn-primary` / `btn-danger`: the icon takes the label's colour,
       at rest and on hover (white on the filled background). */
    .gh-btn-primary .octicon,
    .gh-btn-danger .octicon,
    .gh-btn-danger-primary .octicon { color: currentColor; }

    /* ---- gh-tabs-more — the collapsible-overflow wrapper underline-nav.js
       positions its dropdown against; gh-dropdown-menu already supplies the
       dropdown's own look. ---- */
    .gh-tabs-more { position: relative; }

    /* ---- gh-tab-pinned — sits outside gh-tabs-container, pushed to the far
       end of gh-tabs-bar's flex row so it never collapses into "More". ---- */
    .gh-tab-pinned { margin-left: auto; }
    /* On a phone the pinned tab is its icon: the label stays the link's name
       (and its title) but gives its width to the current tab. */
    @media (max-width: 543.98px) {
      .gh-tab-pinned-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
      /* Still a 30px pill like every tab, so its underline sits on the bar's rule. */
      .gh-tab-pinned { min-height: 30px; }
    }

    /* ---- tab-panel — the section every tab_nav key renders into. ---- */
    .tab-panel { padding: var(--space-5) var(--space-4); }
    .tab-panel--with-subnav { display: flex; gap: var(--space-5); }
    /* The Dashboard's panel is the wiremock's `.gh-layout`: `main` already carries the page gutters (16px, 32px from
       1012px, where the header's logo starts), so the panel adds none and its side nav starts under the logo; `main`'s
       own top margin is the gap under the tab bar. */
    #panel-dashboard { padding: 0; }

    /* ---- tab-panel-title — the visible <h2> each API-backed panel (War Room,
       Dispatch, Connectors) now carries above its content, so a card's own <h3>
       (gh-connector-title) has an ancestor heading instead of jumping straight
       from the page's <h1>. Same look as gh-box-title, with the bottom margin
       that heading needs and gh-box-title's other callers (inside a flex
       gh-box-header) do not. ---- */
    .tab-panel-title { font-size: 14px; font-weight: 600; color: var(--color-fg-default); margin-bottom: var(--space-3); }

    /* ---- panel-loading — sizing for loading_rows()'s gh-skeleton spans;
       the class itself stays plain gh-skeleton, so this scopes to the
       wrapper instead of adding a second class or an inline style. ---- */
    .panel-loading .gh-skeleton { height: var(--space-6); margin-bottom: var(--space-2); }

    /* ---- feed-compact — the retired portal's Clipping view toggle (D12), on
       #newsGrid, remembered per viewer (localStorage). `.article-summary`/
       `.article-excerpt` were that page's own classes (@layer base) — this
       wins over them because @layer components outranks @layer base
       regardless of selector specificity, the same mechanism that already
       lets gh-* win the tab bar. */
    .feed-compact .article-summary,
    .feed-compact .article-excerpt { display: none; }
    .feed-compact .article-card { padding: var(--space-3); gap: var(--space-2); }

    /* ---- feed-toolbar — the view controls (Sort, the view toggle) at the
       start and the PDF export, the row's action, pushed to the end, as
       GitHub's list headers lay them out (Task 22). One 32px line; the PDF
       group wraps as a unit on a narrow screen. ---- */
    .feed-toolbar { margin-bottom: var(--space-3); }
    .feed-toolbar > #pdfExport { margin-left: auto; }
    .feed-toolbar-status { display: flex; justify-content: flex-end; gap: var(--space-2); }
.subnav:not([open]) nav { display: none; }
@media (max-width: 900px) {}

/* Onboarding styles moved from template */

    /* Estilos próprios do onboarding.
     *
     * Em `@layer components`, pela ordem que tokens.css declara
     * (`@layer tokens, base, components, tenant;`). Fora de camada, este bloco
     * venceria `@layer tenant` e a marca do inquilino deixaria de se aplicar
     * aqui — na única página onde ele acabou de a escolher.
     *
     * Sem um único valor de cor literal: tudo sai dos tokens, que é o que
     * permite a esta página respeitar tema claro, tema escuro e a cor do
     * inquilino sem três folhas de estilo. */
    @layer components {
      .gh-pagina {
        min-height: 100vh;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: var(--space-6) var(--space-4);
        background: var(--color-canvas-subtle);
      }
      .gh-cartao {
        width: 100%;
        max-width: 540px;
        background: var(--color-canvas-default);
        border: 1px solid var(--color-border-default);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        padding: var(--space-6);
      }

      .gh-marca { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-5); }
      .gh-marca strong { font-size: var(--text-16); color: var(--brand-primary); letter-spacing: -0.02em; }

      .gh-head h1 { font-size: var(--text-20); font-weight: 700; color: var(--color-fg-default); letter-spacing: -0.02em; }
      .gh-head p { margin-top: 4px; font-size: var(--text-14); color: var(--color-fg-muted); line-height: 1.45; }
      .gh-head .gh-email { color: var(--color-fg-default); font-weight: 600; word-break: break-all; }

      /* ---- Régua de passos ---- */
      .gh-steps {
        display: flex;
        list-style: none;
        gap: var(--space-3);
        margin: var(--space-5) 0;
        padding: 0 0 var(--space-4);
        border-bottom: 1px solid var(--color-border-muted);
      }
      .gh-step {
        display: flex; align-items: center; gap: 6px; min-width: 0;
        font-size: var(--text-12); color: var(--color-fg-muted);
        transition: color var(--duration-fast) var(--ease-out);
      }
      .gh-step-num {
        flex-shrink: 0;
        width: 22px; height: 22px; border-radius: var(--radius-full);
        display: inline-flex; align-items: center; justify-content: center;
        font-size: var(--text-11); font-weight: 700;
        background: var(--color-canvas-subtle);
        border: 1px solid var(--color-border-default);
        color: var(--color-fg-muted);
      }
      .gh-step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .gh-step.active { color: var(--color-fg-default); font-weight: 600; }
      .gh-step.active .gh-step-num {
        background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on-primary);
      }
      .gh-step.done .gh-step-num {
        background: var(--brand-primary-subtle); border-color: var(--brand-primary); color: var(--brand-primary);
      }
      .gh-step-opt { font-style: normal; font-size: var(--text-11); font-weight: 500; color: var(--color-fg-decorative); }

      /* ---- Painéis ---- */
      .gh-panel { display: none; }
      .gh-panel.show { display: block; }
      .gh-campo { margin-bottom: var(--space-4); text-align: left; }
      /* Not the dropzone: it is a label too, and this outranked its flex row. */
      .gh-campo label:not(.gh-dropzone) { display: block; font-size: var(--text-12); font-weight: 600; color: var(--color-fg-default); margin-bottom: 6px; }
      .gh-hint { margin-top: 6px; font-size: var(--text-11); color: var(--color-fg-muted); line-height: 1.5; }
      .gh-hint strong { color: var(--color-fg-default); font-weight: 600; }
      /* Primer large (github.com/login `.form-control`: 40px, 5px 12px). The
         select's indicator and every field's focus ring are the shared
         control-standards rules at the end of this file. */
      .gh-input, .gh-select {
        width: 100%; height: var(--control-large-size); padding: 0 12px;
        font-family: inherit; font-size: var(--text-14);
        background: var(--color-canvas-default);
        border: 1px solid var(--color-control-border);
        border-radius: var(--radius-md);
        color: var(--color-fg-default);
        transition: border-color var(--duration-fast);
      }

      /* ---- Endereço da organização ---- */
      .gh-handle-field {
        display: flex; align-items: center;
        border: 1px solid var(--color-control-border);
        border-radius: var(--radius-md);
        background: var(--color-canvas-default);
        overflow: hidden;
      }
      /* A `.gh-composite-field`: its ring is the shared one on the wrapper.
         38px inside a 1px border: large. */
      /* A long handle is cut, never the input: the prefix takes at most half the field (whole in its `title`).
         Block, not flex, so text-overflow applies; the field's align-items centres it. */
      .gh-handle-prefix {
        flex: 0 1 auto; min-width: 0; max-width: 50%; padding: 0 4px 0 12px;
        overflow: hidden; text-overflow: ellipsis;
        font-size: var(--text-14); color: var(--color-fg-muted); white-space: nowrap; user-select: none;
      }
      .gh-handle-field input {
        flex: 1; min-width: 0; height: 38px; border: none; padding: 0 12px 0 0;
        font-family: inherit; font-size: var(--text-14);
        background: transparent; color: var(--color-fg-default);
      }
      .gh-check { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: var(--text-11); line-height: 1.45; }
      .gh-check svg { flex-shrink: 0; margin-top: 1px; fill: currentColor; }
      .gh-check.ok { color: var(--color-success-fg); }
      .gh-check.bad { color: var(--color-danger-fg); }
      .gh-check.warn { color: var(--color-attention-fg); }
      .gh-check.muted { color: var(--color-fg-muted); }
      /* `display: flex` above would otherwise beat the `hidden` attribute. */
      .gh-check[hidden] { display: none; }

      /* ---- Identificação oficial (R-42) ---- */
      .gh-idcard {
        margin-bottom: var(--space-4); padding: 12px 14px;
        border: 1px solid var(--color-border-default); border-radius: var(--radius-md);
        background: var(--color-canvas-subtle);
      }
      .gh-idcard-title { font-size: var(--text-12); font-weight: 600; color: var(--color-fg-default); margin-bottom: 4px; }
      /* fg-muted, not the step bar's decorative grey: 4.5:1 on the card's subtle canvas. */
      .gh-idcard .gh-step-opt { color: var(--color-fg-muted); }
      .gh-idcard p { font-size: var(--text-11); color: var(--color-fg-muted); line-height: 1.5; margin-bottom: 10px; }
      .gh-idcard-actions { display: flex; gap: 8px; flex-wrap: wrap; }
      #obLater { align-items: center; margin: 0 0 var(--space-4); }
      /* The country selector sits inside the field, like the handle prefix; the
         field's one ring covers both (`.gh-composite-field`). */
      .gh-handle-field select {
        height: 38px; padding: 0 8px; border: none; border-right: 1px solid var(--color-control-border);
        background: var(--color-canvas-subtle); color: var(--color-fg-default);
        font-family: inherit; font-size: var(--text-12); cursor: pointer;
      }
      .gh-handle-field select + input { padding-left: 12px; font-family: var(--font-mono); letter-spacing: 0.02em; }
      .gh-official {
        margin-top: 10px; border: 1px solid var(--color-border-default); border-radius: var(--radius-md);
        background: var(--color-canvas-subtle); font-size: var(--text-12);
      }
      .gh-official.bad { border-color: var(--color-danger-fg); }
      .gh-official-head { padding: 8px 12px; border-bottom: 1px solid var(--color-border-default); font-size: var(--text-11); color: var(--color-fg-muted); }
      .gh-official-body { padding: 10px 12px; line-height: 1.55; }
      .gh-official-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 600; color: var(--color-fg-default); }
      .gh-official-meta { font-size: var(--text-11); color: var(--color-fg-muted); }
      .gh-input[readonly] { background: var(--color-canvas-subtle); }


      /* ---- Listbox de idioma ---- */
      .gh-listbox { position: relative; }
      .gh-listbox-btn {
        width: 100%; height: var(--control-large-size); padding: 0 12px;
        display: flex; align-items: center; justify-content: space-between; gap: 8px;
        font-family: inherit; font-size: var(--text-14); text-align: left;
        background: var(--color-canvas-default);
        border: 1px solid var(--color-control-border);
        border-radius: var(--radius-md);
        color: var(--color-fg-default); cursor: pointer;
      }
      /* It stands in for a select in the same column: the same ring on the border. */
      .gh-listbox-btn:focus-visible { border-color: var(--brand-focus); outline: 2px solid var(--brand-focus); outline-offset: -1px; }
      .gh-listbox-valor { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
      .gh-listbox-valor svg { flex-shrink: 0; border-radius: 2px; }
      .gh-listbox-menu {
        position: absolute; top: calc(100% + 4px); left: 0; right: 0;
        z-index: var(--z-dropdown);
        margin: 0; padding: 4px; list-style: none;
        background: var(--color-canvas-default);
        border: 1px solid var(--color-border-default);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
      }
      .gh-listbox-menu li {
        display: flex; align-items: center; gap: 8px;
        padding: 7px 8px; border-radius: var(--radius-sm);
        font-size: var(--text-14); color: var(--color-fg-default); cursor: pointer;
      }
      .gh-listbox-menu li:hover { background: var(--color-canvas-subtle); }
      .gh-listbox-menu li svg:first-child { flex-shrink: 0; border-radius: 2px; }
      .gh-listbox-check { margin-left: auto; color: var(--brand-primary); visibility: hidden; flex-shrink: 0; }
      .gh-listbox-menu li[aria-selected="true"] .gh-listbox-check { visibility: visible; }

      /* ---- Identidade visual ---- */
      .gh-brand-row { display: flex; align-items: center; gap: 8px; }
      .gh-swatch-input {
        width: 44px; height: var(--control-large-size); padding: 2px;
        border: 1px solid var(--color-control-border);
        border-radius: var(--radius-md);
        background: var(--color-canvas-default);
        cursor: pointer; flex-shrink: 0;
      }
      .gh-contrast { margin-top: 10px; }
      .gh-contrast-preview {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 10px 14px; border-radius: var(--radius-md);
        font-size: var(--text-12); font-weight: 600;
      }
      .gh-ratio { font-family: var(--font-mono); font-size: var(--text-11); }
      .gh-contrast-meta { margin-top: 6px; font-size: var(--text-11); color: var(--color-fg-muted); line-height: 1.5; }

      .gh-dropzone {
        display: flex; align-items: center; gap: 10px;
        padding: 14px; cursor: pointer;
        border: 1px dashed var(--color-border-default);
        border-radius: var(--radius-md);
        background: var(--color-canvas-subtle);
        transition: border-color var(--duration-fast), background var(--duration-fast);
      }
      .gh-dropzone:hover { border-color: var(--brand-primary); }
      /* A `.gh-composite-field`: the hidden input takes the keyboard focus, the
         zone draws the shared ring. */
      .gh-dropzone.tem-arquivo { border-style: solid; border-color: var(--brand-primary); background: var(--brand-primary-subtle); }
      .gh-dropzone-icone { color: var(--color-fg-muted); display: inline-flex; flex-shrink: 0; }
      .gh-dropzone-texto { flex: 1; min-width: 0; font-size: var(--text-12); color: var(--color-fg-muted); overflow: hidden; text-overflow: ellipsis; }
      .gh-dropzone-btn {
        flex-shrink: 0; padding: 4px 10px; border-radius: var(--radius-sm);
        border: 1px solid var(--color-control-border);
        background: var(--color-canvas-default);
        font-size: var(--text-11); font-weight: 600; color: var(--color-fg-default);
      }
      .gh-norma { margin-top: 10px; font-size: var(--text-11); color: var(--color-fg-muted); line-height: 1.6; }
      .gh-norma-titulo { font-weight: 700; color: var(--color-fg-default); margin-bottom: 4px; }
      .gh-norma ul { margin: 0; padding-left: 18px; }
      .gh-norma strong { color: var(--color-fg-default); font-weight: 600; }

      /* ---- Nota de administrador ---- */
      .gh-admin {
        margin-top: var(--space-4); padding: 12px 14px;
        border: 1px solid var(--color-border-default);
        border-radius: var(--radius-md);
        background: var(--color-canvas-subtle);
      }
      .gh-admin-head { display: flex; align-items: center; gap: 6px; font-size: var(--text-12); font-weight: 700; color: var(--color-fg-default); }
      .gh-admin-head svg { flex-shrink: 0; color: var(--brand-primary); }
      .gh-admin-text { margin-top: 4px; font-size: var(--text-11); color: var(--color-fg-muted); line-height: 1.55; }
      .gh-admin-text strong { color: var(--color-fg-default); font-weight: 600; }

      /* ---- Aviso ---- */
      .gh-aviso { display: none; margin-bottom: var(--space-4); padding: 10px 14px; border-radius: var(--radius-md); font-size: var(--text-12); line-height: 1.45; }
      .gh-aviso.error { display: block; background: var(--color-danger-subtle); border: 1px solid var(--color-danger-fg); color: var(--color-danger-fg); }
      .gh-aviso.success { display: block; background: var(--color-success-subtle); border: 1px solid var(--color-success-fg); color: var(--color-success-fg); }

      /* ---- Rodapé do cartão ---- */
      .gh-foot {
        display: flex; align-items: center; gap: 8px;
        margin-top: var(--space-5); padding-top: var(--space-4);
        border-top: 1px solid var(--color-border-muted);
      }
      .gh-foot .gh-btn-primary { margin-left: auto; }
      /* Scoped to onboarding's footer: unscoped, the 38px height reached every
         .gh-btn in the app (browser gate, 2026-09-24). */
      .gh-foot .gh-btn {
        height: 38px; padding: 0 16px; border-radius: var(--radius-md);
        font-family: inherit; font-size: var(--text-14); font-weight: 600;
        cursor: pointer;
        background: var(--color-canvas-default);
        border: 1px solid var(--color-control-border);
        color: var(--color-fg-default);
        transition: background var(--duration-fast), border-color var(--duration-fast);
      }
      .gh-foot .gh-btn:hover { background: var(--color-canvas-subtle); }
      .gh-foot .gh-btn:disabled { opacity: 0.55; cursor: not-allowed; }
      .gh-foot .gh-btn-primary {
        background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on-primary);
        display: inline-flex; align-items: center; gap: 8px;
      }
      .gh-foot .gh-btn-primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); }

      .gh-sair { display: block; margin-top: var(--space-4); text-align: center; font-size: var(--text-11); color: var(--color-fg-muted); }

      @media (max-width: 480px) {
        .gh-pagina { padding: 0; }
        .gh-cartao { border: none; border-radius: 0; min-height: 100vh; padding: var(--space-5) var(--space-4); }
        /* Abaixo desta largura os quatro rótulos não cabem; os números ficam,
           porque são eles que dizem onde se está. */
        .gh-step-label { display: none; }
        .gh-steps { gap: var(--space-2); }
        .gh-foot { flex-wrap: wrap; }
      }
      @media (hover: none) and (pointer: coarse) {
        .gh-input, .gh-select, .gh-foot .gh-btn, .gh-listbox-btn { min-height: 44px; }
        .gh-handle-field, .gh-handle-field input, .gh-handle-field select { min-height: 42px; }
      }
    }
  
}

/* error.html: GitHub's error block — a muted octicon, a 20px/600 title, one
   muted sentence, the way back, and the problem's code for support. */
@layer components {
  .gh-error-page {
    max-width: 544px;
    margin: var(--space-8) auto;
    padding: 0 var(--space-4);
    text-align: center;
  }
  .gh-error-page > .octicon { width: 32px; height: 32px; color: var(--color-fg-muted); }
  .gh-error-page h1 {
    margin: var(--space-4) 0 var(--space-2);
    font-size: var(--text-20);
    font-weight: 600;
    color: var(--color-fg-default);
  }
  .gh-error-page p { margin: 0 0 var(--space-5); font-size: var(--text-14); color: var(--color-fg-muted); }
  .gh-error-code {
    display: block;
    margin-top: var(--space-5);
    font-size: var(--text-12);
    color: var(--color-fg-muted);
  }
  .gh-error-code code { font-family: var(--font-mono); }
}

/* The back office's Super admins tab (plan 2026-09-24-super-admin-invitations,
   Task 12): ported from kliper-github-backoffice-wiremock.html, the owner-
   approved Task 11b design, onto the tokens. Primer components: qualifier
   search (the GitHub Issues one), state counters, SelectPanel / ActionMenu,
   Label, TimelineItem, Tooltip, Flash, Dialog with FormControl and a
   width-stable loading button. Corrections to the wiremock, per AGENTS.md §10:
   every hex and rgba became a token (so the tab follows the dark theme), the
   bespoke focus outlines gave way to base.css's global ring, and the
   wiremock's `.gh-avatar` (a 20px accent disc) is `.gh-al-avatar` here,
   because the product's `.gh-avatar` is the header's 28px initials disc. */
@layer components {
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

  /* main rendered this h1 at 14px: `.tab-panel-title` is redefined further up
     for the portal's <h2> panel titles, and the later rule won. */
  .gh-panel-header > .tab-panel-title { font-size: var(--text-20); margin: 0; }
  /* side_nav() marks the current item with aria-current, as ARIA wants. */
  .gh-subnav-link[aria-current="true"] { font-weight: 600; background-color: var(--color-action-selected); }
  .gh-subnav-link[aria-current="true"]::before {
    content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
    background-color: var(--color-link-fg); border-radius: 2px;
  }
  /* ActionList (Primer `.ActionListItem-label--truncate`): one line, ellipsis,
     the full text in the item's title; the counter keeps its size, centred. */
  .gh-subnav-link { gap: var(--space-2); }
  .gh-subnav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gh-subnav-link .gh-tab-badge { flex-shrink: 0; margin-left: auto; }
  /* side_nav() draws its groups as lists. */
  ul.gh-subnav-group { list-style: none; margin: 0 0 var(--space-4); padding: 0; }
  /* `hidden` must win over each family's own `display` (gh-empty, gh-pagination, gh-flash…). */
  .gh-layout-main [hidden] { display: none; }
  @media (max-width: 900px) {
    .gh-layout { flex-direction: column; gap: var(--space-3); }
  }

  /* Buttons the tab adds to the gh-btn family. */
  .gh-btn-danger-primary {
    color: var(--primer-gray-0);
    background-color: var(--color-danger-fg);
    border-color: color-mix(in oklab, var(--color-fg-default) 15%, transparent);
  }
  .gh-btn-danger-primary:hover { color: var(--primer-gray-0); background-color: var(--primer-red-700); }
  .gh-btn[aria-disabled="true"] { cursor: progress; }
  .gh-btn.is-loading > .gh-btn-label { visibility: hidden; }
  .gh-btn.is-loading > .gh-spinner { position: absolute; inset: 0; margin: auto; }
  .gh-spinner { width: 16px; height: 16px; animation: gh-spin 1s linear infinite; }
  .gh-spinner[hidden] { display: none; }
  @keyframes gh-spin { to { transform: rotate(360deg); } }

  /* Label and Counter (Primer) are the only badge sizes (Control standards, 2026-10-04). Measured on github.com:
     Label 20px, 12/500, `0 6px`, 1px border, fully rounded (Label--large 24px, `0 8px`, line-height 22px);
     Counter 20px, min-width 20px, 12/500, `0 6px`, a transparent 1px border, the neutral-muted fill. Every badge
     class is an alias that keeps only its colours; `:where()` keeps these at zero specificity so any colour rule,
     wherever it sits, wins over the default border. */
  :where(.gh-label, .gh-status-badge, .gh-plan-badge, .gh-badge, .gh-channel-pill) {
    display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px;
    font-size: var(--text-12); font-weight: 500; line-height: 18px; white-space: nowrap;
    border: 1px solid var(--color-border-default); border-radius: var(--radius-full);
  }
  :where(.gh-label-lg) { height: 24px; padding: 0 8px; line-height: 22px; }
  :where(.gh-counter, .gh-tab-badge) {
    display: inline-block; min-width: 20px; height: 20px; padding: 0 6px;
    font-size: var(--text-12); font-weight: 500; line-height: 18px; text-align: center; white-space: nowrap;
    border: 1px solid transparent; border-radius: var(--radius-full);
    background-color: var(--color-action-counter); color: var(--color-fg-default);
  }
  .gh-label-attention { color: var(--color-attention-text); border-color: var(--color-attention-muted); }
  .gh-label-success   { color: var(--color-success-fg); border-color: var(--color-success-muted); }
  .gh-label-secondary { color: var(--color-fg-muted); border-color: var(--color-border-default); }
  .gh-label-danger    { color: var(--color-danger-fg); border-color: var(--color-danger-muted); }
  .gh-label-accent    { color: var(--color-accent-fg); border-color: var(--color-accent-muted); }

  /* Flash (Primer). */
  .gh-flash {
    display: flex; gap: var(--space-2); align-items: flex-start;
    padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
    border: 1px solid; border-radius: var(--radius-md); font-size: var(--text-14);
  }
  .gh-flash[hidden] { display: none; }
  .gh-flash > .octicon { flex-shrink: 0; margin-top: 3px; }
  .gh-flash-success { background: var(--color-success-subtle); border-color: var(--color-success-muted); }
  .gh-flash-success > .octicon { color: var(--color-success-fg); }
  .gh-flash-error { background: var(--color-danger-subtle); border-color: var(--color-danger-muted); }
  .gh-flash-error > .octicon { color: var(--color-danger-fg); }
  .gh-flash-attention { background: var(--color-attention-subtle); border-color: var(--color-attention-muted); }
  .gh-flash-attention > .octicon { color: var(--color-attention-fg); }

  /* Dialog (Primer): header, body, footer, and no padding of its own then. The
     older one-block dialogs (Create organization) keep .gh-dialog's padding. */
  .gh-dialog:has(.gh-dialog-header) { padding: 0; }
  .gh-dialog-confirm { max-width: 400px; }
  .gh-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); padding: var(--space-4) var(--space-4) var(--space-2); }
  .gh-dialog-header > div { flex: 1; min-width: 0; }
  .gh-dialog-header .gh-dialog-title { margin: 0; font-size: var(--text-14); line-height: 20px; }
  /* The title can carry a person's or a tenant's name: an unbroken one wraps, never widens the dialog past
     the screen or pushes the close button out (PR 468 review). */
  .gh-dialog-title { overflow-wrap: anywhere; min-width: 0; }
  .gh-dialog-description { margin: 2px 0 0; font-size: var(--text-12); line-height: 18px; color: var(--color-fg-muted); }
  .gh-dialog-close {
    display: inline-flex; padding: var(--space-2); margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) 0 0;
    border: 0; border-radius: var(--radius-md); background: none; color: var(--color-fg-muted); cursor: pointer;
  }
  .gh-dialog-close:hover { background: var(--color-action-hover); color: var(--color-fg-default); }
  .gh-dialog-body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-2) var(--space-4) var(--space-4); }
  .gh-dialog-body > p { margin: 0; }
  .gh-dialog-body .gh-flash { margin-bottom: 0; font-size: 13px; }
  .gh-dialog-footer { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-2) var(--space-4) var(--space-4); }
  .gh-dialog[open] { animation: gh-dialog-in 200ms var(--ease-overlay); }
  @keyframes gh-dialog-in { from { opacity: 0; transform: scale(0.96); } }

  /* FormControl (Primer). */
  .gh-form-control { display: flex; flex-direction: column; gap: var(--space-1); }
  .gh-form-label { font-size: var(--text-14); font-weight: 600; }
  .gh-form-input {
    height: var(--control-medium-size); padding: 5px var(--space-3);
    font-size: var(--text-14); line-height: 20px; color: var(--color-fg-default);
    border: 1px solid var(--color-control-border); border-radius: var(--radius-md); background: var(--color-canvas-default);
  }
  .gh-form-input[aria-invalid="true"] { border-color: var(--color-danger-fg); }
  .gh-form-caption { font-size: var(--text-12); color: var(--color-fg-muted); text-wrap: pretty; }
  .gh-form-validation { display: flex; gap: var(--space-1); align-items: center; font-size: var(--text-12); font-weight: 600; color: var(--color-danger-fg); }
  .gh-form-validation[hidden] { display: none; }
  .gh-profile-field { flex: 1; max-width: 440px; }
  .gh-fieldset { min-width: 0; margin: 0 0 var(--space-4); padding: 0; }
  /* A <legend> used as a Box header renders exactly like `.gh-box-header`: a legend is not a block in the box's flow
     (it sits on the border like a tab and shrinks to its text), so it floats full width and the next row clears it. */
  .gh-fieldset > legend.gh-box-header { float: left; width: 100%; box-sizing: border-box; margin: 0; }
  .gh-fieldset > legend.gh-box-header + * { clear: both; }

  /* ---- Personal settings shell (/settings/*): avatar header, side nav, Subhead + Boxes. Wiremock:
     kliper-account-settings-wiremock.html (`.kp-settings-head`, `.kp-side`, `.kp-h1`). ---- */
  .gh-settings-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
  .gh-settings-head .gh-avatar { width: 48px; height: 48px; font-size: var(--text-16); } /* after the base `.gh-avatar` */
  .gh-settings-name { font-size: 20px; font-weight: 600; line-height: 1.25; }
  .gh-settings-sub { margin: 0; font-size: var(--text-14); color: var(--color-fg-muted); }
  .gh-settings-layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: var(--space-5); }
  .gh-settings-layout > .gh-subnav { width: auto; }
  .gh-settings-main { min-width: 0; }
  .gh-subhead { font-size: 24px; font-weight: 400; line-height: 1.25; padding-bottom: var(--space-2); margin: 0 0 var(--space-4); border-bottom: 1px solid var(--color-border-default); }
  .gh-settings-layout .gh-subnav-label { display: inline-flex; align-items: center; gap: var(--space-2); }
  .gh-settings-layout .gh-subnav-label .octicon { color: var(--color-fg-muted); }
  @media (max-width: 900px) { .gh-settings-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); } }
  .gh-choice { display: flex; gap: var(--space-2); align-items: flex-start; cursor: pointer; }
  .gh-choice > input { margin: 3px 0 0; accent-color: var(--color-accent-fg); }
  .gh-choice > span { display: flex; flex-direction: column; }
  .gh-profile-value { font-size: var(--text-14); overflow-wrap: anywhere; }

  /* Qualifier search: a transparent input over a mirror that paints the
     `is:` / `invited-by:` qualifiers; same font and inset, scrolled together. */
  .qb { display: flex; flex: 1; min-width: 0; }
  .qb-field {
    position: relative; display: flex; align-items: center; flex: 1; min-width: 0; height: var(--control-medium-size);
    border: 1px solid var(--color-control-border); border-right: 0; border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: var(--color-canvas-default);
  }
  .qb-field:focus-within { z-index: 1; } /* its ring: `.gh-composite-field`; above the button beside it */
  .qb-icon { display: inline-flex; margin-left: 10px; color: var(--color-fg-muted); }
  .qb-stack { position: relative; flex: 1; min-width: 0; height: 100%; }
  .qb-input, .qb-mirror {
    position: absolute; inset: 0; padding: 0 var(--space-2); border: 0; margin: 0;
    font-size: var(--text-14); line-height: 30px; letter-spacing: normal; white-space: pre;
  }
  .qb-input { width: 100%; background: transparent; color: transparent; caret-color: var(--color-fg-default); }
  .qb-input::placeholder { color: var(--color-fg-muted); }
  .qb-input::selection { color: transparent; background: color-mix(in oklab, var(--color-accent-fg) 25%, transparent); }
  .qb-mirror { overflow: hidden; color: var(--color-fg-default); pointer-events: none; }
  .qb-qual { color: var(--color-accent-fg); background: var(--color-accent-subtle); border-radius: 3px; }
  .qb-clear {
    display: inline-flex; padding: var(--space-1); margin-right: var(--space-1); border: 0; border-radius: var(--radius-md);
    background: none; color: var(--color-fg-muted); cursor: pointer;
  }
  .qb-clear[hidden] { display: none; }
  .qb-clear:hover { background: var(--color-action-hover); color: var(--color-fg-default); }
  .qb-submit { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
  /* A touch screen's 44px target (base.css) grows the button beside the field; the field grows with it, and its
     mirror keeps the input's line. */
  @media (pointer: coarse) {
    .qb-field { height: 44px; }
    .qb-input, .qb-mirror { line-height: 42px; }
    .qb-clear { min-width: 44px; min-height: 42px; margin-right: 0; align-items: center; justify-content: center; }
  }
  .list-reset {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 0 var(--space-3); padding: 2px 4px 2px 0;
    border: 0; border-radius: var(--radius-md); background: none; font-size: var(--text-14); font-weight: 600;
    color: var(--color-fg-muted); cursor: pointer;
  }
  .list-reset > .octicon { padding: 1px; border-radius: var(--radius-md); background: var(--color-fg-muted); color: var(--color-canvas-default); }
  .list-reset:hover { color: var(--color-accent-fg); }
  .list-reset:hover > .octicon { background: var(--color-accent-fg); }
  .list-reset[hidden] { display: none; }

  /* The Box header of a list: state counters on the left, menus on the right. */
  .list-header { padding: var(--space-2) var(--space-4); justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }
  .list-states, .list-menus { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1); }
  .list-state {
    display: inline-flex; align-items: center; gap: 6px; padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--radius-md);
    background: none; font-size: var(--text-14); line-height: 20px; color: var(--color-fg-muted); cursor: pointer;
  }
  .list-state:hover { color: var(--color-fg-default); background: var(--color-action-hover); }
  .list-state[aria-pressed="true"] { color: var(--color-fg-default); font-weight: 600; }
  /* The Box must not clip the overlay: no overflow hidden, so the corners go
     to its first and last children. */
  .gh-box:has(> .list-header) { overflow: visible; }
  .gh-box:has(> .list-header) > .list-header { border-radius: 5px 5px 0 0; }
  .gh-box:has(> .list-header) > :last-child { border-radius: 0 0 5px 5px; }

  /* Menu trigger: Primer Button invisible, medium ("Author ▾" on GitHub). */
  .gh-menu { position: relative; }
  .gh-menu-btn {
    display: inline-flex; align-items: center; gap: var(--space-2);
    height: var(--control-medium-size); padding: 0 var(--space-3);
    border: 0; border-radius: var(--radius-md); background: none;
    font-size: var(--text-14); font-weight: 500; line-height: 20px; color: var(--color-fg-muted); cursor: pointer; white-space: nowrap;
  }
  .gh-menu-btn:hover, .gh-menu-btn[aria-expanded="true"] { color: var(--color-fg-default); background: var(--color-action-hover); }

  /* SelectPanel / ActionMenu overlay (Primer). */
  .gh-overlay {
    position: absolute; top: calc(100% + 4px); right: 0; z-index: var(--z-dropdown);
    display: flex; flex-direction: column; width: 320px; max-width: calc(100vw - 32px); max-height: 480px;
    background: var(--color-canvas-default); border-radius: var(--radius-overlay); overflow: hidden;
    box-shadow: var(--shadow-overlay);
  }
  .gh-overlay[hidden] { display: none; }
  .gh-overlay-menu { width: auto; min-width: 224px; }
  .gh-overlay-header { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2); }
  .gh-overlay-titlebar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 32px; padding-left: var(--space-2); }
  .gh-overlay-title { margin: 0; font-size: var(--text-14); font-weight: 600; line-height: 20px; }
  .gh-overlay-titlebar .gh-dialog-close { margin: 0; }
  .gh-overlay-filter {
    display: flex; align-items: center; height: var(--control-medium-size);
    border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-canvas-default);
    color: var(--color-fg-muted);
  }
  .gh-overlay-filter > .octicon { margin-left: var(--space-2); }
  .gh-overlay-filter input {
    flex: 1; min-width: 0; height: 100%; padding: 0 var(--space-2); border: 0; background: transparent;
    font-size: var(--text-14); line-height: 20px; color: var(--color-fg-default);
  }
  .gh-overlay-body { overflow-y: auto; padding: var(--space-2); border-top: 1px solid var(--color-border-muted); }
  /* ActionList item (Primer): 32px minimum, 6px 8px, radius 6px. */
  .gh-al-item {
    display: flex; align-items: flex-start; gap: var(--space-2); width: 100%; min-height: 32px; padding: 6px var(--space-2);
    border: 0; border-radius: var(--radius-md); background: none;
    font-size: var(--text-14); line-height: 20px; color: var(--color-fg-default); text-align: left; cursor: pointer;
  }
  .gh-al-item[hidden] { display: none; }
  .gh-al-item:hover, .gh-al-item:focus { background: var(--color-action-hover); }
  .gh-al-item:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; }
  .gh-al-check { flex-shrink: 0; display: inline-flex; margin-top: 2px; visibility: hidden; }
  .gh-al-item[aria-checked="true"] .gh-al-check, .gh-al-item[aria-selected="true"] .gh-al-check { visibility: visible; }
  .gh-al-lead { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; color: var(--color-fg-muted); }
  .gh-al-avatar { border-radius: 50%; background: var(--color-accent-subtle); color: var(--color-accent-fg); font-size: 10px; font-weight: 600; line-height: 20px; }
  .gh-al-text { display: flex; flex-direction: column; min-width: 0; }
  .gh-al-text .gh-al-label:not(:only-child) { font-weight: 600; }
  .gh-al-desc { font-size: var(--text-12); line-height: 16px; color: var(--color-fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gh-al-divider { height: 1px; margin: 7px calc(-1 * var(--space-2)) var(--space-2); background: var(--color-border-muted); }
  .gh-al-divider[hidden] { display: none; }
  .gh-al-empty { padding: var(--space-4) var(--space-2); text-align: center; }
  .gh-al-empty[hidden] { display: none; }
  .gh-al-empty strong { display: block; font-size: var(--text-14); }
  .gh-al-empty span { font-size: var(--text-12); color: var(--color-fg-muted); }
  /* Narrow, the panel stays anchored 4px under its trigger (owner ruling 2026-10-02: no bottom sheets, GitHub's
     SelectPanels stay anchored at 375 too); chassis.js clamps it to the viewport and caps its height (D41). */

  /* The invitations list: a Box of rows that expand into a Timeline. */
  .inv-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) 104px 96px 64px 176px;
    gap: var(--space-3); align-items: center;
  }
  .inv-head {
    padding: var(--space-2) var(--space-4); background: var(--color-canvas-subtle);
    border-bottom: 1px solid var(--color-border-default);
    font-size: var(--text-11); font-weight: 600; color: var(--color-fg-muted);
    text-transform: uppercase; letter-spacing: 0.03em;
  }
  .inv-row { border-bottom: 1px solid var(--color-border-default); }
  .inv-row:last-child { border-bottom: none; }
  .inv-row > .inv-grid { padding: var(--space-2) var(--space-4); min-height: 52px; }
  .inv-row:hover > .inv-grid { background: var(--color-canvas-subtle); }
  .inv-toggle {
    display: flex; align-items: center; gap: var(--space-2); min-width: 0;
    background: none; border: 0; border-radius: var(--radius-md); padding: var(--space-1); margin-left: calc(-1 * var(--space-1));
    font-size: var(--text-14); font-weight: 600; color: var(--color-fg-default); text-align: left; cursor: pointer;
  }
  .inv-toggle:hover .inv-email { color: var(--color-accent-fg); }
  .inv-chevron { flex-shrink: 0; color: var(--color-fg-muted); transition: transform var(--duration-fast) ease-out; }
  .inv-toggle[aria-expanded="true"] .inv-chevron { transform: rotate(90deg); }
  .inv-email { overflow-wrap: anywhere; }
  .inv-muted { color: var(--color-fg-muted); font-size: var(--text-12); }
  .inv-by { font-size: 13px; overflow-wrap: anywhere; }
  .inv-flags { display: flex; gap: 6px; }
  .inv-actions { display: flex; gap: 6px; justify-content: flex-end; }
  .inv-mobile-meta { display: none; }

  /* E-mail indicator with a Tooltip (Primer: on hover and on focus). */
  .inv-flag { position: relative; display: inline-flex; align-items: center; padding: 2px; border-radius: var(--radius-md); color: var(--color-fg-muted); }
  .inv-flag .inv-glyph { width: 10px; height: 10px; margin-left: -5px; margin-top: 8px; border-radius: 50%; background: var(--color-canvas-default); }
  .inv-flag.is-ok .inv-glyph { color: var(--color-success-fg); }
  .inv-flag.is-failed .inv-glyph { color: var(--color-attention-text); }
  .inv-flag::after {
    content: attr(aria-label);
    position: absolute; bottom: calc(100% + 6px); right: -8px;
    padding: var(--space-1) var(--space-2); border-radius: var(--radius-md);
    background: var(--color-fg-default); color: var(--color-canvas-default);
    font-size: var(--text-12); font-weight: 400; line-height: 1.5;
    white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--duration-fast) ease-out; z-index: var(--z-dropdown);
  }
  .inv-flag:hover::after, .inv-flag:focus-visible::after { opacity: 1; }

  /* TimelineItem (Primer). */
  .inv-timeline { padding: var(--space-1) var(--space-4) var(--space-3) 44px; border-top: 1px solid var(--color-border-muted); }
  .inv-timeline[hidden] { display: none; }
  .gh-timeline-item { position: relative; display: flex; gap: var(--space-2); padding: var(--space-2) 0; margin-left: var(--space-4); }
  .gh-timeline-item::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--color-border-muted); }
  .gh-timeline-item:first-child::before { top: 16px; }
  .gh-timeline-item:last-child::before { bottom: calc(100% - 16px); }
  .gh-timeline-badge {
    position: relative; z-index: 1; flex-shrink: 0;
    width: 32px; height: 32px; margin-left: -15px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-canvas-subtle); color: var(--color-fg-muted); border: 2px solid var(--color-canvas-default);
  }
  /* One badge family: grey disc, coloured icon — acceptance is not louder than a refusal (owner, 2026-09-25). */
  .gh-timeline-badge.is-success { color: var(--color-success-fg); }
  .gh-timeline-badge.is-danger { color: var(--color-danger-fg); }
  .gh-timeline-badge.is-attention { color: var(--color-attention-text); }
  .gh-timeline-body { padding-top: 5px; font-size: 13px; color: var(--color-fg-default); min-width: 0; overflow-wrap: anywhere; }
  .gh-timeline-body .inv-muted { margin-left: var(--space-1); }

  @media (max-width: 1100px) {
    .inv-grid { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 2px; }
    .inv-head { display: none; }
    .inv-col-by, .inv-col-sent { display: none; }
    .inv-col-status { grid-row: 1; grid-column: 2; }
    .inv-col-flags { grid-row: 1; grid-column: 3; }
    .inv-mobile-meta { display: block; grid-column: 1 / -1; padding-left: 28px; }
    .inv-col-actions { grid-column: 1 / -1; justify-content: flex-start; padding: var(--space-1) 0 0 28px; }
    .inv-timeline { padding-left: var(--space-6); }
  }
  @media (max-width: 480px) {
    .inv-grid { grid-template-columns: auto minmax(0, 1fr); }
    .inv-grid > .inv-toggle { grid-column: 1 / -1; }
    .inv-col-status { grid-row: auto; grid-column: 1; padding-left: 28px; }
    .inv-col-flags { grid-row: auto; grid-column: 2; }
    .inv-flag::after { right: auto; left: -8px; } /* the icons sit on the left here */
  }

  /* The super admins table. */
  /* A containing block, so an absolutely positioned .sr-only header stays inside the scroller instead of widening the page. */
  .gh-table-container { position: relative; }
  .gh-table td.adm-name { white-space: nowrap; }
  .gh-table td.adm-muted { color: var(--color-fg-muted); white-space: nowrap; }
  .adm-actions { display: flex; gap: 6px; justify-content: flex-end; }
  .adm-you { margin-left: 6px; }
  .quorum-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
  .quorum-body > p { margin: 0; }

  @media (max-width: 768px) {
    .list-header { flex-direction: row; align-items: center; }
    .list-header > div { width: auto; }
  }
  @media (max-width: 544px) {
    .gh-panel-header { flex-wrap: wrap; }
    .list-header { flex-direction: column; align-items: flex-start; }
    .list-states, .list-menus { margin-left: calc(-1 * var(--space-2)); }
  }

  /* ---- Control standards (Primer, measured on github.com 2026-09-27) ----
     One rule per standard, for every native control, so no family can draw
     its own. The wiremocks carry the same block (docs/wiremock/*.html).
     docs/knowledge/design/primer-is-the-design-system.md has the table. */

  /* Focus sits ON the field's border (Primer React TextInput: border-color +
     2px outline at -1px; the qualifier search's `.qb-field` already did this).
     base.css's `:focus-visible` (offset +2px) drew it outside, with a gap: a
     double border. */
  :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="button"], [type="submit"], [type="reset"], [type="image"]), select, textarea):not(.gh-composite-field *):focus-visible {
    border-color: var(--brand-focus);
    outline: 2px solid var(--brand-focus);
    outline-offset: -1px;
    box-shadow: none;
  }
  /* A composite field (a prefix, a country select or an icon inside one
     border) is marked `.gh-composite-field`: the wrapper draws the one ring and
     the controls inside draw none. Transparent, not `none`: forced colors
     repaint an outline, so High Contrast still shows the focused control. */
  .gh-composite-field:focus-within {
    border-color: var(--brand-focus);
    outline: 2px solid var(--brand-focus);
    outline-offset: -1px;
  }
  .gh-composite-field :is(input, select, textarea):focus-visible { outline: 2px solid transparent; }
  /* The query input's text box (partials/query_input.html), as github.com/cli/cli/issues draws it (measured
     2026-10-04): the ring sits inside the border (offset -2px, so the 32px control and its edges never move), and
     only while the text input has focus; its clear and the joined search IconButton draw their own. */
  .gh-query-box:has(:focus) { border-color: var(--color-border-default); outline-offset: -2px; }
  .gh-query-box:has(.gh-query-clear:focus) { outline-color: transparent; }

  /* Primer `.form-select`: its double-triangle indicator, 16px, 4px from the
     edge, 24px of padding for it; no second arrow drawn in markup. A button
     that opens a listbox stands in for a select (onboarding's language, stacked
     over two selects): the same glyph at the same place. */
  select:not([multiple], [size]), button[aria-haspopup="listbox"] {
    appearance: none;
    padding-right: 24px;
    background-image: var(--control-select-indicator);
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 16px;
  }
  /* High Contrast repaints colours but not our SVG's fill: give the select its
     system arrow back. ponytail: the listbox button keeps the SVG there (no
     system arrow exists for a button); a mask-painted currentColor glyph if
     that ever reads too faint. */
  @media (forced-colors: active) {
    select:not([multiple], [size]) { appearance: auto; background-image: none; }
  }

  /* R-48 PR 1: Warning banner and engine chip styles */
  .gh-layout-banner { max-width: 1400px; margin: 0 auto; padding: var(--space-4) var(--space-4) 0; }
  .gh-banner-warn {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
    background: var(--color-attention-subtle); border: 1px solid var(--color-attention-muted);
    border-radius: var(--radius-md); font-size: var(--text-13); line-height: 1.5; color: var(--color-fg-default);
  }
  .gh-banner-icon { color: var(--color-attention-fg); flex-shrink: 0; margin-top: 2px; }
  .gh-banner-body { flex: 1; }
  .gh-banner-body a { color: var(--color-accent-fg); text-decoration: underline; font-weight: 500; }

  .gh-engine { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-12); color: var(--color-fg-muted); white-space: nowrap; }
  .gh-engine-icon { width: 12px; height: 12px; flex-shrink: 0; }
  .gh-engine.is-fallback, .gh-engine.is-legacy { color: var(--color-attention-fg); }
  .gh-engine-name { font-weight: 600; }
  .gh-engine-sub { display: block; font-size: var(--text-12); color: var(--color-fg-muted); }
  .gh-engine-error { font-family: var(--font-mono); font-size: var(--text-12); color: var(--color-danger-fg); }

  /* ---- Account settings of managed accounts (spec D11, D12, D15): ported from
     docs/wiremock/kliper-account-settings-wiremock.html (?ctx=manager|managed). The wiremock's `.kp-*` names are kept
     where they did not collide; `.kp-lead-acct` because `.kp-lead-bo` is the back office's. ---- */
  .kp-page { max-width: 1280px; margin: 0 auto; padding: var(--space-5) var(--space-4) 64px; }
  @media (min-width: 1012px) { .kp-page { padding: var(--space-5) 32px 64px; } }
  .kp-muted { color: var(--color-fg-muted); }
  .kp-settings-head { display: flex; align-items: center; gap: 12px; margin-bottom: var(--space-5); flex-wrap: wrap; }
  .kp-settings-head-text { flex: 1; min-width: 0; }
  .kp-settings-head h1 { font-size: var(--text-20); font-weight: 600; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
  .kp-settings-head .kp-handle { font-weight: 400; }
  .kp-settings-head p { font-size: var(--text-14); color: var(--color-fg-muted); margin: 0; }
  .kp-acct-avatar { width: 48px; height: 48px; flex-shrink: 0; border-radius: var(--radius-md); display: grid; place-items: center;
    background: var(--color-canvas-subtle); border: 1px solid var(--color-border-default); color: var(--color-fg-muted); font-size: var(--text-16); font-weight: 600; }
  .kp-side { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: var(--space-5); }
  @media (width <= 900px) { .kp-side { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); } }
  .kp-side .gh-subnav { width: auto; }
  /* ---- GitHub's two layouts, work (`.kp-work`, Issues) and settings (plain `.kp-side`), chosen per template:
     docs/knowledge/design/primer-is-the-design-system.md, "GitHub's two page layouts". ---- */
  .kp-crumb-page { margin-bottom: var(--space-4); } /* a page's own breadcrumb above its heading */
  .kp-nav-toggle { display: none; }
  .kp-nav-expand { display: none; }
  .kp-nav-collapse { display: contents; }
  @media (width > 900px) {
    .kp-body-work { display: flex; flex-direction: column; min-height: 100vh; }
    .kp-page.kp-page-work { display: flex; flex-direction: column; flex: 1; width: 100%; max-width: none; margin: 0; padding: 0; }
    /* What sits above the layout (a demo banner, a breadcrumb) keeps the header's gutters. */
    .kp-page-work > :not(.kp-work) { margin-inline: var(--space-4); }
    .kp-page-work > :not(.kp-work):first-child { margin-top: var(--space-5); }
    .kp-side.kp-work { flex: 1; grid-template-columns: 256px minmax(0, 1fr); gap: 0; }
    .kp-work > .gh-subnav {
      display: flex; flex-direction: column; padding: var(--space-5) var(--space-2) 0;
      border-right: 1px solid var(--color-border-default);
    }
    /* Percentages resolve against the grid area: the content is centred inside a 1280px measure. */
    .kp-work > .gh-subnav ~ :not(dialog, .gh-subnav) {
      padding: var(--space-5) max(var(--space-4), calc((100% - 1280px) / 2)) 64px;
    }

    .kp-nav-toggle {
      display: flex; position: sticky; bottom: 0; margin-top: auto; margin-bottom: var(--space-3); width: 100%;
      justify-content: flex-start; gap: var(--space-2); border: 0; background: var(--color-canvas-default);
      font: inherit; font-size: 13px; color: var(--color-fg-muted); text-align: left;
    }
    .kp-nav-toggle:hover { color: var(--color-fg-default); }
    .kp-nav-toggle:focus-visible { outline: 2px solid var(--brand-focus); outline-offset: -2px; }

    .kp-nav-collapsed .kp-side.kp-work { grid-template-columns: 56px minmax(0, 1fr); }
    .kp-nav-collapsed .kp-nav-collapse { display: none; }
    .kp-nav-collapsed .kp-nav-expand { display: contents; }
    .kp-nav-collapsed .kp-work > .gh-subnav :is(.gh-subnav-title, .gh-subnav-child, .kp-subgroup, .kp-chev,
      .kp-row-actions) { display: none; }
    .kp-nav-collapsed .kp-work > .gh-subnav .gh-subnav-link { justify-content: center; padding-inline: 0; }
    /* Visually hidden, never `display: none`: the label and the count stay the item's accessible name. */
    .kp-nav-collapsed .kp-work > .gh-subnav .gh-subnav-link :is(.gh-subnav-label, .gh-tab-badge) {
      position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%);
      white-space: nowrap; border: 0;
    }
  }
  @media (width >= 1012px) {
    .kp-page-work > :not(.kp-work) { margin-inline: 32px; }
    .kp-work > .gh-subnav ~ :not(dialog, .gh-subnav) { padding-inline: max(32px, calc((100% - 1280px) / 2)); }
  }
  .kp-row-title { font-weight: 600; overflow-wrap: anywhere; } /* the monitoring pages' and the atestado's rows */
  .kp-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: var(--space-4);
    padding-bottom: 8px; border-bottom: 1px solid var(--color-border-default); }
  .kp-h1 { flex: 1; font-size: 24px; font-weight: 400; line-height: 1.25; margin: 0; }
  .kp-h2 { font-size: var(--text-20); font-weight: 400; padding-bottom: 8px; margin: 32px 0 16px; border-bottom: 1px solid var(--color-border-default); }
  .kp-lead-acct { color: var(--color-fg-muted); margin: 0 0 var(--space-4); max-width: 720px; }
  .kp-table-wrap { overflow-x: auto; }
  .kp-table-wrap th[scope="row"] { font-weight: 600; }
  .kp-row-action, .kp-nowrap { white-space: nowrap; }
  .kp-table-nowrap td { white-space: nowrap; }
  .kp-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .kp-field .gh-form-input { width: 100%; }
  .kp-table-wrap a:not(.gh-btn), .kp-facts a { color: var(--color-link-fg); text-decoration: none; }
  .kp-table-wrap a:not(.gh-btn):hover, .kp-facts a:hover { text-decoration: underline; }
  .kp-box-top { margin-top: var(--space-4); }
  .kp-box-pad { padding: var(--space-4); }
  .kp-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; }
  .kp-facts dt { color: var(--color-fg-muted); }
  .kp-facts dd { margin: 0; overflow-wrap: anywhere; }
  .kp-danger { border: 1px solid var(--color-danger-fg); border-radius: var(--radius-md); }
  .kp-danger-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); }
  .kp-danger-row p { font-size: var(--text-12); color: var(--color-fg-muted); margin: 4px 0 0; }
  @media (max-width: 543px) { .kp-danger-row { flex-direction: column; align-items: flex-start; } }
  .kp-hint { font-size: var(--text-12); color: var(--color-fg-muted); }
  /* Plano e faturamento (spec §8 Wave 4): the plan box's name, price and promise lines. */
  .kp-billing-plan { margin: 0 0 4px; }
  .kp-billing-price { margin: 0 0 8px; font-size: var(--text-20); }
  .kp-billing-promise { margin: 12px 0 0; }
  .kp-billing-usage { margin: 0; }
  .kp-usage-bar { display: block; width: 100%; height: 100%; fill: var(--color-success-emphasis); }
  /* Over the limit after a change (kept, never stopped): the attention colour, and the text says so (PR 4.2 M3). */
  .kp-billing-usage.is-exceeded, .kp-muted.is-exceeded { color: var(--color-attention-fg); }
  [data-exceeded] .kp-usage-bar { fill: var(--color-attention-emphasis); }
  .kp-hint-error { color: var(--color-danger-fg); }
  .kp-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
  .kp-radio { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; }
  .kp-radio input { margin-top: 3px; }
  .kp-radio[aria-disabled="true"] { color: var(--color-fg-muted); }
  .kp-radio .kp-hint { display: block; }
  /* The header label (D11) beside the breadcrumb's account; on a phone it wraps under the breadcrumb. */
  .gh-breadcrumb > .gh-managed-label { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  @media (max-width: 543px) {
    .gh-breadcrumb:has(.gh-managed-label) { flex-wrap: wrap; row-gap: 2px; }
    .gh-breadcrumb > .gh-managed-label { order: 1; }
  }

  /* ---- D47: the list header bar (docs/knowledge/design/list-filter-bar.md; partials/filter_bar.html +
     select-panel.js), ported from the Clipping and Alertas wiremocks. One row in the list's Box header: the state
     toggle, the facet buttons, Ordenar, "Mais filtros"; no wrap and no horizontal scroll inside the bar (overflow goes
     to the kebab). Panels are Primer overlays anchored 4px under their button (`.gh-overlay`, placed by chassis.js's
     keepInViewport: clamped, flipped and height-capped, never a bottom sheet). ---- */
  .kp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .kp-listbar { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: var(--space-2); min-height: 48px; text-align: left; }
  .kp-states { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
  .kp-state { display: inline-flex; align-items: center; gap: 6px; color: var(--color-fg-muted); font-size: var(--text-14); font-weight: 400; white-space: nowrap; text-decoration: none; }
  .kp-state:hover { color: var(--color-fg-default); text-decoration: none; }
  .kp-state[aria-current="page"] { color: var(--color-fg-default); font-weight: 600; }
  .kp-state-total { color: var(--color-fg-default); font-weight: 600; }  /* one state: a count, not a link (issue 503) */
  .kp-listbar > .kp-tools { display: flex; align-items: center; flex: 1 1 0; min-width: 0; flex-wrap: nowrap; justify-content: flex-end; gap: var(--space-1); margin-left: auto; }
  .kp-facet-menus { display: flex; align-items: center; gap: 0; flex-wrap: nowrap; margin: 0; }
  .kp-fp:not(.kp-collapsed) { margin-right: var(--space-1); } /* a collapsed field takes no room, not even a gap */
  .kp-fp { position: relative; flex: 0 0 auto; }
  .kp-fp.kp-collapsed > .kp-fb { display: none; }
  /* A field opened from "Mais filtros" anchors to the toolbar's left edge, 4px under it, not to its hidden button. */
  .kp-listbar .kp-tools { position: relative; }
  .kp-fp.kp-collapsed { position: static; }
  .kp-listbar .kp-tools > .gh-select-menu { flex: 0 0 auto; }
  .kp-kebab[hidden] { display: none; }
  .kp-fb { font-weight: 500; }
  .kp-fb .octicon { color: var(--color-fg-muted); }
  .kp-panel { position: absolute; top: calc(100% + 4px); left: 0; right: auto; z-index: var(--z-dropdown); display: flex; flex-direction: column; width: 320px; max-width: calc(100vw - 16px); max-height: min(480px, 70vh); background: var(--color-canvas-overlay); border-radius: var(--radius-overlay); box-shadow: var(--shadow-overlay); text-align: left; }
  .kp-panel[hidden] { display: none; }
  .kp-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-2) 0 var(--space-3); }
  .kp-panel-title { margin: 0; font-size: var(--text-14); font-weight: 600; }
  .kp-panel-filter { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border-muted); }
  .kp-panel-filter .gh-input { width: 100%; }
  .kp-panel-list { list-style: none; margin: 0; padding: var(--space-2); overflow-y: auto; }
  .kp-panel-list:empty { display: none; }
  .kp-panel-group { padding: 6px var(--space-2) 2px; font-size: var(--text-12); font-weight: 600; color: var(--color-fg-muted); }
  .kp-opt { position: relative; display: flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: 6px var(--space-2); border-radius: var(--radius-md); color: var(--color-fg-default); cursor: pointer; }
  .kp-opt[hidden] { display: none; }
  .kp-opt:hover, .kp-opt.kp-active { background: var(--color-action-hover); }
  .kp-opt.kp-active { outline: 2px solid var(--brand-focus); outline-offset: -2px; }
  /* An option with nothing behind it (a count of 0) is drawn and never picked (select-panel.js `enabled`). */
  .kp-opt[aria-disabled="true"] { color: var(--color-fg-muted); cursor: default; }
  .kp-opt[aria-disabled="true"]:hover { background: none; }
  .kp-opt[aria-selected="true"]::before { content: ""; position: absolute; left: calc(-1 * var(--space-2)); top: 6px; bottom: 6px; width: 4px; border-radius: var(--radius-md); background: var(--color-accent-emphasis); }
  .kp-opt-check { display: inline-flex; flex-shrink: 0; width: 16px; visibility: hidden; }
  .kp-opt[aria-selected="true"] .kp-opt-check { visibility: visible; }
  .kp-opt-box { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 16px; height: 16px; border: 1px solid var(--color-control-border); border-radius: 4px; background: var(--color-canvas-default); color: transparent; }
  .kp-opt-box .octicon { width: 12px; height: 12px; color: transparent; }
  .kp-opt[aria-selected="true"] .kp-opt-box { border-color: var(--color-accent-emphasis); background: var(--color-accent-emphasis); color: var(--color-fg-on-emphasis); }
  .kp-opt[aria-selected="true"] .kp-opt-box .octicon { color: var(--color-fg-on-emphasis); }
  .kp-opt > .octicon { flex-shrink: 0; color: var(--color-fg-muted); }
  .kp-opt-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .kp-opt-title, .kp-opt-desc { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .kp-opt-desc { font-size: var(--text-12); color: var(--color-fg-muted); }
  .kp-opt-count { margin-left: auto; flex-shrink: 0; font-size: var(--text-12); color: var(--color-fg-muted); }
  .kp-dot { width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; }
  .kp-dot-positive { background: var(--color-success-fg); }
  .kp-dot-neutral { background: var(--color-fg-muted); }
  .kp-dot-negative { background: var(--color-danger-fg); }
  .kp-panel-loading { margin: 0; padding: var(--space-4) var(--space-3); font-size: var(--text-12); color: var(--color-fg-muted); text-align: center; }
  .kp-panel-loading[hidden] { display: none; }
  .kp-panel-error { color: var(--color-danger-fg); }
  .kp-panel-empty { display: grid; gap: var(--space-1); padding: var(--space-5) var(--space-3); text-align: center; }
  .kp-panel-empty[hidden] { display: none; }
  .kp-panel-empty span { font-size: var(--text-12); color: var(--color-fg-muted); }
  .kp-menu-group { padding: 6px var(--space-3) 2px; font-size: var(--text-12); font-weight: 600; color: var(--color-fg-muted); }
  .kp-menu-sep { height: 1px; margin: var(--space-2) 0; background: var(--color-border-muted); }
  /* A Box whose overlays must escape it (a list with the bar and row menus, owner defect 2026-10-02: the last row's
     "…" menu was cut by the card): overflow stays visible; its header and its last child round its corners. */
  .gh-box.kp-box-overlays { overflow: visible; }
  .gh-box.kp-box-overlays > .gh-box-header { border-top-left-radius: 5px; border-top-right-radius: 5px; }
  .gh-box.kp-box-overlays > :last-child { border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; }
  /* The back office's tenant list (issue 509): github.com/cli/cli/issues, 24px from the query input to the list Box. */
  .kp-tenant-query { margin-bottom: var(--space-5); }
  @media (max-width: 899px) {
    .kp-listbar { flex-wrap: wrap; row-gap: var(--space-1); }
    .kp-listbar > .kp-tools { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
  }
  @media (max-width: 620px) { .kp-listbar .kp-tools .gh-btn, .kp-opt, .kp-listbar .kp-tools .gh-select-item { min-height: 44px; } }
  /* At 375 Período, Canal and Ordenar stay in the row (ruling 2026-10-02): tighter buttons, Ordenar and Exportar
     icon-only (their names stay in aria-label), the header's side padding halved. */
  @media (max-width: 543px) {
    .kp-listbar { padding-left: var(--space-1); padding-right: var(--space-1); }
    .kp-listbar .kp-fb { padding: 0 6px; gap: var(--space-1); }
    .kp-listbar [aria-controls="export-list"] > .octicon:last-child { display: none; }
  }
}
