/*
 * Symfonet components on the Zublime UI/UX guide (docs/guia-ui-ux.md). Every
 * colour, size and radius comes from public/css/tokens.css; nothing here has a
 * literal colour, a gradient or a sustained-uppercase label. Bootstrap 5.3 keeps
 * its accessible behaviour (modals, dropdowns, offcanvas, tooltips) and is themed
 * through its CSS variables, which point at the tokens, so the dark theme needs
 * no second set of rules. The guide's own classes (pill, st, chip-*, notice,
 * panel, kv, stats, segmented, meter) live here too.
 */

/* ---------- Fonts (SIL OFL, served by Symfonet: TIP-8) ---------- */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../vendor/fonts/poppins/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../vendor/fonts/poppins/poppins-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../vendor/fonts/inter/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../vendor/fonts/inter/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../vendor/fonts/inter/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../vendor/fonts/ibm-plex-mono/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../vendor/fonts/ibm-plex-mono/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

/* ---------- Bootstrap 5.3 reads the tokens ---------- */
:root {
    --bs-font-sans-serif: var(--font-ui);
    --bs-font-monospace: var(--font-mono);
    --bs-body-font-family: var(--font-ui);
    --bs-body-font-size: var(--t-base);
    --bs-body-line-height: 1.43;
    --bs-body-color: var(--text);
    --bs-body-bg: var(--canvas);
    --bs-emphasis-color: var(--text);
    --bs-heading-color: var(--text);
    --bs-secondary-color: var(--text-3);
    --bs-tertiary-color: var(--text-3);
    --bs-secondary-bg: var(--sunken);
    --bs-tertiary-bg: var(--sunken);
    --bs-border-color: var(--border);
    --bs-border-color-translucent: var(--border);
    --bs-border-radius: var(--r-2);
    --bs-border-radius-sm: var(--r-1);
    --bs-border-radius-lg: var(--r-3);
    --bs-border-radius-xl: var(--r-4);
    --bs-link-color: var(--accent-text);
    --bs-link-hover-color: var(--accent-text);
    --bs-code-color: var(--text);
    --bs-highlight-bg: var(--warn-soft);
    --bs-form-valid-color: var(--text-2);
    --bs-form-valid-border-color: var(--border-control);
    --bs-form-invalid-color: var(--error-text);
    --bs-form-invalid-border-color: var(--error-fill);
    --bs-focus-ring-width: 0;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { background: var(--canvas); color: var(--text); font-size: var(--t-base); line-height: 1.43; -webkit-font-smoothing: antialiased; }
h1, .h1, h2, .h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.27; color: var(--text); text-wrap: balance; letter-spacing: 0; }
h1, .h1 { font-size: var(--t-xl); }
h2, .h2 { font-size: var(--t-lg); }
h3, .h3, h4, .h4, h5, .h5, h6, .h6 { font-family: var(--font-ui); font-weight: 600; color: var(--text); text-wrap: balance; letter-spacing: 0; }
h3, .h3 { font-size: var(--t-md); line-height: 1.5; }
h4, .h4, h5, .h5, h6, .h6 { font-size: var(--t-base); line-height: 1.43; }
p { max-width: 70ch; }
::selection { background: var(--accent-soft); color: var(--text); }
a { color: var(--accent-text); text-underline-offset: .18em; }
a:hover { color: var(--accent-text); }
p a, li a, .form-text a, dd a, .alert a, .notice a { text-decoration: underline; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono, code, kbd, pre, samp { font-family: var(--font-mono); }
.mono { font-size: var(--t-sm); }
code { font-size: var(--t-sm); color: var(--text); background: var(--sunken); padding: .1em .35em; border-radius: var(--r-1); overflow-wrap: anywhere; }
kbd { font-size: var(--t-xs); color: var(--text-2); background: var(--sunken); border: 1px solid var(--border-strong); border-radius: var(--r-1); padding: .05em .4em; }
small, .small { font-size: var(--t-sm); }
.text-secondary, .text-body-secondary, .text-muted { color: var(--text-3) !important; }
.text-success { color: var(--ok-text) !important; }
.text-danger { color: var(--error-text) !important; }
.text-warning, .text-warning-emphasis { color: var(--warn-text) !important; }
.fw-bold, b, strong { font-weight: 600; }
.tabular, .kpi-value, td.text-end, .text-end .tabular { font-variant-numeric: tabular-nums; }
.ic { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 1.5rem; height: 1.5rem; }
.ic-brand { stroke: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; background: var(--surface); color: var(--text); border: 2px solid var(--focus); padding: 10px 16px; border-radius: var(--r-2); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; color: var(--text); }
hr { border-color: var(--border); opacity: 1; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* A label above a title: the section or the owner, in normal case (TIP-3). */
.eyebrow { display: block; font-size: var(--t-sm); font-weight: 500; color: var(--text-3); margin-bottom: var(--s-1); }
.label-mono { font-size: var(--t-xs); font-weight: 500; color: var(--text-3); }

/* ---------- Brand: the original logo files, one per theme (MAR-1, MAR-2) ---------- */
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); padding: 4px; margin: -4px; text-decoration: none; color: inherit; border-radius: var(--r-2); }
.brand-logo { display: block; height: 28px; width: auto; }
.brand-tag { font-size: var(--t-xs); font-weight: 500; color: var(--text-3); line-height: 1.2; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .logo-light { display: none !important; }
    :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}

/* ---------- Buttons (8.1) ---------- */
.btn {
    --bs-btn-font-family: var(--font-ui); --bs-btn-font-weight: 500; --bs-btn-font-size: var(--t-base); --bs-btn-line-height: 1.2;
    --bs-btn-padding-x: .875rem; --bs-btn-padding-y: 0; --bs-btn-border-radius: var(--r-2); --bs-btn-border-width: 1px;
    --bs-btn-focus-box-shadow: none; --bs-btn-disabled-opacity: .55;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--control-h);
    transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
.btn-sm { --bs-btn-padding-x: .625rem; --bs-btn-font-size: var(--t-sm); --bs-btn-border-radius: var(--r-2); min-height: 1.75rem; }
.btn-lg { --bs-btn-padding-x: 1rem; --bs-btn-font-size: var(--t-base); --bs-btn-border-radius: var(--r-2); min-height: 2.5rem; }
@media (pointer: coarse) { .btn, .btn-sm, .btn-lg { min-height: 44px; } }
.btn-primary, .btn-success {
    --bs-btn-color: var(--on-accent); --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: var(--on-accent); --bs-btn-hover-bg: var(--accent-hover); --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-color: var(--on-accent); --bs-btn-active-bg: var(--accent-hover); --bs-btn-active-border-color: var(--accent-hover);
    --bs-btn-disabled-color: var(--on-accent); --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
    font-weight: 600;
}
.btn-secondary, .btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-light, .btn-google, .btn-warning {
    --bs-btn-color: var(--text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border-control);
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: var(--border-control);
    --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--hover); --bs-btn-active-border-color: var(--text-3);
    --bs-btn-disabled-color: var(--text-disabled); --bs-btn-disabled-bg: var(--surface); --bs-btn-disabled-border-color: var(--border);
}
.btn-ghost {
    --bs-btn-color: var(--text-2); --bs-btn-bg: transparent; --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--hover); --bs-btn-active-border-color: transparent;
}
.btn-danger {
    --bs-btn-color: var(--on-danger); --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger);
    --bs-btn-hover-color: var(--on-danger); --bs-btn-hover-bg: var(--error-fill); --bs-btn-hover-border-color: var(--error-fill);
    --bs-btn-active-color: var(--on-danger); --bs-btn-active-bg: var(--error-fill); --bs-btn-active-border-color: var(--error-fill);
    font-weight: 600;
}
/* Destructive outside a dialog: danger text, neutral border, never a red fill (BTN-4). */
.btn-outline-danger, .btn-danger-ghost {
    --bs-btn-color: var(--error-text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border-control);
    --bs-btn-hover-color: var(--error-text); --bs-btn-hover-bg: var(--error-soft); --bs-btn-hover-border-color: var(--border-control);
    --bs-btn-active-color: var(--error-text); --bs-btn-active-bg: var(--error-soft); --bs-btn-active-border-color: var(--error-text);
}
.btn-link { --bs-btn-color: var(--accent-text); --bs-btn-hover-color: var(--accent-text); --bs-btn-font-weight: 500; --bs-btn-padding-x: 0; text-decoration: underline; text-underline-offset: .18em; }
.btn-icon, .icon-btn { --bs-btn-padding-x: 0; min-width: var(--control-h); }
.btn-sm.btn-icon { min-width: 1.75rem; }
@media (pointer: coarse) { .btn-icon, .icon-btn { min-width: 44px; } }
/* Not valid yet (forms.js): looks disabled but takes the click to show every pending error. */
.btn.is-blocked { opacity: .55; cursor: not-allowed; }
/* Sent (ui.js): keeps its width, shows the spinner (BTN-3). */
.btn.is-loading { pointer-events: none; }
.btn.is-loading .ic { display: none; }
.btn .spinner-border { width: 1em; height: 1em; border-width: .15em; }

/* ---------- Fields (8.3 to 8.6) ---------- */
.form-label { font-weight: 500; font-size: var(--t-base); color: var(--text); margin-bottom: var(--s-1); }
/* A blocked submit says why next to it; a click on it opens the summary on top (E4, FRM-4). */
.submit-reason { margin-inline-start: var(--s-2); font-size: var(--t-sm); color: var(--text-2); align-self: center; }
.submit-reason:empty { display: none; }
.d-flex > .submit-reason, .modal-footer > .submit-reason { margin-inline-start: 0; }
.btn.w-100 + .submit-reason { display: block; margin: var(--s-2) 0 0; text-align: center; }
.form-summary .form-summary-title { font-weight: 600; margin: 0 0 var(--s-1); }
.form-summary ul { margin: 0; padding-left: 1.1rem; }
.form-summary li + li { margin-top: 2px; }
/* Optional fields say so (CAM-5); required ones carry no mark. */
.form-label .opt { color: var(--text-3); font-weight: 400; }
/* A new password: its strength in a bar and in words (8.4); Caps Lock warns under any password. */
.pw-strength { margin-top: var(--s-2); }
.pw-strength[data-level="0"] .pw-meter { visibility: hidden; }
.pw-meter { height: 4px; border-radius: var(--r-full); background: var(--sunken); overflow: hidden; }
.pw-meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--idle-fill); transition: width var(--t-base-motion) ease; }
.pw-strength[data-level="1"] .pw-meter > span { width: 25%; background: var(--error-fill); }
.pw-strength[data-level="2"] .pw-meter > span { width: 50%; background: var(--warn-fill); }
.pw-strength[data-level="3"] .pw-meter > span { width: 75%; background: var(--ok-fill); }
.pw-strength[data-level="4"] .pw-meter > span { width: 100%; background: var(--ok-fill); }
.pw-level { margin: var(--s-1) 0 0; min-height: 1.25em; font-size: var(--t-sm); color: var(--text-2); }
.caps-note { margin: 0; font-size: var(--t-sm); color: var(--warn-text); display: flex; align-items: center; gap: .375rem; }
.caps-note.is-on { margin-top: var(--s-1); }
.caps-note .ic { color: var(--warn-fill); }
.form-text, .form-hint { color: var(--text-3); font-size: var(--t-sm); }
.form-control, .form-select {
    min-height: 2.5rem; padding: .375rem .75rem; font-size: var(--field-font); line-height: 1.43;
    color: var(--text); background-color: var(--surface); border: 1px solid var(--border-control); border-radius: var(--r-2);
}
.form-control::placeholder { color: var(--text-3); opacity: 1; }
.form-control:focus, .form-select:focus { color: var(--text); background-color: var(--surface); border-color: var(--border-control); box-shadow: none; outline: 2px solid var(--focus); outline-offset: 2px; }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--sunken); color: var(--text-2); }
.form-control-sm, .form-select-sm { min-height: var(--control-h); padding: .25rem .625rem; font-size: var(--t-sm); border-radius: var(--r-2); }
.form-control-lg { min-height: 2.75rem; font-size: var(--t-md); border-radius: var(--r-2); }
.form-select { --bs-form-select-bg-img: var(--select-chevron); padding-right: 2.25rem; background-position: right .75rem center; background-size: 14px 10px; }
.form-select-sm { padding-right: 2rem; background-position: right .6rem center; }
.form-select[multiple], .form-select[size]:not([size="1"]) { padding-right: .75rem; background-image: none; }
.form-control.is-invalid, .was-validated .form-control:invalid, .form-select.is-invalid { border-color: var(--error-fill); box-shadow: inset 0 0 0 1px var(--error-fill); background-image: none; padding-right: .75rem; }
.form-control.is-valid, .was-validated .form-control:valid { border-color: var(--border-control); background-image: none; }
.invalid-feedback { color: var(--error-text); font-size: var(--t-sm); font-weight: 500; margin-top: var(--s-1); }
.invalid-feedback::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .35em; vertical-align: -.15em; background: currentColor; -webkit-mask: url("../vendor/lucide/circle-alert.svg") center / contain no-repeat; mask: url("../vendor/lucide/circle-alert.svg") center / contain no-repeat; }
.form-check { min-height: 1.5rem; }
.form-check-input { width: 1.05rem; height: 1.05rem; margin-top: .15em; background-color: var(--surface); border: 1px solid var(--border-control); }
.form-check-input:checked { background-color: var(--accent-mark); border-color: var(--accent-mark); }
.form-check-input:checked[type=checkbox] { --bs-form-check-bg-image: var(--check-img); }
.form-check-input:checked[type=radio] { --bs-form-check-bg-image: var(--radio-img); }
.form-check-input[type=checkbox]:indeterminate { background-color: var(--accent-mark); border-color: var(--accent-mark); --bs-form-check-bg-image: var(--indeterminate-img); }
.form-check-input:focus { border-color: var(--border-control); box-shadow: none; }
.form-check-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.form-switch .form-check-input { width: 2.1em; --bs-form-switch-bg: var(--switch-off-img); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: var(--switch-off-img); }
.form-switch .form-check-input:checked { --bs-form-switch-bg: var(--switch-on-img); background-color: var(--accent-mark); }
.form-check-label { color: var(--text); }
.input-group-text { background: var(--sunken); border-color: var(--border-control); color: var(--text-2); border-radius: var(--r-2); font-size: var(--t-base); }
.input-group > .btn { border-color: var(--border-control); }
/* A field joined to a button or a label rings the whole group, so the ring is never cut by its neighbour. */
.input-group:has(> .form-control:focus, > .form-select:focus) { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-2); }
.input-group > .form-control:focus, .input-group > .form-select:focus { outline: 0; }
.form-narrow { max-width: 640px; }
.password-field .btn { --bs-btn-bg: var(--surface); --bs-btn-color: var(--text-2); }
fieldset legend { font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; }
.code-input { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; padding-left: 1.2rem; }
.code-input::placeholder { letter-spacing: .35em; color: var(--text-disabled); }
/* Tag list (data-tags): the box looks like a field; each value is a removable chip (SEL-5). */
.tags-input { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); padding: .3rem .5rem; min-height: 2.5rem; cursor: text; }
.tags-input:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.tags-input:has(.is-invalid) { border-color: var(--error-fill); box-shadow: inset 0 0 0 1px var(--error-fill); }
.tags-list { display: contents; list-style: none; margin: 0; padding: 0; }
.tag { display: inline-flex; align-items: center; gap: .15rem; max-width: 100%; padding: .1rem .15rem .1rem .5rem; border-radius: var(--r-1); background: var(--sunken); font-size: var(--t-sm); color: var(--text); }
.tag > span { overflow-wrap: anywhere; font-family: var(--font-mono); }
.tag-remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--text-3); padding: 0; }
.tag-remove:hover { background: var(--hover); color: var(--text); }
.tag-remove .ic { width: .9rem; height: .9rem; }
.tags-entry { flex: 1 1 10rem; min-width: 8rem; border: 0; outline: 0; padding: .2rem .3rem; font-size: var(--field-font); color: var(--text); background: transparent; }
.tags-entry::placeholder { color: var(--text-3); }
.tags-input + .invalid-feedback, .tags-input ~ .form-text { margin-top: var(--s-1); }

/* Segmented control (INT-3): 2 to 4 exclusive options, a radio group underneath. */
.segmented { position: relative; display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r-2); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label, .segmented button { display: inline-flex; align-items: center; gap: var(--s-2); min-height: calc(var(--control-h) - 6px); padding: 0 .75rem; border: 0; border-radius: 4px; background: transparent; color: var(--text-2); font-size: var(--t-base); font-weight: 500; cursor: pointer; }
.segmented label:hover, .segmented button:hover { color: var(--text); background: var(--hover); }
.segmented input:checked + label, .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }
.segmented input:focus-visible + label, .segmented button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (pointer: coarse) { .segmented label, .segmented button { min-height: 40px; } }

/* ---------- Panels and cards (8.13): a border, no shadow at rest (ELE-1) ---------- */
.card { --bs-card-bg: var(--surface); --bs-card-color: var(--text); --bs-card-border-color: var(--border); --bs-card-border-radius: var(--r-3); --bs-card-inner-border-radius: calc(var(--r-3) - 1px); --bs-card-cap-bg: var(--surface); --bs-card-spacer-x: 1.25rem; --bs-card-spacer-y: 1.25rem; --bs-card-cap-padding-y: .875rem; box-shadow: none; }
.card-meta { font-size: var(--t-sm); font-weight: 400; color: var(--text-2); }
.card-header { font-family: var(--font-ui); font-weight: 600; font-size: var(--t-md); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; border-bottom-color: var(--border); }
.card-header .card-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); font-weight: 400; font-size: var(--t-sm); color: var(--text-3); }
.card-footer { background: var(--surface); border-top-color: var(--border); color: var(--text-3); font-size: var(--t-sm); }
.card.border-danger, .card.border-warning, .card.border-primary { --bs-card-border-color: var(--border-strong); }
.card.border-danger > .card-header { color: var(--error-text); }
.card.border-warning > .card-header, .card-header.text-bg-warning { background: var(--warn-soft) !important; color: var(--text) !important; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); }
.surface-muted { background: var(--sunken); border-radius: var(--r-2); padding: var(--s-4); }
/* Key-value list (PAN-5): label in text-3, value in text. */
dl.props, dl.kv { display: grid; grid-template-columns: minmax(8rem, 38%) 1fr; gap: var(--s-2) var(--s-4); margin: 0; font-size: var(--t-base); }
dl.props dt, dl.kv dt { font-weight: 400; color: var(--text-3); }
dl.props dd, dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
@media (max-width: 575.98px) { dl.props, dl.kv { grid-template-columns: 1fr; gap: .1rem; } dl.props dd, dl.kv dd { margin-bottom: var(--s-2); } }

/* ---------- Tables (8.12) ---------- */
.table { --bs-table-bg: var(--surface); --bs-table-color: var(--text); --bs-table-border-color: var(--border); --bs-table-hover-bg: var(--hover); --bs-table-hover-color: var(--text); --bs-table-striped-bg: var(--surface); font-size: var(--t-sm); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .5rem var(--cell-px); vertical-align: middle; height: var(--row-h); }
.table-sm > :not(caption) > * > * { padding: .35rem .625rem; }
.table thead th { font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 500; color: var(--text-2); background: var(--sunken); border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: bottom; }
.table tbody tr:last-child > * { border-bottom-width: 0; }
.table-responsive { position: relative; overflow-y: hidden; }
.table-responsive:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.card > .table-responsive:first-child .table thead th:first-child { border-top-left-radius: calc(var(--r-3) - 1px); }
.card > .table-responsive:first-child .table thead th:last-child { border-top-right-radius: calc(var(--r-3) - 1px); }
th[aria-sort] { cursor: pointer; user-select: none; }
th[aria-sort] .sort-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .35em; }
th[aria-sort] .sort-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }
th[aria-sort] .ic { opacity: .45; width: .95em; height: .95em; }
th[aria-sort="ascending"] .ic, th[aria-sort="descending"] .ic { opacity: 1; color: var(--text); }
.table-tools { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--border); }
.table-tools .search { position: relative; flex: 1 1 16rem; max-width: 24rem; }
.table-tools .search .ic { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.table-tools .search input { padding-left: 2.1rem; }
.table-tools .count { font-size: var(--t-sm); color: var(--text-3); margin-left: auto; }
tr.is-filtered-out { display: none; }
/* Below 640 px each row becomes a stacked card: "label: value" pairs (RES-11; ui.js copies the labels). */
@media (max-width: 639.98px) {
    .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tbody tr { border-bottom: 1px solid var(--border); padding: var(--s-3) var(--s-4); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack > :not(caption) > * > * { padding: .2rem 0; border: 0; height: auto; }
    .table-stack td[data-label] { display: grid; grid-template-columns: 38% 1fr; gap: var(--s-3); text-align: left !important; }
    .table-stack td[data-label]::before { content: attr(data-label); font-size: var(--t-xs); font-weight: 500; color: var(--text-3); padding-top: .15rem; }
    .table-stack td[data-label=""]::before, .table-stack td.cell-actions::before { content: none; }
    .table-stack td[data-label=""], .table-stack td.cell-actions { display: flex; justify-content: flex-start; padding-top: var(--s-2); }
    .table-stack td.cell-empty { display: block; }
    .table-stack td.cell-empty::before { content: none; }
    .table-stack td[data-label] > * { justify-self: start; min-width: 0; }
    .table-stack.table-hover > tbody > tr:hover > * { --bs-table-bg-state: transparent; }
}

/* ---------- State (section 6): shape + colour + word, always the three ---------- */
/* Pills: states that need attention or are in progress (EST-2). */
.pill, .badge { --bs-badge-font-size: var(--t-xs); --bs-badge-font-weight: 500; --bs-badge-padding-x: .5rem; --bs-badge-padding-y: 0; --bs-badge-border-radius: var(--r-1); --bs-badge-color: var(--text); display: inline-flex; align-items: center; gap: .375rem; min-height: 22px; padding: 0 .5rem; border-radius: var(--r-1); font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 500; line-height: 1.2; white-space: nowrap; vertical-align: middle; }
.pill .ic, .badge .ic { width: 12px; height: 12px; stroke-width: 2.25; vertical-align: 0; }
.pill-warn, .badge-warn, .text-bg-warning { background: var(--warn-soft) !important; color: var(--warn-text) !important; }
.pill-error, .badge-error, .text-bg-danger { background: var(--error-soft) !important; color: var(--error-text) !important; font-weight: 600; }
.pill-active { background: var(--active-soft) !important; color: var(--active-text) !important; }
.pill-idle, .badge-neutral, .text-bg-secondary, .text-bg-dark { background: var(--idle-soft) !important; color: var(--idle-text) !important; }
.pill-info, .badge-info, .text-bg-info { background: var(--info-soft) !important; color: var(--info-text) !important; }
/* Healthy states are quiet: the shape in colour, the word in text-2, no background (P1). */
.st, .pill-ok, .badge-ok, .text-bg-success { background: transparent !important; color: var(--text-2) !important; padding-left: 0; }
.badge-ok .ic, .text-bg-success .ic, .pill-ok .ic { color: var(--ok-fill); }
/* Inline state for lists and tables: shape + neutral text. */
.st { display: inline-flex; align-items: center; gap: .375rem; font-size: var(--t-sm); white-space: nowrap; }
/* The shapes (12 px), drawn without colour alone: each state has its own form. */
.shape { display: inline-block; width: 12px; height: 12px; flex: 0 0 auto; position: relative; }
.shape-ok { border-radius: 50%; background: var(--ok-fill); }
.shape-active { border-radius: 50%; border: 2px solid var(--active-fill); border-right-color: transparent; animation: sf-spin 1.2s linear infinite; }
.shape-queued { border-radius: 50%; border: 2px dotted var(--idle-fill); }
.shape-warn { background: var(--warn-fill); clip-path: polygon(50% 4%, 100% 96%, 0 96%); }
.shape-error { color: var(--error-fill); }
.shape-error::before, .shape-error::after { content: ""; position: absolute; left: 50%; top: 0; width: 3px; height: 12px; margin-left: -1.5px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.shape-error::after { transform: rotate(-45deg); }
.shape-inactive { width: 10px; height: 10px; margin: 1px; background: var(--idle-fill); border-radius: 2px; }
.shape-draft { border-radius: 50%; border: 2px solid var(--idle-fill); }
.shape-unknown { border-radius: 50%; border: 2px solid var(--idle-fill); }
.shape-unknown::after { content: "?"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 600 8px/1 var(--font-ui); color: var(--idle-text); }
.shape-info { border-radius: 50%; border: 2px solid var(--info-fill); }
.shape-live { border-radius: 50%; background: var(--live-fill); animation: sf-pulse 1.6s ease-in-out infinite; }
@keyframes sf-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes sf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .shape-active, .shape-live { animation: none; } }
/* Chips (8.14): type, and the critical category by fill and outline, never by colour (COL-5). */
.chip, .chip-type, .badge-primary, .badge-super, .text-bg-primary { display: inline-flex; align-items: center; gap: .375rem; min-height: 22px; padding: 0 .5rem; border-radius: var(--r-1); background: var(--sunken) !important; color: var(--text-2) !important; font-size: var(--t-xs); font-weight: 500; white-space: nowrap; border: 0; }
.chip { font-family: var(--font-mono); }
.chip b { color: var(--text); font-weight: 500; }
.chip-prod { background: var(--text) !important; color: var(--surface) !important; }
.chip-staging { background: transparent !important; border: 1px solid var(--text-2); }
.chip-dev { background: transparent !important; border: 1px dashed var(--text-2); }
/* Counter: only for something to attend to (the bell). */
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--error-fill); color: var(--on-danger); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; background: currentColor; }

/* ---------- Notices (8.15): icon, sentence, soft background, no side stripe ---------- */
.alert, .notice { --bs-alert-border-radius: var(--r-3); --bs-alert-padding-x: 1rem; --bs-alert-padding-y: .75rem; --bs-alert-color: var(--text); --bs-alert-link-color: var(--text); display: flex; gap: var(--s-3); align-items: flex-start; border: 1px solid transparent; font-size: var(--t-base); color: var(--text); }
.alert > .ic, .notice > .ic { margin-top: .15em; flex: 0 0 auto; }
.alert > .alert-body, .notice > .notice-body { flex: 1; min-width: 0; }
.alert-dismissible { padding-right: 3rem; }
.alert-success, .notice-ok { --bs-alert-bg: var(--ok-soft); background: var(--ok-soft); }
.alert-success > .ic, .notice-ok > .ic { color: var(--ok-text); }
.alert-warning, .notice-warn { --bs-alert-bg: var(--warn-soft); background: var(--warn-soft); }
.alert-warning > .ic, .notice-warn > .ic { color: var(--warn-text); }
.alert-danger, .notice-error { --bs-alert-bg: var(--error-soft); background: var(--error-soft); }
.alert-danger > .ic, .notice-error > .ic { color: var(--error-text); }
.alert-info, .notice-info { --bs-alert-bg: var(--info-soft); background: var(--info-soft); }
.alert-info > .ic, .notice-info > .ic { color: var(--info-text); }
.alert-secondary { --bs-alert-bg: var(--sunken); background: var(--sunken); }
.note { font-size: var(--t-base); color: var(--text-2); background: var(--sunken); border-radius: var(--r-2); padding: var(--s-3) var(--s-4); }
.note b, .note strong { color: var(--text); }
.note:has(.btn) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.btn-close { --bs-btn-close-bg: var(--close-x); --bs-btn-close-opacity: .7; --bs-btn-close-hover-opacity: 1; --bs-btn-close-focus-shadow: none; width: 1em; height: 1em; }
.btn-close:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-close-white { --bs-btn-close-white-filter: none; filter: none; }
/* Reinstall: what happens, and the text to type (not selectable, so it is typed) */
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.steps-list li { display: grid; grid-template-columns: 1.4rem 1fr; gap: var(--s-2); align-items: start; font-size: var(--t-base); }
.steps-list li > .ic { margin-top: .15rem; color: var(--text-3); }
.challenge { font-family: var(--font-mono); font-size: clamp(1rem, 4.4vw, 1.25rem); font-weight: 500; letter-spacing: clamp(.03em, .8vw, .12em); color: var(--text); background: var(--sunken); border: 1px dashed var(--border-control); border-radius: var(--r-2); padding: .6rem .9rem; margin-bottom: .6rem; user-select: none; -webkit-user-select: none; overflow-wrap: anywhere; }

/* ---------- Floating notices (bottom right; bottom centre on phones) ---------- */
.toast-container { z-index: 1090; }
.toast { --bs-toast-bg: var(--surface); --bs-toast-color: var(--text); --bs-toast-border-color: var(--border-strong); --bs-toast-border-radius: var(--r-3); --bs-toast-max-width: 380px; --bs-toast-font-size: var(--t-base); --bs-toast-box-shadow: var(--shadow-1); box-shadow: var(--shadow-1); }
.toast .toast-body { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); }
.toast .toast-body .ic { color: var(--ok-fill); margin-top: .1em; }
.toast .btn-close { margin-left: auto; }
@media (max-width: 767.98px) { #toasts { left: 0; right: 0; bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px)) !important; display: flex; flex-direction: column; align-items: center; } }

/* ---------- The shell, composition A · Consola (7.2) ---------- */
.panel-page { background: var(--canvas); }
.panel-shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.panel-main { min-width: 0; display: flex; flex-direction: column; }
.panel-sidebar { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--text); background: var(--surface); color: var(--text); border-right: 1px solid var(--border); }
.panel-sidebar .sidebar-inner { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-4) var(--s-3) var(--s-3); min-height: 100%; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-1) var(--s-2) 0; }
.sidebar-nav { display: flex; flex-direction: column; gap: var(--s-2); }
.sidebar-items { display: flex; flex-direction: column; gap: 2px; }
.sidebar-section { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 28px; margin-top: var(--s-2); padding: 0 var(--s-2); border: 0; border-radius: var(--r-2); background: none; font-size: var(--t-xs); font-weight: 500; color: var(--text-3); text-align: left; }
.sidebar-section:hover { color: var(--text); background: var(--hover); }
.nav-chevron { width: .9rem; height: .9rem; flex: 0 0 auto; transition: transform var(--t-base-motion) var(--ease); }
[aria-expanded="false"] > .nav-chevron { transform: rotate(-90deg); }
.sidebar-sub-head { display: flex; align-items: center; gap: 2px; }
.sidebar-sub-head .sidebar-link { flex: 1; min-width: 0; }
.sidebar-sub-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 auto; border: 0; border-radius: var(--r-2); background: none; color: var(--text-3); }
.sidebar-sub-toggle:hover { color: var(--text); background: var(--hover); }
.sidebar-sub-items { margin: 2px 0 0 1.05rem; padding-left: var(--s-2); border-left: 1px solid var(--border); }
.sidebar-link { display: flex; align-items: center; gap: var(--s-3); min-height: 36px; padding: 0 var(--s-2); border-radius: var(--r-2); color: var(--text-2); font-size: var(--t-base); font-weight: 500; text-decoration: none; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.sidebar-link .ic { width: 20px; height: 20px; color: var(--text-3); }
.sidebar-link:hover { background: var(--hover); color: var(--text); }
.sidebar-link:hover .ic { color: var(--text-2); }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent-text); }
.sidebar-link.active .ic { color: var(--accent-text); }
@media (pointer: coarse) { .sidebar-link, .sidebar-sub-toggle { min-height: 44px; } .sidebar-sub-toggle { width: 44px; } }
.sidebar-foot { margin-top: auto; padding: var(--s-3) var(--s-2) 0; border-top: 1px solid var(--border); }
/* "Un producto de" | Zublime (guide 2.2) */
.made-by { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-xs); color: var(--text-3); }
.made-by-sep { width: 1px; height: 14px; background: var(--border-strong); }
.made-by-logo { height: 14px; width: auto; display: block; }

/* The rail: icons with their name on hover or focus (tablet, and the folded sidebar). */
.panel-rail { display: none; flex-direction: column; align-items: center; gap: 2px; width: var(--rail-w); padding: var(--s-3) 0; background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: 1025; }
.rail-home { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: var(--s-2); border-radius: var(--r-2); }
.rail-home img { width: 28px; height: 28px; }
.rail-link { position: relative; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-2); background: none; color: var(--text-3); text-decoration: none; }
.rail-link .ic { width: 20px; height: 20px; }
.rail-link:hover { background: var(--hover); color: var(--text); }
.rail-link.active { background: var(--accent-soft); color: var(--accent-text); }
.rail-link::after { content: attr(data-label); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: .3rem .55rem; border-radius: var(--r-2); background: var(--text); color: var(--surface); font-size: var(--t-xs); font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--t-fast) var(--ease) .4s; z-index: 1080; }
.rail-link:hover::after { opacity: 1; }
.rail-link:focus-visible::after { opacity: 1; transition-delay: 0s; }
.rail-spacer { flex: 1; }

.panel-topbar { display: flex; align-items: center; gap: var(--s-3); min-height: var(--topbar-h); padding: 0 var(--s-6); background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1020; }
.btn-menu { --bs-btn-padding-x: 0; --bs-btn-color: var(--text-2); --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--hover); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: var(--hover); --bs-btn-active-border-color: transparent; min-width: var(--control-h); }
.topbar-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.panel-content { padding: 1.75rem 2rem 3rem; flex: 1; width: 100%; max-width: 1600px; }
.panel-footer { padding: var(--s-4) 2rem var(--s-6); font-size: var(--t-xs); color: var(--text-3); }
.user-menu > .btn { --bs-btn-padding-x: .375rem; --bs-btn-color: var(--text); --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: var(--hover); --bs-btn-active-border-color: transparent; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--hover); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--t-xs); flex: 0 0 auto; }
.user-menu .dropdown-menu { min-width: 260px; }
.theme-switch { padding: var(--s-1) var(--s-2) var(--s-2); }
.theme-switch .segmented { display: flex; }
.theme-switch .segmented button { flex: 1; justify-content: center; padding: 0 .5rem; font-size: var(--t-sm); }
/* The stage is a critical category: a dashed outline chip, no colour (COL-5). */
.stage-badge { display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto; min-height: 24px; padding: 0 .55rem; border: 1px dashed var(--text-2); border-radius: var(--r-1); font-size: var(--t-xs); font-weight: 500; color: var(--text-2); }

/* Bottom bar (phones): up to four destinations and Más (7.2, RES-7). */
.bottom-bar { display: none; }
@media (max-width: 767.98px) {
    .bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--border); }
    .bottom-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; border: 0; background: none; color: var(--text-3); font-size: var(--t-xs); font-weight: 500; text-decoration: none; }
    .bottom-link .ic { width: 20px; height: 20px; }
    .bottom-link.active { color: var(--accent-text); }
    .bottom-link:focus-visible { outline-offset: -3px; }
    .panel-shell { padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px)); }
    .panel-topbar { padding: 0 var(--s-4); }
    .panel-content { padding: var(--s-4) var(--s-4) var(--s-8); }
    .panel-footer { padding: var(--s-4); }
}
@media (min-width: 768px) and (max-width: 991.98px) {
    .panel-shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
    .panel-rail { display: flex; }
    .panel-content { padding: var(--s-6); }
    .panel-topbar, .panel-footer { padding-left: var(--s-6); padding-right: var(--s-6); }
}
@media (max-width: 991.98px) { .panel-sidebar { overflow-y: auto; overscroll-behavior: contain; } }
@media (min-width: 992px) {
    .panel-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .panel-sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
    /* Folded to the rail (preference nav.sidebar). */
    .panel-shell.is-rail { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
    .panel-shell.is-rail .panel-rail { display: flex; }
    .panel-shell.is-rail .panel-sidebar { display: none; }
}

/* Breadcrumbs: the context path, every level a link (NAV-2); phones keep "Atrás" and the last level (NAV-3). */
.breadcrumb { --bs-breadcrumb-margin-bottom: 0; --bs-breadcrumb-divider-color: var(--text-3); --bs-breadcrumb-item-active-color: var(--text); --bs-breadcrumb-item-padding-x: .4rem; font-size: var(--t-sm); flex-wrap: nowrap; overflow: hidden; }
.breadcrumb-item { white-space: nowrap; }
.breadcrumb-item:not(:last-child) { overflow: hidden; text-overflow: ellipsis; }
.breadcrumb-item a { color: var(--text-3); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--accent-text); text-decoration: underline; }
.breadcrumb-item.active { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.crumb-back { display: none; }
@media (max-width: 767.98px) {
    .crumb-back { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin-left: -.5rem; color: var(--text-2); border-radius: var(--r-2); }
    .breadcrumb-item:not(:last-child) { display: none; }
    .breadcrumb-item:last-child::before { display: none; }
}

/* Page header: one h1, the lead, and the actions on the right (ARM-2). */
.page-header { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: flex-end; justify-content: space-between; margin-bottom: var(--s-6); }
.page-header .page-titles { min-width: 0; flex: 1 1 22rem; }
.page-header h1 { font-size: var(--t-xl); margin: 0; overflow-wrap: anywhere; }
.page-header h1 .sub { display: block; font-family: var(--font-mono); font-size: var(--t-sm); font-weight: 400; color: var(--text-3); margin-top: var(--s-1); }
.page-header .lead { font-size: var(--t-base); font-weight: 400; color: var(--text-2); max-width: 70ch; margin: var(--s-2) 0 0; }
.page-header .page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
@media (max-width: 479.98px) { .page-header h1 { font-size: 1.25rem; } }
@media (max-width: 575.98px) { .page-header .page-actions { width: 100%; } .page-header .page-actions > .btn, .page-header .page-actions > form, .page-header .page-actions > form .btn { flex: 1 1 auto; } }
.section-title { font-size: var(--t-lg); margin: var(--s-8) 0 var(--s-3); }

/* Figures strip (PAN-4): label with icon, value in Poppins. */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); padding: var(--s-4) var(--s-4); height: 100%; display: block; color: inherit; text-decoration: none; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
a.kpi:hover { border-color: var(--border-strong); background: var(--hover); color: inherit; }
a.kpi.is-current { border-color: var(--accent-mark); background: var(--accent-soft); }
.kpi .kpi-label { font-size: var(--t-xs); font-weight: 500; color: var(--text-3); display: flex; align-items: center; gap: var(--s-2); }
.kpi .kpi-value { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 600; line-height: 1.2; margin-top: var(--s-1); color: var(--text); }
.kpi-filter { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.kpi-filter .kpi-value { display: block; }
.kpi-filter:hover { border-color: var(--border-strong); background: var(--hover); }
.kpi-filter[aria-pressed="true"] { border-color: var(--accent-mark); background: var(--accent-soft); }
/* The pinned period of a time chart, below it. */
.chart-detail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); padding: var(--s-2) var(--s-3); font-size: var(--t-base); background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r-2); }
.chart-detail[hidden] { display: none; }
.chart-detail > span:nth-child(2) { flex: 1 1 16rem; font-variant-numeric: tabular-nums; }
.chart-box { position: relative; height: 300px; }
.chart-box.small { height: 290px; }
.chart-box.is-empty canvas { visibility: hidden; }
.chart-box.is-empty::before { content: attr(data-empty); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--s-4); border: 1px dashed var(--border-control); border-radius: var(--r-3); color: var(--text-3); font-size: var(--t-base); background: var(--sunken); }
.card-header .chart-title { font: inherit; margin: 0; display: inline-flex; align-items: center; gap: var(--s-2); }
.chart-data { margin-top: var(--s-3); }
.chart-data > summary { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-size: var(--t-base); font-weight: 500; color: var(--accent-text); border-radius: var(--r-2); padding: .15rem .25rem; }
.chart-data > summary:hover { text-decoration: underline; }
.chart-data[open] > summary { margin-bottom: var(--s-2); }
.chart-data .table-responsive { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-3); }
.chart-data thead th { position: sticky; top: 0; z-index: 1; }
.chart-data tbody tr:last-child > * { border-bottom: 0; }
.link-icon { display: inline-flex; align-items: center; gap: .3rem; min-height: 24px; }
.link-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: .4rem; min-height: 28px; }

/* Empty states (8.19): what will appear, how to get there; no illustration, an icon in text-3. */
.empty-state { text-align: center; padding: var(--s-10) var(--s-5); color: var(--text-2); }
.empty-state .tile-ic { margin: 0 auto var(--s-3); width: auto; height: auto; background: none; color: var(--text-3); }
.empty-state .tile-ic .ic { width: 32px; height: 32px; }
.empty-state h2, .empty-state .empty-title { font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; color: var(--text); margin-bottom: var(--s-1); }
.empty-state p { max-width: 46ch; margin: 0 auto var(--s-3); font-size: var(--t-base); }
.tile-ic { width: 40px; height: 40px; border-radius: var(--r-2); background: var(--sunken); display: flex; align-items: center; justify-content: center; color: var(--text-2); flex: 0 0 auto; }
.tile-ic .ic { width: 20px; height: 20px; }

/* Loading (8.20): a flat skeleton with the shape of the content; never a page spinner. */
.skeleton { display: block; background: var(--sunken); border-radius: var(--r-2); color: transparent !important; animation: sf-breathe 1.6s ease-in-out infinite; }
.skeleton-text { height: .9em; margin: .3em 0; }
.chart-box.is-loading::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-3); background: var(--sunken); animation: sf-breathe 1.6s ease-in-out infinite; }
@keyframes sf-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
/* Navigation in progress: a flat line in the live colour. */
.nav-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 2000; background: var(--live-fill); transition: width .3s var(--ease), opacity .3s; opacity: 0; }
.nav-progress.is-active { opacity: 1; width: 75%; transition: width 6s cubic-bezier(.1, .7, .2, 1); }
/* Meter (EST-6, GRA-9): 4 to 6 px, the percentage written next to it. */
.meter { display: block; width: 100%; height: 6px; border-radius: var(--r-full); background: var(--sunken); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--idle-fill); border-radius: var(--r-full); }
.meter.is-warn > span { background: var(--warn-fill); }
.meter.is-error > span { background: var(--error-fill); }

/* QR codes keep a neutral frame */
.scan-frame { position: relative; padding: 12px; display: inline-block; background: var(--logo-plate); border: 1px solid var(--border); border-radius: var(--r-3); }
.scan-frame > .cn-b { display: none; }
.qr-box svg { width: 200px; height: 200px; display: block; }

/* Supervisor credential (ADR 0017): shown once, printed on its own */
.credential-print { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.credential-print .qr-box svg { width: 160px; height: 160px; }
.credential-code { font-size: var(--t-xl); letter-spacing: .08em; margin-bottom: var(--s-2); word-break: break-all; }
.supervisor-reason:empty { display: none; }
.supervisor-summary { font-weight: 600; }
@media print {
    html.print-scope body * { visibility: hidden; }
    html.print-scope .print-target, html.print-scope .print-target * { visibility: visible; }
    html.print-scope .print-target { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; }
    html.print-scope .print-target .no-print { display: none; }
}

/* Values shown once, copied with a button (CAM-7, SEC-2) */
.secret-box { font-family: var(--font-mono); font-size: var(--t-base); background: var(--sunken); border: 1px dashed var(--border-control); padding: var(--s-3) var(--s-4); border-radius: var(--r-2); word-break: break-all; color: var(--text); }
.copyable { display: flex; gap: var(--s-2); align-items: stretch; }
.copyable > .secret-box, .copyable > pre, .copyable > code { flex: 1; min-width: 0; margin: 0; }
pre.mono { white-space: pre-wrap; word-break: break-all; background: var(--sunken); color: var(--text); border: 1px solid var(--border); padding: var(--s-4); border-radius: var(--r-2); max-height: 440px; overflow: auto; font-size: var(--t-sm); line-height: 1.6; }

/* Active filters as chips above a list, each removable (FIL-1). */
.list-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.filter-chip { display: inline-flex; align-items: center; gap: .375rem; max-width: 100%; min-height: 28px; padding: 0 .375rem 0 .625rem; border: 1px solid var(--border); border-radius: var(--r-1); background: var(--sunken); color: var(--text); font-size: var(--t-sm); text-decoration: none !important; }
.filter-chip:hover { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
.filter-chip-label { color: var(--text-2); }
.filter-chip-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.filter-chip .ic { width: 14px; height: 14px; color: var(--text-2); }
@media (pointer: coarse) { .filter-chip { min-height: 40px; } }

/* Open sessions (SES-4): one row per browser, closable. */
.session-list { list-style: none; margin: 0; padding: 0; }
.session-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.session-row:first-child { border-top: 0; padding-top: 0; }
.session-main { min-width: 0; }
.session-device { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.session-device > .ic { color: var(--text-2); }

/* The search button of the top bar and the command palette (CMD-1). */
.topbar-search { display: inline-flex; flex-shrink: 0; align-items: center; gap: var(--s-2); white-space: nowrap; min-height: 2.25rem; padding: 0 var(--s-2) 0 var(--s-3); border: 1px solid var(--border); border-radius: var(--r-2); background: var(--sunken); color: var(--text-2); font-size: var(--t-sm); }
.topbar-search:hover { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
.topbar-search-text { min-width: 8ch; text-align: left; }
.topbar-search-kbd { font-size: var(--t-xs); }
@media (max-width: 767.98px) { .topbar-search { padding: 0 var(--s-2); } .topbar-search-text, .topbar-search-kbd { display: none; } }
@media (max-width: 991.98px) { .topbar-search-kbd { display: none; } }
.palette .modal-dialog { max-width: 640px; margin-top: 12vh; }
.palette .modal-content { overflow: hidden; }
.palette-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.palette-head > .ic { width: 20px; height: 20px; color: var(--text-2); flex: 0 0 auto; }
.palette-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: var(--t-md); padding: var(--s-1) 0; }
.palette-input:focus, .palette-input:focus-visible { outline: none; }
.palette-head:focus-within { box-shadow: inset 0 -2px 0 var(--focus); }
.palette-list { max-height: min(60vh, 28rem); overflow-y: auto; padding: var(--s-2); }
.palette-group { padding: var(--s-2) var(--s-2) var(--s-1); font-size: var(--t-xs); font-weight: 500; color: var(--text-2); }
.palette-option { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: var(--s-2); border-radius: var(--r-2); color: var(--text); cursor: pointer; }
.palette-option > .ic { width: 18px; height: 18px; color: var(--text-2); flex: 0 0 auto; }
.palette-option.is-active { background: var(--accent-soft); }
.palette-option.is-active .palette-label { color: var(--accent-text); }
.palette-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-weight: 500; }
.palette-hint { font-size: var(--t-xs); font-weight: 400; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-key { font-size: var(--t-xs); }
.palette-empty { margin: 0; padding: var(--s-4); color: var(--text-2); font-size: var(--t-sm); }
.palette-foot { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); padding: var(--s-2) var(--s-4); border-top: 1px solid var(--border); background: var(--sunken); color: var(--text-2); font-size: var(--t-xs); }
.palette-foot .ic { width: 14px; height: 14px; vertical-align: -2px; }
@media (max-width: 575.98px) { .palette .modal-dialog { margin-top: 0; } .palette-list { max-height: none; flex: 1; } .palette-foot { display: none; } }
.shortcut-list { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-4); margin: 0 0 var(--s-4); align-items: center; }
.shortcut-list dt { font-weight: 400; white-space: nowrap; }
.shortcut-list dd { margin: 0; }

/* The top bar's indicators: long operations (ATE-5), live data (ATE-6) and the bell (ATE-1). */
.topbar-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: var(--r-2); color: var(--text-2); background: transparent; }
.topbar-icon:hover, .topbar-icon[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.topbar-icon .ic { width: 18px; height: 18px; }
.topbar-icon .badge-count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.activity-indicator, .live-indicator { display: inline-flex; align-items: center; gap: .375rem; font-size: var(--t-sm); color: var(--text-2); white-space: nowrap; }
.activity-indicator { min-height: 2.25rem; padding: 0 var(--s-2); border-radius: var(--r-2); text-decoration: none; }
.activity-indicator:hover { background: var(--hover); color: var(--text); }
.live-indicator.is-reconnecting .shape-live { display: none; }
.live-indicator .shape-active { display: none; }
.live-indicator.is-reconnecting .shape-active { display: inline-block; }
@media (max-width: 767.98px) { .activity-indicator [data-activity-text], .live-indicator [data-live-text] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.attention-menu { width: min(400px, calc(100vw - 2rem)); max-height: min(70vh, 34rem); overflow-y: auto; padding: 0; }
.attention-menu-title { margin: 0; padding: var(--s-3) var(--s-4); font-weight: 600; border-bottom: 1px solid var(--border); }
.attention-menu .attention-list { padding: 0 var(--s-4); }
.attention-menu .attention-empty, .attention-menu .attention-more { padding: var(--s-3) var(--s-4); }
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-item { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.attention-item:first-child { border-top: 0; }
.attention-item > .shape { margin-top: .3rem; }
.attention-title { margin: 0; font-weight: 600; color: var(--text); }
.attention-detail { margin: 2px 0 0; color: var(--text-2); font-size: var(--t-sm); overflow-wrap: anywhere; }
.attention-meta { margin: 2px 0 0; color: var(--text-2); font-size: var(--t-xs); }
.attention-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-2); margin-top: var(--s-2); }
.attention-snooze > summary { list-style: none; display: inline-flex; align-items: center; gap: .375rem; }
.attention-snooze > summary::-webkit-details-marker { display: none; }
.attention-snooze[open] > summary { background: var(--hover); }
.attention-snooze form { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-1); }
.attention-empty { display: flex; align-items: center; gap: var(--s-2); margin: 0; color: var(--text-2); }
.attention-empty .ic { color: var(--ok-fill); }
.attention-more { margin: 0; border-top: 1px solid var(--border); font-size: var(--t-sm); }
.card-title-h { display: flex; align-items: center; gap: var(--s-2); margin: 0; font: inherit; }
/* The service at a glance above Inicio's dashboard: one tile per area, its worst state first (EST-5). */
.summary-tiles { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
/* Six areas: one row on wide screens, two rows of three below (never one tile alone). */
@media (min-width: 1400px) { .summary-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.summary-tile { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); height: 100%; padding: var(--s-3) var(--s-4); border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); color: var(--text); text-decoration: none !important; }
.summary-tile:hover { border-color: var(--border-strong); background: var(--hover); color: var(--text); }
.summary-label { display: inline-flex; align-items: center; gap: .375rem; font-size: var(--t-sm); font-weight: 500; color: var(--text-2); }
.summary-label .ic { width: 16px; height: 16px; }
.summary-note { font-size: var(--t-sm); color: var(--text-2); }
@media (max-width: 575.98px) { .summary-tiles { grid-template-columns: 1fr 1fr; } }

/* Error pages (ERR-3): the code, a clear title, one sentence and the ways out. */
.error-code { margin: 0 0 var(--s-1); font-size: var(--t-sm); color: var(--text-2); }
.error-title { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-xl); margin-bottom: var(--s-3); }
.error-title .ic { width: 24px; height: 24px; color: var(--text-2); flex: 0 0 auto; }

/* Acerca de (guide 2.2): the logo, the exact version and Zublime's backing. */
.about-brand .brand { justify-content: flex-start; }
.about-card .card-footer { display: flex; align-items: center; gap: var(--s-2); background: var(--surface); }

/* Wizard (8.21): every step with its state; a column on the left on wide screens, a row that scrolls on narrow ones. */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
.wizard > * { min-width: 0; }
.wizard-count { font-size: var(--t-sm); font-weight: 500; color: var(--text-2); margin: 0 0 var(--s-2); }
.wizard-nav .sf-progress { margin-bottom: var(--s-3); }
.wizard-steps { list-style: none; margin: 0; padding: 0 0 var(--s-1); display: flex; gap: var(--s-2); overflow-x: auto; scroll-snap-type: x proximity; }
.wizard-steps > li { flex: 0 0 auto; scroll-snap-align: start; }
.wizard-step { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: var(--s-1) var(--s-3) var(--s-1) var(--s-2); border: 1px solid var(--border); border-radius: var(--r-2); background: var(--surface); color: var(--text); text-decoration: none; }
a.wizard-step:hover { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
.wizard-step.is-current { background: var(--accent-soft); border-color: var(--accent-mark); }
.wizard-step.is-current .wizard-label { color: var(--accent-text); font-weight: 600; }
.wizard-num { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: var(--t-xs); font-weight: 600; background: var(--sunken); color: var(--text-2); font-variant-numeric: tabular-nums; }
.wizard-step.is-current .wizard-num { background: var(--accent-mark); color: var(--on-accent-mark); }
.wizard-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; line-height: 1.25; }
.wizard-label { font-size: var(--t-sm); font-weight: 500; white-space: nowrap; }
.wizard-text .st, .wizard-text .pill { font-size: var(--t-xs); min-height: 18px; }
.wizard-text .pill { padding: 0 .375rem; }
.requirement-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-3); }
@media (min-width: 992px) {
    .wizard { grid-template-columns: 240px minmax(0, 1fr); gap: var(--s-8); align-items: start; }
    .wizard-nav { position: sticky; top: var(--s-6); }
    .wizard-steps { flex-direction: column; overflow: visible; gap: 2px; padding: 0; }
    .wizard-step { border-color: transparent; background: transparent; }
    .wizard-step.is-current { border-color: transparent; }
}
.progress { --bs-progress-bar-bg: var(--active-fill); --bs-progress-bg: var(--sunken); --bs-progress-height: 6px; --bs-progress-border-radius: var(--r-full); }
.sf-progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: var(--r-full); background: var(--sunken); overflow: hidden; }
.sf-progress::-webkit-progress-bar { background: var(--sunken); border-radius: var(--r-full); }
.sf-progress::-webkit-progress-value { background: var(--accent-mark); border-radius: var(--r-full); }
.sf-progress::-moz-progress-bar { background: var(--accent-mark); border-radius: var(--r-full); }

/* ---------- Sign-in and installer: the logo on the canvas, the card in the centre ---------- */
.auth-page { min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; min-height: 100vh; min-height: 100dvh; }
.auth-aside { color: var(--text-2); background: var(--canvas); padding: var(--s-6) var(--s-4) 0; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); }
.auth-aside .statement, .auth-aside .lead-dark, .auth-aside .scanline { display: none; }
.auth-aside .aside-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-1) var(--s-3); font-size: var(--t-xs); color: var(--text-3); }
.auth-aside .aside-foot a { color: var(--accent-text); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: var(--s-6) var(--s-4) var(--s-6); gap: var(--s-6); }
.auth-card { width: 100%; max-width: 440px; border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); box-shadow: none; }
.auth-card .card-body { padding: var(--s-8) var(--s-6); }
.auth-card h1 { font-size: var(--t-xl); }
.auth-wide .auth-card { max-width: 720px; }
/* The installer's steps go on the left: a wider card (FRM-1 keeps the form column near 640 px). */
@media (min-width: 992px) { .auth-card:has(.wizard) { max-width: 1040px; } }
.auth-foot { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); font-size: var(--t-xs); color: var(--text-3); text-align: center; }
.auth-divider { display: flex; align-items: center; gap: var(--s-3); color: var(--text-3); font-size: var(--t-sm); margin: var(--s-4) 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.identity-chip { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-2); background: var(--sunken); margin-bottom: var(--s-5); }
.identity-chip .who { min-width: 0; flex: 1; }
.identity-chip .who b { display: block; overflow-wrap: anywhere; }
.method-switch { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); margin-top: var(--s-5); font-size: var(--t-base); }
@media (min-width: 992px) { .auth-aside { padding-top: var(--s-12); } .auth-card .card-body { padding: var(--s-10) var(--s-8); } }

/* ---------- Bootstrap components on the tokens ---------- */
.pagination { --bs-pagination-color: var(--text-2); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-hover-bg: var(--hover); --bs-pagination-hover-color: var(--text); --bs-pagination-hover-border-color: var(--border); --bs-pagination-focus-bg: var(--hover); --bs-pagination-focus-color: var(--text); --bs-pagination-focus-box-shadow: none; --bs-pagination-active-bg: var(--accent-soft); --bs-pagination-active-border-color: var(--accent-mark); --bs-pagination-active-color: var(--accent-text); --bs-pagination-disabled-color: var(--text-disabled); --bs-pagination-disabled-bg: var(--surface); --bs-pagination-disabled-border-color: var(--border); --bs-pagination-border-radius: var(--r-2); font-variant-numeric: tabular-nums; }
.page-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.nav-tabs { --bs-nav-tabs-border-color: var(--border); --bs-nav-tabs-link-active-color: var(--text); --bs-nav-tabs-link-active-bg: transparent; --bs-nav-tabs-link-active-border-color: transparent; --bs-nav-link-color: var(--text-3); --bs-nav-link-hover-color: var(--text); gap: var(--s-1); flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; font-weight: 500; padding: .5rem .75rem; white-space: nowrap; }
.nav-tabs .nav-link.active { border-bottom-color: var(--accent-mark); color: var(--text); }
.nav-tabs .nav-link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 767.98px) { .nav-tabs .nav-link { min-height: 44px; } }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-color: var(--text); --bs-dropdown-border-color: var(--border-strong); --bs-dropdown-border-radius: var(--r-3); --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-link-hover-bg: var(--hover); --bs-dropdown-link-active-bg: var(--accent-soft); --bs-dropdown-link-active-color: var(--accent-text); --bs-dropdown-divider-bg: var(--border); --bs-dropdown-header-color: var(--text-3); --bs-dropdown-font-size: var(--t-base); --bs-dropdown-box-shadow: var(--shadow-1); box-shadow: var(--shadow-1); padding: var(--s-1); }
.dropdown-item { border-radius: var(--r-2); display: flex; align-items: center; gap: var(--s-2); min-height: 36px; padding: 0 var(--s-3); }
.dropdown-item .ic { color: var(--text-3); }
.dropdown-item.text-danger, .dropdown-item.text-danger .ic { color: var(--error-text) !important; }
.dropdown-header { font-size: var(--t-xs); font-weight: 500; color: var(--text-3); }
@media (pointer: coarse) { .dropdown-item { min-height: 44px; } }
.modal { --bs-modal-bg: var(--surface); --bs-modal-color: var(--text); --bs-modal-border-radius: var(--r-4); --bs-modal-inner-border-radius: calc(var(--r-4) - 1px); --bs-modal-border-color: var(--border-strong); --bs-modal-header-border-color: var(--border); --bs-modal-footer-border-color: var(--border); --bs-modal-box-shadow: var(--shadow-2); --bs-modal-width: 480px; }
.modal-title { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; display: flex; align-items: center; gap: var(--s-2); }
.modal-content { box-shadow: var(--shadow-2); }
.modal-backdrop, .offcanvas-backdrop { --bs-backdrop-bg: var(--scrim); --bs-backdrop-opacity: 1; background-color: var(--scrim); }
.modal-backdrop.show, .offcanvas-backdrop.show { opacity: 1; }
.offcanvas { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--text); --bs-offcanvas-border-color: var(--border); --bs-offcanvas-box-shadow: var(--shadow-2); }
.tooltip { --bs-tooltip-bg: var(--text); --bs-tooltip-color: var(--surface); --bs-tooltip-font-size: var(--t-xs); --bs-tooltip-border-radius: var(--r-2); --bs-tooltip-opacity: 1; }
.popover { --bs-popover-bg: var(--surface); --bs-popover-border-color: var(--border-strong); --bs-popover-body-color: var(--text); --bs-popover-box-shadow: var(--shadow-1); --bs-popover-border-radius: var(--r-3); }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-color: var(--text); --bs-list-group-border-color: var(--border); --bs-list-group-border-radius: var(--r-3); --bs-list-group-action-hover-bg: var(--hover); --bs-list-group-action-hover-color: var(--text); --bs-list-group-active-bg: var(--accent-soft); --bs-list-group-active-color: var(--accent-text); --bs-list-group-active-border-color: var(--border); }
.spinner-border { --bs-spinner-border-width: .15em; color: var(--active-text); }

/* Tom Select (multiselects and searchable selects: SEL-1, SEL-4) */
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; border: 0; background: none; box-shadow: none; min-height: 0; outline: 0; }
.ts-control { color: var(--text) !important; background: var(--surface) !important; border: 1px solid var(--border-control) !important; border-radius: var(--r-2) !important; padding: .3rem .6rem !important; min-height: 2.5rem; font-size: var(--field-font) !important; }
.ts-control input { color: var(--text) !important; font-size: var(--field-font) !important; }
.ts-control input::placeholder { color: var(--text-3) !important; }
.focus .ts-control { outline: 2px solid var(--focus) !important; outline-offset: 2px; box-shadow: none !important; }
.ts-wrapper.form-select.single .ts-control, .ts-wrapper.form-select.single.input-active .ts-control { background-image: var(--select-chevron) !important; background-repeat: no-repeat !important; background-position: right .75rem center !important; background-size: 14px 10px !important; padding-right: 2.25rem !important; }
.ts-wrapper.multi .ts-control > div { background: var(--sunken) !important; color: var(--text) !important; border: 0 !important; border-radius: var(--r-1) !important; font-size: var(--t-xs); }
.ts-wrapper.multi .ts-control > div .remove { border-left-color: var(--border-strong) !important; }
.ts-dropdown { color: var(--text) !important; background: var(--surface) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--r-3) !important; box-shadow: var(--shadow-1) !important; }
.ts-dropdown .option, .ts-dropdown .no-results, .ts-dropdown .optgroup-header { color: var(--text) !important; background: transparent !important; }
.ts-dropdown .active { background: var(--hover) !important; color: var(--text) !important; }
.ts-dropdown .selected { background: var(--accent-soft) !important; color: var(--accent-text) !important; }

/* ---------- Disclosure (8.11) and help ---------- */
.disclosure { border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); }
.disclosure > summary { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: var(--s-2) var(--s-3); cursor: pointer; font-weight: 500; font-size: var(--t-base); color: var(--accent-text); border-radius: var(--r-3); list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: ""; margin-left: auto; width: .5rem; height: .5rem; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg); transition: transform var(--t-base-motion) var(--ease); }
.disclosure[open] > summary::after { transform: rotate(-135deg); }
.disclosure > summary:hover { background: var(--hover); }
.disclosure > :not(summary) { padding: 0 var(--s-3) var(--s-3); }
.disclosure-danger > summary { color: var(--error-text); }
.link-hint { display: inline-flex; align-items: center; gap: .35rem; min-height: 24px; padding: .2rem 0; margin-top: .15rem; font-size: var(--t-sm); }
pre.commands { white-space: pre-wrap; overflow-wrap: anywhere; }
.help-steps { padding-left: 1.25rem; margin-bottom: 0; }
.help-steps > li { margin-bottom: var(--s-3); }
.help-steps > li::marker { font-weight: 600; color: var(--text-2); }
.help-steps ul { margin-top: .35rem; padding-left: 1.1rem; }
.help-steps code { overflow-wrap: anywhere; }
.repair-steps { padding-left: 1.2rem; display: flex; flex-direction: column; gap: var(--s-3); }
.repair-steps > li > span { display: block; margin-bottom: .35rem; }

/* Section page: one card per screen of the section (PAN-2: the whole card is the link). */
.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--s-4); }
.tile-link { display: flex; align-items: center; gap: var(--s-3); height: 100%; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.tile-link:hover { border-color: var(--border-strong); background: var(--hover); color: var(--text); }
.tile-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.tile-title { font-weight: 600; font-size: var(--t-md); }
.tile-desc { font-size: var(--t-base); color: var(--text-2); }
.tile-go { color: var(--text-3); flex: 0 0 auto; }
.tile-link.is-soon { background: var(--sunken); }
.tile-link.is-soon:hover { border-color: var(--border); background: var(--sunken); }

/* The pages of a group (Nadro) above each of its pages: a row of tabs that scrolls inside itself (PES-3). */
.ribbon { display: flex; align-items: stretch; gap: var(--s-2); margin: -.25rem 0 var(--s-6); border-bottom: 1px solid var(--border); }
.ribbon-home { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3) 0 0; margin-bottom: -1px; border-right: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: var(--t-base); text-decoration: none; white-space: nowrap; }
.ribbon-home .ic { color: var(--text-3); }
.ribbon-home:hover { color: var(--accent-text); }
.ribbon-list { display: flex; gap: var(--s-1); list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: thin; flex: 1; min-width: 0; }
.ribbon-tile { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3); margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-3); font-size: var(--t-base); font-weight: 500; white-space: nowrap; text-decoration: none; }
.ribbon-ic { display: inline-flex; }
.ribbon-ic .ic { width: 16px; height: 16px; }
.ribbon-tile:hover { color: var(--text); }
.ribbon-tile.active { border-bottom-color: var(--accent-mark); color: var(--text); }
.ribbon-home:focus-visible, .ribbon-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-2); }
@media (max-width: 575.98px) { .ribbon-home { display: none; } }

/* Proveedores mayoristas: one card per wholesaler; their logos sit on a light plate (MAR-5) and are never recoloured. */
.wholesaler-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-4); }
.wholesaler-card { display: flex; flex-direction: column; gap: var(--s-4); height: 100%; padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); color: var(--text); text-decoration: none; position: relative; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
a.wholesaler-card:hover { border-color: var(--border-strong); background: var(--hover); color: var(--text); }
.wholesaler-card .tile-go { position: absolute; top: var(--s-5); right: var(--s-5); }
.wholesaler-logo { display: inline-flex; align-items: center; justify-content: flex-start; align-self: flex-start; height: 64px; padding: 6px 10px; background: var(--logo-plate); border-radius: var(--r-2); }
.wholesaler-logo img { max-height: 52px; max-width: 180px; width: auto; height: auto; }
.wholesaler-body { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.wholesaler-name { font-weight: 600; font-size: var(--t-md); }
.wholesaler-text { font-size: var(--t-base); color: var(--text-2); }
.wholesaler-card.is-soon { background: var(--sunken); }
.heading-logo { height: 40px; width: auto; margin-right: var(--s-3); vertical-align: middle; padding: 4px 8px; background: var(--logo-plate); border-radius: var(--r-2); }
.page-titles h1:has(.heading-logo) { display: flex; align-items: center; flex-wrap: wrap; }

/* Server lists (panel/_list.html.twig, ADR 0011). */
.list-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: var(--s-3) var(--s-4); align-items: end; }
@media (min-width: 992px) { .list-search { grid-column: span 2; } }
.search-box { position: relative; }
.search-box > .ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box > .form-control { padding-left: 2.25rem; }
.list-clear { display: flex; align-items: flex-end; }
.list-clear .btn { width: 100%; white-space: nowrap; }
.list-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-3); }
.list-count { font-size: var(--t-base); color: var(--text-3); }
.list-count .btn-link { font-size: var(--t-base); vertical-align: baseline; min-height: 24px; }
.list-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.list-per { width: auto; }
.list-columns { padding: var(--s-2) var(--s-3); min-width: 230px; max-height: 60vh; overflow-y: auto; }
.list-columns fieldset { margin: 0; }
.list-columns .dropdown-header { padding: .25rem 0 .4rem; }
.list-columns .form-check { min-height: 28px; display: flex; align-items: center; gap: var(--s-2); padding-left: 0; }
.list-columns .form-check-input { margin: 0; float: none; }
.list-table .cell-select { width: 2.75rem; }
.list-table .cell-select .form-check-input { margin: 0; }
.sort-link { display: inline-flex; align-items: center; gap: .3rem; color: inherit; text-decoration: none; border-radius: var(--r-1); }
.sort-link:hover { color: var(--text); }
.sort-link .sort-ic { width: .85rem; height: .85rem; opacity: .5; }
.sort-link.is-sorted { color: var(--text); }
.sort-link.is-sorted .sort-ic { opacity: 1; }
.list-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-4); margin-top: var(--s-4); }
.list-jump { display: flex; align-items: center; gap: var(--s-2); }
.list-jump .form-control { width: 5.5rem; }
.list-results[aria-busy="true"] .card { opacity: .6; transition: opacity var(--t-fast); }
.list-filters-toggle { display: none; }
.list-page-check { display: none; align-items: center; gap: var(--s-2); min-height: 32px; font-size: var(--t-base); font-weight: 500; }
.list-page-check .form-check-input { margin: 0; }
@media (max-width: 639.98px) {
    .list-table.table-stack .cell-select { width: auto; }
    .list-page-check { display: inline-flex; }
}
@media (max-width: 767.98px) {
    .list-bar-actions { width: 100%; }
    .list-filters-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
    .list-tools:not(.show-filters) .list-filter { display: none; }
}

/* Nadro downloads per branch (Configuración) and their buttons. */
.sync-cell { min-width: 6.5rem; }
.sync-line { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.sync-when { display: inline-flex; align-items: center; gap: .3rem; font-size: var(--t-sm); color: var(--text-3); white-space: nowrap; }
.sync-auto, .sync-manual { color: var(--text-3); display: inline-flex; }
.sync-form { display: inline-block; }
.sync-btn.is-syncing { border-style: dashed; }
.sync-btn.is-syncing .ic { color: var(--active-text); animation: sf-spin 1.2s linear infinite; }
.sync-count { font-variant-numeric: tabular-nums; font-size: var(--t-xs); }
.sync-count:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .sync-btn.is-syncing .ic { animation: none; } }
.check-yes { color: var(--text-2); display: inline-flex; }
.check-no { color: var(--text-3); display: inline-flex; }

/* Branch cards above the Nadro viewers: account and the four downloads. */
.branch-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: var(--s-4); }
.branch-card .card-body { padding: var(--s-4) var(--s-5); }
.branch-card-title { font-size: var(--t-md); font-weight: 600; margin: 0 0 .15rem; }
.branch-card-account { display: flex; align-items: center; gap: .35rem; font-size: var(--t-sm); color: var(--text-3); margin: 0 0 var(--s-2); }
.branch-downloads { list-style: none; margin: 0; padding: 0; }
.branch-downloads li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name action" "when action"; align-items: center; column-gap: var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--border); }
.branch-download-name { grid-area: name; display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: var(--t-base); }
.branch-download-when { grid-area: when; display: inline-flex; align-items: center; gap: .3rem; font-size: var(--t-sm); }
.branch-downloads .sync-form, .branch-download-blocker { grid-area: action; }
.branch-download-blocker { font-size: var(--t-xs); color: var(--text-3); max-width: 9rem; text-align: right; }

/* Lists with column groups (one per branch): the group's name above its columns. */
.table thead th.th-group { text-align: center; color: var(--text); border-bottom: 1px solid var(--border-strong); }
.table thead tr + tr th { border-top: 0; }
.btn-link-plain { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; text-decoration-color: var(--border-control); text-underline-offset: .2em; cursor: pointer; text-align: left; }
.btn-link-plain:hover { color: var(--accent-text); text-decoration-color: currentColor; }
.btn-link-plain:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }
.btn-link-plain, .cell-link { min-height: 24px; }
.cell-link { display: inline-flex; align-items: center; gap: .25rem; }
.input-time { max-width: 9rem; }
tr[data-side-row] { cursor: pointer; }
.list-table td.cell-wide { min-width: 13rem; }
/* A column that stays in view, with the checkbox, while a wide list scrolls sideways. */
@media (min-width: 640px) {
    .list-table .cell-sticky-select, .list-table .cell-sticky { position: sticky; z-index: 2; background: var(--surface); }
    .list-table thead .cell-sticky-select, .list-table thead .cell-sticky { background: var(--sunken); z-index: 3; }
    .list-table .cell-sticky-select { left: 0; }
    .list-table .cell-sticky { left: 2.75rem; }
    .list-table .cell-sticky::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; background: var(--border); }
}
@media (max-width: 639.98px) { .list-table td.cell-wide { min-width: 0; } }
tr[data-side-row].is-open > * { background: var(--accent-soft); }

/* Side panel for the detail of a row (DIA-2; its width is a preference, E12 in decisiones-ui.md). */
.side-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 92vw; z-index: 1045; display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-left: 1px solid var(--border-strong); box-shadow: var(--shadow-2); }
.side-panel[hidden] { display: none; }
.side-panel-grip { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; touch-action: none; }
.side-panel-grip::after { content: ""; position: absolute; left: 4px; top: 50%; width: 2px; height: 48px; margin-top: -24px; border-radius: 2px; background: var(--border-control); }
.side-panel-grip:hover::after, .side-panel-grip:focus-visible::after, .side-panel.is-resizing .side-panel-grip::after { background: var(--focus); }
.side-panel-grip:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--topbar-h); padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--border); }
.side-panel-title { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; margin: 0; }
.side-panel-title:focus { outline: none; }
.side-panel-body { flex: 1; overflow: auto; padding: var(--s-4) var(--s-5); }
.side-panel-body:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.side-panel-subject { margin-bottom: var(--s-4); }
.side-panel.is-resizing { user-select: none; }
.side-panel-back { display: none; }
/* Tablets: at most 80 % of the width; phones: the whole screen, closed with "Atrás" (DIA-3, 11.5). */
@media (max-width: 991.98px) { .side-panel { max-width: 80vw; } }
@media (max-width: 767.98px) {
    .side-panel { width: 100% !important; max-width: 100%; border-left: 0; box-shadow: none; }
    .side-panel-grip, .side-panel-close { display: none; }
    .side-panel-back { display: inline-flex; margin-left: calc(var(--s-2) * -1); }
    .side-panel-head { justify-content: flex-start; gap: var(--s-2); padding-inline: var(--s-4); }
}
.warehouse-block + .warehouse-block, .side-section + .side-section { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.warehouse-block-title, .side-section-title { font-size: var(--t-base); font-weight: 600; margin-bottom: .25rem; }
.warehouse-block tfoot th, .warehouse-block tfoot td { border-top: 1px solid var(--border-strong); border-bottom: 0; }
.side-panel-section { display: flex; align-items: center; gap: .4rem; font-size: var(--t-md); margin: var(--s-6) 0 var(--s-3); }
.side-panel-action { border: 1px solid var(--border); border-radius: var(--r-2); padding: var(--s-2) var(--s-3); margin-bottom: var(--s-2); }
.side-panel-action > summary { cursor: pointer; font-weight: 600; min-height: 24px; display: flex; align-items: center; gap: .4rem; }
.side-panel-action[open] > summary { margin-bottom: var(--s-3); }
@media (max-width: 767.98px) {
    .side-panel { width: 100% !important; max-width: 100%; }
    .side-panel-grip { display: none; }
}
/* Read-only file views (Nadro previews): text, XML with its parts marked, Nadro records by type. */
.preview-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
.preview-tabs { margin-bottom: var(--s-2); }
.code-view { font-family: var(--font-mono); font-size: var(--t-sm); line-height: 1.55; background: var(--sunken); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-2); padding: var(--s-3); max-height: 65vh; overflow: auto; white-space: pre; margin: 0; }
.code-view.is-numbered { counter-reset: code-line; }
.code-view .hl-line { display: block; }
.code-view.is-numbered .hl-line::before { counter-increment: code-line; content: counter(code-line); display: inline-block; width: 3ch; margin-right: 1ch; text-align: right; color: var(--text-3); user-select: none; }
.hl-tag { color: var(--code-tag); font-weight: 500; }
.hl-attr { color: var(--code-attr); }
.hl-value { color: var(--code-value); }
.hl-punct, .hl-meta, .hl-comment { color: var(--code-comment); }
.hl-text { color: var(--text); }
/* Nadro record types (C, F, A, P) are categories: the letter distinguishes them, not a colour (COL-5). */
.hl-type { display: inline-block; min-width: 1.4em; text-align: center; font-weight: 600; border-radius: var(--r-1); background: var(--hover); color: var(--text); }
.code-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); padding: 0; margin: var(--s-2) 0 0; font-size: var(--t-sm); color: var(--text-3); }
/* Code editor (templates/nadro/_code_editor.html.twig, ui.js data-code-editor): the textarea lies over
   a highlighted copy with the same font, size, line height and padding, so every character lines up. */
.code-editor-frame { display: flex; height: min(65vh, 40rem); min-height: 16rem; background: var(--sunken); border: 1px solid var(--border-control); border-radius: var(--r-2); overflow: hidden; }
.code-editor-frame:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.code-editor-gutter, .code-editor-highlight, .code-editor-input { font-family: var(--font-mono); font-size: var(--t-sm); line-height: 1.55; letter-spacing: 0; tab-size: 8; font-variant-ligatures: none; }
.code-editor-gutter { display: none; flex: none; min-width: 3.25rem; padding: .75rem .5rem 3rem; text-align: right; color: var(--text-3); white-space: pre; overflow: hidden; user-select: none; border-right: 1px solid var(--border); }
.code-editor-body { position: relative; flex: 1; min-width: 0; }
.code-editor-highlight, .code-editor-input { position: absolute; inset: 0; margin: 0; padding: .75rem; white-space: pre; border: 0; border-radius: 0; }
.code-editor-highlight { display: none; padding-right: 3rem; padding-bottom: 3rem; color: var(--text); background: transparent; overflow: hidden; pointer-events: none; }
.code-editor-input { width: 100%; height: 100%; resize: none; overflow: auto; color: var(--text); caret-color: var(--text); background: transparent; outline: none; }
.code-editor.has-gutter .code-editor-gutter { display: block; }
.code-editor.is-live .code-editor-highlight { display: block; }
.code-editor.is-live .code-editor-input { color: transparent; }
.code-editor.is-live .code-editor-input::selection { color: transparent; background: var(--info-soft); }
.code-editor-highlight .hl-type { display: inline; min-width: 0; border-radius: 0; }
.code-editor-highlight .hl-type, .code-editor-highlight .hl-tag { font-weight: inherit; }
.code-editor-status { margin: .4rem 0 0; min-height: 1.25rem; }

/* Nadro › Directorios */
.directory-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.directory-search { display: flex; flex-wrap: wrap; gap: var(--s-2); flex: 1 1 22rem; }
.directory-search .search-box { flex: 1 1 14rem; }
.directory-upload { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--border); }
/* A section heading inside a form card (client data, billing, contact). */
.form-section { display: flex; align-items: center; gap: .45rem; font-size: var(--t-md); font-weight: 600; margin: 0 0 .35rem; }
/* A list of members (a client's branches and accounts) with a line between items. */
.member-list > li + li { border-top: 1px solid var(--border); }
.deliveries-total { font-size: var(--t-base); margin-bottom: .25rem; }
.deliveries-count { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 600; color: var(--text); margin-right: .25rem; }
.api-count { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Apariencia ---------- */
.appearance-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2) var(--s-6); align-items: center; padding: var(--s-4) 0; border-top: 1px solid var(--border); }
.appearance-row:first-child { border-top: 0; padding-top: 0; }
.appearance-row h2 { font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; margin: 0 0 .15rem; }
.appearance-row p { margin: 0; color: var(--text-2); }
@media (max-width: 639.98px) { .appearance-row { grid-template-columns: minmax(0, 1fr); } }

/* Small helpers */
.gap-section { margin-top: var(--s-6); }
.stack-sm > * + * { margin-top: var(--s-2); }
.min-w-0 { min-width: 0; }
.text-break-all { word-break: break-all; }
.w-uuid { max-width: 13rem; }

/* ---------- Purchase authorization window (ADR 0015 §3): its own page, without the panel's shell ---------- */
.authorize-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); background: var(--surface); }
.authorize-main { max-width: 1080px; margin: 0 auto; padding: var(--s-6) var(--s-4) var(--s-8); display: grid; gap: var(--s-4); }
.authorize-main h1 { font-size: var(--t-xl); margin-bottom: var(--s-2); }
.authorize-grid { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .authorize-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.authorize-code .identity-chip > .ic { color: var(--text-3); flex: 0 0 auto; }
.authorize-filter { max-width: 40rem; }
.authorize-foot { padding-top: var(--s-4); }
.money { font-family: var(--font-mono); font-size: var(--t-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Compras: what happened to an order, in its side panel. */
.order-history { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.order-history > li { display: grid; gap: .15rem; }
.order-history-agent { overflow-wrap: anywhere; }
