/* ═══════════════════════════════════════════════════════════════
   QuadraBay Data — App Stylesheet
   Material 3 via MudBlazor + custom design tokens
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
    /* Type scale (11 November 2026). One set of sizes for the whole portal: a rule names a step and never a size of
       its own, so a size changes in one place. The MudBlazor theme's typography (Layout/AppTheme.cs) reads the same
       steps, so MudText follows them too. The sizes are in rem (16 px at the browser's usual setting), so they
       follow the text size a staff member has set in the browser. LooseFontSizeTests counts the sizes written
       outside the scale and fails when there are more. */
    --app-font-mark: 0.5625rem;          /* 9 px: a mark on a thumbnail, too small a place for words to be read at length */
    --app-font-micro: 0.625rem;          /* 10 px: counts and the smallest marks */
    --app-font-label: 0.75rem;           /* 12 px: labels and table headings, in sentence case (12 November 2026; 11 px in capitals before) */
    --app-font-caption: 0.75rem;         /* 12 px: hints, badges and small print (Typo.caption, Typo.overline) */
    --app-font-detail: 0.8125rem;        /* 13 px: a row's second line and dense controls */
    --app-font-body: 0.875rem;           /* 14 px: body text (the default, Typo.body2, Typo.subtitle2, buttons) */
    --app-font-reading: 0.9375rem;       /* 15 px: text read at length, such as a guide or an email being written */
    --app-font-card: 1rem;               /* 16 px: card and dialog titles, a record's first name (Typo.body1, Typo.subtitle1) */
    --app-font-section: 1.125rem;        /* 18 px: section titles */
    --app-font-heading: 1.25rem;         /* 20 px: headings (Typo.h6) */
    --app-font-title-narrow: 1.375rem;   /* 22 px: the page title on a narrow screen */
    --app-font-headline: 1.5rem;         /* 24 px: the title of a case or an enquiry (Typo.h5) */
    --app-font-title: 1.625rem;          /* 26 px: page titles (Typo.h4) */
    /* Figures have steps of their own, so a tile's number can change without moving a title. */
    --app-font-figure: 1.625rem;         /* 26 px: the number on a figure tile */
    --app-font-figure-compact: 1.375rem; /* 22 px: the number on a tile in a strip */
    --app-font-figure-large: 3rem;       /* 48 px: a risk score (Typo.h3) */

    /* Status badge tones (11 November 2026). StatusBadge draws each tone StatusColors can give from these three
       values: the fill and the text of a filled badge, and the ink of an outlined or a tinted one. The first value
       in each light-dark() is the light theme's; the second is the dark theme's.
       Light: a pale fill with dark words of the same hue, as the design kit draws a badge. MudBlazor's own chip was
       white on the theme's bright colours (warning 2.15 to 1, success 2.54, info 3.68, error 3.76), and an outlined
       one was the bright colour on white, no better. Success, warning, error, info, default are the kit's tones;
       primary (blue), secondary (indigo) and tertiary (teal) follow them. "Dark" stays a solid slate with white
       words: it marks the top of a scale (a very high risk) and has to outrank the red beside it.
       Dark: deep fills with pale words; a colour's ink is the dark theme's own colour, except "dark", which was the
       colour of the page.
       Every pair in both themes is at least 4.5 to 1 (WCAG AA): the text on its fill, and the ink on a card, on the
       page, on a row under the pointer and on a tinted badge's wash. StatusBadgeToneTests checks them, along with
       there being a set for every tone StatusColors uses. */
    --app-badge-default-fill: light-dark(#f1f5f9, #475569);
    --app-badge-default-text: light-dark(#334155, #f8fafc);
    --app-badge-default-ink: light-dark(#334155, #f8fafc);
    --app-badge-primary-fill: light-dark(#dbeafe, #0369a1);
    --app-badge-primary-text: light-dark(#1e40af, #f0f9ff);
    --app-badge-primary-ink: light-dark(#1e40af, #0ea5e9);
    --app-badge-secondary-fill: light-dark(#e0e7ff, #075985);
    --app-badge-secondary-text: light-dark(#3730a3, #e0f2fe);
    --app-badge-secondary-ink: light-dark(#3730a3, #38bdf8);
    --app-badge-tertiary-fill: light-dark(#ccfbf1, #115e59);
    --app-badge-tertiary-text: light-dark(#115e59, #f0fdfa);
    --app-badge-tertiary-ink: light-dark(#115e59, #1ec8a5);
    --app-badge-info-fill: light-dark(#e0f2fe, #155e75);
    --app-badge-info-text: light-dark(#075985, #ecfeff);
    --app-badge-info-ink: light-dark(#075985, #06b6d4);
    --app-badge-success-fill: light-dark(#ecfdf5, #065f46);
    --app-badge-success-text: light-dark(#065f46, #ecfdf5);
    --app-badge-success-ink: light-dark(#065f46, #34d399);
    --app-badge-warning-fill: light-dark(#fef3c7, #854d0e);
    --app-badge-warning-text: light-dark(#854d0e, #fef3c7);
    --app-badge-warning-ink: light-dark(#854d0e, #fbbf24);
    --app-badge-error-fill: light-dark(#fef2f2, #991b1b);
    --app-badge-error-text: light-dark(#991b1b, #fef2f2);
    --app-badge-error-ink: light-dark(#991b1b, #f87171);
    --app-badge-dark-fill: light-dark(#1e293b, #e2e8f0);
    --app-badge-dark-text: light-dark(#f8fafc, #0f172a);
    --app-badge-dark-ink: light-dark(#1e293b, #e2e8f0);

    /* Shadows (12 November 2026): wide, faint and in the ink's own blue-grey, so what floats seems to rest over the
       page and not to be cut out of it. xs is the whisper under a panel; lg and xl are for a menu and a dialog. */
    --app-shadow-xs: 0 1px 2px rgb(15 23 42 / 0.04);
    --app-shadow-sm: 0 1px 2px rgb(15 23 42 / 0.04), 0 2px 6px rgb(15 23 42 / 0.04);
    --app-shadow-md: 0 2px 4px rgb(15 23 42 / 0.04), 0 8px 16px rgb(15 23 42 / 0.06);
    --app-shadow-lg: 0 4px 8px rgb(15 23 42 / 0.04), 0 16px 32px rgb(15 23 42 / 0.08);
    --app-shadow-xl: 0 8px 16px rgb(15 23 42 / 0.06), 0 24px 56px rgb(15 23 42 / 0.14);

    /* Radii */
    /* A scale of corners (12 November 2026; one 4 px corner the day before): the larger the thing, the rounder.
       sm for what is small inside a row (a row's action, a swatch, a menu's item); md for a control (a field, a
       button) and for a box inside a panel; lg for a panel that lies on the page; xl for what floats over it (a
       dialog). Pills and dots keep their own round shape; rows, tabs and parts that sit flush in a panel stay
       square, and the panel's own corner clips them. */
    --app-radius-sm: 6px;
    --app-radius-md: 8px;
    --app-radius-lg: 12px;
    --app-radius-xl: 16px;

    /* Transitions */
    --app-transition-fast: 0s;
    --app-transition-normal: 0s;

    /* The look-and-feel pass (12 November 2026). One value each for the things every page shares, so a change is
       made here and nowhere else. Every colour is one of the theme's own, so both themes follow. */

    /* Labels: a table's column headings, the label over a field or a value, the sidebar's group labels and a figure
       tile's label. Sentence case at the label step of the scale, semibold, in the secondary text colour, with no
       tracking: they were tracked capitals at 11 px, which shout, and Arabic has no capitals to match. */
    --app-label-weight: 600;
    --app-label-ink: var(--mud-palette-text-secondary);

    /* Density: a field's box and a table's row. */
    --app-control-height: 40px;
    --app-row-height: 44px;

    /* The top bar's height, which whatever sticks under it starts from, and the width of the sidebar when it is
       hidden to its rail of icons. */
    --app-topbar-height: 56px;
    --app-rail-width: 56px;
    --app-sticky-top: var(--app-topbar-height);

    /* Focus: a 2 px outline in the brand colour, 2 px clear of what it rings, on everything the keyboard can reach.
       The theme's primary is the brand blue in the light theme and its bright twin in the dark one, so the ring is
       at least 3 to 1 on a card and on the page in both (FocusAndMotionTests works the ratios out). */
    --app-focus-ring: var(--mud-palette-primary);
    --app-focus-width: 2px;
    --app-focus-offset: 2px;

    /* The tint: the selected or just-saved row and the place the staff member is in the sidebar and a section rail.
       The brand colour laid thinly on the surface, so it is a pale blue on white and a deep blue on the dark card. */
    --app-tint: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-surface));

    /* Motion, only as an answer to something the staff member did: a panel that opens, a dialog, a row just saved,
       the line under the top bar while a page is fetched. The reduced-motion block at the end of this file sets the
       durations to nothing. */
    --app-motion-panel: 140ms;
    --app-motion-fade: 120ms;
    --app-motion-flash: 900ms;
    --app-motion-ease: cubic-bezier(0.2, 0, 0, 1);

    /* Spacing scale (matches MudBlazor pa-/ma- values) */
    --app-gap-xs: 4px;
    --app-gap-sm: 8px;
    --app-gap-md: 16px;
    --app-gap-lg: 24px;
    --app-gap-xl: 32px;

    /* Shared interactive sizing */
    --app-control-sm-height: 36px;
    --app-control-touch-height: 44px;

    /* ── Trilingual entity-name display ──────────────────────────
       ONE place to retune the three name colours used by EntityNameStack.
       Native follows the theme's primary text colour; Arabic and English
       each own a distinct, clearly-different hue that stays readable in
       both themes. The second value in each light-dark() is the dark
       theme's (11 November 2026). */
    --entity-name-native: var(--mud-palette-text-primary);
    --entity-name-arabic: light-dark(#0f766e, #5eead4); /* teal 700, teal 300 */
    --entity-name-english: light-dark(#4f46e5, #93c5fd); /* indigo 600, blue 300 */
}

/* ── Which theme the browser is told ─────────────────────────────
   MudBlazor puts no class on the page for its dark theme (.mud-theme-dark is its utility for a part drawn in the
   "dark" colour), so a rule cannot select the dark theme. A value that differs in the dark theme is written with
   light-dark() where it is defined. The block of values that sat under .mud-theme-dark, and so never applied, went
   on 11 November 2026: the name colours had moved here, the sign-in page is never dark, and nothing used the rest.
   light-dark() picks its value from the element's color-scheme, and MudBlazor says which theme is on only through
   --mud-native-html-color-scheme. The parts whose colours differ in the dark theme take their color-scheme from it
   here. It is set on those parts and not on the page, so nothing else (native controls, embedded previews) changes. */
.mud-chip.status-badge,
.entity-name--arabic,
.entity-name--english,
.rich-text-editor__swatch,
.overview-history-value {
    color-scheme: var(--mud-native-html-color-scheme, light);
}

/* ── Status badges ───────────────────────────────────────────────
   The one status badge (Shared/StatusBadge.razor) takes its colours from the tone variables at the top of this
   file, so it looks right in both themes without knowing which is on. Each tone hands its three values to the
   badge; the three ways a badge is drawn use them: filled (the fill and its text), outlined (the ink, and a line
   of the ink) and tinted (the ink, on MudBlazor's faint wash of the theme's colour). Every selector carries three
   classes, to outweigh MudBlazor's two (.mud-chip-filled.mud-chip-color-x).
   A browser without light-dark() skips the block and draws the badge as MudBlazor does. */
@supports (color: light-dark(#000, #fff)) {
    .mud-chip.status-badge.mud-chip-color-default {
        --badge-fill: var(--app-badge-default-fill);
        --badge-text: var(--app-badge-default-text);
        --badge-ink: var(--app-badge-default-ink);
    }

    .mud-chip.status-badge.mud-chip-color-primary {
        --badge-fill: var(--app-badge-primary-fill);
        --badge-text: var(--app-badge-primary-text);
        --badge-ink: var(--app-badge-primary-ink);
    }

    .mud-chip.status-badge.mud-chip-color-secondary {
        --badge-fill: var(--app-badge-secondary-fill);
        --badge-text: var(--app-badge-secondary-text);
        --badge-ink: var(--app-badge-secondary-ink);
    }

    .mud-chip.status-badge.mud-chip-color-tertiary {
        --badge-fill: var(--app-badge-tertiary-fill);
        --badge-text: var(--app-badge-tertiary-text);
        --badge-ink: var(--app-badge-tertiary-ink);
    }

    .mud-chip.status-badge.mud-chip-color-info {
        --badge-fill: var(--app-badge-info-fill);
        --badge-text: var(--app-badge-info-text);
        --badge-ink: var(--app-badge-info-ink);
    }

    .mud-chip.status-badge.mud-chip-color-success {
        --badge-fill: var(--app-badge-success-fill);
        --badge-text: var(--app-badge-success-text);
        --badge-ink: var(--app-badge-success-ink);
    }

    .mud-chip.status-badge.mud-chip-color-warning {
        --badge-fill: var(--app-badge-warning-fill);
        --badge-text: var(--app-badge-warning-text);
        --badge-ink: var(--app-badge-warning-ink);
    }

    .mud-chip.status-badge.mud-chip-color-error {
        --badge-fill: var(--app-badge-error-fill);
        --badge-text: var(--app-badge-error-text);
        --badge-ink: var(--app-badge-error-ink);
    }

    .mud-chip.status-badge.mud-chip-color-dark {
        --badge-fill: var(--app-badge-dark-fill);
        --badge-text: var(--app-badge-dark-text);
        --badge-ink: var(--app-badge-dark-ink);
    }

    .mud-chip.status-badge.mud-chip-filled {
        background-color: var(--badge-fill);
        color: var(--badge-text);
    }

    .mud-chip.status-badge.mud-chip-outlined,
    .mud-chip.status-badge.mud-chip-text {
        color: var(--badge-ink);
    }

    /* An outlined badge's line is its ink, so the line and the words are one colour in both themes: MudBlazor's
       line is the theme's bright colour, which in the light theme no longer matches the words. A neutral badge
       keeps MudBlazor's grey line. */
    .mud-chip.status-badge.mud-chip-outlined:not(.mud-chip-color-default) {
        border-color: var(--badge-ink);
    }

    /* The "dark" colour's own wash is the colour of the dark page; its ink shows on this one. */

    .mud-chip.status-badge.mud-chip-text.mud-chip-color-dark {
        background-color: light-dark(var(--mud-palette-dark-hover), color-mix(in srgb, var(--badge-ink) 12%, transparent));
    }
}

/* ── Button casing ───────────────────────────────────────────
   Sentence case everywhere, matching the public dashboard. MudBlazor's
   default upper-case buttons are opted out here once instead of per page. */
.mud-button-root,
.mud-button-root .mud-button-label {
    text-transform: none;
    letter-spacing: normal;
}

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

.entity-name > span {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Prominence follows the line's ROLE, not its language: the first name shown leads,
   whichever language that turns out to be. Language classes below carry only colour
   (and the Arabic alignment), so reordering the stack cannot change the type scale. */
.entity-name--lead {
    font-size: var(--app-font-card);
    font-weight: 600;
    line-height: 1.3;
    color: var(--entity-name-native);
}

.entity-name--secondary {
    font-size: var(--app-font-detail);
    line-height: 1.35;
}

.entity-name--native {
    color: var(--entity-name-native);
}

.entity-name--arabic {
    /* LTR internal dashboard: keep the RTL name aligned with the stack's
       start edge rather than letting dir="rtl" push it to the right. */
    text-align: left;
    color: var(--entity-name-arabic);
}

.entity-name--english {
    color: var(--entity-name-english);
}

.entity-name__acronym {
    font-size: var(--app-font-caption);
    letter-spacing: 0.02em;
    color: var(--mud-palette-text-disabled);
}

/* Dense list rows: shrink the prominent line while keeping it larger
   than the coloured secondary lines. */
.entity-name--compact .entity-name--lead {
    font-size: var(--app-font-body);
}

.entity-name--compact .entity-name--secondary {
    font-size: var(--app-font-caption);
}

/* Country twin of the stack: flag + English lead (deliberate country
   convention), with the Arabic/Native variants stacked below in the
   shared trilingual colours. */
.country-display__secondary {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* ── Base ─────────────────────────────────────────────────────── */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── The rounding utilities ──────────────────────────────────────
   The MudBlazor theme sets LayoutProperties.DefaultBorderRadius = 8px
   (--app-radius-md) for a control. The rounding UTILITY classes are on
   papers, cards and grids, which are panels, so every one of them takes
   the panel's corner (--app-radius-lg) whatever size its name asks for;
   inside a panel they take the control's ("Soft corners and surfaces"). The one-sided utilities stay
   square: nothing uses them, and a part that sits flush inside a card
   should not round one edge. Identity shapes are exempt and keep their
   own geometry: chips and count pills, avatars, switches, circular
   icon-button ripples, rounded-circle / rounded-pill utilities. */
.rounded,
.rounded-sm,
.rounded-lg,
.rounded-xl {
    border-radius: var(--app-radius-lg) !important;
}

.rounded-t,
.rounded-b,
.rounded-s,
.rounded-e,
.rounded-ts,
.rounded-te,
.rounded-bs,
.rounded-be {
    border-radius: 0 !important;
}

/* Remove MudBlazor default 64px top padding (no MudAppBar used) */
.mud-main-content {
    padding-top: 0 !important;
}

/* ── Education chart edit-mode affordances ───────────────────── */
/* Bottom anchor grows on hover to signal "grab me" + active states bump
   further so the drag origin stays visible through the motion. */
.edu-anchor-source:hover {
    transform: scale(1.4);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35), 0 2px 6px rgba(0,0,0,0.18) !important;
}
.edu-anchor-source:active {
    transform: scale(1.25);
    cursor: grabbing !important;
}

/* While a connection drag is in flight, every card becomes a candidate drop
   target. Hovering over a card lights up its outline so the user can see
   that the drop will land there. */
body.edu-dragging { cursor: crosshair; }
body.edu-dragging [data-card-id] { transition: outline 80ms; }
[data-card-id].edu-drop-hover {
    outline: 3px dashed #6366f1;
    outline-offset: -3px;
}

/* The add-level slots, the row gutters and the context menu items darken on hover. The
   Content-Security-Policy runs no inline onmouseover/onmouseout handler, so the hover lives
   here, and the colours it changes are not written in the element's style attribute, which
   would win over :hover. The context menus are moved to <body>, out of the component. */
.edu-ghost-add {
    border: 2px dashed #94a3b8;
    background: #f6f8f9;
    /* 4.9:1 on the slot's background (WCAG AA asks for 4.5:1). */
    color: #5f6e84;
}
.edu-ghost-add:hover {
    border-color: #475569;
    background: #eef0f4;
    color: #334155;
}
.edu-row-gutter-add {
    border: 2px dashed #cbd5e1;
    background: #fafbfc;
    color: #64748b;
}
.edu-row-gutter-add:hover {
    border-color: #475569;
    background: #f2f5f8;
    color: #334155;
}
.edu-context-menu-item {
    background: none;
}
.edu-context-menu-item:hover {
    background: #f1f5f9;
}
.edu-context-menu-item-danger:hover {
    background: #fef2f2;
}

/* Tracing a card. The shared diagram script marks the card under the pointer or with keyboard
   focus data-edu-hover="self", the cards on its routes "linked" and its routes "lit", and the
   chart data-edu-hovering, all in the browser; these rules draw the result. The member portal's
   diagram carries the same rules. */
[data-edu-card] {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: opacity 120ms, box-shadow 120ms;
}
[data-edu-card][data-edu-hover="self"] {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px var(--edu-glow);
}
[data-edu-hovering] [data-edu-card]:not([data-edu-hover]) {
    opacity: 0.35;
}
.edu-route-rest > * {
    transition: opacity 120ms;
}
.edu-route-lit {
    display: none;
}
[data-edu-hover="lit"] > .edu-route-lit {
    display: inline;
}
[data-edu-hover="lit"] > .edu-route-rest {
    display: none;
}
[data-edu-hovering] .edu-route-rest > * {
    opacity: 0.1;
}

/* ═══════════════════════════════════════════════════════════════
   Sidebar
   ═══════════════════════════════════════════════════════════════ */
.sidebar .mud-drawer-content {
    background: var(--mud-palette-surface) !important;
    border-right: 1px solid var(--mud-palette-divider);
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 12px;
    cursor: pointer;
    user-select: none;
}

/* Spacer between sidebar nav groups */
.sidebar-spacer {
    height: 8px;
}

/* Section labels — one consistent rhythm above every group. */
.sidebar-section-label {
    padding: 18px 16px 4px;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    line-height: 1.2;
    color: var(--app-label-ink);
}

/* Nav links */
.sidebar-nav .mud-nav-link {
    min-height: 40px;
    margin: 1px 0;
    border-left: 3px solid transparent;
    border-radius: 0;
    font-size: var(--app-font-body);
    font-weight: 400;
    letter-spacing: 0.01em;
    padding-left: 13px !important;
    padding-right: 16px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    color: var(--mud-palette-drawer-text) !important;
}

.sidebar-nav .mud-nav-link .mud-icon-root {
    color: var(--mud-palette-drawer-icon) !important;
    font-size: 1.15rem !important;
}

.sidebar-nav .mud-nav-link:hover {
    border-left-color: color-mix(in srgb, var(--mud-palette-primary) 35%, transparent);
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, transparent) !important;
    color: var(--mud-palette-primary) !important;
}

.sidebar-nav .mud-nav-link:hover .mud-icon-root {
    color: var(--mud-palette-primary) !important;
}

/* Active: quiet full-width row with a strong location marker. Billing's link is marked by hand on its own pages below
   its address (sidebar-nav__item--current), since it matches only /admin/billing itself. */
.sidebar-nav .mud-nav-link.active,
.sidebar-nav .sidebar-nav__item--current .mud-nav-link {
    border-left-color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 11%, var(--mud-palette-surface)) !important;
    color: var(--mud-palette-primary) !important;
    font-weight: 600;
}

.sidebar-nav .mud-nav-link.active .mud-icon-root,
.sidebar-nav .sidebar-nav__item--current .mud-nav-link .mud-icon-root {
    color: var(--mud-palette-primary) !important;
}

.sidebar-nav .mud-nav-link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

/* Row layout for nav items that carry a trailing count pill:
   label and pill share one baseline, pill hugs the right edge. */
.sidebar-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

/* ── Nav count pills (expanded drawer) ──
   One pill component for every sidebar count. Neutral/grey for
   informational totals (Countries); the --alert variant is reserved for
   counts that genuinely require action (open enquiries awaiting staff). */
.sidebar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    flex-shrink: 0;
    font-size: var(--app-font-label);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    color: var(--mud-palette-text-secondary);
    background: color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
}

.sidebar-nav .mud-nav-link:hover .sidebar-count,
.sidebar-nav .mud-nav-link.active .sidebar-count {
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent);
}

/* Words on a fill of one of the theme's colours take that colour's own text colour, never a fixed white
   (11 November 2026): the dark theme's colours are bright, and white on them was 2.8 to 1. */
.sidebar-count--alert,
.sidebar-nav .mud-nav-link:hover .sidebar-count--alert,
.sidebar-nav .mud-nav-link.active .sidebar-count--alert {
    color: var(--mud-palette-error-text);
    background: var(--mud-palette-error);
}

/* ── Mini/collapsed sidebar badge counts ── */
.sidebar-mini-badge-wrap {
    position: relative;
}

.sidebar-mini-count {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: var(--app-font-micro);
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.sidebar-mini-count--error {
    color: var(--mud-palette-error-text);
    background: var(--mud-palette-error);
}

/* A count to work through that is not yet urgent (IQC investigations underway, none overdue). */
.sidebar-mini-count--info {
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
}

/* ═══════════════════════════════════════════════════════════════
   Sticky Content Topbar  (inside MudMainContent — sidebar full height)
   ═══════════════════════════════════════════════════════════════ */
.content-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    height: 56px;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
    flex-shrink: 0;
}

/* Hamburger menu toggle */
.topbar-menu-btn {
    flex-shrink: 0;
    margin-right: 4px;
    opacity: 0.65;
}

.topbar-menu-btn:hover {
    opacity: 1;
}

/* Search wrap */
.topbar-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 480px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--app-radius-lg);
    background: var(--mud-palette-background);
    position: relative;
}

.topbar-search-wrap:focus-within {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

.topbar-search-icon {
    color: var(--mud-palette-text-disabled);
    flex-shrink: 0;
}

.topbar-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--mud-palette-text-primary);
    font-family: inherit;
    font-size: var(--app-font-body);
    outline: none;
}

/* The search button sits flush inside the search box, so it stays square. */
.topbar-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: -6px;
    flex-shrink: 0;
    border: none;
    border-radius: var(--app-radius-sm);
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    cursor: pointer;
}

.topbar-search-btn:hover {
    background: var(--mud-palette-primary-darken);
    transform: scale(1.05);
}

.topbar-search-btn:active {
    transform: scale(0.95);
}

.topbar-search-input::placeholder {
    color: var(--mud-palette-text-disabled);
}

/* Right cluster */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* User trigger */
.topbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--app-radius-md);
    cursor: pointer;
}

.topbar-user-trigger:hover {
    background: var(--mud-palette-action-default-hover);
}

.topbar-user-avatar {
    font-size: var(--app-font-caption) !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    flex-shrink: 0;
    /* MudAvatar centres via flex; the font override needs these re-asserted or
       the initial renders high in the circle. */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.topbar-user-caret {
    color: var(--mud-palette-text-secondary);
    flex-shrink: 0;
}

.topbar-user-menu-list {
    min-width: 230px;
    padding-top: 0;
}

.topbar-user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 10px;
}

.topbar-user-menu-header .topbar-user-name {
    font-size: var(--app-font-body);
}

.topbar-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.topbar-user-name {
    font-size: var(--app-font-detail);
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
}

.topbar-user-email {
    font-size: var(--app-font-label);
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    max-width: 180px;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .content-topbar {
        align-content: center;
        flex-wrap: wrap;
        gap: 6px 8px;
        height: auto;
        min-height: 104px;
        padding: 8px 10px;
    }

    .topbar-menu-btn {
        margin-right: 0;
    }

    .topbar-search-wrap,
    .topbar-search-input {
        min-width: 0;
    }

    .topbar-search-wrap {
        order: 4;
        flex: 1 0 100%;
        max-width: none;
        height: 36px;
        gap: 6px;
        padding: 0 8px;
    }

    .topbar-right {
        gap: 0;
    }

    .topbar-user-text {
        display: none;
    }

    .topbar-user-trigger {
        gap: 0;
        padding: 2px;
    }

    .app-page-content {
        padding: 12px !important;
        padding-bottom: 64px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Auth / Login
   ═══════════════════════════════════════════════════════════════ */
/* The sign-in page (12 November 2026): the page's own grey with one white card on it, a hairline round the card
   and no shadow, as every other panel is drawn. It had a gradient behind it and a card that floated. */
.login-bg {
    min-height: 100vh;
    background: var(--mud-palette-background);
}

.login-card {
    width: 400px;
    max-width: 95vw;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--app-radius-xl);
    padding: 32px 32px 24px;
}

.login-header {
    margin-bottom: var(--app-gap-lg);
    text-align: center;
}

.login-footer {
    margin-top: var(--app-gap-lg);
    padding-top: var(--app-gap-md);
    border-top: 1px solid var(--mud-palette-divider);
    text-align: center;
}

/* The line under the form is written in the secondary text colour (12 November 2026): the page set it in the
   colour of disabled text, 2.6 to 1 on the card. */
.login-footer .mud-typography {
    color: var(--mud-palette-text-secondary) !important;
}

/* ═══════════════════════════════════════════════════════════════
   Backdrop, modals and lists (14 October 2026)
   ═══════════════════════════════════════════════════════════════ */

/* The page is one flat grey (12 November 2026). A dot grid and a brand glow were drawn behind the top of every page
   and the sign-in page; they went with every other gradient and wash, so the data is the loudest thing on a page.
   The content still clips what runs past its side. */
.mud-main-content,
.login-bg {
    position: relative;
    overflow-x: clip;
}

/* Every modal: a white card with a hairline, a plain title with a line under it, room round its content and a
   divider above its actions, which sit on the right with the main one last. It floats over the page, so it keeps a
   shadow; the brand edge along its top and the tinted title band went on 12 November 2026. The parts are matched at
   any depth, since a dialog's form can wrap its content and actions. */
.mud-dialog {
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--app-radius-xl) !important;
    box-shadow: 0 24px 48px -16px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .08) !important;
}

.mud-dialog .mud-dialog-title {
    padding: 14px 24px;
    font-size: var(--app-font-card);
    font-weight: 700;
    line-height: 1.35;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.mud-dialog .mud-dialog-title .mud-typography-h6 {
    font-size: var(--app-font-card);
    font-weight: 700;
    line-height: 1.35;
}

.mud-dialog .mud-dialog-content {
    padding-top: 20px;
}

.mud-dialog .mud-dialog-actions {
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}

.mud-dialog .mud-dialog-actions > .mud-button-root {
    min-width: 96px;
}

/* Every list: its heading row in the label style on the card's own white, with a hairline under it, and rows that
   take the tint under the pointer (12 November 2026; the headings were tracked capitals on a grey band). The cell
   helpers put a muted second line under a value and right-align figures. */
.mud-table-root .mud-table-head .mud-table-cell {
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    letter-spacing: normal;
    line-height: 1.5;
    white-space: nowrap;
    color: var(--app-label-ink);
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.mud-table-root .mud-table-head .mud-table-cell .mud-table-sort-label {
    color: inherit;
}

/* A simple table heads its columns the same way (11 November 2026). The rule above reaches MudTable and MudDataGrid
   only, so "Do next" on the home page, the decisions of Data to review, a country's "Latest changes" and the
   unconfirmed links read in sentence case beside lists in small capitals. One more element than MudBlazor's own
   rule for these cells (.mud-simple-table table * tr > th), so this one holds; a long heading may still wrap. */
.mud-simple-table table thead tr > th {
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    letter-spacing: normal;
    line-height: 1.5;
    color: var(--app-label-ink);
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
}

/* A wide list made to fit a 1366-pixel screen without scrolling sideways (18 October 2026): two-word headers ("Governing
   body", "Record status") may take two lines, and the cells keep 12 pixels each side instead of 16 and 24. */
.list-grid--compact .mud-table-head .mud-table-cell {
    white-space: normal;
}

.list-grid--compact.mud-table-dense .mud-table-row .mud-table-cell,
.list-grid--compact .mud-table-dense .mud-table-row .mud-table-cell {
    padding-inline: 12px;
}

/* The same spacing for a simple table (11 November 2026), whose cells carry no class of their own: a country's
   dated records were 28 px wider than their card at 1440 px. One more element than MudBlazor's own rule for a dense
   simple table's cells, so this one holds. */
.mud-simple-table.list-grid--compact table * tr > th,
.mud-simple-table.list-grid--compact table * tr > td {
    padding-inline: 10px;
}

/* An institution's lifecycle list (11 November 2026): the description under the event takes two lines at most (the
   whole of it is the cell's tooltip), and the name before and the name after stand one over the other, each behind
   its word. */
.cell-secondary.lifecycle-grid__description {
    display: -webkit-box;
    max-width: 24rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.lifecycle-grid__name {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.lifecycle-grid__name + .lifecycle-grid__name {
    margin-top: 4px;
}

.lifecycle-grid__name-label {
    flex: 0 0 3rem;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

/* A chip whose label may take two lines in a narrow column, such as a certificate gap's kind. */
.mud-chip.chip--wrapping {
    height: auto;
    min-height: 24px;
}

.mud-chip.chip--wrapping .mud-chip-content {
    white-space: normal;
}

.mud-table-root .mud-table-body .mud-table-row {
    transition: background-color .12s ease;
}

.mud-table-root .mud-table-body .mud-table-cell {
    vertical-align: middle;
}

.cell-secondary {
    display: block;
    margin-top: 2px;
    font-size: var(--app-font-caption);
    line-height: 1.3;
    color: var(--mud-palette-text-secondary);
}

.cell-num {
    text-align: end;
    font-variant-numeric: tabular-nums;
}

/* A field's character count keeps to one line beside its help text (11 November 2026): "0 / 500" broke after the
   stroke under a long line of help. */
.mud-input-helper-text > .ms-auto {
    flex: 0 0 auto;
    padding-inline-start: 12px;
    white-space: nowrap;
}

/* A date, a short code or a count with its unit stays on one line (11 November 2026): a narrow column broke
   "2026-10-30" after its second hyphen. */
.cell-nowrap {
    white-space: nowrap;
}

/* A select that stands in a table's cell reads at the table's text size (11 November 2026): the grey list's "Kind"
   of a weak accreditor was set at MudBlazor's own size, larger than every word round it. Three classes, as
   MudBlazor's own rule for an outlined input has two. */
.cell-select .mud-input.mud-input-outlined {
    font-size: var(--app-font-body);
}

/* The FAQ sections' tables share their column widths, so the sections line up one under another. */
.faq-table table {
    table-layout: fixed;
}

.faq-table__status {
    width: 130px;
}

.faq-table__changed {
    width: 250px;
}

.faq-table__actions {
    width: 176px;
}

/* The title of a "not found" card (Shared/NotFoundNotice). */
.not-found-notice__title {
    font-weight: 600;
}

/* An institution record's Aliases and Codes (11 November 2026). Their classes had no rules, so the headings sat
   against the card's edge, the count ran under the Add button, and the row that adds a code pushed its button past
   the card. They keep the form's 24 px each side, with the heading and its count on one row over the list. */
.organisation-detail__aliases {
    padding: 20px 24px 8px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.organisation-detail__collection-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.organisation-detail__collection-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.organisation-detail__collection-add {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-top: 12px;
}

.organisation-detail__collection-field {
    flex: 1 1 160px;
    min-width: 0;
}

/* The code's own box, wide enough for its label ("Code, as the source prints it"). */
.organisation-detail__collection-field--wide {
    flex: 2 1 270px;
}

.organisation-detail__collection-check,
.organisation-detail__collection-submit {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 40px;
}

@media (max-width: 700px) {
    .organisation-detail__aliases {
        padding-inline: 16px;
    }
}

/* List toolbars keep their filters on one row where there is room and wrap tidily where there is not. */
.page-toolbar {
    display: flex;
    align-items: center;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
    background: var(--mud-palette-background-gray);
    border-bottom: 1px solid var(--mud-palette-divider);
}

/* A row of filters that sits in a card or on the page, not on a list's grey band (11 November 2026): the toolbar's
   control sizes without its band, border and padding. The grey list, the unconfirmed links and Data to review set
   their filters at MudBlazor's own size, larger than the page's text and every other list's filters. */
.page-toolbar.page-toolbar--inline {
    min-height: 0;
    padding: 0;
    background: transparent;
    border-bottom: 0;
}

/* A switch's label reads at the size of the text round it (11 November 2026): MudBlazor sets it a step larger
   (Typo.body1), so "Mine only" and "Held more than once" stood out from their rows. Two classes, so this outweighs
   MudBlazor's .mud-typography-body1; the toolbar's own rule below still sets a toolbar's switch smaller. */
.mud-switch > .mud-typography {
    font-size: var(--app-font-body);
}

/* A switch in a toolbar reads at the toolbar's size, not as a heading beside the filters: a toolbar's switch and
   checkbox labels match its inputs (13px). */
.page-toolbar .mud-switch .mud-typography,
.page-toolbar .mud-checkbox .mud-typography {
    font-size: var(--app-font-detail);
    white-space: nowrap;
    color: var(--mud-palette-text-primary);
}

/* Long text in a list cell stops at two or three lines; the whole of it is a hover or the row's own page away. */
.cell-clamp-2,
.cell-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.cell-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.cell-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* A row's actions sit side by side, never stacked one above another. */
.cell-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   Dashboard
   ═══════════════════════════════════════════════════════════════ */

.dash-activity-country-group + .dash-activity-country-group {
    border-top: 1px solid var(--mud-palette-divider);
}

.dash-activity-country-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dash-activity-country-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-label);
}

/* Timeline items */
.dash-timeline {
    padding: 8px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--mud-palette-divider) transparent;
}

.dash-timeline::-webkit-scrollbar { width: 4px; }
.dash-timeline::-webkit-scrollbar-track { background: transparent; }
.dash-timeline::-webkit-scrollbar-thumb { background: var(--mud-palette-divider); border-radius: var(--app-radius-sm); }

.dash-timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 20px;
    position: relative;
}

.dash-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 29px;
    top: 28px;
    bottom: -2px;
    width: 1.5px;
    background: var(--mud-palette-divider);
}

.dash-timeline-item--clickable {
    cursor: pointer;
}

.dash-timeline-item--clickable:hover {
    background: var(--mud-palette-action-default-hover);
}

.dash-timeline-item--clickable:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.dash-timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    border: 2px solid var(--mud-palette-surface);
    outline: 1.5px solid var(--mud-palette-divider);
}

.dash-timeline-body {
    flex: 1;
    min-width: 0;
}

.dash-timeline-title {
    font-size: var(--app-font-detail);
    font-weight: 600;
}

.dash-timeline-meta {
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-disabled);
    margin-top: 1px;
}

.dash-timeline-time {
    font-size: var(--app-font-label);
    color: var(--mud-palette-text-disabled);
    white-space: nowrap;
    margin-top: 3px;
    flex-shrink: 0;
}

.dash-timeline-arrow {
    align-self: center;
    flex-shrink: 0;
    color: var(--mud-palette-text-disabled);
}

.dash-timeline-item--clickable:hover .dash-timeline-arrow {
    transform: translateX(2px);
    color: var(--mud-palette-primary);
}

/* ── Activity History Page ── */
.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Tabs
   ═══════════════════════════════════════════════════════════════ */
.mud-tabs .mud-tab {
    text-transform: none;
    font-weight: 600;
    font-size: var(--app-font-body);
}

/* ═══════════════════════════════════════════════════════════════
   Page Cards (unified wrapper for tabs + toolbar + grid)
   ═══════════════════════════════════════════════════════════════ */
.crud-card {
    background: var(--mud-palette-surface);
}

/* ── Toolbar strip inside the card ── */
.education-system-workspace {
    overflow: hidden;
    background: var(--mud-palette-surface);
}

/* Embedded in the country workspace the education tab keeps the same 20px round it as every other tab (it used to
   sit flush under the section navigation). */
.education-system-tab--embedded {
    padding: 1.25rem;
}

.education-system-workspace--standalone {
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--app-radius-lg);
}

.education-system-workspace--embedded {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 0;
}

.education-system-header {
    margin-bottom: .875rem;
}

.education-system-header .country-tab-header {
    margin-bottom: 0;
}

.education-system-summary {
    display: grid;
    grid-template-columns: minmax(17rem, .8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: color-mix(in srgb, var(--mud-palette-background-gray) 55%, var(--mud-palette-surface));
}

.education-system-selector {
    width: 100%;
    min-width: 0;
}

.education-system-summary__status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem 1rem;
    min-width: 0;
    flex-wrap: wrap;
}

.education-system-status__item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 2rem;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    font-weight: 600;
    white-space: nowrap;
}

.education-system-status__item .mud-icon-root {
    color: var(--mud-palette-text-disabled);
    font-size: 1.05rem;
}

.education-system-status__item--success .mud-icon-root {
    color: var(--mud-palette-success);
}

.education-system-status__item--warning .mud-icon-root {
    color: var(--mud-palette-warning);
}

.education-system-status__item--info .mud-icon-root {
    color: var(--mud-palette-info);
}

.education-view-toggle {
    flex: 0 0 auto;
    height: var(--app-control-sm-height);
}

.education-view-toggle .mud-toggle-item {
    min-width: 4.25rem;
    padding: 0 .875rem;
    font-size: var(--app-font-detail);
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
}

.country-list-section {
    min-width: 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

.country-list-section__header {
    display: flex;
    min-height: 4.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
}

.country-list-section__heading {
    min-width: 0;
}

.country-list-section__title {
    margin: 0;
    color: var(--mud-palette-text-primary);
    font-size: var(--app-font-reading);
    font-weight: 700;
    line-height: 1.4;
}

.country-list-section__description {
    margin: .2rem 0 0;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    line-height: 1.4;
}

.country-list-section__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: .625rem;
}

.country-list-section__primary-action {
    min-height: var(--app-control-sm-height);
    border-radius: var(--app-radius-sm);
    font-weight: 650;
    letter-spacing: normal;
    text-transform: none;
}

.country-list-section__toolbar {
    display: flex;
    min-width: 0;
    min-height: 3.5rem;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1.25rem;
    border-top: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: color-mix(in srgb, var(--mud-palette-background-gray) 68%, var(--mud-palette-surface));
}

.country-list-section__search {
    width: min(100%, 20rem);
    min-width: 15rem;
}

.country-list-section__toolbar-note {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    font-weight: 600;
    white-space: nowrap;
}

.country-list-section__toolbar-note .mud-icon-root {
    color: var(--mud-palette-primary);
    font-size: 1.05rem;
}

.country-list-section__toolbar-spacer {
    flex: 1 1 auto;
}

.country-list-section__switch {
    flex: 0 0 auto;
    margin: 0;
}

.country-list-section__toolbar .mud-switch .mud-typography {
    font-size: var(--app-font-body);
    white-space: nowrap;
}

.country-list-section__toolbar .mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.country-list-section__toolbar .mud-input-outlined {
    border-radius: var(--app-radius-md);
    background: var(--mud-palette-surface);
}

.country-list-section__toolbar .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--mud-palette-divider) !important;
    border-radius: var(--app-radius-md);
}

.country-list-section__toolbar .mud-input.mud-input-outlined,
.country-list-section__toolbar .mud-input.mud-input-outlined input {
    font-size: var(--app-font-detail);
}

.country-list-section__content {
    min-width: 0;
}

.country-list-section__empty-state {
    display: flex;
    min-height: 12rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .5rem;
    padding: 2rem;
    text-align: center;
}

.country-list-section__empty-state > .mud-icon-root {
    color: var(--mud-palette-text-disabled);
}

.education-diagram-shell {
    padding: 1.25rem;
}

/* The level chosen in the table opens in a panel beside it (11 November 2026); under the table on a narrow screen. */
.education-levels-with-panel {
    display: flex;
    align-items: flex-start;
}

.education-levels-with-panel__table {
    flex: 3 1 32rem;
    min-width: 0;
}

.education-level-panel {
    display: flex;
    flex: 2 1 20rem;
    flex-direction: column;
    gap: .75rem;
    max-width: 25rem;
    min-width: 0;
    padding: 1rem 1.125rem 1.125rem;
    border-left: 1px solid var(--mud-palette-divider);
}

.education-level-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.education-level-panel__heading {
    min-width: 0;
}

.education-level-panel__title {
    font-weight: 650;
    overflow-wrap: anywhere;
}

.education-level-panel__form {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.education-level-panel__last-change {
    color: var(--mud-palette-text-secondary);
}

.education-level-panel__pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.education-level-panel__range,
.education-level-panel__need {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.education-level-panel__range > span {
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-detail);
}

.education-level-panel__need {
    margin-bottom: .375rem;
}

/* The row's flex items are MudSelect's outer wrappers, not the elements that carry the select's Class, so the
   widths go on them (11 November 2026): each select took the width of its longest choice, and the second row's
   delete button stood out past the panel. The level takes what the access box and the button leave, and a long
   level name ends in an ellipsis. */
.education-level-panel__need > .mud-select {
    flex: 1 1 0;
    min-width: 0;
}

.education-level-panel__need > .mud-select:has(.education-level-panel__access) {
    flex: 0 0 9.5rem;
}

.education-level-panel__need > .mud-icon-button {
    flex: 0 0 auto;
}

/* The panel's boxes at the page's text size (11 November 2026), so two selects and a button fit one row of it. */
.education-level-panel .mud-input.mud-input-outlined {
    font-size: var(--app-font-body);
}

/* Beside the open panel the table has about 670 px at 1600 px (11 November 2026), and its cells wrapped to three and
   four lines. Its cells keep 10 px each side there, an age range stays on one line, and "No framework mapping"
   takes two lines at most (its least width is with .education-level-pathway__framework, further down). */
.education-levels-with-panel:has(.education-level-panel) .education-levels-grid .mud-table-row .mud-table-cell {
    padding-inline: 10px;
}

.education-level-structure > span + span {
    white-space: nowrap;
}

.education-level-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    padding-top: .25rem;
}

.education-level-panel__full-record {
    margin-right: auto;
    color: var(--mud-palette-primary);
    font-size: var(--app-font-detail);
    font-weight: 600;
}

/* Two classes and the row, so MudBlazor's own row background does not outweigh it. */
.education-levels-grid .mud-table-row.education-level-row--selected {
    background: var(--mud-palette-action-default-hover);
}

/* The Governance overview (11 November 2026): the governance record, quality assurance and regions as three cards on
   one page, and their one history under them. */
.governance-overview__sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.governance-overview__pair {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
}

.governance-overview__pair > .governance-overview__card {
    flex: 1 1 24rem;
    min-width: 0;
}

.governance-overview__card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--app-radius-lg);
    background: var(--mud-palette-surface);
}

.governance-overview__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .875rem 1.125rem;
}

.governance-overview__title {
    font-weight: 650;
}

.governance-overview__head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.governance-overview__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: .75rem 1.5rem;
    padding: 0 1.125rem .875rem;
    font-size: var(--app-font-body);
}

.governance-overview__label {
    color: var(--app-label-ink);
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
}

.governance-overview__completeness {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 0 1.125rem .75rem;
}

.governance-overview__parts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: .875rem 1.5rem;
    margin: 0;
    padding: 0 1.125rem .875rem;
    font-size: var(--app-font-body);
}

.governance-overview__parts dd {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
    margin: .125rem 0 0;
    overflow-wrap: anywhere;
}

.governance-overview__arabic {
    color: var(--mud-palette-text-secondary);
}

.governance-overview__parts .governance-overview__arabic {
    align-self: stretch;
}

.governance-overview__sublist-label {
    padding: 0 1.125rem .25rem;
}

.governance-overview__links {
    display: grid;
    gap: .375rem 1rem;
    margin: 0;
    padding: 0 1.125rem .875rem;
    font-size: var(--app-font-body);
    list-style: none;
}

.governance-overview__links--columns {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.governance-overview__links li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .5rem;
}

.governance-overview__empty {
    padding: 0 1.125rem .875rem;
}

.governance-overview__history {
    padding: 0 .375rem;
    overflow-x: auto;
}

.governance-overview__when {
    white-space: nowrap;
}

.governance-overview__foot {
    padding: .625rem 1.125rem;
    border-top: 1px solid var(--mud-palette-divider);
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-detail);
}

.governance-overview__card a,
.governance-overview__link-button {
    color: var(--mud-palette-primary);
}

.governance-overview__link-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 959.98px) {
    .education-levels-with-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .education-level-panel {
        max-width: none;
        border-top: 1px solid var(--mud-palette-divider);
        border-left: 0;
    }
}

.education-level-name,
.education-level-structure,
.education-level-pathway {
    display: flex;
    flex-direction: column;
    gap: .125rem;
    min-width: 0;
}

.education-level-name__type {
    color: var(--mud-palette-text-primary);
    font-weight: 650;
}

.education-level-name__heading {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.education-level-name__heading .mud-icon-button {
    width: 1.75rem;
    height: 1.75rem;
    padding: .25rem;
}

.education-level-name > span:not(.education-level-name__heading),
.education-level-structure > span + span {
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
}

.education-level-pathway {
    gap: .25rem;
}

.education-level-pathway__track,
.education-level-requirement {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-detail);
    font-weight: 600;
    white-space: nowrap;
}

.education-level-pathway__dot {
    width: .45rem;
    height: .45rem;
    flex: 0 0 .45rem;
    border-radius: 999px;
    background: var(--mud-palette-text-disabled);
}

.education-level-pathway__track--academic .education-level-pathway__dot {
    background: var(--mud-palette-info);
}

.education-level-pathway__track--vocational .education-level-pathway__dot {
    background: var(--mud-palette-warning);
}

.education-level-pathway__track--professional .education-level-pathway__dot {
    background: var(--mud-palette-primary);
}

.education-level-pathway__track--religious .education-level-pathway__dot {
    background: var(--mud-palette-secondary);
}

.education-level-pathway__framework {
    /* Wide enough that "No framework mapping" takes two lines at most beside the open panel (11 November 2026). */
    min-width: 6.5rem;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
}

.education-level-requirement {
    font-weight: 500;
}

.education-level-requirement .mud-icon-root {
    color: var(--mud-palette-text-disabled);
    font-size: 1.05rem;
}

.education-level-requirement--compulsory .mud-icon-root {
    color: var(--mud-palette-success);
}

.education-level-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .125rem;
}

.education-prerequisites-dialog__title,
.education-prerequisites-editor__toolbar {
    display: flex;
    align-items: center;
}

.education-prerequisites-dialog__title {
    gap: .75rem;
}

.education-prerequisites-editor {
    padding: 1rem;
    border-radius: var(--app-radius-lg);
}

.education-prerequisites-editor__toolbar {
    gap: .75rem;
    margin-bottom: 1rem;
}

.education-prerequisites-dialog .mud-dialog-content {
    padding-top: .5rem;
}

.education-levels-grid .mud-table-cell {
    vertical-align: middle;
}

.education-system-workspace .country-list-section__header {
    min-height: 4.25rem;
    padding-block: .75rem;
}

.education-system-workspace .country-list-section__toolbar {
    min-height: 3rem;
    padding-block: .375rem;
}

.education-levels-grid .mud-table-container,
.education-levels-grid .mud-drop-container,
.education-levels-grid .mud-table-root {
    width: 100%;
}

.education-levels-grid .mud-table-container {
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
}

.education-levels-grid .mud-table-root {
    table-layout: auto;
}

.education-levels-grid .mud-table-head {
    background: color-mix(in srgb, var(--mud-palette-background-gray) 42%, var(--mud-palette-surface));
}

.education-levels-grid .mud-table-head .mud-table-cell {
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    font-weight: 700;
}

.education-levels-grid .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: 0;
}

/* Search type filters: the row wraps on narrow screens, so the toolbar must grow with it. */
.search-type-toolbar {
    flex-wrap: wrap;
    min-height: 44px;
    padding: 6px 12px;
}

.crud-list-toolbar,
.responsive-page-toolbar {
    flex-wrap: wrap;
    min-width: 0;
}

/* A list's search box asks for 240 px and takes up to 300 px where its row has room to spare (11 November 2026).
   At a fixed 240 px "Search by name or contact email" was cut; at a fixed 300 px a full row sent its Add button
   onto a row of its own, because a toolbar wraps before it lets anything shrink. It grows ahead of the spacer that
   pushes the Add button to the right. A hint is worded to fit the 240 px box. */
.crud-toolbar-search {
    flex: 100 1 240px;
    min-width: 200px;
    max-width: 300px;
}

/* A search box that is not CrudPage's own, with a hint as long as "Invoice number, card order number or member". */
.toolbar-search {
    flex: 0 1 22rem;
    min-width: 14rem;
}

/* In a list's toolbar a filter keeps one width, as on a country's lists (11 November 2026): MudSelect's wrapper
   grows to fill the row, so the filters drifted apart and the Add button was pushed onto a row of its own. */
.crud-list-toolbar > .mud-select:not(.mud-input-control) {
    flex: 0 1 12.5rem;
    min-width: 9rem;
}

/* A filter whose box has to show a long hint ("Search by country name or code"), and one that holds a word or two.
   The class is on the box inside MudSelect's or MudAutocomplete's own wrapper, and the wrapper is the toolbar's
   child, so the widths go on the wrapper. These follow the rule above, which they have to outrank. */
.page-toolbar > .mud-select:has(> .toolbar-filter--wide) {
    flex: 0 1 17rem;
    min-width: 16.5rem;
    max-width: 19rem;
}

.page-toolbar > .mud-select:has(> .toolbar-filter--narrow) {
    flex: 0 1 9rem;
    min-width: 7.5rem;
}

.crud-toolbar-action,
.crud-row-action {
    min-height: var(--app-control-sm-height);
    border-radius: var(--app-radius-sm);
    font-size: var(--app-font-caption);
    letter-spacing: normal;
    text-transform: none;
}

.crud-toolbar-action--primary {
    font-weight: 600;
}

@media (max-width: 600px) {
    .crud-list-toolbar > .mud-input-control:first-child {
        flex: 1 1 100%;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }

    .crud-toolbar-search {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .crud-toolbar-action,
    .crud-row-action {
        min-height: var(--app-control-touch-height);
    }
}

/* Remove default MudBlazor margin on input controls inside toolbar */
.page-toolbar .mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* White background on container, visible border on fieldset */
.page-toolbar .mud-input-outlined {
    background: var(--mud-palette-surface);
    border-radius: var(--app-radius-md);
}

.page-toolbar .mud-input-outlined .mud-input-outlined-border {
    background: transparent !important;
    border-color: var(--mud-palette-divider) !important;
    border-radius: var(--app-radius-md);
}

.page-toolbar .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--mud-palette-text-secondary) !important;
}

.page-toolbar .mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 2px rgba(4, 92, 152, 0.10);
}

/* Slightly smaller font for toolbar inputs */
.page-toolbar .mud-input.mud-input-outlined {
    font-size: var(--app-font-detail);
}

.page-toolbar .mud-input.mud-input-outlined input,
.page-toolbar .mud-input.mud-input-outlined .mud-select-input {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    font-size: var(--app-font-detail);
    /* Autocomplete inputs otherwise inherit a 1.4 line-height and render ~3px
       taller than sibling search/select controls in the same toolbar. */
    line-height: 1.1876 !important;
}

/* Keep dropdown filters the same height and vertical rhythm as toolbar search fields.
   Applies to every toolbar surface (CrudPageBody bars and CountryListSurface bars alike). */
.page-toolbar .mud-select .mud-input-slot.mud-select-input {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

/* Ensure placeholder is always visible */
.page-toolbar .mud-input.mud-input-outlined input::placeholder {
    color: var(--mud-palette-text-secondary) !important;
    opacity: 1 !important;
}

.page-toolbar .mud-input-slot:empty + .mud-input-placeholder,
.page-toolbar .mud-input-outlined .mud-input-slot[placeholder] {
    opacity: 1 !important;
}

.page-toolbar .mud-input-label {
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
}

.page-toolbar .mud-input-adornment-start .mud-icon-root {
    font-size: 1.15rem;
    color: var(--mud-palette-text-secondary);
}

/* Compact chips inside toolbar */
.page-toolbar .mud-chip {
    font-size: var(--app-font-caption);
    height: 28px;
}

/* The sign-up requests list's search box keeps a readable width beside the filters. */
.sign-up-search {
    flex: 0 1 22rem;
    min-width: 14rem;
}

/* A sign-up request's answers: long addresses, websites and purposes wrap within their column. */
.sign-up-answer {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.sign-up-history th {
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

/* ── Shared two-sided list footer contract ──────────────────────────────
   Every list view ends with one footer row: paging controls on the LEFT
   (always rendered, even for a single page) and the total record count on
   the RIGHT. Wrap a MudDataGridPager (or custom pagination controls) plus
   a `.list-footer__count` caption in one `.list-footer` element. */
.list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 44px;
    padding-inline-end: 16px;
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

/* Left-align the MudBlazor pager block: neutralise its right-pushing spacer
   and its own top border (the footer row owns the divider). */
.list-footer .mud-table-pagination {
    flex: 0 1 auto;
    min-width: 0;
    border-top: 0;
}

.list-footer .mud-table-pagination-spacer {
    display: none;
}

/* The footer draws the one line above a list's pager; the pager's own toolbar drew a second, shorter one. */
.list-footer .mud-table-pagination-toolbar {
    padding-inline-start: 8px;
    border-top: 0;
}

/* Custom pagination footers (no MudDataGridPager) share the same geometry. */
.list-footer__pager {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-inline-start: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.list-footer__pager .mud-input-control {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.list-footer__count {
    white-space: nowrap;
    text-align: right;
}

/* A list's footer while its first read is under way (11 November 2026): it keeps its place, so the page does not
   jump when the rows arrive, but is out of sight, so the pager and the count never read "0" before they do. */
.list-footer--pending {
    visibility: hidden;
}

/* ── List states (11 November 2026) ─────────────────────────────────────
   Grey placeholder rows while a list's first read is on its way (ListSkeleton), so no count or "No …" text shows
   before the rows do. */
.list-skeleton {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: start;
}

.list-skeleton__row {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 44px;
    padding: 0 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.list-skeleton__row:last-child {
    border-bottom: 0;
}

.list-skeleton__bar {
    display: block;
    height: 12px;
    border-radius: var(--app-radius-md);
    background: var(--mud-palette-skeleton);
    animation: list-skeleton-pulse 1.4s ease-in-out infinite;
}

.list-skeleton__bar--title {
    height: 14px;
}

.list-skeleton__bar--short {
    margin-inline-start: auto;
}

@keyframes list-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

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

/* The thin line over a list that is being read again with its rows still on screen. It lies over the list's top
   edge, so the rows do not move down while it shows. */
.mud-progress-linear.list-reloading {
    margin-bottom: -4px;
    z-index: 1;
}

/* An archived row, shown with "Show archived" on: greyed, with Restore as its one action. The shared action column
   marks the row (.crud-row-actions--archived), so every grid that uses it follows; the action cell itself stays at
   full strength so Restore reads clearly. */
.mud-table-row:has(.crud-row-actions--archived) > .mud-table-cell:not(:has(.crud-row-actions--archived)) {
    opacity: 0.6;
}

/* Fix outlined label/text alignment when collapsed — applies to selects,
   autocompletes AND text/numeric fields so all toolbar labels match. */
.page-toolbar .mud-input-label-outlined {
    font-size: var(--app-font-detail);
    transform: translate(14px, 9px) scale(1);
}
/* Filter labels in every toolbar float at one height, whether the filter is empty or filled, so a row of filters
   keeps its labels level. */
.page-toolbar .mud-input-label-outlined.mud-input-label-inputcontrol {
    transform: translate(14px, -6px) scale(.75);
}

/* Fix collapsed select text alignment */
.page-toolbar .mud-select .mud-select-input {
    min-height: unset;
    line-height: 1.4;
}

/* Toolbar select – auto-size to content, with sensible bounds */
.toolbar-select {
    min-width: 140px;
    max-width: 220px;
    flex-shrink: 0;
}

/* Switch label inside toolbar */
.page-toolbar .mud-switch {
    margin: 0;
}

.toolbar-switch {
    flex-shrink: 0;
    white-space: nowrap;
}

.toolbar-switch .mud-switch-label {
    font-size: var(--app-font-detail);
}

/* Toolbar toggle group (Active/Deleted segmented control) */
.toolbar-toggle {
    flex-shrink: 0;
}

.toolbar-toggle .mud-toggle-group {
    height: 32px;
}

.toolbar-toggle .mud-toggle-item {
    font-size: var(--app-font-caption) !important;
    font-weight: 600 !important;
    padding: 0 14px !important;
    min-width: unset !important;
    text-transform: none !important;
}

/* Remove extra elevation from grids nested inside the card */
.crud-card > .mud-data-grid,
.crud-card .mud-table,
.crud-card .mud-data-grid,
.crud-card .mud-data-grid .mud-table {
    box-shadow: none !important;
}

.crud-card > .mud-data-grid > .mud-table > .mud-table-container,
.crud-card .mud-data-grid > .mud-table > .mud-table-container {
    border-radius: 0;
}

/* Fix border alignment in MudDataGrid - ensure consistent cell borders */
.crud-card .mud-table-cell {
    border-bottom: 1px solid var(--mud-palette-divider) !important;
}

.crud-card .mud-table-row:last-child .mud-table-cell {
    border-bottom: none !important;
}

/* ── Country workspace masthead and grouped navigation ── */
.country-page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    margin: -4px 0 8px 2px;
    font-size: var(--app-font-detail);
}

.country-page-breadcrumb__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 7px;
    border-radius: var(--app-radius-md);
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
    text-decoration: none;
}

.country-page-breadcrumb__back .mud-icon-root {
    color: var(--mud-palette-primary);
    font-size: 1.1rem;
}

.country-page-breadcrumb__back:hover {
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.country-page-breadcrumb__back:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.country-page-breadcrumb__separator {
    color: var(--mud-palette-text-disabled);
    font-size: 1rem;
}

.country-page-breadcrumb__current {
    padding: 4px 6px;
    color: var(--mud-palette-primary);
    font-weight: 700;
}

.country-workspace-shell {
    position: relative;
    min-width: 0;
    margin-bottom: var(--app-gap-lg);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--app-radius-lg);
    background: var(--mud-palette-surface);
    box-shadow: var(--app-shadow-sm);
}

.country-workspace-shell > .page-header {
    margin: 0 !important;
    padding: 16px 18px;
}

.country-masthead-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.country-open-public {
    min-height: var(--app-control-sm-height);
    white-space: nowrap;
}

.country-primary-navigation__item:focus-visible,
.country-secondary-navigation__item:focus-visible,
.country-section-select-wrap select:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.country-section-navigation {
    position: sticky;
    top: 56px;
    z-index: 90;
    overflow: hidden;
    border-top: 1px solid var(--mud-palette-divider);
    border-bottom: 1px solid var(--mud-palette-divider);
    background: color-mix(in srgb, var(--mud-palette-surface) 97%, transparent);
    backdrop-filter: blur(10px);
}

.country-primary-navigation,
.country-secondary-navigation {
    display: flex;
    align-items: center;
}

/* The section groups wrap rather than run under the bar's clipped edge: with the side menu open between 960px and
   about 1020px the last group ("Risk Profile") was cut off. */
.country-primary-navigation {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
}

.country-primary-navigation__item,
.country-secondary-navigation__item {
    border: 0;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.country-primary-navigation__item {
    min-height: var(--app-control-sm-height);
    padding: 7px 14px;
    border-radius: 0;
    font-size: var(--app-font-detail);
    font-weight: 600;
}

/* Between the width the rail takes over (1400 px) and a small laptop's, the eight groups keep to one row
   (11 November 2026): at 1280 px "Governance" was left alone on a second one. */
@media (min-width: 1250px) and (max-width: 1399.98px) {
    .country-primary-navigation {
        gap: 2px;
    }

    .country-primary-navigation__item {
        padding-inline: 8px;
    }
}

.country-primary-navigation__item:hover,
.country-secondary-navigation__item:hover {
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-action-default-hover);
}

.country-primary-navigation__item--active {
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
}

.country-secondary-navigation {
    min-height: 42px;
    gap: 2px;
    padding: 0 8px;
    border-top: 1px solid var(--mud-palette-divider);
}

.country-secondary-navigation__item {
    position: relative;
    align-self: stretch;
    min-width: 92px;
    padding: 8px 14px;
    font-size: var(--app-font-detail);
    font-weight: 500;
}

.country-secondary-navigation__item--active {
    color: var(--mud-palette-primary);
    font-weight: 700;
}

.country-secondary-navigation__item--active::after {
    position: absolute;
    right: 12px;
    bottom: 0;
    left: 12px;
    height: 2px;
    border-radius: 0;
    background: var(--mud-palette-primary);
    content: "";
}

.country-navigation-mobile {
    display: none;
}

/* The section rail (11 November 2026). It shows from 1400px, where there is room for it beside the work; below
   that the two rows of tabs stay. */
.section-rail {
    display: none;
}

.rail-layout__main {
    min-width: 0;
}

@media (min-width: 1400px) {
    .rail-layout {
        display: grid;
        grid-template-columns: 212px minmax(0, 1fr);
        align-items: start;
        border-top: 1px solid var(--mud-palette-divider);
    }

    .rail-layout .country-section-navigation,
    .rail-layout .entity-detail-navigation {
        display: none;
    }

    .section-rail {
        display: block;
        position: sticky;
        top: 56px;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        padding: 10px 8px 16px;
        border-right: 1px solid var(--mud-palette-divider);
    }

    .rail-layout__main {
        border-left: 0;
    }
}

.section-rail__group + .section-rail__group {
    margin-top: 10px;
}

.section-rail__label {
    padding: 6px 10px 4px;
    color: var(--app-label-ink);
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
}

/* An entry is a link on the country page and a button on a record whose sections are tabs: both read the same. */
button.section-rail__item {
    width: 100%;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    background: transparent;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
}

.section-rail__item {
    display: block;
    padding: 6px 10px;
    border-left: 2px solid transparent;
    border-radius: 0 var(--app-radius-md) var(--app-radius-md) 0;
    color: var(--mud-palette-text-primary);
    font-size: var(--app-font-detail);
    line-height: 1.3;
    text-decoration: none;
}

.section-rail__item--single {
    font-weight: 600;
}

.section-rail__item:hover {
    background: var(--mud-palette-action-default-hover);
}

.section-rail__item:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.section-rail__item--active {
    border-left-color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
    color: var(--mud-palette-primary);
    font-weight: 700;
}

.country-workspace-body {
    min-width: 0;
    overflow: hidden;
    border-radius: 0;
    background: var(--mud-palette-surface);
}

@media (max-width: 820px) {
    .country-navigation-desktop {
        display: none;
    }

    .country-navigation-mobile {
        display: block;
        padding: 9px 12px 10px;
    }

    .country-navigation-mobile label {
        display: block;
        margin-bottom: 5px;
        color: var(--app-label-ink);
        font-size: var(--app-font-label);
        font-weight: var(--app-label-weight);
    }

    .country-section-select-wrap {
        position: relative;
        display: flex;
        align-items: center;
    }

    .country-section-select-wrap select {
        width: 100%;
        min-height: var(--app-control-touch-height);
        padding: 8px 42px 8px 12px;
        appearance: none;
        border: 1px solid var(--mud-palette-lines-inputs);
        border-radius: var(--app-radius-md);
        background: var(--mud-palette-surface);
        color: var(--mud-palette-text-primary);
        font: inherit;
        font-size: var(--app-font-body);
        font-weight: 600;
        cursor: pointer;
    }

    .country-section-select-wrap .mud-icon-root {
        position: absolute;
        right: 12px;
        color: var(--mud-palette-text-secondary);
        pointer-events: none;
    }
}

.qtf-alignment-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 400px) auto auto minmax(220px, 320px);
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.qtf-alignment-framework-picker,
.qtf-alignment-compare-picker {
    width: 100%;
    min-width: 0;
}
.qtf-alignment-target {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.qtf-alignment-target .mud-chip {
    max-width: 100%;
}

.level-mapping-table .mud-table-container {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.level-mapping-table .mud-table-root {
    min-width: 980px;
}

.level-mapping-table .mud-button-root,
.level-mapping-table .mud-icon-button {
    min-width: var(--app-control-sm-height);
    min-height: var(--app-control-sm-height);
}

@media (max-width: 1100px) {
    .qtf-alignment-toolbar {
        grid-template-columns: minmax(240px, 1fr) auto auto;
    }
    .qtf-alignment-compare-picker {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .country-page-breadcrumb {
        margin-left: 0;
    }

    .country-workspace-shell > .page-header {
        padding: 12px;
    }

    .country-masthead-actions {
        justify-content: stretch;
        width: 100%;
    }

    .country-open-public {
        flex: 1 1 auto;
    }

    .qtf-alignment-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }
    .qtf-alignment-target,
    .qtf-alignment-compare-picker {
        grid-column: 1 / -1;
    }
    .level-mapping-table .mud-button-root,
    .level-mapping-table .mud-icon-button {
        min-width: var(--app-control-touch-height);
        min-height: var(--app-control-touch-height);
    }
}

/* ═══════════════════════════════════════════════════════════════
   Countries – Card Grid
   ═══════════════════════════════════════════════════════════════ */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1px;
    background: var(--mud-palette-divider);
}

.country-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--mud-palette-surface);
}

.country-card-hitarea {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.country-card-hitarea:focus-visible {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: -3px;
}

.country-card:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 5%, var(--mud-palette-surface));
}

.country-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.country-card-name {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-size: var(--app-font-body);
    font-weight: 600;
    line-height: 1.3;
    color: var(--mud-palette-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-card-region {
    display: inline-block;
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
    color: var(--mud-palette-primary);
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
    font-size: var(--app-font-label);
    line-height: 1.6;
    width: fit-content;
}

.country-card-counts {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-disabled);
}

.country-card-counts-sep {
    color: var(--mud-palette-divider);
}

.country-card-manage {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.country-card--deleted {
    opacity: 0.5;
    background: repeating-linear-gradient(
        -45deg,
        var(--mud-palette-surface),
        var(--mud-palette-surface) 10px,
        color-mix(in srgb, var(--mud-palette-error) 5%, var(--mud-palette-surface)) 10px,
        color-mix(in srgb, var(--mud-palette-error) 5%, var(--mud-palette-surface)) 20px
    );
}

.country-card--deleted .country-card-manage {
    opacity: 1;
}

.country-card--hidden {
    opacity: 0.7;
}

.country-card-deleted-badge {
    display: inline-block;
    background: color-mix(in srgb, var(--mud-palette-error) 15%, transparent);
    color: var(--mud-palette-error);
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
    font-size: var(--app-font-label);
    line-height: 1.6;
    width: fit-content;
}

/* ═══════════════════════════════════════════════════════════════
   Shared Utilities
   ═══════════════════════════════════════════════════════════════ */

/* Page header */
.page-header .mud-typography-h4 {
    font-size: var(--app-font-title);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.page-header__identity,
.page-header__copy {
    min-width: 0;
}

.page-header__copy {
    flex: 1 1 auto;
}

.page-header__actions {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .page-header {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0.75rem;
    }

    .page-header__identity {
        align-items: flex-start !important;
    }

    .page-header__actions {
        width: 100%;
    }

    .page-header__actions .mud-button-root {
        min-height: var(--app-control-touch-height);
    }

    .page-header__actions > .d-flex {
        flex-wrap: wrap;
    }

    .page-header .mud-typography-h4 {
        font-size: var(--app-font-title-narrow);
        line-height: 1.25;
    }
}

/* Breadcrumbs */
.mud-breadcrumbs .mud-breadcrumb-item a {
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.mud-breadcrumbs .mud-breadcrumb-item a:hover {
    color: var(--mud-palette-primary);
    text-decoration: underline;
}

.mud-breadcrumbs .mud-breadcrumb-item:last-child .mud-breadcrumb-item-disabled {
    color: var(--mud-palette-primary) !important;
    font-weight: 700;
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   Fields of Study Tree
   ═══════════════════════════════════════════════════════════════ */

/* ── Row layout ───────────────────────────────────────────────── */
.fos-row {
    display: flex;
    align-items: center;
    gap: var(--app-gap-sm);
    width: 100%;
    padding: 6px 8px 6px 0;
    border-radius: var(--app-radius-sm);
}

/* ── ISCED code badge ─────────────────────────────────────────── */
.fos-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 2px 10px;
    font-size: var(--app-font-caption);
    font-weight: 700;
    font-family: 'Roboto Mono', 'Consolas', monospace;
    letter-spacing: 0.5px;
    border-radius: var(--app-radius-sm);
    flex-shrink: 0;
}

.fos-code--level-0 {
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    color: var(--mud-palette-primary);
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 22%, transparent);
    font-size: var(--app-font-caption);
    font-weight: 800;
}

.fos-code--level-1 {
    background: color-mix(in srgb, var(--mud-palette-info) 10%, transparent);
    color: var(--mud-palette-info);
    border: 1px solid color-mix(in srgb, var(--mud-palette-info) 18%, transparent);
}

.fos-code--level-2 {
    background: color-mix(in srgb, var(--mud-palette-secondary) 8%, transparent);
    color: var(--mud-palette-text-secondary);
    border: 1px solid color-mix(in srgb, var(--mud-palette-secondary) 14%, transparent);
    font-size: var(--app-font-label);
}

/* ── Name text ────────────────────────────────────────────────── */
.fos-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fos-name--level-0 {
    font-weight: 700;
    font-size: var(--app-font-reading);
}

.fos-name--level-1 {
    font-weight: 600;
    font-size: var(--app-font-body);
}

.fos-name--level-2 {
    font-weight: 500;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
}

/* ── Metadata (child count badge) ─────────────────────────────── */
.fos-meta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--app-font-label);
    font-weight: 600;
    color: var(--mud-palette-text-disabled);
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--mud-palette-action-default) 6%, transparent);
}

.fos-meta .mud-icon-root {
    font-size: 0.85rem !important;
}

/* ── Status + actions cluster ─────────────────────────────────── */
.fos-status-actions {
    display: flex;
    align-items: center;
    gap: var(--app-gap-xs);
    flex-shrink: 0;
    margin-left: auto;
    padding-left: var(--app-gap-sm);
}

/* ── Action button group ──────────────────────────────────────── */
.fos-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    border-radius: var(--app-radius-sm);
    background: color-mix(in srgb, var(--mud-palette-action-default) 5%, transparent);
}

/* ── Deleted item treatment ───────────────────────────────────── */
.fos-row--deleted {
    opacity: 0.55;
}

.fos-row--deleted .fos-name {
    text-decoration: line-through;
    text-decoration-color: var(--mud-palette-error);
}

.fos-row--deleted .fos-code {
    background: color-mix(in srgb, var(--mud-palette-error) 8%, transparent);
    color: var(--mud-palette-error);
    border-color: color-mix(in srgb, var(--mud-palette-error) 15%, transparent);
}

/* ── Inactive (hidden from website) ───────────────────────────── */
.fos-row--inactive .fos-name {
    color: var(--mud-palette-text-disabled);
}

.fos-row--inactive .fos-code {
    opacity: 0.6;
}

/* Touch devices & reduced motion */
@media (hover: none), (prefers-reduced-motion: reduce) {
    .fos-actions {
        opacity: 1;
}
}

/* ═══════════════════════════════════════════════════════════════
   Markdown Content
   ═══════════════════════════════════════════════════════════════ */

/* ── First-party rich text editor ── */

.rich-text-editor {
    min-width: 0;
}

@media (max-width: 1040px) {
    .education-system-summary {
        grid-template-columns: minmax(15rem, 1fr) auto;
    }
}

@media (max-width: 700px) {
    .education-system-tab--embedded {
        padding: 1rem;
    }

    .education-system-summary {
        grid-template-columns: minmax(0, 1fr);
        padding: 1rem;
    }

    .education-system-summary__status {
        grid-column: auto;
        grid-row: auto;
        justify-content: flex-start;
    }

    .country-list-section__header {
        align-items: flex-start;
        padding: 1rem;
    }

    .country-list-section__toolbar {
        flex-wrap: wrap;
        padding: .625rem 1rem;
    }

    .country-list-section__search {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .country-list-section__toolbar-spacer {
        display: none;
    }

    .education-diagram-shell {
        padding: 1rem;
    }

    .education-prerequisites-editor__toolbar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .education-prerequisites-editor__toolbar > div:first-child {
        flex: 1 1 100%;
    }
}

@media (max-width: 959.98px) {
    /* The stacked-card layout below replaces the table grid entirely; without
       these the header row and table layout survive and squeeze the cards into
       the first column's width. */
    .education-levels-grid .mud-table-head {
        display: none;
    }

    .education-levels-grid .mud-table-root {
        display: block;
    }

    .education-levels-grid .mud-table-body {
        display: grid;
        gap: .75rem;
        padding: .75rem 1rem 1rem;
        background: var(--mud-palette-background-gray);
    }

    .education-levels-grid .mud-table-body .mud-table-row {
        display: block;
        overflow: hidden;
        margin: 0;
        border: 1px solid var(--mud-palette-lines-default);
        border-radius: 0;
        background: var(--mud-palette-surface);
        box-shadow: none;
    }

    .education-levels-grid .mud-table-body .mud-table-cell {
        display: flex;
        align-items: center;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        text-align: start !important;
        min-height: 2.75rem;
        padding: .625rem .875rem;
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }

    /* The card's own border closes it; a divider under its last line doubled that edge. */
    .education-levels-grid .mud-table-body .mud-table-cell:last-child {
        border-bottom: 0 !important;
    }

    .education-levels-grid .mud-table-body .mud-table-cell::before {
        flex: 0 0 auto;
        content: attr(data-label);
        min-width: 7.25rem;
        margin-right: 1rem;
        color: var(--app-label-ink);
        font-size: var(--app-font-label);
        font-weight: var(--app-label-weight);
    }

    .education-level-row-actions {
        flex: 1 1 auto;
        width: auto;
    }
}

@media (max-width: 520px) {
    .country-list-section__header {
        flex-direction: column;
    }

    .country-list-section__actions {
        width: 100%;
        justify-content: space-between;
    }

    .country-list-section__primary-action {
        flex: 1 1 auto;
    }
}

.rich-text-editor__header,
.rich-text-editor__label-row,
.rich-text-editor__toolbar,
.rich-text-editor__tool-group,
.rich-text-editor__link-controls,
.rich-text-editor__status {
    display: flex;
    align-items: center;
}

.rich-text-editor__header {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .625rem;
}

.rich-text-editor__label-row {
    min-width: 0;
    gap: .25rem;
}

.rich-text-editor__label {
    color: var(--mud-palette-text-primary);
    font-size: var(--app-font-caption);
    font-weight: 600;
    line-height: 1.25rem;
}

.rich-text-editor__required {
    color: var(--mud-palette-error);
}

.rich-text-editor__frame {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--app-radius-md);
    background: var(--mud-palette-surface);
}

.rich-text-editor__frame.is-focused,
.rich-text-editor__frame:focus-within {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

.rich-text-editor--error .rich-text-editor__frame {
    border-color: var(--mud-palette-error);
}

.rich-text-editor--error .rich-text-editor__frame.is-focused,
.rich-text-editor--error .rich-text-editor__frame:focus-within {
    border-color: var(--mud-palette-error);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-error) 12%, transparent);
}

.rich-text-editor__toolbar {
    min-height: 3rem;
    gap: .375rem;
    padding: .375rem .625rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: color-mix(in srgb, var(--mud-palette-background-gray) 80%, var(--mud-palette-surface));
    direction: ltr;
}

.rich-text-editor__tool-group {
    gap: .125rem;
}

.rich-text-editor__tool,
.rich-text-editor__link-close {
    display: inline-grid;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--app-radius-md);
    color: var(--mud-palette-text-secondary);
    background: transparent;
    cursor: pointer;
}

/* MudBlazor's inline SVG icons, at the size the icon font had and in the button's own colour, which changes on hover
   and when a tool is active. */
.rich-text-editor__tool .mud-icon-root,
.rich-text-editor__link-close .mud-icon-root {
    color: inherit;
    font-size: 1.25rem;
}

.rich-text-editor__tool:hover,
.rich-text-editor__link-close:hover {
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-action-default-hover);
}

/* A tool with words beside its icon: an email's "Placeholder" menu (28 October 2026). */
.rich-text-editor__tool--text {
    display: inline-flex;
    gap: .3rem;
    width: auto;
    padding: 0 .5rem;
    font-size: var(--app-font-detail);
    font-weight: 600;
}

/* An email's placeholder menu: under the toolbar, its email's own placeholders, then those saved for every email. */
.rich-text-editor__insert-panel {
    display: grid;
    gap: .5rem;
    max-height: 18rem;
    overflow-y: auto;
    padding: .5rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
}

.rich-text-editor__insert-panel[hidden] {
    display: none;
}

.rich-text-editor__insert-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
}

.rich-text-editor__insert-heading {
    flex-basis: 100%;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.rich-text-editor__insert {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    padding: .25rem .55rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--app-radius-md);
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    font: inherit;
    font-size: var(--app-font-detail);
    cursor: pointer;
}

.rich-text-editor__insert:hover,
.rich-text-editor__insert:focus-visible {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
}

.rich-text-editor__insert-token {
    font-size: var(--app-font-label);
    color: var(--mud-palette-text-secondary);
}

.rich-text-editor__tool.is-active {
    border-color: color-mix(in srgb, var(--mud-palette-primary) 24%, transparent);
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
}

.rich-text-editor__tool:focus-visible,
.rich-text-editor__link-action:focus-visible,
.rich-text-editor__link-close:focus-visible,
.rich-text-editor__link-input:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

.rich-text-editor__separator {
    align-self: stretch;
    width: 1px;
    margin: .25rem .125rem;
    background: var(--mud-palette-lines-default);
}

.rich-text-editor__surface {
    box-sizing: border-box;
    overflow: auto;
    padding: 1rem 1.125rem;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    font-family: "Open Sans", sans-serif;
    font-size: var(--app-font-reading);
    line-height: 1.65;
    outline: none;
    white-space: normal;
}

.rich-text-editor__surface:empty::before {
    color: var(--mud-palette-text-disabled);
    content: attr(data-placeholder);
    pointer-events: none;
}

.rich-text-editor__surface p {
    margin: 0 0 .875rem;
}

.rich-text-editor__surface p:last-child {
    margin-bottom: 0;
}

.rich-text-editor__surface ul,
.rich-text-editor__surface ol {
    margin: 0 0 .875rem;
    padding-inline-start: 1.5rem;
}

.rich-text-editor__surface ul:last-child,
.rich-text-editor__surface ol:last-child {
    margin-bottom: 0;
}

/* An email's grey panel (28 October 2026), shown as the email shows it: light grey, rounded, its words centred in
   QB CLEAR's blue. */
.rich-text-editor__surface blockquote.rich-text-editor__panel {
    margin: 0 0 .875rem;
    padding: .75rem 1.5rem;
    border-radius: 12px;
    background: #f4f4f5;
    color: #0062a6;
    text-align: center;
}

.rich-text-editor__surface blockquote.rich-text-editor__panel:last-child {
    margin-bottom: 0;
}

/* An email's colour buttons: a dot of the colour; "No colour" a dot crossed through. */
.rich-text-editor__swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--swatch);
    /* In the dark theme the ring is pale (11 November 2026): the dark grey dot all but vanished into the toolbar. */
    border: 1px solid light-dark(color-mix(in srgb, currentColor 30%, transparent), color-mix(in srgb, #f8fafc 65%, transparent));
}

.rich-text-editor__colour[data-editor-command="colour-none"] .rich-text-editor__swatch {
    background: linear-gradient(135deg, transparent 45%, #b91c1c 45%, #b91c1c 55%, transparent 55%);
}

.rich-text-editor__surface a {
    color: var(--mud-palette-primary);
    text-decoration: underline;
    text-underline-offset: .125em;
}

.rich-text-editor__surface code {
    padding: .08em .3em;
    border-radius: var(--app-radius-md);
    background: var(--mud-palette-action-default-hover);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .875em;
}

.rich-text-editor--rtl .rich-text-editor__surface {
    direction: rtl;
    text-align: right;
}

.rich-text-editor__link-panel {
    padding: .75rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
    direction: ltr;
}

.rich-text-editor__link-panel[hidden],
.rich-text-editor__link-error[hidden],
.rich-text-editor__link-action[hidden] {
    display: none;
}

.rich-text-editor__link-label {
    display: block;
    margin-bottom: .375rem;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    font-weight: 600;
}

.rich-text-editor__link-controls {
    gap: .5rem;
}

.rich-text-editor__link-input {
    min-width: 10rem;
    flex: 1;
    height: 2.25rem;
    padding: 0 .625rem;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: var(--app-radius-md);
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    font: inherit;
}

.rich-text-editor__link-action {
    min-height: 2.25rem;
    padding: 0 .75rem;
    border: 1px solid var(--mud-palette-primary);
    border-radius: var(--app-radius-md);
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
    font: inherit;
    font-size: var(--app-font-detail);
    font-weight: 600;
    cursor: pointer;
}

.rich-text-editor__link-action--quiet {
    border-color: var(--mud-palette-lines-inputs);
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
}

.rich-text-editor__link-error {
    display: block;
    margin-top: .375rem;
    color: var(--mud-palette-error);
    font-size: var(--app-font-caption);
}

.rich-text-editor__status {
    justify-content: flex-end;
    column-gap: .5rem;
    min-height: 1.625rem;
    padding-top: .375rem;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    line-height: 1.25rem;
}

.rich-text-editor__validation {
    margin-right: auto;
    color: var(--mud-palette-error);
    font-weight: 600;
}

.rich-text-editor__limit {
    color: var(--mud-palette-error);
    font-weight: 600;
}

@media (max-width: 599.98px) {
    .rich-text-editor__toolbar {
        padding-inline: .375rem;
    }

    .rich-text-editor__link-controls {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .rich-text-editor__link-input {
        width: 100%;
        flex-basis: 100%;
    }
}

/* ── Markdown rendered content ── */

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.markdown-content li {
    margin-bottom: 0.25em;
}

/* Transparent dialog backdrop — used by AppDialogOptions.SidePanelRight so the
   curator can still see the chart underneath while editing a level. */
.mud-overlay-transparent {
    background-color: transparent !important;
}

/* Highlight pulse for the chart card currently being edited (Edit dialog open). */
.edu-card-being-edited {
    outline: 3px solid #2563eb !important;
    outline-offset: -3px;

    z-index: 4;
}

/* When the body is in browser fullscreen for the education chart:
   - The chart outer (`.edu-chart-fullscreen-target`) covers the viewport at
     z-index 1399 — above MudAppBar (1300) but below MudDialog (1400) and
     bulk-action bar (9999) so dialogs + side-panel edits + selection bar all
     stay clickable and visible.
   - MudAppBar + MudDrawer hide so the chart owns the viewport visually.
   - Body padding zeroed so the chart aligns flush to viewport edges. */
body.edu-chart-fullscreen .edu-chart-fullscreen-target {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1399 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}
body.edu-chart-fullscreen .mud-appbar,
body.edu-chart-fullscreen .mud-drawer {
    visibility: hidden !important;
}
body.edu-chart-fullscreen {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}
.country-overview-controls {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.overview-validation-summary .validation-errors {
    margin: .5rem 0 0;
    padding-inline-start: 1.25rem;
}

.overview-validation-summary .validation-message + .validation-message {
    margin-top: .25rem;
}

.country-details-panel {
    overflow: hidden;
    border-radius: var(--app-radius-lg);
    background: var(--mud-palette-surface);
}

.overview-description-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.overview-language-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    padding: .1875rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--app-radius-md);
    background: var(--mud-palette-background-gray);
}

.overview-language-toggle__button {
    min-width: 5rem;
    padding: .375rem .75rem;
    border: 0;
    border-radius: var(--app-radius-sm);
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: var(--app-font-detail);
    font-weight: 600;
    line-height: 1.25rem;
}

.overview-language-toggle__button:hover {
    color: var(--mud-palette-text-primary);
}

.overview-language-toggle__button:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.overview-language-toggle__button--active {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.overview-description-panel {
    padding: 1.25rem;
}

.overview-description-panel--rtl {
    direction: rtl;
    text-align: right;
}

.overview-history-title {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.overview-history-loading {
    display: flex;
    min-height: 22rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .75rem;
    padding: 2rem;
    text-align: center;
}

.overview-history-loading--detail {
    min-height: 18rem;
}

.overview-history-workspace {
    display: grid;
    min-height: 30rem;
    grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--app-radius-lg);
    background: var(--mud-palette-surface);
}

.overview-history-revision-list {
    max-height: 36rem;
    overflow-y: auto;
    border-right: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-gray);
}

.overview-history-revision {
    position: relative;
    display: flex;
    width: 100%;
    gap: .75rem;
    padding: 1rem;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-primary);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.overview-history-revision:hover {
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--mud-palette-surface));
}

.overview-history-revision:focus-visible {
    z-index: 1;
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.overview-history-revision--selected {
    background: var(--mud-palette-surface);
}

.overview-history-revision__rail {
    width: .25rem;
    flex: 0 0 .25rem;
    align-self: stretch;
    border-radius: 999px;
    background: transparent;
}

.overview-history-revision--selected .overview-history-revision__rail {
    background: var(--mud-palette-primary);
}

.overview-history-revision__content,
.overview-history-revision__topline {
    display: flex;
    min-width: 0;
}

.overview-history-revision__content {
    flex: 1;
    flex-direction: column;
    gap: .25rem;
}

.overview-history-revision__topline {
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.overview-history-revision__version,
.overview-history-revision__action {
    font-size: var(--app-font-body);
    font-weight: 650;
}

.overview-history-revision__action {
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-history-revision__meta,
.overview-history-revision__fields {
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    line-height: 1.35;
}

.overview-history-current-badge {
    padding: .125rem .4rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mud-palette-success) 14%, transparent);
    color: var(--mud-palette-success-darken);
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
}

.overview-history-detail {
    min-width: 0;
    max-height: 36rem;
    overflow-y: auto;
    padding: 1.25rem;
}

.overview-history-detail__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.overview-history-changes {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.overview-history-change {
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--app-radius-md);
}

.overview-history-change__label {
    padding: .625rem .875rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-gray);
}

.overview-history-compare {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-history-value {
    min-width: 0;
    padding: .875rem;
    color: var(--mud-palette-text-primary);
    font-size: var(--app-font-body);
    overflow-wrap: anywhere;
}

.overview-history-value + .overview-history-value {
    border-left: 1px solid var(--mud-palette-lines-default);
}

/* The dark theme takes a stronger wash (11 November 2026): at the light theme's 4% and 5% the two sides were the
   same dark grey and could not be told apart. The words on either are still 9 to 1 or better. */
.overview-history-value--before {
    background: light-dark(color-mix(in srgb, var(--mud-palette-error) 4%, transparent), color-mix(in srgb, var(--mud-palette-error) 18%, transparent));
}

.overview-history-value--after {
    background: light-dark(color-mix(in srgb, var(--mud-palette-success) 5%, transparent), color-mix(in srgb, var(--mud-palette-success) 18%, transparent));
}

.overview-history-value__label {
    display: block;
    margin-bottom: .5rem;
    color: var(--app-label-ink);
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
}

.overview-history-value .markdown-content > :last-child {
    margin-bottom: 0;
}

@media (max-width: 599.98px) {
    .overview-description-header {
        align-items: stretch;
        flex-direction: column;
    }

    .overview-language-toggle {
        align-self: flex-start;
    }

    .overview-history-workspace {
        grid-template-columns: 1fr;
    }

    .overview-history-revision-list {
        max-height: 15rem;
        border-right: 0;
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }

    .overview-history-detail__header,
    .overview-history-compare {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .overview-history-detail__header {
        flex-direction: column;
    }

    .overview-history-value + .overview-history-value {
        border-top: 1px solid var(--mud-palette-lines-default);
        border-left: 0;
    }
}

.country-detail-section {
    padding: 1.125rem 1.25rem 1.25rem;
}

.country-detail-section + .country-detail-section {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.country-detail-section__heading {
    margin-bottom: 1rem;
    color: var(--mud-palette-text-primary);
    font-weight: 650;
}

.country-detail-list {
    display: grid;
    margin: 0;
    gap: 1rem 2rem;
}

.country-detail-list--facts,
.country-detail-list--names {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.country-detail-list--location {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.country-detail-item {
    min-width: 0;
}

.country-detail-item dt {
    margin: 0 0 .25rem;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    font-weight: 600;
    line-height: 1.125rem;
}

.country-detail-item dd {
    margin: 0;
    color: var(--mud-palette-text-primary);
    font-size: var(--app-font-reading);
    font-weight: 500;
    line-height: 1.375rem;
    overflow-wrap: anywhere;
}

.country-code-values {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.country-code-value {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
}

.country-code-value + .country-code-value::before {
    width: 1px;
    height: 1.125rem;
    margin-right: .1rem;
    background: var(--mud-palette-lines-default);
    content: "";
}

.country-code-value__label {
    color: var(--app-label-ink);
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
}

@media (max-width: 767.98px) {
    .country-detail-list--facts,
    .country-detail-list--names,
    .country-detail-list--location {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 479.98px) {
    .country-detail-section {
        padding: 1rem;
    }

    .country-detail-list--facts,
    .country-detail-list--names,
    .country-detail-list--location {
        grid-template-columns: minmax(0, 1fr);
    }
}

.editor-control-section {
    min-width: 0;
}

.editor-control-section__heading {
    margin-bottom: .75rem;
    color: var(--mud-palette-text-primary);
    font-weight: 650;
}

.editor-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .375rem;
}

.editor-field__label-row {
    display: flex;
    min-height: 1.5rem;
    align-items: center;
    gap: .25rem;
}

.editor-field__label {
    color: var(--mud-palette-text-primary);
    font-size: var(--app-font-detail);
    font-weight: 600;
    line-height: 1.25rem;
}

.editor-field__required {
    color: var(--mud-palette-error);
}

.editor-field__info {
    width: 1.5rem;
    height: 1.5rem;
    padding: .1875rem;
    color: var(--mud-palette-text-secondary);
}

.editor-inline-control {
    display: flex;
    min-width: 0;
    align-items: stretch;
    gap: .5rem;
}

.editor-inline-control > .mud-input-control {
    min-width: 0;
    flex: 1 1 auto;
}

.editor-inline-control > .mud-button-root {
    min-width: 7.5rem;
    white-space: nowrap;
}

@media (max-width: 599.98px) {
    .editor-inline-control {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-inline-control > .mud-button-root {
        min-height: 2.75rem;
    }
}
/* EntityDetailNavigation owns the visible and accessible tab controls on grouped
   detail pages. The MudTabs tabbar stays in the DOM so ActivePanelIndex binding
   keeps driving panel activation, but it must not reserve any layout height. */
.organisation-detail-tabs--grouped > .mud-tabs-tabbar {
    display: none;
}

/* Shared framework workspace shell — used by the standalone framework definition
   page, the country framework-link page and the FrameworkDefinitionEditor
   component they both host. */
.framework-definition-workspace {
    min-width: 0;
    background: var(--mud-palette-surface);
}

.framework-definition-workspace .mud-table-container {
    overflow-x: auto;
}

.framework-definition-toolbar {
    min-height: 72px;
    padding: 14px 24px;
    background: var(--mud-palette-surface);
}

.rich-text-editor__surface.ProseMirror { position: relative; white-space: pre-wrap; }
.rich-text-editor__surface[data-editor-empty="true"]::before {
    color: var(--mud-palette-text-disabled); content: attr(data-placeholder);
    pointer-events: none; position: absolute;
}

/* Record titles share native link/button semantics across list views. */
.record-title-link {
    color: inherit;
    font: inherit;
    text-align: inherit;
    text-decoration: none;
    text-underline-offset: .18em;
    cursor: pointer;
}
button.record-title-link {
    padding: 0;
    border: 0;
    background: none;
}
.record-title-link:hover,
.record-title-link:focus-visible,
tr:hover .record-title-link:not(:disabled),
.record-title-link:hover .entity-name > span,
.record-title-link:focus-visible .entity-name > span,
tr:hover .record-title-link .entity-name > span {
    text-decoration: underline;
}
.record-title-link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 3px;
    border-radius: var(--app-radius-sm);
}
.record-title-link:disabled {
    cursor: default;
    text-decoration: none;
}

/* Staff interactions are immediate; retain animation only for loading progress.
   The near-zero duration preserves completion events used by component libraries.
   The selectors are written with :where() (12 November 2026), so the rule weighs nothing more than an element: the
   few motions that answer something a staff member did (a dialog, a panel, a saved row, the line under the top
   bar; see "Motion, only as an answer" at the end of this file) are let through by name there. */
*, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
}

:where(*:not(.mud-progress-circular):not(.mud-progress-circular *):not(.mud-progress-linear):not(.mud-progress-linear *)),
:where(*)::before, :where(*)::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Member management (14 October 2026): summary strips of figures,
   section cards and label/value grids, in the portal's own style.
   ═══════════════════════════════════════════════════════════════ */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    width: 100%;
    padding: 12px 14px 12px 17px;
    text-align: start;
    font: inherit;
    color: inherit;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--app-radius-lg);
}

/* The tone's edge. It was a straight bar the height of the tile, which stood square against the tile's corner once
   the corner was rounded to 12 px (12 November 2026): the bar's ends showed outside the curve. It is now a short
   bar with rounded ends, clear of both corners, on the tile's edge. A tile with no tone has no bar. */
.stat-tile::before {
    content: "";
    position: absolute;
    inset-block: 12px;
    inset-inline-start: -1px;
    width: 3px;
    border-start-end-radius: 3px;
    border-end-end-radius: 3px;
    background: var(--stat-tone, transparent);
}

.stat-tile--primary { --stat-tone: var(--mud-palette-primary); }
.stat-tile--success { --stat-tone: var(--mud-palette-success); }
.stat-tile--warning { --stat-tone: var(--mud-palette-warning); }
.stat-tile--error { --stat-tone: var(--mud-palette-error); }
.stat-tile--info { --stat-tone: var(--mud-palette-info); }

/* A summary figure that is also a filter is a button, and a button centres what it holds; the figure lines up at the
   start like the figures that are not buttons. */
.stat-tile--clickable {
    align-items: stretch;
    justify-content: flex-start;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

/* A tile that opens a page is a link: it keeps the tile's own lettering, not a link's colour and underline. */
a.stat-tile,
a.stat-tile:hover {
    color: inherit;
    text-decoration: none;
}

.stat-tile--clickable:hover {
    border-color: var(--stat-tone, var(--mud-palette-primary));
    background: var(--mud-palette-background-gray);
}

.stat-tile--clickable:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.stat-tile--selected {
    border-color: var(--stat-tone, var(--mud-palette-primary));
    background: var(--mud-palette-background-gray);
    box-shadow: inset 0 -2px 0 var(--stat-tone, var(--mud-palette-primary));
}

.stat-tile__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.stat-tile__label {
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.stat-tile__icon {
    color: var(--stat-tone, var(--mud-palette-text-disabled));
}

.stat-tile__value {
    font-size: var(--app-font-figure);
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-primary);
}

.stat-tile__hint {
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
}

/* What a tile shows under its figure, such as a chip with a word beside it. */
.stat-tile__extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: var(--app-font-caption);
}

.section-card {
    border-radius: var(--app-radius-lg) !important;
    overflow: hidden;
}

.section-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--mud-palette-background-gray);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.section-card__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.section-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--mud-palette-primary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
}

.section-card__title {
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.section-card__subtitle {
    color: var(--mud-palette-text-secondary);
}

.section-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.section-card__body {
    padding: 16px;
}

.section-card__body--flush {
    padding: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px 24px;
    margin: 0;
}

@media (min-width: 960px) {
    .detail-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .detail-grid__item--wide { grid-column: 1 / -1; }
}

.detail-grid__item {
    min-width: 0;
}

.detail-grid__item dt {
    margin-bottom: 2px;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.detail-grid__item dd {
    margin: 0;
    font-size: var(--app-font-body);
    color: var(--mud-palette-text-primary);
    overflow-wrap: anywhere;
}

.detail-grid__empty {
    color: var(--mud-palette-text-disabled);
}

/* ═══════════════════════════════════════════════════════════════
   Organization detail tabs and dialogs (14 October 2026): the
   Package, Visibility, Country access and API access tabs and the
   organization dialogs. Rows with a coloured edge for an override
   or an unsaved change, grouped lists, grouped fields and dialog
   title icons, in the portal's own style. Tables use the shared
   list styling and its cell helpers (.cell-num, .cell-secondary).
   ═══════════════════════════════════════════════════════════════ */
.org-tab {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    container-type: inline-size;
}

.org-tab .stat-tile__value {
    overflow-wrap: break-word;
}

/* A search box and a count over a list in a section card. */
.org-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.org-list-toolbar__search {
    flex: 1 1 220px;
    max-width: 360px;
}

.org-list-toolbar__search.mud-input-control {
    margin: 0 !important;
}

.org-list-toolbar__count {
    margin-inline-start: auto;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* A group of rows under a category heading. */
.org-group__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: var(--mud-palette-background-gray);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.org-group + .org-group .org-group__header {
    border-top: 1px solid var(--mud-palette-divider);
}

.org-group__title {
    margin: 0;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.org-group__count {
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* One row of a list: what it is and its state on the left, its control on the right, wrapping under on a narrow pane. */
.org-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.org-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 10px 16px 10px 19px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.org-row:last-child {
    border-bottom: 0;
}

.org-row::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 3px;
    background: transparent;
}

.org-row--override::before {
    background: var(--mud-palette-primary);
}

.org-row--muted::before {
    background: var(--mud-palette-lines-default);
}

.org-row--pending {
    background: color-mix(in srgb, var(--mud-palette-warning) 7%, transparent);
}

.org-row--pending::before {
    background: var(--mud-palette-warning);
}

.org-row__main {
    display: flex;
    flex: 1 1 260px;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.org-row__title {
    font-size: var(--app-font-body);
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    overflow-wrap: anywhere;
}

.org-row__title code {
    margin-inline-start: 6px;
    font-size: var(--app-font-detail);
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
}

.org-row__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.org-row__chips .mud-chip {
    margin: 0;
}

.org-row__main > .cell-secondary {
    margin-top: 0;
    overflow-wrap: anywhere;
}

.org-row__control {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* A note under a heading or above a form: what the section holds now. */
.org-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 0;
    padding: 10px 12px;
    font-size: var(--app-font-body);
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-divider);
}

.org-note .mud-icon-root {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--mud-palette-text-secondary);
}

/* The bar of unsaved changes beside a card's Save. */
.org-pending {
    font-size: var(--app-font-detail);
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.org-pending--changed {
    color: var(--mud-palette-warning-darken);
}

/* A seat count over a bar that fills to the limit. */
.org-meter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.org-meter__figures {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: var(--app-font-body);
    font-variant-numeric: tabular-nums;
}

.org-meter__figures strong {
    font-size: var(--app-font-card);
}

/* Fields in a dialog or card, grouped under a small heading with a line of help. */
.org-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.org-fieldset + .org-fieldset {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--mud-palette-divider);
}

.org-fieldset > legend {
    float: left;
    width: 100%;
    margin-bottom: 4px;
    padding: 0;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.org-fieldset > legend + * {
    clear: both;
}

.org-fieldset__hint {
    margin-bottom: 10px;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
}

.org-fieldset__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.org-fieldset__body > .mud-input-control,
.org-fieldset__body > .mud-grid {
    margin-top: 0;
}

/* A dialog's title: an icon, the action and a line on what it does. */
.org-dialog-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.org-dialog-title__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 35%, transparent);
}

.org-dialog-title--destructive .org-dialog-title__icon {
    color: var(--mud-palette-error);
    background: color-mix(in srgb, var(--mud-palette-error) 10%, transparent);
    border-color: color-mix(in srgb, var(--mud-palette-error) 35%, transparent);
}

.org-dialog-title__text {
    min-width: 0;
}

.org-dialog-title__subtitle {
    margin-top: 2px;
    color: var(--mud-palette-text-secondary);
}

/* A radio choice with a line of help under its label. */
.org-choice-help {
    display: block;
    margin: -4px 0 6px 48px;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
}

.org-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.org-chip-list .mud-chip {
    margin: 0;
}

@media (max-width: 600px) {
    .org-row__control {
        justify-content: flex-start;
    }

    .org-list-toolbar__search {
        max-width: none;
    }

    .org-list-toolbar__count {
        margin-inline-start: 0;
    }
}

/* Text for screen readers alone, such as a table's actions column heading. */
.org-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* A summary figure that filters a list or opens a page is a button; MudBlazor centres a button's content and sets its
   lettering, so its label, figure and line under it are put back on the start edge in a plain tile's lettering, as
   the figures that are not buttons have them, and a row of tiles lines up. (A fix for the shared StatTile, kept here
   until it moves there.) */
button.stat-tile {
    align-items: stretch;
    justify-content: flex-start;
    min-width: 0;
    line-height: normal;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}

/* An organization tab's figures share one row, and two rows of two on a narrow pane, never three and one. */
.org-tab > .stat-strip {
    margin-bottom: 0;
    grid-template-columns: none;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
}

@container (max-width: 560px) {
    .org-tab > .stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row;
    }
}

/* Override switches line up from row to row. */
.org-row__control .mud-toggle-group {
    min-width: 216px;
}

/* A fee's actions: side by side, wrapping under one another only where the narrow pane has no room for them. */
.org-fee-actions-cell {
    text-align: end;
}

.org-fee-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
    min-width: 132px;
}

.org-fieldset__hint--error {
    color: var(--mud-palette-error);
}

/* Choices in a group stack one under another, each with its line of help. */
.org-fieldset .mud-input-control.mud-input-control-boolean-input .mud-radio-group {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
}

/* Short label/value pairs two to a row even in a dialog or a narrow pane, then the grid's own columns from md up. */
.detail-grid.org-detail-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 400px) {
    .detail-grid.org-detail-pair {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 960px) {
    .detail-grid--3.org-detail-pair { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-grid--4.org-detail-pair { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


/* ═══════════════════════════════════════════════════════════════
   Member management: billing and sign-up requests (14 October 2026)
   Pages/Admin/Billing: the sign-up requests list and request page,
   the Billing catalogue, the accounts reports, the IQC costs and the
   billing dialogs. Square, palette colours only, so dark mode holds.
   Shared helpers used here and defined elsewhere: .stat-strip,
   .section-card, .detail-grid, .cell-num, .cell-secondary,
   .cell-actions.
   ═══════════════════════════════════════════════════════════════ */

/* Text tones that stay readable on light and dark surfaces: the tone mixed with the body text colour. */
.billing-text--warning {
    color: color-mix(in srgb, var(--mud-palette-warning) 55%, var(--mud-palette-text-primary));
    font-weight: 600;
}

.billing-text--error {
    color: color-mix(in srgb, var(--mud-palette-error) 70%, var(--mud-palette-text-primary));
    font-weight: 600;
}

.billing-muted {
    color: var(--mud-palette-text-secondary);
}

.billing-nowrap {
    white-space: nowrap;
}

/* A long reference with no spaces, such as Telr's 64-character order reference, wraps inside its column. */
.billing-break {
    overflow-wrap: anywhere;
}

.billing-inline-icon {
    vertical-align: text-bottom;
    margin-inline-end: 2px;
}

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

/* ── Page structure: filters, section navigation and stacked section cards ── */
.billing-filters,
.billing-nav {
    margin-bottom: 16px;
}

.billing-filters .page-toolbar {
    border-bottom: 0;
}

.billing-filters__caption {
    margin-inline-start: auto;
    color: var(--mud-palette-text-secondary);
}

.billing-filters__caption--below {
    display: block;
    padding: 0 16px 10px;
    margin: 0;
    background: var(--mud-palette-background-gray);
}

.billing-nav .entity-detail-navigation {
    border-bottom: 0;
}

.billing-stack {
    display: grid;
    gap: 16px;
}

.billing-cell-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.billing-price-list {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px;
}

.billing-price-button {
    min-width: 0 !important;
    padding-inline: 6px !important;
    font-variant-numeric: tabular-nums;
    text-transform: none !important;
}

/* A plain table inside a section card or dialog, read the same way as the portal's grids. */
.billing-table-wrap {
    overflow-x: auto;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--app-font-body);
}

.billing-table th,
.billing-table td {
    padding: 8px 12px;
    text-align: start;
    vertical-align: middle;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.billing-table thead th {
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    white-space: nowrap;
    color: var(--app-label-ink);
    background: var(--mud-palette-background-gray);
}

.billing-table th.cell-num,
.billing-table td.cell-num {
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.billing-table tbody tr:last-child td {
    border-bottom: 0;
}

.billing-table--outlined {
    border: 1px solid var(--mud-palette-divider);
}

.billing-table__action {
    width: 1%;
    text-align: end !important;
    white-space: nowrap;
}

.billing-table__empty {
    color: var(--mud-palette-text-secondary);
}

.billing-table__row--retired td {
    color: var(--mud-palette-text-secondary);
}

/* Amounts that add up to a total: the figures right-aligned, the total ruled off and bold. */
.billing-amounts {
    width: 100%;
    max-width: 26rem;
    margin-top: 12px;
    border-collapse: collapse;
    font-size: var(--app-font-body);
    font-variant-numeric: tabular-nums;
}

.billing-amounts th,
.billing-amounts td {
    padding: 4px 0;
}

.billing-amounts th {
    font-weight: 400;
    text-align: start;
    color: var(--mud-palette-text-secondary);
}

.billing-amounts td {
    text-align: end;
    white-space: nowrap;
}

.billing-amounts__total th,
.billing-amounts__total td {
    padding-top: 8px;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
    border-top: 1px solid var(--mud-palette-divider);
}

/* ── Dialogs: title with an icon, a lead line on the effect, grouped fields ── */
.billing-dialog-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.billing-dialog-title__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--mud-palette-primary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
}

.billing-dialog-title--error .billing-dialog-title__icon {
    color: var(--mud-palette-error);
    border-color: color-mix(in srgb, var(--mud-palette-error) 40%, var(--mud-palette-divider));
}

.billing-dialog-title__text {
    min-width: 0;
}

.billing-dialog-title__subtitle {
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

.billing-dialog-lead {
    margin: 0 0 16px;
    color: var(--mud-palette-text-secondary);
}

.billing-dialog-footnote {
    display: block;
    margin-top: 12px;
    color: var(--mud-palette-text-secondary);
}

.billing-form-section {
    min-width: 0;
    margin: 16px 0 0;
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--mud-palette-divider);
}

.billing-form-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.billing-form-section__title {
    display: block;
    width: 100%;
    margin: 0 0 4px;
    padding: 0;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.billing-form-section__hint {
    margin: 0 0 12px;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
}

.billing-form-section__label {
    display: block;
    margin: 12px 0 2px;
    font-size: var(--app-font-label) !important;
    font-weight: var(--app-label-weight) !important;
    color: var(--app-label-ink);
}

.billing-switch-field {
    margin: 4px 0 12px;
}

.billing-switch-field__help {
    display: block;
    margin-top: -2px;
    color: var(--mud-palette-text-secondary);
}

.billing-step-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 8px;
}

.billing-step-row > .mud-tooltip-root {
    padding-top: 12px;
}

.billing-balance {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-divider);
}

.billing-danger-zone {
    margin-top: 20px;
    padding: 16px;
    background: color-mix(in srgb, var(--mud-palette-error) 6%, var(--mud-palette-surface));
    border: 1px solid color-mix(in srgb, var(--mud-palette-error) 45%, var(--mud-palette-divider));
    border-inline-start: 3px solid var(--mud-palette-error);
}

.billing-danger-zone__title {
    margin-bottom: 4px;
    font-weight: 700 !important;
    color: color-mix(in srgb, var(--mud-palette-error) 70%, var(--mud-palette-text-primary));
}

.plan-fee-schedule__editor {
    margin-top: 12px;
    padding: 12px 16px 16px;
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-divider);
}

.plan-fee-schedule__editor .billing-form-section__label {
    margin-top: 0;
    margin-bottom: 8px;
}

/* ── Sign-up requests list ── */
.signup-row {
    display: grid;
    gap: 2px;
    padding: 4px 0;
}

.signup-row__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    font-weight: 600;
}

.signup-row__warning {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--app-font-caption);
    font-weight: 700;
    white-space: nowrap;
    color: color-mix(in srgb, var(--mud-palette-warning) 55%, var(--mud-palette-text-primary));
}

.signup-row__warning .mud-icon-root {
    color: var(--mud-palette-warning);
    font-size: 1.05rem;
}

.signup-row__meta {
    font-size: var(--app-font-caption);
    line-height: 1.35;
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

/* ── A sign-up request's notes and timeline (20 October 2026) ── */
.signup-note-box {
    display: grid;
    gap: 8px;
    justify-items: start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.signup-note-box .mud-input-control {
    width: 100%;
}

.sign-up-history__note td {
    background: color-mix(in srgb, var(--mud-palette-info) 7%, transparent);
}

.sign-up-history__demo td {
    background: color-mix(in srgb, var(--mud-palette-success) 7%, transparent);
}

.sign-up-history .cell-secondary {
    display: block;
    margin-top: 2px;
}

/* ── Demo Requests: the list or calendar switch, and the calendar of demos booked (20 October 2026) ── */
.demo-view-switch {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.demo-calendar__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.demo-calendar__nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.demo-calendar__month {
    margin: 0 6px;
    min-width: 9.5rem;
    text-align: center;
    font-size: var(--app-font-card);
    font-weight: 600;
}

.demo-calendar__zone {
    margin-inline-start: 8px;
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
}

.demo-calendar__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.demo-calendar__key {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: var(--app-font-caption);
    font-weight: 600;
}

.demo-calendar__loading {
    margin: 0;
}

.demo-calendar__scroll {
    overflow-x: auto;
}

.demo-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(6.5rem, 1fr));
    min-width: 46rem;
}

.demo-calendar__weekday {
    padding: 6px 8px;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.demo-calendar__day {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 6.5rem;
    padding: 6px;
    border-right: 1px solid var(--mud-palette-divider);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.demo-calendar__day:nth-child(7n) {
    border-right: 0;
}

.demo-calendar__day--outside {
    background: color-mix(in srgb, var(--mud-palette-text-primary) 3%, transparent);
}

.demo-calendar__day--outside .demo-calendar__date {
    color: var(--mud-palette-text-disabled);
}

.demo-calendar__date {
    font-size: var(--app-font-caption);
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.demo-calendar__day--today .demo-calendar__date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
}

.demo-calendar__event {
    display: flex;
    gap: 5px;
    min-width: 0;
    padding: 3px 6px;
    border-radius: var(--app-radius-sm);
    font-size: var(--app-font-caption);
    line-height: 1.3;
    text-decoration: none;
    border-inline-start: 3px solid currentColor;
}

.demo-calendar__event:hover {
    filter: brightness(.95);
}

.demo-calendar__time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

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

/* One week instead of the month (11 November 2026): taller days, and each demo's Dubai time on a line of its own. */
.demo-calendar__span {
    margin-inline-start: 8px;
}

.demo-calendar__day--week {
    min-height: 11rem;
}

.demo-calendar__day--week .demo-calendar__event {
    flex-wrap: wrap;
}

.demo-calendar__dubai {
    flex-basis: 100%;
    font-size: var(--app-font-label);
}

.demo-calendar__event--booked {
    color: color-mix(in srgb, var(--mud-palette-success) 70%, var(--mud-palette-text-primary));
    background: color-mix(in srgb, var(--mud-palette-success) 14%, transparent);
}

.demo-calendar__event--moved {
    color: color-mix(in srgb, var(--mud-palette-primary) 75%, var(--mud-palette-text-primary));
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}

.demo-calendar__event--closed {
    color: var(--mud-palette-text-secondary);
    background: color-mix(in srgb, var(--mud-palette-text-primary) 7%, transparent);
}

.demo-calendar__agenda {
    padding: 14px;
}

.demo-calendar__agenda-title {
    margin: 0 0 8px;
    font-size: var(--app-font-reading);
    font-weight: 600;
}

.demo-calendar__list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.demo-calendar__item {
    display: grid;
    grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 16px;
    padding: 8px 0;
    border-top: 1px solid var(--mud-palette-divider);
}

.demo-calendar__when,
.demo-calendar__who {
    display: grid;
    gap: 1px;
}

@media (max-width: 640px) {
    .demo-calendar__item {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── One sign-up request: details, with the decision panel on top on a narrow screen and beside them on a wide one ── */
.signup-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.signup-detail__main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.signup-detail__aside {
    min-width: 0;
}

@media (min-width: 1200px) {
    .signup-detail {
        grid-template-columns: minmax(0, 1fr) 340px;
    }

    .signup-detail__aside {
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: 16px;
    }

    .signup-detail__main {
        grid-column: 1;
        grid-row: 1;
    }
}

.signup-section {
    min-width: 0;
}

.signup-decision {
    display: grid;
    gap: 12px;
}

.signup-decision__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.signup-decision__chips .mud-chip {
    margin: 0;
}

.signup-decision__actions {
    display: grid;
    gap: 8px;
    padding-top: 4px;
}

.signup-decision__note {
    margin: 0;
}

/* A booked demo at the top of the decision panel: its time large, and joining it filled while it is about to start or
   under way. */
.demo-booked {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 35%, var(--mud-palette-divider));
    border-left: 4px solid var(--mud-palette-primary);
    border-radius: var(--app-radius-lg);
    background: color-mix(in srgb, var(--mud-palette-primary) 7%, var(--mud-palette-surface));
}

.demo-booked--now {
    background: color-mix(in srgb, var(--mud-palette-primary) 14%, var(--mud-palette-surface));
}

.demo-booked__label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--app-label-ink);
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
}

.demo-booked__time {
    display: grid;
    gap: 0;
    line-height: 1.25;
}

.demo-booked__time span {
    font-size: var(--app-font-reading);
    font-weight: 600;
}

.demo-booked__time strong {
    font-size: var(--app-font-headline);
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.demo-booked__meta {
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-body);
}

.signup-decision__tailor {
    display: grid;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--mud-palette-divider);
}

.signup-decision__tailor-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* A Ministry or Regulator enquiry (15 October 2026): the steps to its custom plan, where to tailor it, and the charge. */
.signup-decision__bespoke {
    display: grid;
    gap: 12px;
}

.signup-decision__steps-title {
    display: block;
    font-weight: 600;
}

.signup-decision__steps {
    margin: 4px 0 8px;
    padding-inline-start: 20px;
}

.signup-decision__steps li + li {
    margin-top: 2px;
}

.signup-decision__charge {
    padding-top: 12px;
    border-top: 1px solid var(--mud-palette-divider);
}

/* ── A sign-up's steps (11 November 2026): where it stands, on its request's page and the member's sign-up card ── */
.signup-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.signup-steps__step {
    display: flex;
    flex: 1 1 9rem;
    gap: 8px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--mud-palette-divider);
    border-top: 3px solid var(--mud-palette-divider);
    border-radius: var(--app-radius-md);
    background: var(--mud-palette-surface);
}

.signup-steps__mark {
    display: inline-flex;
    flex: none;
    margin-top: 1px;
    color: var(--mud-palette-text-disabled);
}

.signup-steps__text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.signup-steps__title {
    font-size: var(--app-font-body);
    font-weight: 600;
}

.signup-steps__detail {
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

.signup-steps__step--done {
    border-top-color: var(--mud-palette-success);
}

.signup-steps__step--done .signup-steps__mark {
    color: var(--mud-palette-success);
}

.signup-steps__step--current {
    border-top-color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--mud-palette-surface));
}

.signup-steps__step--current .signup-steps__mark {
    color: var(--mud-palette-primary);
}

.signup-steps__step--turned-down {
    border-top-color: var(--mud-palette-error);
    background: color-mix(in srgb, var(--mud-palette-error) 6%, var(--mud-palette-surface));
}

.signup-steps__step--turned-down .signup-steps__mark {
    color: var(--mud-palette-error);
}

.signup-steps__step--to-come .signup-steps__title,
.signup-steps__step--skipped .signup-steps__title {
    color: var(--mud-palette-text-secondary);
}

.signup-steps__step--skipped .signup-steps__title {
    text-decoration: line-through;
}

/* The words for a struck-through step stay readable to a screen reader and are not struck through themselves. */
.signup-steps__step--skipped .signup-steps__title .visually-hidden {
    text-decoration: none;
}

.signup-decision__charge > .signup-subsection__title {
    margin-top: 0;
}

.signup-warnings {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.signup-warnings__item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--mud-palette-warning) 8%, var(--mud-palette-surface));
    border-inline-start: 3px solid var(--mud-palette-warning);
}

.signup-warnings__item + .signup-warnings__item {
    margin-top: 8px;
}

.signup-warnings__text {
    display: grid;
    gap: 2px;
    min-width: 0;
    font-size: var(--app-font-body);
    overflow-wrap: anywhere;
}

.signup-warnings__title {
    font-weight: 700;
}

.signup-subsection {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--mud-palette-divider);
}

.signup-subsection__title {
    margin: 16px 0 10px;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.signup-subsection > .signup-subsection__title {
    margin-top: 0;
}

.signup-text--warning {
    color: color-mix(in srgb, var(--mud-palette-warning) 55%, var(--mud-palette-text-primary));
    font-weight: 600;
}

/* Label and value pairs on the billing and sign-up pages sit two to a row from a narrow pane up, not only from 960px. */
@media (min-width: 560px) {
    .signup-detail .detail-grid--2,
    .billing-stack .detail-grid--2,
    .billing-detail-grid.detail-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .signup-detail .detail-grid__item--wide,
    .billing-stack .detail-grid__item--wide,
    .billing-detail-grid .detail-grid__item--wide {
        grid-column: 1 / -1;
    }
}

.billing-table-note {
    border-top: 1px solid var(--mud-palette-divider);
}

/* A summary figure that is a name rather than a number, such as the plan new sign-ups join. */
.stat-tile--text .stat-tile__value {
    padding-block: 3px 1px;
    font-size: var(--app-font-section);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* Figures in the billing lists stay on one line; a long price list wraps in its own column. */
.billing-section td.cell-num {
    white-space: nowrap;
}

/* Invoices and selling businesses (15 October 2026): the status figures above the invoice list sit inside the card's
   flush body, a draft's lines are edited a row at a time, and the two businesses sit side by side on a wide screen. */
.billing-invoice-figures {
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.billing-line-editor {
    display: grid;
    gap: 8px;
}

.billing-line-editor__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px 12px;
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-divider);
}

@media (min-width: 960px) {
    .billing-line-editor__row {
        grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
        align-items: center;
    }
}

.billing-entities {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 1280px) {
    .billing-entities {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.billing-entity__address {
    font-style: normal;
    white-space: pre-line;
}


/* ═══════════════════════════════════════════════════════════════
   Organizations list and organization page (14 October 2026):
   the status strip that filters the list, two-line rows, the
   organization workspace, its section cards and the sign-up card.
   The shared list helpers (.cell-secondary, .cell-num,
   .cell-actions) do the cells' work; this adds what is particular
   to these pages. Square, palette colours only, so dark mode
   follows the theme.
   ═══════════════════════════════════════════════════════════════ */

/* ── Text: muted values, coloured hints and amounts ── */
.org-muted {
    color: var(--mud-palette-text-secondary);
}

/* Mixed towards the text colour, so a warning or an overdue date stays readable on light and dark surfaces. Doubled
   up with .cell-secondary, so the hint keeps its colour as a muted second line wherever the shared rule sits. */
.org-hint--warning,
.cell-secondary.org-hint--warning {
    color: color-mix(in srgb, var(--mud-palette-warning) 60%, var(--mud-palette-text-primary));
    font-weight: 600;
}

.org-hint--error,
.cell-secondary.org-hint--error {
    color: color-mix(in srgb, var(--mud-palette-error) 80%, var(--mud-palette-text-primary));
    font-weight: 600;
}

.org-amount--in {
    color: color-mix(in srgb, var(--mud-palette-success) 70%, var(--mud-palette-text-primary));
    font-weight: 600;
}

.org-amount--out {
    color: color-mix(in srgb, var(--mud-palette-error) 80%, var(--mud-palette-text-primary));
    font-weight: 600;
}

.org-strong {
    font-weight: 600;
}

.org-nowrap {
    white-space: nowrap;
}

/* A value with a line under it, in a cell or a label and value grid. */
.org-cell {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.org-cell--end {
    align-items: flex-end;
}

.org-cell--start {
    align-items: flex-start;
}

.org-cell__primary {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

/* A figures column's heading sits right too: the grid's heading is a flex row. */
th.cell-num .column-header {
    justify-content: flex-end;
}

.org-col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: end;
}

.org-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.org-code {
    padding: 1px 6px;
    font-size: var(--app-font-detail);
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-divider);
}

.org-address {
    display: flex;
    flex-direction: column;
    font-style: normal;
}

.org-chip-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.org-chip-row .mud-chip {
    margin: 0;
}

.org-note--flush {
    margin: 0;
}

.org-note--footer {
    margin: 0;
    padding: 10px 16px;
    font-size: var(--app-font-caption);
    border-top: 1px solid var(--mud-palette-divider);
}

/* ── The organizations list ── */
.org-status-strip .stat-tile__value {
    font-size: var(--app-font-figure-compact);
}

/* Six tiles: two or three to a row in a narrow window, all six in a wide one. */
.org-status-strip--six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 520px) {
    .org-status-strip--six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .org-status-strip--six {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Eight tiles (the two sign-up stages joined the six, 11 November 2026): two, then four to a row, and all eight in
   a very wide window. */
.org-status-strip--eight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 700px) {
    .org-status-strip--eight {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1700px) {
    .org-status-strip--eight {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

/* Tighter cells, so the lists fit a window about 690 pixels wide without scrolling sideways. */
.org-list .mud-table-root .mud-table-row .mud-table-cell,
.org-workspace .mud-table-root .mud-table-row .mud-table-cell,
.org-table.mud-simple-table table * tr > td,
.org-table.mud-simple-table table * tr > th {
    padding-inline: 8px;
}

.org-list .mud-table-root .mud-table-row .mud-table-cell:first-child,
.org-workspace .mud-table-root .mud-table-row .mud-table-cell:first-child,
.org-table.mud-simple-table table * tr > :first-child {
    padding-inline-start: 12px;
}

/* A long email stops with an ellipsis rather than breaking mid-word; the whole of it is its title. */
.org-email {
    display: block;
    max-width: 20ch;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.org-plan-chip {
    margin: 0;
    max-width: 18ch;
}

/* A trial or a demo account: its chip and when it ends, side by side, the date going under it in a narrow cell. */
.org-trial {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
}

.org-trial .mud-chip {
    margin: 0;
}

/* ── Sign-ups waiting above the list ── */
.waiting-signups__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.waiting-signups__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.waiting-signups__row:last-child {
    border-bottom: 0;
}

.waiting-signups__row .mud-chip {
    margin: 0;
}

.waiting-signups__when {
    grid-column: 1 / -1;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
}

@media (min-width: 760px) {
    .waiting-signups__row {
        grid-template-columns: minmax(0, 1fr) auto 15rem;
    }

    .waiting-signups__when {
        grid-column: auto;
        text-align: end;
    }
}

.waiting-signups__more {
    padding: 8px 16px;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
    border-top: 1px solid var(--mud-palette-divider);
}

/* ── The organization page ── */
.org-alert__reason {
    margin-top: 2px;
}

.org-workspace__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

@media (max-width: 600px) {
    .org-workspace__body {
        padding: 12px;
    }
}

.org-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 1200px) {
    .org-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .org-overview__wide {
        grid-column: 1 / -1;
    }
}

/* The team's notes on a member's record (11 November 2026): each note over who wrote it and when. */
.org-notes {
    margin: 0;
    padding: 0;
    list-style: none;
}

.org-notes__item {
    display: grid;
    gap: 2px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.org-notes__text {
    font-size: var(--app-font-body);
}

/* Label and value grids answer to the card they sit in rather than to the window, so they keep two columns in a
   narrow window and do not crowd a card that shares a row. */
.org-workspace .section-card__body,
.signup-card .section-card__body {
    container-type: inline-size;
}

.org-workspace .detail-grid__item--wide,
.signup-card .detail-grid__item--wide {
    grid-column: 1 / -1;
}

@container (min-width: 440px) {
    .org-workspace .detail-grid--2,
    .org-workspace .detail-grid--3,
    .org-workspace .detail-grid--4,
    .signup-card .detail-grid--3,
    .signup-card .detail-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (min-width: 720px) {
    .org-workspace .detail-grid--3,
    .signup-card .detail-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .org-workspace .detail-grid--4,
    .signup-card .detail-grid--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* A strip of figures inside a card ends with the card's own padding. */
.section-card__body > .stat-strip:last-child {
    margin-bottom: 0;
}

.org-inline-figures .stat-tile {
    background: var(--mud-palette-background-gray);
}

/* The page's simple tables (credit batches, action costs) keep each heading on one line; the small capitals and the
   tinted band are every simple table's (see "Every list" above). */
.org-table.mud-simple-table table thead tr > th {
    white-space: nowrap;
}

.org-table.mud-simple-table table tbody tr > td {
    vertical-align: middle;
}

/* The simple tables' own cell rule outranks .cell-num, so their figures are put right here. */
.org-table.mud-simple-table table * tr > .cell-num {
    text-align: end;
}

.org-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
}

@media (min-width: 720px) {
    .org-form-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
    }
}

.org-form-row .mud-input-control {
    margin-top: 0;
}

.org-form-row__action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 40px;
}

/* ── The sign-up card: an edge in its state's colour, then its panels ── */
.signup-card {
    --signup-tone: var(--mud-palette-lines-default);
    border-inline-start: 3px solid var(--signup-tone) !important;
}

.signup-card--warning { --signup-tone: var(--mud-palette-warning); }
.signup-card--info { --signup-tone: var(--mud-palette-info); }
.signup-card--error { --signup-tone: var(--mud-palette-error); }
.signup-card--success { --signup-tone: var(--mud-palette-success); }

.signup-card .section-card__icon {
    color: var(--signup-tone);
}

.signup-card .section-card__actions .mud-chip {
    margin: 0;
}

.signup-card__panel {
    padding: 14px 16px;
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-divider);
}

.signup-card__panel + .signup-card__panel {
    margin-top: 12px;
}

.signup-card__panel-title {
    margin-bottom: 8px;
    font-weight: 700 !important;
}

.signup-card__panel-note {
    margin-bottom: 12px;
    color: var(--mud-palette-text-secondary);
}

.signup-card__panel .mud-input.mud-input-outlined {
    background: var(--mud-palette-surface);
}

.signup-card__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

@container (min-width: 520px) {
    .signup-card__fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (min-width: 900px) {
    .signup-card__fields {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


/* ═══════════════════════════════════════════════════════════════
   Staff home, enquiries, users, translations, product configuration
   and the app shell (14 October 2026, UI audit). Appended last so it
   settles the shared rules above for these pages.
   ═══════════════════════════════════════════════════════════════ */

/* Muted copy that is not a link: an intro line, a hint, a caption. The theme's secondary colour is a blue that reads as
   a link, so plain explanatory text uses the secondary text colour instead. */
.text-muted {
    color: var(--mud-palette-text-secondary) !important;
}

/* ── Staff home ──
   Six figures in two even rows of three (two on a phone), so no row ends with a lone tile. */
/* The home page's sections (11 November 2026): what waits on staff and the "Do next" list first, the latest
   changes next, and the databank's figures under their own heading. */
.home-do-next {
    margin-bottom: 16px;
}

.home-section-title {
    margin: 8px 0 12px;
    font-weight: 700;
}

.home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 600px) {
    .home-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Four figures (sign-ups and demos, 21 October 2026) sit in one row on a wide screen rather than three and one. */
@media (min-width: 900px) {
    .home-stats--four {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* A country's Overview opens with what is waiting to be done for it. */
.country-work-waiting {
    margin-bottom: 1.25rem;
}

.country-work-waiting__heading {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Data to review (11 November 2026): the country filter, the time the counts were worked out and Refresh sit in one row
   over the seven kinds' figures; the chosen kind's list follows in its own card. */
.data-review__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.data-review__bar .data-review__country {
    flex: 0 1 320px;
    min-width: 240px;
}

.data-review__as-of {
    margin-left: auto;
    color: var(--mud-palette-text-secondary);
}

.data-review__list,
.data-review__decisions {
    margin-bottom: 1rem;
}

/* The seven kinds never leave one tile alone on a row (11 November 2026): seven across on a wide window, four over
   three on a narrower one, and pairs on a phone. The strip's own rule fitted as many 170 px tiles as the row took,
   which was six and one at 1440 px. */
.data-review__kinds {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 1400px) {
    .data-review__kinds {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .data-review__kinds {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* The dashboard's coverage section: its tiles sit straight in the card, and the country table follows them. */
.home-coverage {
    margin-bottom: 1rem;
}

.home-coverage__heading {
    margin: 1rem 0 0.5rem;
    font-size: var(--app-font-body);
    font-weight: 600;
}

/* The country table's heading, search and order sit on one line and wrap on a narrow screen. */
.home-coverage__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 1rem 0 0.5rem;
}

.home-coverage__bar .home-coverage__heading {
    margin: 0;
    flex: 1 1 auto;
}

.home-coverage__search {
    flex: 0 1 260px;
}

.home-coverage__order {
    flex: 0 1 220px;
}

/* Every country is listed, so the table scrolls in a box with its headings kept in view. The box that scrolls is
   the table's own container: headings stick to the nearest box that scrolls, and with the scrolling on a box
   outside it they scrolled away with the rows. */
.home-coverage__scroll {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--app-radius-lg);
    overflow: hidden;
}

/* The selector has to outweigh MudBlazor's own for a sticky-header table, which sets the height to 100%: the
   shorter one lost to it, the table grew to its full length and the headings scrolled away with the page. */
.home-coverage__scroll .mud-simple-table.mud-table-sticky-header .mud-table-container {
    max-height: 560px;
    overflow: auto;
}

.home-coverage__scroll thead th {
    position: sticky;
    top: 0;
    background: var(--mud-palette-surface);
    z-index: 1;
    white-space: nowrap;
}

.home-coverage__count {
    margin-top: 0.5rem;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
}

.home-coverage__table th:not(:first-child),
.home-coverage__table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The Marketing dashboard (21 October 2026): the weekly chart beside the last 90 days, the next demos under them. */
.marketing-dash {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-top: 16px;
}

@media (min-width: 1100px) {
    .marketing-dash {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }

    .marketing-dash > :last-child {
        grid-column: 1 / -1;
    }
}

.marketing-dash__split {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}

.marketing-dash__legend {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 12rem;
}

.marketing-dash__legend li {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.marketing-dash__swatch {
    width: 12px;
    height: 12px;
    border-radius: var(--app-radius-sm);
}

.marketing-dash__note {
    margin: 12px 0 0;
    color: var(--mud-palette-text-secondary);
}

.marketing-dash__table summary {
    cursor: pointer;
    color: var(--mud-palette-primary);
    font-size: var(--app-font-body);
    margin-top: 4px;
}

.marketing-dash__next {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.marketing-dash__next li {
    display: grid;
    grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 16px;
    padding: 10px 0;
    border-top: 1px solid var(--mud-palette-divider);
}

.marketing-dash__next li:first-child {
    border-top: 0;
}

.marketing-dash__when,
.marketing-dash__who {
    display: grid;
    gap: 1px;
}

@media (max-width: 640px) {
    .marketing-dash__next li {
        grid-template-columns: minmax(0, 1fr);
    }
}

/*
   The activity list grows with the page instead of scrolling inside it, so no row is cut off; long names and summaries
   stop at two lines. */
/* A list footer on a narrow window drops the pager's "Rows per page" caption, so the pager and the count share one
   row; the page-size choice beside it still reads as the number of rows. */
@media (max-width: 760px) {
    .list-footer--compact .mud-table-pagination-spacer + .mud-table-pagination-caption {
        display: none;
    }
}

/* ── Dialogs ──
   One line saying what the dialog does, then its fields in titled groups. */
.dlg-intro {
    margin: 0 0 16px;
    font-size: var(--app-font-body);
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
}

.dlg-section + .dlg-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--mud-palette-divider);
}

.dlg-section__title {
    margin: 0 0 4px;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.dlg-section__hint {
    margin: 0 0 10px;
    font-size: var(--app-font-detail);
    line-height: 1.45;
    color: var(--mud-palette-text-secondary);
}

.dlg-fields {
    display: grid;
    gap: 14px;
}

@media (min-width: 600px) {
    .dlg-fields--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dlg-fields__wide {
        grid-column: 1 / -1;
    }
}

/* A toolbar's switch and checkbox sit level with its inputs. */
.page-toolbar .mud-input-control-boolean-input {
    margin: 0;
}

/* Checkbox choices with a line under each, such as staff roles. */
.dlg-choice {
    display: flex;
    flex-direction: column;
    padding: 2px 0;
}

.dlg-choice .mud-checkbox {
    margin: 0;
}

.dlg-section__hint--after {
    margin: 2px 0 0;
}

.dlg-choice__hint {
    margin: -6px 0 4px 31px;
    font-size: var(--app-font-caption);
    line-height: 1.4;
    color: var(--mud-palette-text-secondary);
}

/* ── Lists ── */

/* A row's actions stay in view at the list's right edge when a narrow window scrolls the columns sideways. */
.grid-sticky-actions .mud-table-body .mud-table-cell.sticky-right {
    background-color: var(--mud-palette-surface);
    box-shadow: inset 1px 0 0 var(--mud-palette-divider);
}

.grid-sticky-actions .mud-table-head .mud-table-cell.sticky-right {
    box-shadow: inset 1px 0 0 var(--mud-palette-divider);
}

/* A table wider than its frame, in a narrow window: its Actions column stays in view and the other columns pass beneath
   it, which read as a table cut short. While columns lie beneath it the column casts a soft edge, and the edge goes as
   the list reaches its end. The timeline is the frame's own sideways scroll, so a table that fits has no edge at all;
   a browser without scroll timelines shows the table as before. */
@supports (animation-timeline: scroll()) {
    .mud-data-grid .mud-table-container {
        scroll-timeline: --list-sideways x;
    }

    .mud-data-grid .mud-table-cell.sticky-right {
        animation: list-columns-beneath linear both;
        animation-timeline: --list-sideways;
    }

    @keyframes list-columns-beneath {
        from, 92% {
            box-shadow: inset 1px 0 0 var(--mud-palette-divider), -14px 0 12px -12px rgb(15 23 42 / 0.34);
        }
        to {
            box-shadow: inset 1px 0 0 var(--mud-palette-divider), -14px 0 12px -12px rgb(15 23 42 / 0);
        }
    }
}

@media (hover: hover) and (pointer: fine) {
    .grid-sticky-actions.mud-table-hover .mud-table-body .mud-table-row:hover > .mud-table-cell.sticky-right {
        background: linear-gradient(var(--mud-palette-table-hover), var(--mud-palette-table-hover)), var(--mud-palette-surface);
    }
}

/* Staff roles as chips that wrap within their cell. */
.role-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.role-chips .mud-chip {
    margin: 0;
}

/* A field with an action of its own (Translate) keeps the action at its end, under the field. */
.dlg-field-action {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}

/* Arabic runs right to left inside its box; the box's label and outline stay where every other field's are. */
.dlg-rtl textarea,
.dlg-rtl input {
    direction: rtl;
    text-align: right;
}

/* A read-only value the dialog is about, such as a translation key. */
.dlg-key {
    display: block;
    padding: 8px 10px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: var(--app-font-detail);
    line-height: 1.45;
    overflow-wrap: anywhere;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-divider);
}

/* Under a translation key: where members see its wording, when the key says. */
.dlg-key-place {
    margin: 6px 0 0;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary);
}

/* ── App shell ── */

.topbar-search-btn:hover,
.topbar-search-btn:active {
    transform: none;
}

.topbar-search-btn:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* The keyboard shortcut that focuses the search box, shown while the box is empty and there is room. */
.topbar-search-kbd {
    display: none;
    flex-shrink: 0;
    padding: 1px 6px;
    font-family: inherit;
    font-size: var(--app-font-label);
    font-weight: 600;
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-inputs);
    white-space: nowrap;
}

@media (min-width: 900px) {
    .topbar-search-input:placeholder-shown ~ .topbar-search-kbd {
        display: inline-block;
    }

    .topbar-search-wrap:focus-within .topbar-search-kbd {
        display: none;
    }
}

.topbar-user-trigger:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   Country workspace (14 October 2026): the country tabs' spacing,
   second lines and toolbar filters, and their dialogs' subtitles.
   ═══════════════════════════════════════════════════════════════ */

/* Every tab keeps 20px round its content, and 16px on a narrow pane. Some tabs narrowed at 700px and others only at
   480px, so their edges stepped as staff moved from one tab to the next. */
@media (max-width: 700px) {
    .country-workspace-body > .pa-5 {
        padding: 16px !important;
    }
}

/* In the workspace a MudText given Color.Secondary is a caption or a second line under a value. The palette's
   Secondary is a link blue, so those lines read as links; they take the muted text colour the portal's other second
   lines use (.cell-secondary, section and page subtitles). */
.country-workspace-body .mud-typography.mud-secondary-text {
    color: var(--mud-palette-text-secondary) !important;
}

/* Filter labels in the workspace toolbars all float at one height in an opening in the field's border. The shared
   toolbar rule floats an empty filter's label 3px higher than MudBlazor floats a filled one, and without the opening,
   so the border ran through the empty filters' labels and a row of filters had its labels at two heights. */
.country-workspace-body .page-toolbar .mud-input-label-outlined.mud-input-label-inputcontrol {
    transform: translate(14px, -6px) scale(.75);
}

.country-workspace-body .page-toolbar .mud-input-outlined-with-label > .mud-input-outlined-border legend {
    width: auto;
    padding: 0 5px;
}

/* On a narrow pane a list's footer had no room for the pager and the record count side by side, so the pager broke
   its buttons onto a second line under "Rows per page". The count now takes the second line, at the right, and the
   pager stays on one line wherever it fits (on a phone it still wraps). */
@media (max-width: 700px) {
    .country-workspace-body .list-footer {
        flex-wrap: wrap;
        row-gap: 0;
        padding-bottom: 8px;
    }

    .country-workspace-body .list-footer > .list-footer__count {
        margin-inline-start: auto;
    }
}

@media (min-width: 481px) and (max-width: 700px) {
    .country-workspace-body .list-footer .mud-table-pagination-toolbar {
        flex-wrap: nowrap;
    }
}

/* A dialog's line under its title stays a small muted caption, whatever size the title band gives its typography. */
.mud-dialog .mud-dialog-title .mud-typography.dialog-title__subtitle {
    display: block;
    margin-top: 2px;
    font-size: var(--app-font-caption);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: normal;
    color: var(--mud-palette-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   Portal-wide consistency (14 October 2026): the country workspace's fixes for captions, toolbar labels and list
   footers, applied to every staff page.
   ═══════════════════════════════════════════════════════════════ */

/* A MudText given Color.Secondary is a caption or a second line under a value. The palette's Secondary is a link blue,
   so those lines read as links on every page; they take the muted text colour the portal's other second lines use.
   Buttons, chips and icons keep the colour. */
.mud-typography.mud-secondary-text {
    color: var(--mud-palette-text-secondary) !important;
}

/* Filter labels in every toolbar float in an opening in the field's border, whether the filter is empty or filled, so
   the border never runs through one. */
.page-toolbar .mud-input-outlined-with-label > .mud-input-outlined-border legend {
    width: auto;
    padding: 0 5px;
}

/* On a narrow pane a list's footer keeps its pager on one line and moves the record count to a second line at the
   right, instead of breaking the pager's buttons under "Rows per page" (on a phone it still wraps). */
@media (max-width: 700px) {
    .list-footer {
        flex-wrap: wrap;
        row-gap: 0;
        padding-bottom: 8px;
    }

    .list-footer > .list-footer__count {
        margin-inline-start: auto;
    }
}

@media (min-width: 481px) and (max-width: 700px) {
    .list-footer .mud-table-pagination-toolbar {
        flex-wrap: nowrap;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Data list pages (14 October 2026): Change History, Editorial
   Corrections, Countries and Reference Data, and their dialogs.
   ═══════════════════════════════════════════════════════════════ */

/* A list's filters as an even grid: one row where there is room, tidy rows of equal controls where there is not. Each
   control fills its cell, and a label resting on a border has room above it. */
.page-toolbar.filter-toolbar {
    container-type: inline-size;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    align-items: center;
    gap: 14px 12px;
    padding: 12px 16px;
}

.filter-toolbar > * {
    min-width: 0;
}

/* The search box takes two cells wherever the toolbar has two to give, so its prompt reads whole. */
@container (min-width: 360px) {
    .filter-toolbar > .filter-toolbar__search {
        grid-column: span 2;
    }
}

.filter-toolbar .mud-input-control {
    width: 100%;
    max-width: none;
}

/* From a tablet's width up the data lists are tables (below it MudBlazor stacks each row as label and value pairs): their
   cells sit a little closer, and fixed columns hold their widths, so no column is squeezed to a sliver. A window too
   narrow for the columns scrolls them instead. */
@media (min-width: 600px) {
    .data-list-grid .mud-table-row .mud-table-cell {
        padding-inline: 12px;
    }

    .data-list-grid .mud-table-row .mud-table-cell:first-child {
        padding-inline-start: 16px;
    }

    .data-list-grid .mud-table-row .mud-table-cell:last-child {
        padding-inline-end: 16px;
    }

    .data-list-grid .mud-table-container {
        overflow-x: auto;
    }

    .data-list-grid .mud-table-root {
        table-layout: fixed;
    }

    .data-list-grid .mud-table-body .mud-table-cell {
        overflow-wrap: anywhere;
    }

    /* Change History: the record over its country, what changed, who over when, the source and the open button. */
    .change-history-grid .mud-table-root {
        min-width: 600px;
    }

    .change-history-grid .change-history-grid__record {
        width: 25%;
    }

    .change-history-grid .change-history-grid__by {
        width: 9rem;
    }

    .change-history-grid .change-history-grid__source {
        width: 8.5rem;
    }

    .change-history-grid .change-history-grid__open {
        width: 3.25rem;
        text-align: end;
    }
}

.cell-empty {
    color: var(--mud-palette-text-disabled);
}

.change-history-grid__summary {
    font-size: var(--app-font-detail);
    line-height: 1.45;
}

/* Text for screen readers alone, such as the name of a column of buttons. */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* A list toolbar's switch reads at the size of the filters beside it, and its count is a quiet figure. */
.page-toolbar .toolbar-switch .mud-typography {
    font-size: var(--app-font-detail);
}

.toolbar-count {
    color: var(--mud-palette-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Countries: each card's name, then its region and record status side by side at one height, then its counts. */
.country-card-name__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-card-name .country-card-hidden-icon {
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--mud-palette-text-secondary);
}

.country-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.country-card-region,
.country-card-deleted-badge {
    line-height: 18px;
}

.country-card-tags .mud-chip {
    height: 20px;
    margin: 0;
    padding: 0 8px;
    font-size: var(--app-font-label);
    font-weight: 500;
}

.country-card-tags .mud-chip .mud-chip-content {
    padding: 0;
}

/* A card's counts read in the secondary text colour: the disabled grey fell below a readable contrast on white. */
.country-card .country-card-counts {
    color: var(--mud-palette-text-secondary);
}

/* Reference Data: the type picker keeps a readable width beside the search; the list's name, description, figures and
   actions hold their columns (the page's own stylesheet never reached the grid, which renders outside its scope). */
.reference-data-type-select {
    flex: 1 1 15rem;
    max-width: 22rem;
    min-width: 0;
}

.reference-data-grid__description {
    font-size: var(--app-font-detail);
    line-height: 1.45;
    color: var(--mud-palette-text-secondary);
}

/* A column aligned to the end (figures, row buttons) has its head there too, with any sort arrow on the inside. */
.cell-end {
    text-align: end;
}

.mud-table-head .cell-num .column-header,
.mud-table-head .cell-end .column-header {
    flex-direction: row-reverse;
}

.reference-data-grid .reference-data-grid__actions {
    white-space: nowrap;
}

@media (min-width: 600px) {
    .reference-data-grid .mud-table-root {
        min-width: 600px;
    }

    .reference-data-grid .reference-data-grid__name {
        width: 24%;
    }

    .reference-data-grid .reference-data-grid__country {
        width: 8rem;
    }

    .reference-data-grid .reference-data-grid__used {
        width: 5.75rem;
    }

    .reference-data-grid .reference-data-grid__public {
        width: 4.75rem;
    }

    .reference-data-grid .reference-data-grid__status {
        width: 6.5rem;
    }

    .reference-data-grid .reference-data-grid__actions {
        width: 10rem;
    }

    .reference-data-grid--read-only .reference-data-grid__actions {
        width: 6rem;
    }
}

/* Reference Data's three parts (11 November 2026): the lookups in a grouped list on the left, the chosen lookup's
   values, and the value being edited in a panel on the right. The list on the left shows from 1280px, where there is
   room for it; below that the "Reference data type" box and the toolbar's page links stay. The panel sits beside the
   values from 960px; below that it takes their place until it closes. */
.reference-data-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.reference-data-layout > .reference-data-layout__rail,
.reference-data-layout .reference-data-list-heading {
    display: none;
}

.reference-data-layout__list,
.reference-data-layout__editor {
    min-width: 0;
}

.reference-data-list-heading {
    padding: 10px 16px 0;
    background: var(--mud-palette-background-gray);
}

.reference-data-rail {
    padding: 10px 8px 16px;
}

/* An entry's name on the left; its count, "Read only" or "Own page" on the right. */
.reference-data-rail .reference-data-rail__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.reference-data-rail__hint {
    flex: none;
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-caption);
    font-weight: 400;
    white-space: nowrap;
}

/* The row open in the panel. */
.reference-data-grid .mud-table-row.reference-data-grid__row--editing > .mud-table-cell {
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
}

.reference-data-grid__editing {
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-detail);
    font-weight: 600;
}

@media (max-width: 959.98px) {
    .reference-data-layout--editing > .reference-data-layout__list {
        display: none;
    }
}

@media (min-width: 960px) {
    .reference-data-layout--editing {
        grid-template-columns: minmax(0, 1fr) 340px;
    }

    .reference-data-layout__editor {
        position: sticky;
        top: 72px;
        max-height: calc(100vh - 88px);
        overflow-y: auto;
    }

    /* Beside the panel the values have less room: the description moves under the name and the table may be narrower. */
    .reference-data-layout--editing .reference-data-grid .mud-table-root {
        min-width: 380px;
    }

    .reference-data-layout--editing .reference-data-grid .reference-data-grid__name {
        width: auto;
    }
}

@media (min-width: 1280px) {
    .reference-data-layout {
        grid-template-columns: 228px minmax(0, 1fr);
    }

    .reference-data-layout--editing {
        grid-template-columns: 228px minmax(0, 1fr) 340px;
    }

    .reference-data-layout > .reference-data-layout__rail {
        display: block;
        position: sticky;
        top: 72px;
        max-height: calc(100vh - 88px);
        overflow-y: auto;
    }

    .reference-data-layout .reference-data-list-heading {
        display: block;
    }

    .reference-data-layout .page-toolbar .reference-data-narrow-only {
        display: none;
    }
}

/* The shared editor as a panel beside a list (CrudEditPanel, 11 November 2026): the record's name and a close button,
   the form, the line that says what is changing, Cancel and Save, then the page's own links. */
.crud-edit-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
}

.crud-edit-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.crud-edit-panel__heading {
    min-width: 0;
    overflow-wrap: anywhere;
}

.crud-edit-panel__subtitle,
.crud-edit-panel__note {
    color: var(--mud-palette-text-secondary);
    font-size: var(--app-font-detail);
}

.crud-edit-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.crud-edit-panel__footer {
    padding-top: 10px;
    border-top: 1px solid var(--mud-palette-divider);
}

.crud-edit-panel__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

/* The line above an editor's one Save: what is changing, and how far it reaches. */
.crud-change-summary {
    padding: 10px 12px;
    border-radius: var(--app-radius-md);
    background: color-mix(in srgb, var(--mud-palette-warning) 14%, var(--mud-palette-surface));
    color: var(--mud-palette-text-primary);
    font-size: var(--app-font-detail);
    line-height: 1.45;
}

/* A dialog's line under its title says what the dialog does, in the quieter body size: a caption or subtitle in the
   title band never takes the title's weight. */
.mud-dialog .mud-dialog-title .dialog-subtitle,
.mud-dialog .mud-dialog-title .mud-typography-caption {
    margin-top: 2px;
    font-size: var(--app-font-detail);
    font-weight: 400;
    line-height: 1.45;
}

.mud-dialog .mud-dialog-title .dialog-subtitle {
    color: var(--mud-palette-text-secondary);
}

/* A question's confirm button is filled, as on the other dialogs; a destructive one is filled in the error colour. */
.mud-message-box .mud-message-box__yes-button.mud-button-text-primary {
    color: var(--mud-palette-primary-text);
    background-color: var(--mud-palette-primary);
}

.mud-message-box .mud-message-box__yes-button.mud-button-text-primary:hover,
.mud-message-box .mud-message-box__yes-button.mud-button-text-primary:focus-visible {
    background-color: var(--mud-palette-primary-darken);
}

/* A question naming a long address (the demo booking page) wraps it rather than scrolling the box sideways. */
.mud-message-box .mud-dialog-content {
    overflow-wrap: anywhere;
}

/* In a narrow window a data list's footer keeps its pager on one line and moves the count to the line below, on the
   right, rather than splitting the pager's buttons from its figures. */
.data-list-grid .list-footer {
    flex-wrap: wrap;
    row-gap: 0;
}

.data-list-grid .list-footer .list-footer__count {
    margin-inline-start: auto;
    padding-block: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   Email templates (15 October 2026): the list of every email the
   platform sends, and the editor with the system's own words beside
   staff's, placeholder chips and a live preview. Square, in palette
   colours so dark mode holds, but for the HTML preview's white page.
   ═══════════════════════════════════════════════════════════════ */

/* ── The list ── */
.email-templates__search {
    flex: 1 1 18rem;
    max-width: 28rem;
}

.email-templates-grid .email-templates-grid__group {
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
    background: var(--mud-palette-background-gray);
}

.email-templates-grid__key {
    display: block;
    margin-top: 2px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
    overflow-wrap: anywhere;
}

@media (min-width: 600px) {
    .email-templates-grid .mud-table-root {
        min-width: 640px;
    }

    .email-templates-grid .email-templates-grid__email {
        width: 46%;
    }

    .email-templates-grid .email-templates-grid__format {
        width: 7rem;
    }

    .email-templates-grid .email-templates-grid__status {
        width: 11rem;
    }
}

/* ── The editor: the words, then the placeholders and the preview beside them on a wide screen ── */
.email-editor {
    display: grid;
    gap: 16px;
}

.email-editor__main,
.email-editor__aside {
    display: grid;
    gap: 16px;
    min-width: 0;
    align-content: start;
}

/* Side by side from a laptop up: the preview takes two fifths of the width, never wider than the email itself (600px
   and its card's padding), so on a wide screen the room goes to the words and on a laptop neither is squeezed. */
@media (min-width: 1280px) {
    .email-editor {
        grid-template-columns: minmax(0, 1fr) min(40%, 660px);
        align-items: start;
    }

    .email-editor__aside {
        position: sticky;
        top: 72px;
    }
}

/* One part: its name and a line of help, then staff's box. */
.email-part {
    padding: 14px 16px;
}

.email-part + .email-part {
    border-top: 1px solid var(--mud-palette-divider);
}

.email-part__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-bottom: 8px;
}

.email-part__label {
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--mud-palette-text-primary);
}

.email-part__hint {
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
}

.email-part__field.mud-input-control {
    margin: 0;
}

/* Each part (28 October 2026): its box across the column. The part's name above already labels the editor, so
   the editor's own label is kept for screen readers only. */
.email-part__stack {
    display: grid;
    gap: 8px;
}

.email-part .rich-text-editor__header {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* A changed part's way back to its default, at the end of its heading line. */
.email-part__head .email-part__use-default {
    margin-inline-start: auto;
    padding-block: 0;
}

/* A one-line part (the subject, the button's words) with its placeholder menu beside the box (28 October 2026). */
.email-part__line {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.email-part__line .email-part__field {
    flex: 1 1 auto;
    min-width: 0;
}

.email-part__insert {
    margin-top: 2px;
}

.email-part__insert-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    width: 100%;
}

.email-part__insert-item code {
    margin-inline-start: auto;
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
}

/* Links and values (28 October 2026): the form over the saved list. */
.email-values {
    display: grid;
    gap: 16px;
}

.email-values__form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 12px 16px;
    align-items: start;
}

.email-values__value,
.email-values__description {
    grid-column: 1 / -1;
}

.email-values__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.email-values-grid__label {
    display: block;
    font-weight: 600;
}

.email-values-grid__token {
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
}

.email-values-grid__kind {
    display: block;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.email-values-grid__value {
    overflow-wrap: anywhere;
}

.email-values-grid__actions {
    white-space: nowrap;
    text-align: end;
}

/* The preview: the subject, then the body as it is sent, plain text kept as typed and HTML in a frame that runs no script. */
.email-preview {
    display: grid;
    gap: 6px;
}

.email-preview__label {
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.email-preview__subject {
    padding: 8px 10px;
    font-weight: 600;
    overflow-wrap: anywhere;
    border: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}

.email-preview__text {
    margin: 0;
    padding: 12px;
    font-family: inherit;
    font-size: var(--app-font-body);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}

/* An email is read on white, so the frame is white in either theme; tall enough for the branded layout's card and footer. */
.email-preview__frame {
    display: block;
    width: 100%;
    min-height: 720px;
    border: 1px solid var(--mud-palette-divider);
    background: #ffffff;
}

.email-preview__problems {
    margin-top: 6px;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--mud-palette-warning);
    border-inline-start-width: 3px;
    background: color-mix(in srgb, var(--mud-palette-warning) 8%, transparent);
}

.email-preview__problems ul {
    margin: 4px 0 0;
    padding-inline-start: 18px;
    font-size: var(--app-font-detail);
    line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════
   User guides (15 October 2026): the index of the staff guides
   and one guide's page, its words in a readable column with an
   "On this page" list beside them on a wide screen. Headings,
   tables, callouts and captioned screenshots, square and in the
   palette's colours so dark mode holds.
   ═══════════════════════════════════════════════════════════════ */

/* ── The index ── */
.guide-index {
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-index__item + .guide-index__item {
    border-top: 1px solid var(--mud-palette-divider);
}

.guide-index__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
}

.guide-index__link:hover {
    background: var(--mud-palette-background-gray);
}

.guide-index__link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.guide-index__number {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-primary);
    border: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
}

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

.guide-index__title {
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.guide-index__summary {
    font-size: var(--app-font-body);
    color: var(--mud-palette-text-secondary);
}

.guide-index__chevron {
    flex: 0 0 auto;
    color: var(--mud-palette-text-disabled);
}

/* ── One guide: the words, with the contents list above them, or beside them on a wide screen ── */
.guide-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.guide-contents {
    padding: 12px 14px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-inline-start: 3px solid var(--mud-palette-primary);
}

.guide-contents__label,
.guide-others__label {
    margin-bottom: 6px;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.guide-contents__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-contents__item {
    margin: 0;
    padding: 3px 0;
    font-size: var(--app-font-detail);
    line-height: 1.4;
}

.guide-contents__item--sub {
    padding-inline-start: 14px;
    font-size: var(--app-font-detail);
}

.guide-contents__item a,
.guide-others__list a {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

.guide-contents__item a:hover,
.guide-others__list a:hover {
    text-decoration: underline;
}

/* ── The words ── */
.guide-article {
    min-width: 0;
    max-width: 52rem;
    padding: 20px 24px 28px;
    font-size: var(--app-font-reading);
    line-height: 1.65;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
}

@media (min-width: 1280px) {
    .guide-layout {
        grid-template-columns: minmax(0, 52rem) 16rem;
    }

    .guide-layout .guide-contents {
        position: sticky;
        top: 72px;
        grid-column: 2;
        grid-row: 1;
        max-height: calc(100vh - 96px);
        overflow-y: auto;
    }

    .guide-layout .guide-article {
        grid-column: 1;
        grid-row: 1;
    }
}

.guide-article > :first-child {
    margin-top: 0;
}

.guide-article h2 {
    margin: 2rem 0 .6rem;
    padding-bottom: 6px;
    font-size: var(--app-font-heading);
    font-weight: 700;
    line-height: 1.3;
    border-bottom: 1px solid var(--mud-palette-divider);
    scroll-margin-top: 72px;
}

.guide-article h3 {
    margin: 1.5rem 0 .4rem;
    font-size: var(--app-font-card);
    font-weight: 700;
    line-height: 1.35;
    scroll-margin-top: 72px;
}

.guide-article h4 {
    margin: 1.2rem 0 .3rem;
    font-size: var(--app-font-detail);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
}

.guide-article p {
    margin: 0 0 .8rem;
}

.guide-article ul,
.guide-article ol {
    margin: 0 0 .9rem;
    padding-inline-start: 1.4rem;
}

.guide-article li {
    margin-bottom: .3rem;
}

.guide-article li > ul,
.guide-article li > ol {
    margin: .3rem 0 0;
}

.guide-article a {
    color: var(--mud-palette-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.guide-article strong {
    font-weight: 700;
}

.guide-article code {
    padding: 1px 5px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: .82em;
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-divider);
}

.guide-article blockquote {
    margin: 0 0 1rem;
    padding: 8px 14px;
    color: var(--mud-palette-text-secondary);
    border-inline-start: 3px solid var(--mud-palette-lines-default);
}

.guide-article hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid var(--mud-palette-divider);
}

/* A table scrolls on its own on a narrow screen rather than widening the page. */
.guide-article table {
    display: block;
    max-width: 100%;
    margin: 0 0 1rem;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: var(--app-font-body);
    line-height: 1.5;
}

.guide-article th,
.guide-article td {
    padding: 7px 10px;
    text-align: start;
    vertical-align: top;
    border: 1px solid var(--mud-palette-divider);
}

.guide-article th {
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--app-label-ink);
    background: var(--mud-palette-background-gray);
}

/* ── Screenshots: a bordered figure with its caption under it ── */
.guide-figure {
    margin: 1rem 0 1.25rem;
}

.guide-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--mud-palette-divider);
}

.guide-figure figcaption {
    margin-top: 6px;
    font-size: var(--app-font-detail);
    line-height: 1.45;
    color: var(--mud-palette-text-secondary);
}

/* ── Callouts: "> [!NOTE]", "> [!TIP]", "> [!IMPORTANT]", "> [!WARNING]" and "> [!CAUTION]" ── */
.guide-article .markdown-alert {
    --guide-callout-tone: var(--mud-palette-info);
    margin: 0 0 1rem;
    padding: 10px 14px;
    border: 1px solid var(--guide-callout-tone);
    border-inline-start-width: 4px;
    background: color-mix(in srgb, var(--guide-callout-tone) 7%, var(--mud-palette-surface));
}

.guide-article .markdown-alert-tip { --guide-callout-tone: var(--mud-palette-success); }
.guide-article .markdown-alert-important { --guide-callout-tone: var(--mud-palette-primary); }
.guide-article .markdown-alert-warning { --guide-callout-tone: var(--mud-palette-warning); }
.guide-article .markdown-alert-caution { --guide-callout-tone: var(--mud-palette-error); }

.guide-article .markdown-alert > :last-child {
    margin-bottom: 0;
}

.guide-article .markdown-alert-title {
    margin-bottom: 4px;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    color: var(--mud-palette-text-primary);
}

/* ── The other guides, under the words ── */
.guide-others {
    max-width: 52rem;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
}

.guide-others__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-others__list li {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    padding: 5px 0;
    font-size: var(--app-font-body);
}

.guide-others__summary {
    color: var(--mud-palette-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   The look-and-feel pass (12 November 2026)
   One place for what every page shares: the page's gutter and header, one surface level, fields, tables, buttons,
   the focus ring and motion. Each part reads the variables at the top of this file. The rules sit last in the
   file, so they follow the page-by-page rules above where the two have the same weight; where MudBlazor's own rule
   is heavier, the selector here carries the classes it needs to outweigh it, and says so.
   ═══════════════════════════════════════════════════════════════ */

/* ── The page ──────────────────────────────────────────────────
   A 24 px gutter round every page (16 px before), from the width a phone's own rule stops at. */
@media (min-width: 601px) {
    .app-page-content {
        padding: 24px 24px 64px !important;
    }
}

/* ── One page header ───────────────────────────────────────────
   Shared/PageHeader draws every page's header: the trail (small, in the secondary colour), the title, one line
   saying what the page is for, and the page's actions on the right. Its spacing is set here once: the trail 4 px
   over the title, 16 px under the block. The title is drawn a touch tighter. */
.mud-breadcrumbs {
    min-height: 20px;
    margin-bottom: 4px !important;
    padding: 0;
    font-size: var(--app-font-detail);
}

.mud-breadcrumbs .mud-breadcrumb-item:last-child .mud-breadcrumb-item-disabled {
    color: var(--mud-palette-text-primary) !important;
    font-weight: 600;
}

.page-header {
    gap: 16px;
    min-height: 40px;
    margin-top: 0 !important;
    margin-bottom: 16px !important;
}

.page-header .mud-typography-h4,
.page-header__heading {
    letter-spacing: -0.01em;
}

.page-header__actions,
.page-header__actions > .d-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ── One surface level ─────────────────────────────────────────
   The page is the grey; a panel is white with a hairline; nothing white with a line round it sits inside another.
   A panel that lies on the page has no shadow: a shadow is for what floats over the page (a menu, a dialog, a bar
   that sticks). */
.app-page-content .mud-paper.mud-elevation-1,
.app-page-content .mud-paper.mud-elevation-2 {
    border: 1px solid var(--mud-palette-divider);
    box-shadow: none;
}

/* A section card's heading is the card's own white with a hairline under it (a grey band before), and its icon
   stands by itself, without a box. */
.section-card__header {
    background: var(--mud-palette-surface);
}

.section-card__icon {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 0;
}

/* A list's filters sit on the card's white too, over a hairline. */
.page-toolbar,
.country-list-section__toolbar,
.education-system-summary,
.reference-data-list-heading,
.org-group__header {
    background: var(--mud-palette-surface);
}

.billing-table thead th,
.guide-article th,
.organisation-detail__collection-table thead {
    background: var(--mud-palette-surface);
}

/* A record whose sections are cards of their own (a member, a country): the wrapper that held them is no longer a
   card. Its tabs and its section rail lie on the page, and each section's card is the one white surface. */
.country-workspace-shell,
.country-workspace-shell.crud-card,
.app-page-content .mud-paper.org-workspace {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.country-workspace-body {
    overflow: visible;
    background: transparent;
}

.country-workspace-shell > .page-header {
    min-height: 40px;
    margin: 0 0 16px !important;
    padding: 0;
}

.org-workspace__body {
    padding: 16px 0 0;
}

/* A record whose sections are forms (an institution, a framework, an editor's surface): the wrapper stays the one
   card, and what lies in it is flush: a list has no line of its own round it, and a group of fields is parted from
   the next by a hairline, not boxed. A list's own stylesheet is read after this one, so the rule for it carries a
   class more than that stylesheet's. */
.app-page-content .organisation-detail-workspace .country-list-surface,
.app-page-content .framework-definition-workspace .country-list-surface,
.app-page-content .editor-surface .country-list-surface,
.app-page-content .section-card .country-list-surface,
.section-card .section-card {
    border: 0;
    border-radius: 0;
}

.organisation-detail-workspace .mud-paper.mud-paper-outlined,
.framework-definition-workspace .mud-paper.mud-paper-outlined,
.editor-surface .mud-paper.mud-paper-outlined {
    border-width: 1px 0 0;
    border-radius: 0;
    background: transparent;
}

/* A table in a card is part of the card: no line or shadow of its own. */
.app-page-content .mud-paper .mud-table,
.country-list-surface .mud-table,
.section-card .mud-table {
    border: 0;
    box-shadow: none;
}

/* Risk Queue (12 November 2026): the whole page, header and all, lay in one white panel, unlike every other page.
   Its header lies on the page now, and what follows it (the two lists in their tabs, or the placeholder, the empty
   queue or a failed read) is the one white card. Where the queue is shown inside another page it has no class of
   its own and is left as it is. */
.app-page-content .mud-paper.risk-queue-page {
    background: transparent;
}

.risk-queue-page > :not(.page-header, nav) {
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--app-radius-lg);
    background: var(--mud-palette-surface);
}

/* ── Fields ────────────────────────────────────────────────────
   Every field's box is 40 px high with its label over it, whatever margin the page asked MudBlazor for: MudBlazor
   9.11 has no setting for a default margin (MudGlobal holds the menu's and the tooltip's defaults only), so the
   dense size is set here once. The text in a box is the body size. MudBlazor draws the label inside the box until
   the field has a value and then in a notch on its top edge, at three-quarters size; here it is always over the
   box, in the label style, and the notch stays closed. A filter in a list's toolbar keeps its label in the box:
   the toolbar is one row, shared with a search box that has no label.
   Weights: MudBlazor's label rules carry up to five classes and an element (".mud-input:focus-within ~
   label.mud-input-label.mud-input-label-inputcontrol.mud-input-label-outlined"); these carry six. */
.mud-input.mud-input-outlined {
    font-size: var(--app-font-body);
}

.mud-input.mud-input-outlined > input.mud-input-root.mud-input-root-outlined,
.mud-input.mud-input-outlined > div.mud-input-slot.mud-input-root.mud-input-root-outlined {
    padding-top: calc((var(--app-control-height) - 1lh) / 2);
    padding-bottom: calc((var(--app-control-height) - 1lh) / 2);
}

.mud-input.mud-input-outlined > textarea.mud-input-root.mud-input-root-outlined {
    margin-top: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    line-height: 1.45;
    -webkit-mask-image: none;
    mask-image: none;
}

.mud-input-control.mud-input-outlined-with-label:not(.page-toolbar *, .list-footer *) > .mud-input-control-input-container > label.mud-input-label.mud-input-label-outlined.mud-input-label-inputcontrol {
    position: static;
    order: -1;
    max-width: 100%;
    padding: 0 0 4px !important;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    line-height: 1.5;
    letter-spacing: normal;
    color: var(--app-label-ink);
    white-space: normal;
    pointer-events: auto;
    transform: none;
    transition: none;
}

.mud-input-control.mud-input-outlined-with-label:not(.page-toolbar *, .list-footer *) > .mud-input-control-input-container > .mud-input.mud-input-outlined > fieldset.mud-input-outlined-border > legend {
    width: 0;
    padding: 0;
}

/* With its label in the flow over it, a field needs no room kept clear for a label that stood on its edge. */
.mud-input-control.mud-input-outlined-with-label:not(.page-toolbar *, .list-footer *) {
    margin-top: 0;
    margin-bottom: 4px;
}

.mud-input-control > .mud-input-control-helper-container {
    margin-top: 2px;
}

/* A switch or a tick box that shares a row with fields lines up with their boxes, not with their labels. A grid
   item that is a full row at every width shares it with nothing, and is left alone. */
.mud-grid > .mud-grid-item:is([class*="-sm-"], [class*="-md-"], [class*="-lg-"]) > .mud-input-control-boolean-input:only-child,
.organisation-detail__collection-check,
.organisation-detail__collection-submit {
    margin-top: 22px;
}

/* A tick box's and a radio button's label reads at the size of the text round it, as a switch's does: MudBlazor
   sets it a step larger. Two classes, so this outweighs MudBlazor's .mud-typography-body1. */
.mud-checkbox > .mud-typography,
.mud-radio > .mud-typography {
    font-size: var(--app-font-body);
}

/* The title of a group of fields (a dialog's "Address", a form's "Organisation") stands a step above the labels of
   the fields under it: the body size, bold, in the text colour. It was a tracked capital label, which in sentence
   case would read as one more field label. */
.org-group__title,
.org-fieldset > legend,
.dlg-section__title,
.billing-form-section__title,
.signup-subsection__title {
    font-size: var(--app-font-body);
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

/* ── Tables ────────────────────────────────────────────────────
   Rows of 44 px at least, with 14 px text and a 12 px second line; figures in tabular numerals, so a column of
   them lines up; the row under the pointer takes the tint, whether or not the page asked MudBlazor for it; the
   row that is selected takes the tint too, and the row just saved shows it once ("Motion", below). The heading
   row is set where the lists' rule is,
   above; it sticks under the top bar where the shell's script finds the table fits its card (see below). */
.mud-table-root .mud-table-body .mud-table-cell,
.mud-simple-table table tbody tr > td {
    height: var(--app-row-height);
    font-size: var(--app-font-body);
    font-variant-numeric: tabular-nums;
}

.mud-table-root .mud-table-body .mud-table-row:hover,
.mud-simple-table table tbody tr:hover {
    background-color: var(--mud-palette-table-hover);
}

.mud-table-root .mud-table-head .mud-table-cell.cell-num,
.mud-table-root .mud-table-head .mud-table-cell.mud-table-cell-align-right,
.mud-simple-table table thead tr > th.cell-num {
    text-align: end;
}

/* The selected row (the one open in a panel beside the list) and the row just saved. Three classes and the cell,
   so MudBlazor's own row backgrounds do not outweigh them. */
.mud-table-root .mud-table-body .mud-table-row.row-selected > .mud-table-cell,
.reference-data-grid .mud-table-row.reference-data-grid__row--editing > .mud-table-cell,
.education-levels-grid .mud-table-row.education-level-row--selected > .mud-table-cell {
    background: var(--app-tint);
}

/* The heading row sticks under the top bar while its list is scrolled. A sticking heading needs the table's own
   box not to scroll, and a table wider than its card has to scroll sideways, so the shell's script (dashboard-
   shell.js, the table watch) marks the tables that fit their card and have no scrolling box round them; only
   those stick. The cards round a list clip (overflow: clip) where they hid (overflow: hidden): a box that hides
   is a scrolling box, and a heading would stick to it and not to the page. A country's lists and an editor's surface
   say the same in their own stylesheets (CountryListSurface, EditorSurface and the country tabs' tables). */
.section-card,
.crud-card,
.organisation-detail-workspace,
.framework-definition-workspace {
    overflow: clip;
}

/* The lists' own stylesheets set their table boxes to scroll, with up to four classes, and are read after this one.
   The mark is only on a table that needs no scrolling, so it outranks them all. */
.mud-table-container[data-head-sticks] {
    overflow: visible !important;
}

.mud-table-container[data-head-sticks] .mud-table-head .mud-table-cell,
.mud-table-container[data-head-sticks] thead > tr > th {
    position: sticky;
    top: var(--app-sticky-top);
    z-index: 3;
    /* The hairline under the heading, drawn as a shadow as well as a border: a border between a heading that has
       stuck and the row passing under it can fall between two pixels and vanish. */
    box-shadow: 0 1px 0 var(--mud-palette-divider);
}

/* A dialog scrolls inside itself, so nothing in it starts from the top bar. */
.mud-dialog {
    --app-sticky-top: 0px;
}

/* A list's placeholder rows are the height of the rows that replace them. */
.list-skeleton__row {
    min-height: var(--app-row-height);
}

/* ── Dialogs ───────────────────────────────────────────────────
   A dialog is no wider than what it holds needs. A medium dialog (960 px) that holds a form alone, in one column
   or two, is 720 px: its fields ran the width of a page. One that holds a list, tabs, a text editor or a row of
   three or more fields keeps the full width. */
.mud-dialog.mud-dialog-width-md:not(:has(table, .mud-tabs, .detail-grid--3, .detail-grid--4, .rich-text-editor, .markdown-editor, [class*="mud-grid-item-md-4"], [class*="mud-grid-item-md-3"], [class*="mud-grid-item-md-2"], [class*="mud-grid-item-sm-4"], [class*="mud-grid-item-sm-3"])) {
    max-width: 720px;
}

/* ── Buttons ───────────────────────────────────────────────────
   One filled button to a view, and it is flat: a button on the page casts no shadow. Every button is 36 px high
   (a small one 32 px), and an icon alone is a 32 px target at least. */
.mud-button-root.mud-button {
    min-height: 36px;
}

.mud-button-root.mud-button.mud-button-size-small {
    min-height: 32px;
}

/* A switch's thumb sits in an icon button of its own (.mud-switch-base), sized to the switch and placed over the
   track. It is not a button on its own: its switch's label is the target. Held to 32 px, a small switch's 24 px
   holder grew and its thumb sat 4 px below and to the right of its track (12 November 2026). */
.mud-button-root.mud-icon-button:not(.mud-switch-base) {
    min-width: 32px;
    min-height: 32px;
}

/* A column heading's own buttons (sort, filter, the column's menu) stand three to a heading, so they are narrower:
   24 px wide and the full 32 px high, with a smaller, quieter picture. At 32 px each a list with header filters
   (Rankings) grew wider than its card, and its filter icons stood larger than the words they belong to. */
.mud-table-head .column-header .mud-button-root.mud-icon-button {
    min-width: 24px;
    padding-inline: 2px;
    color: var(--mud-palette-text-secondary);
}

.mud-table-head .column-header .mud-icon-button .mud-icon-root {
    width: 18px;
    height: 18px;
}

.mud-button-filled,
.mud-button-filled:hover,
.mud-button-filled:focus-visible,
.mud-button-filled:active {
    box-shadow: none;
}

/* An outlined or a text button in a status colour (Suspend, Archive, Resolve) is written in that tone's ink, the
   one a status badge uses: the theme's bright colours are 2.1 to 3.8 to 1 as words on white. The line of an
   outlined one is the ink too. */
.mud-button-outlined.mud-button-outlined-error,
.mud-button-text.mud-button-text-error,
.mud-button-outlined.mud-button-outlined-success,
.mud-button-text.mud-button-text-success,
.mud-button-outlined.mud-button-outlined-warning,
.mud-button-text.mud-button-text-warning,
.mud-button-outlined.mud-button-outlined-info,
.mud-button-text.mud-button-text-info {
    color-scheme: var(--mud-native-html-color-scheme, light);
}

@supports (color: light-dark(#000, #fff)) {
    .mud-button-outlined.mud-button-outlined-error:not(:disabled),
    .mud-button-text.mud-button-text-error:not(:disabled) {
        color: var(--app-badge-error-ink);
    }

    .mud-button-outlined.mud-button-outlined-success:not(:disabled),
    .mud-button-text.mud-button-text-success:not(:disabled) {
        color: var(--app-badge-success-ink);
    }

    .mud-button-outlined.mud-button-outlined-warning:not(:disabled),
    .mud-button-text.mud-button-text-warning:not(:disabled) {
        color: var(--app-badge-warning-ink);
    }

    .mud-button-outlined.mud-button-outlined-info:not(:disabled),
    .mud-button-text.mud-button-text-info:not(:disabled) {
        color: var(--app-badge-info-ink);
    }

    .mud-button-outlined.mud-button-outlined-error:not(:disabled),
    .mud-button-outlined.mud-button-outlined-success:not(:disabled),
    .mud-button-outlined.mud-button-outlined-warning:not(:disabled),
    .mud-button-outlined.mud-button-outlined-info:not(:disabled) {
        border-color: currentColor;
    }
}

/* ── Focus ─────────────────────────────────────────────────────
   Everything the keyboard can reach shows where it is: a 2 px line in the brand colour, 2 px clear of the thing.
   MudBlazor takes the browser's outline off links and buttons ("a:focus-visible", "button:focus", ".mud-button-
   root"); these put one back, and follow MudBlazor's rules in the page, so they hold at the same weight. A rule
   above that sets its own offset (a row that fills its box rings inside it) still does. What only a script moves
   the keyboard to (a page's title after a link is followed, a section scrolled to) is not ringed. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="link"]:focus-visible,
.mud-button-root:focus-visible {
    outline: var(--app-focus-width) solid var(--app-focus-ring);
    outline-offset: var(--app-focus-offset);
}

/* What fills its box, or lies in a list that clips, rings just inside its own edge. */
.mud-list-item:focus-visible,
.mud-nav-link:focus-visible,
.mud-tab:focus-visible,
.mud-table-row:focus-visible,
.mud-toggle-item:focus-visible,
.section-rail__item:focus-visible {
    outline-offset: calc(-1 * var(--app-focus-width));
}

/* A field: its box takes the ring, with its edge in the brand colour (MudBlazor thickens the edge to 2 px; the
   ring says the same without the box seeming to grow inwards). */
.mud-input.mud-input-outlined:focus-within {
    border-radius: var(--app-radius-md);
    outline: var(--app-focus-width) solid var(--app-focus-ring);
    outline-offset: var(--app-focus-offset);
}

.mud-input.mud-input-outlined:focus-within > .mud-input-outlined-border {
    border-width: 1px;
}

/* A tick box, a radio button and a switch hide their own input and draw a picture of it: the picture takes the
   ring when the input has the keyboard. */
.mud-checkbox:has(input:focus-visible) .mud-icon-button,
.mud-radio:has(input:focus-visible) .mud-icon-button,
.mud-switch:has(input:focus-visible) .mud-switch-base {
    border-radius: 50%;
    outline: var(--app-focus-width) solid var(--app-focus-ring);
    outline-offset: calc(-1 * var(--app-focus-width));
}

.topbar-search-wrap:focus-within {
    border-color: var(--app-focus-ring);
    box-shadow: none;
    outline: var(--app-focus-width) solid var(--app-focus-ring);
    outline-offset: var(--app-focus-offset);
}

.rich-text-editor__frame:focus-within {
    box-shadow: none;
    outline: var(--app-focus-width) solid var(--app-focus-ring);
    outline-offset: var(--app-focus-offset);
}

.page-toolbar .mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    box-shadow: none;
}

/* ── The sidebar and the top bar ───────────────────────────────
   Quiet chrome. The place the staff member is in takes the tint and a 3 px brand bar; a link under the pointer
   takes the neutral hover, and keeps its colour. A count is a plain grey pill; one that needs someone now is in
   the error tone a status badge uses. A record's section rail, a country's row of sections and a figure tile that
   is the filter in force mark their place the same way. */
.section-rail__item {
    border-left-width: 3px;
}

.section-rail__item--active,
.country-primary-navigation__item--active {
    background: var(--app-tint);
}

.stat-tile--clickable:hover {
    background: var(--mud-palette-table-hover);
}

.stat-tile--selected,
.stat-tile--selected:hover {
    background: var(--app-tint);
    box-shadow: none;
}

/* A country's own trail ("Back to countries", then the country) sits as every page's trail does. */
.country-page-breadcrumb {
    min-height: 20px;
    margin: 0 0 4px;
}

.country-page-breadcrumb__back {
    min-height: 24px;
    padding: 0 6px 0 0;
    font-weight: 500;
}

.country-page-breadcrumb__current {
    padding: 0 6px;
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}
.sidebar-nav .mud-nav-link:hover {
    border-left-color: transparent;
    background: var(--mud-palette-action-default-hover) !important;
    color: var(--mud-palette-drawer-text) !important;
}

.sidebar-nav .mud-nav-link:hover .mud-icon-root {
    color: var(--mud-palette-drawer-icon) !important;
}

.sidebar-nav .mud-nav-link.active,
.sidebar-nav .mud-nav-link.active:hover,
.sidebar-nav .sidebar-nav__item--current .mud-nav-link,
.sidebar-nav .sidebar-nav__item--current .mud-nav-link:hover {
    border-left-color: var(--mud-palette-primary);
    background: var(--app-tint) !important;
    color: var(--mud-palette-primary) !important;
}

.sidebar-nav .mud-nav-link.active .mud-icon-root,
.sidebar-nav .mud-nav-link.active:hover .mud-icon-root {
    color: var(--mud-palette-primary) !important;
}

.sidebar-section-label {
    padding: 16px 16px 4px;
}

.sidebar-count,
.sidebar-mini-count {
    color-scheme: var(--mud-native-html-color-scheme, light);
    font-variant-numeric: tabular-nums;
}

.sidebar-count,
.sidebar-nav .mud-nav-link:hover .sidebar-count,
.sidebar-nav .mud-nav-link.active .sidebar-count {
    min-width: 22px;
    height: 20px;
    border-radius: 10px;
    font-size: var(--app-font-label);
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    background: color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
}

@supports (color: light-dark(#000, #fff)) {
    .sidebar-count--alert,
    .sidebar-nav .mud-nav-link:hover .sidebar-count--alert,
    .sidebar-nav .mud-nav-link.active .sidebar-count--alert,
    .sidebar-mini-count--error {
        color: var(--app-badge-error-text);
        background: var(--app-badge-error-fill);
    }
}

.sidebar-mini-count {
    box-shadow: none;
}

/* "Hide navigation" leaves a rail of icons on a desk-sized screen (12 November 2026). The layout has always drawn
   the hidden sidebar as icons with their names as tooltips and their counts as small pills, but the drawer is
   MudBlazor's responsive one, which slides the whole sidebar off the page when it is closed, so the rail was never
   seen. From the width the drawer stops being an overlay (960 px) the closed drawer stays on the page at the
   rail's width, and the content starts beside it. Below that width nothing changes: closed is hidden, and open
   lies over the page. MudBlazor's own rail (DrawerVariant.Mini) was not used: opened on a phone it pushes the page
   aside where the responsive drawer lies over it. Five classes, as MudBlazor's rule for the closed drawer has four. */
@media (min-width: 960px) {
    .mud-drawer.mud-drawer-responsive.mud-drawer-pos-left.mud-drawer--closed.sidebar {
        left: 0;
        width: var(--app-rail-width);
        overflow-x: hidden;
    }

    .mud-layout.mud-drawer-close-responsive-md-left .mud-main-content {
        margin-left: var(--app-rail-width);
    }

    .sidebar.mud-drawer--closed .sidebar-brand {
        justify-content: center;
        padding-inline: 0;
    }

    /* An icon stands in the middle of the rail; the link's 3 px bar on the left is matched on the right. */
    .sidebar.mud-drawer--closed .sidebar-nav .mud-nav-link {
        justify-content: center;
        padding-left: 0 !important;
        padding-right: 3px !important;
    }

    .sidebar.mud-drawer--closed .sidebar-nav .mud-nav-link .mud-nav-link-icon {
        margin: 0;
    }

    .sidebar.mud-drawer--closed .sidebar-nav .mud-nav-link .mud-nav-link-text {
        display: none;
    }
}

/* The top bar: the search box is the widest thing in it, with its shortcut shown; its button is an icon, not a
   filled square, since the page under it has its own one filled button. */
.topbar-search-wrap {
    max-width: 640px;
}

.topbar-search-btn,
.topbar-search-btn:hover {
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    transform: none;
}

.topbar-search-btn:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-primary);
}

.topbar-search-btn:active {
    transform: none;
}

.topbar-menu-btn {
    opacity: 1;
    color: var(--mud-palette-text-secondary);
}

/* ── Soft corners and surfaces ─────────────────────────────────
   12 November 2026. The portal had one 4 px corner on everything, hairlines and no depth at all, which read as
   exact but hard. Corners now follow a scale (the tokens at the top of this file): the larger the thing, the
   rounder. A control (a field, a button) has 8 px; a panel that lies on the page 12 px; what floats over the page
   (a dialog) 16 px; a menu 12 px with its items rounded inside it. A panel keeps its hairline and gains a whisper
   of shadow, so it seems to rest on the page. What floats casts a wide, faint shadow in the ink's blue-grey.
   The brand colour, the typeface, the sizes and every word are as they were.

   Weights: a panel's rule here carries two classes, so it outweighs MudBlazor's one (".mud-paper") and gives way to
   the rules above that make a part flush inside a workspace (three classes). What is nested is matched through
   :where(), which adds no weight, for the same reason. */

/* A panel on the page. */
.mud-paper.mud-elevation-1,
.mud-paper.mud-elevation-2,
.mud-paper.mud-paper-outlined,
.mud-card.mud-paper,
.mud-table.mud-paper,
.mud-expansion-panels.mud-paper {
    border-radius: var(--app-radius-lg);
}

.app-page-content .mud-paper.mud-elevation-1,
.app-page-content .mud-paper.mud-elevation-2,
.section-card,
.crud-card,
.stat-tile,
.record-header,
.editor-surface,
.country-list-surface,
.login-card {
    box-shadow: var(--app-shadow-xs);
}

/* A box inside a panel is a step smaller than the panel and has no shadow of its own: the panel is the one
   surface. The rounding utilities are told the same; they are drawn with !important above, so here too. */
:where(.mud-paper, .section-card, .crud-card, .editor-surface, .mud-dialog) .mud-paper.mud-paper-outlined,
:where(.mud-paper, .section-card, .crud-card, .editor-surface, .mud-dialog) .mud-paper.mud-elevation-1 {
    border-radius: var(--app-radius-md);
    box-shadow: none;
}

:where(.mud-paper, .section-card, .crud-card, .editor-surface, .mud-dialog) :is(.rounded, .rounded-sm, .rounded-lg, .rounded-xl) {
    border-radius: var(--app-radius-md) !important;
}

:where(.section-card, .crud-card, .editor-surface, .organisation-detail-workspace, .framework-definition-workspace) :is(.section-card, .country-list-surface, .stat-tile, .record-header) {
    box-shadow: none;
}

/* A table in a panel is square: the panel's corner clips it. One that stands alone is a panel itself, and clips
   its own heading row and last row to its corner. */
:where(.mud-paper, .section-card, .crud-card, .country-list-surface, .editor-surface) .mud-table.mud-paper {
    border-radius: 0;
}

.mud-table.mud-paper {
    overflow: clip;
}

/* What floats over the page. A dialog; a menu, a select's list, a date picker; a message; a tooltip. */
.mud-dialog {
    box-shadow: var(--app-shadow-xl) !important;
}

.mud-overlay.mud-overlay-dialog .mud-overlay-dark,
.mud-overlay .mud-overlay-dark {
    background-color: rgb(15 23 42 / 0.4);
}

.mud-popover.mud-paper {
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-lg);
}

/* A menu's or a list's items are rounded inside it, 4 px clear of its edge, so the one under the pointer is a soft
   block and not a band from edge to edge. */
.mud-popover.mud-paper .mud-list {
    padding: 4px;
}

.mud-popover.mud-paper .mud-list-item,
.mud-popover.mud-paper .mud-menu-item {
    border-radius: var(--app-radius-sm);
}

.mud-snackbar {
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-lg);
}

.mud-tooltip {
    border-radius: var(--app-radius-sm);
}

/* The line under the tab that is open has rounded ends and is a pixel thicker. */
.mud-tabs .mud-tab-slider.mud-tab-slider-horizontal {
    height: 3px;
    border-radius: 3px 3px 0 0;
}

/* The sidebar. A link is a rounded block 8 px clear of the sidebar's edges; the place the staff member is in is
   that block in the tint, with its words in the brand colour and bold. The 3 px bar that marked it is gone: the
   block says the same more quietly. Closed to a rail, the block is a 40 px tile round the icon. The link's width is
   worked out, not left to the browser: its item is a flex row, where a link without a width shrinks to its words.
   Three classes: MudBlazor's dense menu sets a link's margin with three (".mud-navmenu.mud-navmenu-margin-dense
   .mud-nav-link"), and with two the link stayed against the sidebar's left edge. */
.sidebar-nav.mud-navmenu .mud-nav-link {
    width: calc(100% - 16px);
    margin: 2px 8px;
    border-left: 0;
    border-radius: var(--app-radius-md);
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.sidebar-section-label {
    padding: 16px 20px 4px;
}

@media (min-width: 960px) {
    .sidebar.mud-drawer--closed .sidebar-nav.mud-navmenu .mud-nav-link {
        width: 40px;
        margin: 2px auto;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* A record's section rail marks its place the same way: a rounded block in the tint, with no bar on its edge. */
.section-rail__item {
    padding-inline: 12px;
    border-left: 0;
    border-radius: var(--app-radius-md);
}

/* The top bar: the person's menu is a pill round their picture and name. */
.topbar-user-trigger {
    padding-right: 12px;
    border-radius: 999px;
}

.topbar-search-wrap {
    background: var(--mud-palette-surface);
}

/* The bell (12 November 2026): beside the person's menu, in the top bar's quiet grey. Its count is a small pill on
   the button's corner, in the brand colour: something to look at, not something overdue. The pill takes no clicks,
   so the button under it does. */
.topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.topbar-bell .mud-menu .mud-icon-button-label {
    color: var(--mud-palette-text-secondary);
}

.topbar-bell__count {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: var(--app-font-micro);
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
}

/* What the bell opens: a list about 380 px wide (narrower on a phone), with each notification a link of two lines,
   what happened and how long ago. One not yet read has a dot in the brand colour and its words in the primary text
   colour at semibold; one already read is in the secondary colour. Four classes on a row: MudBlazor lays a menu's
   item out with one, and the popover's rule above rounds it with three. */
.mud-popover.mud-paper .mud-list.notification-panel {
    width: 380px;
    max-width: calc(100vw - 24px);
}

.notification-panel__head {
    padding: 10px 12px 6px;
    font-size: var(--app-font-body);
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    cursor: default;
}

.notification-panel__note,
.mud-popover.mud-paper .mud-list .mud-menu-item.notification-panel__note {
    padding: 10px 12px 14px;
    font-size: var(--app-font-detail);
    color: var(--mud-palette-text-secondary) !important;
    cursor: default;
}

.mud-popover.mud-paper .mud-list .mud-menu-item.notification-panel__note .mud-menu-item-text {
    margin: 0;
    font-size: var(--app-font-detail);
}

.mud-popover.mud-paper .mud-list .mud-menu-item.notification-row {
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    color: var(--mud-palette-text-secondary);
}

.mud-popover.mud-paper .mud-list .mud-menu-item.notification-row .mud-menu-item-text {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    min-width: 0;
}

.notification-row__dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: transparent;
}

.notification-row--unread .notification-row__dot {
    background: var(--mud-palette-primary);
}

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

.notification-row__what {
    font-size: var(--app-font-detail);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.notification-row--unread .notification-row__what {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.notification-row__when {
    font-size: var(--app-font-label);
    color: var(--mud-palette-text-secondary);
}

.mud-popover.mud-paper .mud-list .mud-menu-item.notification-panel__mark-all {
    justify-content: center;
    margin-top: 4px;
    border-top: 1px solid var(--mud-palette-divider);
    border-radius: 0 0 var(--app-radius-sm) var(--app-radius-sm);
    color: var(--mud-palette-primary);
}

.mud-popover.mud-paper .mud-list .mud-menu-item.notification-panel__mark-all .mud-menu-item-text {
    flex: 0 1 auto;
    margin: 2px 0;
    font-size: var(--app-font-detail);
    font-weight: 600;
}

/* Scroll bars are thin and in the ink at a quarter strength, in both themes: a list that scrolls in its panel, a
   dialog's content and the sidebar no longer carry the browser's grey gutter. */
html {
    scrollbar-color: color-mix(in srgb, var(--mud-palette-text-primary) 24%, transparent) transparent;
}

.mud-table-container,
.mud-dialog-content,
.mud-drawer-content,
.mud-popover.mud-paper,
.home-coverage__scroll {
    scrollbar-width: thin;
}

/* ── My work: the desk ─────────────────────────────────────────
   12 November 2026, and redrawn the same day after the owner saw the first drawing, which was worse than the page
   it replaced: tall tiles that mostly read nought, rows three lines high, and the latest changes as a timeline in
   bands by country, far down the page or squeezed into a column.

   The list of what to do next is what the page is for. The queues' counts are a strip of small links over it, each
   with its figure in a pill; a figure is coloured only when something there needs someone now, and a nought is
   drawn quietly. A thing waiting is a row of two lines, and one line where the list is wide. The latest changes
   are a plain list, newest first. From 1280 px the list takes the left, with the queues and the latest changes in
   a column beside it. */
.home-desk {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.home-desk > * {
    min-width: 0;
}

.home-desk .home-stats,
.home-desk .home-do-next,
.home-desk .home-activity {
    margin-bottom: 0;
}

/* The strip needs no heading over it: each link names its queue. It is kept for a screen reader. */
.home-desk__heading {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* A queue: its name, and its figure in a pill at the end. The tile's own parts are placed again. Over the list the
   queues are a strip of links, each as wide as its name needs, wrapping to a second line: in columns of equal width
   four names in five were cut short ("Expert Enqui…"). The icon, which the sidebar shows beside the same name, is
   left out of the strip and kept in the column. */
.home-desk .home-queues {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-queues .stat-tile {
    display: grid;
    flex: 0 1 auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "top value";
    align-items: center;
    gap: 0 10px;
    width: auto;
    min-height: 44px;
    padding: 6px 12px 6px 14px;
}

.home-queues .stat-tile::before {
    content: none;
}

.home-queues .stat-tile--clickable:hover {
    border-color: var(--mud-palette-divider);
    background: var(--mud-palette-table-hover);
}

.home-queues .stat-tile__top {
    grid-area: top;
    justify-content: flex-start;
    min-width: 0;
}

.home-queues .stat-tile__label {
    overflow: hidden;
    font-size: var(--app-font-body);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mud-palette-text-primary);
}

.home-queues .stat-tile__icon {
    display: none;
    flex: none;
    order: -1;
    color: var(--mud-palette-text-secondary);
}

/* The line under the name is read out, and shown where there is room for it: in the column beside the list. */
.home-queues .stat-tile__hint {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.home-queues .stat-tile__value {
    grid-area: value;
    min-width: 32px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: var(--app-font-body);
    line-height: 1.5;
    text-align: center;
    color: var(--mud-palette-text-primary);
    background: color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
}

.home-queues .stat-tile--none .stat-tile__value {
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    background: transparent;
}

@supports (color: light-dark(#000, #fff)) {
    .home-queues .stat-tile {
        color-scheme: var(--mud-native-html-color-scheme, light);
    }

    .home-queues .stat-tile--warning:not(.stat-tile--none) .stat-tile__value {
        color: var(--app-badge-warning-text);
        background: var(--app-badge-warning-fill);
    }

    .home-queues .stat-tile--error:not(.stat-tile--none) .stat-tile__value {
        color: var(--app-badge-error-text);
        background: var(--app-badge-error-fill);
    }
}

@media (min-width: 1280px) {
    .home-desk {
        grid-template-columns: minmax(0, 1fr) 340px;
        grid-template-areas: "work queues" "work changes";
        grid-template-rows: auto 1fr;
        column-gap: 24px;
    }

    .home-desk__work {
        grid-area: work;
    }

    .home-desk__queues {
        grid-area: queues;
        overflow: clip;
        border: 1px solid var(--mud-palette-divider);
        border-radius: var(--app-radius-lg);
        background: var(--mud-palette-surface);
        box-shadow: var(--app-shadow-xs);
    }

    .home-desk__changes {
        grid-area: changes;
    }

    /* Beside the list the queues are rows of one panel, under the panel's own heading, so its top lines up with
       the list's; there is room for the line under each name. */
    .home-desk__queues .home-desk__heading {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 14px 16px;
        overflow: visible;
        clip-path: none;
        border-bottom: 1px solid var(--mud-palette-divider);
        font-size: var(--app-font-card);
        font-weight: 700;
        line-height: 1.35;
        color: var(--mud-palette-text-primary);
    }

    .home-desk .home-queues {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
    }

    .home-queues .stat-tile__icon {
        display: inline-block;
    }

    .home-queues .stat-tile {
        grid-template-areas: "top value" "hint value";
        width: 100%;
        padding: 10px 16px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .home-queues .stat-tile + .stat-tile {
        border-top: 1px solid var(--mud-palette-divider);
    }

    .home-queues .stat-tile:focus-visible {
        outline-offset: calc(-1 * var(--app-focus-width));
    }

    .home-queues .stat-tile__hint {
        position: static;
        grid-area: hint;
        width: auto;
        height: auto;
        margin: 0;
        padding-inline-start: 28px;
        overflow: hidden;
        clip-path: none;
        text-overflow: ellipsis;
    }
}

/* The quick filters: one rounded track, with the filter in force raised on it. */
.work-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 6%, transparent);
}

.work-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-size: var(--app-font-detail);
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}

.work-filter:hover:not(:disabled) {
    color: var(--mud-palette-text-primary);
}

.work-filter[aria-pressed="true"] {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-primary);
    box-shadow: var(--app-shadow-sm);
}

.work-filter:disabled {
    opacity: 0.55;
    cursor: default;
}

.work-filter__count {
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

/* The list. Its own width, not the window's, decides how a row is laid out: beside the column of queues the list is
   narrower than the window suggests. */
.work-list {
    container: work-list / inline-size;
}

.work-list__group {
    margin: 0;
    padding: 12px 20px 2px;
    font-size: var(--app-font-label);
    font-weight: var(--app-label-weight);
    line-height: 1.5;
    color: var(--app-label-ink);
}

.work-list__group-count {
    margin-inline-start: 4px;
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

.work-list__rows {
    margin: 0;
    padding: 4px 8px 8px;
    list-style: none;
}

.work-list__rows > li + li {
    border-top: 1px solid var(--mud-palette-divider);
}

.work-row,
.work-row:hover {
    color: inherit;
    text-decoration: none;
}

/* Two lines: what it is and who holds it; what it is about, and what it waits for and for how long. */
.work-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 24px;
    grid-template-areas: "title owner go" "detail meta go";
    gap: 2px 12px;
    align-items: center;
    margin: 2px 0;
    padding: 8px 12px;
    border-radius: var(--app-radius-md);
}

.work-row:hover {
    background: var(--mud-palette-table-hover);
}

.work-row:focus-visible {
    outline-offset: calc(-1 * var(--app-focus-width));
}

/* How pressing it is, as an edge in the tone its time is written in. */
.work-row--overdue {
    box-shadow: inset 3px 0 0 var(--mud-palette-error);
}

.work-row--soon {
    box-shadow: inset 3px 0 0 var(--mud-palette-warning);
}

.work-row__title {
    grid-area: title;
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.work-row__reference {
    overflow: hidden;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    color: var(--mud-palette-primary);
}

.work-row:hover .work-row__reference {
    text-decoration: underline;
}

.work-row__kind {
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
}

.work-row__detail {
    grid-area: detail;
    min-width: 0;
    overflow: hidden;
    font-size: var(--app-font-detail);
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.work-row__meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.work-row__state,
.work-row__time {
    min-width: 0;
}

.work-row__owner {
    grid-area: owner;
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 8px;
    min-width: 0;
    font-size: var(--app-font-detail);
    white-space: nowrap;
}

.work-row__owner--none {
    color: var(--mud-palette-text-secondary);
}

.work-row__owner--me {
    font-weight: 600;
}

.work-row__avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: var(--app-font-micro);
    font-weight: 700;
    color: var(--mud-palette-primary);
    background: var(--app-tint);
}

.work-row__owner--me .work-row__avatar {
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
}

.work-row__owner--none .work-row__avatar {
    border: 1px dashed var(--mud-palette-lines-inputs);
    background: transparent;
}

.work-row__go {
    grid-area: go;
    color: var(--mud-palette-text-disabled);
}

.work-row:hover .work-row__go {
    color: var(--mud-palette-primary);
}

/* On a narrow list what it waits for goes under what it is about. */
@container work-list (max-width: 559px) {
    .work-row {
        grid-template-areas: "title owner go" "detail detail go" "meta meta go";
        row-gap: 4px;
    }

    .work-row__meta {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* With room, what it waits for, the time and the holder each stand in a column of their own, so the rows line up. */
@container work-list (min-width: 880px) {
    .work-row {
        grid-template-columns: minmax(0, 1fr) 216px 124px 168px 24px;
        grid-template-areas: "title state time owner go" "detail state time owner go";
    }

    .work-row__meta {
        display: contents;
    }

    .work-row__state {
        grid-area: state;
    }

    .work-row__time {
        grid-area: time;
    }

    .work-row__owner {
        justify-self: start;
    }
}

/* The latest changes: a dot in the change's colour, the record's name with where and what under it, and when. */
.home-activity .section-card__header {
    align-items: center;
}

.activity-list {
    margin: 0;
    padding: 4px 8px 8px;
    list-style: none;
}

.activity-list > li + li {
    border-top: 1px solid var(--mud-palette-divider);
}

.activity-row,
.activity-row:hover {
    color: inherit;
    text-decoration: none;
}

.activity-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    gap: 0 12px;
    align-items: center;
    margin: 2px 0;
    padding: 8px 12px;
    border-radius: var(--app-radius-md);
}

.activity-row--link:hover {
    background: var(--mud-palette-table-hover);
}

.activity-row--link:focus-visible {
    outline-offset: calc(-1 * var(--app-focus-width));
}

.activity-row__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

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

.activity-row__title,
.activity-row__meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-row__title {
    font-weight: 600;
}

.activity-row--link:hover .activity-row__title {
    color: var(--mud-palette-primary);
}

.activity-row__meta,
.activity-row__time {
    font-size: var(--app-font-caption);
    color: var(--mud-palette-text-secondary);
}

.activity-row__time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The Pass picker's list (12 November 2026). A pass's name is a sentence ("Indonesian institutions from the NOOSR
   lists (11 Nov 2026): records, file 30"), and the list was as narrow as the filter's box, so each name ran to six
   lines. The list is as wide as its names need, up to 560 px or the window. MudBlazor writes "max-width: none" on a
   list that sizes to its content, in the element's own style, so the limit is marked important: without that the
   list ran the width of the page (seen on staging, 12 November 2026). */
.pass-picker__list {
    max-width: min(560px, calc(100vw - 32px)) !important;
}

.pass-picker__list .mud-list-item-text {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ── Motion, only as an answer ─────────────────────────────────
   A dialog fades in; a panel that opens beside a list slides in from the side it lies on; a row just saved shows
   the tint once; a thin brand line runs under the top bar while a page is being fetched. Nothing moves by itself
   when a page appears: every one of these waits for the shell's script, which marks the document (data-motion on
   <html>) once it runs, so what the server drew, and a page photographed for a guide, stands still.
   The portal makes every other animation instant ("Staff interactions are immediate", above); each motion here
   names its own duration with !important to be let through that rule. */
html[data-motion] .mud-dialog {
    animation: app-fade-in var(--app-motion-fade) ease-out both;
    animation-duration: var(--app-motion-fade) !important;
}

html[data-motion] .mud-dialog-container.mud-dialog-centerright .mud-dialog,
html[data-motion] .reference-data-layout__editor,
html[data-motion] .education-level-panel {
    animation: app-panel-in var(--app-motion-panel) var(--app-motion-ease) both;
    animation-duration: var(--app-motion-panel) !important;
}

html[data-motion] .mud-table-root .mud-table-body .mud-table-row.row-saved > .mud-table-cell {
    animation: row-saved var(--app-motion-flash) ease-out 1;
    animation-duration: var(--app-motion-flash) !important;
}

@keyframes row-saved {
    from { background-color: var(--app-tint); }
    to { background-color: transparent; }
}

@keyframes app-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes app-panel-in {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: none; }
}

/* The line under the top bar. The shell's script marks the document (data-page-busy on <html>) from the moment an
   address is asked for until the page has arrived; a page that arrives at once never shows it (the 120 ms wait). */
.page-progress {
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.page-progress::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 40%;
    background: var(--mud-palette-primary);
    transform: translateX(-100%);
}

html[data-page-busy] .page-progress {
    opacity: 1;
    transition: opacity 80ms linear 120ms !important;
}

html[data-page-busy] .page-progress::before {
    animation: page-progress 1.1s var(--app-motion-ease) infinite;
    animation-duration: 1.1s !important;
    animation-iteration-count: infinite !important;
}

@keyframes page-progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

/* Nothing jumps: what shows while a read is under way keeps the room of what replaces it. A list's placeholder
   rows are the height of its rows (above), and the line saying what members see keeps the two lines it becomes. */
.record-header__member-view:has(> .record-header__line-reason:only-child) {
    min-height: 54px;
}

/* ── Less motion ───────────────────────────────────────────────
   A staff member who has asked their computer for less motion gets none of the above: the panel and the dialog
   appear at once, the saved row does not flash, the placeholders do not pulse, and the line under the top bar
   stands still, full width, while a page is fetched. */
@media (prefers-reduced-motion: reduce) {
    :root {
        --app-motion-panel: 0ms;
        --app-motion-fade: 0ms;
        --app-motion-flash: 0ms;
    }

    html[data-motion] .mud-dialog,
    html[data-motion] .mud-dialog-container.mud-dialog-centerright .mud-dialog,
    html[data-motion] .reference-data-layout__editor,
    html[data-motion] .education-level-panel,
    html[data-motion] .mud-table-root .mud-table-body .mud-table-row.row-saved > .mud-table-cell,
    .list-skeleton__bar {
        animation: none;
    }

    html[data-page-busy] .page-progress {
        transition: none !important;
    }

    html[data-page-busy] .page-progress::before {
        width: 100%;
        transform: none;
        animation: none;
    }
}
