/* Import Nimbus Design System Theme *//**
 * Nimbus Design System - CSS Theme
 * Auto-generated from Figma Design Tokens
 *
 * This file contains all design tokens as CSS custom properties.
 * The theme automatically adapts to light/dark mode using prefers-color-scheme.
 *
 * NOTE: the @import below is hand-added and must survive regeneration from the
 * token export. Everything after it is generated.
 */

/* Global scrollbar chrome. Hand-written, kept in its own file so a token
   regeneration of this one cannot clobber it. Must stay above all rules —
   @import is only valid at the top of a stylesheet. */

/**
 * Nimbus Design System - Scrollbars
 *
 * A single floating-pill scrollbar for every scroll container: no track chrome,
 * a narrow rounded thumb inset from the container edge.
 *
 * Hand-written, and deliberately NOT part of theme.css — that file is generated
 * from the Figma token export and would lose these rules on the next sync. It is
 * imported by theme.css so consumers still get it from the one entry point.
 *
 * Two engines, two mechanisms — each ignores the other's properties, so the
 * rules coexist and Firefox degrades to the closest thing it can express:
 *   - Firefox: `scrollbar-width` / `scrollbar-color` only. Thin and recoloured,
 *     but the thumb still spans the full track — no inset pill is possible.
 *   - WebKit/Blink (Chrome, Edge, Safari, Electron): the ::-webkit-scrollbar
 *     pseudo-elements give full control, which is what produces the design.
 *
 * The inset is a transparent border on the thumb rather than a narrower track:
 * a thumb always fills its track's width, so shrinking the track would shrink
 * the hit area too. `background-clip: padding-box` keeps the border transparent
 * to the (transparent) track, leaving a centred pill with a comfortable grab
 * target either side of it.
 */

:root {
    /* Thumb colours are deliberately borders, not text: the scrollbar is chrome
       that sits beside content, and the border ramp is the token scale tuned for
       that weight. Both resolve per-theme, so the bar follows light/dark with no
       extra rules here. */
    --scrollbar-size: 10px;
    --scrollbar-inset: 3px;
    --scrollbar-thumb: var(--border-60);
    --scrollbar-thumb-hover: var(--text-paragraph);
}

/* Firefox. Set on the root and inherited, so nested scroll containers pick it
   up without each needing its own rule. */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* WebKit does NOT inherit scrollbar pseudo-elements, so this has to match every
   scrollable element rather than just the root. `:where()` keeps specificity at
   zero — any component rule that wants a different scrollbar overrides this
   without needing !important or a specificity fight. */
:where(*)::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

:where(*)::-webkit-scrollbar-track {
    background: transparent;
}

:where(*)::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border: var(--scrollbar-inset) solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}

:where(*)::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* The square where the vertical and horizontal bars meet: left at its default
   it paints an opaque grey patch in the corner of dual-axis scrollers. */
:where(*)::-webkit-scrollbar-corner {
    background: transparent;
}
:root {
    color-scheme: light dark;
}

/* Light Theme (Default) */
:root {
    /* Backgrounds - Surface */
    --bg-surface-primary: #ffffff;
    --bg-surface-secondary: #f5f7f9;
    --bg-page: #f6f7f9;
    --bg-surface-invert: #ffffff;
    --bg-surface-invert-2: #edeff2;
    --bg-surface-brand: #403456;

    /* Backgrounds - Buttons */
    --bg-button-primary: #303640;
    --text-button-primary: #ffffff;
    --bg-button-secondary: #edeff2;
    --bg-button-ghost: #ffffff;
    --bg-button-border: #d7dae0;
    --bg-button-disable: #edeff2;

    /* Backgrounds - Chips */
    --bg-chip-filled: #edeff2;
    --bg-chip-border: #edeff2;

    /* Backgrounds - Content Switcher */
    --bg-cs-bg: #edeff2;
    --bg-cs-highlight: #ffffff;

    /* Backgrounds - Footer */
    --bg-footer-surface-primary: #f6f7f9;
    --bg-footer-border-selected: #232933;

    /* Borders */
    --border-20: #d7dae0;
    --border-40: #d7dae0;
    --border-60: #bdc4d1;
    --border-100: #232933;
    --border-brand: #2d1b3f;

    /* Text Colors */
    --text-title: #232933;
    --text-paragraph: #5c6575;
    --text-disable: #bdc4d1;
    --text-invert: #ffffff;
    --text-brand: #2d1b3f;

    /* Icon Colors */
    --icon-hero: #171b27;
    --icon-secondary: #5c6575;
    --icon-disable: #828b99;
    --icon-brand: #675d78;

    /* Status Colors */
    --color-acknowledged: #fdbf09;
    --color-cleared: #589a23;
    --color-fault: #ffd455;
    --color-fire: #e6251e;
    /* A past alert, or a mark for no stage of one (a comment). */
    --color-inactive: #828b99;
    --color-isolate: #7f8c8d;
    --color-mode-service: #7b3fbe;
    --color-mode-weekly-test: #285cc3;
    --color-non-critical: #007d96;
    --color-read: #ed6a07;
    /* Glyphs and text on the status colours: white, but dark on the fault yellow. */
    --text-on-status: #ffffff;
    --text-on-fault: #1a1a1a;
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
    :root {
        /* Backgrounds - Surface */
        --bg-surface-primary: #303640;
        --bg-surface-secondary: #464e5c;
        --bg-page: #232933;
        --bg-surface-invert: #464e5c;
        --bg-surface-invert-2: #5c6575;
        --bg-surface-brand: #d8d6dd;

        /* Backgrounds - Buttons */
        --bg-button-primary: #5c6575;
        --text-button-primary: #ffffff;
        --bg-button-secondary: #303640;
        --bg-button-ghost: #232933;
        --bg-button-border: #464e5c;
        --bg-button-disable: #303640;

        /* Backgrounds - Chips */
        --bg-chip-filled: #303640;
        --bg-chip-border: #303640;

        /* Backgrounds - Content Switcher */
        --bg-cs-bg: #464e5c;
        --bg-cs-highlight: #303640;

        /* Backgrounds - Footer */
        --bg-footer-surface-primary: #303640;
        --bg-footer-border-selected: #bdc4d1;

        /* Borders */
        --border-20: #5c6575;
        --border-40: #464e5c;
        --border-60: #5c6575;
        --border-100: #f6f7f9;
        --border-brand: #675d78;

        /* Text Colors */
        --text-title: #ffffff;
        --text-paragraph: #d7dae0;
        --text-disable: #5c6575;
        --text-invert: #232933;
        --text-brand: #2d1b3f;

        /* Icon Colors */
        --icon-hero: #ffffff;
        --icon-secondary: #d7dae0;
        --icon-disable: #bdc4d1;
        --icon-brand: #675d78;

        /* Status Colors */
        --color-acknowledged: #fdbf09;
        --color-cleared: #589a23;
        --color-fault: #ffd455;
        --color-fire: #e6251e;
        /* A past alert, or a mark for no stage of one (a comment). */
        --color-inactive: #828b99;
        --color-isolate: #7f8c8d;
        --color-mode-service: #7b3fbe;
        --color-mode-weekly-test: #285cc3;
        --color-non-critical: #007d96;
        --color-read: #ed6a07;
        /* Glyphs and text on the status colours: white, but dark on the fault yellow. */
        --text-on-status: #ffffff;
        --text-on-fault: #1a1a1a;
    }
}

/* Force Light Theme */
[data-theme="light"] {
    color-scheme: light;

    /* Backgrounds - Surface */
    --bg-surface-primary: #ffffff;
    --bg-surface-secondary: #f5f7f9;
    --bg-page: #f6f7f9;
    --bg-surface-invert: #ffffff;
    --bg-surface-invert-2: #edeff2;
    --bg-surface-brand: #403456;

    /* Backgrounds - Buttons */
    --bg-button-primary: #303640;
    --text-button-primary: #ffffff;
    --bg-button-secondary: #edeff2;
    --bg-button-ghost: #ffffff;
    --bg-button-border: #d7dae0;
    --bg-button-disable: #edeff2;

    /* Backgrounds - Chips */
    --bg-chip-filled: #edeff2;
    --bg-chip-border: #edeff2;

    /* Backgrounds - Content Switcher */
    --bg-cs-bg: #edeff2;
    --bg-cs-highlight: #ffffff;

    /* Backgrounds - Footer */
    --bg-footer-surface-primary: #f6f7f9;
    --bg-footer-border-selected: #232933;

    /* Borders */
    --border-20: #d7dae0;
    --border-40: #d7dae0;
    --border-60: #bdc4d1;
    --border-100: #232933;
    --border-brand: #2d1b3f;

    /* Text Colors */
    --text-title: #232933;
    --text-paragraph: #5c6575;
    --text-disable: #bdc4d1;
    --text-invert: #ffffff;
    --text-brand: #2d1b3f;

    /* Icon Colors */
    --icon-hero: #171b27;
    --icon-secondary: #5c6575;
    --icon-disable: #828b99;
    --icon-brand: #675d78;

    /* Status Colors */
    --color-acknowledged: #fdbf09;
    --color-cleared: #589a23;
    --color-fault: #ffd455;
    --color-fire: #e6251e;
    /* A past alert, or a mark for no stage of one (a comment). */
    --color-inactive: #828b99;
    --color-isolate: #7f8c8d;
    --color-mode-service: #7b3fbe;
    --color-mode-weekly-test: #285cc3;
    --color-non-critical: #007d96;
    --color-read: #ed6a07;
    /* Glyphs and text on the status colours: white, but dark on the fault yellow. */
    --text-on-status: #ffffff;
    --text-on-fault: #1a1a1a;
}

/* Force Dark Theme */
[data-theme="dark"] {
    color-scheme: dark;

    /* Backgrounds - Surface */
    --bg-surface-primary: #303640;
    --bg-surface-secondary: #464e5c;
    --bg-page: #232933;
    --bg-surface-invert: #464e5c;
    --bg-surface-invert-2: #5c6575;
    --bg-surface-brand: #d8d6dd;

    /* Backgrounds - Buttons */
    --bg-button-primary: #5c6575;
    --text-button-primary: #ffffff;
    --bg-button-secondary: #303640;
    --bg-button-ghost: #232933;
    --bg-button-border: #464e5c;
    --bg-button-disable: #303640;

    /* Backgrounds - Chips */
    --bg-chip-filled: #303640;
    --bg-chip-border: #303640;

    /* Backgrounds - Content Switcher */
    --bg-cs-bg: #464e5c;
    --bg-cs-highlight: #303640;

    /* Backgrounds - Footer */
    --bg-footer-surface-primary: #303640;
    --bg-footer-border-selected: #bdc4d1;

    /* Borders */
    --border-20: #5c6575;
    --border-40: #464e5c;
    --border-60: #5c6575;
    --border-100: #f6f7f9;
    --border-brand: #675d78;

    /* Text Colors */
    --text-title: #ffffff;
    --text-paragraph: #d7dae0;
    --text-disable: #5c6575;
    --text-invert: #232933;
    --text-brand: #2d1b3f;

    /* Icon Colors */
    --icon-hero: #ffffff;
    --icon-secondary: #d7dae0;
    --icon-disable: #bdc4d1;
    --icon-brand: #675d78;

    /* Status Colors */
    --color-acknowledged: #fdbf09;
    --color-cleared: #589a23;
    --color-fault: #ffd455;
    --color-fire: #e6251e;
    /* A past alert, or a mark for no stage of one (a comment). */
    --color-inactive: #828b99;
    --color-isolate: #7f8c8d;
    --color-mode-service: #7b3fbe;
    --color-mode-weekly-test: #285cc3;
    --color-non-critical: #007d96;
    --color-read: #ed6a07;
    /* Glyphs and text on the status colours: white, but dark on the fault yellow. */
    --text-on-status: #ffffff;
    --text-on-fault: #1a1a1a;
}
/* Import Nimbus Design System Components */
/**
 * Nimbus Design System - Components Package
 * @lancontrolsystems/nimbus-web-components
 *
 * This package provides structural CSS components and layout tokens.
 * Use alongside @lancontrolsystems/nimbus-web-theme for colors.
 *
 * Usage:
 *   @import '@lancontrolsystems/nimbus-web-components/src/index.css';
 *
 * Or import individual files:
 *   @import '@lancontrolsystems/nimbus-web-components/src/tokens/typography.css';
 *   @import '@lancontrolsystems/nimbus-web-components/src/components/buttons.css';
 */

/* Tokens - CSS Custom Properties */

/**
 * Nimbus Design System - Spacing & Layout Tokens
 * Based on 4px base unit grid system
 */

:root {
    /* Spacing Scale (4px base) */
    --spacing-0: 0;
    --spacing-1: 0.25rem; /* 4px */
    --spacing-2: 0.5rem; /* 8px */
    --spacing-3: 0.75rem; /* 12px */
    --spacing-4: 1rem; /* 16px */
    --spacing-5: 1.25rem; /* 20px */
    --spacing-6: 1.5rem; /* 24px */
    --spacing-8: 2rem; /* 32px */
    --spacing-10: 2.5rem; /* 40px */
    --spacing-12: 3rem; /* 48px */
    --spacing-16: 4rem; /* 64px */

    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.25rem; /* 4px - subtle rounding */
    --radius-md: 0.5rem; /* 8px - cards, containers */
    --radius-lg: 0.75rem; /* 12px - larger cards */
    --radius-xl: 1rem; /* 16px */
    --radius-2xl: 1.5rem; /* 24px - drawers, modals */
    --radius-full: 9999px; /* Pill shape - chips, badges */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    /* Every floating list of choices: a Select's options, a Menu, a dropdown. One value, so
       they all lift off the page by the same amount. */
    --shadow-menu: 0 8px 24px rgba(0, 0, 0, 0.2);
    /* What floats well clear of the page over a dimmed or busy background: a guided tour's
       bubble, a panel over the brand artwork. Tinted with the brand's navy, not plain black. */
    --shadow-xl: 0 24px 60px -20px rgba(14, 13, 40, 0.55), 0 2px 6px rgba(14, 13, 40, 0.12);

    /* Overlays: the page dimmed behind something that needs it to step back (a guided tour),
       and the light edge round a part of the page cut out of that dimming to point at it. */
    --overlay-scrim: rgba(14, 13, 40, 0.6);
    --overlay-cutout-edge: rgba(255, 255, 255, 0.7);
    --overlay-cutout-halo: rgba(255, 255, 255, 0.14);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-tooltip: 400;
    /* A floating list of choices is portalled to the body and opened from anywhere, a modal
       or a drawer included, so it has to clear every layer above. */
    --z-menu: 1100;
}

/**
 * Nimbus Design System - Typography Tokens
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Font: Montserrat
 * Line Height: 140% (1.4)
 * Letter Spacing: 0
 * Paragraph Spacing: 10px
 */

:root {
    /* Font Family */
    --font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Font Weights */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Font Sizes */
    --font-size-xs: 0.625rem; /* 10px */
    --font-size-sm: 0.75rem; /* 12px */
    --font-size-m: 0.9375rem; /* 15px */
    --font-size-l: 1.25rem; /* 20px */
    --font-size-xl: 1.375rem; /* 22px */

    /* The label on a pill in the pill bar (a name, "System status", "Full screen"): small
       and bold, so a row of them reads as controls rather than as text. */
    --pill-label-size: 0.6875rem; /* 11px */

    /* Line Heights */
    --line-height-default: 1.4; /* 140% */

    /* Paragraph Spacing */
    --paragraph-spacing: 0.625rem; /* 10px */
}

/* Typography Classes */

/* Extra Small */
.text-xs {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

.text-xs-bold {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

/* Small */
.text-sm {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

.text-sm-bold {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

/* Medium */
.text-m {
    font-family: var(--font-family);
    font-size: var(--font-size-m);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

.text-m-bold {
    font-family: var(--font-family);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

/* Large */
.text-l {
    font-family: var(--font-family);
    font-size: var(--font-size-l);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

.text-l-bold {
    font-family: var(--font-family);
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

/* Extra Large */
.text-xl {
    font-family: var(--font-family);
    font-size: var(--font-size-xl);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

.text-xl-bold {
    font-family: var(--font-family);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    letter-spacing: 0;
}

/**
 * Nimbus Design System - Page Layout Tokens
 *
 * The page the shell (app-container) lays out, and every federated module's page sits in:
 * a fixed pill bar over the top of the view, the gutters either side of the content, and
 * the space the content keeps below the bar. Published here rather than by the shell so a
 * module reads the same values whether or not the shell's stylesheet has loaded.
 */

:root {
    /* Shared because layouts below the fixed bar have to reserve its height. */
    --pill-bar-height: 44px;
    /* The space either side of the page's content, which the pill bar's right edge lines up
       with. Modules leave it to the shell rather than adding their own, and read it where
       they need to reach into it. Narrows with the window, from 48px to 28px. */
    --page-gutter: clamp(1.75rem, 3.5vw, var(--spacing-12));
    /* The space below the page's content: a little under the side gutter, so a page that
       just fits the window doesn't scroll for the sake of padding. FLARE's panels end here. */
    --page-bottom: var(--spacing-8);
    /* The widest the page's content gets, inside the gutters. A wider window centres it in the
       room beside the menus, so a table's columns don't drift hundreds of pixels apart. A
       module with fullWidth set (FLARE's monitoring screen) keeps the whole window. */
    --page-max-width: 100rem;
    /* The space above a page's content: the pill bar's top offset, the bar itself, and a gap
       under it. Every page starts here, so a title holds its place as you move between them.
       The shell pads the sides and the bottom; a page pads only its top (see .page). */
    --page-top: calc(var(--spacing-5) + var(--pill-bar-height) + var(--spacing-4));

    /* Every list's search field is the same width: it holds its width, and what shares its
       row wraps, rather than squeezing it (see .list-toolbar__search). */
    --search-width: 20rem;

    /* How far a drawer floats clear of the window's top and bottom: a card over the page,
       rather than a panel along its edge. */
    --drawer-inset-block: 3.75rem;

    /* The height every single-line control shares — a button, a text input, a select — so
       a field and the button beside it line up without per-page overrides. */
    --control-height: 36px;
}

/**
 * Nimbus Design System - Motion Tokens
 *
 * One way of moving, taken from the iOS and Android apps (Theme/Motion.swift, theme/Motion.kt)
 * and scaled for a desktop screen: quick, quiet, and done before it is noticed. On a phone one
 * list arrives at a time; on a desktop page several things change at once, so content moves
 * less, for less long, and once per change, while the springs are kept for what reads as a
 * physical thing moving: the chosen tab's mark, a drawer, a modal, a mark popping in.
 *
 * - enter: how content arrives (a row, a card, a panel): a short ease-out over a few pixels.
 * - settle: how something moves into place (the tab mark sliding, a drawer, a modal). The apps'
 *   spring; barely overshoots.
 * - pop: how something small appears (an icon disc, a badge, a step on a progress strip). The
 *   apps' spring; a small bounce.
 *
 * The springs are drawn as `linear()` curves sampled from the apps' own (response and damping
 * fraction below), so the web settles the way the apps do. Browsers without `linear()` get a
 * cubic-bezier close to it.
 *
 * A list's items come in one after another, a stagger step apart, and the stagger stops
 * counting after five, so any list is in place within a sixth of a second.
 */

:root {
    /* enter: fast out of the blocks, landing softly. The size of SizeTransition's easing. */
    --motion-ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
    --motion-duration-enter: 300ms;

    /* settle: spring(response 0.42s, damping 0.82), within 0.2% of rest at 540ms. */
    --motion-ease-settle: cubic-bezier(0.25, 0.9, 0.3, 1);
    --motion-duration-settle: 540ms;

    /* pop: spring(response 0.36s, damping 0.6), peaks 9.5% over, at rest by 560ms. */
    --motion-ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
    --motion-duration-pop: 560ms;

    /* A short ease-out, for what only fades in: a backdrop, a tooltip, a menu. */
    --motion-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --motion-duration-quick: 160ms;
    --motion-duration-fade: 200ms;

    /* A list's items arrive this far apart, counting no further than the cap. */
    --motion-stagger-step: 30ms;
    --motion-stagger-cap: 5;

    /* How far content rises as it arrives: felt more than seen. */
    --motion-rise: 0.25rem;
}

@supports (animation-timing-function: linear(0, 1)) {
    :root {
        --motion-ease-settle: linear(
            0,
            0.047,
            0.156,
            0.292,
            0.431,
            0.56,
            0.673,
            0.766,
            0.839,
            0.896,
            0.937,
            0.966,
            0.986,
            0.999,
            1.006,
            1.01,
            1.011,
            1.011,
            1.01,
            1.008,
            1.007,
            1.005,
            1.004,
            1.003,
            1
        );
        --motion-ease-pop: linear(
            0,
            0.047,
            0.162,
            0.314,
            0.476,
            0.632,
            0.77,
            0.883,
            0.969,
            1.031,
            1.069,
            1.089,
            1.095,
            1.09,
            1.079,
            1.065,
            1.049,
            1.035,
            1.022,
            1.011,
            1.003,
            0.997,
            0.993,
            0.992,
            0.991,
            0.991,
            0.993,
            0.994,
            0.995,
            0.997,
            1
        );
    }
}

/* Components */

/**
 * Nimbus Design System - Motion
 *
 * The movements everything else is built from, as keyframes and as classes to put on anything
 * that should move the same way. The design system's own components already use them (a table's
 * rows, an empty state's icon, a menu opening); reach for these before writing a keyframe of your
 * own. Values come from tokens/motion.css, which follows the iOS and Android apps.
 *
 * - .motion-arrive: fades in and rises a few pixels into place (enter). Give it --motion-index
 *   (0, 1, 2…) to come in after the ones before it, or put it in a .motion-stagger. Give it (or
 *   the list) --motion-delay to start later, after something that arrives first.
 * - .motion-stagger: its children arrive one after another, in order, up to the cap.
 * - .motion-pop: fades in and grows from --motion-pop-from (0.55) on the pop spring, for
 *   something small: an icon, a badge, a dot.
 * - .motion-fade: only fades in.
 * - .motion-wiggle: one small shake, for an empty state's picture.
 *
 * Built on the individual `translate`, `scale` and `rotate` properties rather than `transform`,
 * so they combine with each other and never undo a transform an element already has.
 *
 * Every animation runs once, as the element appears (it is mounted, or stops being
 * display: none), and holds nothing after: `backwards`, so an element is back to its own styles
 * the moment it lands. A re-render does not replay it.
 *
 * With reduced motion asked for, nothing moves: --motion-amount goes to 0, so arriving and
 * popping become a short fade, and the wiggle and ripple have nothing left to show. A keyframe of
 * your own should scale its movement by --motion-amount the same way.
 */

/* An element's place in its list is its own: what is inside a list's third row does not inherit
   that row's place and wait with it. --motion-delay is inherited, so a list can start late. */
@property --motion-index {
    syntax: "<integer>";
    inherits: false;
    initial-value: 0;
}

:root {
    /* How much of each movement plays: 1, or 0 with reduced motion (below). */
    --motion-amount: 1;
}

@keyframes motion-arrive {
    from {
        opacity: 0;
        translate: 0 calc(var(--motion-rise) * var(--motion-amount));
    }
}

/* Arriving from above: what drops down out of the place it hangs from (an expanding section). */
@keyframes motion-arrive-down {
    from {
        opacity: 0;
        translate: 0 calc(var(--motion-rise) * -0.8 * var(--motion-amount));
    }
}

@keyframes motion-pop {
    from {
        opacity: 0;
        scale: calc(1 - (1 - var(--motion-pop-from, 0.55)) * var(--motion-amount));
    }
}

@keyframes motion-fade {
    from {
        opacity: 0;
    }
}

/* The empty state's shake: the apps' phaseAnimator([0, -9, 7, -3, 0]), two thirds as far. */
@keyframes motion-wiggle {
    25% {
        rotate: calc(-6deg * var(--motion-amount));
    }
    50% {
        rotate: calc(4deg * var(--motion-amount));
    }
    75% {
        rotate: calc(-2deg * var(--motion-amount));
    }
}

/* A ring that spreads from something and fades: a step just reached, a value just changed. */
@keyframes motion-ripple {
    from {
        opacity: calc(0.55 * var(--motion-amount));
        scale: 1;
    }
    to {
        opacity: 0;
        scale: 1.22;
    }
}

/* What opens from a control: a menu, a list of options. Small, and quick. */
@keyframes motion-open {
    from {
        opacity: 0;
        scale: calc(1 - 0.03 * var(--motion-amount));
        translate: 0 calc(-0.25rem * var(--motion-amount));
    }
}

/* The same, opening upward from a control near the foot of the window. */
@keyframes motion-open-up {
    from {
        opacity: 0;
        scale: calc(1 - 0.03 * var(--motion-amount));
        translate: 0 calc(0.25rem * var(--motion-amount));
    }
}

/* Only the movement of something settling into place, for a surface that should be solid at once
   (a modal, a toast): pair it with a quick motion-fade, so it isn't see-through while it moves. */
@keyframes motion-settle-in {
    from {
        scale: calc(1 - 0.02 * var(--motion-amount));
        translate: 0 calc(var(--motion-rise) * var(--motion-amount));
    }
}

/* ==========================================
   CLASSES
   ========================================== */

.motion-arrive,
.motion-stagger > * {
    animation: motion-arrive var(--motion-duration-enter) var(--motion-ease-enter) backwards;
    animation-delay: calc(
        var(--motion-delay, 0ms) + min(var(--motion-index, 0), var(--motion-stagger-cap)) *
            var(--motion-stagger-step)
    );
}

.motion-pop {
    animation: motion-pop var(--motion-duration-pop) var(--motion-ease-pop) backwards;
    animation-delay: calc(
        var(--motion-delay, 0ms) + min(var(--motion-index, 0), var(--motion-stagger-cap)) *
            var(--motion-stagger-step)
    );
}

.motion-fade {
    animation: motion-fade var(--motion-duration-fade) var(--motion-ease-out) backwards;
}

.motion-wiggle {
    animation: motion-wiggle 560ms ease-in-out;
}

/* Each child's place in the line, counted from 0. Past the cap they all come in together. A
   table's rows are counted here too. */
:where(.motion-stagger, .table__body) > :nth-child(2) {
    --motion-index: 1;
}
:where(.motion-stagger, .table__body) > :nth-child(3) {
    --motion-index: 2;
}
:where(.motion-stagger, .table__body) > :nth-child(4) {
    --motion-index: 3;
}
:where(.motion-stagger, .table__body) > :nth-child(5) {
    --motion-index: 4;
}
:where(.motion-stagger, .table__body) > :nth-child(n + 6) {
    --motion-index: 5;
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    :root {
        --motion-amount: 0;
        --motion-duration-enter: var(--motion-duration-fade);
        --motion-ease-enter: ease-out;
        --motion-duration-settle: var(--motion-duration-fade);
        --motion-duration-pop: var(--motion-duration-fade);
        --motion-ease-settle: ease-out;
        --motion-ease-pop: ease-out;
        --motion-stagger-step: 0ms;
    }
}

/**
 * Nimbus Design System - Button Components
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Variants: Primary, Secondary, Ghost, Text
 * States: Default, Hover, Focus, Pressed, Disabled
 * Shape: Rounded rectangle (--radius-md / 8px)
 * Anatomy: Label + Optional Icons (leading/trailing)
 */

/* Base Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    /* Shared with the text input and the select, so a field and its button line up. */
    min-height: var(--control-height);
    /* Browsers size a <button> by its border box but a link by its content, so without this a
       link drawn as a button (<a class="btn">) adds its padding and border to that height. */
    box-sizing: border-box;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-default);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast);
}

/* :focus-visible rather than :focus, here and for each variant below: a button keeps focus
   after it is clicked, and a drawer or modal hands focus back to the button that opened it when
   it closes, so with :focus a mouse user's trigger stayed filled as if pressed until they clicked
   elsewhere. Keyboard focus still shows both the fill and the ring. */
.btn:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

/* Button with icon only (square/circle) */
.btn--icon-only {
    padding: var(--spacing-2);
    aspect-ratio: 1;
}

/* Round rather than a rounded square: an icon button that stands apart from a row of square
   ones, such as the way back beside a breadcrumb trail. */
.btn--round {
    border-radius: var(--radius-full);
}

/* ==========================================
   PRIMARY BUTTON
   High emphasis - main actions
   ========================================== */

.btn--primary {
    background-color: var(--bg-button-primary);
    border-color: var(--bg-button-primary);
    /* Not --text-invert: that tracks light-on-dark surfaces and flips to dark text in
       dark mode, where this button stays mid-grey and still needs white. */
    color: var(--text-button-primary);
}

.btn--primary:hover {
    background-color: color-mix(in srgb, var(--bg-button-primary) 85%, black);
    border-color: color-mix(in srgb, var(--bg-button-primary) 85%, black);
}

.btn--primary:focus-visible {
    background-color: color-mix(in srgb, var(--bg-button-primary) 80%, black);
    border-color: color-mix(in srgb, var(--bg-button-primary) 80%, black);
}

.btn--primary:active {
    background-color: color-mix(in srgb, var(--bg-button-primary) 70%, black);
    border-color: color-mix(in srgb, var(--bg-button-primary) 70%, black);
}

.btn--primary:disabled,
.btn--primary.btn--disabled {
    background-color: var(--bg-button-disable);
    border-color: var(--bg-button-disable);
    color: var(--text-disable);
    cursor: not-allowed;
}

/* ==========================================
   SECONDARY AND DANGER BUTTONS
   Medium emphasis - supporting actions. Danger is a secondary button for what can't be
   undone, removing or deleting: red at rest, so it reads as that before it is pressed, and
   filled as a secondary is once pointed at or pressed.
   ========================================== */

.btn--secondary,
.btn--danger {
    background-color: transparent;
    border-color: var(--border-20);
    color: var(--text-title);
}

.btn--danger {
    color: var(--color-fire);
}

.btn--secondary:hover,
.btn--danger:hover {
    background-color: var(--bg-button-primary);
    border-color: var(--bg-button-primary);
    color: var(--text-button-primary);
}

.btn--secondary:focus-visible,
.btn--danger:focus-visible {
    background-color: color-mix(in srgb, var(--bg-button-primary) 90%, black);
    border-color: color-mix(in srgb, var(--bg-button-primary) 90%, black);
    color: var(--text-button-primary);
}

.btn--secondary:active,
.btn--danger:active {
    background-color: color-mix(in srgb, var(--bg-button-primary) 80%, black);
    border-color: color-mix(in srgb, var(--bg-button-primary) 80%, black);
    color: var(--text-button-primary);
}

.btn--secondary:disabled,
.btn--secondary.btn--disabled,
.btn--danger:disabled,
.btn--danger.btn--disabled {
    background-color: transparent;
    border-color: var(--border-20);
    color: var(--text-disable);
    cursor: not-allowed;
}

/* ==========================================
   GHOST BUTTON
   Low emphasis - tertiary actions
   ========================================== */

.btn--ghost {
    background-color: transparent;
    border-color: transparent;
    color: var(--text-paragraph);
}

.btn--ghost:hover {
    background-color: var(--bg-button-primary);
    border-color: var(--bg-button-primary);
    color: var(--text-button-primary);
}

.btn--ghost:focus-visible {
    background-color: color-mix(in srgb, var(--bg-button-primary) 90%, black);
    border-color: color-mix(in srgb, var(--bg-button-primary) 90%, black);
    color: var(--text-button-primary);
}

.btn--ghost:active {
    background-color: color-mix(in srgb, var(--bg-button-primary) 80%, black);
    border-color: color-mix(in srgb, var(--bg-button-primary) 80%, black);
    color: var(--text-button-primary);
}

.btn--ghost:disabled,
.btn--ghost.btn--disabled {
    background-color: transparent;
    border-color: transparent;
    color: var(--text-disable);
    cursor: not-allowed;
}

/* ==========================================
   TEXT BUTTON
   A control that reads as the text around it: a person's name in a table row that opens out
   their details, say. No fill, frame or padding, and the size, weight and colour of where it
   sits, so it lines up with the plain text beside and below it. Its icon says what it does.
   ========================================== */

.btn--text {
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background-color: transparent;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    text-align: left;
}

.btn--text:hover {
    color: var(--text-title);
}

.btn--text:disabled,
.btn--text.btn--disabled {
    color: var(--text-disable);
    cursor: not-allowed;
}

/* ==========================================
   EXPAND BUTTON
   Shows or hides what is under it (ExpandButton): its chevron points down while that is shut
   and turns up while it is open, read from the aria-expanded it always carries.
   ========================================== */

.expand-button__chevron {
    transition: transform var(--transition-fast);
}

.expand-button[aria-expanded="true"] .expand-button__chevron {
    transform: rotate(180deg);
}

/* ==========================================
   BUTTON SIZES
   ========================================== */

.btn--sm {
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-xs);
}

.btn--lg {
    padding: var(--spacing-3) var(--spacing-6);
    font-size: var(--font-size-m);
}

/* ==========================================
   ICON BUTTON
   A small round button holding only an icon (or a letter), quiet until pointed at: the close in
   a bubble's corner, the tools along a card's edge. Give it an aria-label. Pressed, it fills;
   --danger turns it the fire red when pointed at, for one that removes something.
   ========================================== */

.btn--icon {
    width: 1.75rem;
    height: 1.75rem;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    background-color: transparent;
    color: var(--icon-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.btn--icon:hover:not(:disabled) {
    background-color: var(--bg-surface-secondary);
    color: var(--text-title);
}

.btn--icon:disabled {
    opacity: 0.35;
    cursor: default;
}

.btn--icon[aria-pressed="true"] {
    background-color: var(--bg-button-primary);
    color: var(--text-button-primary);
}

.btn--icon.btn--icon-danger:hover:not(:disabled) {
    color: var(--color-fire);
}

/* ==========================================
   BUTTON ICON ELEMENTS
   ========================================== */

.btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.btn__icon--leading {
    margin-right: calc(var(--spacing-1) * -1);
}

.btn__icon--trailing {
    margin-left: calc(var(--spacing-1) * -1);
}

/* ==========================================
   BUTTON GROUP
   ========================================== */

.btn-group {
    display: inline-flex;
    gap: var(--spacing-2);
}

.btn-group--vertical {
    flex-direction: column;
}

/**
 * Nimbus Design System - Breadcrumb
 *
 * Trail of ancestor links ending in the page being looked at.
 */

/* ==========================================
   TRAIL
   ========================================== */

.breadcrumb {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    /* A trail is usually a flex item beside a page's actions. Without this it keeps its
       content's width there, so a long crumb runs it off the page instead of clipping. */
    min-width: 0;
}

.breadcrumb__list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--spacing-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A long ancestor is capped, and clips at the cap. In a trail too long for its room an
   ancestor gives way too, down to the current crumb's minimum, so the trail fits rather
   than running past its container. A short one like "Users" goes no narrower than its own
   width (--crumb-natural, measured by the component), so it is never clipped at all. */
.breadcrumb__item {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    flex-shrink: 1;
    min-width: min(4rem, var(--crumb-natural, 4rem));
    max-width: 16rem;
}

/* The page being looked at gives way first, down to a few characters, so a long one clips
   before any ancestor does. Its shrink weight is so much larger that an ancestor's share is
   far below a pixel until this one is at its minimum, and only then do the ancestors give
   way. */
.breadcrumb__item:last-child {
    flex-shrink: 100000;
    min-width: 4rem;
    max-width: none;
}

/* A clipped crumb that is not a link takes focus, so its tooltip can be opened from the
   keyboard; the ring matches a link crumb's. */
.breadcrumb__item:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.breadcrumb__separator {
    color: var(--text-disable);
    flex: 0 0 auto;
    user-select: none;
}

/* ==========================================
   CRUMBS
   ========================================== */

/* A consumer's own anchor is styled alongside the component's, so a trail whose crumbs
   navigate through a router looks the same as one built from plain links. */
.breadcrumb__link,
.breadcrumb__item a {
    display: block;
    min-width: 0;
    color: var(--text-paragraph);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
    /* Clipped rather than wrapped: a trail is a single line of ancestry, and a wrapped
       crumb reads as two. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb__link:hover,
.breadcrumb__item a:hover {
    color: var(--text-title);
    text-decoration: underline;
}

/* Focus. The ring matches .btn, and is removed again for pointer focus so that a host
   which rings every anchor on :focus does not box a crumb that was merely clicked.

   Both :focus and :focus-visible are styled deliberately: where :focus-visible is
   unknown the browser drops both rules below, including the one inside :not(), and the
   component would fall back to whatever focus styling the host happens to apply. */
.breadcrumb__link:focus,
.breadcrumb__link:focus-visible,
.breadcrumb__item a:focus,
.breadcrumb__item a:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

.breadcrumb__link:focus:not(:focus-visible),
.breadcrumb__item a:focus:not(:focus-visible) {
    outline: none;
}

/* A crumb with nowhere to lead: shaped like a link, without the affordances of one. */
.breadcrumb__text {
    display: block;
    min-width: 0;
    color: var(--text-paragraph);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb__current {
    display: block;
    min-width: 0;
    color: var(--text-title);
    font-weight: var(--font-weight-semibold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/**
 * Nimbus Design System - Detail header
 *
 * The top of a page card that is reached from somewhere: the way back (BackTrail), and for a
 * record (DetailHeader) its name, mark, badge and description under it. The page card's header
 * lays the rows out and the breadcrumb styles the crumbs; only what is particular to them is here.
 */

/* The back control beside the crumbs. The crumbs give way and clip before anything across from
   them does. */
.back-trail {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: var(--spacing-3);
    min-width: 0;
}

/* Round, through the trail as well as its own class: a shell still loading an older copy of the
   buttons after this sheet would otherwise square it on order alone. */
.back-trail .back-trail__back {
    flex-shrink: 0;
    border-radius: var(--radius-full);
}

/* A crumb that is a button, not a link: stripped back to read as the linked crumbs do. */
.back-trail .breadcrumb__link {
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
}

/* The record's mark, then its name with its badge over its description. */
.detail-header__identity {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    min-width: 0;
}

.detail-header__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--spacing-2);
    min-width: 0;
}

.detail-header__text .card__section-title {
    overflow-wrap: anywhere;
}

/* A record's own description, typed in a field that keeps line breaks: shown with them. */
.detail-header__text .card__section-description {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* The name, and anything that goes beside it, wrapping under it when the name is long. */
.detail-header__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-2);
    min-width: 0;
}
/**
 * Nimbus Design System - Chip Components
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Sizes: Small, Medium, Large
 * States: Alarm (red), Warning (amber), Online (green), Offline (gray)
 * Shape: Pill (fully rounded)
 * Anatomy: Icon + Label + Optional Time
 *
 * Hierarchy (Traffic Light System):
 * - High emphasis: Alarm (red) - most important
 * - Medium emphasis: Warning/Fault (amber)
 * - Low emphasis: Online (green)
 * - Inactive: Offline (gray)
 */

/* ==========================================
   BASE CHIP
   ========================================== */

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    white-space: nowrap;
}

/* ==========================================
   CHIP SIZES
   ========================================== */

/* Small - icon only or minimal text */
.chip--sm {
    padding: var(--spacing-1);
    font-size: var(--font-size-xs);
}

.chip--sm.chip--has-text {
    padding: var(--spacing-1) var(--spacing-2);
}

/* Medium (default) */
.chip--md {
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-xs);
}

/* Large - with time display */
.chip--lg {
    padding: var(--spacing-2) var(--spacing-4);
    font-size: var(--font-size-sm);
}

/* ==========================================
   CHIP STATES / VARIANTS
   Traffic light system: Red > Amber > Green > Gray
   ========================================== */

/* Alarm - High emphasis (Red) */
.chip--alarm {
    background-color: #c62828;
    color: #ffffff;
}

.chip--alarm .chip__icon {
    color: #ffffff;
}

/* Warning/Fault - Medium emphasis (Amber) */
.chip--warning {
    background-color: transparent;
    color: #e65100;
    border: 1px solid currentColor;
}

.chip--warning .chip__icon {
    color: #e65100;
}

/* Online - Low emphasis (Green) */
.chip--online {
    background-color: #2e7d32;
    color: #ffffff;
}

.chip--online .chip__icon {
    color: #ffffff;
}

/* Offline - Inactive (Gray) */
.chip--offline {
    background-color: var(--bg-chip-filled);
    color: var(--text-paragraph);
}

.chip--offline .chip__icon {
    color: var(--icon-secondary);
}

/* Offline variant with red text (for emphasis when needed) */
.chip--offline-alert {
    background-color: #c62828;
    color: #ffffff;
}

/* ==========================================
   CHIP ELEMENTS
   ========================================== */

.chip__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.chip__label {
    flex-shrink: 0;
}

.chip__time {
    opacity: 0.9;
}

.chip__separator {
    opacity: 0.6;
}

/* ==========================================
   CHIP DISPLAY VARIANTS
   ========================================== */

/* Icon only */
.chip--icon-only {
    padding: var(--spacing-1);
    aspect-ratio: 1;
    justify-content: center;
}

/* Text only (no icon) */
.chip--text-only .chip__icon {
    display: none;
}

/* ==========================================
   CHIP GROUP / LIST
   ========================================== */

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
}

.chip-group--vertical {
    flex-direction: column;
    align-items: flex-start;
}

/* Chip stack for hierarchical display */
.chip-stack {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    align-items: flex-start;
}
/**
 * Nimbus Design System - Card Components
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Card Anatomy:
 * 1. Status chip (header)
 * 2. Information widget (data grid)
 * 3. Information expansion (tags)
 * 4. Actions (buttons)
 * 5. Timeline (status icons)
 */

/* ==========================================
   BASE CARD
   ========================================== */

.card {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card--elevated {
    box-shadow: var(--shadow-card);
    border: none;
}

/* ==========================================
   CARD SECTIONS
   ========================================== */

.card__header {
    padding: var(--spacing-4);
    padding-bottom: var(--spacing-2);
}

.card__body {
    padding: var(--spacing-4);
    padding-top: var(--spacing-2);
    padding-bottom: var(--spacing-2);
}

.card__footer {
    padding: var(--spacing-4);
    padding-top: var(--spacing-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-4);
    flex-wrap: wrap;
}

/* ==========================================
   ALERT CARD
   Specific layout for alert/event cards
   ========================================== */

.card--alert {
    gap: var(--spacing-2);
}

.card--alert .card__header {
    padding-bottom: var(--spacing-3);
}

/* ==========================================
   INFORMATION WIDGET
   Grid of labeled data fields
   ========================================== */

.card__info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-1);
}

.card__info-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    padding: var(--spacing-2) var(--spacing-3);
    background-color: var(--bg-surface-secondary);
    border-radius: var(--radius-sm);
    min-width: 80px;
}

/* As written: labels are sentence case, as every label is, rather than capitalised word by word. */
.card__info-label {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
}

.card__info-value {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--text-title);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   INFORMATION EXPANSION
   Row of tags/labels
   ========================================== */

.card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
}

.card__tag {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-1) var(--spacing-3);
    background-color: transparent;
    border: 1px solid var(--border-40);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
}

/* ==========================================
   CARD ACTIONS
   Button row at bottom
   ========================================== */

.card__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.card__actions--start {
    justify-content: flex-start;
}

.card__actions--end {
    justify-content: flex-end;
    margin-left: auto;
}

.card__actions--between {
    justify-content: space-between;
    width: 100%;
}

/* ==========================================
   TIMELINE / STATUS ICONS
   Row of status indicator icons
   ========================================== */

.card__timeline {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
}

.card__timeline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
}

.card__timeline-icon--active {
    background-color: var(--bg-button-primary);
    color: var(--text-button-primary);
}

.card__timeline-icon--inactive {
    background-color: var(--bg-surface-secondary);
    color: var(--icon-disable);
}

/* ==========================================
   CARD VARIANTS
   ========================================== */

/* Compact card - less padding */
.card--compact .card__header,
.card--compact .card__body,
.card--compact .card__footer {
    padding: var(--spacing-3);
}

.card--compact .card__header {
    padding-bottom: var(--spacing-1);
}

.card--compact .card__body {
    padding-top: var(--spacing-1);
    padding-bottom: var(--spacing-1);
}

.card--compact .card__footer {
    padding-top: var(--spacing-1);
}

/* Clickable card */
.card--clickable {
    cursor: pointer;
    transition:
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.card--clickable:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-60);
}

/* Selected card */
.card--selected {
    border-color: var(--border-brand);
    border-width: 2px;
}

/* ==========================================
   PAGE CARD
   A page's content on one surface: its heading, trail and tools in the header, ruled off
   from what they head. Keeps the base card's outline.
   ========================================== */

.card--page {
    border-radius: var(--radius-xl);
}

.card--page > .card__header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    padding: var(--spacing-6);
    border-bottom: 1px solid var(--border-20);
}

/* Tabs that end the header sit on its rule, which the selected tab's underline covers, so
   the header leaves no room under them. */
.card--page > .card__header:has(> .tabs:last-child) {
    padding-bottom: 0;
}

/* A heading with a toolbar across from it: the toolbar drops under the heading when the
   card is too narrow for both. */
.card--page .card__section-header {
    flex-wrap: wrap;
}

/* The toolbar fills the rest of the heading's row and gathers its tools at the far end. Left
   to shrink to fit, a wrapping row is only as wide as its widest tool (Chrome sizes it so),
   and the tools would stack under one another. The header spaces it, not its own margin. */
.card--page > .card__header .card__section-header > .list-toolbar {
    flex: 1 1 auto;
    margin-bottom: 0;
}

/* A search opened from its button (ToolbarSearch, toolbar.css) needs more than the room beside
   the heading: while it is open, its toolbar takes a row of its own under the heading. */
.card--page > .card__header .card__section-header > .list-toolbar:has(> .toolbar-search--open) {
    flex-basis: 100%;
}

.card--page > .card__body {
    padding: var(--spacing-6);
}

/* The tabs that switch the panels are in the header, and the body already pads them. */
.card--page > .card__body > .tab-panel {
    padding: 0;
}

/* ==========================================
   SECTION CARD
   One section of a page — a settings card, a module's settings — headed at 15px
   semibold, with no bands above or below and no rule under the heading.
   ========================================== */

.card--section {
    gap: var(--spacing-2);
    padding: var(--spacing-6);
    font-family: var(--font-family);
}

/* The heading and its description on one side, the section's action across from them. */
.card__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-4);
}

/* A step below the page title and a step above the text it heads. */
.card__section-title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-default);
    color: var(--text-title);
}

.card__section-description {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-default);
    color: var(--text-paragraph);
}

/* Held while what it describes loads ("3 sites"): a line's height with nothing in it, so the
   heading doesn't grow when it arrives. Mark it aria-hidden: there is nothing yet to say. */
.card__section-description--pending::before {
    content: "\a0";
}

/* ==========================================
   CARD — ARRIVING
   A page's card is the page's frame, and stays still as the page opens: what is in its body
   comes in, a few pixels, quickly. Cards drawn afresh for each of a record's tabs, as an
   organisation's are, so never blink as a whole. The body comes in from the side the tabs
   moved to (--tab-shift-x, set on the card by SlidingIndicator), and a record's page, opened
   from its row in a list (it has a way back), from the right, as a page pushed on in the apps
   does, so going into a record reads as going in.
   ========================================== */

.card--page > .card__body {
    animation: card-body-in var(--motion-duration-enter) var(--motion-ease-enter) backwards;
}

.card--page:has(> .card__header .back-trail) {
    --tab-shift-x: 1;
    --tab-shift-y: 0;
}

@keyframes card-body-in {
    from {
        opacity: 0;
        translate: calc(var(--tab-shift-x, 0) * 0.5rem * var(--motion-amount))
            calc(var(--tab-shift-y, 1) * var(--motion-rise) * var(--motion-amount));
    }
}

/**
 * Nimbus Design System - Form Controls
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Components: Checkbox, Radio, Switch/Toggle
 */

/* ==========================================
   CHECKBOX
   States: unchecked, checked, indeterminate
   ========================================== */

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
    user-select: none;
}

.checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox__box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-60);
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface-primary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox__box svg,
.checkbox__box::after {
    opacity: 0;
    transition: opacity var(--transition-fast);
}

/* Checked state. --checkbox-checked-color, set on the .checkbox, recolours checked and
   indeterminate (a red tick, say); unset, it is the primary button's fill. */
.checkbox__input:checked + .checkbox__box {
    background-color: var(--checkbox-checked-color, var(--bg-button-primary));
    border-color: var(--checkbox-checked-color, var(--bg-button-primary));
}

.checkbox__input:checked + .checkbox__box svg,
.checkbox__input:checked + .checkbox__box::after {
    opacity: 1;
    color: var(--text-invert);
}

/* Drawn checked, for a choice that is made without an input of its own: an option in a listbox
   that can hold several, whose aria-selected is what is chosen. Looks as a checked box does. */
.checkbox__box--checked {
    background-color: var(--bg-button-primary);
    border-color: var(--bg-button-primary);
}

.checkbox__box--checked svg,
.checkbox__box--checked::after {
    opacity: 1;
    color: var(--text-invert);
}

/* Drawn mixed, as the select-all row of a list with some of its options ticked: a dash. */
.checkbox__box--mixed {
    background-color: var(--bg-button-primary);
    border-color: var(--bg-button-primary);
}

/* Doubled up to outrank the checkmark fallback below, which would otherwise draw its tick. */
.checkbox__box.checkbox__box--mixed::after {
    content: "−";
    opacity: 1;
    color: var(--text-invert);
}

/* Checkmark icon fallback */
.checkbox__box::after {
    content: "✓";
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-invert);
}

.checkbox__input:checked + .checkbox__box::after {
    opacity: 1;
}

/* Indeterminate state */
.checkbox__input:indeterminate + .checkbox__box {
    background-color: var(--checkbox-checked-color, var(--bg-button-primary));
    border-color: var(--checkbox-checked-color, var(--bg-button-primary));
}

.checkbox__input:indeterminate + .checkbox__box::after {
    content: "−";
    opacity: 1;
}

/* Focus state */
.checkbox__input:focus-visible + .checkbox__box {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

/* Disabled state */
.checkbox__input:disabled + .checkbox__box {
    background-color: var(--bg-button-disable);
    border-color: var(--border-20);
    cursor: not-allowed;
}

.checkbox__input:disabled ~ .checkbox__label {
    color: var(--text-disable);
    cursor: not-allowed;
}

.checkbox__label {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
}

/* An indicator rather than a control: a disabled checkbox reporting a state that is changed
   elsewhere (what an organisation pays for, say). A disabled label is greyed almost out of
   sight, and the name is the part that has to be read, so it keeps a live label's colour; and
   a disabled box is greyed even when checked, leaving a white tick on near-white, so checked
   keeps its live fill and on and off are told apart by it rather than by a faint mark. */
.checkbox--indicator,
.checkbox--indicator .checkbox__input:disabled + .checkbox__box {
    cursor: default;
}

.checkbox--indicator .checkbox__input:disabled ~ .checkbox__label {
    color: var(--text-title);
    cursor: default;
}

.checkbox--indicator .checkbox__input:checked:disabled + .checkbox__box {
    background-color: var(--checkbox-checked-color, var(--bg-button-primary));
    border-color: var(--checkbox-checked-color, var(--bg-button-primary));
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.checkbox-group--horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing-4);
}

.checkbox-group__label {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
    margin-bottom: var(--spacing-1);
}

/* ==========================================
   RADIO
   States: unselected, selected
   ========================================== */

.radio {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
    user-select: none;
}

.radio__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio__circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-60);
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-primary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.radio__circle::after {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-full);
    background-color: var(--bg-button-primary);
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

/* Selected state */
.radio__input:checked + .radio__circle {
    border-color: var(--bg-button-primary);
}

.radio__input:checked + .radio__circle::after {
    opacity: 1;
    transform: scale(1);
}

/* Focus state */
.radio__input:focus-visible + .radio__circle {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

/* Disabled state */
.radio__input:disabled + .radio__circle {
    background-color: var(--bg-button-disable);
    border-color: var(--border-20);
    cursor: not-allowed;
}

.radio__input:disabled ~ .radio__label {
    color: var(--text-disable);
    cursor: not-allowed;
}

.radio__label {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.radio-group--horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing-4);
}

.radio-group__label {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
    margin-bottom: var(--spacing-1);
}

/* ==========================================
   SWITCH / TOGGLE
   States: on (green), off (gray)
   Sizes: l (large), sm (small)
   ========================================== */

.switch {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
    user-select: none;
}

.switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch__track {
    position: relative;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-full);
    background-color: var(--bg-chip-filled);
    transition: background-color var(--transition-fast);
    flex-shrink: 0;
}

.switch__handle {
    position: absolute;
    border-radius: var(--radius-full);
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-fast);
}

/* Large size (default) */
.switch__track {
    width: 2.75rem;
    height: 1.5rem;
}

.switch__handle {
    width: 1.25rem;
    height: 1.25rem;
    left: 0.125rem;
}

/* Small size */
.switch--sm .switch__track {
    width: 2rem;
    height: 1.125rem;
}

.switch--sm .switch__handle {
    width: 0.875rem;
    height: 0.875rem;
    left: 0.125rem;
}

/* On state */
.switch__input:checked + .switch__track {
    background-color: #4caf50;
}

.switch__input:checked + .switch__track .switch__handle {
    transform: translateX(1.25rem);
}

.switch--sm .switch__input:checked + .switch__track .switch__handle {
    transform: translateX(0.875rem);
}

/* Focus state */
.switch__input:focus-visible + .switch__track {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

/* Disabled state */
.switch__input:disabled + .switch__track {
    opacity: 0.5;
    cursor: not-allowed;
}

.switch__input:disabled ~ .switch__label {
    color: var(--text-disable);
    cursor: not-allowed;
}

.switch__label {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
}

/**
 * Nimbus Design System - Text Inputs
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Anatomy: Label, Input Field, Helper Text, Trailing Icon
 * Variants: Default, Search
 */

/* ==========================================
   ERROR COLOURS
   ========================================== */

/* A field in error: its border, and the message under it. The light theme's red is too dark to
   see against the dark theme's surfaces, so there the border takes the brighter fire red and
   the message is white: the red border beside it already says which field it is about. Set for
   both ways the dark theme applies, the system preference and a chosen theme. */
:root {
    --field-error-border: #c62828;
    --field-error-text: #c62828;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --field-error-border: var(--color-fire);
        --field-error-text: var(--text-title);
    }
}

[data-theme="dark"] {
    --field-error-border: var(--color-fire);
    --field-error-text: var(--text-title);
}

/* ==========================================
   INPUT FIELD WRAPPER
   ========================================== */

.input-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.input-field__label {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
}

/* A group's label, the legend of its fieldset (a set of radios or checkboxes): lined up with what
   it labels, without the browser's own inset, and with room under it. The fieldset's gap does not
   reach a legend, which is not one of its flex items. */
legend.input-field__label {
    padding: 0;
    margin-bottom: var(--spacing-2);
}

.input-field__helper {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--text-paragraph);
}

.input-field__helper--error {
    color: var(--field-error-text);
}

/* ==========================================
   INPUT CONTAINER
   ========================================== */

.input {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    /* The height of the button beside it. Sized by its content alone, a field falls short of
       a button's height by a few pixels — less with an icon, more without — and every toolbar
       that put the two side by side had to pad it out itself. */
    box-sizing: border-box;
    min-height: var(--control-height);
    padding: var(--spacing-2) var(--spacing-3);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-40);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.input:hover {
    border-color: var(--border-60);
}

/* Focus is a border recolour, deliberately without an outer ring. A ring drawn outside
   the border box is clipped wherever a field sits in a scroll container (a modal body,
   a drawer), and it reads as a double-weight edge beside any plainly-bordered control. */
.input:focus-within {
    border-color: var(--border-100);
}

/* Disabled state */
.input--disabled {
    background-color: var(--bg-button-disable);
    border-color: var(--border-20);
    cursor: not-allowed;
}

/* ==========================================
   INPUT ELEMENT
   ========================================== */

.input__field {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
    padding: 0;
    min-width: 0;
}

.input__field::placeholder {
    color: var(--text-disable);
}

.input__field:disabled {
    cursor: not-allowed;
    color: var(--text-disable);
}

/* ==========================================
   INPUT ICONS / TRAILING
   ========================================== */

.input__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-secondary);
    flex-shrink: 0;
}

.input__trailing {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    color: var(--text-paragraph);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
}

.input__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: none;
    background: transparent;
    color: var(--icon-secondary);
    cursor: pointer;
    padding: 0;
    border-radius: var(--radius-full);
    transition: background-color var(--transition-fast);
}

.input__clear:hover {
    background-color: var(--bg-surface-secondary);
    color: var(--text-title);
}

/* ==========================================
   SEARCH INPUT
   Collapsed until it is used: a grey fill with no outline at rest, so a toolbar's search
   reads quieter than the actions beside it. Focused, or holding a query, it opens out into
   the ordinary field, white and outlined, so a filter in force is plain to see. "Holding a
   query" is read from the placeholder being hidden, so give the field a placeholder.
   ========================================== */

.input--search {
    padding-left: var(--spacing-3);
    background-color: var(--bg-cs-bg);
    border-color: transparent;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast);
}

.input--search:focus-within,
.input--search:has(.input__field:not(:placeholder-shown)) {
    background-color: var(--bg-surface-primary);
}

/* Holding a query but not focused: outlined as a field at rest is. Focus keeps its own
   darker border from .input:focus-within. */
.input--search:has(.input__field:not(:placeholder-shown)):not(:focus-within) {
    border-color: var(--border-40);
}

.input--search .input__icon {
    order: -1;
    font-size: 0.875rem;
}

/* On the grey, the placeholder is the field's only label, so it is set as text rather than
   faded out as a hint. */
.input--search .input__field::placeholder {
    color: var(--text-paragraph);
}

/* ==========================================
   INPUT SIZES
   ========================================== */

.input--sm {
    padding: var(--spacing-1) var(--spacing-2);
}

.input--sm .input__field {
    font-size: var(--font-size-xs);
}

.input--lg {
    padding: var(--spacing-3) var(--spacing-4);
}

.input--lg .input__field {
    font-size: var(--font-size-m);
}

/* ==========================================
   TEXTAREA
   ========================================== */

.textarea {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-2) var(--spacing-3);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-40);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.textarea:hover {
    border-color: var(--border-60);
}

.textarea:focus-within {
    border-color: var(--border-100);
}

.textarea__field {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
    resize: vertical;
    min-height: 80px;
    padding: 0;
}

.textarea__field::placeholder {
    color: var(--text-disable);
}

/* ==========================================
   SELECT
   ========================================== */

.select {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    /* The height of a button and a text input, as .input explains. */
    box-sizing: border-box;
    min-height: var(--control-height);
    padding: var(--spacing-2) var(--spacing-3);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-40);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.select:hover {
    border-color: var(--border-60);
}

.select:focus-within {
    border-color: var(--border-100);
}

.select__field {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
    cursor: pointer;
    appearance: none;
    padding: 0;
    min-width: 0;
}

.select__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-secondary);
    flex-shrink: 0;
    pointer-events: none;
}

/* ==========================================
   ERROR STATE
   ========================================== */

/* After every field's own hover and focus rules, which it has to outrank at the same
   specificity. Hover and focus keep the red: a field in error never reads as fine while the
   pointer or the caret is on it. */
.input--error,
.input--error:hover,
.input--error:focus-within,
.textarea--error,
.textarea--error:hover,
.textarea--error:focus-within,
.select--error,
.select--error:hover,
.select--error:focus-within {
    border-color: var(--field-error-border);
}

/* ==========================================
   SELECT — STYLED LISTBOX
   The variant that draws its own option menu, for designs where the OS-rendered
   native list is not acceptable.
   ========================================== */

.select--listbox {
    /* The trigger owns the padding so its hit area covers the whole control. */
    padding: 0;
}

.select--open {
    border-color: var(--border-100);
}

.select--disabled {
    background-color: var(--bg-button-disable);
    border-color: var(--border-20);
    cursor: not-allowed;
}

.select__trigger {
    flex: 1;
    /* The trigger is the whole control's hit area, so it fills the box's height rather than
       centring inside it. */
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-3);
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
    text-align: left;
    cursor: inherit;
    min-width: 0;
}

/* The wrapper renders the focus ring via :focus-within, so the button must not
   draw its own — including against a global button:focus-visible outline. */
.select__trigger:focus,
.select__trigger:focus-visible {
    outline: none;
}

.select__trigger:disabled {
    cursor: not-allowed;
}

.select__value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select__value--placeholder {
    color: var(--text-disable);
}

.select__icon--open {
    transform: rotate(180deg);
}

.select__menu {
    /* Fixed, and positioned from the trigger's rect, so the menu escapes any
       ancestor that clips or scrolls — a modal body, for instance. */
    position: fixed;
    z-index: var(--z-menu);
    max-width: calc(100vw - 32px);
    max-height: 318px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* The menu recipe every list of choices follows: the items sit inset in a rounded
       card, so a highlighted one is a rounded row rather than a full-width band. */
    padding: var(--spacing-2);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-40);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
    box-sizing: border-box;
}

.select__option {
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

/* Hovered or reached by the keyboard: a soft grey row. */
.select__option--active {
    background-color: var(--bg-cs-bg);
}

/* The current choice reads as the same row, in the heavier weight, rather than a dark
   filled chip. */
.select__option--selected {
    background-color: var(--bg-cs-bg);
    font-weight: var(--font-weight-semibold);
}

/* Disabled is pale text and nothing else: no fill, no fade, and no hover. */
.select__option--disabled,
.select__option--disabled.select__option--active {
    color: var(--text-disable);
    background-color: transparent;
    cursor: not-allowed;
}
/**
 * Nimbus Design System - Content Switcher
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Segmented control with pill highlight
 * Variants: Text labels, Icon labels
 */

/* ==========================================
   CONTENT SWITCHER CONTAINER
   ========================================== */

.switcher {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-1);
    background-color: var(--bg-cs-bg);
    border-radius: var(--radius-full);
    gap: var(--spacing-1);
}

/* ==========================================
   SWITCHER ITEM
   ========================================== */

.switcher__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-1);
    padding: var(--spacing-1) var(--spacing-4);
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.switcher__item:hover {
    color: var(--text-title);
}

/* Selected state */
.switcher__item--selected {
    background-color: var(--bg-cs-highlight);
    color: var(--text-title);
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-sm);
}

/* Disabled state */
.switcher__item:disabled,
.switcher__item--disabled {
    color: var(--text-disable);
    cursor: not-allowed;
}

/* ==========================================
   SWITCHER ICON
   ========================================== */

.switcher__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
}

/* Icon-only variant */
.switcher__item--icon-only {
    padding: var(--spacing-2);
}

/* Across the whole width, its items sharing it equally. */
.switcher--fill {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.switcher--fill .switcher__item {
    flex: 1 1 0;
}

/* ==========================================
   SWITCHER SIZES
   ========================================== */

.switcher--sm {
    padding: 2px;
}

.switcher--sm .switcher__item {
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-xs);
}

.switcher--lg .switcher__item {
    padding: var(--spacing-2) var(--spacing-5);
    font-size: var(--font-size-m);
}

/**
 * Nimbus Design System - Sliding indicator
 *
 * The mark of what is chosen in a row of choices, as one element that slides from the choice
 * left to the one chosen (React: SlidingIndicator, which places it). Laid over its parent, which
 * must be positioned; what it looks like is the row's to say (tabs.css: an underline, a pill's
 * fill). Placed without sliding at first, and hidden while nothing is chosen.
 */

.sliding-indicator {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    pointer-events: none;
    transition: opacity var(--motion-duration-quick) var(--motion-ease-out);
}

/* Hidden while nothing in its row is chosen (the choice is in another row, say), fading out and
   back in rather than vanishing. */
.sliding-indicator[data-hidden] {
    opacity: 0;
}

.sliding-indicator[data-ready] {
    transition:
        opacity var(--motion-duration-quick) var(--motion-ease-out),
        translate var(--motion-duration-settle) var(--motion-ease-settle),
        width var(--motion-duration-settle) var(--motion-ease-settle),
        height var(--motion-duration-settle) var(--motion-ease-settle);
}

/**
 * Nimbus Design System - Tabs
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Underline style tabs
 * States: selected (bold + underline), unselected, inactive
 * Can have icon + text labels
 */

/* ==========================================
   TABS CONTAINER
   ========================================== */

.tabs {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    border-bottom: 1px solid var(--border-20);
}

.tabs--no-border {
    border-bottom: none;
}

/* ==========================================
   TAB ITEM
   ========================================== */

.tab {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-3);
    padding-bottom: calc(var(--spacing-2) - 2px);
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text-title);
}

/* Focus. The ring matches .btn, inset rather than offset so it does not collide with
   the strip's own bottom border, and is removed again for pointer focus — the selected
   underline already answers which tab is chosen, and a host that rings every button on
   :focus would otherwise box it.

   Both :focus and :focus-visible are styled deliberately: where :focus-visible is
   unknown the browser drops both rules below, including the one inside :not(), and the
   component would fall back to whatever focus styling the host happens to apply. */
.tab:focus,
.tab:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
}

.tab:focus:not(:focus-visible) {
    outline: none;
    /* Square again with the ring gone. The corners are only rounded to shape the ring, and
       the selected underline is this element's own bottom border, so a radius left behind
       after a click curves its ends. */
    border-radius: 0;
}

/* Selected state */
.tab--selected {
    color: var(--text-title);
    font-weight: var(--font-weight-bold);
    border-bottom-color: var(--border-100);
}

/* Inactive/disabled state: pale text and nothing else, no fill, no fade and no hover, against
   the global button:disabled a host may set too (the shell's fills and fades every disabled
   button). Doubled to outweigh that rule's element and pseudo-class. */
.tab.tab--inactive,
.tab:disabled {
    color: var(--text-disable);
    background: transparent;
    opacity: 1;
    cursor: not-allowed;
}

.tab.tab--inactive:hover,
.tab:disabled:hover {
    color: var(--text-disable);
}

/* ==========================================
   TAB ICON
   ========================================== */

.tab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* ==========================================
   TAB MORE / OVERFLOW
   ========================================== */

.tab--more {
    color: var(--text-paragraph);
}

.tab--more .tab__icon {
    margin-left: var(--spacing-1);
}

/* ==========================================
   TABS VARIANTS
   ========================================== */

/* Compact tabs */
.tabs--compact .tab {
    padding: var(--spacing-1) var(--spacing-2);
    padding-bottom: calc(var(--spacing-1) - 2px);
    font-size: var(--font-size-xs);
}

/* Flush tabs: no padding at the sides, so the first label lines up with the heading above it
   and the selected underline is as wide as its label. The gap between labels takes the
   spacing the padding gave. */
.tabs--flush {
    gap: var(--spacing-6);
}

.tabs--flush .tab {
    padding-left: 0;
    padding-right: 0;
}

/* Pill tabs (no underline, background highlight) */
.tabs--pill {
    border-bottom: none;
    background-color: var(--bg-surface-secondary);
    padding: var(--spacing-1);
    border-radius: var(--radius-md);
    gap: var(--spacing-1);
}

.tabs--pill .tab {
    border-bottom: none;
    margin-bottom: 0;
    border-radius: var(--radius-sm);
    padding: var(--spacing-1) var(--spacing-3);
}

.tabs--pill .tab--selected {
    background-color: var(--bg-surface-primary);
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   TAB PANEL (content area)
   ========================================== */

.tab-panel {
    padding: var(--spacing-4) 0;
    /* A tab's content comes in as the tab is chosen, as one quick change: shown again after
       being hidden plays it too. */
    animation: tab-panel-in var(--motion-duration-fade) var(--motion-ease-enter) backwards;
}

.tab-panel[hidden] {
    display: none;
}

/* ==========================================
   TABS — CHOOSING
   The chosen tab's mark, its underline or a pill tab's fill, is one element (SlidingIndicator)
   that slides from the tab left to the one chosen on the settle spring, and draws out from its
   middle when the tabs first appear. The tabs' own underline and fill give way to it while it
   is there; without it (before it has measured, or in a test) they show as they always have.
   ========================================== */

.tabs {
    position: relative;
}

.tabs > .sliding-indicator {
    border-bottom: 2px solid var(--border-100);
    animation: tab-underline-in var(--motion-duration-settle) var(--motion-ease-settle) backwards;
}

.tabs:has(> .sliding-indicator:not([data-hidden])) > .tab--selected {
    border-bottom-color: transparent;
}

/* Drawn afresh where the same tabs were a moment ago, it slides on from there instead. */
.tabs > .sliding-indicator[data-carried] {
    animation: none;
}

.tabs--pill > .sliding-indicator {
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface-primary);
    box-shadow: var(--shadow-sm);
    animation-name: motion-fade;
}

.tabs--pill:has(> .sliding-indicator:not([data-hidden])) > .tab--selected {
    background-color: transparent;
    box-shadow: none;
}

@keyframes tab-underline-in {
    from {
        opacity: 0;
        scale: calc(1 - 0.6 * var(--motion-amount)) 1;
    }
}

/* What is in a panel comes with it, in one movement, rather than in a cascade of its own on top:
   its rows and tiles don't stagger or rise as the panel comes in. */
.tab-panel > * {
    --motion-stagger-step: 0ms;
    --motion-rise: 0px;
}

/* A panel comes in from the side the selection moved to (--tab-shift-x, which SlidingIndicator
   sets on what holds the tabs and their panels), a little way, as the apps' tabs slide; shown
   any other way it rises, as everything arriving does. */
@keyframes tab-panel-in {
    from {
        opacity: 0;
        translate: calc(var(--tab-shift-x, 0) * 0.375rem * var(--motion-amount))
            calc(var(--tab-shift-y, 1) * var(--motion-rise) * var(--motion-amount));
    }
}
/**
 * Nimbus Design System - Notifications / Toasts
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Anatomy: Icon, Title, Description, Action Button, Close Button
 * Style: Dark background, pill-shaped
 */

/* ==========================================
   NOTIFICATION / TOAST
   ========================================== */

.notification {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    /* The icon's disc sits as far from the left end as from the top, so the end's curve runs
       round it; the close button, smaller, sits a little further in from the right. */
    padding: var(--spacing-3) var(--spacing-4) var(--spacing-3) var(--spacing-3);
    background-color: #232933;
    /* A full pill for a notice of one line, or a line and a description: its height is under
       twice this, so the ends are as round as they can be, and their curve runs round the
       icon's disc. A message that wraps further keeps this radius at its corners, close to the
       disc's and its margin (1.75rem), so it reads as the same shape grown taller, not as an
       ellipse. */
    border-radius: 2rem;
    color: #ffffff;
    /* Never wider than the screen, less a margin either side: a toast on a phone is cut off
       otherwise, its start off the left edge. */
    max-width: min(480px, calc(100vw - 2 * var(--spacing-4)));
    box-sizing: border-box;
    box-shadow: var(--shadow-lg);
}

/* ==========================================
   NOTIFICATION ICON
   ========================================== */

.notification__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* Icon variants */
.notification__icon--error {
    background-color: #c62828;
    color: #ffffff;
}

.notification__icon--warning {
    background-color: #e65100;
    color: #ffffff;
}

.notification__icon--success {
    background-color: #2e7d32;
    color: #ffffff;
}

.notification__icon--info {
    background-color: #1565c0;
    color: #ffffff;
}

/* ==========================================
   NOTIFICATION CONTENT
   ========================================== */

.notification__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification__title {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: #ffffff;
    /* The whole message shows, wrapped, and can be selected and copied. */
    overflow-wrap: anywhere;
    user-select: text;
}

.notification__description {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.7);
    overflow-wrap: anywhere;
    user-select: text;
}

/* ==========================================
   NOTIFICATION ACTIONS
   ========================================== */

.notification__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    flex-shrink: 0;
}

.notification__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-1) var(--spacing-3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: #ffffff;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.notification__action:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.notification__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.notification__close:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   NOTIFICATION VARIANTS
   ========================================== */

/* Compact - no description */
.notification--compact {
    padding: var(--spacing-2) var(--spacing-3);
}

.notification--compact .notification__icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Light theme notification */
.notification--light {
    background-color: var(--bg-surface-primary);
    color: var(--text-title);
    border: 1px solid var(--border-20);
}

.notification--light .notification__title {
    color: var(--text-title);
}

.notification--light .notification__description {
    color: var(--text-paragraph);
}

.notification--light .notification__action {
    color: var(--text-title);
    border-color: var(--border-40);
}

.notification--light .notification__action:hover {
    background-color: var(--bg-surface-secondary);
}

.notification--light .notification__close {
    color: var(--icon-secondary);
}

.notification--light .notification__close:hover {
    color: var(--text-title);
    background-color: var(--bg-surface-secondary);
}

/* ==========================================
   NOTIFICATION CONTAINER (for stacking)
   ========================================== */

.notification-container {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    z-index: var(--z-tooltip);
    pointer-events: none;
}

.notification-container > * {
    pointer-events: auto;
}

/* Position variants */
.notification-container--top-right {
    top: var(--spacing-4);
    right: var(--spacing-4);
}

.notification-container--top-center {
    top: var(--spacing-4);
    left: 50%;
    transform: translateX(-50%);
}

.notification-container--bottom-right {
    bottom: var(--spacing-4);
    right: var(--spacing-4);
}

.notification-container--bottom-center {
    bottom: var(--spacing-4);
    left: 50%;
    transform: translateX(-50%);
}

/* Top right, just under the shell's pill bar, which is fixed over that corner: the place every
   module's notices appear, so none sits behind the bar. */
.notification-container--below-pill-bar {
    top: calc(var(--spacing-5) + var(--pill-bar-height) + var(--spacing-2));
    right: var(--spacing-5);
    /* Several stack here, oldest first. Each keeps its gap as a margin rather than the
       container's, so one leaving takes its gap with it as it closes up. */
    gap: 0;
    align-items: flex-end;
}

.notification-container--below-pill-bar > .notification {
    margin-bottom: var(--spacing-2);
}

/* On a phone the margin each side is the same, the notice being as wide as the screen allows. */
@media (max-width: 640px) {
    .notification-container--below-pill-bar {
        right: var(--spacing-4);
    }
}

/* ==========================================
   NOTIFICATION — ARRIVING
   A toast drops in under the pill bar, a little smaller to start with, and its icon pops just
   after, as the apps' toasts do. One in a container at the foot of the window rises instead. A
   notification set in the page simply arrives.
   ========================================== */

@keyframes notification-drop-in {
    from {
        scale: calc(1 - 0.04 * var(--motion-amount));
        translate: 0 calc(-0.5rem * var(--motion-amount));
    }
}

.notification {
    animation: motion-arrive var(--motion-duration-enter) var(--motion-ease-enter) backwards;
}

/* A toast is a thing put in front of the page: solid almost at once, it lands on the settle
   spring. */
.notification-container > .notification {
    transform-origin: top center;
    animation:
        motion-fade var(--motion-duration-quick) var(--motion-ease-out) backwards,
        notification-drop-in var(--motion-duration-settle) var(--motion-ease-settle) backwards;
}

:is(.notification-container--bottom-right, .notification-container--bottom-center) > .notification {
    transform-origin: bottom center;
    animation:
        motion-fade var(--motion-duration-quick) var(--motion-ease-out) backwards,
        motion-settle-in var(--motion-duration-settle) var(--motion-ease-settle) backwards;
}

.notification__icon {
    --motion-pop-from: 0.5;
    animation: motion-pop var(--motion-duration-pop) var(--motion-ease-pop) 50ms backwards;
}

/* ==========================================
   NOTIFICATION — LEAVING
   A toast leaves as it arrived, in reverse: it lifts a little and shrinks as it fades, and
   closes up its own height and gap, so those below slide into its place rather than jumping.
   The height is set by the toast itself (--notification-height) as it starts leaving.
   ========================================== */

@keyframes notification-lift-out {
    60% {
        opacity: 0;
    }
    to {
        opacity: 0;
        scale: calc(1 - 0.04 * var(--motion-amount));
        translate: 0 calc(-0.5rem * var(--motion-amount));
        margin-bottom: calc(-1 * var(--notification-height, 0px));
    }
}

/* With reduced motion asked for, it only fades; the others move up once it has gone. */
@keyframes notification-fade-out {
    to {
        opacity: 0;
    }
}

.notification-container > .notification--leaving {
    pointer-events: none;
    animation: notification-lift-out var(--motion-duration-enter) var(--motion-ease-enter) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .notification-container > .notification--leaving {
        animation: notification-fade-out var(--motion-duration-fade) var(--motion-ease-out) forwards;
    }
}

/**
 * Nimbus Design System - Inline Messages
 *
 * In-flow feedback attached to a specific piece of UI: a failed save, a validation
 * summary, a retryable load. Unlike a notification it takes up layout space beside
 * whatever it describes and stays until the state that caused it clears.
 */

/* ==========================================
   INLINE MESSAGE
   ========================================== */

.inline-message {
    /* Every tint below is mixed from this one accent, so a variant only has to
       restate the colour. */
    --inline-message-accent: #c62828;

    display: flex;
    align-items: flex-start;
    gap: var(--spacing-3);
    padding: var(--spacing-4);
    /* The palette has no error or warning surfaces, so the accent is tinted into the
       card background and softened for the border, which holds up in either theme. */
    background-color: color-mix(
        in srgb,
        var(--inline-message-accent) 10%,
        var(--bg-surface-primary)
    );
    border: 1px solid color-mix(in srgb, var(--inline-message-accent) 45%, transparent);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
}

/* ==========================================
   INLINE MESSAGE VARIANTS
   ========================================== */

.inline-message--error {
    --inline-message-accent: #c62828;
}

.inline-message--warning {
    --inline-message-accent: #e65100;
}

.inline-message--success {
    --inline-message-accent: #2e7d32;
}

.inline-message--info {
    --inline-message-accent: #1565c0;
}

/* ==========================================
   INLINE MESSAGE ICON
   ========================================== */

.inline-message__icon {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--inline-message-accent);
    /* Sized against the message and nudged onto its first line, rather than centred on
       a block whose height changes when the text wraps. */
    font-size: 1.125rem;
    margin-top: 0.0625rem;
}

/* ==========================================
   INLINE MESSAGE CONTENT
   ========================================== */

.inline-message__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
}

.inline-message__title {
    font-weight: var(--font-weight-bold);
}

.inline-message__text {
    margin: 0;
}

/* ==========================================
   INLINE MESSAGE ACTION
   ========================================== */

.inline-message__action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-1) var(--spacing-3);
    border: 1px solid var(--inline-message-accent);
    border-radius: var(--radius-full);
    background: transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: var(--text-title);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    white-space: nowrap;
}

.inline-message__action:hover {
    background-color: color-mix(in srgb, var(--inline-message-accent) 15%, transparent);
}

.inline-message__action:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

/* ==========================================
   INLINE MESSAGE VARIANTS - SIZE
   ========================================== */

/* Compact - for dense surfaces such as drawers and modals */
.inline-message--compact {
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-3);
}

.inline-message--compact .inline-message__icon {
    font-size: 1rem;
}

/* A message arrives where it is needed rather than appearing in place (motion.css). */
.inline-message {
    animation: motion-arrive var(--motion-duration-enter) var(--motion-ease-enter) backwards;
}
/**
 * Nimbus Design System - Table
 *
 * Listings of records: sites, users, groups. The default variant is a plain grid; the
 * "rows" variant gives each record its own surface separated by a gap, so a row reads as an
 * object you act on; the "bordered" variant frames the grid and rules every row, for a
 * listing that sits inside a page's card.
 */

/* ==========================================
   TABLE
   ========================================== */

.table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
}

.table__header-cell {
    padding: var(--spacing-3) var(--spacing-4);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--text-paragraph);
    background-color: var(--bg-cs-bg);
    /* A header is a word or two, and a wrapped one doubles the height of the whole row. */
    white-space: nowrap;
}

.table__row-header,
.table__cell {
    padding: var(--spacing-4);
    text-align: left;
    /* A row header identifies its row; it should not also shout. */
    font-weight: var(--font-weight-regular);
    vertical-align: middle;
}

/* A count badge never breaks. */
.table .badge {
    white-space: nowrap;
}

/* A tag stays on one line where it fits, and a column is sized for the English label. A
   longer translation ("Administrador de la organización") wraps between its words inside the
   tag rather than running out of the column. */
.table .info-tag {
    max-width: 100%;
    white-space: normal;
}

/* A value that is not there, muted so a column of them does not read as content. */
.table__empty {
    color: var(--text-disable);
}

/* ==========================================
   TABLE — FIXED LAYOUT
   ========================================== */

/* The columns share out the table's width rather than each taking what its longest value
   asks for, so one long value cannot push every column after it off the side. Values clip
   instead (Table.Text / .truncated-text). The consumer sizes the columns that hold short
   values, and gives the table a min-width to scroll below rather than squeeze past
   reading, inside a .table-scroll wrapper. */
.table--fixed {
    table-layout: fixed;
}

/* Wraps a table that may be wider than the room it gets, or longer: one longer than the window
   scrolls in here rather than with the page, so its header can stay in view (below). A page that
   knows the room it has says so with --table-scroll-max-height; the default leaves the window's
   height less the pill bar, a card's heading and toolbar, and the pagination under the table. */
.table-scroll {
    overflow: auto;
    max-height: calc(100vh - var(--table-scroll-offset, 15rem));
    max-height: var(--table-scroll-max-height, calc(100dvh - var(--table-scroll-offset, 15rem)));
    /* A row brought into view (Shift+Tab to one above) stops under the header, not behind it:
       the header row's height (2.55rem, one line of small text and its padding) and a little. */
    scroll-padding-top: 3rem;
}

/* The header stays at the top of the table while its rows scroll under it. Opaque already (its
   band), and above the rows, whose hover fills would otherwise paint over it. */
.table-scroll .table__header-cell {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* ==========================================
   TABLE — ROWS ARRIVING
   A table's rows come in one after another as they load, as a list does in the apps, and each
   row added later (a new alert, the next page) arrives the same way. Rows already shown don't
   move again when the table re-renders. The stagger is capped (motion.css), so a long table is
   in place as quickly as a short one. Skeleton rows only fade, so loading doesn't bounce.
   .table--static keeps every row still, for a table that rebuilds its rows as it updates.
   ========================================== */

.table__body > .table__row {
    animation: motion-arrive var(--motion-duration-enter) var(--motion-ease-enter) backwards;
    animation-delay: calc(
        var(--motion-delay, 0ms) + min(var(--motion-index, 0), var(--motion-stagger-cap)) *
            var(--motion-stagger-step)
    );
}

.table__body--skeleton > .table__row {
    animation-name: motion-fade;
}

/* A row's detail, opened under it, grows open out of the row at once, however far down the
   table it is, rather than waiting its place in the line: its cells' padding and what is in them
   ease up from nothing, so the rows below move down rather than jump.
   Browsers that can't ease to an auto height (interpolate-size) only fade it in. */
.table__body > .table__row--detail {
    animation: none;
}

.table__body > .table__row--detail > * {
    animation: table-detail-cell-open var(--motion-duration-enter) var(--motion-ease-enter)
        backwards;
}

.table__body > .table__row--detail > * > * {
    interpolate-size: allow-keywords;
    animation: table-detail-open var(--motion-duration-enter) var(--motion-ease-enter) backwards;
}

@keyframes table-detail-cell-open {
    from {
        padding-block: 0;
    }
}

@keyframes table-detail-open {
    from {
        overflow: clip;
        height: 0;
        opacity: 0;
    }
    to {
        overflow: clip;
        height: auto;
    }
}

/* With reduced motion it only fades in, at its full height. */
@media (prefers-reduced-motion: reduce) {
    .table__body > .table__row--detail > * {
        animation: none;
    }

    .table__body > .table__row--detail > * > * {
        animation-name: motion-fade;
    }
}

.table--static .table__body > .table__row {
    animation: none;
}

/* ==========================================
   TABLE — INTERACTIVE ROWS
   ========================================== */

/* A row that opens what it lists (Table.Row onActivate) has to look like it does. */
.table__row--interactive {
    cursor: pointer;
}

/* Painted on the cells, not the row: the rows variant sets each row's own background at a
   specificity a hover rule on the row cannot reach, but nothing paints the cells, so they
   win on top of it. The end cells also carry the row's rounded corners. */
.table__row--interactive > * {
    transition: background-color var(--transition-fast);
}

.table__body .table__row--interactive:hover > *,
.table__body .table__row--interactive:focus-visible > * {
    background-color: var(--bg-surface-secondary);
}

/* Inset, because the rows variant leaves a gap between rows and an offset ring would sit
   in it. */
.table__row--interactive:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: -2px;
}

/* ==========================================
   TABLE — BORDERED VARIANT
   ========================================== */

/* One framed surface: the header on its band, a rule under every row but the last, which
   the frame closes. Separated borders rather than collapsed, because a collapsed table
   cannot be rounded; each cell draws only its right and bottom edges, so no rule is drawn
   twice. On the table itself, or on the .table-scroll around it (below). */
.table--bordered {
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-md);
}

.table--bordered .table__header-cell {
    border-bottom: 1px solid var(--border-20);
}

/* Inside a .table-scroll the frame is the scroll box's, not the table's: a table frame would
   scroll its top edge and corners away with the first rows while the header stayed put. The box
   clips the grid to its rounded corners, so the corner cells need no radii of their own. */
.table-scroll:has(> .table--bordered) {
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-md);
}

.table-scroll > .table--bordered {
    border: none;
    border-radius: 0;
}

.table--bordered .table__body .table__row:not(:last-child) > * {
    border-bottom: 1px solid var(--border-20);
}

/* The header's band and a hovered row's fill are painted on the cells, and would square
   off the frame's corners, so the corner cells are rounded inside it. */
.table--bordered .table__header-cell:first-child {
    border-top-left-radius: calc(var(--radius-md) - 1px);
}

.table--bordered .table__header-cell:last-child {
    border-top-right-radius: calc(var(--radius-md) - 1px);
}

.table--bordered .table__body .table__row:last-child > *:first-child {
    border-bottom-left-radius: calc(var(--radius-md) - 1px);
}

.table--bordered .table__body .table__row:last-child > *:last-child {
    border-bottom-right-radius: calc(var(--radius-md) - 1px);
}

/* ==========================================
   TABLE — DETAIL ROWS
   ========================================== */

/* A row's details, opened under it: an edit's fields under the edit, say. They read as one with
   the row above them: no rule between it and them, on a quiet band, a little tighter than a row,
   at the table's own size and colour so they are as easy to read as the row. The detail rows take
   .table__row--detail; the row they belong to needs nothing. Through .table as well, to outrank
   the bordered variant's rule. */
.table .table__body .table__row:has(+ .table__row--detail) > *,
.table .table__body .table__row--detail:has(+ .table__row--detail) > * {
    border-bottom-color: transparent;
}

.table .table__body .table__row--detail > * {
    padding-top: var(--spacing-2);
    padding-bottom: var(--spacing-2);
    background-color: var(--bg-surface-secondary);
}

/* The band is the hover's colour, so a detail that opens something darkens a step further. */
.table .table__body .table__row--detail.table__row--interactive:hover > *,
.table .table__body .table__row--detail.table__row--interactive:focus-visible > * {
    background-color: var(--bg-cs-bg);
}

/* ==========================================
   TABLE — ROWS VARIANT
   ========================================== */

/* Each record sits on its own surface, so the rows need to be separated rather than
   ruled. border-spacing only applies to a separated border model. */
.table--rows {
    border-collapse: separate;
    border-spacing: 0 var(--spacing-2);
}

.table--rows .table__body .table__row {
    background-color: var(--bg-surface-primary);
}

/* Radii go on the end cells: a <tr> cannot be rounded in a separated border model. */
.table--rows .table__header-cell:first-child,
.table--rows .table__body .table__row > *:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.table--rows .table__header-cell:last-child,
.table--rows .table__body .table__row > *:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* The access grid: people down the side, sites across the top under their branches; scrolls inside
   itself, the names staying in view as it scrolls sideways. Each square has its symbol, its word
   and its colour: green keeps, blue gains, orange-red loses. */
.access-grid {
    --access-grid-keeps: light-dark(#2e7d32, #a5d6a7);
    --access-grid-gains: light-dark(#1565c0, #90caf9);
    --access-grid-loses: light-dark(#c2410c, #ffab91);

    display: grid;
    gap: var(--spacing-3);
    min-width: 0;
}

.access-grid__note {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
}

.access-grid__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-2);
}

.access-grid__limit,
.access-grid__empty {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
}

.access-grid__scroll {
    max-height: min(70vh, 40rem);
    overflow: auto;
    border: 1px solid var(--border-20);
    border-radius: var(--radius-md);
}

.access-grid__table {
    border-collapse: separate;
    border-spacing: 0;
}

.access-grid__table th,
.access-grid__table td {
    padding: var(--spacing-1) var(--spacing-2);
    border-bottom: 1px solid var(--border-20);
    text-align: start;
    vertical-align: top;
    white-space: nowrap;
}

.access-grid__table thead th {
    background-color: var(--bg-surface-secondary);
    color: var(--text-title);
    font-weight: var(--font-weight-semibold);
}

.access-grid__name {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: var(--bg-surface-primary);
}

.access-grid__toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.access-grid__count {
    margin-left: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.access-grid__square,
.access-grid__apps,
.access-grid__bell {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    margin-right: var(--spacing-1);
    font-weight: var(--font-weight-semibold);
}

.access-grid__square--keeps {
    color: var(--access-grid-keeps);
}

.access-grid__square--gains,
.access-grid__apps--gains {
    color: var(--access-grid-gains);
}

.access-grid__square--loses,
.access-grid__apps--loses {
    color: var(--access-grid-loses);
}

.access-grid__bell {
    color: var(--text-paragraph);
}

.access-grid__marked > th,
.access-grid__marked > td {
    background-color: var(--bg-surface-secondary);
}

/* ==========================================
   SIZE TRANSITION
   Content that changes height (a skeleton giving way to the rows, or to nothing) eases to its
   new size, and new content fades in. Barely there: it should be felt more than seen.
   ========================================== */

.size-transition {
    transition: height 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Clipped only while it moves: menus and tooltips inside aren't cut off the rest of the time. */
.size-transition--moving {
    overflow: hidden;
}

/* Backwards rather than both, and the translate property rather than transform, so once it has
   faded in the content holds no transform: nothing inside is pinned to it as if it were the
   window, and nothing has to sit in a layer of its own. */
.size-transition__content {
    animation: size-transition-in 220ms ease-out backwards;
}

@keyframes size-transition-in {
    from {
        opacity: 0;
        translate: 0 calc(3px * var(--motion-amount));
    }
}

@media (prefers-reduced-motion: reduce) {
    /* The content still fades in (motion.css takes its rise to nothing); the height jumps. */
    .size-transition {
        transition: none;
    }

    /* No transition to end it: nothing is ever clipped. */
    .size-transition--moving {
        overflow: visible;
    }
}

/**
 * Nimbus Design System - Skeleton
 *
 * A grey shape where something is still loading, softly pulsing: the size of what is coming, so
 * nothing moves when it arrives. One look everywhere, from a widget's rows to a table's cells.
 *
 * Anatomy: .skeleton, sized by what it stands in for (--row, --stat, --card, --text)
 */

.skeleton {
    display: block;
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface-secondary);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

/* In place of a widget-row. */
.skeleton--row {
    height: 2.75rem;
}

/* In place of a widget-stat. */
.skeleton--stat {
    height: 5.5rem;
}

/* In place of a whole card on a board: the card's own corners. */
.skeleton--card {
    border-radius: var(--radius-2xl);
}

/* In place of a line of text, such as a table cell's value. Give it a width. */
.skeleton--text {
    height: 0.75rem;
    max-width: 100%;
    border-radius: var(--radius-full);
}

/* In place of a line of text inside the element that will hold it (a widget's row label, a
   stat's value): a bar the text's size, beside a non-breaking space, so the element keeps the
   line's own height and what loads takes the same room (WidgetRowsSkeleton). Give it a width. */
.skeleton--line {
    display: inline-block;
    max-width: 100%;
    height: 0.75em;
    vertical-align: middle;
    border-radius: var(--radius-full);
}

@keyframes skeleton-pulse {
    50% {
        opacity: 0.55;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
    }
}

/**
 * Nimbus Design System - Utilities
 *
 * Single-purpose classes that aren't a component of their own.
 */

/* Read out but not shown: kept in the accessibility tree, unlike display: none. For a label a
   screen reader needs that the eye gets another way (an icon, a heading drawn elsewhere). */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
/**
 * Nimbus Design System - Tooltip
 *
 * A short label shown on hover or focus, and the whole of a value that has been clipped
 * for room. One look and one behaviour everywhere: React consumers get both from
 * <Tooltip>, <TruncatedText> and Table.Text, which place the tooltip in the body so no
 * clipping container can cut it off.
 */

/* ==========================================
   TOOLTIP
   ========================================== */

/* The theme's inverse pair: dark on a light page, light on a dark one. Compact and quiet:
   a short label, or a sentence of explanation at most, and never an action. */
.tooltip {
    position: fixed;
    z-index: var(--z-tooltip);
    /* The width the component sets, when it narrows a wrapped tooltip to its longest line,
       includes the padding. */
    box-sizing: border-box;
    max-width: min(17.5rem, calc(100vw - 2 * var(--spacing-2)));
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-sm);
    background-color: var(--text-title);
    color: var(--text-invert);
    box-shadow: var(--shadow-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-default);
    text-align: left;
    /* A clipped value can be one unbroken string, an email address or a pasted token, and
       it has to wrap somewhere to fit the tooltip's width. */
    overflow-wrap: anywhere;
    white-space: normal;
    pointer-events: auto;
}

/* The pointer, in the gap between the tooltip and what it labels. The component sets
   --tooltip-pointer to keep it on the trigger's centre when the tooltip has been moved
   along to stay on screen. */
.tooltip::after {
    content: "";
    position: absolute;
    border: 5px solid transparent;
}

.tooltip--top::after,
.tooltip--bottom::after {
    left: var(--tooltip-pointer, 50%);
    transform: translateX(-50%);
}

.tooltip--left::after,
.tooltip--right::after {
    top: var(--tooltip-pointer, 50%);
    transform: translateY(-50%);
}

.tooltip--top::after {
    top: 100%;
    border-top-color: var(--text-title);
}

.tooltip--bottom::after {
    bottom: 100%;
    border-bottom-color: var(--text-title);
}

.tooltip--left::after {
    left: 100%;
    border-left-color: var(--text-title);
}

.tooltip--right::after {
    right: 100%;
    border-right-color: var(--text-title);
}

/* A value too long for the window scrolls inside the tooltip, which itself stays on
   screen; the scroll is on the content so the pointer outside the box is not clipped.
   The height left is the window less the 8px gap and the padding, top and bottom. */
.tooltip__content {
    max-height: calc(100vh - 4 * var(--spacing-2));
    overflow-y: auto;
}

/* ==========================================
   TRUNCATED TEXT
   ========================================== */

/* One line, clipped with an ellipsis. Only clips when its container gives it a width to
   clip to: a fixed-layout table column, a flex item with min-width: 0, a set width. */
.truncated-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A clipped value takes keyboard focus so its tooltip can be opened without a pointer; the
   ring matches the other controls'. */
.truncated-text:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ==========================================
   TOOLTIP — SHOWING
   Fades in, nudged out of what it labels by a couple of pixels.
   ========================================== */

.tooltip {
    animation: tooltip-in var(--motion-duration-quick) var(--motion-ease-out) backwards;
}

.tooltip--top {
    --tooltip-from-y: 0.125rem;
}

.tooltip--bottom {
    --tooltip-from-y: -0.125rem;
}

.tooltip--left {
    --tooltip-from-x: 0.125rem;
}

.tooltip--right {
    --tooltip-from-x: -0.125rem;
}

@keyframes tooltip-in {
    from {
        opacity: 0;
        translate: calc(var(--tooltip-from-x, 0px) * var(--motion-amount))
            calc(var(--tooltip-from-y, 0px) * var(--motion-amount));
    }
}

/**
 * Nimbus Design System - Info Tags / Badges
 * Based on Figma Style Guide (20 Jan 2026)
 *
 * Small inline status text indicators
 * Variants: Success (green), Error (red), Warning (amber), Neutral
 */

/* ==========================================
   INFO TAG
   ========================================== */

.info-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    white-space: nowrap;
}

/* Separator between parts */
.info-tag__separator {
    opacity: 0.6;
}

/* ==========================================
   INFO TAG VARIANTS
   ========================================== */

/* Success / Passed (green) */
.info-tag--success {
    background-color: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
}

/* Error / Failed (red) */
.info-tag--error {
    background-color: rgba(198, 40, 40, 0.1);
    color: #c62828;
}

/* Warning (amber) */
.info-tag--warning {
    background-color: rgba(230, 81, 0, 0.1);
    color: #e65100;
}

/* Neutral / Default */
.info-tag--neutral {
    background-color: var(--bg-surface-secondary);
    color: var(--text-paragraph);
}

/* On a dark page the deep status colours sink into the surface: lighter text over a stronger
   tint of the same hue, so a tag reads as clearly as it does on a light one. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .info-tag--success {
        background-color: rgba(129, 199, 132, 0.16);
        color: #a5d6a7;
    }

    :root:not([data-theme="light"]) .info-tag--error {
        background-color: rgba(239, 154, 154, 0.16);
        color: #ef9a9a;
    }

    :root:not([data-theme="light"]) .info-tag--warning {
        background-color: rgba(255, 183, 77, 0.16);
        color: #ffb74d;
    }
}

[data-theme="dark"] .info-tag--success {
    background-color: rgba(129, 199, 132, 0.16);
    color: #a5d6a7;
}

[data-theme="dark"] .info-tag--error {
    background-color: rgba(239, 154, 154, 0.16);
    color: #ef9a9a;
}

[data-theme="dark"] .info-tag--warning {
    background-color: rgba(255, 183, 77, 0.16);
    color: #ffb74d;
}

/* ==========================================
   BADGE
   Small pill-shaped indicator
   ========================================== */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-2);
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: 1;
}

/* Badge variants */
.badge--primary {
    background-color: var(--bg-button-primary);
    color: var(--text-button-primary);
}

.badge--secondary {
    background-color: var(--bg-surface-secondary);
    color: var(--text-paragraph);
}

/* A count that is information rather than a call to act on it (a site's buildings, say):
   the chip fill, which holds its own against a white row where the secondary fill fades. */
.badge--neutral {
    background-color: var(--bg-chip-filled);
    color: var(--text-title);
}

.badge--success {
    background-color: #2e7d32;
    color: #ffffff;
}

.badge--error {
    background-color: #c62828;
    color: #ffffff;
}

.badge--warning {
    background-color: #e65100;
    color: #ffffff;
}

/* Dot badge (no text, just indicator) */
.badge--dot {
    width: 0.5rem;
    height: 0.5rem;
    min-width: 0.5rem;
    padding: 0;
}

/* Outline badge */
.badge--outline {
    background-color: transparent;
    border: 1px solid currentColor;
}

.badge--outline.badge--primary {
    color: var(--bg-button-primary);
}

.badge--outline.badge--success {
    color: #2e7d32;
}

.badge--outline.badge--error {
    color: #c62828;
}

.badge--outline.badge--warning {
    color: #e65100;
}

/**
 * Nimbus Design System - Card Repeater Component
 *
 * A panel/list container that wraps repeated Card entries.
 * Shows either a list of cards or a centered empty state.
 *
 * Usage:
 *   <div class="card-repeater">
 *     <div class="card-repeater__header">
 *       <span class="card-repeater__title">Events <span class="card-repeater__title-count">· 2</span></span>
 *       <div class="card-repeater__actions">...</div>
 *     </div>
 *     <div class="card-repeater__body">
 *       <div class="card-repeater__list">...</div>
 *       \3c !-- or when empty: -->
 *       <div class="card-repeater__empty">
 *         <span class="card-repeater__empty-icon">...</span>
 *         <span class="card-repeater__empty-label">Events cleared</span>
 *       </div>
 *     </div>
 *   </div>
 */

/* ==========================================
   CARD REPEATER CONTAINER
   ========================================== */

.card-repeater {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 0;
}

/* ==========================================
   HEADER
   Title row with optional action buttons
   ========================================== */

.card-repeater__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-4);
    flex-shrink: 0;
}

.card-repeater__title {
    font-family: var(--font-family);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-bold);
    color: var(--text-title);
}

.card-repeater__title-count {
    font-weight: var(--font-weight-bold);
    color: var(--text-paragraph);
}

.card-repeater__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

/* ==========================================
   BODY
   ========================================== */

.card-repeater__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ==========================================
   CARD LIST
   Populated state — stacked cards
   ========================================== */

.card-repeater__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
    padding: var(--spacing-6);
    padding-top: 0;
    padding-right: var(--spacing-2);
    margin-right: var(--spacing-2);
    overflow-y: auto;
    min-height: 0;
}

/* ==========================================
   EMPTY STATE
   Centred icon + label when no cards present
   ========================================== */

.card-repeater__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-3);
    padding: var(--spacing-8);
    flex: 1;
    min-height: 200px;
}

.card-repeater__empty-icon {
    color: var(--icon-disable);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-repeater__empty-label {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
}

/**
 * Nimbus Design System - Drawer Component
 * A slide-in panel from the right side of the screen
 */

/* ==========================================
   OVERLAY / BACKDROP
   ========================================== */

.drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: var(--z-modal);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.drawer-overlay--open {
    opacity: 1;
    pointer-events: all;
}

/* ==========================================
   DRAWER PANEL
   ========================================== */

/* A card floating over the page, clear of its top and bottom, flat rather than shadowed. */
.drawer {
    position: fixed;
    top: var(--drawer-inset-block);
    bottom: var(--drawer-inset-block);
    right: var(--spacing-4);
    height: auto;
    width: 575px;
    max-width: calc(100vw - var(--spacing-4) * 2);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-2xl);
    box-shadow: none;
    overflow: hidden;
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    transform: translateX(calc(100% + var(--spacing-4)));
    transition:
        transform var(--transition-slow),
        top var(--transition-slow),
        bottom var(--transition-slow),
        right var(--transition-slow),
        width var(--transition-slow),
        max-width var(--transition-slow),
        border-radius var(--transition-slow);
}

/* It slides in on the settle spring, as the apps' panels do, and is widened or narrowed on it
   while open. It leaves on the quicker ease above, so it is gone before DrawerPresence unmounts
   it. */
.drawer--open {
    transform: translateX(0);
    transition-duration: var(--motion-duration-settle);
    transition-timing-function: var(--motion-ease-settle);
}

/* Expanded, it is the same floating card, only wider: clear of the window's edges, its corners
   rounded, as a drawer always is. */
.drawer--expanded {
    width: 86vw;
    max-width: calc(100vw - var(--spacing-4) * 2);
}

/* ==========================================
   DRAWER HEADER
   ========================================== */

/* Its buttons along the top, at the body's own inset, with nothing ruled off below them. */
.drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-3);
    padding: var(--spacing-6) var(--spacing-6) var(--spacing-2);
    flex-shrink: 0;
}

.drawer__header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    flex-shrink: 0;
}

.drawer__header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    flex-shrink: 0;
}

/* Declared rather than inherited: the buttons beside it set their own line-height, so a
   title taking the page's instead gives the header two differently-measured boxes, and
   centring them looks wrong however faithfully it is done. */
.drawer__title {
    font-family: var(--font-family);
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    color: var(--text-title);
    margin: 0;
    flex: 1;
    /* A heading is roomy: it wraps, and breaks an unbroken name where it must, rather than being
       cut short or running off the edge. */
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The title under the header, first in the body, where a design puts it beneath Close and
   Save; a description following it sits close under it. */
.drawer__title--below {
    /* the header row's flex: 1 would stretch it down the body's flex column */
    flex: none;
    margin-bottom: var(--spacing-1);
}

/* ==========================================
   DRAWER BODY
   ========================================== */

.drawer__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    padding: var(--spacing-6);
    margin-bottom: var(--spacing-6);
}

/* A card in the body keeps its full height, so the body scrolls: shrunk to fit, a card (which
   hides its overflow) would cut its own contents off with nothing to scroll. */
.drawer__body > .card {
    flex-shrink: 0;
}

/* A drawer's form: its messages and fields, one under another. */
.drawer__fields {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

/* A drawer's contents come with it, in the one movement, rather than in a cascade of their own on
   top: lists in it don't stagger or rise as it opens, and what loads into it later only fades. */
.drawer__body {
    --motion-stagger-step: 0ms;
    --motion-rise: 0px;
}
/**
 * Nimbus Design System - Modal Component
 */

/* ==========================================
   BACKDROP
   ========================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--spacing-4);
}

/* ==========================================
   MODAL CONTAINER
   ========================================== */

.modal {
    background: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-6);
    width: 480px;
    max-width: 100%;
    max-height: calc(100vh - var(--spacing-4) * 2);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    /* Portalled to the body, so it can't count on inheriting a font from the app root. */
    font-family: var(--font-family);
    /* Lets Modal nudge it onto a whole pixel with `top`, leaving transform to the animation. */
    position: relative;
}

.modal--sm {
    width: 360px;
}

.modal--lg {
    width: 640px;
}

/* For a grid of choices to pick from: the welcome's modules and widgets. */
.modal--xl {
    width: 960px;
}

/* ==========================================
   MODAL SECTIONS
   ========================================== */

.modal__header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

.modal__title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-bold);
    color: var(--text-title);
}

.modal__subtitle {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-paragraph);
}

.modal__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    overflow-y: auto;
}

/* A paragraph of what the modal says: what will happen, or why. The body spaces them. */
.modal__text {
    margin: 0;
    color: var(--text-paragraph);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

/* With the modal's gap, the body and the footer are 24px apart. */
.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-2);
    margin-top: var(--spacing-3);
}

/* A way out at the start and the way on at the end: "Skip for now" … "Back" "Next". */
.modal__footer--split {
    justify-content: space-between;
    align-items: center;
}

/* Buttons kept together at one end of a split footer. */
.modal__footer-group {
    display: flex;
    gap: var(--spacing-2);
}

/* Frosted: over the brand artwork or a busy page, the theme's surface just short of opaque with
   what is behind blurred through it, lifted well clear. Still the theme's colours, so it reads
   the same in light and dark. */
.modal--frosted {
    background-color: color-mix(in srgb, var(--bg-surface-primary) 92%, transparent);
    backdrop-filter: blur(18px);
    border-color: var(--brand-glass-edge);
    box-shadow: var(--shadow-xl);
}

/* ==========================================
   MODAL — OPENING
   The page dims as the modal rises into place over it, on the settle spring, as a sheet comes
   up in the apps. Closing is immediate.
   ========================================== */

.modal-backdrop {
    animation: motion-fade var(--motion-duration-fade) var(--motion-ease-out) backwards;
}

/* Solid almost at once, so the page doesn't show through it, while it settles into place. */
.modal {
    animation:
        motion-fade var(--motion-duration-quick) var(--motion-ease-out) backwards,
        motion-settle-in var(--motion-duration-settle) var(--motion-ease-settle) backwards;
}

/* A modal's contents come with it, in the one movement, rather than in a cascade of their own on
   top: lists in it don't stagger or rise as it opens, and what loads into it later only fades. */
.modal__body {
    --motion-stagger-step: 0ms;
    --motion-rise: 0px;
}
/**
 * Nimbus Design System - Status Pill
 * Based on Figma Style Guide
 *
 * Outlined pill indicator showing a current status or mode.
 * Renders as a <span> by default; use the interactive variant for clickable pills.
 */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    color: var(--text-title);
    white-space: nowrap;
}

.status-pill--interactive {
    cursor: pointer;
}

.status-pill--interactive:hover:not(:disabled) {
    background-color: var(--bg-surface-secondary);
    border-color: var(--border-40);
}

.status-pill--interactive:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

.status-pill--interactive:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/**
 * Nimbus Design System - Status marks
 *
 * How far something has got, as a mark for each stage on a capsule: filled once that stage is
 * reached, outlined and grey while it is still ahead.
 *
 * Anatomy: marks (capsule); mark, reached
 */

.status-marks {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--spacing-1);
    padding: var(--spacing-1);
    background-color: var(--bg-surface-primary);
    border-radius: var(--radius-full);
}

/* A grey capsule, to stand off a white surface: a list's rows. The switcher's track, the grey of
   a pill that holds things, so it reads clearly on white; the marks still ahead stand out on it as
   lighter circles. */
.status-marks--secondary {
    background-color: var(--bg-cs-bg);
}

/* On a surface that is tinted already, the marks stand on it without the capsule. */
.status-marks--bare {
    background-color: transparent;
}

.status-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    box-sizing: border-box;
    /* Its width and style only: the colour is the :where() rules', which a shorthand here would
       outweigh. */
    border-width: 1px;
    border-style: solid;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

/* The colours are written in :where(), which weighs nothing, so the app's class for a reached
   stage gives the mark its colour whichever of the two sheets loads last. */
:where(.status-mark) {
    border-color: var(--border-20);
    background-color: var(--bg-surface-secondary);
    color: var(--icon-secondary);
}

/* Filled: in the colour the app's class for the stage gives it, the secondary icon colour
   without one; a white glyph unless that class says otherwise. */
:where(.status-mark--reached) {
    border-color: transparent;
    background-color: var(--icon-secondary);
    color: var(--text-on-status);
}

/* Smaller marks, for a list's rows, on a capsule as roomy as the full-size one's, so it reads as
   a pill rather than a thin edge. */
.status-marks--sm {
    gap: var(--spacing-1);
    padding: var(--spacing-1);
}

.status-marks--sm .status-mark {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.625rem;
}

/* ==========================================
   STATUS MARKS — BUILDING UP
   As the marks appear they pop in, in order, at the delay the component gives each
   (--status-mark-delay): a reached one from small on the pop spring, one still ahead from
   nearly its size. A list's smaller marks are simply there. A stage reached while the marks are
   shown (.status-mark--reached-now) pops as it fills, with a ring of its colour spreading out.
   ========================================== */

.status-mark {
    position: relative;
    --motion-pop-from: 0.85;
    animation: motion-pop var(--motion-duration-pop) var(--motion-ease-pop)
        var(--status-mark-delay, 0ms) backwards;
}

.status-mark--reached {
    --motion-pop-from: 0.45;
}

.status-marks--sm .status-mark {
    animation: none;
}

.status-marks .status-mark--reached-now {
    animation: status-mark-reach var(--motion-duration-pop) var(--motion-ease-pop);
}

.status-mark--reached-now::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: inherit;
    /* Only a ring of the stage's colour, the mark's own edge outward. */
    mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
    opacity: 0;
    pointer-events: none;
    animation: motion-ripple 500ms ease-out;
}

@keyframes status-mark-reach {
    from {
        scale: calc(1 - 0.4 * var(--motion-amount));
    }
}

/* In a pane that has swapped to the next alert at once (.motion-swapped), the marks come in
   together, quickly, from nearly their size and with no overshoot: the one part of the pane that
   moves, since it says how far the new alert has got. */
.motion-swapped .status-mark {
    --motion-pop-from: 0.8;
    animation: motion-pop var(--motion-duration-enter) var(--motion-ease-enter) 40ms backwards;
}
/**
 * Nimbus Design System - Page
 *
 * The frame of a module's page inside the shell: where it starts below the pill bar, and its
 * title. The shell pads a page's sides and bottom (--page-gutter, --page-bottom); a page pads
 * only its top, so every page's title holds the same place as you move between them.
 */

/* ==========================================
   PAGE
   ========================================== */

.page {
    padding-top: var(--page-top);
}

/* ==========================================
   PAGE TITLE
   ========================================== */

/* The page title's style everywhere: the top of the type scale, as .text-xl-bold. */
.page-title {
    margin: 0 0 var(--spacing-6);
    font-family: var(--font-family);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    color: var(--text-title);
}

/* A line under the title; the gap under the page's heading moves below it. */
.page-title:has(+ .page-subtitle) {
    margin-bottom: var(--spacing-2);
}

.page-subtitle {
    margin: 0 0 var(--spacing-6);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-default);
    color: var(--text-paragraph);
}

/* ==========================================
   PAGE — ARRIVING
   The page's title is its frame and stays still as the page opens; the line under it comes in,
   as a page card's body does (cards.css).
   ========================================== */

.page > .page-subtitle {
    animation: motion-arrive var(--motion-duration-enter) var(--motion-ease-enter) backwards;
}

/**
 * Nimbus Design System - List Toolbar
 *
 * The row above a listing (sites, users, groups, organisations): its search, any filters
 * beside it, and the page's action at the far end.
 *
 * Anatomy: search, filters, actions
 */

/* ==========================================
   LIST TOOLBAR
   ========================================== */

.list-toolbar {
    display: flex;
    align-items: center;
    /* The search, the filters and the action gathered together at the far end, so a list's
       tools read as one group beside its action rather than spread across the row. */
    justify-content: flex-end;
    /* Wraps rather than squeezing the search field to nothing on a narrow window. */
    flex-wrap: wrap;
    gap: var(--spacing-3);
    margin-bottom: var(--spacing-5);
}

/* Every list's search field is the same width: it holds its width, and what shares its row
   wraps, rather than squeezing it. */
.list-toolbar__search {
    box-sizing: border-box;
    flex: 0 1 var(--search-width);
    max-width: 100%;
}

/* A line saying what the list is, in place of a heading: it takes the start of the row, and
   the tools stay gathered at the far end. */
.list-toolbar__description {
    flex: 1 1 20rem;
    margin: 0;
    color: var(--text-paragraph);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

/* The page's actions, as a group: a primary button, or a few side by side. */
.list-toolbar__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-2);
}

/* Before 1.2.0 the last item was pushed to the far end with this same selector. Modules still
   bundling an older copy of this sheet would keep doing so, so it is undone here, where the
   shell's copy, which loads after theirs, decides. */
.list-toolbar > *:last-child:not(:first-child) {
    margin-left: 0;
}

/* A lone search, with nothing to gather beside, stays at the start. */
.list-toolbar > :only-child,
.list-toolbar > .toolbar-search:only-child > * {
    margin-right: auto;
}

/* ==========================================
   TOOLBAR SEARCH
   The React ToolbarSearch: the search field where the row has room for it at its full
   width, and a search button where it has not, so the toolbar keeps to one line. Its wrapper
   lays nothing out, so the field or the button is the toolbar's own item.
   ========================================== */

.toolbar-search {
    display: contents;
}

/* The tools beside it keep their size and their labels on one line, so the width the search
   measures them at is the width they take. */
.list-toolbar:has(> .toolbar-search) > .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Opened from the button: the field takes what the row has left, rather than its usual
   width, so the tools stay beside it instead of wrapping under it. */
.toolbar-search--open > .list-toolbar__search {
    flex: 1 1 0;
    min-width: 8rem;
}
/**
 * Nimbus Design System - Empty State
 *
 * What a listing or a page shows where its content would be: nothing created yet, nothing
 * matching a search, nothing to show until one is made. A surface of its own, centred, with
 * what to do about it underneath.
 *
 * Anatomy: icon, title, description, actions
 */

/* ==========================================
   EMPTY STATE
   ========================================== */

/* The disc is the plum at 14%, its glyph the deep plum; on a dark page the disc is stronger and
   the glyph white, so both still read. */
:root {
    --empty-state-disc: color-mix(in srgb, var(--icon-brand) 14%, transparent);
    --empty-state-glyph: var(--bg-surface-brand);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --empty-state-disc: color-mix(in srgb, var(--icon-brand) 45%, transparent);
        --empty-state-glyph: #ffffff;
    }
}

[data-theme="dark"] {
    --empty-state-disc: color-mix(in srgb, var(--icon-brand) 45%, transparent);
    --empty-state-glyph: #ffffff;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    box-sizing: border-box;
    width: 100%;
    min-height: 12.5rem;
    padding: var(--spacing-8) var(--spacing-6);
    text-align: center;
    font-family: var(--font-family);
    background: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-lg);
}

/* The picture: the icon on a disc of the brand's plum, as in the apps (IconDisc), popping in
   with one small shake as the empty state appears. The words rise in just after it. All of it
   waits --motion-delay, where something else has to move first. */
.empty-state__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    margin-bottom: var(--spacing-3);
    border-radius: var(--radius-full);
    background-color: var(--empty-state-disc);
    /* The glyph is 44% of the disc. */
    font-size: 1.98rem;
    color: var(--empty-state-glyph);
    --motion-pop-from: 0.7;
    animation:
        motion-pop var(--motion-duration-pop) var(--motion-ease-pop)
            calc(var(--motion-delay, 0ms) + 50ms) backwards,
        motion-wiggle 560ms ease-in-out calc(var(--motion-delay, 0ms) + 50ms);
}

.empty-state__title,
.empty-state__description,
.empty-state__actions {
    animation: motion-arrive var(--motion-duration-enter) var(--motion-ease-enter) backwards;
}

.empty-state__title {
    animation-delay: calc(var(--motion-delay, 0ms) + 60ms);
}

.empty-state__description {
    animation-delay: calc(var(--motion-delay, 0ms) + 90ms);
}

.empty-state__actions {
    animation-delay: calc(var(--motion-delay, 0ms) + 120ms);
}

.empty-state__title {
    margin: 0;
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-default);
    color: var(--text-title);
}

.empty-state__description {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-default);
    color: var(--text-paragraph);
}

/* What to do about it, set apart from the words: the gap under the description is the
   one empty listings have always had before their button. */
.empty-state__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    margin-top: var(--spacing-4);
}

/* Inside a surface that is already there (a panel, a pane): the same layout and words,
   without a card of its own, and filling what is left of a flex column. */
.empty-state--plain {
    flex: 1;
    background: none;
    border: none;
    border-radius: 0;
}

/* Inside a page's card: sunk into it on the secondary surface rather than outlined as a
   card of its own. The icon is the panel's picture rather than a mark beside the words, so
   its disc is larger, and the title carries the panel, so it is set bold. */
.empty-state--filled {
    min-height: 24rem;
    padding: var(--spacing-16) var(--spacing-6);
    background: var(--bg-surface-secondary);
    border: none;
}

/* A secondary action keeps the card's white rather than taking on the grey it sits in. At
   rest only: this stylesheet loads after the buttons', so unscoped it would also replace the
   dark fill of hover, focus and press, under their white text. */
.empty-state--filled .btn--secondary:not(:hover, :focus-visible, :active) {
    background-color: var(--bg-surface-primary);
}

.empty-state--filled .empty-state__icon {
    width: 5.5rem;
    height: 5.5rem;
    font-size: 2.42rem;
}

.empty-state--filled .empty-state__title {
    font-weight: var(--font-weight-bold);
}

/* The words held to a readable measure, for a card that spans a wide listing. */
.empty-state--narrow .empty-state__title,
.empty-state--narrow .empty-state__description {
    max-width: 32rem;
}

@media (max-width: 640px) {
    .empty-state {
        min-height: 0;
        padding: var(--spacing-6) var(--spacing-4);
    }
}

/**
 * Nimbus Design System - Menu
 *
 * The one design for a floating list of choices: a dropdown of actions, a page's navigation
 * menu, a filter's options. It is the Select's own menu (inputs.css, .select__menu and
 * .select__option) with room for icons, group headings and dividers, so a Select and a Menu
 * opened side by side are the same thing to look at.
 *
 * Anatomy: surface, items (icon, label), group labels, dividers
 *
 * One shadow (--shadow-menu) and one layer (--z-menu) for every menu: it is portalled to the
 * body and may open from inside a modal or a drawer, so it clears them all.
 */

/* ==========================================
   MENU SURFACE
   ========================================== */

.menu {
    z-index: var(--z-menu);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* At least as wide as what it opens under, which the React Menu publishes. */
    min-width: max(12rem, var(--menu-anchor-width, 0px));
    max-width: calc(100vw - 32px);
    overflow-y: auto;
    /* The items sit inset in a rounded card, so a highlighted one is a rounded row rather than
       a full-width band. */
    padding: var(--spacing-2);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-40);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
    font-family: var(--font-family);
}

/* Focus sits on the list itself until an arrow key reaches an item; the item shows it. */
.menu:focus {
    outline: none;
}

/* ==========================================
   MENU ITEM
   The pill bar's dropdowns (pills.css) list their items with the same rules.
   ========================================== */

.menu__item,
.pill-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: var(--spacing-2) var(--spacing-3);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-default);
    color: var(--text-title);
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

/* Hovered or reached by the keyboard: a soft grey row, as a Select's option. */
.menu__item:hover,
.menu__item--active,
.pill-dropdown__item:hover {
    background-color: var(--bg-cs-bg);
    /* Against a global link hover that fades it. */
    opacity: 1;
}

.menu__item:focus,
.pill-dropdown__item:focus {
    outline: none;
}

.menu__item:focus-visible,
.pill-dropdown__item:focus-visible {
    background-color: var(--bg-cs-bg);
    /* Inset, so the ring is not clipped by the menu's own edge. */
    outline: 2px solid var(--border-brand);
    outline-offset: -2px;
}

/* The current choice, or the page showing: the same row, in the heavier weight, rather than a
   dark filled chip. */
.menu__item--selected,
.menu__item[aria-checked="true"],
.menu__item[aria-current="page"] {
    background-color: var(--bg-cs-bg);
    font-weight: var(--font-weight-semibold);
}

/* Disabled is pale text and nothing else: no fill, no fade, and no hover — against the
   global button:disabled a host may set too. */
.menu__item:disabled,
.menu__item[aria-disabled="true"],
.menu__item--disabled,
.pill-dropdown__item:disabled {
    color: var(--text-disable);
    background: transparent;
    opacity: 1;
    cursor: not-allowed;
}

.menu__item-icon,
.pill-dropdown__item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 1rem;
    font-size: 1rem;
    color: var(--icon-secondary);
}

.menu__item:disabled .menu__item-icon,
.menu__item[aria-disabled="true"] .menu__item-icon,
.menu__item--disabled .menu__item-icon {
    color: var(--icon-disable);
}

/* Cut with an ellipsis rather than widening the menu past its trigger's reach. */
.menu__item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   GROUPS & DIVIDERS
   ========================================== */

.menu__group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* A group's heading: small capitals in the paragraph colour, a step back from its items. */
.menu__group-label {
    margin: var(--spacing-2) 0 var(--spacing-1);
    padding: 0 var(--spacing-3);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-paragraph);
}

/* The first group's heading starts the menu: the menu's own padding is room enough. */
.menu > .menu__group:first-child .menu__group-label {
    margin-top: var(--spacing-1);
}

.menu__divider,
.pill-dropdown__divider {
    flex-shrink: 0;
    height: 1px;
    margin: var(--spacing-2) 0;
    background-color: var(--border-20);
    border: none;
}

/* ==========================================
   MENU — OPENING
   Every floating list of choices (a Menu, a Select's options, a SearchableSelect's popover, the
   Filters panel) grows out of the control it opens from, quickly enough never to be waited
   for. The React components say which way it opened in data-placement.
   ========================================== */

.menu,
.select__menu,
.searchable-select__popover,
.filters-panel {
    transform-origin: top center;
    animation: motion-open var(--motion-duration-quick) var(--motion-ease-out) backwards;
}

:is(.menu, .select__menu, .searchable-select__popover, .filters-panel)[data-placement="above"] {
    transform-origin: bottom center;
    animation-name: motion-open-up;
}

/* The Filters panel hangs from its button's right-hand end. */
.filters-panel {
    transform-origin: top right;
}

.filters-panel[data-placement="above"] {
    transform-origin: bottom right;
}

/**
 * Nimbus Design System - Filter Menu
 *
 * The sliders button at the end of a list's toolbar, which opens the list's filters in a Menu
 * (menu.css). The React FilterMenu renders it.
 *
 * Anatomy: trigger (ghost icon button), active dot
 */

/* ==========================================
   TRIGGER
   ========================================== */

.filter-menu__trigger {
    position: relative;
}

/* A dot on the sliders while any filter is on, so a shortened list is never a mystery. */
.filter-menu__trigger[data-active] {
    color: var(--text-title);
}

.filter-menu__trigger[data-active]::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--bg-button-primary);
    /* Ringed in the surface behind it, so it reads as sitting on the button's corner. */
    box-shadow: 0 0 0 2px var(--bg-surface-primary);
}

/**
 * Nimbus Design System - Filters
 *
 * The filtering pattern (End Users, 20 Oct 2026): one filter button beside a list's search, a
 * panel that opens on the Filter by list (or straight into the options of a page's only filter),
 * the chips of what is applied under the list's header, and how many results are showing. The
 * React Filters, FiltersButton, AppliedFilters and FilterResultCount render it.
 *
 * Anatomy: button (+ count badge), panel (header, search, Filter by rows, options, checks,
 * date range, footer), applied chips, result count
 */

/* ==========================================
   BUTTON
   ========================================== */

/* Ghost while nothing is applied, secondary once something is (the Button's own variants);
   the badge says how many. */
.filters-button {
    position: relative;
}

.filters-button__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    /* The theme's inverse pair, so it stands out in either theme. Ringed in the surface behind
       it, so it reads as sitting on the button's corner. */
    background-color: var(--text-title);
    color: var(--text-invert);
    box-shadow: 0 0 0 2px var(--bg-surface-primary);
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    line-height: 1;
}

/* ==========================================
   PANEL
   ========================================== */

.filters-panel {
    position: fixed;
    z-index: var(--z-menu);
    display: flex;
    flex-direction: column;
    width: min(22rem, calc(100vw - 2rem));
    box-sizing: border-box;
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-40);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
    overflow: hidden;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
}

/* The panel's title: "Filter by", or the filter showing, after a back arrow. */
.filters-panel__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    min-height: 3.5rem;
    padding: var(--spacing-3) var(--spacing-5);
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-20);
}

.filters-panel__title {
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-semibold);
}

.filters-panel__back,
.filters-panel__clear-all,
.filters-panel__clear {
    font-family: inherit;
    border: none;
    background: transparent;
    color: var(--text-title);
    cursor: pointer;
}

/* Padding set to 0, not left to the page: a page's own button padding would leave the icon no
   room in a fixed-size button. */
.filters-panel__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    margin-left: calc(-1 * var(--spacing-2));
    border-radius: var(--radius-full);
}

.filters-panel__back:hover {
    background-color: var(--bg-surface-secondary);
}

.filters-panel__clear-all {
    margin-left: auto;
    padding: var(--spacing-1) 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.filters-panel__clear-all:hover,
.filters-panel__clear:not(:disabled):hover {
    text-decoration: underline;
}

.filters-panel__search {
    flex: 0 0 auto;
    padding: var(--spacing-3) var(--spacing-4) 0;
}

/* What scrolls when the panel is taller than the room it has: the header, search and footer
   stay put. */
.filters-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--spacing-2);
}

.filters-panel__note,
.filters-panel__empty {
    margin: var(--spacing-2) var(--spacing-3);
    color: var(--text-paragraph);
}

/* ==========================================
   PANEL — FILTER BY ROWS
   ========================================== */

.filters-panel__filter {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    width: 100%;
    padding: var(--spacing-3);
    box-sizing: border-box;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.filters-panel__filter:hover {
    background-color: var(--bg-surface-secondary);
}

.filters-panel__filter-icon {
    display: inline-flex;
    flex-shrink: 0;
    font-size: 1.125rem;
    color: var(--icon-secondary);
}

.filters-panel__filter-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.filters-panel__filter-label {
    font-weight: var(--font-weight-semibold);
}

.filters-panel__filter-value {
    color: var(--text-paragraph);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A filter that narrows the list says so in the title's colour. */
.filters-panel__filter-value--set {
    color: var(--text-title);
}

.filters-panel__chevron {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--icon-secondary);
}

/* ==========================================
   PANEL — ONE-OF OPTIONS (single select, date)
   ========================================== */

.filters-panel__options {
    margin: 0;
    padding: 0;
    list-style: none;
}

.filters-panel__option {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-3);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.filters-panel__option:hover {
    background-color: var(--bg-surface-secondary);
}

/* A step on from the hover's fill in both themes. (--bg-cs-bg, the listbox Select's, is the
   hover's grey in the dark theme.) */
.filters-panel__option--selected {
    background-color: var(--bg-surface-invert-2);
    font-weight: var(--font-weight-semibold);
}

.filters-panel__option-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The count sits at the row's end, before the tick; a 0 stays, so the list doesn't jump. */
.filters-panel__count {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-paragraph);
    font-weight: var(--font-weight-regular);
    font-variant-numeric: tabular-nums;
}

.filters-panel__tick {
    display: inline-flex;
    flex-shrink: 0;
    width: 1rem;
    justify-content: center;
}

.filters-panel__option-label + .filters-panel__tick {
    margin-left: auto;
}

/* ==========================================
   PANEL — CHECKS (multi-select)
   ========================================== */

.filters-panel__group + .filters-panel__group {
    margin-top: var(--spacing-2);
}

.filters-panel__group-heading {
    display: block;
    padding: var(--spacing-2) var(--spacing-3) var(--spacing-1);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-paragraph);
}

.filters-panel__check {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: var(--radius-md);
}

.filters-panel__check:hover {
    background-color: var(--bg-surface-secondary);
}

.filters-panel__check .checkbox {
    flex: 1 1 auto;
    min-width: 0;
}

.filters-panel__footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-3);
    padding: var(--spacing-3) var(--spacing-5);
    border-top: 1px solid var(--border-20);
}

.filters-panel__selected {
    color: var(--text-paragraph);
}

.filters-panel__clear {
    padding: var(--spacing-1) 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.filters-panel__clear:disabled {
    color: var(--text-disable);
    cursor: default;
}

/* ==========================================
   PANEL — CUSTOM DATE RANGE
   ========================================== */

.filters-panel__range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3);
    align-items: end;
    padding: var(--spacing-3);
}

.filters-panel__range-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    min-width: 0;
}

.filters-panel__range .btn {
    grid-column: 1 / -1;
    justify-self: end;
}

/* Focus on the panel's rows, inset so it isn't cut off at the panel's edge. An option list
   holds focus itself while its arrow keys move the active option, so the option takes the ring. */
.filters-panel__filter:focus-visible,
.filters-panel__options:focus-visible .filters-panel__option--active,
.filters-panel__back:focus-visible,
.filters-panel__clear-all:focus-visible,
.filters-panel__clear:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: -2px;
}

.filters-panel__options:focus-visible {
    outline: none;
}

/* ==========================================
   APPLIED CHIPS
   ========================================== */

/* Under the list's header: one chip per applied filter, then Clear all at two or more. */
.applied-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-2);
}

.applied-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    max-width: 100%;
    padding: 0 var(--spacing-1) 0 var(--spacing-4);
    border-radius: var(--radius-full);
    background-color: var(--bg-cs-bg);
}

.applied-filters__change,
.applied-filters__remove,
.applied-filters__clear-all {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
    border: none;
    background: transparent;
    cursor: pointer;
}

.applied-filters__change {
    min-width: 0;
    padding: var(--spacing-2) 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* At least 24px to hit. No padding, as with the panel's back button. */
.applied-filters__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border-radius: var(--radius-full);
    color: var(--text-paragraph);
}

/* The surface's own colour, which differs from the chip's in both themes. (The other hovers'
   --bg-surface-secondary is the chip's grey in the dark theme.) */
.applied-filters__remove:hover {
    background-color: var(--bg-surface-primary);
    color: var(--text-title);
}

.applied-filters__clear-all {
    padding: var(--spacing-2) var(--spacing-2);
}

.applied-filters__change:hover,
.applied-filters__clear-all:hover {
    text-decoration: underline;
}

.applied-filters__change:focus-visible,
.applied-filters__remove:focus-visible,
.applied-filters__clear-all:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 1px;
    border-radius: var(--radius-sm);
}

/* ==========================================
   RESULT COUNT
   ========================================== */

.filter-result-count {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
}

/* Held while the list loads: a line's height with nothing in it. */
.filter-result-count--pending::before {
    content: "\a0";
}
/**
 * Nimbus Design System - Pills
 *
 * The round triggers in the shell's pill bar (the account, full screen, a module's own, such
 * as FLARE's system status) and the dropdown each one opens. The bar itself — where it sits
 * and how its pills are spaced — is the shell's; these are the pills, so a module that draws
 * one looks like the shell's own.
 *
 * Anatomy: pill (avatar, label, chevron), dropdown (header, menu items, divider)
 */

/* ==========================================
   PILL TRIGGER
   ========================================== */

.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    height: var(--pill-bar-height);
    padding: 0 var(--spacing-3);
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-40);
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
    box-shadow: var(--shadow-sm);
}

.pill:hover {
    background-color: var(--bg-surface-secondary);
    border-color: var(--border-60);
}

.pill:focus {
    outline: none;
}

.pill:focus-visible {
    outline: 2px solid var(--bg-button-primary);
    outline-offset: 2px;
}

.pill--active {
    background-color: var(--bg-surface-secondary);
    border-color: var(--border-60);
}

/* ==========================================
   PILL CONTENTS
   ========================================== */

.pill__avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.pill__avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background-color: var(--bg-button-primary);
    color: var(--text-button-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}

/* What a pill says ("Full screen", "System status"): .pill's own size and weight are for its
   contents, which set their own, so every pill's words are set by this. */
.pill__label {
    font-size: var(--pill-label-size);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

/* A pill's label that is somebody's name, which can be any length. */
.pill__name {
    font-size: var(--pill-label-size);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
    /* The pill bar is a flex row with no overflow handling, so an unbounded name
       pushes the other pills around. Cap it and ellipsise; the full value stays
       available via the title attribute and the dropdown header. */
    max-width: 24ch;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pill__chevron {
    font-size: 0.75rem;
    color: var(--icon-secondary);
    transition: transform var(--transition-fast);
}

.pill--active .pill__chevron {
    transform: rotate(180deg);
}

/* ==========================================
   PILL DROPDOWN
   Opens under its pill, which the bar wraps in a positioned element.
   ========================================== */

.pill-dropdown {
    position: absolute;
    top: calc(100% + var(--spacing-2));
    right: 0;
    min-width: 260px;
    background-color: var(--bg-surface-primary);
    border-radius: var(--radius-lg);
    /* The shadow alone lifts the panel off the page; an outline on top of it reads as
       a double edge against the bordered cards inside. */
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    overflow: hidden;
    /* Kept mounted and shown by its class, so it opens with a transition rather than the
       menus' keyframe (menu.css), making the same small move out of the pill they make. */
    opacity: 0;
    visibility: hidden;
    transform-origin: top right;
    scale: calc(1 - 0.03 * var(--motion-amount));
    translate: 0 calc(-0.25rem * var(--motion-amount));
    transition:
        opacity var(--motion-duration-quick) var(--motion-ease-out),
        visibility var(--motion-duration-quick),
        scale var(--motion-duration-quick) var(--motion-ease-out),
        translate var(--motion-duration-quick) var(--motion-ease-out);
}

.pill-dropdown--open {
    opacity: 1;
    visibility: visible;
    scale: 1;
    translate: 0 0;
}

.pill-dropdown__header {
    margin: var(--spacing-4);
    padding: var(--spacing-4);
    background-color: var(--bg-surface-secondary);
    border-radius: var(--radius-md);
}

.pill-dropdown__user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.pill-dropdown__avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.pill-dropdown__avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background-color: var(--bg-button-primary);
    color: var(--text-button-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}

.pill-dropdown__user-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    min-width: 0;
}

.pill-dropdown__badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-1) var(--spacing-2);
    background-color: var(--bg-chip-filled);
    border: 1px solid var(--border-40);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    color: var(--text-paragraph);
    width: fit-content;
}

.pill-dropdown__name {
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
    font-size: var(--font-size-m);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pill-dropdown__email {
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Items inset on every side, so a highlighted one is a rounded row rather than a full-width
   band. The items themselves (.pill-dropdown__item, __item-icon, __divider) are the menu
   design's, and are styled with .menu__item in menu.css. */
.pill-dropdown__menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--spacing-2);
}
/**
 * Nimbus Design System - Pagination
 *
 * The row under a paged listing: how much of it is showing, and the pages to move between.
 * Its own file rather than part of table.css: a paged list need not be a table.
 *
 * Anatomy: summary ("Showing 1–25 of 300"), pages (Previous, page buttons, gaps, Next)
 */

/* ==========================================
   PAGINATION
   ========================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-3);
    margin-top: var(--spacing-5);
}

.pagination__summary {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
}

/* The page buttons: .btn, the current one primary and the rest secondary. */
.pagination__pages {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-2);
}

/* The elided run. Sized to match a page button's text so the row of controls keeps an even
   rhythm rather than collapsing around the gap. */
.pagination__gap {
    padding: 0 var(--spacing-1);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
    user-select: none;
}
/**
 * Nimbus Design System - Filter chips
 *
 * A single-choice row of count chips over a list ("All 12", "Fire 3"). Each chip is a toggle
 * button; the chosen one is ringed in the strong border, raised and bold, so the choice reads
 * without relying on colour. Not the status .chip (chips.css), which only shows.
 *
 * Anatomy: chip (dot?, label, count)
 */

/* ==========================================
   FILTER CHIPS
   ========================================== */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
}

.filter-chips__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 var(--spacing-3);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-title);
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast);
}

.filter-chips__chip:hover {
    background-color: var(--bg-surface-secondary);
}

.filter-chips__chip:focus {
    outline: none;
}

.filter-chips__chip:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

/* Chosen: raised like the selected switcher item and ringed in the strong border, as the
   selected tab is underlined, with the label bold. Hover leaves it as it is. */
.filter-chips__chip--selected,
.filter-chips__chip--selected:hover {
    background-color: var(--bg-cs-highlight);
    border-color: var(--border-100);
    box-shadow: var(--shadow-sm);
}

.filter-chips__chip--selected .filter-chips__label {
    font-weight: var(--font-weight-bold);
}

/* Coloured by the caller, to match how the matching rows are drawn. */
.filter-chips__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.filter-chips__label {
    font-weight: var(--font-weight-semibold);
}

.filter-chips__count {
    font-weight: var(--font-weight-bold);
}

/**
 * Nimbus Design System - Searchable select
 *
 * The listbox select's trigger and options (inputs.css), with the pieces it has no counterpart
 * for: the list floating under the trigger (or over it), with a search box at its top.
 *
 * Anatomy: label (required?), trigger (count, when several are chosen), popover (search, list of
 * options with hints and, when several can be chosen, ticks; status)
 */

/* ==========================================
   SEARCHABLE SELECT
   ========================================== */

.searchable-select {
    position: relative;
    min-width: 0;
}

.searchable-select__required {
    margin-left: 2px;
    color: var(--text-title);
}

/* Fixed, and placed from the field's rect (top or bottom, left, width and max-height, set
   inline), so the list floats over anything that clips or scrolls, a modal's body say, as the
   listbox select's does. At least 260px wide beside a narrow field; never taller than its room:
   the list gives way. */
.searchable-select__popover {
    position: fixed;
    z-index: var(--z-menu);
    min-width: min(260px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    padding: var(--spacing-2);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-40);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-menu);
    box-sizing: border-box;
}

/* The search box keeps its height when the popover is cut short; the list scrolls instead. */
.searchable-select__search {
    flex-shrink: 0;
}

.searchable-select__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    min-height: 0;
    overflow-y: auto;
}

.searchable-select__list:empty {
    display: none;
}

/* The select-all row stands apart from the options it ticks, with a rule under it. */
.searchable-select__option--select-all {
    position: relative;
    margin-bottom: var(--spacing-2);
}

.searchable-select__option--select-all::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: calc(-1 * var(--spacing-1) - 1px);
    left: 0;
    height: 1px;
    background-color: var(--border-20);
}

/* Several can be chosen: each name, then its tick at the end of the row. */
.searchable-select__option--multiple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-2);
}

.searchable-select__option-label {
    min-width: 0;
}

/* How many are chosen, beside the chevron: their names run past the field's end with a few. */
.searchable-select__count {
    flex-shrink: 0;
    margin-left: auto;
}

.searchable-select__hint {
    margin-left: var(--spacing-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    opacity: 0.75;
}

.searchable-select__status {
    margin: 0;
    padding: var(--spacing-2) var(--spacing-3);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
}

.address-finder {
    position: relative;
}

/* Mirrors the country picker's menu so the two dropdowns in a form match. */
.address-finder__menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + var(--spacing-1));
    left: 0;
    right: 0;
    max-height: 16rem;
    overflow-y: auto;
    margin: 0;
    /* Items inset in a rounded card, as every menu of choices is. */
    padding: var(--spacing-2);
    list-style: none;
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg, 0 8px 24px rgb(0 0 0 / 12%));
    /* Grows out of the field as the design system's menus do (menu.css). It stays open while
       the suggestions change under it, so only opening moves. */
    transform-origin: top center;
    animation: motion-open var(--motion-duration-quick) var(--motion-ease-out) backwards;
}

.address-finder__option {
    display: block;
    width: 100%;
    padding: var(--spacing-2) var(--spacing-3);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 12px;
    line-height: 18px;
    color: var(--text-title);
    text-align: left;
    cursor: pointer;
}

.address-finder__option:hover:not(:disabled),
.address-finder__option:focus-visible {
    background-color: var(--bg-cs-bg);
}

/* Pale text and nothing else: no fill, fade or hover. */
.address-finder__option:disabled,
.address-finder__option[aria-disabled="true"] {
    color: var(--text-disable);
    background: transparent;
    opacity: 1;
    cursor: not-allowed;
}

/* Searching / no matches / failed — stated in the menu rather than under the field, so
   the message sits where the eye already is. */
.address-finder__note {
    padding: var(--spacing-2) var(--spacing-3);
    font-family: var(--font-family);
    font-size: 12px;
    line-height: 18px;
    color: var(--text-paragraph);
}
/**
 * Nimbus Design System - Settings
 *
 * The shell's settings cards (System Preferences, and the module settings shown beside it,
 * such as the developer portal's): one card per group, a row per setting with what it does on
 * one side and its control on the other.
 *
 * Anatomy: group (heading), item (info: label, description; control)
 */

/* ==========================================
   SETTINGS GROUP
   ========================================== */

/* One settings card, whoever's settings it holds: headed at 15px semibold, with no rule
   under the heading. The same card as .card--section, for markup that cannot use .card. */
.settings-group {
    background: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-lg);
    padding: var(--spacing-6);
}

.settings-group h2 {
    margin: 0 0 var(--spacing-2) 0;
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
}

/* ==========================================
   SETTINGS ITEM
   ========================================== */

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* The control drops under its label when both don't fit, rather than squeezing the label
       to a word a line or running past the card. */
    flex-wrap: wrap;
    gap: var(--spacing-3) var(--spacing-5);
    padding: var(--spacing-3) 0;
}

.settings-item + .settings-item {
    border-top: 1px solid var(--border-20);
}

.settings-item-info {
    flex: 1 1 14rem;
    min-width: 0;
}

.settings-item-info label {
    display: block;
    margin-bottom: var(--spacing-1);
}

.settings-item-info p {
    margin: 0;
}

/* A setting that is its own control, a checkbox, with a hint under it rather than across from
   it: the card's options, one per row, parted by the same rule. Evenly spaced: the card's ends
   and either side of each rule get the same room, so no option looks pressed against the next.
   Where they are all the card holds, the card's padding is the space at its ends, so the first
   and last rows add none. Doubled with .settings-item so it wins whichever copy of the design
   system's CSS comes last: the shell's goes in after a module's, and may be older than it. */
.settings-group:has(> .settings-item--stacked) {
    padding-block: var(--spacing-4);
}

/* The box beside its label and hint together, centred on the two of them rather than sitting
   up against the label: the checkbox's own parts are laid out in the row's grid. */
.settings-item.settings-item--stacked {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--spacing-1) var(--spacing-3);
    padding: var(--spacing-4) 0;
}

.settings-item--stacked > .checkbox {
    display: contents;
}

.settings-item--stacked > .checkbox > .checkbox__box {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.settings-item--stacked > .checkbox > .checkbox__label {
    grid-column: 2;
    grid-row: 1;
}

/* Lined up under the label by the grid, with no indent of its own (an older copy of this CSS
   indents it past the box). */
.settings-item--stacked > .settings-item__hint {
    padding-left: 0;
}

.settings-item.settings-item--stacked:first-child {
    padding-top: 0;
}

.settings-item.settings-item--stacked:last-child {
    padding-bottom: 0;
}

/* Under the checkbox's label, lined up with it, the size of any setting's description, as
   .settings-item-info's. */
.settings-item__hint {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-default);
    color: var(--text-paragraph);
}

/* ==========================================
   SETTINGS SELECT
   A native select, for a setting's control.
   ========================================== */

.settings-select {
    padding: var(--spacing-2) var(--spacing-4);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-md);
    background: var(--bg-surface-secondary);
    color: var(--text-title);
    cursor: pointer;
    min-width: 120px;
    transition: border-color var(--transition-fast);
}

.settings-select:focus {
    outline: none;
    border-color: var(--bg-button-primary);
}

.settings-select:hover {
    border-color: var(--border-40);
}

/* A page of settings groups: each group comes in as a block, a beat after the one above. What
   is inside a group comes with it. */
.settings-group {
    animation: motion-arrive var(--motion-duration-enter) var(--motion-ease-enter) backwards;
}

.settings-group + .settings-group {
    animation-delay: var(--motion-stagger-step);
}

.settings-group + .settings-group + .settings-group {
    animation-delay: calc(2 * var(--motion-stagger-step));
}

.settings-group + .settings-group + .settings-group + .settings-group {
    animation-delay: calc(3 * var(--motion-stagger-step));
}

/**
 * Nimbus Design System - Status & Loading Panels
 *
 * What a page's place says when it has no content to show yet: that it is loading (the
 * loading panel), or why it cannot show it — it could not be loaded, it is not yours to see
 * (the status panel). Both are the same frame: a title in the page title's style, centred in
 * the content area, with a running bar under a loading panel and a description and what to
 * do under a status panel. The shell shows them while a module loads or fails to; a module
 * shows the same for its own page, so the two read as one.
 *
 * Anatomy: area; panel (icon, title, description, actions | track, fill)
 */

/* ==========================================
   AREA
   ========================================== */

/* The content area's own centre, inside the shell's sidebar and pill bar. The height is the
   content area's, which the shell publishes; the fallback is the same sum, for a page shown
   without it. */
.loading-area,
.status-area {
    min-height: var(--content-height, calc(100vh - var(--spacing-5) - var(--page-bottom)));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   PANEL
   ========================================== */

.loading-panel,
.status-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.loading-panel__title,
.status-panel__title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-title);
}

/* ==========================================
   STATUS PANEL
   ========================================== */

/* Each tone sets the accent its icon is drawn in. */
.status-panel {
    --status-panel-accent: var(--icon-secondary);
}

.status-panel--error {
    --status-panel-accent: #c62828;
}

.status-panel--warning {
    --status-panel-accent: #e65100;
}

.status-panel--success {
    --status-panel-accent: #2e7d32;
}

.status-panel--info {
    --status-panel-accent: #1565c0;
}

.status-panel__icon {
    display: inline-flex;
    font-size: 2rem;
    color: var(--status-panel-accent);
}

.status-panel__description {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-m);
    color: var(--text-paragraph);
}

/* What to do about it (try again, go elsewhere): buttons, at the start of the line. */
.status-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-2);
}

/* ==========================================
   LOADING PANEL
   ========================================== */

.loading-panel__track {
    width: 100%;
    max-width: 470px;
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-secondary);
    overflow: hidden;
}

.loading-panel__fill {
    width: 25%;
    height: 100%;
    border-radius: var(--radius-full);
    background-color: var(--color-fire);
    animation: loadingPanelBar 1.2s ease-in-out infinite;
}

/* Still, and across the whole track at half strength: a quarter of it standing still would
   read as a quarter done. The title still says what is loading. */
@media (prefers-reduced-motion: reduce) {
    .loading-panel__fill {
        width: 100%;
        opacity: 0.5;
        animation: none;
    }
}

@keyframes loadingPanelBar {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

/* ==========================================
   STATUS TEXT
   The same news inside a page rather than in place of it: a tab's list still loading, or a
   search that matched nothing. One quiet line, where the content will be.
   ========================================== */

.status-text {
    margin: 0;
    color: var(--text-paragraph);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

/* A status panel arrives rather than appearing in place (motion.css). */
.status-panel {
    animation: motion-arrive var(--motion-duration-enter) var(--motion-ease-enter) backwards;
}
/**
 * Nimbus Design System - Tiles
 *
 * The overview layout: an entity's header (its mark beside its name), and its people and
 * what it pays for, each a grid of small tiles — as many to a row as the width holds, so a
 * wide window shows more of them side by side rather than stretching any one across it.
 *
 * Anatomy: entity header (mark, title, subtitle, actions), logo mark (image or initial),
 * tile section (title, groups), tile grid, tile, person tile (avatar, name, detail, status)
 */

/* ==========================================
   ENTITY HEADER
   ========================================== */

.entity-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    min-width: 0;
}

/* The name, and under it a line about it (an organisation's type, say). */
.entity-header__identity {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    min-width: 0;
}

/* The page title's style everywhere (.page-title), without its margin: the header spaces it. */
.entity-header__title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-default);
    color: var(--text-title);
    overflow-wrap: anywhere;
}

.entity-header__subtitle {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
}

/* Pushed to the far end of the header, across from the name it edits. */
.entity-header__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-left: auto;
    flex-shrink: 0;
}

/* ==========================================
   LOGO MARK
   ========================================== */

/* An organisation's mark: its logo on white, framed as a tile, or its initial. Held to the
   header's height, so a tall or square logo shrinks to fit rather than pushing it taller. */
.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    height: 3.5rem;
    min-width: 3.5rem;
    max-width: 10rem;
    padding: var(--spacing-2) var(--spacing-3);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-md);
}

.logo-mark__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-mark__initial {
    font-family: var(--font-family);
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-bold);
    color: var(--text-title);
}

/* ==========================================
   TILE SECTION
   A heading over one or more grids of tiles.
   ========================================== */

.tile-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

/* As the settings cards and dashboard widgets head theirs: a step below the page title and a
   step above the names in the tiles it heads. */
.tile-section__title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
}

/* One level within a section (the primary user, then the admins): its heading, then its row. */
.tile-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

/* More room above a group than inside one, so each heading reads as starting its own row
   rather than ending the row above. */
.tile-group + .tile-group {
    margin-top: var(--spacing-2);
}

/* A step below the section's heading: smaller, and in the paragraph colour. */
.tile-group__title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-paragraph);
}

/* ==========================================
   TILE GRID
   ========================================== */

/* As many tiles to a row as the width holds, each between --tile-min-width and two columns'
   worth. Set --tile-min-width on the grid for a different floor, and --tile-gap for a wider
   gap (a grid of larger cards takes --spacing-4). Works as a <ul> too. */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--tile-min-width, 18rem), 100%), 1fr));
    gap: var(--tile-gap, var(--spacing-3));
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A grid that is a list: each tile in an <li>, which may shrink with its column. */
.tile-grid__item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Whatever the item holds fills it, so a row's tiles are one height. */
.tile-grid__item > * {
    flex: 1;
}

/* ==========================================
   TILE
   ========================================== */

/* A card's surface at a tile's size: the medium radius, as the large one reads as a panel at
   these heights. Its contents sit in a row. */
.tile {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    box-sizing: border-box;
    min-width: 0;
    padding: var(--spacing-4);
    font-family: var(--font-family);
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-md);
}

/* ==========================================
   TEXT TILE
   A record that is mostly words: its lines, the title between a small line over it and
   quieter ones under it, and one action at the far end.
   ========================================== */

/* Beside a few lines, the action sits at their top rather than across from their middle. */
.text-tile--start {
    align-items: flex-start;
}

.text-tile__lines {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--spacing-2);
    min-width: 0;
}

.text-tile__eyebrow,
.text-tile__meta {
    color: var(--text-paragraph);
    font-size: var(--font-size-xs);
    line-height: 1.5;
}

/* Kept as written, line breaks and all, and broken anywhere rather than overflowing. */
.text-tile__title {
    color: var(--text-title);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.text-tile__action {
    display: inline-flex;
    flex-shrink: 0;
}

/* ==========================================
   MODULE TILE
   A Nimbus module: its mark on its colour, its name with what it is under it, and where it
   stands at the far end.
   ========================================== */

/* A row's tiles finish level, so a tile beside a wrapped description is as tall as it. */
.module-tile {
    height: 100%;
}

/* White on the module's colour; on the neutral one where it has none. */
.module-tile__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    background-color: var(--icon-disable);
    color: var(--text-invert);
    font-size: 1.25rem;
}

.module-tile__lines {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--spacing-1);
    min-width: 0;
}

.module-tile__name {
    color: var(--text-title);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    overflow-wrap: anywhere;
}

.module-tile__description {
    color: var(--text-paragraph);
    font-size: var(--font-size-xs);
}

/* A module only named, not acted on (what someone can use, as the welcome lists them): no box
   to suggest it can be pressed, and its mark tinted rather than filled. */
.module-tile--plain {
    padding: var(--spacing-2) 0;
    background-color: transparent;
    border: none;
}

.module-tile--plain .module-tile__icon {
    background-color: var(--brand-wash, var(--bg-surface-secondary));
    color: var(--brand-red, var(--icon-hero));
}

.module-tile--plain .module-tile__name {
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-semibold);
}

.module-tile--plain .module-tile__description {
    font-size: var(--font-size-sm);
}

.module-tile__status {
    flex-shrink: 0;
}

/* ==========================================
   PERSON TILE
   ========================================== */

/* Their initials, standing in for a picture. Also on its own, wherever a person is listed. */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    overflow: hidden;
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-secondary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--text-title);
}

.avatar__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-tile__lines {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.person-tile__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
}

.person-tile__detail {
    font-size: var(--font-size-xs);
    color: var(--text-paragraph);
}

/* Where they stand (an invitation still waiting, say), at the far end of the row. */
.person-tile__status {
    flex-shrink: 0;
    white-space: nowrap;
}
/**
 * Nimbus Design System - Detail tiles
 *
 * A record's overview: tiles two to a row, one on a narrow window, each an icon and its labelled
 * values side by side. The tile's surface is the shared .tile; only its contents are laid out here.
 */

.detail-tiles {
    display: grid;
    gap: var(--spacing-3);
}

@media (min-width: 48rem) {
    .detail-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* A row's tiles finish level, so a tile beside a wrapped address is as tall as it. */
.detail-tile {
    align-self: stretch;
}

.detail-tile__icon {
    display: inline-flex;
    flex-shrink: 0;
    font-size: 1.125rem;
    color: var(--icon-disable);
}

/* Stretched to the tile's height, so the labels sit along its top and the values along its
   bottom, level across the row however many lines the value beside them takes. */
.detail-tile__entries {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--spacing-4);
    flex: 1;
    align-self: stretch;
    min-width: 0;
    margin: 0;
}

.detail-tile__entry {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--spacing-2);
    min-width: 0;
}

.detail-tile__label {
    color: var(--text-paragraph);
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}

.detail-tile__value {
    margin: 0;
    color: var(--text-title);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-medium);
    overflow-wrap: anywhere;
    /* A note typed over several lines reads over several lines. */
    white-space: pre-line;
}

/* Across the whole row, rather than one column of it. */
.detail-tile--wide {
    grid-column: 1 / -1;
}

/* Set apart from the tiles around it, on a light tint of the colour it is given. */
.detail-tile--tinted {
    background-color: color-mix(in srgb, var(--detail-tile-tint) 10%, transparent);
    border-color: transparent;
}

/* Compact: in a pane or a drawer, each tile one fact read at a glance. Tighter, with its label
   and value together in its middle rather than along its top and bottom, and the value bold. */
.detail-tiles--compact > .detail-tile {
    padding: var(--spacing-3) var(--spacing-4);
}

.detail-tiles--compact .detail-tile__entry {
    justify-content: center;
    gap: calc(var(--spacing-1) / 2);
}

.detail-tiles--compact .detail-tile__value {
    font-weight: var(--font-weight-bold);
}

.detail-tile__value--unset {
    color: var(--text-disable);
    font-weight: var(--font-weight-regular);
}

/**
 * Nimbus Design System - Image Upload
 *
 * A field for one picture, such as an organisation's logo: an Upload button that becomes a
 * preview with Remove and Replace once there is a picture to show.
 *
 * Anatomy: label, hidden file input, preview (image, actions), error
 */

/* ==========================================
   IMAGE UPLOAD
   ========================================== */

.image-upload {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-2);
}

/* Matches a drawer's field labels: the picker is a field, so it reads as one even though it
   is a button rather than an input. */
.image-upload__label {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    line-height: 1.5;
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
}

/* The native control is driven by the Upload and Replace buttons. */
.image-upload__input {
    display: none;
}

.image-upload__preview {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    width: 100%;
}

.image-upload__image {
    /* Contain so a wide or tall picture is shown whole rather than cropped by the frame. A
       photo of a place is shown taller than a logo: set --image-upload-preview-height. The
       border is inside the width, so the frame does not overflow the field. */
    box-sizing: border-box;
    width: 100%;
    max-height: var(--image-upload-preview-height, 8rem);
    object-fit: contain;
    background-color: var(--bg-cs-bg);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-md);
}

.image-upload__actions {
    display: flex;
    gap: var(--spacing-2);
}

/* ==========================================
   DROPZONE
   In place of the Upload button: a target to drop a file on, or to press to pick one.
   ========================================== */

.image-upload__dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    box-sizing: border-box;
    width: 100%;
    padding: var(--spacing-8) var(--spacing-6);
    background: none;
    /* Dashed, as the design draws it: it reads as a target rather than a filled field. */
    border: 1px dashed var(--bg-button-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background-color var(--transition-fast);
}

.image-upload__dropzone:hover {
    border-color: var(--border-40);
}

.image-upload__dropzone:focus-visible {
    outline: 2px solid var(--border-brand);
    outline-offset: 2px;
}

/* A file is being dragged over it: it will take it. */
.image-upload__dropzone--active {
    border-color: var(--border-100);
    background-color: var(--bg-surface-secondary);
}

.image-upload__dropzone:disabled,
.image-upload__dropzone--disabled {
    border-color: var(--border-20);
    cursor: not-allowed;
}

/* A target with its own Choose file button: filled, as the design draws it, and taller, so the
   button sits under the prompt with room around it. Only the button is pressed. */
.image-upload__dropzone--with-button {
    gap: var(--spacing-3);
    padding: var(--spacing-8) var(--spacing-6);
    background-color: var(--bg-surface-secondary);
    cursor: default;
}

.image-upload__dropzone--with-button .image-upload__dropzone-icon {
    font-size: 1.5rem;
}

.image-upload__dropzone--with-button .image-upload__prompt {
    font-size: var(--font-size-m);
}

.image-upload__dropzone-icon {
    display: inline-flex;
    font-size: 1rem;
    color: var(--icon-secondary);
}

.image-upload__prompt {
    font-size: var(--font-size-sm);
    line-height: 1.5;
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
}

.image-upload__hint {
    font-size: var(--font-size-xs);
    line-height: 1.5;
    color: var(--icon-disable);
}

/* ==========================================
   PREPARING
   Shown while a picked file is being prepared (a photo shrunk), in place of the dropzone or
   the preview.
   ========================================== */

.image-upload__busy {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: var(--spacing-4);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
    background-color: var(--bg-cs-bg);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-md);
}

.image-upload__spinner {
    flex-shrink: 0;
    animation: image-upload-spin 1s linear infinite;
}

/* The words still say what is happening. */
@media (prefers-reduced-motion: reduce) {
    .image-upload__spinner {
        animation: none;
    }
}

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

/**
 * Nimbus Design System - Brand
 *
 * The brand's own colours and its gradient, for the places that speak as Nimbus rather than as
 * a module: the welcome, the home page's spotlight, a call to get started. Hand-written, apart
 * from the generated theme, since none of it is a Figma token.
 *
 * Anatomy: brand tokens, brand light (the brand's colours held light over the artwork), brand
 * surface (the gradient as a background), brand button (the gradient as a pill), brand mark (a
 * word picked out in the brand red), icon tile (an icon in a brand-tinted square)
 */

/* ==========================================
   TOKENS
   ========================================== */

:root {
    /* The red of the logo and the word "Nimbus" in the welcome. */
    --brand-red: #c8102e;
    /* Headings that speak as Nimbus: a navy just short of black. */
    --brand-ink: #15123a;
    /* The artwork. Replacing the file changes it everywhere it is shown. */
    --brand-gradient-image: url("/assets/brand-gradient-ChcFUdWy.svg");
    /* The artwork's colours as a strip, for a surface too small or too narrow to show it. */
    --brand-gradient-strip: linear-gradient(
        100deg,
        #1a2468 0%,
        #6b2a86 38%,
        #e5001f 78%,
        #ff5a78 100%
    );
    /* A brand-red wash, for a selection that belongs to the brand (the sidebar's current page). */
    --brand-wash: color-mix(in srgb, var(--brand-red) 9%, transparent);
    /* Body text beside the brand ink: the theme's, except where held light (see LIGHT). */
    --brand-ink-soft: var(--text-paragraph);
    /* The glow under the gradient pill: the artwork's red. */
    --brand-glow: #e5001f;
    /* Text and marks on the brand's red and on its gradient pill: white whatever the theme. */
    --brand-contrast: #ffffff;
    /* What shows behind the artwork while it loads, and round it where it doesn't reach. */
    --brand-ground: #eceef6;
    /* Frosted white over the artwork: a tile on it, and the edge of a panel floating on it. */
    --brand-glass: rgba(255, 255, 255, 0.85);
    --brand-glass-edge: color-mix(in srgb, #ffffff 55%, transparent);
}

/* On a dark page the red is lifted and the ink gives way to the theme's title colour, so both
   keep their contrast. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand-red: #ff5470;
        --brand-ink: var(--text-title);
        --brand-wash: color-mix(in srgb, var(--brand-red) 16%, transparent);
    }
}

[data-theme="dark"] {
    --brand-red: #ff5470;
    --brand-ink: var(--text-title);
    --brand-wash: color-mix(in srgb, var(--brand-red) 16%, transparent);
}

/* ==========================================
   LIGHT
   The artwork is pale whatever the theme, so whatever sits on it keeps the brand's light
   colours rather than the theme's: the ink, a softer ink for body text, and the red.
   ========================================== */

.brand-light,
.brand-surface,
.brand-surface .brand-surface__title {
    --brand-red: #c8102e;
    --brand-ink: #15123a;
    --brand-ink-soft: #3d3a5c;
    --brand-ink-hover: #2a2560;
}

/* ==========================================
   SURFACE
   The artwork as a background, covering whatever it is on. It is pale at the top left and
   dark at the bottom right, so text on it starts at the top left.
   ========================================== */

.brand-surface {
    background-color: var(--brand-ground);
    background-image: var(--brand-gradient-image);
    background-size: cover;
    background-position: center;
    color: var(--brand-ink);
}

/* The artwork is pale whatever the theme, so a primary button on it keeps the brand ink rather
   than the theme's (which goes grey on a dark page). */
.brand-surface .btn--primary {
    background-color: var(--brand-ink);
    color: var(--brand-contrast);
}

.brand-surface .btn--primary:hover {
    background-color: var(--brand-ink-hover);
    color: var(--brand-contrast);
}

.brand-surface__eyebrow {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-ink);
}

.brand-surface__title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    color: var(--brand-ink);
}

/* ==========================================
   BUTTON
   The gradient as a pill: the one call to action on a brand surface ("Get started"). Its
   colours drift across it when pointed at.
   ========================================== */

.btn--brand {
    border: none;
    border-radius: 999px;
    padding: var(--spacing-3) var(--spacing-6);
    background-image: var(--brand-gradient-strip);
    background-size: 140% 100%;
    background-position: 0% 50%;
    color: var(--brand-contrast);
    font-weight: var(--font-weight-semibold);
    box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--brand-glow) 70%, transparent);
    transition:
        background-position 600ms ease,
        box-shadow 200ms ease,
        transform 200ms ease;
}

.btn--brand:hover {
    background-position: 100% 50%;
    color: var(--brand-contrast);
    box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--brand-glow) 85%, transparent);
}

.btn--brand:active {
    transform: translateY(1px);
}

.btn--brand:focus-visible {
    outline: 2px solid var(--brand-ink);
    outline-offset: 3px;
}

.btn--brand:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    .btn--brand {
        transition: none;
    }
}

/* ==========================================
   MARK
   A word picked out in the brand red: "Nimbus" in "Welcome to Nimbus".
   ========================================== */

.brand-mark {
    color: var(--brand-red);
}

/* ==========================================
   ICON TILE
   An icon in a brand-tinted square: what a tour, a module or a setting is, at a glance. Larger
   for a title card; frosted where it sits on the artwork.
   ========================================== */

.icon-tile {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-lg);
    background-color: var(--brand-wash);
    color: var(--brand-red);
    font-size: 1.1rem;
}

.icon-tile--lg {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-xl);
    font-size: 1.4rem;
}

/* Quieter, for a list of them side by side (the widgets to choose from). */
.icon-tile--neutral {
    background-color: var(--bg-surface-secondary);
}

.icon-tile--glass {
    background-color: var(--brand-glass);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-md);
}

/**
 * Nimbus Design System - Widgets
 *
 * The home page's board: a grid of widgets, each a card a module (or the shell) fills with a
 * glance at its data and a way into it. The shell draws the board and each card's frame; a
 * widget draws its body from the parts below, so every module's widgets read as one set.
 *
 * Anatomy: board (grid, add slot), widget card (header, body, footer), stat (label, value,
 * detail, meter), widget rows (a coloured mark, a label, a count), widget state (loading, error)
 */

/* ==========================================
   BOARD
   Three columns where there is room, two, then one. A widget spans one, two or all three
   (data-size small, medium, large), never more than the board has.
   ========================================== */

.widget-board {
    --widget-board-columns: 3;
    --widget-min-height: 21rem;
    display: grid;
    grid-template-columns: repeat(var(--widget-board-columns), minmax(0, 1fr));
    grid-auto-rows: minmax(var(--widget-min-height), auto);
    gap: var(--spacing-5);
}

@media (max-width: 1279px) {
    .widget-board {
        --widget-board-columns: 2;
    }
}

.widget-board > [data-size="medium"] {
    grid-column: span 2;
}

.widget-board > [data-size="large"] {
    grid-column: 1 / -1;
}

@media (max-width: 759px) {
    .widget-board {
        --widget-board-columns: 1;
    }

    .widget-board > [data-size="medium"] {
        grid-column: auto;
    }

    /* A whole widget's height of empty space is a lot to scroll past on a phone. */
    .widget-board__add {
        min-height: 8rem;
    }
}

/* The cards rise in one after another as the board opens (--i: each one's place on it), and one
   added arrives the same way. Once played it stays played, so moving or resizing a card doesn't
   replay it. */
.widget-board > .widget-card,
.widget-board > .widget-board__add {
    animation: widget-board-rise 450ms var(--motion-ease-enter) both;
    animation-delay: calc(min(var(--i, 0), 8) * 40ms);
}

/* Half a rem and barely smaller: the board settling into place, as the rest of the app's content
   arrives, rather than cards flying up. */
@keyframes widget-board-rise {
    from {
        opacity: 0;
        transform: translateY(0.5rem) scale(0.99);
    }
}

@media (prefers-reduced-motion: reduce) {
    .widget-board > .widget-card,
    .widget-board > .widget-board__add {
        animation: none;
    }
}

/* The board's last slot: a dashed outline asking for another widget. */
.widget-board__add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    min-height: var(--widget-min-height);
    border: 1px dashed var(--border-60);
    border-radius: var(--radius-2xl);
    background: transparent;
    color: var(--text-title);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast);
}

.widget-board__add svg {
    font-size: 1.25rem;
    color: var(--icon-secondary);
}

.widget-board__add:hover {
    background-color: var(--bg-surface-primary);
    border-color: var(--border-100);
}

.widget-board__add:focus-visible {
    outline: 2px solid var(--border-100);
    outline-offset: 2px;
}

/* ==========================================
   WIDGET CARD
   ========================================== */

.widget-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    min-width: 0;
    padding: var(--spacing-5);
    box-sizing: border-box;
    background-color: var(--bg-surface-primary);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-2xl);
}

.widget-card__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    min-height: 1.75rem;
}

.widget-card__icon {
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--brand-red, var(--color-fire));
}

.widget-card__title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-m);
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Grows to push the footer to the card's foot, so cards side by side end their buttons level. */
.widget-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    flex: 1 1 auto;
    min-height: 0;
}

.widget-card__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-2);
    margin-top: auto;
}

/* A widget that draws its own surface edge to edge (the spotlight): the card keeps its shape
   and the board's rhythm, but gives its padding and border to what is inside. */
.widget-card--bare {
    padding: 0;
    border: none;
    overflow: hidden;
}

/* Raised off what it sits on: a card shown as an example, over a surface of its own colour. */
.widget-card--raised {
    box-shadow: var(--shadow-card);
}

/* A card being arranged: outlined and draggable. A bare card clips what it holds to its corners,
   which would clip the tools on its edge too, so it follows the bare card here. */
.widget-card--editing {
    outline: 2px dashed var(--border-60);
    outline-offset: 3px;
    cursor: grab;
    overflow: visible;
}

/* ==========================================
   STAT
   One figure in a framed tile: what it counts, the number, and a line about it.
   ========================================== */

.widget-stat {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    padding: var(--spacing-4);
    border: 1px solid var(--border-20);
    border-radius: var(--radius-xl);
    min-width: 0;
}

/* Fills the card's body: a single figure, centred in the room it has. */
.widget-stat--fill {
    flex: 1 1 auto;
    justify-content: center;
}

.widget-stat__label {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-paragraph);
}

.widget-stat__label svg {
    flex-shrink: 0;
    color: var(--icon-secondary);
}

.widget-stat__value {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-2);
    margin: 0;
    font-family: var(--font-family);
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.15;
    color: var(--text-title);
    font-variant-numeric: tabular-nums;
}

.widget-stat--fill .widget-stat__value {
    font-size: 2.75rem;
}

.widget-stat__detail {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
}

/* A round mark over a filled stat: what it counts, as a picture. */
.widget-stat__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: var(--spacing-2);
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-secondary);
    color: var(--icon-hero);
}

/* How much of a whole the figure is: a track with a filled share (style="--meter: 0.11"). */
.widget-meter {
    height: 0.375rem;
    margin-top: var(--spacing-2);
    border-radius: var(--radius-full);
    background-color: var(--bg-surface-invert-2);
    overflow: hidden;
}

.widget-meter::before {
    content: "";
    display: block;
    height: 100%;
    width: calc(var(--meter, 0) * 100%);
    min-width: 0.375rem;
    border-radius: inherit;
    background-color: var(--meter-colour, var(--brand-red, var(--color-fire)));
}

/* ==========================================
   ROWS
   A short list of counts, each led by a mark in its own colour (style="--row-colour: …").
   ========================================== */

.widget-rows {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.widget-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface-secondary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-title);
}

.widget-row::before {
    content: "";
    flex-shrink: 0;
    width: 3px;
    height: 1.25rem;
    border-radius: var(--radius-full);
    background-color: var(--row-colour, var(--color-inactive));
}

.widget-row__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: var(--font-weight-bold);
}

/* A row about one thing (a panel, a person): its name, and a line under it saying where or who. */
.widget-row__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.widget-row__detail {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    color: var(--text-paragraph);
}

/* In place of a count: a short note on the row's state ("Service · 3 hours ago"). */
.widget-row__meta {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--spacing-1);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    color: var(--text-paragraph);
}

/* A state that wants someone to look: in the alarm red, and bolder. */
.widget-row__meta--alert {
    color: var(--color-fire);
    font-weight: var(--font-weight-semibold);
}

/* A line under a widget's rows: how many more there are, or why a figure is a floor. */
.widget-note {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
}

.widget-row__count {
    font-size: var(--font-size-l);
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
}

/* A widget's rows while they load (WidgetRowsSkeleton): laid out in the card as the rows will be. */
.widget-rows-skeleton {
    display: contents;
}

/* ==========================================
   STATE
   What a widget shows while its data is on the way, or when it could not be had.
   ========================================== */

.widget-state {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-paragraph);
    text-align: center;
}

/* Nothing wrong: the state led by a tick in the cleared green. */
.widget-state--good svg {
    font-size: 1.75rem;
    color: var(--color-cleared);
}

/* Nothing to show yet, and nothing wrong either: led by the subject's icon, muted, with a title
   saying why above the line saying what to do. */
.widget-state--empty svg {
    font-size: 1.75rem;
    color: var(--text-paragraph);
    opacity: 0.6;
}

.widget-state__title {
    font-weight: var(--font-weight-semibold);
    color: var(--text-title);
}

.widget-state p {
    margin: 0;
}

/* A widget's state fades in once it loads, and the good state's tick pops (motion.css). The
   card rising carries the rest. */
.widget-state {
    animation: motion-fade var(--motion-duration-fade) var(--motion-ease-out) backwards;
}

.widget-state--good svg {
    --motion-pop-from: 0.6;
    animation: motion-pop var(--motion-duration-pop) var(--motion-ease-pop) 50ms backwards;
}

/* ==========================================
   METER
   How much of an allowance is used. The track is the maximum; the fill turns amber at it
   and red past it, the status colours the badges use.
   ========================================== */

.meter {
    position: relative;
    inline-size: 100%;
    block-size: 0.5rem;
    border-radius: var(--radius-full);
    background-color: var(--border-20);
    overflow: hidden;
}

.meter__fill {
    block-size: 100%;
    border-radius: inherit;
    background-color: var(--text-title);
    transition:
        width var(--motion-duration-quick) var(--motion-ease-out),
        background-color var(--motion-duration-quick) var(--motion-ease-out);
}

.meter--warning .meter__fill {
    background-color: #e65100;
}

.meter--danger .meter__fill {
    background-color: #c62828;
}

@media (prefers-reduced-motion: reduce) {
    .meter__fill {
        transition: none;
    }
}

/* ==========================================
   STEPS
   Where a multi-step drawer has got to: equal segments, a bar on top and the label under it,
   the bar filled for the steps done and the current one.
   ========================================== */

.steps {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: var(--spacing-2);
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-sm);
}

.steps__step {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    min-width: 0;
    color: var(--text-paragraph);
}

.steps__step::before {
    content: "";
    height: var(--spacing-1);
    border-radius: var(--radius-full);
    background: var(--border-20);
}

.steps__step--current {
    color: var(--text-title);
    font-weight: var(--font-weight-bold);
}

.steps__step--current::before,
.steps__step--done::before {
    background: var(--border-100);
}

/* A narrow drawer cuts a long label short rather than wrapping it under its neighbours. */
.steps__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Said by a screen reader, never shown. */
.steps__hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
/* ==========================================
   DRAWER STEP HEADER
   The flow's name, the step's title and description, then the step indicator, at the top of a
   multi-step drawer's body.
   ========================================== */

.drawer-step-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-1);
    /* A name in the title or description is unbroken text as often as not. */
    min-width: 0;
    overflow-wrap: anywhere;
}

.drawer-step-header__eyebrow,
.drawer-step-header__description {
    margin: 0;
    color: var(--text-paragraph);
    font-size: var(--font-size-sm);
}

.drawer-step-header__eyebrow {
    font-weight: var(--font-weight-semibold);
}

.drawer-step-header .drawer-step-header__title {
    margin: 0;
}

/* Focus moves here on a step change for a screen reader; it is not a control. */
.drawer-step-header__title:focus {
    outline: none;
}

.drawer-step-header__steps {
    margin-block-start: var(--spacing-3);
}

:root {
    font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    font-weight: 400;

    color: var(--text-paragraph);
    background-color: var(--bg-surface-primary);

    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    display: flex;
    place-items: center;
    min-width: 320px;
    min-height: 100vh;
}

h1 {
    font-size: 3.2em;
    line-height: 1.1;
    color: var(--text-title);
}
