/* =====================================================================
   FSS UI - base + primitives (admin en portaal)
   ---------------------------------------------------------------------
   Poort van `app/admin/styles/{base,primitives}.css` uit de Next-app (branch
   feature/redesign-v3), beperkt tot de primitives van Task 0.7. Klassennamen
   zijn bewust gelijk gebleven (`admin-*`, `fss-*`), zodat de module-CSS van
   latere taken 1-op-1 meekomt. Tokens staan in `tokens.css`.

   Gates (tests/Unit/UiCssGatesTest.php): geen kleurverloop (behalve shimmer),
   geen glow/backdrop-filter/uppercase, lime nooit als tekst-, icoon- of
   lijnkleur, geen zichtbare randkleur op secundaire knop en statusbadge.
   ===================================================================== */

/* ---------- 1. BASE ---------------------------------------------------- */

body:has(.admin-chrome),
body:has(.portal-chrome),
body:has(.admin-auth-page) {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    /* clip, not hidden: hidden makes <body> a scroll container as soon as an overlay sets overflow:hidden on <html>, and then the
       sticky sidebar scrolls away with the page behind an open drawer. */
    overflow-x: clip;
}

body:has(.portal-chrome) {
    background: var(--canvas-portal);
}

/* Preflight-lite (Next gebruikt Tailwind's preflight): zonder specificiteit, dus elke eigen regel wint hiervan.
   Links erven kleur, formulierelementen erven het lettertype, lijsten zijn kaal. */
:where(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :where(*, ::before, ::after) {
    border: 0 solid;
}

:where(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :where(a) {
    color: inherit;
    text-decoration: inherit;
}

:where(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :where(button, input, select, textarea, optgroup) {
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
}

:where(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :where(button, [role="button"]) {
    background: transparent;
    cursor: pointer;
}

:where(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :where(ul, ol) {
    margin: 0;
    padding: 0;
    list-style: none;
}

:where(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :where(table) {
    border-collapse: collapse;
    border-color: inherit;
}

:where(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :where(img, video) {
    display: block;
    max-width: 100%;
    vertical-align: middle;
}

/* Icons sit on the text line: inline next to text in a block parent; a flex parent centres them itself. */
:where(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :where(svg) {
    display: inline-block;
    max-width: 100%;
    vertical-align: -0.125em;
}

[x-cloak] {
    display: none !important;
}

.admin-chrome,
.portal-chrome,
.admin-auth-page {
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--ink);
}

.admin-chrome *,
.portal-chrome *,
.admin-auth-page *,
.fss-teleported,
.fss-teleported * {
    box-sizing: border-box;
}

:is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :is(h1, h2, h3, h4, h5, h6) {
    margin: 0;
    color: var(--ink);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
}

:is(.admin-chrome, .portal-chrome, .admin-auth-page) h1 {
    font-size: var(--text-2xl);
    line-height: 32px;
}

:is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) h2 {
    font-size: var(--text-xl);
    line-height: 28px;
}

:is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) h3 {
    font-size: var(--text-lg);
    line-height: 24px;
}

:is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) p {
    margin: 0 0 var(--space-3);
    color: var(--ink-2);
}

:is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) p:last-child {
    margin-bottom: 0;
}

:is(.admin-chrome, .portal-chrome) :is(td, th, time, .admin-num) {
    font-variant-numeric: tabular-nums;
}

.fss-display,
:is(.admin-chrome, .portal-chrome, .admin-auth-page) .admin-page-header h1,
:is(.admin-chrome, .portal-chrome) .admin-kpi-value {
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
    letter-spacing: -0.025em;
}

:is(.admin-chrome, .portal-chrome, .admin-auth-page) .admin-page-header h1 {
    font-size: var(--text-h1);
    line-height: var(--lh-h1);
}

.fss-num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    white-space: nowrap;
}

.fss-mono {
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    line-height: var(--lh-mono);
    letter-spacing: 0;
    font-variant-ligatures: none;
}

.admin-muted {
    color: var(--ink-2);
    font-size: var(--text-sm);
}

.admin-text-link {
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 2px;
}

.admin-text-link:hover {
    text-decoration-color: currentColor;
}

/* A bare link in running text, a list, a definition or help text looks like `.admin-text-link`, never like plain text.
   Everything but the link itself sits in `:where()`, so the rule weighs (0,0,1) and any app nav CSS wins; nav links are excluded. */
:where(.admin-content, .portal-content, .admin-card-body, .admin-drawer-body, .admin-modal, .fss-teleported) :where(p, li, dd, .admin-field-help):where(:not(nav *, [role="navigation"] *)) a:where(:not([class])) {
    color: var(--ink);
    font-weight: var(--font-medium);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 2px;
}

:where(.admin-content, .portal-content, .admin-card-body, .admin-drawer-body, .admin-modal, .fss-teleported) :where(p, li, dd, .admin-field-help):where(:not(nav *, [role="navigation"] *)) a:where(:not([class])):hover {
    text-decoration-color: currentColor;
}

/* Focus: 2px ring met 2px ruimte, alleen bij toetsenbordgebruik (html[data-input]).
   The transparent outline stays invisible next to the ring but becomes visible in forced-colors mode. */
:is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :focus-visible {
    border-radius: var(--radius-sm);
    box-shadow: var(--focus-ring);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

html[data-input="pointer"] :focus-visible:not(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    box-shadow: none;
    outline: none;
}

@media (forced-colors: active) {
    :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :is(:focus, :focus-visible) {
        outline-color: CanvasText !important;
    }
}

:is(.admin-chrome, .portal-chrome) ::selection {
    background: var(--accent-soft);
    color: var(--ink);
}

.fss-skip-link {
    position: absolute;
    z-index: var(--z-skip);
    top: var(--space-2);
    left: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: var(--font-medium);
    text-decoration: none;
    transform: translateY(-200%);
}

.fss-skip-link:focus {
    transform: none;
}

.sr-only,
.fss-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (pointer: coarse) {
    :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) .admin-btn {
        min-height: 44px;
    }

    :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) .admin-btn--icon {
        min-width: 44px;
    }

    :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported)
        :is(.admin-input, .admin-field input:where(:not([type="checkbox"]):not([type="radio"])), .admin-field select, .admin-datatable-search input, .admin-datatable-filter select, .admin-datatable-pagesize select) {
        min-height: 44px;
    }
}

/* Minder beweging: systeem en schakelaar (html[data-motion="reduced"]). */
@media (prefers-reduced-motion: reduce) {
    :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported),
    :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) * {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}

html[data-motion="reduced"] :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported),
html[data-motion="reduced"] :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
}

/* ---------- 2. KNOPPEN ------------------------------------------------- */

.admin-btn {
    position: relative;
    display: inline-flex;
    height: var(--control-md);
    flex: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 20px;
    text-decoration: none;
    /* v2: hover/pressed zijn "instant" (80ms); de pressed-schaal is de enige transform. */
    transition:
        background var(--dur-instant) var(--ease-out),
        border-color var(--dur-instant) var(--ease-out),
        color var(--dur-instant) var(--ease-out),
        transform var(--dur-instant) var(--ease-out);
    white-space: nowrap;
}

.admin-btn > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.admin-btn--sm {
    height: var(--control-sm);
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
}

.admin-btn--lg {
    height: var(--control-lg);
    padding: 0 var(--space-4);
}

.admin-btn--block {
    width: 100%;
}

/* Large full-width button (login, onboarding): fills the column, content centred. */
.admin-btn--lg.admin-btn--block {
    display: flex;
    width: 100%;
}

.admin-btn--icon {
    width: var(--control-sm);
    height: var(--control-sm);
    padding: 0;
}

.admin-btn--icon.admin-btn--md {
    width: var(--control-md);
    height: var(--control-md);
}

.admin-btn--icon.admin-btn--lg {
    width: var(--control-lg);
    height: var(--control-lg);
}

.admin-btn--primary {
    /* v4 (design-v4): de primaire actie is inkt, zoals bij ElevenLabs en shadcn. Lime is een klein merkaccent
       (actieve markering, logo, grafiekpunt), geen knopvlak meer; gate `primary-ink` bewaakt dat. */
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow-1);
}

.admin-btn--primary:hover:not(:disabled) {
    background: #27272a;
}

.admin-btn--primary:active:not(:disabled) {
    background: #3f3f46;
    transform: scale(0.98);
}

.admin-btn--secondary {
    /* Grey control fill, no shadow, no visible border: visible on a white card and on paper, and the same surface as the
       datatable "more filters"/"columns" buttons and the chips. Only inputs carry an outline. */
    border-color: transparent;
    background: var(--control-fill);
    box-shadow: none;
    color: var(--ink);
}

.admin-btn--secondary:hover:not(:disabled) {
    background: var(--control-fill-hover);
}

.admin-btn--secondary:active:not(:disabled) {
    background: var(--control-fill-active);
}

/* Icon-only secondary keeps the square icon size of its control size (no own colour). */
.admin-btn--secondary.admin-btn--icon {
    padding: 0;
}

.admin-btn--ghost {
    color: var(--ink-2);
}

.admin-btn--ghost:hover:not(:disabled) {
    background: var(--control-fill);
    color: var(--ink);
}

.admin-btn--ghost:active:not(:disabled) {
    background: var(--control-fill-hover);
}

/* Destructive icon action in a row: ghost at rest, danger tint on hover and keyboard focus.
   Must stay AFTER the ghost hover/active rules: same weight, so the order decides. */
.admin-btn--icon-danger:is(:hover, :focus-visible):not(:disabled) {
    background: var(--danger-bg);
    color: var(--danger);
}

.admin-btn--icon-danger:active:not(:disabled) {
    background: var(--danger-bg);
    color: var(--danger);
}

.admin-btn--danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.admin-btn--danger:hover:not(:disabled) {
    background: color-mix(in srgb, var(--danger-bg), var(--danger) 8%);
}

.admin-btn--danger-solid {
    background: var(--danger-solid);
    color: #fff;
}

.admin-btn--danger-solid:hover:not(:disabled) {
    background: color-mix(in srgb, var(--danger-solid), #000 10%);
}

.admin-btn--link {
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}

.admin-btn--link:hover:not(:disabled) {
    text-decoration-color: currentColor;
}

/* Uitgeschakeld: eigen tokens, nooit opacity (dan zakt het contrast door). */
.admin-btn:disabled:not([data-loading]),
.admin-btn[aria-disabled="true"]:not([data-loading]) {
    background: var(--surface-2);
    color: var(--ink-disabled);
    cursor: not-allowed;
}

.admin-btn[data-loading="true"] {
    cursor: progress;
}

.admin-btn-spinner {
    display: inline-flex;
    flex: none;
    animation: admin-btn-spin 0.8s linear infinite;
}

@keyframes admin-btn-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes admin-skeleton-shimmer {
    from {
        background-position: 100% 50%;
    }

    to {
        background-position: 0 50%;
    }
}

@keyframes fss-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- 3. VELDEN -------------------------------------------------- */

.admin-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1-5);
}

.admin-field-label {
    color: var(--ink-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
}

.admin-field-help {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

/* Help text right after a control (outside an `x-fss::field`, which uses its own gap): 6px below the control. */
.admin-form :is(.admin-input, input:not([type="hidden"]), select, textarea, .admin-switch-field, .admin-segmented, .fss-combobox) + .admin-field-help {
    margin-top: var(--space-1-5);
}

/* Directly in the form the form gap is known, so the help text is pulled up to the same 6px. */
.admin-form > :is(.admin-input, input:not([type="hidden"]), select, textarea, .admin-switch-field, .admin-segmented, .fss-combobox) + .admin-field-help {
    margin-top: calc(var(--space-1-5) - var(--field-gap));
}

/* Inside a field or a stacked bare label the 6px already comes from the flex gap. */
:is(.admin-field, .admin-form > label:not([class]), .admin-field-grid > label:not([class])) > :is(.admin-input, input:not([type="hidden"]), select, textarea, .admin-switch-field, .admin-segmented, .fss-combobox) + .admin-field-help {
    margin-top: 0;
}

.admin-field-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
}

.admin-field :is(input, select, textarea):where(:not([type="checkbox"]):not([type="radio"])),
.admin-input,
.admin-textarea,
select.admin-select {
    width: 100%;
    min-height: var(--input-h);
    padding: 0 var(--space-3);
    border: 1px solid var(--line-field);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: var(--text-base);
    line-height: 20px;
}

.admin-field textarea,
.admin-textarea {
    min-height: 96px;
    padding: var(--space-2) var(--space-3);
    resize: vertical;
}

:is(.admin-textarea, textarea).admin-textarea--compact {
    min-height: 64px;
}

:is(.admin-textarea, textarea).admin-textarea--tall {
    min-height: 160px;
}

.admin-field :is(input, select, textarea):where(:not([type="checkbox"]):not([type="radio"])):focus,
.admin-input:focus,
.admin-textarea:focus,
select.admin-select:focus {
    border-color: var(--selection-ink);
    box-shadow: var(--focus-ring);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.admin-field :is(input, select, textarea)[aria-invalid="true"],
.admin-field[data-invalid] :is(input, select, textarea) {
    border-color: var(--danger);
}

.admin-field :is(input, select, textarea):where(:disabled) {
    background: var(--surface-2);
    color: var(--ink-disabled);
}

.admin-check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-base);
}

.admin-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--selection-ink);
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.admin-field-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ---------- 4. KAART --------------------------------------------------- */

.admin-card {
    padding: var(--card-pad);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.admin-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.admin-card-head h2,
.admin-card-head h3 {
    font-size: var(--text-md);
    line-height: 24px;
}

.admin-stack {
    display: flex;
    flex-direction: column;
    gap: var(--stack);
}

.admin-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* ---------- 5. STATUSBADGE --------------------------------------------- */

.admin-status-badge {
    display: inline-flex;
    height: var(--badge-h);
    align-items: center;
    gap: var(--space-1-5);
    padding: 0 var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
    white-space: nowrap;
}

.admin-status-badge[data-tone="success"] {
    background: var(--success-bg);
    color: var(--success);
}

.admin-status-badge[data-tone="warning"] {
    background: var(--warning-bg);
    color: var(--warning);
}

.admin-status-badge[data-tone="danger"] {
    background: var(--danger-bg);
    color: var(--danger);
}

.admin-status-badge[data-tone="info"] {
    background: var(--info-bg);
    color: var(--info);
}

/* One badge size everywhere: `data-size="sm"` is accepted for old markup but renders like every other badge. */

.admin-status-badge-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: var(--radius-full);
    background: currentColor;
}

/* ---------- 6. PAGINAKOP ----------------------------------------------- */

.admin-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    padding: 0;
    border-bottom: 0;
    margin: 0;
    background: none;
}

.admin-page-header-copy {
    display: flex;
    min-width: 0;
    flex: 1 1 320px;
    flex-direction: column;
    gap: var(--space-1);
}

.admin-page-header-kicker {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-page-header-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-3);
}

.admin-page-header h1 {
    /* Lettertype, maat (28/32) en gewicht staan in base.css (display, zwaarder gescoped).
       Een lange titel wrapt op twee regels en wordt daarna afgekapt (de volledige titel staat in
       het `title`-attribuut); nooit `…` op één regel. */
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: 32px;
    overflow-wrap: anywhere;
}

.admin-page-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.admin-page-header-desc {
    margin: 0;
    color: var(--ink-2);
    font-size: var(--text-base);
    line-height: 20px;
}

.admin-page-header-actions {
    display: flex;
    flex: 0 1 auto;
    min-height: 32px;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.admin-page-header-primary {
    display: contents;
}

.admin-page-header-next {
    display: grid;
    align-items: baseline;
    gap: var(--space-1) var(--space-3);
    grid-template-columns: 16px minmax(0, auto) auto;
    justify-content: start;
    margin-top: var(--space-2);
    color: var(--ink);
    font-size: var(--text-base);
    line-height: 20px;
}

.admin-page-header-next-node {
    width: 8px;
    height: 8px;
    flex: none;
    align-self: start;
    margin: 6px 4px 0;
    border-radius: var(--radius-full);
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 5px var(--selection-ink);
}

.admin-page-header-next-label {
    color: var(--ink-2);
}

.admin-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-1);
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-breadcrumbs a {
    color: var(--ink-2);
    text-decoration: none;
}

.admin-breadcrumbs a:hover {
    color: var(--ink);
    text-decoration: underline;
}

/* Back link: a quiet text link with an arrow, no pill and no border. The gap below it separates it from the title. */
.admin-back-link {
    display: inline-flex;
    width: fit-content;
    min-height: 24px;
    align-items: center;
    gap: var(--space-1-5);
    margin-bottom: var(--space-3);
    padding: 0;
    border: 0;
    border-radius: var(--radius-xs);
    background: none;
    box-shadow: none;
    color: var(--ink-3);
    font-size: var(--text-sm, 13px);
    font-weight: var(--font-medium);
    line-height: 20px;
    text-decoration: none;
    transition: color var(--dur-fast, 120ms) var(--ease-out, ease-out);
}

.admin-back-link > svg {
    flex: none;
    transition: transform var(--dur-fast, 120ms) var(--ease-out, ease-out);
}

.admin-back-link:hover {
    background: none;
    color: var(--ink);
}

.admin-back-link:hover > svg {
    transform: translateX(-2px);
}

.admin-back-link:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    :is(.admin-chrome, .portal-chrome) .admin-page-header h1 {
        font-size: 24px;
        line-height: 28px;
    }

    .admin-page-header-next {
        grid-template-columns: 16px minmax(0, 1fr);
    }
}

/* Onder 1024 px draagt de vaste actiebalk de primaire actie; de knop in de kop verdwijnt. */
@media (max-width: 1023px) {
    .admin-page-header-primary[data-mobile-bar] {
        display: none;
    }
}

/* ---------- 7. PAGETABS (detailtabs, onderstreept) --------------------- */

.admin-tabs2 {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: var(--space-1);
    border-bottom: 1px solid var(--line);
    margin: 0;
}

/* The ONE gap between a page tab bar and the content below it. Page shells are flex columns with `gap: var(--stack)`, so the bar adds
   only what is missing to reach --tabs-gap (nothing by default). Change the rhythm here (or set --tabs-gap on a shell), never with a
   margin on the next block or on a wrapper around the bar. */
.admin-tabs2[data-variant="page"] {
    margin-bottom: calc(var(--tabs-gap) - var(--stack));
}

.admin-tabs2-scroll {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    gap: var(--space-1);
    /* The active-tab line sits 1px below the bar (on the border). With overflow-x: auto that 1px made the bar scroll vertically
       right after load; the extra pixel of padding over the border holds it, and overflow-y: hidden blocks the vertical scroll. */
    padding-bottom: 1px;
    margin-bottom: -1px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.admin-tabs2-scroll::-webkit-scrollbar {
    display: none;
}

.admin-tab2 {
    position: relative;
    display: inline-flex;
    height: 44px;
    flex: none;
    align-items: center;
    padding: 0 var(--space-3);
    color: var(--ink-3);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    gap: var(--space-2);
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.admin-tab2:hover {
    /* v4 (ElevenLabs): tabs zijn tekst met een inktstreep; hover kleurt alleen de tekst. */
    color: var(--ink);
}

.admin-tab2[aria-current="page"],
.admin-tab2[aria-selected="true"] {
    color: var(--ink);
}

.admin-tab2::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--selection-ink);
    content: "";
    opacity: 0;
    transform: scaleX(0.6);
    transition:
        opacity var(--dur-fast) var(--ease-out),
        transform var(--dur-base) var(--ease-out);
}

.admin-tab2[aria-current="page"]::after,
.admin-tab2[aria-selected="true"]::after {
    opacity: 1;
    transform: none;
}

.admin-tab2-count {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-1-5);
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-medium);
}

/* Scroll-hint: fade-randen die verschijnen waar de balk verder scrolt. */
.admin-tabs2::before,
.admin-tabs2-fade-end {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease-out);
}

.admin-tabs2::before {
    left: 0;
    background: linear-gradient(to right, var(--tabs-fade-bg, var(--canvas)), transparent);
    content: "";
    opacity: 0;
}

.admin-tabs2-fade-end {
    right: 0;
    background: linear-gradient(to left, var(--tabs-fade-bg, var(--canvas)), transparent);
    opacity: 0;
}

.admin-tabs2[data-can-scroll-start]::before,
.admin-tabs2[data-can-scroll-end] .admin-tabs2-fade-end {
    opacity: 1;
}

/* Keyboard focus on a tab: an inset ring, because the scroll box clips everything outside the tab. */
.admin-tab2:focus-visible {
    box-shadow: inset 0 0 0 2px var(--focus-ring-color);
    outline: 2px solid transparent;
    outline-offset: -2px;
}

/* Level 2 (`x-fss::page-tabs level="2"`): sub-sections as a small segmented control under the level-1 line. Grey track
   (--control-fill), the chosen segment white with --shadow-1, left aligned, 32 px high (28 compact), no line. Same links,
   param and scroll script as level 1; on a phone the track scrolls with the same fades (in the track colour). */
.admin-tabs2[data-level="2"] {
    --tabs-l2-h: 32px;
    --tabs-fade-bg: var(--control-fill);
    width: fit-content;
    max-width: 100%;
    border-bottom: 0;
    border-radius: var(--radius-sm);
}

[data-density="compact"] .admin-tabs2[data-level="2"],
.admin-tabs2[data-level="2"][data-density="compact"] {
    --tabs-l2-h: 28px;
}

.admin-tabs2[data-level="2"] .admin-tabs2-scroll {
    height: var(--tabs-l2-h);
    align-items: stretch;
    padding: 2px;
    margin: 0;
    border-radius: var(--radius-sm);
    background: var(--control-fill);
    gap: 2px;
}

.admin-tabs2[data-level="2"] .admin-tab2 {
    height: auto;
    padding: 0 var(--space-3);
    border-radius: calc(var(--radius-sm) - 2px);
    color: var(--ink-2);
    font-size: var(--text-sm, 13px);
    gap: 6px;
    line-height: 18px;
}

.admin-tabs2[data-level="2"] .admin-tab2::after {
    display: none;
}

.admin-tabs2[data-level="2"] .admin-tab2:hover {
    background: var(--control-fill-hover);
    color: var(--ink);
}

.admin-tabs2[data-level="2"] .admin-tab2:is([aria-current="page"], [aria-selected="true"]) {
    background: var(--surface);
    box-shadow: var(--shadow-1);
    color: var(--ink);
}

/* Above the chosen-segment shadow; scoped to keyboard input so a mouse click keeps the plain chosen look. */
html:not([data-input="pointer"]) .admin-tabs2[data-level="2"] .admin-tab2:focus-visible {
    box-shadow: inset 0 0 0 2px var(--focus-ring-color);
}

.admin-tabs2[data-level="2"] .admin-tab2-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--control-fill-active);
    font-size: 11px;
}

.admin-tabs2[data-level="2"] .admin-tab2[aria-current="page"] .admin-tab2-count {
    background: var(--surface-2);
}

.admin-tabs2[data-level="2"]::before,
.admin-tabs2[data-level="2"] .admin-tabs2-fade-end {
    top: 2px;
    bottom: 2px;
}

.admin-tabs2[data-level="2"]::before {
    left: 2px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.admin-tabs2[data-level="2"] .admin-tabs2-fade-end {
    right: 2px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

@media (forced-colors: active) {
    .admin-tabs2[data-level="2"] .admin-tabs2-scroll {
        border: 1px solid CanvasText;
    }

    .admin-tab2:is([aria-current="page"], [aria-selected="true"]) {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
    }

    .admin-tab2:focus-visible {
        outline-color: CanvasText;
    }
}

/* ---------- 8. KPI ----------------------------------------------------- */

.admin-kpi-grid {
    display: grid;
    gap: var(--stack-cards);
    grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .admin-kpi-grid {
        grid-template-columns: repeat(min(var(--kpi-cols, 4), 3), minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phone: two columns, and in a grid with `data-kpi-more` tiles 5+ stay hidden until the grid has `data-expanded`. */
@media (max-width: 640px) {
    .admin-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-kpi-grid[data-kpi-more]:not([data-expanded]) > .admin-kpi:nth-child(n + 5) {
        display: none;
    }
}

.admin-kpi {
    position: relative;
    display: flex;
    min-height: 112px;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    background: var(--surface);
    /* v4: zelfde kaartvlak als `.admin-card` (hairline + shadow-xs). */
    box-shadow: var(--shadow-1);
    color: var(--ink);
    text-decoration: none;
    /* De tegel is een query-container: de waarde krimpt met de tegel mee (zie `.admin-kpi-value`).
       KpiTile staat altijd in een grid, dus zijn breedte komt van buiten — vereist voor inline-size. */
    container-type: inline-size;
}

html[data-density="compact"] .admin-kpi {
    min-height: 96px;
}

a.admin-kpi {
    transition:
        background-color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

a.admin-kpi:hover {
    border-color: var(--line-field);
    background: color-mix(in srgb, var(--surface), var(--surface-2) 40%);
}

.admin-kpi-label {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--ink-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 18px;
}

.admin-kpi-value {
    flex: 1 0 100%;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    margin-top: var(--space-1);
    font-size: min(clamp(22px, 2.4vw + 8px, 30px), max(16px, 14cqi));
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-semibold);
    letter-spacing: -0.01em;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-kpi-hint {
    flex: 1 0 100%;
    margin-top: var(--space-1);
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-kpi[data-tone="danger"] .admin-kpi-hint {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
    color: var(--danger);
}

.admin-kpi[data-tone="warning"] .admin-kpi-hint {
    color: var(--warning);
}

.admin-kpi[data-tone="success"] .admin-kpi-hint {
    color: var(--success);
}

/* ---------- 9. BANNER -------------------------------------------------- */

.admin-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid transparent; /* g1-no-outlines: alleen vlak */
    border-radius: var(--radius-md);
    background: var(--info-bg);
    color: var(--ink);
    font-size: var(--text-base);
    line-height: 20px;
}

.admin-banner[data-tone="success"] {
    background: var(--success-bg);
}

.admin-banner[data-tone="warning"] {
    background: var(--warning-bg);
}

.admin-banner[data-tone="danger"] {
    background: var(--danger-bg);
}

.admin-banner[data-tone="neutral"] {
    background: var(--surface-2);
}

.admin-banner-mark {
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: var(--radius-full);
    background: var(--info);
}

.admin-banner[data-tone="success"] .admin-banner-mark {
    background: var(--success);
}

.admin-banner[data-tone="warning"] .admin-banner-mark {
    background: var(--warning);
}

.admin-banner[data-tone="danger"] .admin-banner-mark {
    background: var(--danger);
}

.admin-banner-copy {
    min-width: 0;
    flex: 1 1 240px;
}

.admin-banner-copy strong {
    display: block;
    font-weight: var(--font-semibold);
}

.admin-banner-copy p {
    margin: 0;
    color: var(--ink-2);
}

.admin-banner-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-left: var(--space-4);
}

/* Icon markup (Next `Banner`): a tone icon, a body with the title, the actions and an optional close button. */
.admin-banner {
    animation: admin-banner-in 200ms var(--ease-out) backwards;
}

.admin-banner-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: var(--ink-2);
}

.admin-banner-icon > svg {
    width: 20px;
    height: 20px;
}

.admin-banner[data-tone="info"] .admin-banner-icon {
    color: var(--info);
}

.admin-banner[data-tone="warning"] .admin-banner-icon {
    color: var(--warning);
}

.admin-banner[data-tone="danger"] .admin-banner-icon {
    color: var(--danger);
}

.admin-banner[data-tone="success"] .admin-banner-icon {
    color: var(--success);
}

.admin-banner-body {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--space-1);
}

.admin-banner-body > p {
    margin: 0;
    color: var(--ink);
}

.admin-banner-title {
    display: block;
    font-weight: var(--font-semibold);
}

.admin-banner-close {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: var(--ink-2);
    cursor: pointer;
}

@keyframes admin-banner-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

/* Inline: rail links, voor binnen een kaart of drawer. */
.admin-banner[data-variant="inline"] {
    padding: var(--space-1) 0 var(--space-1) var(--space-3);
    border: 0;
    border-left: 1px solid var(--info);
    border-radius: 0;
    background: none;
}

.admin-banner[data-variant="inline"][data-tone="success"] {
    border-left-color: var(--success);
}

.admin-banner[data-variant="inline"][data-tone="warning"] {
    border-left-color: var(--warning);
}

.admin-banner[data-variant="inline"][data-tone="danger"] {
    border-left-color: var(--danger);
}

/* ---------- 10. LEGE STAAT --------------------------------------------- */

.admin-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-12) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink-2);
    text-align: center;
}

/* Compact (inside a card or table, and the filtered state): a little less than the page-level 48px, but never cramped. */
.admin-empty-state[data-compact] {
    min-height: 0;
    padding: var(--space-10) var(--space-4);
}

.admin-empty-state > strong {
    font-size: 15px;
    font-weight: var(--font-semibold);
    line-height: 22px;
}

.admin-empty-state > p {
    max-width: 44ch;
    margin: 0;
    color: var(--ink-2);
}

.admin-empty-state-mark {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--surface-2);
}

.admin-empty-state-mark::before {
    width: 8px;
    height: 8px;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-full);
    content: "";
}

.admin-empty-state-icon {
    /* Next EmptyState with an icon: a small white tile with a hairline and shadow-1. */
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    color: var(--ink-2);
}

.admin-empty-state[data-kind="done"] .admin-empty-state-mark {
    background: var(--accent-soft);
}

.admin-empty-state[data-kind="done"] .admin-empty-state-mark::before {
    border-color: var(--selection-ink);
    background: var(--accent);
}

.admin-empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--space-2);
    gap: var(--space-2);
}

/* ---------- 11. DE LIJN, TIJDLIJN -------------------------------------- */

.fss-rail-node {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: none;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-full);
    background: var(--surface);
}

.fss-rail-node[data-state="done"] {
    border-color: var(--ink);
    background: var(--ink);
}

.fss-rail-node[data-state="now"] {
    border-color: var(--selection-ink);
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.fss-timeline {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    gap: var(--space-4);
    list-style: none;
}

.fss-timeline-filters {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
    gap: var(--space-1-5);
}

.fss-timeline-day {
    margin: var(--space-2) 0 0;
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
}

.fss-timeline-item {
    position: relative;
    display: grid;
    padding-left: var(--space-6);
    gap: var(--space-0-5, 2px);
}

.fss-timeline-item::before {
    position: absolute;
    top: 14px;
    bottom: -16px;
    left: 3px;
    width: 3px;
    background: var(--line);
    content: "";
}

.fss-timeline-item:last-child::before {
    display: none;
}

.fss-timeline-item > .fss-rail-node {
    position: absolute;
    top: 4px;
    left: 0;
}

.fss-timeline-title {
    color: var(--ink);
    font-weight: var(--font-medium);
}

.fss-timeline-body {
    color: var(--ink-2);
}

.fss-timeline-meta {
    color: var(--ink-3);
    font-size: var(--text-xs);
}

/* Chips (filters, presets) */
.fss-chip {
    display: inline-flex;
    height: 28px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--ink-2);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-small, 13px);
    font-weight: 500;
    line-height: 1;
    transition: background-color var(--dur-instant) var(--ease-out), color var(--dur-instant) var(--ease-out);
}

.fss-chip:hover {
    background: var(--surface-pressed);
    color: var(--ink);
}

.fss-chip[aria-pressed="true"] {
    border-color: var(--selection-ink);
    background: var(--accent-soft);
    color: var(--accent-ink);
}

/* ---------- 12. SKELETON ----------------------------------------------- */

.admin-skeleton {
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-pressed) 37%, var(--surface-2) 63%);
    background-size: 400% 100%;
    animation: admin-skeleton-shimmer 1400ms ease infinite;
}

@media (prefers-reduced-motion: no-preference) {
    .admin-skeleton {
        background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-pressed) 50%, var(--surface-2) 75%);
        background-size: 200% 100%;
        animation: fss-shimmer 1.4s linear infinite;
    }
}

@keyframes fss-shimmer {
    to {
        background-position: -200% 0;
    }
}

/* ---------- 13. DATATABLE ---------------------------------------------- */

.admin-datatable-wrap {
    overflow: visible;
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.fss-datatable {
    container-type: inline-size;
    container-name: fss-datatable;
}

.admin-datatable-controls {
    display: flex;
    flex-direction: column;
    padding: var(--space-4) var(--space-4) var(--space-3);
    gap: var(--space-2);
}

.admin-datatable-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* Zoekveld: gevuld vlak zonder rand; bij focus wit met de focusring. */
.admin-datatable-search {
    position: relative;
    min-width: 220px;
    max-width: 360px;
    flex: 1 1 280px;
}

.admin-datatable-search > svg {
    position: absolute;
    top: 50%;
    left: var(--space-3);
    width: 16px;
    height: 16px;
    color: var(--ink-3);
    pointer-events: none;
    transform: translateY(-50%);
}

:is(.admin-datatable-controls, .fss-list-card-head) .admin-datatable-search input {
    width: 100%;
    height: var(--control-md);
    padding: 0 var(--space-8) 0 34px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--control-fill);
    box-shadow: none;
    color: var(--ink);
    font: inherit;
}

:is(.admin-datatable-controls, .fss-list-card-head) .admin-datatable-search input:hover {
    background: var(--control-fill-hover);
}

:is(.admin-datatable-controls, .fss-list-card-head) .admin-datatable-search input:focus {
    border-color: var(--focus-ring-color);
    background: var(--surface);
    box-shadow: var(--focus-ring);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.admin-datatable-search-clear {
    position: absolute;
    top: 50%;
    right: var(--space-1);
    transform: translateY(-50%);
}

/* "/"-hint rechts in het zoekveld (desktop, zolang het veld leeg en niet gefocust is). */
.admin-datatable-search-kbd {
    position: absolute;
    top: 50%;
    right: var(--space-2);
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-xs);
    background: var(--control-fill-hover);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
}

.admin-datatable-search:focus-within .admin-datatable-search-kbd {
    display: none;
}

@media (pointer: coarse) {
    .admin-datatable-search-kbd {
        display: none;
    }
}

/* Filter: het label staat in de control ("Klant: Alles"), geen kapjes erboven. */
.admin-datatable-filter {
    position: relative;
    display: inline-flex;
    height: var(--control-md);
    min-width: 0;
    align-items: center;
    gap: var(--space-1-5);
    padding: 0 var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--control-fill);
    color: var(--ink);
    font-size: var(--text-base);
}

.admin-datatable-filter > span {
    color: var(--ink-2);
    font-weight: var(--font-regular);
    line-height: 20px;
    white-space: nowrap;
}

.admin-datatable-filter > span::after {
    content: ":";
}

.admin-datatable-filter:hover {
    background: var(--control-fill-hover);
}

.admin-datatable-filter[data-active] {
    background: var(--control-fill-active);
}

:is(.admin-datatable-controls, .admin-datatable-sheetfilters, .admin-datatable-morefilters) .admin-datatable-filter select {
    width: auto;
    min-width: 0;
    max-width: 220px;
    height: auto;
    padding: 0;
    border: 0;
    background-color: transparent;
    box-shadow: none;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: var(--font-medium);
}

:is(.admin-datatable-controls, .admin-datatable-sheetfilters, .admin-datatable-morefilters) .admin-datatable-filter select:focus {
    box-shadow: none;
    outline: none;
}

html:not([data-input="pointer"]) .admin-datatable-filter:has(select:focus-visible) {
    box-shadow: var(--focus-ring);
}

.admin-datatable-footer .admin-datatable-pagesize select {
    height: var(--control-md);
    padding: 0 var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background-color: var(--control-fill);
    box-shadow: none;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
}

.admin-datatable-footer .admin-datatable-pagesize select:hover {
    background-color: var(--control-fill-hover);
}

/* Meerkeuzefilter: de trigger deelt de look van het select-filter. */
.admin-datatable-filter--button {
    cursor: pointer;
    font: inherit;
}

.admin-datatable-filter--button > strong {
    color: var(--ink);
    font-weight: var(--font-medium);
    white-space: nowrap;
}

.admin-datatable-filter--button > svg {
    flex: none;
    color: var(--ink-3);
}

/* "Meer filters", "Filters (n)" en "Kolommen": secundaire knop op controlhoogte. */
.admin-datatable-more,
.admin-datatable-columns {
    display: inline-flex;
    height: var(--control-md);
    flex: none;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--control-fill);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 20px;
    white-space: nowrap;
    transition:
        background var(--dur-instant) var(--ease-out),
        border-color var(--dur-instant) var(--ease-out);
}

.admin-datatable-more:hover,
.admin-datatable-columns:hover {
    background: var(--control-fill-hover);
}

.admin-datatable-more:active,
.admin-datatable-columns:active {
    background: var(--control-fill-active);
}

.admin-datatable-more svg,
.admin-datatable-columns svg {
    color: var(--ink-2);
}

.admin-datatable-more[data-active] {
    border-color: var(--selection-ink);
}

/* "Kolommen" staat altijd rechts. */
.admin-datatable-toolbar > .fss-menu-host:last-child .admin-datatable-columns {
    margin-left: auto;
}

.admin-datatable-toolbar > .fss-menu-host:last-child {
    margin-left: auto;
}

.admin-datatable-more-count {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-1-5);
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--selection-ink);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-semibold);
}

/* "Filters (n)" bestaat alleen in de kaartlijst-stand (smalle container). */
.admin-datatable-filtersbtn {
    display: none;
}

/* Popover "Meer filters" en de filter-Sheet: de filters staan gestapeld op volle breedte. */
.fss-popover-host {
    position: relative;
    display: inline-flex;
}

/* `.fss-menu` (later in this file) sets `position: absolute`; the double class keeps the panel fixed to the viewport, otherwise
   it stays at its old page position while the page scrolls. */
.fss-menu.fss-popover {
    position: fixed;
    width: 300px;
    padding: var(--space-3);
}

.admin-datatable-morefilters {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.admin-datatable-morefilters-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.admin-datatable-morefilters .admin-datatable-filter,
.admin-datatable-sheetfilters .admin-datatable-filter {
    width: 100%;
    justify-content: space-between;
}

.admin-datatable-morefilters .admin-datatable-filter select,
.admin-datatable-sheetfilters .admin-datatable-filter select {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
    text-align: right;
}

.admin-datatable-filter--picker {
    padding-right: var(--space-1);
}

.admin-datatable-filter--picker .fss-combobox {
    min-width: 0;
    flex: 1 1 auto;
}

.admin-datatable-filter--picker .fss-combobox-control {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.admin-datatable-filter--picker .fss-combobox-input {
    height: 100%;
    min-width: 0;
    font-weight: var(--font-medium);
    text-align: right;
}

.admin-datatable-sheetfilters {
    gap: var(--space-3);
}

.admin-datatable-sheetfilters .admin-datatable-filter {
    min-height: 44px;
}

.admin-datatable-sheetfoot > .admin-btn {
    flex: 1 1 0;
}

.admin-datatable-filter-multi {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-1);
}

.admin-datatable-filter-multi-title {
    color: var(--ink-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.admin-datatable-filter-multi-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 calc(-1 * var(--space-2));
}

/* Own rule: the stacked (sheet / more filters) checklist of a long filter scrolls inside itself. */
.admin-datatable-filter-multi-list {
    max-height: min(320px, 45dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-datatable-filter-multi-list .admin-checkbox-label[hidden] {
    display: none;
}

/* Elke optie is een menurij: vinkje + label, hover-vlak, controlhoogte. */
.admin-datatable-filter-multi-list .admin-checkbox-label {
    display: flex;
    min-height: var(--control-md);
    align-items: center;
    gap: 10px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--ink);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: background-color var(--dur-fast) var(--ease-out);
}

.admin-datatable-filter-multi-list .admin-checkbox-label:hover {
    background: var(--surface-2);
}

.admin-datatable-filter-multi-list .admin-checkbox-label:has(input:checked) {
    font-weight: var(--font-medium);
}

.admin-datatable-filter-multi-list .admin-checkbox-label input {
    width: 16px;
    height: 16px;
    min-height: 0;
    flex: none;
    margin: 0;
    accent-color: var(--selection-ink);
    cursor: pointer;
}

.admin-datatable-more-clear {
    display: inline-flex;
    height: var(--control-sm);
    align-items: center;
    justify-content: center;
    gap: var(--space-1-5);
    padding: 0 var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--control-fill);
    color: var(--ink-2);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.admin-datatable-more-clear:hover {
    background: var(--control-fill-hover);
    color: var(--ink);
}

/* Actieve filters als verwijderbare chips + "Alles wissen". */
.admin-datatable-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.admin-datatable-chip {
    display: inline-flex;
    height: 28px;
    align-items: center;
    gap: var(--space-1-5);
    padding: 0 var(--space-1-5) 0 var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--control-fill);
    color: var(--ink);
    font-size: var(--text-xs);
}

.admin-datatable-chip button {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-full);
    background: none;
    color: var(--ink-2);
    cursor: pointer;
}

.admin-datatable-chip button:hover {
    background: var(--surface-pressed);
    color: var(--ink);
}

.admin-datatable-chips-clear {
    margin-left: var(--space-1);
}

/* Resultaattelling: 8px onder de controls, 12/16. */
.admin-datatable-count {
    margin: 0;
    padding: 0;
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-datatable-scroll {
    overflow-x: auto;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.admin-datatable {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
}

.admin-datatable thead th {
    height: var(--thead-h);
    padding: 0 var(--space-3);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--sidebar-bg);
    color: var(--ink-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 18px;
    text-align: left;
    white-space: nowrap;
}

.admin-datatable th[data-align="right"],
.admin-datatable td[data-align="right"] {
    text-align: right;
}

.admin-datatable th[data-align="center"],
.admin-datatable td[data-align="center"] {
    text-align: center;
}

/* Unit after a value ("/mnd", "GB"): smaller and muted, one small space from the value. */
.fss-unit {
    margin-left: var(--space-1);
    color: var(--ink-3);
    font-size: 0.857em;
}

/* Optional grouped datasets use the same controls in tables and mobile cards. */
.fss-table-group {
    background: var(--surface-2);
    color: var(--ink-2);
    text-align: left;
}

.fss-table-group th {
    padding: var(--space-1) var(--space-3);
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.fss-table-group .fss-table-group-toggle {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    flex-wrap: wrap;
    text-align: left;
    white-space: normal;
}

.fss-table-group-toggle[aria-expanded="false"] > svg {
    transform: rotate(-90deg);
}

.admin-datatable-sort {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

.admin-datatable-sort svg {
    width: 12px;
    height: 12px;
    flex: none;
    color: var(--ink-3);
    opacity: 0.55;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.admin-datatable-sort:hover svg {
    opacity: 1;
}

th[aria-sort] .admin-datatable-sort {
    color: var(--ink);
}

th[aria-sort] .admin-datatable-sort svg {
    opacity: 1;
}

th[aria-sort="descending"] .admin-datatable-sort svg {
    transform: rotate(180deg);
}

.admin-datatable tbody td {
    height: var(--row-h);
    padding: 0 var(--space-3);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    line-height: 20px;
    vertical-align: middle;
    transition: background-color var(--dur-fast) var(--ease-out);
}
/* Rijen komen 4 px omhoog en fadet binnen (180 ms), om en om 25 ms later, tot rij 12: gelijk aan DataTable in de Next-admin.
   Alleen een nieuw ingevoegde rij speelt dit af; een Livewire-morph van bestaande rijen doet niets. */
@keyframes fss-row-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}
.admin-datatable tbody tr {
    animation: fss-row-in 180ms var(--ease-out) backwards;
}
.admin-datatable tbody tr:nth-child(n+2) { animation-delay: 25ms; }
.admin-datatable tbody tr:nth-child(n+3) { animation-delay: 50ms; }
.admin-datatable tbody tr:nth-child(n+4) { animation-delay: 75ms; }
.admin-datatable tbody tr:nth-child(n+5) { animation-delay: 100ms; }
.admin-datatable tbody tr:nth-child(n+6) { animation-delay: 125ms; }
.admin-datatable tbody tr:nth-child(n+7) { animation-delay: 150ms; }
.admin-datatable tbody tr:nth-child(n+8) { animation-delay: 175ms; }
.admin-datatable tbody tr:nth-child(n+9) { animation-delay: 200ms; }
.admin-datatable tbody tr:nth-child(n+10) { animation-delay: 225ms; }
.admin-datatable tbody tr:nth-child(n+11) { animation-delay: 250ms; }
.admin-datatable tbody tr:nth-child(n+12) { animation-delay: 275ms; }
.admin-datatable tbody tr:nth-child(n+13) { animation-delay: 300ms; }
.admin-datatable tbody tr:last-child td {
    border-bottom: 0;
}

/* ONE hover for every table row in admin and portal: the shared datatable, the hand-made .admin-data-table and any other
   hand-made table that opts in with .fss-table. Rows that do something (link, drawer, method) also get the pointer; rows without a target stay on the default cursor. */
:is(.admin-datatable, .admin-data-table, .fss-table) tbody tr:not(.fss-table-group):not([data-selected]):hover > :is(td, th),
:is(.admin-datatable, .admin-data-table, .fss-table) tbody tr:has(a.admin-datatable-rowlink:focus-visible, [data-row-primary]:focus-visible) > :is(td, th) {
    background: var(--sidebar-bg);
}

:is(.admin-datatable, .admin-data-table, .fss-table) tbody tr:is([data-href], [data-row-event], [data-row-method]) {
    cursor: pointer;
}

.admin-datatable tbody tr[data-selected] td:first-child {
    box-shadow: inset 3px 0 0 var(--selection-ink);
}

.admin-datatable tbody tr[data-selected] td {
    background: var(--surface-2);
}

.admin-datatable td[data-mono] {
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    font-variant-ligatures: none;
}

.admin-datatable-select {
    width: 40px;
}

a.admin-datatable-rowlink {
    color: inherit;
    text-decoration: none;
}

.admin-datatable-cellmain {
    display: flex;
    flex-direction: column;
    padding: var(--space-1-5) 0;
}

.admin-datatable-cellmain > :first-child {
    font-weight: var(--font-regular, 400);
}

.admin-datatable-cellmain > :not(:first-child) {
    color: var(--ink-3);
    font-size: var(--text-xs);
}

.admin-datatable-footer {
    display: flex;
    min-height: 56px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--line);
    color: var(--ink-2);
    font-size: var(--text-sm);
    gap: var(--space-3);
}

.admin-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
}

.admin-pagination-pages {
    min-width: 56px;
    text-align: center;
}

/* Kaartlijst (mobiel): onder 768 px containerbreedte wordt elke rij een kaart. */
.fss-cardlist {
    display: none;
    flex-direction: column;
    gap: var(--space-2);
    padding: 0;
    margin: 0;
    list-style: none;
}

.fss-card {
    position: relative;
    display: grid;
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    column-gap: var(--space-3);
    row-gap: 2px;
    transition: background-color var(--dur-instant) var(--ease-out);
}

.fss-card[data-selected] {
    background: var(--accent-soft);
}

.fss-card-title {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    align-items: baseline;
    gap: var(--space-2);
    overflow: hidden;
    color: var(--ink);
    font-weight: var(--font-medium);
    text-overflow: ellipsis;
}

.fss-card-title a {
    color: inherit;
    text-decoration: none;
}

.fss-card-title a::after {
    position: absolute;
    inset: 0;
    content: "";
}

.fss-card-subtitle {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    color: var(--ink-3);
    font-size: var(--text-sm);
    line-height: 18px;
}

.fss-card-trailing {
    grid-column: 2;
    grid-row: 1;
    font-weight: var(--font-semibold);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fss-card-badge {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
}

.fss-card-check {
    position: relative;
    z-index: 1;
}

/* Card with swipe actions (port of SwipeActions): the li is only the border; the content slides over the actions as the front.
   The front must be opaque, otherwise the actions show through. */
.fss-card[data-swipe] {
    display: block;
    padding: 0;
    overflow: hidden;
}

.fss-swipe {
    position: relative;
    overflow: hidden;
    border-radius: inherit;
}

.fss-swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.fss-swipe-action {
    display: flex;
    width: 72px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--surface-2);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-caption, 12px);
    font-weight: var(--font-medium);
    gap: 4px;
    line-height: 16px;
}

.fss-swipe-action[data-tone="danger"] {
    background: var(--danger-solid);
    color: #fff;
}

.fss-swipe-action[data-tone="accent"] {
    background: var(--accent);
    color: var(--accent-ink);
}

.fss-swipe-action:focus-visible {
    box-shadow: inset 0 0 0 2px var(--selection-ink), inset 0 0 0 4px var(--surface);
    outline: 2px solid transparent;
    outline-offset: -2px;
}

.fss-swipe-front {
    position: relative;
    display: grid;
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    column-gap: var(--space-3);
    row-gap: 2px;
    touch-action: pan-y;
}

.fss-card[data-swipe][data-interactive]:hover .fss-swipe-front {
    background: var(--surface-2);
}

.fss-card[data-swipe][data-selected] .fss-swipe-front {
    background: var(--accent-soft);
}

@container fss-datatable (max-width: 767px) {
    .fss-datatable[data-cards] .admin-datatable-scroll {
        display: none;
    }

    /* Kaartlijst: alleen zoeken + "Filters (n)"; kolommen kiezen heeft geen betekenis, en de filters zitten in de Sheet. */
    .fss-datatable[data-cards] .admin-datatable-toolbar > :not(.admin-datatable-search):not(.admin-datatable-filtersbtn) {
        display: none;
    }

    .fss-datatable[data-cards] .admin-datatable-filtersbtn {
        display: inline-flex;
    }

    .fss-datatable[data-cards] .admin-datatable-search {
        min-width: 0;
        max-width: none;
        flex: 1 1 120px;
    }

    .fss-datatable[data-cards] .fss-cardlist {
        display: grid;
    }
}

@media (max-width: 1023px) {
    .fss-datatable[data-cards] .admin-datatable-scroll {
        display: none;
    }

    .fss-datatable[data-cards] .fss-cardlist {
        display: grid;
    }
}

/* Bulkbalk: een zwevende pil onderin het venster. */
.fss-bulkbar {
    position: fixed;
    z-index: var(--z-sticky);
    right: 0;
    bottom: var(--space-6);
    left: 0;
    display: flex;
    max-width: calc(100vw - var(--space-8));
    align-items: center;
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    margin: 0 auto;
    background: var(--night);
    box-shadow: var(--shadow-3);
    color: #fff;
    gap: var(--space-3);
    width: fit-content;
}

.fss-bulkbar .admin-btn {
    color: #fff;
}

.fss-bulkbar .admin-btn:hover {
    background: var(--night-2);
}

.fss-bulkbar .admin-btn[data-tone="danger"] {
    color: #ffb4ae;
}

/* ---------- 13b. VIEWS (lijn-tabs met teller) -------------------------- */

.fss-count {
    display: inline-flex;
    min-width: 20px;
    height: 18px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-medium, 500);
    line-height: 18px;
}

/* Views = navigation level 3: chips with a count, preferably in the toolbar of the table card. No line under the row of chips
   (that is level 1); the chosen chip is filled with the selection ink. */
.fss-views {
    position: relative;
    /* flow-root: the scroller's negative margin must not collapse through this box (it made the box 36 px high and 4 px too high in a block parent). */
    display: flow-root;
    min-width: 0;
    max-width: 100%;
    --fade-bg: var(--canvas);
}

/* Views above a list/card: the page rhythm (`--stack`, 24 px) goes above the block, 12 px between the chips and what they filter.
   Wrap the chips and the card/table that follows in this block; do not add margins to the chips. */
.fss-views-block {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-3);
}

.fss-views-scroller {
    position: relative;
    display: flex;
    /* Room for the focus ring (2px + 2px offset) inside the scroll box: overflow clips everything outside it. */
    padding: var(--space-1);
    margin: calc(var(--space-1) * -1);
    overflow-x: auto;
    overflow-y: hidden;
    gap: var(--space-1);
    scrollbar-width: none;
}

.fss-views-scroller::-webkit-scrollbar {
    display: none;
}

.fss-view {
    position: relative;
    display: inline-flex;
    height: var(--control-sm);
    flex: none;
    align-items: center;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-sm, 13px);
    font-weight: var(--font-medium, 500);
    gap: 6px;
    line-height: 18px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.fss-view:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.fss-view[aria-pressed="true"] {
    background: var(--selection-ink);
    color: var(--surface);
}

.fss-view:focus-visible {
    border-radius: var(--radius-full);
    box-shadow: var(--focus-ring);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Count in the chip: a badge from 1, a dimmed number without a badge surface at 0 (it stays, so the view list never jumps). */
.fss-view-count {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--control-fill);
    color: var(--ink-2);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-medium, 500);
    line-height: 18px;
}

.fss-view:hover .fss-view-count {
    background: var(--control-fill-active);
}

.fss-view-count[data-zero] {
    min-width: 0;
    padding: 0;
    background: none;
    color: var(--ink-4);
}

.fss-view:hover .fss-view-count[data-zero] {
    background: none;
}

.fss-view[aria-pressed="true"] .fss-view-count {
    background: color-mix(in srgb, var(--surface) 18%, transparent);
    color: var(--surface);
}

.fss-view[aria-pressed="true"] .fss-view-count[data-zero] {
    background: none;
    color: color-mix(in srgb, var(--surface) 62%, transparent);
}

/* Scroll hint: an edge fades where the chips scroll on (fssTabs sets the data attributes). Inside a card the fade is white. */
.fss-views::before,
.fss-views-fade-end {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    width: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease-out);
}

.fss-views::before {
    left: 0;
    box-shadow: inset 18px 0 12px -8px var(--fade-bg);
    content: "";
}

.fss-views-fade-end {
    right: 0;
    box-shadow: inset -18px 0 12px -8px var(--fade-bg);
}

.fss-views[data-can-scroll-start]::before,
.fss-views[data-can-scroll-end] .fss-views-fade-end {
    opacity: 1;
}

:is(.admin-card, .admin-datatable-wrap) .fss-views {
    --fade-bg: var(--surface);
}

/* Touch: the chip keeps its look; an invisible margin around it makes the target 44 px high. */
@media (pointer: coarse) {
    .fss-views-scroller {
        padding-block: calc((44px - var(--control-sm)) / 2);
        margin-block: calc((44px - var(--control-sm)) / -2);
    }

    .fss-view::after {
        position: absolute;
        inset: calc((44px - var(--control-sm)) / -2) 0;
        content: "";
    }
}

@media (forced-colors: active) {
    .fss-view[aria-pressed="true"] {
        border: 1px solid Highlight;
        background: Highlight;
        color: HighlightText;
        forced-color-adjust: none;
    }

    .fss-view:focus-visible {
        outline-color: CanvasText;
    }
}

/* ---------- 14. MENU / POPOVER ----------------------------------------- */

.fss-menu-host {
    position: relative;
    display: inline-flex;
}

.fss-menu {
    position: absolute;
    z-index: var(--z-popover);
    top: calc(100% + 4px);
    min-width: 200px;
    padding: var(--space-1);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

/* 2026-11-26 (deliberate fix, own rule so the v0.97 `.fss-menu` rule stays byte for byte): a menu or popover never grows past the viewport.
   The script narrows `max-height` to the room on the side of the trigger it opens on; the panel scrolls itself and keeps a wheel or
   swipe at the end of the list from scrolling the page behind it. */
.fss-menu {
    max-height: min(440px, calc(100dvh - 16px));
    overflow: hidden auto;
    overscroll-behavior: contain;
}

.fss-menu[data-align="end"] {
    right: 0;
}

.fss-menu[data-align="start"] {
    left: 0;
}

.fss-menu-item {
    display: flex;
    width: 100%;
    min-height: 32px;
    align-items: center;
    padding: 0 var(--space-2);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-base);
    gap: var(--space-2);
    text-align: left;
    text-decoration: none;
}

.fss-menu-item:hover,
.fss-menu-item:focus-visible {
    background: var(--surface-2);
}

.fss-menu-item[hidden] {
    display: none;
}

.fss-menu-search {
    padding: var(--space-1) var(--space-1) var(--space-2);
}

/* Own rule (see above): the search field sticks to the top of the scrolling panel so it stays reachable in a long list. */
.fss-menu-search {
    position: sticky;
    z-index: 1;
    /* The panel has padding, and sticky respects it: pull up by that padding so no option shows above the field. */
    top: calc(-1 * var(--space-1));
    background: var(--surface);
}

.fss-menu-search input {
    width: 100%;
    min-height: 36px;
    padding: 0 var(--space-2);
    border: 1px solid var(--line-field);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.fss-menu-empty {
    padding: var(--space-3);
    margin: 0;
    color: var(--ink-3);
    text-align: center;
}

@media (pointer: coarse) {
    .fss-menu-search input {
        font-size: 16px;
    }
}

.fss-menu-item[data-tone="danger"] {
    color: var(--danger);
}

.fss-menu-item[data-checked]::before {
    width: 6px;
    height: 6px;
    flex: none;
    border-radius: var(--radius-full);
    background: var(--selection-ink);
    content: "";
}

.fss-menu-label {
    padding: var(--space-1-5) var(--space-2);
    color: var(--ink-3);
    font-size: var(--text-xs);
}

.fss-menu-sep {
    height: 1px;
    margin: var(--space-1) 0;
    background: var(--line);
}

.fss-menu.fss-tr-from {
    opacity: 0;
    transform: translateY(-4px);
}

.fss-menu.fss-tr-enter,
.fss-menu.fss-tr-leave {
    transition:
        opacity var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.fss-menu.fss-tr-leave-to {
    opacity: 0;
}

/* ---------- 15. OVERLAYS: MODAL, DRAWER, SHEET ------------------------- */

.fss-tr-enter {
    transition:
        opacity var(--dur-slow) var(--ease-out),
        transform var(--dur-slow) var(--ease-out);
}

.fss-tr-leave {
    transition:
        opacity var(--dur-base) var(--ease-in),
        transform var(--dur-base) var(--ease-in);
}

.admin-modal2-scrim,
.admin-drawer-scrim {
    position: fixed;
    background: rgba(16, 21, 18, 0.4);
    inset: 0;
}

.admin-modal2-scrim.fss-tr-from,
.admin-drawer-scrim.fss-tr-from,
.admin-modal2-scrim.fss-tr-leave-to,
.admin-drawer-scrim.fss-tr-leave-to {
    opacity: 0;
}

.admin-modal2 {
    position: fixed;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    inset: 0;
}

.admin-modal2-panel {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 640px;
    max-height: calc(100dvh - var(--space-12));
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-3);
}

.admin-modal2-panel[data-size="sm"] {
    max-width: 480px;
}

.admin-modal2-panel[data-size="lg"] {
    max-width: 800px;
}

.admin-modal2-panel[data-size="xl"] {
    max-width: 960px;
}

.admin-modal2-panel.fss-tr-from,
.admin-modal2-panel.fss-tr-leave-to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
}

.admin-modal2-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.admin-modal2-head {
    padding: var(--card-pad) var(--card-pad) 0;
}

.admin-modal2-head h2 {
    font-size: var(--text-xl);
    line-height: 28px;
}

.admin-modal2-head p {
    margin: var(--space-1) 0 0;
    color: var(--ink-2);
}

.admin-modal2-body {
    flex: 1 1 auto;
    padding: var(--card-pad);
    overflow-y: auto;
}

.admin-modal2-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0 var(--card-pad) var(--card-pad);
    gap: var(--space-2);
}

.admin-drawer {
    position: fixed;
    z-index: var(--z-drawer);
    inset: 0;
}

/* Right-hand panel (Next `Drawer`): 64 px head, 24 px body, 72 px foot. */
.admin-drawer-panel {
    --drawer-width: 480px;

    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    width: min(var(--drawer-width, 640px), 100%);
    max-width: 100%;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid var(--line);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-3);
    touch-action: pan-y;
}

.admin-drawer-panel[data-size="lg"] {
    --drawer-width: 640px;
}

.admin-drawer-panel[data-size="xl"] {
    --drawer-width: 800px;
}

/* No dark rail along the edge: the panel is separated by its subtle border and shadow only. */
.admin-drawer-panel:focus-visible {
    outline: none;
}

/* Spring (`springSheet`: stiffness 341, damping 32.5, mass 1) as a linear() curve: 24 px + fade in, 180 ms ease-in out. */
.admin-drawer-panel.fss-tr-enter {
    transition:
        opacity var(--dur-base) var(--ease-out),
        transform 410ms var(--ease-spring-sheet);
}

.admin-drawer-panel.fss-tr-leave {
    transition:
        opacity 180ms var(--ease-in),
        transform 180ms var(--ease-in);
}

.admin-drawer-panel.fss-tr-from,
.admin-drawer-panel.fss-tr-leave-to {
    opacity: 0;
    transform: translateX(24px);
}

.admin-drawer-scrim.fss-tr-enter {
    transition: opacity var(--dur-base) var(--ease-out);
}

.admin-drawer-scrim.fss-tr-leave {
    transition: opacity var(--dur-fast) var(--ease-in);
}

.admin-drawer-head {
    display: flex;
    min-height: 64px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--card-pad);
    border-bottom: 1px solid var(--line);
    gap: var(--space-3);
}

.admin-drawer-headings {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-1);
}

.admin-drawer-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: var(--text-h2);
    font-weight: var(--font-semibold);
    letter-spacing: -0.01em;
    line-height: var(--lh-h2);
}

.admin-drawer-head .fss-subtitle,
.admin-modal2-head .fss-subtitle {
    margin: 0;
    color: var(--ink-3);
    font-size: var(--text-sm, 13px);
    line-height: 18px;
    overflow-wrap: anywhere;
}

.admin-drawer-head .fss-subtitle.fss-mono,
.admin-modal2-head .fss-subtitle.fss-mono {
    font-size: 12.5px;
}

.admin-drawer-desc {
    margin: 0;
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-drawer-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
}

.admin-drawer-close:hover:not(:disabled) {
    background: var(--surface-2);
    color: var(--ink);
}

.admin-drawer-body {
    flex: 1 1 auto;
    padding: var(--card-pad);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.admin-drawer-foot {
    display: flex;
    min-height: 72px;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: var(--space-4) var(--card-pad);
    border-top: 1px solid var(--line);
    background: var(--surface);
    gap: var(--space-2);
}

.admin-drawer-foot .admin-form-actions {
    padding: 0;
}

/* Forms carry their action row as the last child of the <form>; here it sticks like the foot. */
.admin-drawer-body .admin-form > .admin-form-actions,
.admin-drawer-body > .admin-form-actions {
    position: sticky;
    z-index: 1;
    bottom: calc(var(--card-pad) * -1);
    min-height: 72px;
    margin: var(--card-pad) calc(var(--card-pad) * -1) calc(var(--card-pad) * -1);
    padding: var(--space-4) var(--card-pad);
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.admin-drawer-body .admin-form > .admin-form-actions ~ .admin-form-actions {
    position: static;
    min-height: 0;
    margin: var(--space-4) 0 0;
    padding: 0;
    border-top: 0;
}

/* ACTIONS PINNED TO THE BOTTOM OF EVERY DRAWER.
   A form's action row (the last `.admin-form-actions` in a form inside a drawer body) always sits at the bottom edge of the
   panel: long content scrolls above it (sticky), short content leaves the row at the bottom (the body is a flex column and
   the form fills it; `margin-top: auto` pushes the row down). It is a CSS-only rule, so the buttons stay inside their <form>
   and keep submitting. Drawers that use the `footer` slot already have `.admin-drawer-foot` below the scrolling body.
   Selector weight (0,4,1) beats the older per-app overrides of the same rule. */
.admin-drawer-panel .admin-drawer-body:has(> form) {
    display: flex;
    flex-direction: column;
}

.admin-drawer-panel .admin-drawer-body > form {
    flex: 1 0 auto;
}

.admin-drawer-panel .admin-drawer-body form .admin-form-actions:last-child {
    position: sticky;
    z-index: 2;
    bottom: calc(var(--card-pad) * -1);
    min-height: 72px;
    margin: var(--space-6) calc(var(--card-pad) * -1) calc(var(--card-pad) * -1);
    padding: var(--space-4) var(--card-pad);
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.admin-drawer-panel .admin-drawer-body > .admin-form > .admin-form-actions:last-child,
.admin-drawer-panel .admin-drawer-body > form.admin-form > .admin-form-actions:last-child {
    margin-top: auto;
}

/* Visual separation from the gap above the row when the form is as short as the panel. */
.admin-drawer-panel .admin-drawer-body > .admin-form {
    padding-bottom: 0;
}

/* Sheet: bottom-sheet met sleepgreep. Een Drawer wordt op <= 640 px vanzelf een Sheet. */
.fss-sheet-handle {
    display: none;
    width: 100%;
    padding: var(--space-2) 0 var(--space-1);
    cursor: grab;
    touch-action: none;
}

.fss-sheet-handle::before {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: var(--radius-full);
    margin: 0 auto;
    background: var(--line-strong);
    content: "";
}

.fss-sheet-panel,
.admin-drawer-panel[data-side="bottom"] {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 94dvh;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
}

.fss-sheet-panel.fss-tr-from,
.fss-sheet-panel.fss-tr-leave-to,
.admin-drawer-panel[data-side="bottom"].fss-tr-from,
.admin-drawer-panel[data-side="bottom"].fss-tr-leave-to {
    opacity: 0;
    transform: translateY(24px);
}

.fss-sheet-panel[data-height="full"] {
    height: 94dvh;
}

.fss-sheet-panel .fss-sheet-handle,
.admin-drawer-panel[data-side="bottom"] .fss-sheet-handle {
    display: block;
}

@media (max-width: 640px) {
    .admin-drawer-panel {
        top: auto;
        left: 0;
        width: 100%;
        max-width: 100%;
        max-height: 94dvh;
        border-top: 1px solid var(--line);
        border-left: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .admin-drawer-panel.fss-tr-from,
    .admin-drawer-panel.fss-tr-leave-to {
        opacity: 0;
        transform: translateY(24px);
    }

    .admin-drawer-panel .fss-sheet-handle {
        display: block;
    }

    .admin-drawer-head {
        padding: var(--space-3) var(--card-pad);
    }

    .admin-drawer-body {
        padding: var(--card-pad);
    }

    .admin-drawer-foot {
        padding: var(--space-4) calc(var(--card-pad) + env(safe-area-inset-right)) calc(var(--space-4) + env(safe-area-inset-bottom)) var(--card-pad);
    }

    .admin-drawer-body .admin-form > .admin-form-actions,
    .admin-drawer-body > .admin-form-actions {
        bottom: calc(var(--card-pad) * -1);
        margin: var(--card-pad) calc(var(--card-pad) * -1) calc(var(--card-pad) * -1);
        padding: var(--space-4) var(--card-pad) calc(var(--space-4) + env(safe-area-inset-bottom));
    }

    .admin-modal2 {
        align-items: flex-end;
        padding: var(--space-4) 0 0;
    }

    .admin-modal2-panel {
        max-width: none;
        max-height: calc(100dvh - var(--space-8));
        border-bottom: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .admin-modal2-panel.fss-tr-from,
    .admin-modal2-panel.fss-tr-leave-to {
        transform: translateY(100%);
    }

    .admin-modal2-head {
        padding: var(--space-4) var(--space-4) 0;
    }

    .admin-modal2-body {
        padding: var(--space-4);
    }

    .admin-modal2-foot {
        padding: 0 var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
    }
}

/* Waarschuwing "niet opgeslagen" binnen een drawer */
.fss-discard {
    position: absolute;
    z-index: 2;
    right: var(--space-4);
    bottom: var(--space-4);
    left: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.fss-discard strong {
    display: block;
    margin-bottom: var(--space-1);
}

.fss-discard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: var(--space-3);
    gap: var(--space-2);
}

/* ---------- 16. CONFIRM ------------------------------------------------ */

.admin-confirm2-body {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.admin-confirm2-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--ink-2);
    font-weight: var(--font-semibold);
}

.admin-confirm2-body[data-tone="danger"] .admin-confirm2-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.admin-confirm2-copy {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--space-3);
}

.admin-confirm2-copy > .admin-muted {
    color: var(--ink-2);
    font-size: var(--text-body);
    line-height: var(--lh-body);
}

.admin-confirm2-object {
    font-weight: var(--font-semibold);
    overflow-wrap: anywhere;
}

.admin-confirm2-consequences {
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    margin: 0;
    background: var(--surface-2);
    color: var(--ink);
    font-size: var(--text-small);
    gap: var(--space-1);
    line-height: var(--lh-small);
    list-style: none;
}

.admin-confirm2-consequences li {
    position: relative;
    padding-left: var(--space-4);
}

.admin-confirm2-consequences li::before {
    position: absolute;
    top: 6px;
    left: 2px;
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--ink-3);
    content: "";
}

/* ---------- 17. TOAST -------------------------------------------------- */

.admin-toast-region {
    position: fixed;
    z-index: var(--z-toast);
    right: var(--space-6);
    bottom: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}

/* Same look as the Next toast: icon, title + text, optional undo button, round-corner close; the tone is the left rail. */
.admin-toast {
    position: relative;
    display: flex;
    width: 360px;
    max-width: calc(100vw - var(--space-8));
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
    border-left: 3px solid var(--ink-2);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-2);
    font-size: var(--text-base);
    pointer-events: auto;
}

.admin-toast[data-tone="success"] {
    border-left-color: var(--success);
}

.admin-toast[data-tone="warning"] {
    border-left-color: var(--warning);
}

.admin-toast[data-tone="error"] {
    border-left-color: var(--danger);
}

.admin-toast[data-tone="info"] {
    border-left-color: var(--info);
}

.admin-toast-icon {
    display: inline-flex;
    flex: 0 0 auto;
    padding-top: 1px;
    color: var(--ink-3);
}

.admin-toast-icon .fss-icon,
.admin-toast-icon svg {
    width: 18px;
    height: 18px;
}

.admin-toast[data-tone="success"] .admin-toast-icon {
    color: var(--success);
}

.admin-toast[data-tone="warning"] .admin-toast-icon {
    color: var(--warning);
}

.admin-toast[data-tone="error"] .admin-toast-icon {
    color: var(--danger);
}

.admin-toast[data-tone="info"] .admin-toast-icon {
    color: var(--info);
}

.admin-toast-copy {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
}

.admin-toast-title {
    color: var(--ink);
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    line-height: var(--lh-body);
}

.admin-toast-body {
    color: var(--ink-2);
    font-size: var(--text-small);
    line-height: var(--lh-small);
}

.admin-toast-close {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin: -4px -4px -4px 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink-3);
    cursor: pointer;
}

.admin-toast-close:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.admin-toast-undo {
    display: inline-flex;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-1);
    margin: -4px 0;
    padding: 0 var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--control-fill);
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-small);
    font-weight: var(--font-medium);
    white-space: nowrap;
}

.admin-toast-undo:hover {
    background: var(--control-fill-hover);
}

.admin-toast-undo .fss-icon,
.admin-toast-undo svg {
    width: 14px;
    height: 14px;
}

/* Undo toast: the rail is the track and its bar drains over the toast duration (remaining time to undo). */
.admin-toast[data-undo] {
    border-left-color: var(--line);
}

.admin-toast-progress {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    width: 3px;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: var(--success);
    transform-origin: bottom;
    animation: fss-toast-drain var(--toast-ms, 6000ms) linear forwards;
}

.admin-toast[data-paused] .admin-toast-progress {
    animation-play-state: paused;
}

@keyframes fss-toast-drain {
    from {
        transform: scaleY(1);
    }

    to {
        transform: scaleY(0);
    }
}

html[data-motion="reduced"] .admin-toast-progress {
    animation: none;
}

.admin-toast.fss-tr-from,
.admin-toast.fss-tr-leave-to {
    opacity: 0;
    transform: translateY(8px);
}

@media (max-width: 1023px) {
    .admin-toast-region {
        bottom: calc(var(--space-4) + var(--bottom-nav-h, 0px) + env(safe-area-inset-bottom));
    }
}

@media (max-width: 640px) {
    .admin-toast-region {
        right: var(--space-4);
        left: var(--space-4);
    }

    .admin-toast {
        width: 100%;
        max-width: none;
    }
}

/* ---------- 18. COMBOBOX ----------------------------------------------- */

.fss-combobox {
    position: relative;
}

.fss-combobox-control {
    position: relative;
    display: flex;
    min-height: var(--input-h);
    flex-wrap: wrap;
    align-items: center;
    padding: 0 var(--space-2);
    border: 1px solid var(--line-field);
    border-radius: var(--radius-sm);
    background: var(--surface);
    gap: var(--space-1);
}

.fss-combobox-control:focus-within {
    border-color: var(--selection-ink);
    box-shadow: var(--focus-ring);
}

.fss-combobox-input {
    min-width: 80px;
    height: calc(var(--input-h) - 2px);
    flex: 1 1 80px;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    outline: none;
}

.fss-combobox-input:focus-visible {
    box-shadow: none;
}

.fss-combobox-single {
    color: var(--ink);
}

.fss-combobox-chip {
    display: inline-flex;
    height: 24px;
    align-items: center;
    padding: 0 var(--space-1) 0 var(--space-2);
    border-radius: var(--radius-full);
    background: var(--control-fill);
    font-size: var(--text-sm);
    gap: var(--space-1);
}

.fss-combobox-chip button {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    background: none;
    color: var(--ink-2);
    cursor: pointer;
}

.fss-combobox-list {
    position: absolute;
    z-index: var(--z-popover);
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 260px;
    padding: var(--space-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin: 0;
    background: var(--surface);
    box-shadow: var(--shadow-2);
    list-style: none;
    overflow-y: auto;
}

.fss-combobox-option {
    display: flex;
    min-height: 32px;
    align-items: center;
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    gap: var(--space-2);
}

.fss-combobox-option[data-active] {
    background: var(--surface-2);
}

.fss-combobox-option[aria-selected="true"] {
    font-weight: var(--font-medium);
}

.fss-combobox-option[aria-selected="true"]::after {
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-radius: var(--radius-full);
    background: var(--selection-ink);
    content: "";
}

.fss-combobox-group {
    padding: var(--space-1-5) var(--space-2);
    color: var(--ink-3);
    font-size: var(--text-xs);
}

.fss-combobox-empty {
    padding: var(--space-3);
    color: var(--ink-3);
    text-align: center;
}

/* The Blade picker (<x-fss::combobox>): the list is fixed to the viewport (placed in JS), so a drawer or modal never clips it. */
.fss-picker .fss-combobox-list {
    right: auto;
    left: auto;
    overscroll-behavior: contain;
}

.fss-combobox-option-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: var(--space-1) 0;
}

.fss-combobox-option-hint {
    overflow: hidden;
    color: var(--ink-3);
    font-size: var(--text-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A phone: 16px stops iOS from zooming into the field, and the rows get a finger-sized target. */
@media (pointer: coarse) {
    .fss-combobox-input {
        font-size: 16px;
    }

    .fss-picker .fss-combobox-option {
        min-height: 44px;
    }
}

/* ---------- 19. FILEDROPZONE ------------------------------------------- */

.fss-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6) var(--space-4);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    gap: var(--space-1);
    text-align: center;
    transition: background var(--dur-fast) var(--ease-out);
}

/* The dropzone of a plain form (`<x-fss::file-input>`) is a button: same surface, button defaults removed. */
button.fss-dropzone {
    width: 100%;
    color: var(--ink);
    font: inherit;
}

button.fss-dropzone:focus-visible {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--selection-ink);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.fss-file-input .fss-dropzone > svg {
    color: var(--ink-3);
}

.fss-dropzone[data-over] {
    border-color: var(--selection-ink);
    background: var(--accent-soft);
}

.fss-dropzone-hint {
    color: var(--ink-3);
    font-size: var(--text-xs);
}

.fss-dropzone-files {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: var(--space-3) 0 0;
    gap: var(--space-1-5);
    list-style: none;
}

.fss-dropzone-file {
    display: flex;
    align-items: center;
    padding: var(--space-1-5) var(--space-2) var(--space-1-5) var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    gap: var(--space-2);
}

.fss-dropzone-file-name {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fss-dropzone-file-size {
    color: var(--ink-3);
    font-size: var(--text-xs);
}

.fss-progress {
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: var(--radius-full);
    margin-top: var(--space-2);
    background: var(--surface-2);
}

.fss-progress > span {
    display: block;
    height: 100%;
    background: var(--selection-ink);
    transition: width var(--dur-base) var(--ease-out);
}

/* ---------- 20. ACTIEBALK (mobiel) ------------------------------------- */

.fss-actionbar {
    position: fixed;
    z-index: var(--z-sticky);
    right: 0;
    bottom: var(--fss-bottom-nav-h, 0px);
    left: 0;
    display: none;
    align-items: center;
    min-height: 56px;
    padding: var(--space-2) var(--space-4) calc(var(--space-2) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
    gap: var(--space-2);
}

.fss-actionbar > * {
    min-width: 0;
    flex: 1 1 0;
}

.fss-actionbar > * > .admin-btn,
.fss-actionbar > .admin-btn {
    width: 100%;
}

@media (max-width: 1023px) {
    .fss-actionbar {
        display: flex;
    }
}

/* ---------- 21. SHELL VOOR LAYOUT & STYLEGUIDE ------------------------- */

.fss-shell {
    max-width: var(--content-max);
    padding: var(--space-6) var(--page-pad) var(--space-16);
    margin: 0 auto;
}

@media (max-width: 640px) {
    .fss-shell {
        padding: var(--space-4) var(--space-4) calc(var(--space-16) + 56px);
    }
}

.fss-shell > * + * {
    margin-top: var(--stack);
}

.fss-tr-hold {
    transition: opacity var(--dur-base) var(--ease-in);
}

/* ---------- 20. OVERLAY-BEWEGING (gelijk aan Drawer/Modal/Sheet in de Next-admin) ---------------------------------
   Lade: komt 24 px + fade binnen op een rustige veer (~340 ms), sluit in 180 ms op ease-in. Modal: fade + scale .98 (200/140 ms).
   Bottom-sheet: 24 px + fade erin, uit naar onderen. De veer is benaderd met een cubic-bezier (framer-spring 341/32,5 heeft
   een dempingsfractie van 0,88: een kleine, rustige nadruk). Minder beweging laat de globale 1 ms-regel winnen. */
@media (min-width: 641px) {
    .admin-drawer-panel.fss-tr-from,
    .admin-drawer-panel.fss-tr-leave-to {
        opacity: 0;
        transform: translateX(24px);
    }

    .admin-drawer-panel.fss-tr-enter {
        transition:
            opacity var(--dur-base) var(--ease-out),
            transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .admin-drawer-panel.fss-tr-leave {
        transition:
            opacity 180ms var(--ease-in),
            transform 180ms var(--ease-in);
    }

    .admin-modal2-panel.fss-tr-from,
    .admin-modal2-panel.fss-tr-leave-to {
        opacity: 0;
        transform: scale(0.98);
    }

    .admin-modal2-panel.fss-tr-enter {
        transition:
            opacity var(--dur-base) var(--ease-out),
            transform var(--dur-base) var(--ease-out);
    }

    .admin-modal2-panel.fss-tr-leave {
        transition:
            opacity 140ms var(--ease-in),
            transform 140ms var(--ease-in);
    }
}

@media (max-width: 640px) {
    .admin-drawer-panel.fss-tr-from,
    .admin-modal2-panel.fss-tr-from,
    .fss-sheet-panel.fss-tr-from {
        opacity: 0;
        transform: translateY(24px);
    }

    .admin-drawer-panel.fss-tr-enter,
    .admin-modal2-panel.fss-tr-enter,
    .fss-sheet-panel.fss-tr-enter {
        transition:
            opacity var(--dur-base) var(--ease-out),
            transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .admin-drawer-panel.fss-tr-leave,
    .admin-modal2-panel.fss-tr-leave,
    .fss-sheet-panel.fss-tr-leave {
        transition:
            opacity 180ms var(--ease-in),
            transform 180ms var(--ease-in);
    }
}

/* Een tabel blijft een tabel: op smalle schermen krijgt het zoekveld de volle breedte (kaartlijsten: zie de container query). */
@media (max-width: 760px) {
    .admin-datatable-search {
        max-width: none;
        flex-basis: 100%;
    }

    .admin-datatable-toolbar > .fss-menu-host:last-child {
        margin-left: 0;
    }
}

/* ---------- 22. STAAFGRAFIEK (TrendChart) ------------------------------- */
/* Port of `app/admin/styles/modules/charts.css` (bar part). `--chart-h` is the height of the plot area; the labels sit below it.
   The grid lines are real elements (`.admin-chart-grid`), not a background gradient. */

.admin-chart {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
}

.admin-chart-plot {
    display: grid;
    align-items: start;
    gap: var(--space-3);
    grid-template-columns: auto minmax(0, 1fr);
}

.admin-chart-axis {
    display: flex;
    height: calc(var(--chart-h, 200px) + 16px);
    flex-direction: column;
    justify-content: space-between;
    margin: -8px 0;
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    line-height: 16px;
    text-align: right;
    white-space: nowrap;
}

.admin-chart-bars {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--chart-gap, var(--space-2));
}

.admin-chart-grid {
    position: absolute;
    z-index: 0;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    height: var(--chart-h, 200px);
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.admin-chart-grid > span {
    display: block;
    height: 0;
    border-top: 1px solid var(--chart-grid);
}

.admin-chart-bar-col {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex: 1 1 0;
    flex-direction: column;
    gap: var(--space-2);
    outline: none;
}

.admin-chart-bar-col:focus-visible {
    border-radius: var(--radius-sm);
    box-shadow: var(--focus-ring);
}

.admin-chart-bar-track {
    display: flex;
    height: var(--chart-h, 200px);
    align-items: flex-end;
    background: var(--chart-track);
}

.admin-chart-bar-fill {
    width: 100%;
    max-width: 56px;
    border-radius: 4px 4px 0 0;
    margin: 0 auto;
    background: var(--chart-bar);
    animation: admin-chart-grow var(--dur-draw) var(--ease-draw) backwards;
    transform-origin: bottom;
}

@keyframes admin-chart-grow {
    from {
        transform: scaleY(0);
    }
}

.admin-chart-bars[data-accent="neutral"] .admin-chart-bar-col:hover .admin-chart-bar-fill:not([data-current]) {
    background: var(--chart-neutral-hover);
}

.admin-chart-bar-fill[data-current] {
    background: var(--chart-current);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), var(--ink) 30%);
}

.admin-chart-bars[data-accent="success"] .admin-chart-bar-fill:not([data-current]) {
    background: var(--chart-1);
}

.admin-chart-bars[data-accent="info"] .admin-chart-bar-fill:not([data-current]) {
    background: var(--chart-2);
}

.admin-chart-bars[data-accent="warning"] .admin-chart-bar-fill:not([data-current]) {
    background: var(--chart-3);
}

.admin-chart-bars[data-accent="danger"] .admin-chart-bar-fill:not([data-current]) {
    background: var(--chart-4);
}

.admin-chart-bar-label {
    display: flex;
    height: 16px; /* a fixed row, also when the label is empty: an empty block would collapse to 0 and shift the track */
    flex: none;
    justify-content: center; /* an overflowing label (narrow column) spills to both sides */
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
    white-space: nowrap;
}

/* Tooltip per bar. It sits in the column (no layout shift: absolute), above the bar, never above the top of the plot.
   Hover (pointer devices only), keyboard focus and a tap (`data-open`, set by `FssUi.chartTipTap`) show it. */
.admin-chart-tip {
    position: absolute;
    z-index: 2;
    bottom: min(calc(var(--space-2) + 16px + var(--chart-h, 200px) * var(--p, 0) / 100 + 6px), calc(var(--chart-h, 200px) - 12px));
    left: 50%;
    display: flex;
    width: max-content;
    flex-direction: column;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-xs);
    background: var(--ink);
    box-shadow: var(--shadow-2);
    color: var(--surface);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    line-height: 16px;
    opacity: 0;
    pointer-events: none;
    /* centred over the bar; `--tip-shift` (px) is set by `FssUi.chartTipClamp` only when the tooltip would overflow the chart */
    transform: translateX(calc(-50% + var(--tip-shift, 0px)));
    transition: opacity var(--dur-fast) ease;
    visibility: hidden;
    white-space: nowrap;
}

.admin-chart-tip > strong {
    font-weight: 400;
    opacity: 0.7;
}

.admin-chart-tip-row {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.admin-chart-tip-row > b {
    font-weight: 600;
}

.admin-chart-tip-row > em + b {
    margin-left: var(--space-2);
}

.admin-chart-tip-row > em {
    font-style: normal;
    opacity: 0.7;
}

.admin-chart-tip-row > i {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 2px;
}

.admin-chart-bar-col:focus-visible > .admin-chart-tip,
.admin-chart-bar-col[data-open] > .admin-chart-tip {
    opacity: 1;
    visibility: visible;
}

@media (hover: hover) {
    .admin-chart-bar-col:hover > .admin-chart-tip {
        opacity: 1;
        visibility: visible;
    }

    .admin-chart-bar-col:hover .admin-chart-bar-fill {
        filter: brightness(0.88);
    }
}

.admin-chart-bar-col:focus-visible .admin-chart-bar-fill,
.admin-chart-bar-col[data-open] .admin-chart-bar-fill {
    filter: brightness(0.88);
}

.admin-chart-bars[data-accent] .admin-chart-tip i[data-series="1"] {
    background: var(--chart-bar);
}

.admin-chart-bars[data-accent="info"] .admin-chart-tip i[data-series="1"] {
    background: var(--chart-2);
}

.admin-chart-bars[data-accent="warning"] .admin-chart-tip i[data-series="1"] {
    background: var(--chart-3);
}

.admin-chart-bars[data-accent="danger"] .admin-chart-tip i[data-series="1"] {
    background: var(--chart-4);
}

.admin-chart-bars[data-accent="success"] .admin-chart-tip i[data-series="1"] {
    background: var(--success);
}

/* Each column is its own stacking context: lift the active one so its tooltip is not painted over by the next bar. */
.admin-chart-bar-col:focus-visible,
.admin-chart-bar-col[data-open] {
    z-index: 3;
}

@media (hover: hover) {
    .admin-chart-bar-col:hover {
        z-index: 3;
    }
}

.admin-chart-footnote {
    margin: 0;
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-chart-empty {
    display: flex;
    height: var(--chart-h, 200px);
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--ink-2);
    font-size: var(--text-base);
}

@media (prefers-reduced-motion: reduce) {
    .admin-chart-bar-fill {
        animation: none;
    }

    .admin-chart-tip {
        transition: none;
    }
}

html[data-motion="reduced"] .admin-chart-bar-fill {
    animation: none;
}

html[data-motion="reduced"] .admin-chart-tip {
    transition: none;
}

/* ---------- 23. RESOURCEGEBRUIK (runtime) ------------------------------- */
/* Port of the resource part of `app/admin/styles/modules/runtime.css` (card `<x-fss::runtime-resources-card>`). */

.admin-resources {
    display: grid;
    gap: var(--space-4);
}

.admin-resources-pod > header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.admin-resources h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
}

.admin-resources-trends {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* The usage bar of a pod row is the shared <x-fss::meter size="sm" decorative>; this class only sets its place. */
.admin-resource-meter {
    max-width: 240px;
    margin-top: 6px;
}

/* =====================================================================
   Next-parity heads (admin-design-system §7): card heading + toolbar, eyebrow, next-step hint,
   and the KPI chevron (the empty-state icon tile lives with .admin-empty-state). Same values as app/admin/styles/primitives.css.
   ===================================================================== */
.admin-kicker {
    display: block;
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    letter-spacing: 0;
    line-height: 16px;
    text-transform: none;
}

.admin-page-header .admin-kicker,
.admin-card-heading .admin-kicker {
    display: none;
}

.admin-drawer-head .admin-kicker {
    display: block;
    color: var(--ink-3);
}

.admin-card-heading {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.admin-card-heading > svg {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--ink-3);
}

.admin-card-heading > div {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--space-1);
}

.admin-card-heading h2,
.admin-card-heading h3,
.admin-card-heading h4 {
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    line-height: 24px;
}

.admin-card-heading > p,
.admin-card-heading > div > p {
    margin: 0;
    color: var(--ink-2);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-section-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.admin-section-toolbar > .admin-card-heading {
    margin-bottom: 0;
}

.admin-section-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.admin-page-header-next-copy {
    min-width: 0;
    flex: 0 1 auto;
}

.admin-page-header-next-hint {
    color: var(--ink-3);
}

.admin-kpi-chevron {
    position: absolute;
    top: var(--space-4);
    right: var(--space-3);
    display: inline-flex;
    color: var(--ink-3);
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease-out);
}

a.admin-kpi:hover .admin-kpi-chevron,
a.admin-kpi:focus-visible .admin-kpi-chevron {
    opacity: 1;
}

/* ---------- CRM parity: KPI icon, done node, page-header avatar, avatar, timeline (chevron and icon tile live above) ---------- */
/* Ports from the Next primitives (KpiTile, EmptyState, PageHeader.leading, FaviconAvatar, Timeline). */

.admin-kpi-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex: none;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
}

/* Admin KPI labels are mono eyebrows without an icon (design v5); the portal shows the icon. */
.admin-chrome:not(.portal-chrome) .admin-kpi-icon {
    display: none;
}

.admin-kpi-value[data-text] {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
    font-size: var(--text-xl);
    line-height: 1.25;
    white-space: normal;
}

.admin-empty-state[data-kind="done"] > strong {
    font-size: 24px;
    line-height: 28px;
}

.admin-empty-state-node {
    width: 12px;
    height: 12px;
    margin-bottom: var(--space-2);
    border-radius: var(--radius-full);
    background: var(--accent);
    box-shadow: 0 0 0 6px var(--accent-soft), 0 0 0 7px var(--selection-ink);
}

.admin-page-header-leading {
    display: inline-flex;
    align-self: center;
}

@media (max-width: 1023px) {
    .admin-chrome:not(.portal-chrome) .admin-page-header-next-copy {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-chrome:not(.portal-chrome) .admin-page-header-next-hint {
        display: none;
    }
}

.fss-avatar {
    --avatar: 32px;
    display: inline-grid;
    overflow: hidden;
    width: var(--avatar);
    height: var(--avatar);
    flex: none;
    place-items: center;
    border-radius: 9px;
    background: var(--ink);
    color: #ffffff;
    font-family: var(--font-display);
    font-size: calc(var(--avatar) * 0.4);
    font-weight: var(--font-semibold);
    letter-spacing: -0.01em;
    line-height: 1;
    user-select: none;
}

.fss-avatar[data-size="xs"] {
    --avatar: 20px;
    border-radius: 6px;
}

.fss-avatar[data-size="sm"] {
    --avatar: 28px;
    border-radius: 8px;
}

.fss-avatar[data-size="lg"] {
    --avatar: 44px;
    border-radius: 12px;
}

/* Initials: eight muted hues, white on each above 7:1. */
.fss-avatar[data-hue="0"] { background: #2f4b3a; }
.fss-avatar[data-hue="1"] { background: #3a4a63; }
.fss-avatar[data-hue="2"] { background: #6b4a2f; }
.fss-avatar[data-hue="3"] { background: #5a3d5c; }
.fss-avatar[data-hue="4"] { background: #2f5560; }
.fss-avatar[data-hue="5"] { background: #4f4f2f; }
.fss-avatar[data-hue="6"] { background: #6a3b3b; }
.fss-avatar[data-hue="7"] { background: #3d3d47; }

.fss-avatar[data-image] {
    border: 1px solid var(--line);
    background: var(--surface);
}

.fss-avatar img {
    width: 62%;
    height: 62%;
    object-fit: contain;
}

.admin-status-badge > svg {
    width: 12px;
    height: 12px;
    flex: none;
}

.fss-timeline-title a {
    color: inherit;
    text-decoration: none;
}

.fss-timeline-title a:hover {
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}

.fss-timeline-title a:focus-visible {
    border-radius: 2px;
    box-shadow: var(--focus-ring);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.fss-timeline-icon {
    display: inline-flex;
    margin-right: var(--space-1);
    vertical-align: -2px;
    color: var(--ink-2);
}

/* --- ageing-bar (port of app/admin/styles/primitives.css, components/admin/charts/AgeingBar.tsx) --- */
.fss-ageing-track {
    display: flex;
    overflow: hidden;
    height: 12px;
    border-radius: 6px;
    background: var(--surface-2);
    gap: 3px;
}

.fss-ageing-track > span {
    min-width: 4px;
    flex: 1 1 0;
    border-radius: 3px;
}

.fss-ageing [data-bucket="current"] { background: #d3d4cf; }
.fss-ageing [data-bucket="d30"] { background: #8c9196; }
.fss-ageing [data-bucket="d60"] { background: #e5484d; }
.fss-ageing [data-bucket="older"] { background: #a61b1f; }
.fss-ageing [data-bucket="empty"] { background: transparent; }

.fss-ageing-legend {
    display: grid;
    margin: var(--space-4) 0 0;
    padding: 0;
    gap: var(--space-3);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    list-style: none;
}

.fss-ageing .fss-ageing-legend > li {
    background: none;
}

.fss-ageing-legend > li > :is(a, div) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: var(--space-1) 0;
    border-radius: var(--radius-sm);
    color: inherit;
    gap: 2px;
    text-decoration: none;
}

.fss-ageing-legend > li > a:hover .fss-ageing-amount {
    text-decoration: underline;
    text-decoration-color: var(--line-field);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.fss-ageing-legend > li > a:focus-visible {
    box-shadow: var(--focus-ring);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.fss-ageing-key {
    display: inline-flex;
    align-items: center;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 11.5px;
    gap: 6px;
    letter-spacing: 0.02em;
    line-height: 16px;
}

.fss-ageing-key i {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 2px;
}

.fss-ageing-amount {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: var(--font-semibold);
    letter-spacing: -0.02em;
    line-height: 26px;
}

.fss-ageing-legend > li[data-bucket="d60"] .fss-ageing-amount,
.fss-ageing-legend > li[data-bucket="older"] .fss-ageing-amount {
    color: var(--danger);
}

.fss-ageing-legend > li[data-empty] .fss-ageing-amount {
    color: var(--ink-3);
}

.fss-ageing-count {
    color: var(--ink-3);
    font-size: 12px;
    line-height: 16px;
}

@media (max-width: 639px) {
    .fss-ageing-legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- month-bars (port of app/admin/styles/primitives.css, components/admin/charts/MonthBars.tsx) --- */
/* The bar height is inline on .fss-monthbars-bar (Next: `--h`), so no extra local custom property is needed. */
.fss-monthbars {
    min-width: 0;
    margin: 0;
}

.fss-monthbars-plot {
    display: flex;
    height: 112px;
    align-items: flex-end;
    margin: 0;
    padding: 0;
    gap: 6px;
    list-style: none;
}

.fss-monthbars-plot > li {
    display: flex;
    min-width: 0;
    height: 100%;
    flex: 1 1 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 6px;
}

.fss-monthbars-bar {
    display: block;
    min-height: 2px;
    border-radius: 4px 4px 2px 2px;
    background: var(--chart-neutral);
    transition: background-color var(--dur-base) var(--ease-out);
}

.fss-monthbars-plot > li:hover:not([data-current], [data-zero], [data-kind], [data-tone]) .fss-monthbars-bar {
    background: var(--chart-neutral-hover);
}

.fss-monthbars-plot > li[data-zero] .fss-monthbars-bar {
    height: 1px;
    min-height: 1px;
    background: var(--line-field);
}

.fss-monthbars-plot > li[data-current] .fss-monthbars-bar {
    box-sizing: border-box;
    border: 1.5px solid var(--ink);
    background: var(--accent);
}

.fss-monthbars-label {
    overflow: hidden;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 10.5px;
    line-height: 14px;
    text-align: center;
    white-space: nowrap;
}

.fss-monthbars-plot > li[data-current] .fss-monthbars-label {
    color: var(--ink);
}

@media (max-width: 639px) {
    .fss-monthbars-plot {
        gap: 3px;
    }

    .fss-monthbars-plot > li:nth-child(even):not([data-current]) .fss-monthbars-label {
        visibility: hidden;
    }
}

/* =====================================================================
   CARD (x-card): head / body / foot with one inner padding, one rhythm.
   `.admin-card` carries the padding (`--card-pad`) so head, body and foot always share the same
   inset. A `flush` card (lists, rows, tables) has no outer padding; its head and body pad themselves.
   ===================================================================== */
/* A card made with <x-fss::card> is structured: the card itself has no padding, the head, body and foot each pad with `--card-pad`
   (the one inset also used by the drawer, modal and table cells). The head ALWAYS has a divider. `flush` only removes the body padding. */
.admin-card[data-structured] {
    padding: 0;
}

.admin-card[data-structured] > .admin-card-head {
    flex-wrap: nowrap;
    margin: 0;
    padding: var(--space-3) var(--card-pad);
    min-height: 56px;
    border-bottom: 1px solid var(--line);
}

.admin-card-head > .admin-card-heading {
    min-width: 0;
    flex: 1 1 280px;
    margin-bottom: 0;
}

.admin-card-titleline {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.admin-card-count {
    color: var(--ink-3);
    font-size: var(--text-sm, 13px);
    font-weight: var(--font-regular);
}

.admin-card-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

.admin-card[data-structured] > .admin-card-body {
    padding: var(--card-pad);
}

.admin-card[data-structured][data-flush] > .admin-card-body {
    padding: 0;
}

/* Sub-section inside a card body ("SMS-herinneringen" with an icon): a modest title, then the content with the in-card rhythm. */
.admin-card .admin-card-section-title,
.admin-card h3.admin-card-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    line-height: 20px;
}

.admin-card-section-title > svg {
    flex: none;
    color: var(--ink-3);
}

.admin-card .admin-card-body > * + .admin-card-section-title {
    margin-top: var(--space-6);
}

/* Content rhythm inside a card body: paragraph margins are neutralised, consecutive elements get one gap
   (`--card-gap`), and an action row before the end gets slightly more (`--card-gap-action`). */
.admin-card .admin-card-body > * {
    margin-block: 0;
}

.admin-card .admin-card-body > * + * {
    margin-top: var(--card-gap);
}

.admin-card .admin-card-body > * + :is(.admin-card-actions, .admin-form-actions, .admin-btn, button.admin-btn) {
    margin-top: var(--card-gap-action);
}

.admin-card .admin-card-body > :is(.admin-btn, button.admin-btn) {
    width: fit-content;
}

.admin-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.admin-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--card-pad);
    border-top: 1px solid var(--line);
}

/* =====================================================================
   FORM RHYTHM: label, field, help text, then a clear gap before the next field.
   Zero specificity (`:where`) so a form that lays itself out as a grid or row keeps doing so.
   ===================================================================== */
:where(.admin-form) {
    display: flex;
    flex-direction: column;
    gap: var(--field-gap);
}

:where(.admin-form fieldset) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--field-gap);
    padding: 0;
    margin: 0;
    border: 0;
}

:where(.admin-form p, .admin-form h3) {
    margin: 0;
}

/* A bare label directly in a form or field grid renders as a stacked field: label text (first span) 12px, control below. */
.admin-form > label:not([class]),
.admin-field-grid > label:not([class]) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-1-5);
}

.admin-form > label:not([class]) > span:first-child,
.admin-field-grid > label:not([class]) > span:first-child {
    color: var(--ink-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
}

.admin-form label > small,
.admin-form label > .admin-form-help {
    display: block;
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-regular);
    line-height: 16px;
}

/* Radio / checkbox groups: the group label (`legend`) looks like every other label, the options sit close together
   (`--space-2`), and the next field follows after the normal field gap. */
.admin-form fieldset > legend {
    float: none;
    width: auto;
    padding: 0;
    margin: 0 0 var(--space-2);
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
}

.admin-form .admin-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: 20px;
}

/* A checkbox group: the options stack 8px apart through the gap of their wrapper (no negative margins, so nothing
   overlaps when a wrapper lays itself out differently). A grid of checks (`.admin-form-checks`) keeps its own gap. */
.admin-check-group,
:where(.admin-form fieldset:not(.admin-field-grid, .admin-form-checks):has(> .admin-checkbox-label)) {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Transitional, until every group is wrapped in `.admin-check-group`: consecutive checkbox labels loose in a form keep 8px.
   Directly in the form the form gap is known, so it is narrowed to 8px; in a plain (block) wrapper they get an 8px margin.
   Known flex/grid groups lay out their own gap and are excluded, so no rule here can make options overlap. */
.admin-form > .admin-checkbox-label + .admin-checkbox-label {
    margin-top: calc(var(--space-2) - var(--field-gap));
}

:where(.admin-form :not(fieldset, .admin-check-group, .admin-form-checks, .admin-row, .admin-radio-list, .admin-checkbox-group, .admin-segmented, .admin-checkbox-chips, [role="radiogroup"], .admin-field-grid, .admin-form-grid)) > .admin-checkbox-label + .admin-checkbox-label {
    margin-top: var(--space-2);
}

.admin-check-group > .admin-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: 20px;
}

/* The action row at the end of a form: a clear gap above it (the sticky drawer footer rules above still apply in a drawer). */
.admin-form > .admin-form-actions {
    margin-top: var(--space-2);
}

.admin-drawer-body .admin-form > .admin-form-actions {
    margin-top: var(--space-6);
}

/* =====================================================================
   FORM SECTIONS: a modest heading (like a card title), a clear gap above it (larger than the field gap),
   an optional muted description, then the fields with the normal rhythm. Works on a bare `<h3>` in a form
   and on the `.admin-form-section-title` class.
   ===================================================================== */
.admin-form h3,
.admin-form-section-title {
    margin: 0;
    color: var(--ink);
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    line-height: 24px;
}

.admin-form > * + h3,
.admin-form > * + .admin-form-section-title,
.admin-form fieldset > * + h3 {
    margin-top: calc(var(--space-8) - var(--field-gap));
}

.admin-form h3 + *,
.admin-form-section-title + * {
    margin-top: calc(var(--space-3) - var(--field-gap));
}

.admin-form h3 + :is(p, .admin-form-section-desc),
.admin-form-section-title + :is(p, .admin-form-section-desc) {
    margin-top: calc(var(--space-1) - var(--field-gap));
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-form h3 + :is(p, .admin-form-section-desc) + * {
    margin-top: calc(var(--space-3) - var(--field-gap));
}

/* Drawer forms: the drawer body already insets the content; the form never adds a second horizontal inset. */
.admin-drawer-body .admin-form,
.admin-drawer-body form {
    padding-inline: 0;
    margin-inline: 0;
}

/* =====================================================================
   DATATABLE IN A CARD: description, toolbar, count and the first/last table cell share the card inset (`--card-pad`).
   In a padded card the controls sit flush with the card padding and the table runs edge to edge; in a `flush` card
   the controls and the outer cells pad themselves by the same amount.
   ===================================================================== */
.admin-datatable-controls {
    padding: var(--space-4) var(--card-pad) var(--space-3);
    gap: var(--space-3);
}

.admin-datatable thead th:first-child,
.admin-datatable tbody td:first-child {
    padding-left: var(--card-pad);
}

.admin-datatable thead th:last-child,
.admin-datatable tbody td:last-child {
    padding-right: var(--card-pad);
}

.admin-card[data-structured] > .admin-card-body > .fss-datatable:only-child .admin-datatable-controls {
    padding-top: var(--card-pad);
}

.admin-card[data-structured]:not([data-flush]) > .admin-card-body:has(> .fss-datatable:only-child) {
    padding: 0;
}

/* Column menu: every item shows its state as a check box (role menuitemcheckbox + aria-checked); hidden columns are visibly unchecked. */
.fss-menu-item[role="menuitemcheckbox"]::before {
    width: 16px;
    height: 16px;
    flex: none;
    border: 1px solid var(--line-field);
    border-radius: var(--radius-xs);
    background: var(--surface) center / 12px 12px no-repeat;
    content: "";
}

.fss-menu-item[role="menuitemcheckbox"][aria-checked="true"]::before {
    border-color: var(--ink);
    background-color: var(--ink);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.fss-menu-item[role="menuitemcheckbox"]:disabled {
    cursor: default;
    opacity: 0.6;
}

/* =====================================================================
   SELECT: no native arrow. One chevron of our own, 12px from the right edge, with enough right padding that text never runs
   under it. Same height and radius as the text inputs (those come from the field rules above).
   ===================================================================== */
:is(.admin-chrome, .portal-chrome, .fss-teleported) :is(.admin-field, .admin-form, .admin-datatable-filter, .admin-datatable-pagesize) select,
:is(.admin-chrome, .portal-chrome, .fss-teleported) select.admin-input,
:is(.admin-chrome, .portal-chrome, .fss-teleported) select:where(.admin-select) {
    padding-right: calc(var(--space-3) + 16px + var(--space-2));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    -webkit-appearance: none;
    appearance: none;
    text-overflow: ellipsis;
}

:is(.admin-chrome, .portal-chrome, .fss-teleported) select[multiple] {
    background-image: none;
    padding-right: var(--space-3);
}

/* KPI tiles in one row always have the same height (stretch); a hint line is optional and never changes a neighbour's height. */
.admin-kpi-grid {
    align-items: stretch;
}

.admin-kpi-grid > .admin-kpi {
    height: 100%;
}

/* Loose content in a `flush` card body (text, forms, buttons next to rows or tables) gets the card inset and the body rhythm;
   rows, lists and tables run edge to edge. */
.admin-card[data-flush] > .admin-card-body > :is(p, form, fieldset, h3, h4, label, small, .admin-btn, button, .admin-card-actions, .admin-form-actions, .admin-form, .admin-field, .admin-banner) {
    margin-inline: var(--card-pad);
}

.admin-card[data-flush] > .admin-card-body > :is(p, form, fieldset, h3, h4, label, small, .admin-btn, button, .admin-card-actions, .admin-form-actions, .admin-form, .admin-field, .admin-banner):first-child {
    margin-top: var(--card-pad);
}

.admin-card[data-flush] > .admin-card-body > :is(p, form, fieldset, h3, h4, label, small, .admin-btn, button, .admin-card-actions, .admin-form-actions, .admin-form, .admin-field, .admin-banner):last-child {
    margin-bottom: var(--card-pad);
}

/* Same look for the legacy hand-made card head still around: divider, padding and title size match the card head. */
.pv-card > .pv-card-head {
    min-height: 56px;
    padding: var(--space-3) var(--card-pad);
    border-bottom: 1px solid var(--line);
}

.pv-card > .pv-card-head h2 {
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    line-height: 24px;
}

/* A submit button or action link directly in a form keeps its natural width (the form is a flex column). */
.admin-form > :is(button, .admin-btn, a.admin-btn) {
    align-self: flex-start;
}

/* Plain labels stacked inside a plain wrapper of a form (not a direct child, not in a flex fieldset or a choice group):
   the same gap as between fields. Classed labels (checkbox, segmented option, chip) are never touched. */
:where(.admin-form *:not(fieldset, .admin-field-grid, .admin-form-grid, .admin-check-group, .admin-segmented, .admin-checkbox-chips, [role="radiogroup"], .admin-form-checks)) > label:not([class]) + label:not([class]) {
    margin-top: var(--field-gap);
}

/* Header text: the description under a card title is 13px muted; the actions never wrap under the text on a normal width. */
.admin-card-head .admin-card-heading p {
    color: var(--ink-3);
    font-size: var(--text-sm, 13px);
    line-height: 18px;
}

.admin-card-head-actions {
    flex: 0 0 auto;
}

/* =====================================================================
   SWITCH (<x-fss::switch>): track 36x20 with a knob; lime only when on. The native checkbox stays focusable (visually hidden).
   ===================================================================== */
.admin-switch-field {
    display: inline-flex;
    min-height: var(--input-h);
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    color: var(--ink);
}

/* Containing block of the visually hidden checkbox: without it the input was placed against the drawer panel (outside the scrolling
   body) and focusing or clicking the switch scrolled the whole panel out of view (2026-11-25). A rule of its own: the v0.97 rule above
   stays byte for byte (ComponentsGCssTest). */
.admin-switch-field {
    position: relative;
}

.admin-switch-field[data-aligned] {
    padding-top: calc(16px + var(--space-1-5));
}

.admin-switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.admin-switch-track {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex: none;
    border-radius: var(--radius-full);
    background: var(--line-field);
    transition: background var(--dur-fast, 120ms) var(--ease-out, ease-out);
}

.admin-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
    transition: transform var(--dur-fast, 120ms) var(--ease-out, ease-out);
}

/* ONE on-state for both modes (input and button): the checkbox and aria-checked drive the same track colour and knob travel. */
:is(.admin-switch-input:checked + .admin-switch-track, .admin-switch-field[aria-checked="true"] .admin-switch-track) {
    background: var(--accent);
}

:is(.admin-switch-input:checked + .admin-switch-track, .admin-switch-field[aria-checked="true"] .admin-switch-track) .admin-switch-knob {
    transform: translateX(16px);
}

.admin-switch-input:focus-visible + .admin-switch-track {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
}

.admin-switch-input:disabled + .admin-switch-track {
    opacity: 0.5;
}

.admin-switch-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-switch-label {
    font-size: var(--text-sm, 13px);
    font-weight: var(--font-medium);
    line-height: 18px;
}

.admin-switch-help {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

/* =====================================================================
   SEGMENTED RADIO GROUP (<x-fss::radio-group>): one pill control. Like every field it ends with the form's field gap.
   ===================================================================== */
.admin-radio-group {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-1-5);
    padding: 0;
    margin: 0;
    border: 0;
}

.admin-radio-group > legend {
    padding: 0;
    margin: 0 0 var(--space-1-5);
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
}

.admin-segmented {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
    padding: 2px;
    gap: 2px;
    border: 1px solid var(--line-field);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.admin-segmented-option {
    position: relative;
    display: inline-flex;
    min-height: calc(var(--input-h) - 8px);
    align-items: center;
    padding: 0 var(--space-3);
    border-radius: calc(var(--radius-sm) - 2px);
    color: var(--ink-2);
    cursor: pointer;
    font-size: var(--text-sm, 13px);
    font-weight: var(--font-medium);
}

.admin-segmented-option > input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.admin-segmented-option:has(input:checked) {
    background: var(--surface);
    box-shadow: var(--shadow-1);
    color: var(--ink);
}

.admin-segmented-option:has(input:focus-visible) {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 1px;
}

/* =====================================================================
   COMBOBOX: one control with exactly the look of a normal input (single border, same height, radius and padding). The wrapper
   has no border; the inner input is bare so a form's generic input rules (border, height) never draw a second box.
   ===================================================================== */
.fss-combobox .fss-combobox-control {
    padding: 0 var(--space-3);
    box-shadow: var(--shadow-1);
}

.fss-combobox .fss-combobox-control:hover:not(:focus-within) {
    border-color: #a1a1aa;
}

.fss-combobox .fss-combobox-control .fss-combobox-input {
    width: auto;
    height: calc(var(--input-h) - 2px);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    outline: none;
}

/* A table inside a card has exactly one container: the card. The table wrapper draws no card of its own, and nothing clips the column menu. */
.admin-card .admin-datatable-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.admin-card .admin-datatable-scroll {
    border-radius: 0;
}

.admin-card .admin-card-body:has(> .fss-datatable) {
    overflow: visible;
}

@media (max-width: 640px) {
    .admin-card[data-structured] > .admin-card-head {
        flex-wrap: wrap;
    }

    .admin-card-head-actions {
        flex: 0 1 auto;
    }
}

/* Primary control of an action row (a real button for keyboard and screen readers): looks like the cell text. */
button.admin-datatable-rowlink,
.fss-card-title button.fss-card-primary {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: inherit;
}

.fss-card-title button.fss-card-primary::after {
    position: absolute;
    inset: 0;
    content: "";
}

/* ---------- 20. ROW, TABLE, KEYVALUE, SEGMENTED, SETTING-ROW, TAG ------------------------------------------------ */

/* Tag badge: same box as a status badge but squarer; the colour comes from the inline `--tag-color`. */
.admin-status-badge[data-variant="tag"] {
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--tag-color, var(--ink-3)) 14%, white);
    color: color-mix(in oklab, var(--tag-color, var(--ink-2)) 55%, black);
    font-weight: var(--font-medium);
}

/* Accent badge: the one lime surface outside active markers; the text stays ink. */
.admin-status-badge[data-tone="accent"] {
    background: var(--accent-soft);
    color: var(--ink);
}

/* A table with its own wrap but no DataTable around it (x-fss::table): the scroll area is the only thing that scrolls, no min-width. */
.fss-datatable > .admin-datatable-wrap > .admin-datatable-scroll {
    overflow-x: auto;
}

/* Row in a card (x-fss::row): one line plus an optional sub line, exactly one table row high. */
.fss-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fss-row {
    position: relative;
    display: flex;
    min-height: var(--row-h);
    align-items: center;
    padding: 0 var(--card-pad);
    gap: var(--space-4);
    border-top: 1px solid var(--line);
}

.fss-rows > .fss-row:first-child,
.admin-card-head + .fss-rows > .fss-row:first-child {
    border-top: 0;
}

.fss-row[data-linked]:hover {
    background: var(--sidebar-bg);
}

.fss-row-lead {
    display: grid;
    min-width: 32px;
    height: 32px;
    flex: none;
    place-items: center;
    color: var(--ink-2);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.fss-row-lead[data-icon] {
    width: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.fss-row-body {
    min-width: 0;
    flex: 1 1 auto;
    padding: var(--space-2) 0;
}

.fss-row-title {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 20px;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.fss-row-title::after {
    position: absolute;
    inset: 0;
    content: "";
}

/* The stretched ::after carries the focus indicator; the link itself shows none, so there is no double ring. */
a.fss-row-title:focus-visible {
    outline-width: 0;
    box-shadow: none;
}

a.fss-row-title:focus-visible::after {
    border-radius: inherit;
    box-shadow: inset 0 0 0 2px var(--focus-ring-color);
    outline: 2px solid transparent;
    outline-offset: -2px;
}

@media (forced-colors: active) {
    a.fss-row-title:focus-visible::after {
        outline-color: CanvasText;
    }
}

.fss-row-sub {
    overflow: hidden;
    color: var(--ink-3);
    font-size: var(--text-sm, 13px);
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fss-row-sub[data-mono] {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.fss-row-status {
    flex: none;
}

.fss-row-acts {
    position: relative;
    z-index: 1;
    display: flex;
    flex: none;
    justify-content: flex-end;
    gap: var(--space-1);
}

.fss-row-chevron {
    flex: none;
    color: var(--ink-3);
}

@media (max-width: 640px) {
    .fss-row {
        gap: var(--space-3);
    }

    .fss-row-status {
        max-width: 40%;
        overflow: hidden;
    }
}

/* Sortable list (x-fss::sortable-list / sortable-item): a row with a grip on the left; the dragged row lifts, the target row shows a ring. */
/* At rest the row has no fill of its own (the card is the surface): a filled last row squared off the card's rounded bottom
   corners. Only the lifted row gets the surface. */
.fss-sortable-item {
    background: transparent;
}

.fss-sortable-item[data-dragging="true"] {
    z-index: 2;
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

/* The last table row / list row of a flush card keeps the card's bottom corners round when it is hovered (its fill would square them). */
.admin-card[data-flush] .admin-card-body > :last-child :is(.admin-datatable, .admin-data-table, .fss-table) tbody tr:last-child > :is(td, th):first-child,
.admin-card[data-flush] .admin-card-body > :is(.admin-datatable, .admin-data-table, .fss-table):last-child tbody tr:last-child > :is(td, th):first-child,
.admin-card[data-flush] .admin-card-body > :last-child .fss-rows > li:last-child {
    border-bottom-left-radius: var(--radius-md);
}

.admin-card[data-flush] .admin-card-body > :last-child :is(.admin-datatable, .admin-data-table, .fss-table) tbody tr:last-child > :is(td, th):last-child,
.admin-card[data-flush] .admin-card-body > :is(.admin-datatable, .admin-data-table, .fss-table):last-child tbody tr:last-child > :is(td, th):last-child,
.admin-card[data-flush] .admin-card-body > :last-child .fss-rows > li:last-child {
    border-bottom-right-radius: var(--radius-md);
}

/* The last row of a list that closes a flush card follows the card's bottom corners (lift shadow and drop ring stay round). */
.admin-card[data-flush] .admin-card-body > :last-child .fss-sortable-item:last-child {
    border-bottom-right-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

/* No grip where there is nothing to order: a list of one row, or a surrounding `data-sortable-off` (for example while a search filters the rows). */
.fss-sortable-list:has(> :only-child) .fss-sortable-handle,
[data-sortable-off] .fss-sortable-handle {
    display: none;
}

/* A row with children (slot `children`: a nested sortable list): the <li> holds the row line and the sub list; moving the parent moves the subtree. */
.fss-sortable-tree {
    position: relative;
    border-top: 1px solid var(--line);
    background: transparent;
}

.fss-rows > .fss-sortable-tree:first-child {
    border-top: 0;
}

.fss-sortable-line {
    border-top: 0;
}

.fss-sortable-children {
    padding-left: var(--space-8);
    background: var(--surface);
}

.fss-sortable-children .fss-sortable-tree:first-child,
.fss-sortable-children .fss-rows > :first-child {
    border-top: 1px solid var(--line);
}

/* Drop line: a 2 px accent bar on the edge where the lifted row will land (the neighbours have already made room). */
.fss-sortable-item[data-over]::after {
    content: "";
    position: absolute;
    right: var(--space-3);
    left: var(--space-3);
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
    pointer-events: none;
}

.fss-sortable-item[data-over="top"]::after {
    top: -1px;
}

.fss-sortable-item[data-over="bottom"]::after {
    bottom: -1px;
}

.fss-sortable-handle {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    margin-left: calc(var(--space-2) * -1);
    background: transparent;
    color: var(--ink-3);
    cursor: grab;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.fss-sortable-handle:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.fss-sortable-handle:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--focus-ring);
}

.fss-sortable-item[data-dragging="true"] .fss-sortable-handle {
    cursor: grabbing;
}

@media (pointer: coarse) {
    .fss-sortable-handle {
        width: 44px;
        height: 44px;
    }
}

/* Key-value list: properties of one object. dt is the small muted label, dd the value; no flex on dd, so inline content flows. */
.admin-keyvalue {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.admin-keyvalue > div {
    display: grid;
    min-height: var(--control-lg);
    align-items: baseline;
    padding: var(--space-2) 0;
    gap: var(--space-4);
    grid-template-columns: 144px minmax(0, 1fr);
}

.admin-keyvalue dt {
    color: var(--ink-3);
    font-size: var(--text-xs);
}

.admin-keyvalue dd {
    display: block;
    min-width: 0;
    margin: 0;
    color: var(--ink);
    font-size: var(--text-base);
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .admin-keyvalue > div {
        gap: 0;
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Segmented control made of buttons: the pressed one looks like the checked option of the radio variant. */
button.admin-segmented-option {
    border: 0;
    background: none;
    font-family: inherit;
}

.admin-segmented-option[aria-pressed="true"] {
    background: var(--surface);
    box-shadow: var(--shadow-1);
    color: var(--ink);
}

/* Radio group as a list: one row per option, radio on the left, label plus explanation, the chosen row on --surface-2. */
.admin-radio-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.admin-radio-list-option {
    display: flex;
    align-items: flex-start;
    padding: var(--space-3);
    gap: var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.admin-radio-list-option:has(input:checked) {
    background: var(--surface-2);
}

.admin-radio-list-option:has(input:focus-visible) {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 1px;
}

.admin-radio-list-option > input {
    margin: 2px 0 0;
    flex: none;
}

.admin-radio-list-text {
    display: flex;
    flex-direction: column;
    color: var(--ink);
    font-size: var(--text-base);
    line-height: 20px;
}

.admin-radio-list-text > small {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

/* A setting with a control on the right (usually a switch). */
.admin-setting-rows {
    display: flex;
    flex-direction: column;
}

.admin-setting-row {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) 0;
    gap: var(--space-4);
}

.admin-setting-rows > .admin-setting-row + .admin-setting-row {
    border-top: 1px solid var(--line);
}

.admin-setting-row-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.admin-setting-row-label {
    color: var(--ink);
    font-size: var(--text-base);
    line-height: 20px;
}

.admin-setting-row-help {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.admin-setting-row-control {
    flex: none;
}

/* A DataTable is its own card (toolbar, chips, count, header, rows, footer: see the customers list). Wrapping it in another card
   gave a second inset and a card in a card on many pages; this guard makes a plain wrapper around nothing but the table invisible. */
:is(.admin-card, .admin-wide-card, .pv-card):not([data-structured]):has(> .fss-datatable:only-child, > :only-child > .fss-datatable:only-child) {
    padding: 0;
    background: none;
    box-shadow: none;
}

/* ---------- LIST CARD (x-fss::list-card) ------------------------------------------------------------------------------
   One card for both list kinds: a table (DataTable look) or a row list. Head, toolbar, chips, count, rows and footer share
   `--card-pad` left and right, one head line (56px, line under it) and one row rhythm (`--row-h`, `--row-pad-y`). */
.fss-list-card > .admin-datatable-wrap > .fss-list-card-head {
    flex-wrap: nowrap;
    min-height: 56px;
    margin: 0;
    padding: var(--space-3) var(--card-pad);
    border-bottom: 1px solid var(--line);
}

.fss-list-card-head .admin-card-head-actions {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: var(--space-2);
}

/* Search in the head (a card with a title): right of the title, the same filled field as in the toolbar. */
.fss-list-card-head .admin-card-head-actions > .admin-datatable-search {
    width: 300px;
    min-width: 240px;
    max-width: 320px;
    flex: 0 1 300px;
}

/* A head with the search field keeps the one head height (56px incl. its line): the 40px field sets the vertical padding. */
.fss-list-card > .admin-datatable-wrap > .fss-list-card-head[data-search] {
    padding-block: max(0px, calc((56px - 1px - var(--control-md)) / 2));
}

/* Below the head the toolbar row only holds filters, "More filters" and "Columns". */
.fss-list-card-head + .admin-datatable-controls {
    padding-top: var(--space-3);
}

/* The head has its own line; the first row or table head must not draw a second one. */
.fss-list-card-head ~ .admin-datatable-scroll .admin-datatable thead th {
    border-top: 0;
}

.fss-list-card-head + .admin-datatable-controls ~ .admin-datatable-scroll .admin-datatable thead th {
    border-top: 1px solid var(--line);
}

.fss-list-card > .admin-datatable-wrap > :is(.fss-rows, .pv-rows) {
    margin: 0;
}

.fss-list-card > .admin-datatable-wrap > .admin-datatable-controls + :is(.fss-rows, .pv-rows) > :first-child {
    border-top: 1px solid var(--line);
}

/* Extra toolbar controls (slot `tools`): right, before "Columns". */
.admin-datatable-toolbar > .admin-datatable-tools {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

.admin-datatable-toolbar > .admin-datatable-tools + .fss-menu-host .admin-datatable-columns {
    margin-left: 0;
}

/* Narrow: the search field goes under the title, full width. */
@media (max-width: 640px) {
    .fss-list-card > .admin-datatable-wrap > .fss-list-card-head[data-search] {
        flex-wrap: wrap;
    }

    .fss-list-card-head[data-search] .admin-card-head-actions {
        width: 100%;
        flex: 1 1 100%;
    }

    .fss-list-card-head[data-search] .admin-card-head-actions > .admin-datatable-search {
        width: auto;
        max-width: none;
        flex: 1 1 auto;
    }
}


/* Long unbroken values (domains, slugs) wrap inside their cell instead of running into the next column. */
.admin-datatable td :is(.admin-datatable-cellmain, .admin-datatable-cellmain > *, a, span) { overflow-wrap: anywhere; }

/* =====================================================================
   COMPONENTS v0.86 (design-system audit WP1): meter, steps, stack-bar, tabs, field affix + money + password + code, totals, month-select,
   thread + message, attachments + file-glyph, copy, secret-reveal, address, worklist, and the extensions of kpi, row, month-bars, trend-chart,
   segmented, radio cards, setting-row, switch button, timeline and file-input.
   Rules for this block: only tokens (so a dark theme follows without edits), computed values arrive as custom properties (--v, --m, --len,
   --off, --i, --p, --h, --n, --size, --cols, --lines, --ind-x, --ind-w), motion only on transform/opacity/width and always switched off for
   reduced motion (last section), numbers are tabular.
   ===================================================================== */

@keyframes fss-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@keyframes fss-fade {
    from {
        opacity: 0;
    }
}

@keyframes fss-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fss-pop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* ---------- METER ------------------------------------------------------------------------------------------------ */

.fss-meter-wrap {
    min-width: 0;
}

.fss-meter {
    position: relative;
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--surface-2);
}

.fss-meter-wrap[data-size="sm"] .fss-meter {
    height: 4px;
}

.fss-meter-wrap[data-size="lg"] .fss-meter {
    height: 10px;
}

.fss-meter-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: max(calc(var(--v, 0) * 100%), 4px);
    border-radius: inherit;
    background: var(--chart-1);
    animation: fss-meter-in var(--dur-draw) var(--ease-draw) backwards;
    transition:
        width var(--dur-slow) var(--ease-out),
        background-color var(--dur-base) var(--ease-out);
}

.fss-meter[data-empty] .fss-meter-fill {
    width: 0;
}

@keyframes fss-meter-in {
    from {
        width: 0;
    }
}

.fss-meter-wrap[data-tone="neutral"] .fss-meter-fill {
    background: var(--chart-neutral);
}

.fss-meter-wrap[data-tone="success"] .fss-meter-fill {
    background: var(--success);
}

.fss-meter-wrap[data-tone="warning"] .fss-meter-fill {
    background: var(--warning);
}

.fss-meter-wrap[data-tone="danger"] .fss-meter-fill {
    background: var(--danger);
}

/* The tick (a reservation, a limit): ink with a surface edge so it reads on top of the fill too. */
.fss-meter-mark {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--m, 0) * 100%);
    width: 2px;
    margin-left: -1px;
    background: var(--ink);
    box-shadow: 0 0 0 1px var(--surface);
    transition: left var(--dur-slow) var(--ease-out);
}

.fss-meter-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    color: var(--ink-3);
    font-size: var(--text-xs);
    gap: var(--space-3);
    line-height: 16px;
}

.fss-meter-right {
    font-variant-numeric: tabular-nums;
}

.fss-meter-wrap[data-tone="warning"] .fss-meter-right {
    color: var(--warning);
}

.fss-meter-wrap[data-tone="danger"] .fss-meter-right {
    color: var(--danger);
}

.fss-meter-wrap[data-tone="success"] .fss-meter-right {
    color: var(--success);
}

/* ---------- STEPS ------------------------------------------------------------------------------------------------ */

.fss-steps {
    display: flex;
    margin: 0;
    padding: 0;
    counter-reset: fss-step;
    gap: var(--space-2);
    list-style: none;
}

.fss-steps-item {
    min-width: 0;
    counter-increment: fss-step;
}

.fss-steps-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.fss-steps-label {
    overflow: hidden;
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--dur-base) var(--ease-out);
}

a.fss-steps-label:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fss-steps-item[data-state="done"] .fss-steps-label {
    color: var(--ink-2);
}

.fss-steps-item[data-state="now"] .fss-steps-label {
    color: var(--ink);
    font-weight: var(--font-medium);
}

.fss-steps-hint,
.fss-steps-body {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

/* segments: one bar per phase; the fill wipes in when a phase is reached */
.fss-steps[data-variant="segments"] .fss-steps-item {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 6px;
}

.fss-steps-bar {
    position: relative;
    display: block;
    height: 4px;
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--surface-2);
}

.fss-steps-bar::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--ink);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition:
        transform var(--dur-slow) var(--ease-out),
        background-color var(--dur-base) var(--ease-out);
}

.fss-steps-item[data-state="done"] .fss-steps-bar::after {
    transform: scaleX(1);
}

.fss-steps-item[data-state="now"] .fss-steps-bar::after {
    background: var(--accent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), var(--ink) 35%);
    transform: scaleX(1);
}

/* dots: a row of dots on a hairline */
.fss-steps[data-variant="dots"] .fss-steps-item {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.fss-steps[data-variant="dots"] .fss-steps-item + .fss-steps-item::before {
    position: absolute;
    top: 4px;
    right: 50%;
    left: -50%;
    height: 2px;
    background: var(--line);
    content: "";
    transition: background-color var(--dur-base) var(--ease-out);
}

.fss-steps[data-variant="dots"] .fss-steps-item:is([data-state="done"], [data-state="now"]) + .fss-steps-item::before {
    background: var(--ink);
}

.fss-steps-dot {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 10px;
    height: 10px;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius-full);
    background: var(--surface);
    transition:
        background-color var(--dur-base) var(--ease-out),
        border-color var(--dur-base) var(--ease-out),
        box-shadow var(--dur-base) var(--ease-out);
}

.fss-steps-item[data-state="done"] .fss-steps-dot {
    border-color: var(--ink);
    background: var(--ink);
}

.fss-steps-item[data-state="now"] .fss-steps-dot {
    border-color: var(--selection-ink);
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* rail and numbered: vertical, the connector runs to the next step */
.fss-steps:is([data-variant="rail"], [data-variant="numbered"]) {
    flex-direction: column;
    gap: 0;
}

.fss-steps[data-variant="rail"] .fss-steps-item {
    position: relative;
    display: grid;
    padding-bottom: var(--space-4);
    gap: var(--space-3);
    grid-template-columns: 16px minmax(0, 1fr);
}

.fss-steps[data-variant="rail"] .fss-rail-node {
    margin: 4px auto 0;
}

.fss-steps[data-variant="rail"] .fss-steps-item:not(:last-child)::before {
    position: absolute;
    top: 18px;
    bottom: 2px;
    left: 7px;
    width: 2px;
    background: var(--line);
    content: "";
}

.fss-steps:is([data-variant="rail"], [data-variant="numbered"]) .fss-steps-label {
    color: var(--ink);
    font-size: var(--text-base);
    line-height: 24px;
    white-space: normal;
}

.fss-steps[data-variant="rail"] .fss-steps-item[data-state="planned"] .fss-steps-label {
    color: var(--ink-3);
}

.fss-steps[data-variant="numbered"] .fss-steps-item {
    position: relative;
    display: grid;
    padding-bottom: var(--space-5);
    gap: var(--space-3);
    grid-template-columns: 24px minmax(0, 1fr);
}

.fss-steps[data-variant="numbered"] .fss-steps-item:not(:last-child)::before {
    position: absolute;
    top: 30px;
    bottom: 6px;
    left: 11px;
    width: 2px;
    background: var(--line);
    content: "";
}

.fss-steps-num {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-semibold);
    transition:
        background-color var(--dur-base) var(--ease-out),
        color var(--dur-base) var(--ease-out),
        box-shadow var(--dur-base) var(--ease-out);
}

.fss-steps-num::before {
    content: counter(fss-step);
}

.fss-steps-num > svg {
    display: none;
}

.fss-steps-item[data-state="now"] .fss-steps-num {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    color: var(--accent-ink);
}

.fss-steps-item[data-state="done"] .fss-steps-num {
    background: var(--ink);
    color: var(--surface);
}

.fss-steps-item[data-state="done"] .fss-steps-num::before {
    content: none;
}

.fss-steps-item[data-state="done"] .fss-steps-num > svg {
    display: block;
    animation: fss-pop var(--dur-base) var(--ease-knob);
}

.fss-steps[data-variant="numbered"] .fss-steps-body {
    margin-top: 2px;
    color: var(--ink-2);
    font-size: var(--text-sm);
    line-height: 20px;
}

/* ---------- STACK BAR / DONUT ------------------------------------------------------------------------------------ */

.fss-stack {
    display: flex;
    min-width: 0;
    flex-direction: column;
    margin: 0;
    gap: var(--space-3);
}

.fss-stack[data-variant="donut"] {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5);
}

.fss-stack [data-shade="1"] {
    --c: var(--ink);
}

.fss-stack [data-shade="2"] {
    --c: color-mix(in srgb, var(--ink) 72%, var(--surface));
}

.fss-stack [data-shade="3"] {
    --c: color-mix(in srgb, var(--ink) 48%, var(--surface));
}

.fss-stack [data-shade="4"] {
    --c: color-mix(in srgb, var(--ink) 30%, var(--surface));
}

.fss-stack [data-shade="5"] {
    --c: color-mix(in srgb, var(--ink) 18%, var(--surface));
}

.fss-stack [data-tone="success"] {
    --c: var(--success);
}

.fss-stack [data-tone="info"] {
    --c: var(--info);
}

.fss-stack [data-tone="warning"] {
    --c: var(--warning);
}

.fss-stack [data-tone="danger"] {
    --c: var(--danger);
}

.fss-stack-track {
    display: flex;
    height: 10px;
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    gap: 2px;
    animation: fss-stack-wipe var(--dur-draw) var(--ease-draw) backwards;
}

@keyframes fss-stack-wipe {
    from {
        clip-path: inset(0 100% 0 0);
    }
}

.fss-stack-track > i {
    display: block;
    min-width: 3px;
    flex: var(--v, 1) 1 0%;
    background: var(--c);
    transition: flex-grow var(--dur-slow) var(--ease-out);
}

.fss-stack-donut {
    position: relative;
    width: var(--size, 120px);
    height: var(--size, 120px);
    flex: none;
}

.fss-stack-donut > svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.fss-stack-ring,
.fss-stack-arc {
    fill: none;
    stroke-width: 4;
}

.fss-stack-ring {
    stroke: var(--surface-2);
}

.fss-stack-arc {
    stroke: var(--c);
    stroke-dasharray: var(--len, 0) calc(100 - var(--len, 0));
    stroke-dashoffset: calc(var(--off, 0) * -1);
    animation: fss-stack-arc var(--dur-draw) var(--ease-draw) backwards;
    animation-delay: calc(var(--i, 0) * var(--stagger));
    transition:
        stroke-dasharray var(--dur-slow) var(--ease-out),
        stroke-dashoffset var(--dur-slow) var(--ease-out);
}

@keyframes fss-stack-arc {
    from {
        stroke-dasharray: 0 100;
    }
}

.fss-stack-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18%;
    text-align: center;
}

.fss-stack-center > strong {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.fss-stack-center > span {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.fss-stack-legend {
    display: flex;
    min-width: 0;
    flex-direction: column;
    margin: 0;
    padding: 0;
    gap: var(--space-2);
    list-style: none;
}

.fss-stack[data-variant="donut"] .fss-stack-legend {
    flex: 1 1 180px;
}

.fss-stack-legend > li {
    display: grid;
    align-items: center;
    color: var(--ink-2);
    font-size: var(--text-sm);
    gap: var(--space-2);
    grid-template-columns: 10px minmax(0, 1fr) auto;
    line-height: 18px;
}

.fss-stack-legend a {
    color: var(--ink);
    text-underline-offset: 3px;
}

.fss-stack-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--c);
}

.fss-stack-value {
    color: var(--ink);
    font-weight: var(--font-medium);
}

.fss-stack-value > small {
    margin-left: 4px;
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-regular);
}

/* ---------- TABS (client-side) ----------------------------------------------------------------------------------- */

.fss-tabs {
    min-width: 0;
}

.fss-tabs-list {
    position: relative;
    display: flex;
    overflow-x: auto;
    gap: var(--space-1);
    scrollbar-width: none;
}

.fss-tabs-list::-webkit-scrollbar {
    display: none;
}

.fss-tabs[data-variant="line"] .fss-tabs-list {
    box-shadow: inset 0 -1px 0 var(--line);
}

.fss-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    height: 40px;
    flex: none;
    align-items: center;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink-3);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    gap: var(--space-2);
    line-height: 20px;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out);
}

.fss-tab:hover,
.fss-tab[aria-selected="true"] {
    color: var(--ink);
}

.fss-tab:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: -2px;
}

.fss-tab:disabled {
    color: var(--ink-disabled);
    cursor: not-allowed;
}

.fss-tab-count {
    min-width: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

/* One indicator slides to the selected tab (set by ui.js through --ind-x and --ind-w). Without JS the selected tab draws its own mark. */
.fss-tabs-ind {
    position: absolute;
    left: 0;
    width: var(--ind-w, 0);
    opacity: 0;
    pointer-events: none;
    transform: translateX(var(--ind-x, 0));
    transition:
        transform var(--dur-base) var(--ease-out),
        width var(--dur-base) var(--ease-out),
        opacity var(--dur-fast) var(--ease-out);
}

.fss-tabs[data-ind="on"] .fss-tabs-ind {
    opacity: 1;
}

.fss-tabs[data-variant="line"] .fss-tabs-ind {
    bottom: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--selection-ink);
}

.fss-tabs[data-variant="line"]:not([data-ind]) .fss-tab[aria-selected="true"]::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--selection-ink);
    content: "";
}

.fss-tabs[data-variant="segmented"] .fss-tabs-list {
    display: inline-flex;
    max-width: 100%;
    padding: 3px;
    border-radius: var(--radius-sm);
    background: var(--control-fill);
}

.fss-tabs[data-variant="segmented"] .fss-tab {
    height: 30px;
    font-size: var(--text-sm);
}

.fss-tabs[data-variant="segmented"] .fss-tabs-ind {
    top: 3px;
    bottom: 3px;
    border-radius: calc(var(--radius-sm) - 2px);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.fss-tabs[data-variant="segmented"]:not([data-ind]) .fss-tab[aria-selected="true"] {
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.fss-tab-panel {
    margin-top: var(--space-4);
}

.fss-tab-panel[hidden] {
    display: none;
}

.fss-tab-panel:not([hidden]) {
    animation: fss-fade var(--dur-base) var(--ease-out);
}

.fss-tab-panel:focus-visible {
    border-radius: var(--radius-sm);
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 4px;
}

/* ---------- FIELD AFFIX, MONEY, PASSWORD ------------------------------------------------------------------------- */

/* A control with fixed text (or a button) inside the field frame. The frame carries border and focus ring; the input inside has none. */
.admin-field-control {
    display: flex;
    min-height: var(--input-h);
    align-items: center;
    border: 1px solid var(--line-field);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition:
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out);
}

.admin-field-control:focus-within {
    border-color: var(--selection-ink);
    box-shadow: var(--focus-ring);
}

.admin-field-control[data-invalid],
.admin-field[data-invalid] .admin-field-control {
    border-color: var(--danger);
}

.admin-field-control.admin-field-control > :is(input, select) {
    min-width: 0;
    min-height: calc(var(--input-h) - 2px);
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    box-shadow: none;
    outline: 0;
}

.admin-field-control[data-prefix].admin-field-control > :is(input, select) {
    padding-left: 0;
}

.admin-field-control[data-suffix].admin-field-control > :is(input, select) {
    padding-right: 0;
}

.admin-field-affix {
    display: flex;
    align-items: center;
    padding: 0 var(--space-3);
    color: var(--ink-3);
    font-size: var(--text-base);
    line-height: 20px;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.admin-field-affix:first-child {
    padding-right: var(--space-1-5);
}

.admin-field-affix:last-child {
    padding-left: var(--space-1-5);
}

.fss-money > input[type="text"] {
    font-variant-numeric: tabular-nums;
}

.fss-password-toggle {
    display: grid;
    width: var(--control-sm, 32px);
    height: var(--control-sm, 32px);
    flex: none;
    place-items: center;
    margin-right: 3px;
    border: 0;
    border-radius: calc(var(--radius-sm) - 2px);
    background: none;
    color: var(--ink-3);
    cursor: pointer;
    transition:
        background-color var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out);
}

.fss-password-toggle:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.fss-password-toggle:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 1px;
}

/* ---------- CODE INPUT ------------------------------------------------------------------------------------------- */

.admin-code-input {
    position: relative;
    display: block;
    width: min(100%, calc(var(--n, 6) * 52px));
}

/* The real input covers the slots and draws nothing itself (transparent text and caret); the slots draw what it holds. It must stay fully
   opaque and unclipped: password managers (Bitwarden) skip fields they judge hidden, and opacity below ~0.1 counts as hidden, so the
   old opacity: 0.01 made them ignore the code field. */
.admin-code-input-field {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    caret-color: transparent;
    color: transparent;
    cursor: text;
    font-size: 16px;
    opacity: 1;
}

.admin-code-input-field::selection {
    background: transparent;
}

.admin-code-input-slots {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
}

.admin-code-input-slot {
    position: relative;
    display: grid;
    height: 52px;
    place-items: center;
    border: 1px solid var(--line-field);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    transition:
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out);
}

.admin-code-input-slot[data-filled] {
    border-color: var(--line-strong);
}

.admin-code-input-slot[data-active] {
    border-color: var(--selection-ink);
    box-shadow: var(--focus-ring);
}

.admin-code-input-slot[data-active]:not([data-filled])::after {
    width: 1.5px;
    height: 24px;
    background: var(--ink);
    content: "";
    animation: fss-caret 1s steps(1) infinite;
}

@keyframes fss-caret {
    50% {
        opacity: 0;
    }
}

/* ---------- TOTALS ------------------------------------------------------------------------------------------------ */

.fss-totals {
    display: flex;
    flex-direction: column;
    margin: 0;
    font-size: var(--text-base);
    gap: var(--space-2);
}

.fss-totals-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
}

.fss-totals-row > dt {
    margin: 0;
    color: var(--ink-2);
}

.fss-totals-row > dt > small {
    display: block;
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.fss-totals-row > dd {
    margin: 0;
    color: var(--ink);
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.fss-totals-row[data-tone="success"] > dd {
    color: var(--success);
}

.fss-totals-row[data-tone="danger"] > dd {
    color: var(--danger);
}

.fss-totals-row[data-tone="muted"] > :is(dt, dd) {
    color: var(--ink-3);
}

.fss-totals-row[data-total] {
    margin-top: var(--space-1);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.fss-totals-row[data-total] > dt {
    color: var(--ink);
    font-weight: var(--font-semibold);
}

.fss-totals-row[data-total] > dd {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    letter-spacing: -0.01em;
}

/* ---------- MONTH SELECT ------------------------------------------------------------------------------------------ */

.fss-month-select {
    display: inline-flex;
    align-items: center;
    margin: 0;
    gap: var(--space-1);
}

.fss-month-select-input {
    width: auto;
    min-width: 150px;
    font-variant-numeric: tabular-nums;
}

.fss-month-select [aria-disabled="true"] {
    cursor: default;
    opacity: 0.35;
    pointer-events: none;
}

/* ---------- THREAD AND MESSAGE ----------------------------------------------------------------------------------- */

.fss-thread {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-4);
}

.fss-thread-log {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    gap: var(--space-4);
    list-style: none;
}

.fss-thread-log:empty::before {
    color: var(--ink-3);
    content: var(--empty, "Nog geen berichten");
    font-size: var(--text-sm);
}

.fss-message {
    display: flex;
    max-width: min(75%, 640px);
    align-items: flex-start;
    align-self: flex-start;
    gap: var(--space-2);
    animation: fss-rise var(--dur-base) var(--ease-out) backwards;
}

.fss-message[data-side="self"] {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.fss-message-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.fss-message[data-side="self"] .fss-message-main {
    align-items: flex-end;
}

/* The bubble is as wide as its text (a short "Test" is a small bubble), capped by the message; the time/status line sits on the same
   edge as the bubble (left for incoming, right for outgoing). */
@media (max-width: 640px) {
    .fss-message {
        max-width: min(85%, 640px);
    }
}

.fss-message-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    color: var(--ink-3);
    font-size: var(--text-xs);
    gap: var(--space-2);
    line-height: 16px;
}

.fss-message-author {
    color: var(--ink-2);
    font-weight: var(--font-medium);
}

.fss-message-bubble {
    width: fit-content;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    color: var(--ink);
    font-size: var(--text-base);
    line-height: 20px;
    overflow-wrap: anywhere;
}

.fss-message[data-side="other"] .fss-message-bubble {
    border-top-left-radius: 6px;
}

.fss-message[data-side="self"] .fss-message-bubble {
    border-top-right-radius: 6px;
    background: var(--accent-soft);
}

.fss-message[data-internal] .fss-message-bubble,
.fss-message[data-tone="warning"] .fss-message-bubble {
    background: var(--warning-bg);
}

.fss-message[data-tone="success"] .fss-message-bubble {
    background: var(--success-bg);
}

.fss-message[data-tone="danger"] .fss-message-bubble {
    background: var(--danger-bg);
}

.fss-message[data-tone="info"] .fss-message-bubble {
    background: var(--info-bg);
}

.fss-message-bubble > :first-child {
    margin-top: 0;
}

.fss-message-bubble > :last-child {
    margin-bottom: 0;
}

.fss-message-bubble a {
    color: inherit;
    text-underline-offset: 3px;
}

.fss-message-files,
.fss-message-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1-5);
}

.fss-thread-composer {
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

/* Messenger style (opt-in with `clock`/`status`): 16px bubble with a smaller corner on the sender's side, the time and delivery text
   small and muted inside the bubble at the bottom right, follow-ups of the same side closer together, a centered day divider. */
.fss-message[data-clock] .fss-message-bubble {
    border-radius: 16px;
}

.fss-message[data-clock][data-side="other"] .fss-message-bubble {
    border-top-left-radius: 4px;
    background: var(--surface-2);
}

.fss-message[data-clock][data-side="self"] .fss-message-bubble {
    border-top-right-radius: 4px;
}

.fss-message-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
    color: var(--ink-3);
    font-size: 11px;
    gap: 6px;
    line-height: 14px;
}

.fss-message-status[data-tone="danger"] {
    color: var(--danger);
}

/* Delivery ticks (`ticks` 1|2): inline SVG before the status text, tight against it; blue when seen (`ticksRead`). */
.fss-message-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.fss-message-ticks {
    flex: none;
    width: 14px;
    height: 14px;
}

.fss-message-ticks[data-read] {
    color: var(--info);
}

.fss-message[data-follow] {
    margin-top: calc(var(--space-4) * -1 + 4px);
}

.fss-thread-day {
    display: flex;
    justify-content: center;
    color: var(--ink-3);
    font-size: var(--text-xs);
    list-style: none;
}

.fss-thread-day > span {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--surface-2);
}

/* ---------- ATTACHMENTS AND FILE GLYPH --------------------------------------------------------------------------- */

.fss-glyph {
    --g: var(--ink-3);
    display: inline-grid;
    width: var(--size, 32px);
    height: var(--size, 32px);
    flex: none;
    place-items: center;
    border-radius: max(6px, calc(var(--size, 32px) * 0.22));
    background: color-mix(in srgb, var(--g) 14%, var(--surface));
    color: color-mix(in srgb, var(--g) 80%, var(--ink));
}

.fss-glyph[data-kind="pdf"] {
    --g: var(--danger);
}

.fss-glyph[data-kind="image"] {
    --g: var(--info);
}

.fss-glyph[data-kind="doc"] {
    --g: var(--chart-2);
}

.fss-glyph[data-kind="sheet"] {
    --g: var(--success);
}

.fss-glyph[data-kind="archive"] {
    --g: var(--warning);
}

.fss-glyph[data-kind="audio"],
.fss-glyph[data-kind="video"] {
    --g: var(--moss);
}

.fss-glyph[data-kind="code"] {
    --g: var(--ink-2);
}

.fss-glyph-ext {
    font-family: var(--font-mono);
    font-size: max(8px, calc(var(--size, 32px) * 0.3));
    font-weight: var(--font-semibold);
    line-height: 1;
}

.fss-attachments {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    gap: var(--space-1-5);
    list-style: none;
}

.fss-attachment {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    padding: 4px 10px 4px 4px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: var(--text-sm);
    gap: var(--space-2);
    line-height: 18px;
}

.fss-attachment-name {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.fss-attachment-name:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fss-attachment-size {
    flex: none;
    color: var(--ink-3);
    font-size: var(--text-xs);
}

.fss-attachments[data-variant="rows"] {
    flex-direction: column;
    gap: 0;
}

.fss-attachments[data-variant="rows"] .fss-attachment {
    display: flex;
    width: 100%;
    padding: var(--space-2) 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: none;
    font-size: var(--text-base);
}

.fss-attachments[data-variant="rows"] .fss-attachment:first-child {
    border-top: 0;
}

.fss-attachments[data-variant="rows"] .fss-attachment-name {
    flex: 1 1 auto;
}

.fss-attachment-thumb {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 8px;
    background: var(--surface-2);
    object-fit: cover;
}

/* ---------- COPY AND SECRET REVEAL ------------------------------------------------------------------------------- */

.fss-copy-icon {
    display: inline-grid;
}

.fss-copy-icon > svg {
    grid-area: 1 / 1;
    transition:
        opacity var(--dur-fast) var(--ease-out),
        transform var(--dur-base) var(--ease-knob);
}

.fss-copy-icon > svg:last-child {
    color: var(--success);
    opacity: 0;
    transform: scale(0.5);
}

.fss-copy[data-copied] .fss-copy-icon > svg:first-child {
    opacity: 0;
    transform: scale(0.5);
}

.fss-copy[data-copied] .fss-copy-icon > svg:last-child {
    opacity: 1;
    transform: scale(1);
}

.admin-copyblock {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.admin-copyblock-label {
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
}

.admin-copyblock-body {
    display: flex;
    align-items: flex-start;
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    gap: var(--space-2);
}

.admin-copyblock-body :is(pre, code) {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    background: none;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: var(--text-mono);
    line-height: var(--lh-mono);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.admin-copyblock[data-tone="inline"] .admin-copyblock-body {
    align-items: center;
}

.admin-copyblock[data-tone="inline"] code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fss-reveal {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.fss-reveal-title {
    margin: 0;
    font-size: var(--text-h2);
    line-height: var(--lh-h2);
}

.fss-reveal-note {
    margin: 0;
    color: var(--ink-2);
}

.fss-reveal-values {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* ---------- ADDRESS FIELD ----------------------------------------------------------------------------------------
   One set of ordinary fields (x-fss::field look: label above, --input-h, base font size). Row 1 is the lookup row; the status line below it
   keeps its height so the fields never jump when a lookup starts or ends. */

.fss-address {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.fss-address-row {
    display: grid;
    align-items: start;
    gap: var(--space-3);
}

/* The grid gap does all the spacing: sibling-margin rules of the surrounding form (label + label, * + *) must not push cells down. */
.fss-address.fss-address > *,
.fss-address .fss-address-row > * {
    margin: 0;
}

.fss-address-row[data-cols="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fss-address-row[data-cols="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Postcode is the widest of the lookup row, the addition the narrowest. */
.fss-address-row[data-row="lookup"][data-cols="3"] {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
}

.fss-address-status {
    display: flex;
    align-items: center;
    min-height: 20px;
    margin: calc(var(--space-1) * -1) 0 0;
    color: var(--ink-3);
    font-size: var(--text-sm);
    line-height: 20px;
}

.fss-address-status-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
}

.fss-address-status-item[data-tone="success"] {
    color: var(--success);
}

.fss-address-spinner {
    flex: none;
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--ink-3);
    border-top-color: transparent;
    border-radius: var(--radius-full);
    animation: fss-spin 700ms linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .fss-address-spinner {
        animation-duration: 2s;
    }
}

@media (max-width: 520px) {
    /* Phones: the lookup row keeps postcode on its own line, house number and addition share the next; the rest stacks. */
    .fss-address-row[data-row="lookup"][data-cols="3"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fss-address-row[data-row="lookup"][data-cols="3"] > :first-child {
        grid-column: 1 / -1;
    }

    .fss-address-row[data-cols="2"]:not([data-row="lookup"]) {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- WORKLIST --------------------------------------------------------------------------------------------- */

.fss-wlist {
    display: flex;
    flex-direction: column;
}

.fss-wlist-items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fss-wlist-item {
    position: relative;
    display: flex;
    min-height: var(--row-h);
    align-items: center;
    padding: var(--space-2) var(--card-pad);
    border-top: 1px solid var(--line);
    gap: var(--space-3);
    transition:
        background-color var(--dur-fast) var(--ease-out),
        opacity var(--dur-base) var(--ease-out);
}

.fss-wlist-items > .fss-wlist-item:first-child {
    border-top: 0;
}

.fss-wlist-item:hover {
    background: var(--sidebar-bg);
}

.fss-wlist-node {
    display: grid;
    width: 16px;
    flex: none;
    place-items: center;
}

.fss-wlist-item[data-tone="warning"] .fss-rail-node:not([data-state="done"]) {
    border-color: var(--warning);
}

.fss-wlist-item[data-tone="danger"] .fss-rail-node:not([data-state="done"]) {
    border-color: var(--danger);
}

.fss-wlist-item[data-tone="success"] .fss-rail-node:not([data-state="done"]) {
    border-color: var(--success);
}

.fss-wlist-item[data-tone="info"] .fss-rail-node:not([data-state="done"]) {
    border-color: var(--info);
}

.fss-wlist-age {
    min-width: 28px;
    color: var(--ink-3);
    font-size: var(--text-xs);
}

.fss-wlist-text {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    padding: var(--space-1) 0;
}

.fss-wlist-title {
    overflow: hidden;
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 20px;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.fss-wlist-title::after {
    position: absolute;
    inset: 0;
    content: "";
}

a.fss-wlist-title:focus-visible {
    outline-width: 0;
}

a.fss-wlist-title:focus-visible::after {
    box-shadow: inset 0 0 0 2px var(--focus-ring-color);
}

.fss-wlist-sub {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.fss-wlist-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex: none;
    align-items: center;
    gap: var(--space-2);
}

.fss-wlist-item[data-state="handled"] {
    opacity: 0.55;
}

.fss-wlist-done {
    display: none;
    align-items: center;
    padding: var(--space-4) var(--card-pad);
    color: var(--ink-2);
    gap: var(--space-3);
}

.fss-wlist:not(:has(.fss-wlist-item)) .fss-wlist-done {
    display: flex;
    animation: fss-rise var(--dur-slow) var(--ease-out) backwards;
}

.fss-wlist-done strong {
    display: block;
    color: var(--ink);
    font-weight: var(--font-medium);
}

.fss-wlist-done span {
    color: var(--ink-3);
    font-size: var(--text-sm);
}

/* ---------- EXTENSIONS: KPI -------------------------------------------------------------------------------------- */

.admin-kpi-meaning {
    flex: 1 0 100%;
    margin-top: var(--space-1);
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
}

.admin-kpi-meaning[data-tone="success"] {
    color: var(--success);
}

.admin-kpi-meaning[data-tone="warning"] {
    color: var(--warning);
}

.admin-kpi-meaning[data-tone="danger"] {
    color: var(--danger);
}

.admin-kpi-meaning[data-tone="info"] {
    color: var(--info);
}

.admin-kpi-visual {
    min-width: 0;
    flex: 1 0 100%;
    margin-top: var(--space-2);
}

.admin-kpi[data-size="compact"] {
    min-height: 0;
    padding: var(--space-3) var(--space-4);
}

.admin-kpi[data-size="compact"] .admin-kpi-value {
    font-size: min(20px, max(16px, 12cqi));
}

/* cols="auto": as many columns as fit, never more than four per row; `count` fixes a short row. */
.admin-kpi-grid[data-cols="auto"] {
    grid-template-columns: repeat(auto-fit, minmax(max(150px, calc((100% - 3 * var(--stack-cards)) / 4)), 1fr));
}

.admin-kpi-grid[data-cols="auto"][data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
}

.admin-kpi-grid[data-cols="auto"][data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-kpi-grid[data-cols="auto"][data-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .admin-kpi-grid[data-cols="auto"][data-count="3"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- EXTENSIONS: ROW -------------------------------------------------------------------------------------- */

.fss-row-lead[data-avatar] {
    background: none;
}

.fss-row-fig {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.fss-row-fig > .fss-num {
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 20px;
}

.fss-row-fig > small {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

/* ---------- EXTENSIONS: MONTH-BARS, TREND-CHART ------------------------------------------------------------------ */

.fss-monthbars .fss-monthbars-plot {
    height: var(--h, 112px);
}

.fss-monthbars-plot > li[data-kind="missed"]:not([data-current]) .fss-monthbars-bar {
    background: var(--danger);
}

.fss-monthbars-plot > li[data-kind="idle"]:not([data-current]) .fss-monthbars-bar {
    background: var(--line-strong);
}

.fss-monthbars-plot > li[data-tone="success"]:not([data-current]) .fss-monthbars-bar {
    background: var(--success);
}

.fss-monthbars-plot > li[data-tone="warning"]:not([data-current]) .fss-monthbars-bar {
    background: var(--warning);
}

.fss-monthbars-plot > li[data-tone="danger"]:not([data-current]) .fss-monthbars-bar {
    background: var(--danger);
}

.fss-monthbars-plot > li[data-tone="info"]:not([data-current]) .fss-monthbars-bar {
    background: var(--info);
}

.fss-monthbars-plot > li[data-kind="now"] .fss-monthbars-bar {
    box-sizing: border-box;
    border: 1.5px solid var(--ink);
    background: var(--accent);
}

.fss-monthbars[data-draw] .fss-monthbars-bar {
    animation: fss-bar-grow var(--dur-draw) var(--ease-draw) backwards;
    animation-delay: calc(var(--i, 0) * var(--stagger));
    transform-origin: bottom;
}

@keyframes fss-bar-grow {
    from {
        transform: scaleY(0);
    }
}

.admin-chart-bar-fill[data-stacked] {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: none;
}

.admin-chart-bar-fill[data-stacked] > i {
    display: block;
    min-height: 1px;
    flex: var(--v, 1) 1 0%;
}

.admin-chart-bar-fill[data-stacked] > i[data-series="1"],
.fss-chart-legend i[data-series="1"] {
    background: var(--chart-bar);
}

.admin-chart-bars[data-accent="info"] [data-stacked] > i[data-series="1"] {
    background: var(--chart-2);
}

.admin-chart-bars[data-accent="warning"] [data-stacked] > i[data-series="1"] {
    background: var(--chart-3);
}

.admin-chart-bars[data-accent="danger"] [data-stacked] > i[data-series="1"] {
    background: var(--chart-4);
}

.admin-chart-bar-fill[data-stacked][data-current] > i[data-series="1"] {
    background: var(--chart-current);
}

[data-series="2"][data-tone="neutral"] {
    background: var(--chart-5);
}

[data-series="2"][data-tone="success"] {
    background: var(--success);
}

[data-series="2"][data-tone="info"] {
    background: var(--chart-2);
}

[data-series="2"][data-tone="warning"] {
    background: var(--chart-3);
}

[data-series="2"][data-tone="danger"] {
    background: var(--chart-4);
}

.fss-chart-legend {
    display: flex;
    flex-wrap: wrap;
    margin: var(--space-2) 0 0;
    padding: 0;
    color: var(--ink-3);
    font-size: var(--text-xs);
    gap: var(--space-4);
    line-height: 16px;
    list-style: none;
}

.fss-chart-legend > li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fss-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ---------- EXTENSIONS: SEGMENTED (links), RADIO CARDS, SETTING ROW, SWITCH BUTTON ------------------------------- */

a.admin-segmented-option {
    color: inherit;
    text-decoration: none;
}

.admin-segmented-option[aria-current="page"] {
    background: var(--surface);
    box-shadow: var(--shadow-1);
    color: var(--ink);
}

.fss-choice-cards {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(var(--cols, auto-fit), minmax(min(100%, 200px), 1fr));
}

.fss-choice-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow:
        inset 0 0 0 1px var(--line),
        var(--shadow-1);
    cursor: pointer;
    gap: var(--space-3);
    transition:
        background-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out);
}

.fss-choice-card:hover {
    box-shadow:
        inset 0 0 0 1px var(--line-field),
        var(--shadow-1);
}

.fss-choice-card > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fss-choice-card:has(input:checked) {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 2px var(--selection-ink);
}

.fss-choice-card:has(input:focus-visible) {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
}

.fss-choice-card:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.5;
}

.fss-choice-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: none;
    place-items: center;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--ink-2);
    transition: background-color var(--dur-fast) var(--ease-out);
}

.fss-choice-card:has(input:checked) .fss-choice-icon {
    background: var(--surface);
    color: var(--ink);
}

.fss-choice-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding-right: var(--space-5);
}

.fss-choice-label {
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 20px;
}

.fss-choice-text > small {
    color: var(--ink-3);
    font-size: var(--text-xs);
    line-height: 16px;
}

.fss-choice-check {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: var(--radius-full);
    background: var(--ink);
    color: var(--surface);
    opacity: 0;
    transform: scale(0.5);
    transition:
        opacity var(--dur-fast) var(--ease-out),
        transform var(--dur-base) var(--ease-knob);
}

.fss-choice-card:has(input:checked) .fss-choice-check {
    opacity: 1;
    transform: scale(1);
}

.admin-setting-row-state {
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    line-height: 16px;
}

.admin-setting-row-state[data-tone="success"] {
    color: var(--success);
}

.admin-setting-row-state[data-tone="warning"] {
    color: var(--warning);
}

.admin-setting-row-state[data-tone="danger"] {
    color: var(--danger);
}

.admin-setting-row-state[data-tone="info"] {
    color: var(--info);
}

/* Switch as an instant-action button: the track follows aria-checked, a spinner shows on the knob while busy. */
button.admin-switch-field {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

button.admin-switch-field:focus-visible {
    outline: none;
}

button.admin-switch-field:focus-visible .admin-switch-track {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
}

button.admin-switch-field:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.admin-switch-field[data-busy] {
    cursor: progress;
    pointer-events: none;
}

.admin-switch-field[data-busy] .admin-switch-knob::after {
    position: absolute;
    inset: 3px;
    border: 1.5px solid var(--ink-3);
    border-top-color: transparent;
    border-radius: var(--radius-full);
    content: "";
    animation: fss-spin 700ms linear infinite;
}

/* ---------- EXTENSIONS: TIMELINE, FILE INPUT --------------------------------------------------------------------- */

.fss-timeline[data-compact] {
    gap: var(--space-3);
}

.fss-timeline-body[data-clamp] {
    display: -webkit-box;
    overflow: hidden;
    cursor: pointer;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--lines, 3);
}

.fss-timeline-body[data-clamp][data-open] {
    display: block;
}

.fss-timeline-body[data-clamp]:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
}

.fss-timeline-actor {
    color: var(--ink-2);
    font-weight: var(--font-medium);
}

.fss-dropzone-upload {
    flex-wrap: wrap;
}

.fss-dropzone-upload > .fss-progress {
    flex: 1 1 100%;
    margin-top: 0;
}

.fss-progress[data-var] > span {
    width: calc(var(--p, 0) * 1%);
}

.fss-dropzone-file-error {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--danger);
    font-size: var(--text-xs);
}

.fss-dropzone-upload[data-status="error"] {
    background: var(--danger-bg);
}

.fss-dropzone-upload[data-status="done"] .fss-dropzone-file-size {
    color: var(--success);
}

/* ---------- REDUCED MOTION for everything above (also outside the app chrome) ------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    :is(.fss-meter-fill, .fss-stack-track, .fss-stack-arc, .fss-message, .fss-tab-panel, .fss-wlist-done, .fss-steps-num > svg, .fss-monthbars-bar, .admin-code-input-slot::after, .admin-switch-knob::after) {
        animation: none;
    }

    :is(.fss-meter-fill, .fss-meter-mark, .fss-steps-bar::after, .fss-tabs-ind, .fss-choice-check, .fss-copy-icon > svg, .fss-stack-arc, .fss-stack-track > i) {
        transition: none;
    }
}

html[data-motion="reduced"] :is(.fss-meter-fill, .fss-stack-track, .fss-stack-arc, .fss-message, .fss-tab-panel, .fss-wlist-done, .fss-steps-num > svg, .fss-monthbars-bar, .admin-code-input-slot::after, .admin-switch-knob::after) {
    animation: none;
}

html[data-motion="reduced"] :is(.fss-meter-fill, .fss-meter-mark, .fss-steps-bar::after, .fss-tabs-ind, .fss-choice-check, .fss-copy-icon > svg, .fss-stack-arc, .fss-stack-track > i) {
    transition: none;
}

/* ---------- AUDIO PLAYER ----------------------------------------------------------------------------------------- */

.fss-audio {
    --p: 0; /* played fraction, set by the component */
    --b: 0; /* buffered fraction, set by the component */
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
}

.fss-audio-head {
    min-width: 0;
}

.fss-audio-title {
    overflow: hidden;
    color: var(--ink);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fss-audio-subtitle {
    color: var(--ink-3);
    font-size: 13px;
}

.fss-audio-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.fss-audio-play {
    display: inline-grid;
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ink);
    color: var(--surface);
    cursor: pointer;
    place-items: center;
    transition:
        transform var(--dur-fast) var(--ease-out),
        opacity var(--dur-fast) var(--ease-out);
}

.fss-audio[data-size="lg"] .fss-audio-play {
    width: 56px;
    height: 56px;
}

.fss-audio-play:hover {
    opacity: 0.88;
}

.fss-audio-play:active {
    transform: scale(0.96);
}

/* the global focus ring would square off the round button */
.fss-audio-play:focus-visible {
    border-radius: 50%;
}

.fss-audio-icon {
    display: inline-flex;
    grid-area: 1 / 1;
}

/* the play triangle is optically centred a little to the right */
.fss-audio-play .fss-audio-icon:first-child svg {
    fill: currentColor;
    margin-left: 2px;
}

.fss-audio-play .fss-audio-icon:nth-child(2) svg {
    fill: currentColor;
}

.fss-audio-spin svg {
    animation: fss-spin 0.8s linear infinite;
}

.fss-audio-body {
    display: flex;
    min-width: 120px;
    flex: 1 1 160px;
    flex-direction: column;
    gap: 2px;
}

.fss-audio-track {
    position: relative;
    display: flex;
    height: 20px;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.fss-audio-rail {
    position: relative;
    display: block;
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--surface-2);
}

.fss-audio-rail > i {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}

.fss-audio-buffer {
    width: calc(var(--b, 0) * 100%);
    background: var(--control-fill-active);
}

.fss-audio-fill {
    width: calc(var(--p, 0) * 100%);
    background: var(--ink);
}

.fss-audio-thumb {
    position: absolute;
    top: 50%;
    left: calc(var(--p, 0) * 100%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ink);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
    transition:
        opacity var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.fss-audio-track:hover .fss-audio-thumb,
.fss-audio-track:focus-visible .fss-audio-thumb,
.fss-audio-track[data-scrubbing] .fss-audio-thumb {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.fss-audio-times {
    display: flex;
    justify-content: space-between;
    color: var(--ink-3);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.fss-audio-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.fss-audio-tool {
    display: inline-flex;
    min-width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-decoration: none;
}

.fss-audio-tool:hover {
    background: var(--control-fill);
    color: var(--ink);
}

.fss-audio-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--danger);
    font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
    .fss-audio-play,
    .fss-audio-thumb {
        transition: none;
    }
}


/* =====================================================================
   TASK C2: EXISTING COMPONENTS ON DESIGN G
   Everything above is untouched. Rules here are either (a) under `html[data-design="g"]` (visual change only with the flag), or (b) for
   markup that only exists through a new, opt-in prop (busy button, tasklist steps, tabs overflow menu, row actions, KPI "more" toggle,
   screen reader chart table). tests/Unit/Ui/ComponentsGCssTest.php keeps (a) and (b) apart.
   ===================================================================== */

/* ---------- Button: busy (opt-in prop `busy`) ---------- */

.admin-btn[data-busy-host] {
    position: relative;
}

/* The label stays in the flow, so the button keeps its width; display: contents keeps icon and text flex items of the button. */
.admin-btn-label {
    display: contents;
}

.admin-btn-label > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.admin-btn[data-busy="true"] .admin-btn-label {
    visibility: hidden;
}

.admin-btn-busy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-btn-busy > svg {
    width: 16px;
    height: 16px;
    animation: admin-btn-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .admin-btn-busy > svg {
        animation: none;
    }
}

html[data-motion="reduced"] .admin-btn-busy > svg {
    animation: none;
}

/* ---------- Button: primary is lime with accent ink (design G) ---------- */

html[data-design="g"] .admin-btn--primary {
    background: var(--btn-primary-bg);
    box-shadow: none;
    color: var(--btn-primary-ink);
}

html[data-design="g"] .admin-btn--primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--btn-primary-bg), var(--ink) 8%);
}

html[data-design="g"] .admin-btn--primary:active:not(:disabled) {
    background: color-mix(in srgb, var(--btn-primary-bg), var(--ink) 14%);
}

/* ---------- Overlay: fixed action bar (slot `actions`) ---------- */

.admin-drawer-actions,
.admin-modal2-actions {
    flex: 0 0 auto;
}

/* The title takes focus when an overlay opens by its address; the ring would be noise on a heading. */
.admin-drawer-headings > h2[tabindex="-1"]:focus,
.admin-modal2-head h2[tabindex="-1"]:focus {
    outline: none;
}

/* ---------- KPI: figure in the display font (design G); phone toggle (opt-in prop `more` on the grid) ---------- */

html[data-design="g"] .admin-kpi-value {
    font-family: var(--font-display);
    font-size: min(var(--text-h1, 30px), max(16px, 14cqi));
    font-weight: var(--font-medium);
    letter-spacing: -0.02em;
}

html[data-design="g"] .admin-kpi-value[data-text] {
    font-size: var(--text-xl);
}

.admin-kpi-more {
    display: none;
    grid-column: 1 / -1;
    height: var(--control-md);
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--control-fill);
    color: var(--ink-2);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.admin-kpi-more:hover {
    background: var(--control-fill-hover);
    color: var(--ink);
}

@media (max-width: 640px) {
    .admin-kpi-grid[data-kpi-more]:has(> .admin-kpi:nth-child(5)) > .admin-kpi-more {
        display: inline-flex;
    }
}

/* ---------- Steps: tasklist (opt-in variant) ---------- */

.fss-steps[data-variant="tasklist"] {
    flex-direction: column;
    gap: 0;
}

.fss-steps[data-variant="tasklist"] .fss-steps-item {
    position: relative;
    display: grid;
    align-items: start;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--line);
    gap: var(--space-3);
    grid-template-columns: 16px minmax(0, 1fr) auto;
}

.fss-steps[data-variant="tasklist"] .fss-steps-item:last-child {
    border-bottom: 0;
}

.fss-steps[data-variant="tasklist"] .fss-rail-node {
    margin: 4px auto 0;
}

.fss-steps[data-variant="tasklist"] .fss-steps-label {
    color: var(--ink);
    font-size: var(--text-base);
    line-height: 24px;
    white-space: normal;
}

.fss-steps[data-variant="tasklist"] .fss-steps-item:is([data-state="planned"], [data-state="skipped"]) .fss-steps-label {
    color: var(--ink-2);
}

.fss-steps[data-variant="tasklist"] .fss-steps-item[data-state="skipped"] .fss-steps-label {
    text-decoration: line-through;
    text-decoration-color: var(--ink-3);
}

/* The state is words, never only a colour: the colour just follows the word. */
.fss-steps-state {
    color: var(--ink-3);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 24px;
    white-space: nowrap;
}

.fss-steps-item[data-state="now"] > .fss-steps-state {
    color: var(--ink);
}

.fss-steps-item[data-state="done"] > .fss-steps-state {
    color: var(--ink-2);
}

/* ---------- Charts: texture next to colour (design G) ---------- */

html[data-design="g"] .fss-stack-track > i,
html[data-design="g"] .fss-stack-swatch {
    background-repeat: repeat;
    background-size: 6px 6px;
}

html[data-design="g"] .fss-stack [data-pattern="2"]:not(.fss-stack-arc) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M-1 1l2-2M0 6l6-6M5 7l2-2' stroke='%23ffffff' stroke-opacity='.6' stroke-width='1.3'/%3E%3C/svg%3E");
}

html[data-design="g"] .fss-stack [data-pattern="3"]:not(.fss-stack-arc) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Ccircle cx='3' cy='3' r='1.1' fill='%23ffffff' fill-opacity='.7'/%3E%3C/svg%3E");
}

html[data-design="g"] .fss-stack [data-pattern="4"]:not(.fss-stack-arc) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 3h6' stroke='%230c0f14' stroke-opacity='.45' stroke-width='1.2'/%3E%3C/svg%3E");
}

html[data-design="g"] .fss-stack [data-pattern="5"]:not(.fss-stack-arc) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 3h6M3 0v6' stroke='%230c0f14' stroke-opacity='.4' stroke-width='1'/%3E%3C/svg%3E");
}

/* ---------- Page tabs: overflow menu (opt-in prop `overflow="menu"`) ---------- */

/* Without script the bar scrolls as before; once fssTabs has measured it (data-overflow-ready) the tabs that do not fit move into the "Meer" menu. */
.admin-tabs2[data-overflow="menu"][data-overflow-ready] .admin-tabs2-scroll {
    overflow: hidden;
}

.admin-tabs2[data-overflow="menu"] .admin-tab2[data-overflowed] {
    display: none;
}

.admin-tabs2-more {
    display: flex;
    flex: none;
    align-items: stretch;
}

.admin-tabs2-more[hidden] {
    display: none;
}

.admin-tab2-morebtn {
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.admin-tabs2-more[data-active] .admin-tab2-morebtn {
    color: var(--ink);
}

.admin-tabs2-more[data-active] .admin-tab2-morebtn::after {
    opacity: 1;
    transform: none;
}

.fss-menu-item[hidden] {
    display: none;
}

.fss-menu-item[aria-current="page"] {
    font-weight: var(--font-medium);
}

.fss-menu-item > .admin-tab2-count {
    margin-left: auto;
}

/* ---------- DataTable: row actions (opt-in `rowActions()`) ---------- */

.admin-datatable-actions {
    width: 1%;
    white-space: nowrap;
}

.admin-datatable td.admin-datatable-actions {
    text-align: right;
}

.admin-datatable-actions-row {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1);
}

.admin-datatable-actions .admin-btn[data-tone="danger"] {
    color: var(--danger);
}


/* =====================================================================
   TASK C3: NEW COMPONENTS, ROUND 1
   status-dot, bulk-bar, quick-actions, service-card, attention-row, product-icon. All of this is markup that only exists through the new
   components (so nothing existing changes without the flag); `html[data-design="g"]` rules only refine them.
   ===================================================================== */

/* ---------- Status dot ---------- */

.fss-status-dot {
    display: inline-flex;
    align-items: center;
    color: var(--ink-2);
    font-size: var(--text-sm);
    gap: var(--space-2);
    line-height: 20px;
    white-space: nowrap;
}

/* The word carries the state; the mark follows with colour and shape (square = down, ring = unknown), so it also works in greys. */
.fss-status-dot-mark {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: var(--radius-full);
    background: var(--ink-3);
}

.fss-status-dot[data-tone="online"] .fss-status-dot-mark {
    background: var(--success);
}

.fss-status-dot[data-tone="warning"] .fss-status-dot-mark {
    background: var(--warning);
}

.fss-status-dot[data-tone="down"] .fss-status-dot-mark {
    border-radius: 2px;
    background: var(--danger);
}

.fss-status-dot[data-tone="unknown"] .fss-status-dot-mark {
    border: 2px solid var(--ink-3);
    background: transparent;
}

.fss-status-dot[data-pulse] .fss-status-dot-mark::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    content: "";
    opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduced"]) .fss-status-dot[data-pulse] .fss-status-dot-mark::after {
        animation: fss-status-pulse 2s var(--ease-out) infinite;
    }
}

@keyframes fss-status-pulse {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(2.6);
    }
}

/* ---------- Bulk bar ---------- */

.fss-bulk-bar {
    position: sticky;
    z-index: 5;
    bottom: calc(var(--space-4) + var(--fss-bulk-offset, 0px) + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--line-field);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-2);
    gap: var(--space-3);
}

.fss-bulk-bar[hidden] {
    display: none;
}

.fss-bulk-bar-count {
    margin: 0;
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    white-space: nowrap;
}

.fss-bulk-bar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

@media (max-width: 640px) {
    .fss-bulk-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .fss-bulk-bar-actions {
        justify-content: flex-start;
    }
}

/* ---------- Quick actions ---------- */

.fss-quick-actions-list {
    display: grid;
    margin: 0;
    padding: 0;
    gap: var(--space-2);
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
    list-style: none;
}

.fss-quick-action {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    gap: var(--space-3);
    line-height: 20px;
    text-decoration: none;
    transition:
        background-color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out);
}

.fss-quick-action:hover {
    border-color: var(--line-field);
    background: var(--surface-2);
}

.fss-quick-action-icon {
    display: grid;
    flex: none;
    place-items: center;
    color: var(--ink-2);
}

/* ---------- Service card ---------- */

.fss-service-title {
    color: inherit;
    text-decoration: none;
}

.fss-service-title:hover {
    text-decoration: underline;
}

.fss-service-figure {
    display: flex;
    flex-direction: column;
    margin: 0;
    gap: var(--space-1);
}

.fss-service-figure-value {
    color: var(--ink);
    font-size: var(--text-xl);
    font-weight: var(--font-medium);
    line-height: 1.15;
}

.fss-service-figure-label {
    color: var(--ink-3);
    font-size: var(--text-sm);
}

.fss-service-visual,
.fss-service-action {
    margin-top: var(--space-3);
}

html[data-design="g"] .fss-service-figure-value {
    font-family: var(--font-display);
    font-size: var(--text-h1, 30px);
    letter-spacing: -0.02em;
}

/* ---------- Attention row ---------- */

/* The row is a worklist item; this only lets the one button keep its width when the title is long. */
.fss-attention-row .fss-wlist-actions .admin-btn {
    white-space: nowrap;
}

/* ---------- Product icon ---------- */

.fss-picon {
    flex: none;
    color: var(--ink);
    overflow: visible;
}

.fss-picon .s {
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.75;
}

/* The one lime part: it is the accent, so it never carries meaning alone. */
.fss-picon .f {
    fill: var(--accent);
    stroke: var(--ink);
    stroke-width: 1.25;
}

/* ---------- App chrome (Task C5): bottom bar, More sheet, shortcut help, worklist owner/selection/keys ---------- */

/* Worklist: checkbox, owner and the keyboard focus of a row. All of it only exists through the new props. */
.fss-wlist-check {
    position: relative;
    z-index: 1;
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ink);
    cursor: pointer;
}

.fss-wlist-item[data-selected] {
    background: var(--sidebar-bg);
}

.fss-wlist-item[tabindex]:focus {
    outline: none;
}

.fss-wlist-item[tabindex]:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: -2px;
}

.fss-wlist-owner {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex: none;
    min-height: 32px;
    align-items: center;
    padding: 0 var(--space-2) 0 var(--space-1);
    border: 0;
    border-radius: var(--radius-full, 999px);
    background: none;
    color: var(--ink-2);
    cursor: default;
    font: inherit;
    font-size: var(--text-xs);
    gap: var(--space-2);
    text-decoration: none;
}

a.fss-wlist-owner,
button.fss-wlist-owner {
    cursor: pointer;
}

a.fss-wlist-owner:hover,
button.fss-wlist-owner:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.fss-wlist-owner:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.fss-wlist-owner-mark {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full, 999px);
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    color: var(--ink);
    font-size: 10px;
    font-weight: var(--font-semibold);
}

@media (max-width: 640px) {
    .fss-wlist-owner-name {
        display: none;
    }
}

/* Keyboard hint and the keys of the help dialog. */
.fss-kbd {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius-xs, 4px);
    background: var(--surface);
    color: var(--ink-2);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
    line-height: 1;
}

.fss-shortcut-hint {
    display: inline-flex;
    margin-left: var(--space-2);
    gap: 3px;
}

.fss-shortcuts-group + .fss-shortcuts-group {
    margin-top: var(--space-4);
}

.fss-shortcuts-scope {
    margin: 0 0 var(--space-2);
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.fss-shortcuts-list {
    display: grid;
    margin: 0;
    gap: var(--space-2);
}

.fss-shortcuts-row {
    display: grid;
    align-items: center;
    gap: var(--space-3);
    grid-template-columns: 96px minmax(0, 1fr);
}

.fss-shortcuts-row dt {
    display: flex;
    gap: 4px;
}

.fss-shortcuts-row dd {
    margin: 0;
    color: var(--ink);
    font-size: var(--text-sm);
}

.fss-shortcuts-note {
    margin: var(--space-4) 0 0;
    color: var(--ink-3);
    font-size: var(--text-xs);
}

/* More sheet: rows of at least 44 px. */
.fss-more {
    display: grid;
    align-content: start;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
}

.fss-more-group {
    display: grid;
    gap: 2px;
}

.fss-more-heading {
    margin: 0;
    padding: var(--space-2) var(--space-3) 0;
    color: var(--ink-3);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.fss-more-rows {
    display: grid;
    gap: 2px;
}

.fss-more-rows[hidden] {
    display: none;
}

/* Accordion (opt-in `accordion` on x-fss::more-sheet): the heading of a group is a button that folds its rows. */
.fss-more-toggle {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    cursor: pointer;
    font: inherit;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    gap: var(--space-3);
    text-align: left;
}

.fss-more-toggle:hover {
    background: var(--surface-2);
}

.fss-more-toggle:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--focus-ring);
}

.fss-more-toggle > svg {
    transition: transform 120ms ease;
}

.fss-more-toggle[aria-expanded="true"] > svg {
    transform: rotate(180deg);
}

.fss-more-row {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-base);
    gap: var(--space-3);
    text-align: left;
    text-decoration: none;
}

.fss-more-row:hover {
    background: var(--surface-2);
}

.fss-more-row:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: -2px;
}

.fss-more-row[data-active] {
    background: var(--surface-2);
    font-weight: var(--font-semibold);
}

.fss-more-label {
    flex: 1;
    min-width: 0;
}

.fss-more-row > svg:last-child:not(:first-child) {
    color: var(--ink-3);
}

.fss-more-footer {
    display: grid;
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
    gap: var(--space-2);
}

/* Bottom bar: small screens only. */
.fss-bnav {
    display: none;
}

@media (max-width: 1023px) {
    :root:has(.fss-bnav) {
        --fss-bnav-h: calc(64px + env(safe-area-inset-bottom, 0px));

        /* A focused element is scrolled clear of the bar (WCAG 2.4.11 Focus Not Obscured). */
        scroll-padding-bottom: calc(var(--fss-bnav-h) + var(--space-4));
    }

    .fss-bnav {
        --rail-bg: var(--night);
        position: fixed;
        z-index: var(--z-sticky);
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        height: var(--fss-bnav-h);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--night);
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .fss-bnav[data-cols="3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fss-bnav[data-cols="4"] {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fss-bnav::before {
        position: absolute;
        top: 0;
        right: var(--space-3);
        left: var(--space-3);
        height: 3px;
        border-radius: 3px;
        background: var(--night-2);
        content: "";
        pointer-events: none;
    }

    .fss-bnav-item {
        position: relative;
        display: flex;
        min-height: 64px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--space-2) 0 0;
        border: 0;
        background: none;
        color: #aeb6af; /* 8,88:1 on --night */
        cursor: pointer;
        font: inherit;
        gap: 2px;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .fss-bnav-item[data-active] {
        color: #ffffff;
    }

    .fss-bnav-item:focus-visible {
        border-radius: var(--radius-sm);
        box-shadow: inset 0 0 0 2px #ffffff; /* white on --night: 18,45:1 */
    }

    .fss-bnav-icon {
        position: relative;
        display: inline-flex;
        height: 24px;
        align-items: center;
    }

    .fss-bnav-label {
        font-size: var(--text-caption);
        font-weight: var(--font-medium);
        line-height: 16px;
    }

    .fss-bnav-item[data-active] .fss-bnav-label {
        font-weight: var(--font-semibold);
    }

    .fss-rail-node.fss-bnav-node {
        position: absolute;
        top: -2.5px;
        left: calc(50% - 4px);
        view-transition-name: fss-bnav-node;
        box-shadow:
            inset 0 0 0 1.5px var(--night),
            0 0 0 3px rgba(255, 255, 255, 0.3);
    }

    .fss-bnav-badge {
        position: absolute;
        top: -4px;
        left: calc(100% - 6px);
        display: inline-flex;
        min-width: 18px;
        height: 18px;
        align-items: center;
        justify-content: center;
        padding: 0 5px;
        border-radius: var(--radius-full, 999px);
        background: var(--danger-solid, var(--danger));
        box-shadow: 0 0 0 2px var(--night);
        color: #ffffff;
        font-size: 11px;
        font-weight: var(--font-semibold);
        line-height: 1;
    }
}

::view-transition-group(fss-bnav-node) {
    animation-duration: 300ms;
    animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

html[data-motion="reduced"] ::view-transition-group(fss-bnav-node) {
    animation-duration: 1ms;
}

/* ---------- Command palette and top search (Task C4) ---------- */

/* The field in the page header. A native button that opens the palette; icon only on a phone. */
.fss-top-search {
    display: inline-flex;
    width: min(420px, 100%);
    min-height: 36px;
    align-items: center;
    padding: 0 var(--space-3);
    border: 1px solid var(--line-field);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink-3);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-base);
    gap: var(--space-2);
    text-align: left;
}

.fss-top-search:hover {
    border-color: var(--line-strong);
    color: var(--ink-2);
}

.fss-top-search-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fss-top-search-keys {
    flex: none;
    padding: 1px var(--space-1-5);
    border-radius: var(--radius-xs);
    background: var(--surface-2);
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 11px;
}

@media (max-width: 767px) {
    .fss-top-search {
        width: 40px;
        min-height: 40px;
        justify-content: center;
        padding: 0;
    }

    .fss-top-search-text,
    .fss-top-search-keys {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

.fss-palette {
    position: fixed;
    z-index: var(--z-modal);
    display: flex;
    inset: 0;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh var(--space-4) var(--space-4);
}

.fss-palette[hidden],
.fss-palette[x-cloak] {
    display: none;
}

.fss-palette-backdrop {
    position: absolute;
    border: 0;
    background: color-mix(in srgb, var(--ink) 32%, transparent);
    cursor: default;
    inset: 0;
}

.fss-palette-panel {
    position: relative;
    display: flex;
    width: min(640px, 100%);
    max-height: min(640px, 80vh);
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-3);
}

.fss-palette-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.fss-palette-field {
    display: flex;
    min-height: 52px;
    align-items: center;
    padding: 0 var(--space-4);
    border-bottom: 1px solid var(--line);
    color: var(--ink-3);
    gap: var(--space-3);
}

.fss-palette-input {
    min-width: 0;
    height: 100%;
    min-height: 52px;
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    outline: none;
}

.fss-palette-input::-webkit-search-cancel-button {
    display: none;
}

.fss-palette-input:focus-visible {
    outline: none;
}

.fss-palette-field:focus-within {
    box-shadow: inset 0 -2px 0 var(--ink);
}

.fss-palette-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--line-field);
    border-radius: var(--radius-full);
    border-top-color: var(--ink-2);
    animation: fss-palette-spin 0.7s linear infinite;
}

@keyframes fss-palette-spin {
    to {
        transform: rotate(360deg);
    }
}

html[data-motion="reduced"] .fss-palette-spinner {
    animation-duration: 2s;
}

.fss-palette-scopes {
    display: flex;
    flex-wrap: wrap;
    padding: var(--space-3) var(--space-4) 0;
    gap: var(--space-1-5);
}

.fss-palette-chip {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-full);
    background: var(--control-fill);
    color: var(--ink-2);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-sm);
    gap: var(--space-1-5);
}

.fss-palette-chip[aria-pressed="true"] {
    background: var(--ink);
    color: var(--surface);
}

.fss-palette-results {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2) var(--space-2) var(--space-3);
    overscroll-behavior: contain;
    scroll-padding: var(--space-2);
}

.fss-palette-group + .fss-palette-group {
    margin-top: var(--space-2);
}

.fss-palette-group-label {
    display: block;
    padding: var(--space-2) var(--space-2) var(--space-1);
    color: var(--ink-3);
    font-size: 12px;
    line-height: 16px;
}

.fss-palette-row {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: var(--space-1-5) var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--ink);
    gap: var(--space-3);
    text-decoration: none;
}

/* The active row is told by a bar as well as the fill, so it does not rely on colour. */
.fss-palette-row[data-active] {
    background: var(--surface-2);
    box-shadow: inset 2px 0 0 var(--ink);
}

.fss-palette-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: none;
    place-items: center;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink-2);
}

.fss-palette-text {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.fss-palette-title-text {
    overflow: hidden;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fss-palette-desc {
    overflow: hidden;
    color: var(--ink-3);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fss-palette-meta {
    flex: none;
    color: var(--ink-3);
    font-size: 12px;
}

.fss-palette-keys {
    display: inline-flex;
    flex: none;
    gap: 2px;
}

.fss-palette-keys kbd,
.fss-palette-foot kbd {
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 var(--space-1);
    border-radius: var(--radius-xs);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 10px;
}

.fss-palette-enter {
    display: grid;
    flex: none;
    color: var(--ink-3);
    opacity: 0;
}

.fss-palette-row[data-active] .fss-palette-enter {
    opacity: 1;
}

.fss-palette-empty,
.fss-palette-note {
    margin: var(--space-3) var(--space-2);
    color: var(--ink-3);
    font-size: var(--text-sm);
}

.fss-palette-foot {
    display: flex;
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 12px;
    gap: var(--space-4);
}

@media (max-width: 640px) {
    .fss-palette {
        padding: var(--space-2);
    }

    .fss-palette-panel {
        max-height: 88vh;
    }

    .fss-palette-foot,
    .fss-palette-desc {
        display: none;
    }
}

html[data-design="g"] .fss-palette-panel {
    border-radius: var(--radius-lg);
}

html[data-design="g"] .fss-top-search {
    border-radius: var(--radius-md);
}

/* ---------- v0.99.1: worklist item and bulk bar on a phone ---------- */

/* Bulk bar: while rows are selected it stays fixed above the bottom bar (and above the action bar), also when it sits inside a card. */
@media (max-width: 1023px) {
    .fss-bulk-bar {
        position: fixed;
        z-index: calc(var(--z-sticky) + 1);
        right: var(--space-3);
        bottom: calc(var(--fss-bottom-nav-h, var(--fss-bnav-h, env(safe-area-inset-bottom, 0px))) + var(--space-2));
        left: var(--space-3);
    }

    :root:has(.fss-actionbar) .fss-bulk-bar {
        bottom: calc(var(--fss-bottom-nav-h, var(--fss-bnav-h, env(safe-area-inset-bottom, 0px))) + 56px + var(--space-4));
    }
}

/* ---------- Mobile-first pass (feature/mobile-ui) ---------------------------------------------------------------- */

/* Worklist item (phone): the row wraps. Check, node, age and the title stay on the first line (the title may wrap); owner and buttons get their own line, indented under the title. */
@media (max-width: 767px) {
    .fss-wlist-item {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: var(--space-2);
    }

    .fss-wlist-text {
        flex: 1 1 0;
    }

    .fss-wlist-title {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .fss-wlist-owner {
        order: 3;
        margin-left: 40px;
    }

    .fss-wlist-actions {
        order: 4;
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        padding-left: 40px;
    }
}

/* Visually hidden controls stay 1 px: `.admin-field input` (width, min-height on touch screens) is more specific and made a hidden file input
   360 px wide, which scrolled the page sideways on a phone. */
.sr-only,
.fss-sr-only {
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    border: 0 !important;
    clip-path: inset(50%);
}

/* Touch: no 300 ms tap delay or double-tap zoom on controls, and no grey tap flash (the :active states below are the feedback). */
@media (pointer: coarse) {
    :is(.admin-chrome, .portal-chrome, .fss-teleported) :is(a, button, summary, label, [role="button"], [role="tab"], select) {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* Inputs are 16 px on a touch screen: iOS zooms the page into any field below that. Selector is long on purpose (beats the module rules). */
@media (pointer: coarse), (max-width: 640px) {
    :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported)
        :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]), select, textarea),
    :is(.admin-chrome, .portal-chrome, .admin-auth-page, .fss-teleported) :is(.admin-input, .admin-datatable-search input) {
        font-size: max(16px, 1em);
    }
}

@media (pointer: coarse) {
    /* Checkboxes of a card and of a worklist row: the box stays 18 px, the touch target becomes 40 px (appearance off, box drawn by ::before). */
    :is(.fss-card-check, .fss-wlist-check) {
        display: inline-grid;
        width: 40px;
        height: 40px;
        flex: none;
        margin: -11px;
        place-items: center;
        appearance: none;
        background: none;
        border: 0;
        cursor: pointer;
    }

    :is(.fss-card-check, .fss-wlist-check)::before {
        width: 18px;
        height: 18px;
        border: 1.5px solid var(--line-strong);
        border-radius: var(--radius-xs, 4px);
        background: var(--surface);
        content: "";
    }

    :is(.fss-card-check, .fss-wlist-check):checked::before {
        border-color: var(--ink);
        background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 14px no-repeat;
    }

    :is(.fss-card-check, .fss-wlist-check):focus-visible {
        outline: 2px solid var(--focus-ring-color);
        outline-offset: -4px;
        border-radius: var(--radius-sm);
    }

    /* Worklist owner chip (initials only on a phone) and the segmented options. */
    .fss-wlist-owner {
        min-width: 40px;
        min-height: 40px;
        justify-content: center;
    }

    .admin-segmented-option {
        min-height: 40px;
    }

    /* Switch: the (invisible) input covers its whole field, so the reported hit area is the row, not 1 px. */
    .admin-switch-field:has(> .admin-switch-input) {
        position: relative;
        min-height: 44px;
    }

    .admin-switch-field > .admin-switch-input {
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        clip: auto;
        cursor: pointer;
        opacity: 0;
    }

    /* Stretched-link titles (the ::after covers the whole row): grow the element's own box to 40 px without moving anything. */
    :is(a.fss-row-title, a.fss-wlist-title, .fss-card-title button.fss-card-primary, .fss-card-title > a) {
        padding-block: 10px;
        margin-block: -10px;
    }

    /* View tabs above a list (Open / Te laat / …) and checkbox rows get a full touch-sized row. */
    .fss-views-scroller .fss-view {
        min-height: 40px;
    }

    .admin-checkbox-label {
        min-height: 40px;
        align-items: center;
    }

    /* Header meta (badges, customer chip) wraps on a phone instead of being cut in a side-scrolling strip. */
    .admin-page-header-meta {
        flex-wrap: wrap;
        overflow: visible;
    }

    .admin-back-link {
        min-height: 40px;
        margin-block: -8px calc(var(--space-3) - 8px);
    }

    /* Tab bars snap to a tab instead of stopping halfway. */
    .admin-tabs2-scroll {
        scroll-snap-type: x proximity;
        scroll-padding-inline: var(--space-4);
    }

    .admin-tabs2-scroll > .admin-tab2 {
        scroll-snap-align: center;
    }
}

/* Press feedback, touch only (hover:none): a short scale/opacity dip. Not under reduced motion. */
@media (hover: none) and (prefers-reduced-motion: no-preference) {
    :is(.admin-chrome, .portal-chrome, .fss-teleported) :is(.admin-btn, .admin-tab2, .admin-segmented-option, .fss-chip) {
        transition-property: transform, opacity, background-color, color, border-color, box-shadow;
    }

    :is(.admin-chrome, .portal-chrome, .fss-teleported) .admin-btn:active:not(:disabled):not([aria-disabled="true"]) {
        opacity: 0.86;
        transform: scale(0.97);
    }

    :is(.admin-chrome, .portal-chrome, .fss-teleported) :is(.fss-row[data-linked], .fss-wlist-item, .fss-card[data-linked], .admin-kpi[href], .admin-tab2):active {
        background-color: var(--sidebar-bg);
    }
}

@media (max-width: 640px) {
    /* Page header: the "..." menu stays on the title row; copy takes what is left (200 px minimum so wide actions still wrap below). */
    .admin-page-header-copy {
        flex-basis: 200px;
    }

    .admin-page-header-actions {
        margin-left: auto;
    }

    /* Compact empty states. */
    .admin-empty-state {
        padding: var(--space-8) var(--space-4);
    }

    .admin-empty-state[data-compact] {
        padding: var(--space-6) var(--space-4);
    }

    /* Row: title keeps a real column; figure, status and actions drop to a second line when they do not fit beside it. */
    .fss-row {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .fss-row-body {
        flex: 1 1 150px;
    }

    .fss-row-chevron {
        order: 2;
    }

    :is(.fss-row-fig, .fss-row-status, .fss-row-acts) {
        order: 3;
    }

    .fss-row:has(> .fss-row-fig, > .fss-row-status) {
        padding-bottom: var(--space-1);
    }

    /* With both a status and actions there is no room beside the title on a phone: the title takes the full line. */
    .fss-row:has(> .fss-row-status):has(> .fss-row-acts) > .fss-row-body {
        flex-basis: 100%;
    }

    /* A hidden chart tooltip near the last bars still counts toward the page width; keep it inside the chart. */
    .admin-chart {
        overflow-x: clip;
    }

    /* KPI strip (opt-in: <x-fss::kpi-grid strip>): one swipeable row of tiles with snap instead of a tall stack. */
    .admin-kpi-grid[data-strip] {
        display: flex;
        margin-inline: calc(var(--space-4) * -1);
        padding-inline: var(--space-4);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-padding-inline: var(--space-4);
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .admin-kpi-grid[data-strip]::-webkit-scrollbar {
        display: none;
    }

    .admin-kpi-grid[data-strip] > .admin-kpi {
        flex: 0 0 min(72%, 260px);
        scroll-snap-align: start;
    }
}

/* Card list: the single grid track must be allowed to shrink, otherwise a nowrap trailing figure widened every card past the screen. */
.fss-cardlist {
    grid-template-columns: minmax(0, 1fr);
}

.fss-card {
    min-width: 0;
}

.fss-card-trailing {
    max-width: 45vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Page header meta (badges) wraps inside the header instead of pushing it wider than the screen. */
.admin-page-header-meta {
    min-width: 0;
    max-width: 100%;
}

/* A badge never grows past its container: a long label is cut with an ellipsis instead of widening the page. */
.admin-status-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chart axis label that would overlap its neighbour (set by FssUi.chartLabels); the bar keeps its tooltip with the full label. */
.admin-chart-bar-label[data-hidden] {
    visibility: hidden;
}

/* Row on a phone: title and sub line wrap instead of one ellipsised line (no line clamp: apps that set overflow: visible on a variant would
   then paint the clamped lines over the next element). */
@media (max-width: 640px) {
    .fss-row-title,
    .fss-row-sub {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Month bars: 12 px labels that are not clipped; the ones that would touch are hidden by FssUi.chartLabels instead of every second one. */
.fss-monthbars-label[data-hidden] {
    visibility: hidden;
}

@media (max-width: 639px) {
    .fss-monthbars-label {
        overflow: visible;
        font-size: 12px;
        line-height: 16px;
    }

    .fss-monthbars-plot > li:nth-child(even):not([data-current]) .fss-monthbars-label {
        visibility: visible;
    }
}

/* Password toggle: 40 px hit area on touch (the glyph stays the same). */
@media (pointer: coarse) {
    .fss-password-toggle {
        width: 40px;
        height: 40px;
        margin-right: 0;
    }
}

/* @membership-badge:start
   Membership badge (x-fss::membership-badge), the FINAL design approved by Sebas on 28 Oct 2026. This block is the one deliberate exception to
   the "no halo / backdrop-filter / gradient" gates (tests/Unit/Ui/UiCssGatesTest.php skips everything between the start and end markers):
   the badge is a status reward, not chrome. Text only: no icon, no emoji. Both tiers are SOLID brand lime inside with black text.
   Pro = static: a thin black inner ring and a soft lime halo. Platinum = no inner ring; a 3px iridescent ring and a wider soft glow sit BEHIND
   the lime fill (the fill is its own element above the pseudo-elements) and rotate once per 9 s. The ring extends 3px and the glow ~8px outside
   the pill: a parent must not clip it (overflow: hidden). Browsers without @property show a static ring.
   Contrast: black on #d4ff3f 17:1. */
@property --fss-mb-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.fss-membership-badge {
    --h: 22px;
    --ring-blur: 1px;

    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    height: var(--h);
    margin-inline: 2px;
    border-radius: calc(var(--h) * 0.5);
    font: 600 calc(var(--h) * 0.5) / 1 var(--font-sans, inherit);
    letter-spacing: 0.01em;
    vertical-align: middle;
}

.fss-membership-badge[data-size="sm"] {
    --h: 18px;
    --ring-blur: 0.75px;
}

.fss-membership-badge__fill {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 calc(var(--h) * 0.45);
    border-radius: inherit;
    background: #d4ff3f;
    color: #000;
    white-space: nowrap;
}

/* Pro */
.fss-membership-badge[data-tier="pro"] {
    box-shadow: 0 0 calc(var(--h) * 0.3) rgb(170 230 40 / 0.25);
}

.fss-membership-badge[data-tier="pro"] .fss-membership-badge__fill {
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.18);
}

/* Platinum: blurred iridescent ring and glow, behind the fill */
.fss-membership-badge[data-tier="platinum"]::before {
    content: "";
    position: absolute;
    inset: -1.5px;
    z-index: 1;
    border-radius: calc(var(--h) * 0.5 + 1.5px);
    background: conic-gradient(from var(--fss-mb-angle), #b98cff, #6eaaff, #ffffff, #ffd678, #aa78ff, #5ac8ff, #ffffff, #ffc36e, #b98cff);
    filter: blur(var(--ring-blur));
    animation: fss-mb-spin 14s linear infinite;
}

.fss-membership-badge[data-tier="platinum"]::after {
    content: "";
    position: absolute;
    inset: -4px;
    z-index: 0;
    border-radius: calc(var(--h) * 0.5 + 4px);
    background: conic-gradient(from var(--fss-mb-angle), rgb(185 140 255 / 0.28), rgb(110 170 255 / 0.25), rgb(255 214 120 / 0.25), rgb(90 200 255 / 0.25), rgb(185 140 255 / 0.28));
    filter: blur(calc(var(--h) * 0.15));
    animation: fss-mb-spin 14s linear infinite;
}

@keyframes fss-mb-spin {
    to {
        --fss-mb-angle: 360deg;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fss-membership-badge[data-tier="platinum"]::before,
    .fss-membership-badge[data-tier="platinum"]::after {
        animation: none;
    }
}

@media (forced-colors: active) {
    .fss-membership-badge[data-tier]::before,
    .fss-membership-badge[data-tier]::after {
        display: none;
    }

    .fss-membership-badge__fill {
        border: 1px solid CanvasText;
        background: Canvas;
        color: CanvasText;
    }
}
/* @membership-badge:end */

/* An option is a centred box, whatever it is (label, button or link) and wherever it sits. Generic field rules such as
   `.admin-form label:not(.admin-checkbox):not(.admin-switch)` (specificity 0,3,1: flex column, gap, 12px text) used to win over the
   single-class rules above, so the label text stuck to the top-left of its pill. The doubled classes lift this block above them. */
.admin-segmented.admin-segmented > .admin-segmented-option.admin-segmented-option:is(label, button, a) {
    display: inline-flex;
    box-sizing: border-box;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 0 var(--space-3);
    color: var(--ink-2);
    font-size: var(--text-sm, 13px);
    font-weight: var(--font-medium);
    line-height: 16px;
    text-align: center;
}

.admin-segmented.admin-segmented > .admin-segmented-option.admin-segmented-option:is(label, button, a):is(:has(input:checked), [aria-pressed="true"], [aria-current="page"]) {
    color: var(--ink);
}

.admin-segmented-option > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
}

/* =====================================================================
   CORE TOUCH POLISH (design loop): touch targets, KPI tiles, card head, scroll fades, light action bar, shared fixes.
   Desktop density is unchanged: everything that grows is behind (pointer: coarse) or a phone width.
   ===================================================================== */

/* ---------- Touch targets >= 44 px ------------------------------------------------------------------------------- */
@media (pointer: coarse), (max-width: 640px) {
    .admin-btn--ghost,
    .admin-btn--sm {
        min-height: 44px;
    }

    .admin-btn--ghost.admin-btn--icon,
    .admin-btn--sm.admin-btn--icon {
        min-width: 44px;
    }

    /* Inline link: the padding grows the tap area, the negative margin keeps the line height (an inline box ignores vertical margins). */
    .admin-text-link {
        padding-block: 14px;
        margin-block: -14px;
    }

    .admin-back-link {
        min-height: 44px;
        margin-top: -10px;
        margin-bottom: calc(var(--space-3) - 10px);
    }

    .admin-segmented-option {
        min-height: 44px;
    }

    /* The stretched ::after already makes the whole row the target; the element itself reaches 44 px too without moving the row. */
    :is(a.fss-row-title, a.fss-wlist-title, .fss-card-title button.fss-card-primary, .fss-card-title > a) {
        padding-block: 12px;
        margin-block: -12px;
    }

    .fss-password-toggle {
        width: 44px;
        height: 44px;
        margin: -2px 0;
    }
}

/* ---------- KPI tiles on a phone --------------------------------------------------------------------------------- */
@media (max-width: 640px) {
    /* An odd last tile would leave a hole next to it: it takes both columns. */
    .admin-kpi-grid > .admin-kpi:nth-child(odd):nth-last-child(1 of .admin-kpi) {
        grid-column: 1 / -1;
    }

    .admin-kpi {
        padding-inline: 14px;
    }

    /* Bigger than the desktop floor of 22 px, tight enough that an amount like "€ 12.845,00" still fits a half-width tile. */
    .admin-kpi-value:not([data-text]) {
        font-size: clamp(23px, 17cqi, 30px);
        letter-spacing: -0.025em;
    }
}

/* A grid of exactly six tiles reads as 3 x 2, not 4 + 2 (the default of four columns is the inline `--kpi-cols: 4`). */
@media (min-width: 761px) {
    .admin-kpi-grid[style*="--kpi-cols: 4"]:has(> .admin-kpi:nth-child(6)):not(:has(> .admin-kpi:nth-child(7))) {
        --kpi-cols: 3;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- Card head on a phone: an action stays next to the title ---------------------------------------------- */
@media (max-width: 640px) {
    .admin-card[data-structured] > .admin-card-head:not(.fss-list-card-head):not(:has(.admin-card-head-actions > :nth-child(3), .admin-card-head-actions :is(input, select, textarea))) {
        flex-wrap: nowrap;
        align-items: center;
        gap: var(--space-3);
    }

    .admin-card[data-structured] > .admin-card-head:not(.fss-list-card-head):not(:has(.admin-card-head-actions > :nth-child(3), .admin-card-head-actions :is(input, select, textarea))) > .admin-card-heading {
        flex: 1 1 0;
    }

    .admin-card[data-structured] > .admin-card-head:not(.fss-list-card-head):not(:has(.admin-card-head-actions > :nth-child(3), .admin-card-head-actions :is(input, select, textarea))) > .admin-card-head-actions {
        flex: none;
        flex-wrap: nowrap;
    }
}

/* ---------- Horizontal scrollers fade at the edge that scrolls on ------------------------------------------------ */
/* Scroll-driven (no script): the mask fades only the side that has more content; a bar that does not overflow has no active timeline and no fade.
   `.fss-scroll-fade` is the utility for chip rows and tab bars of an app; x-fss::tabs puts it on its tab list itself. */
@property --fss-fade-start {
    syntax: "<length>";
    inherits: false;
    initial-value: 0px;
}

@property --fss-fade-end {
    syntax: "<length>";
    inherits: false;
    initial-value: 0px;
}

@keyframes fss-scroll-fade {
    0% {
        --fss-fade-start: 0px;
        --fss-fade-end: 24px;
    }

    4%,
    96% {
        --fss-fade-start: 24px;
        --fss-fade-end: 24px;
    }

    100% {
        --fss-fade-start: 24px;
        --fss-fade-end: 0px;
    }
}

@supports (animation-timeline: scroll()) {
    .fss-scroll-fade {
        animation: fss-scroll-fade linear both;
        animation-timeline: scroll(self inline);
        mask-image: linear-gradient(to right, transparent, #000 var(--fss-fade-start), #000 calc(100% - var(--fss-fade-end)), transparent);
    }
}

/* ---------- Action bar (phone): light and slim ------------------------------------------------------------------- */
/* The bar is a light surface with a hairline; the primary button keeps its ink colour. It was a 56 px bar that also added the safe-area
   inset on top of the bottom bar's own, which together with the dark bottom bar made a heavy slab. Now: 6 px rhythm (52 px with a 44 px
   button) and no second safe-area inset when a bottom bar is present. */
.fss-actionbar {
    /* Sits on top of the bottom bar: the app chrome's own height first, else the core bottom bar's (the styleguide has no app chrome). */
    bottom: var(--fss-bottom-nav-h, var(--fss-bnav-h, 0px));
    min-height: 0;
    padding-block: 6px calc(6px + env(safe-area-inset-bottom, 0px));
}

:root:has(.fss-bnav) .fss-actionbar,
.portal-chrome .fss-actionbar {
    padding-bottom: 6px;
}

/* ---------- Shared fixes from the admin design loop -------------------------------------------------------------- */
/* Search field: starts at 200 px instead of 280, so it shares a toolbar row with a filter button (the phone rule, full width, stays). */
@media (min-width: 761px) {
    .admin-datatable-search {
        min-width: 200px;
        flex-basis: 200px;
    }
}

/* Stacked cell (main line + sub line): a floor so a narrow column does not wrap one letter per line (`overflow-wrap: anywhere` above). */
.admin-datatable-cellmain {
    min-width: 112px;
}

/* An empty state inside a card sits in the card's own surface: 24 px all round instead of the page-level padding. */
:is(.admin-card, .admin-wide-card, .pv-card) .admin-empty-state {
    padding: var(--space-6);
}

/* Banner with an action: on a phone the action drops below the text, aligned with it (icon width 18 px + gap). The close button
   stays on the first line (order), the action takes the second. */
@media (max-width: 640px) {
    .admin-banner:has(> .admin-banner-actions) {
        flex-wrap: wrap;
    }

    .admin-banner:has(> .admin-banner-actions) > .admin-banner-close {
        order: 1;
    }

    .admin-banner:has(> .admin-banner-actions) > .admin-banner-actions {
        order: 2;
        box-sizing: border-box;
        flex: 1 1 100%;
        padding-left: calc(18px + var(--space-2));
        margin-left: 0;
    }
}

/* Row status on a phone: no 40 % cap and no clipping, the badge may wrap; beside the actions on the row's second line it takes the rest. */
@media (max-width: 640px) {
    .fss-row-status {
        min-width: 0;
        max-width: 100%;
        flex: 0 1 auto;
        overflow: visible;
    }

    /* With a lead, the title shares its line with it (lead 32 px + gap 12 px) instead of leaving the lead alone on a line. */
    .fss-row:has(> .fss-row-lead):has(> .fss-row-status):has(> .fss-row-acts) > .fss-row-body {
        flex-basis: calc(100% - 45px);
    }

    /* Next to the actions (the title has the line above to itself) the status takes the room that is left. */
    .fss-row-status:has(+ .fss-row-acts) {
        flex: 1 1 0;
    }

    .fss-row-status .admin-status-badge {
        height: auto;
        min-height: var(--badge-h);
        padding-block: 2px;
        overflow: visible;
        white-space: normal;
    }
}

/* Eyebrow: a small label above a title or value; sans, not mono (the mono eyebrow read as code). */
.fss-eyebrow,
.admin-page-header-kicker {
    color: var(--ink-3);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    letter-spacing: 0.02em;
    line-height: 16px;
}
/* ---------- ROUND 3: filter chip, flat mobile cards, row hierarchy -------------------------------------------------- */

/* Filter chip (single and multiple): one compact control, label quiet, value in ink, a small chevron that turns when the popover is open. */
.admin-datatable-filter--button {
    padding-inline: var(--space-3) var(--space-2);
    transition:
        background-color var(--dur-fast) var(--ease-out),
        transform var(--dur-instant) var(--ease-out);
}

.admin-datatable-filter--button > svg {
    transition: transform var(--dur-fast) var(--ease-out);
}

.admin-datatable-filter--button[aria-expanded="true"] {
    background: var(--control-fill-hover);
}

.admin-datatable-filter--button[aria-expanded="true"] > svg {
    transform: rotate(180deg);
}

.admin-datatable-filter--button:active {
    transform: scale(0.98);
}

.admin-datatable-filter--button:focus-visible {
    box-shadow: var(--focus-ring);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* An active chip (a value is chosen) drops the colon and shows a marker, so a glance down the toolbar tells what is filtered. */
.admin-datatable-filter--button[data-active] > span::before {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: var(--space-1-5);
    border-radius: var(--radius-full);
    background: var(--selection-ink);
    content: "";
    vertical-align: 2px;
}

/* Single-choice popover: the dot slot is reserved so the labels do not shift when the choice changes. */
.fss-menu-item[role="menuitemradio"]::before {
    width: 6px;
    height: 6px;
    flex: none;
    border-radius: var(--radius-full);
    background: transparent;
    content: "";
}

.fss-menu-item[role="menuitemradio"][data-checked]::before {
    background: var(--selection-ink);
}

/* ---- Data cards (mobile list): one grid, title on its own line ----
   The frozen v0.97 rules above stay as they are (ComponentsGCssTest); this pass overrides them. */

/* Title takes the whole first line; subtitle, amount and status share the second one, so the figure and its badge never wrap apart. */
:is(.fss-card, .fss-swipe-front) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 0;
}

.fss-card-title {
    grid-column: 1 / -1;
}

/* A selectable card: the checkbox (and its 40 px touch target) must not be clipped by the title's overflow (that cut the box in half). */
.fss-card-title:has(> .fss-card-check) {
    overflow: visible;
}

.fss-card-title > :is(a, .fss-card-primary) {
    min-width: 0;
    overflow-wrap: anywhere;
}

.fss-card-subtitle {
    grid-row: 2;
}

.fss-card-trailing {
    grid-row: 2;
    margin-left: var(--space-3);
}

.fss-card-badge {
    grid-column: 3;
    margin-left: var(--space-2);
}

.fss-card-check {
    flex: none;
    align-self: flex-start;
    margin-block: 3px 0;
}

@media (pointer: coarse) {
    /* The 40 px target is centred on the first title line (the line is about 22 px high). */
    .fss-card-check {
        margin: -9px -11px -13px;
    }
}

/* Mobile data cards are rows of ONE surface (the table card around them), not cards inside a card: no radius, no shadow, a hairline between. */
.admin-datatable-wrap .fss-cardlist {
    gap: 0;
}

.admin-datatable-wrap .fss-card {
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.admin-datatable-wrap .fss-card[data-selected] {
    background: var(--accent-soft);
}

/* The head of a list card already draws its own line. */
.admin-datatable-wrap .fss-list-card-head + .fss-cardlist > .fss-card:first-child {
    border-top: 0;
}

@media (hover: hover) and (pointer: fine) {
    .admin-datatable-wrap .fss-card[data-interactive]:not([data-selected]):hover {
        background: var(--sidebar-bg);
    }
}

.admin-datatable-wrap .fss-card[data-interactive]:not([data-selected]):active,
.admin-datatable-wrap .fss-card:not([data-selected]):has(:focus-visible) {
    background: var(--sidebar-bg);
}

/* A KPI tile inside a card is a flat tile, not a second raised card. */
.admin-card .admin-kpi:not(a) {
    background: var(--surface-2);
    box-shadow: none;
}

/* ---- Rows (x-fss::row) ---- */

.fss-row {
    transition: background-color var(--dur-fast) var(--ease-out);
}

/* The hover wash is for a pointer: on a phone it stayed painted after a tap. Keyboard focus gets the same wash as the inset ring. */
.fss-row[data-linked]:hover {
    background: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .fss-row[data-linked]:hover {
        background: var(--sidebar-bg);
    }
}

.fss-row[data-linked]:has(a.fss-row-title:focus-visible) {
    background: var(--sidebar-bg);
}

/* A second list in the same card (for example the fixed rows under a sortable list) keeps the divider between the two lists. */
.fss-rows + .fss-rows > .fss-row:first-child,
.fss-sortable + .fss-rows > .fss-row:first-child {
    border-top: 1px solid var(--line);
}

/* Title, sub line and trailing parts share one optical centre line: the figure's number lines up with the title, its label with the sub line. */
.fss-row-fig {
    align-self: center;
}

.fss-row-acts {
    align-self: center;
}

/* Phone: a row with a single trailing part (status or figure, no actions) keeps it on the title's line instead of dropping it to a second line. */
@media (max-width: 640px) {
    .fss-row:has(> :is(.fss-row-status, .fss-row-fig)):not(:has(> .fss-row-acts)):not(:has(> .fss-row-status):has(> .fss-row-fig)) {
        flex-wrap: nowrap;
        padding-bottom: 0;
    }

    .fss-row:has(> :is(.fss-row-status, .fss-row-fig)):not(:has(> .fss-row-acts)):not(:has(> .fss-row-status):has(> .fss-row-fig)) > .fss-row-body {
        flex: 1 1 0;
    }

    .fss-row:has(> :is(.fss-row-status, .fss-row-fig)):not(:has(> .fss-row-acts)):not(:has(> .fss-row-status):has(> .fss-row-fig)) > :is(.fss-row-status, .fss-row-fig) {
        order: 1;
    }
}

/* Phone, a row with lead, status and actions: the second line (status, actions) starts under the title, not under the lead. */
@media (max-width: 640px) {
    .fss-row:has(> .fss-row-lead):has(> .fss-row-status):has(> .fss-row-acts) > .fss-row-status {
        margin-left: calc(32px + var(--space-3));
    }
}

/* ---- Round 4: active-filter chips and the card-head switch ---- */

/* A chip of a promoted filter repeats a toolbar control that is already visible: hide it there. "Filters wissen" stays. A card list (data-cards) hides its toolbar filters below 768px, so the chip stays visible there. */
.fss-datatable:not([data-cards]) .admin-datatable-chip[data-promoted] {
    display: none;
}

@container fss-datatable (min-width: 768px) {
    .fss-datatable[data-cards] .admin-datatable-chip[data-promoted] {
        display: none;
    }
}

/* A segmented switch in a card head (VPN: platform per device) is wider than a phone: the head wraps and the switch scrolls sideways inside its own row.
   `:not(#_)` lifts the specificity above the "action stays next to the title" phone rules, which would otherwise keep the head on one line. */
@media (max-width: 767px) {
    .admin-card[data-structured] > .admin-card-head:has(.admin-segmented):not(#_) {
        flex-wrap: wrap;
    }

    .admin-card-head-actions:has(> .admin-segmented):not(#_) {
        flex: 1 1 100%;
        min-width: 0;
        margin-left: 0;
    }

    .admin-card-head-actions > .admin-segmented {
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }
}

/* ---------- Shared components promoted from the portal and admin (design round components-1) ------------------------- */

/* Usage line (x-fss::usage): label and figure on one line, an optional bar under it, one quiet sentence below. */
.fss-usage-list {
    display: grid;
    gap: var(--space-4);
}

.fss-usage {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.fss-usage-head {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: var(--space-2);
}

.fss-usage-icon {
    flex: none;
    align-self: center;
    color: var(--ink-3);
}

.fss-usage-label {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: var(--ink);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.fss-usage-label {
    text-decoration: none;
}

a.fss-usage-label:hover {
    text-decoration: underline;
}

.fss-usage-figure {
    flex: none;
    font-weight: 600;
}

.fss-usage-of {
    color: var(--ink-3);
    font-weight: 400;
}

.fss-usage-sub {
    margin: 0;
    color: var(--ink-3);
    font-size: var(--text-sm);
}

.fss-usage[data-state="near"] .fss-usage-sub strong {
    color: var(--warning);
}

.fss-usage[data-state="full"] .fss-usage-sub strong {
    color: var(--danger);
}

.fss-usage-more {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.fss-usage-more:hover {
    color: var(--ink);
}

/* The lines of a usage list settle in with a short stagger; reduced motion shows them at once. */
@keyframes fss-usage-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@media (prefers-reduced-motion: no-preference) {
    html:not([data-motion="reduced"]) .fss-usage-list > .fss-usage {
        animation: fss-usage-rise var(--dur-base, 200ms) var(--ease-out, ease-out) backwards;
        animation-delay: calc(var(--i, 0) * 40ms);
    }

    .fss-usage-list > .fss-usage:nth-child(2) { --i: 1; }
    .fss-usage-list > .fss-usage:nth-child(3) { --i: 2; }
    .fss-usage-list > .fss-usage:nth-child(4) { --i: 3; }
    .fss-usage-list > .fss-usage:nth-child(5) { --i: 4; }
}

/* Advanced fold (x-fss::advanced): a quiet summary row with a chevron, the content stacked below. */
.fss-advanced {
    display: grid;
    gap: var(--space-3);
    /* minmax(0, 1fr): a scrolling row inside (chips, segmented) shrinks to the width of the fold instead of stretching the page. */
    grid-template-columns: minmax(0, 1fr);
}

.fss-advanced > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px var(--space-3);
    padding: var(--space-2) 0;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
}

.fss-advanced > summary > span {
    grid-column: 1;
    color: var(--ink-3);
    font-size: var(--text-sm);
    font-weight: 400;
}

.fss-advanced > summary::-webkit-details-marker {
    display: none;
}

.fss-advanced > summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid var(--ink-3);
    border-bottom: 1.5px solid var(--ink-3);
    content: "";
    rotate: 45deg;
    transition: rotate var(--dur-base) var(--ease-out);
}

.fss-advanced[open] > summary::after {
    rotate: 225deg;
}

@media (prefers-reduced-motion: reduce) {
    .fss-advanced > summary::after {
        transition: none;
    }
}

/* Split (x-fss::split): 2/3 + 1/3, one column below 1180px. */
.fss-split {
    display: grid;
    gap: var(--stack-cards);
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.fss-split[data-align="start"] {
    align-items: start;
}

@media (max-width: 1180px) {
    .fss-split {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* TOTP setup (x-fss::totp-qr): the QR code on a white tile (it must stay white in dark mode to scan), the manual details below. */
.fss-totp {
    display: grid;
    gap: var(--space-3);
}

.fss-totp-qr {
    display: grid;
    justify-items: start;
    gap: var(--space-3);
}

.fss-totp-qr img {
    width: min(232px, 100%);
    height: auto;
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
}

.fss-totp-toggle {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fss-totp-manual {
    display: grid;
    gap: var(--space-3);
}

/* Chip row (x-fss::chip-row): wraps from a tablet up; on a phone one scrolling line (the fade comes from .fss-scroll-fade). */
.fss-chip-row {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

@media (max-width: 767px) {
    .fss-chip-row:not([data-wrap]) {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .fss-chip-row:not([data-wrap]) > * {
        flex: none;
        scroll-snap-align: start;
    }

    .fss-chip-row::-webkit-scrollbar {
        display: none;
    }
}

/* Segmented switcher with many options (x-fss::segmented scroll): one scrolling line on a phone (fade from .fss-scroll-fade). */
@media (max-width: 767px) {
    .admin-segmented[data-scroll] {
        display: flex;
        width: 100%;
        max-width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .admin-segmented[data-scroll]::-webkit-scrollbar {
        display: none;
    }

    .admin-segmented[data-scroll] > .admin-segmented-option {
        flex: none;
        white-space: nowrap;
        scroll-snap-align: start;
    }
}

/* Slim empty state (x-fss::empty-state slim): one row (icon, text, action) for a card that would otherwise be mostly air.
   Even the compact state is about 130px tall; this one is about 64px. On a phone the action drops under the text. */
.admin-empty-state[data-slim] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--space-3);
    row-gap: 0;
    padding: var(--space-3) var(--card-pad, var(--space-4));
    text-align: left;
}

.admin-empty-state[data-slim] > :is(.admin-empty-state-mark, .admin-empty-state-node, .admin-empty-state-icon) {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 32px;
    height: 32px;
    box-shadow: none;
    background: var(--surface-2);
}

.admin-empty-state[data-slim] > strong {
    grid-column: 2;
    grid-row: 1;
    font-size: var(--text-base, 14px);
    line-height: 20px;
}

.admin-empty-state[data-slim] > p {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    font-size: var(--text-sm);
    line-height: 18px;
    color: var(--ink-3);
}

.admin-empty-state[data-slim] > strong:only-of-type:not(:has(~ p)) {
    grid-row: 1 / span 2;
}

.admin-empty-state[data-slim] > .admin-empty-state-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin: 0;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .admin-empty-state[data-slim] {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .admin-empty-state[data-slim] > .admin-empty-state-actions {
        grid-column: 2;
        grid-row: 3;
        margin-top: var(--space-2);
        justify-content: flex-start;
    }
}

/* List card with a status column (x-fss::list-card status-width="8rem"): the status of every row gets at least this width (a minimum, so
   content such as a bar with text is never squeezed), so the badges form a column instead of floating at the title's length. Not on a phone, where the badge wraps under the title. */
@media (min-width: 641px) {
    .fss-list-card[data-status-col] .fss-row-status {
        min-width: var(--fss-row-status-w);
        display: flex;
        justify-content: flex-start;
    }
}

/* Row lists at the edge of a card (one rule for every row component: fss-row, pv-rows, hub rows, agenda rows, ...).
   A card does not clip (overflow stays visible: a row menu has to open outside it), so a row fill (hover, header tint) at the card's
   top or bottom edge would square off the rounded corners. The first / last item of a list that is itself the first / last thing in
   the card (also through the wrappers of a nested list card, up to four deep) takes the card's corner radius. The card is a flush card
   or a table wrap that is not inside another card (a table in a card has no card of its own). */
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :is(ul, ol):last-child > li:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :last-child > :is(ul, ol):last-child > li:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :last-child > :last-child > :is(ul, ol):last-child > li:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :last-child > :last-child > :last-child > :is(ul, ol):last-child > li:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :last-child > :last-child > :last-child > :last-child > :is(ul, ol):last-child > li:last-child {
    border-end-start-radius: var(--radius-md);
    border-end-end-radius: var(--radius-md);
}

:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :is(ul, ol):first-child > li:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :is(ul, ol):first-child > li:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :is(ul, ol):first-child > li:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :is(ul, ol):first-child > li:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :first-child > :is(ul, ol):first-child > li:first-child {
    border-start-start-radius: var(--radius-md);
    border-start-end-radius: var(--radius-md);
}

:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:first-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :first-child > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:first-child {
    border-start-start-radius: var(--radius-md);
}

:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:last-child,
:is(.admin-card[data-flush], .admin-datatable-wrap:not(.admin-card *)) > :first-child > :first-child > :first-child > :first-child > :first-child > :first-child > :is(.admin-datatable, .admin-data-table, .fss-table):first-child > thead > tr:first-child > th:last-child {
    border-start-end-radius: var(--radius-md);
}
