/* ==========================================================================
   ITOps App (White Glove IT Solutions Inc.)
   main.css

   Organization (per STYLE_GUIDE.md):
   1. CSS custom properties (:root)
   2. Reset and base element styles
   3. Layout primitives
   4. Components (alphabetical)
   5. Utilities
   6. Media queries (mobile-first, scaling up)
   ========================================================================== */


/* ---------- 1. Custom Properties ---------- */

:root {
    /* D450 (branding/brand_redesign/DESIGN_SYSTEM.md §2, Direction 1): colour tokens named
       by job -- deep navy, bright blue, a cool white ground. Built on D401's token names
       (WGIT_LOOK_DESIGN.md §2), so every rule that reads them changes with this block.
       This block is the only place in the app's stylesheets where a colour is written;
       everything else reads these names. These are the light values; the dark set
       follows this block (design §9). tools/token_contrast.py checks every pair. */
    --ground: #F5F7FB;          /* page background */
    --card: #FFFFFF;            /* cards, panels, dialogs, menus */
    --fill: #F1F4F9;            /* fields, subtle fills, stripes, hover */
    --line: #E3E8F0;            /* borders, dividers, table rules (decorative) */
    --line-strong: #7C8BA1;     /* input and control borders (3:1 on --card and --fill) */
    --text: #0F172A;            /* body text and headings */
    --text-2: #475569;          /* secondary text, captions, meta */
    --accent: #2563EB;          /* primary buttons, active tabs, selected states */
    --on-accent: #FFFFFF;       /* text and icons on --accent */
    --accent-tint: #EAF1FF;     /* selected rows, chips, soft highlights */
    --accent-text: #1D4ED8;     /* links, accent text, action icons */
    --brass: #D97706;           /* second colour: charts, budgets, highlights (never text) */
    --header-bg: #FFFFFF;
    --header-text: #0F172A;
    --footer-bg: #0A1428;
    --footer-text: #C9D3E6;
    --good: #15803D;            /* done, OK */
    --good-tint: #E9F7ED;
    --warn: #B45309;            /* due, waiting, needs you */
    --warn-tint: #FFF2DE;
    --problem: #BE123C;         /* overdue, errors, destructive actions */
    --problem-tint: #FFE6EB;
    /* D450 new: the navy navigation (the Hybrid shell's rail, Phase 2), AI's violet and
       a teal for kinds of work. */
    --nav-bg: #0B1630;
    --nav-bg-2: #13213F;
    --nav-bg-3: #1C2E55;        /* a hovered row, the top menu's chosen tab (coder-691) */
    --nav-text: #C9D3E6;
    --nav-muted: #8696B4;
    --nav-strong: #FFFFFF;      /* the name beside the mark, a hovered row's text */
    --nav-mark: #60A5FA;        /* the ITOps App mark drawn on the navy */
    --nav-active-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);   /* the current item's glow */
    --ai: #6D28D9;              /* AI-drafted work, the assistant */
    --ai-tint: #F0EAFF;
    --teal: #0F766E;
    --teal-tint: #E0F4F1;
    --focus-ring: rgba(37, 99, 235, 0.28);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-raised: 0 10px 30px rgba(15, 23, 42, 0.1);   /* menus, dialogs (D450 new) */
    /* coder-693 (D450 Phase 3a, design §5 "Buttons"): the primary button's soft blue glow. */
    --accent-glow: 0 1px 2px rgba(15, 23, 42, 0.1), 0 4px 10px rgba(37, 99, 235, 0.25);
    --scrim: rgba(15, 23, 42, 0.55);
    /* coder-582 (fix queue 7): an emphasis panel (S&M's "My items"): filled in light; in
       dark it stays a dark panel, so it is never the brightest thing on the page.
       coder-689 (D450): the light fill is the navigation's navy, not the bright accent,
       so its faded text keeps 4.5:1. */
    --emphasis-ground: var(--nav-bg);
    --emphasis-edge: var(--nav-bg);
    --emphasis-ink: var(--on-accent);
    --emphasis-link: var(--on-accent);

    /* Categories, for charts and maps: data told apart, never a status. Each tint is
       12 % of the colour on white. A category colour always goes with a label. */
    --cat-1: #2563EB;
    --cat-1-tint: #E5ECFD;
    --cat-2: #D97706;
    --cat-2-tint: #FAEFE1;
    --cat-3: #0F766E;
    --cat-3-tint: #E2EFEE;
    --cat-4: #7C3AED;
    --cat-4-tint: #EFE7FD;
    --cat-5: #64748B;
    --cat-5-tint: #ECEEF1;

    /* Fixed in both modes (design §9): the light plate content images sit on in dark
       (they were made for a white page), so no dark value is set for it. */
    --plate: #FFFFFF;

    /* Theme switches that are not colours, flipped by the dark set below: the WG mark
       is black on the light header and drawn white on the dark one; what floats over
       the page (popovers, menus, dialogs) carries a --line edge in dark, where --shadow
       is none. */
    --mark-filter: none;
    --float-edge: none;
    /* D450: the ITOps App mark (img/brand/itops-mark.svg) is blue on the light header and
       drawn white on the dark one -- the same drawing as itops-mark-white.svg. */
    --logo-filter: none;
    /* --image-plate, --image-plate-inset and --image-plate-radius are set by the dark
       set only: a content image rule reads each with its own light value as the
       fallback, so light is unchanged and dark puts the image on the plate. */

    /* The hatch for paused and held work, built from two role tokens. */
    --hatch: repeating-linear-gradient(135deg, var(--line) 0 3px, var(--fill) 3px 7px);

    /* Shape (D450 §4) */
    --radius-card: 14px;
    --radius-control: 9px;
    --radius-panel: 20px;       /* large panels, sheets (D450 new) */
    --radius-pill: 999px;
    --radius-field: 10px;       /* inputs, selects, text areas (design §5 "Fields", coder-693) */

    /* coder-693 (D450 Phase 3a, design §5 "Chips and status"): one chip shape for every
       badge, chip and status mark; the colour comes from the chip's family (section 4,
       "Chips and status"). */
    --chip-height: 23px;
    --chip-pad-x: 9px;
    --chip-weight: 650;

    /* Typography (D450 §3): Plus Jakarta Sans for the product, self-hosted (the
       @font-face below). The display face reads it too in this phase: Playfair Display is
       kept for the few section headings design §1 names, and returns only where a serif
       improves the page. --font-heading is D450's new name for headings. */
    --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --font-heading: var(--font-body);
    --font-display: var(--font-body);
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Type Scale (D450 §3's app scale, on D401's names): caption 12, metadata and tables
       13, body 14.5, section titles 15, sub-headings 17, headings 20, page titles 25,
       numbers in tiles 28 px. */
    --text-xs: 0.75rem;
    --text-label: 0.78125rem;   /* 12.5 px: field labels and small lines (design §5, coder-698) */
    --text-sm: 0.8125rem;
    --text-base: 0.90625rem;
    --text-lg: 0.9375rem;
    --text-xl: 1.0625rem;
    --text-2xl: 1.25rem;
    --text-3xl: 1.5625rem;
    --text-4xl: 1.75rem;

    /* Line heights (D450 new) */
    --leading-tight: 1.15;
    --leading-snug: 1.35;
    --leading: 1.5;

    /* Spacing (4px grid) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    --space-10: 4rem;
    --space-12: 6rem;
    /* coder-698: the half steps the wizards' sheet uses (2, 6, 10, 14 and 20 px), so its
       spacing is tokens too (design §4: literal spacing replaced as areas are touched). */
    --space-0-5: 0.125rem;
    --space-1-5: 0.375rem;
    --space-2-5: 0.625rem;
    --space-3-5: 0.875rem;
    --space-4-5: 1.25rem;

    /* Container Widths. D450: a page that lists or shows work takes the work area's
       width (--container-wide, and .container--medium when it holds a list: section 3);
       forms and long reading text stay within --container-medium's ~880 px of content. */
    --container-narrow: 640px;
    --container-medium: 944px;
    --container-wide: 1600px;

    /* coder-698 (D450 Phase 4c): the icons a rule draws as a mask in currentColor -- a
       check's result (good, problem, warning, a note), a plain tick, and the shell sprite's
       sparkle (`ask`) for the assistant's work. Shapes, not colours: the colour is the
       rule's own. */
    --icon-sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 2.5l2 5.5 5.5 2-5.5 2-2 5.5-2-5.5-5.5-2 5.5-2z'/%3E%3Cpath d='M18.5 14l1 2.5 2.5 1-2.5 1-1 2.5-1-2.5-2.5-1 2.5-1z'/%3E%3C/svg%3E");
    --icon-good: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm4.6 6.4-6 6.2-3.2-3.1-1.6 1.7 4.8 4.6 7.6-7.8z'/%3E%3C/svg%3E");
    --icon-problem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E");
    --icon-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2.5 22.5 21h-21zm-1.25 6.5v6h2.5V9zm0 7.5V19h2.5v-2.5z'/%3E%3C/svg%3E");
    --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 8v7h2.5v-7zm0-4v2.5h2.5V6z'/%3E%3C/svg%3E");
    --icon-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 16.2 5.3 12l-1.6 1.6 5.8 5.8 11-11-1.6-1.6z'/%3E%3C/svg%3E");
}

/* D450 (design §3): Plus Jakarta Sans, the variable font (weights 200-800), self-hosted
   with its licence in static/fonts/ (OFL.txt, SOURCES.md): latin, which base.html's head
   preloads, and latin-ext, fetched only for a character in its range. */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
        U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* D401 §6, WGIT_LOOK_DESIGN.md §9: the dark set, with D450's dark values (design §2; its
   --line-strong tuned to #5E6F8E for 3:1 on --fill, coder-689). The same values twice: once for
   a person on Automatic (no data-theme on <html>) whose device asks for dark, once for a
   person who chose Dark. So Automatic follows the device with no script and every page
   is right on first paint. Category tints are 20 % of the dark colour on the dark
   --card. Screen only: a printed page keeps the light values. color-scheme follows, so
   native controls, scrollbars, date pickers and SVG images match. */
@media screen {
    :root:not([data-theme]) {
        color-scheme: light dark;
    }

    :root[data-theme="light"] {
        color-scheme: light;
    }

    :root[data-theme="dark"] {
        color-scheme: dark;
        --ground: #0B1220;
        --card: #111A2C;
        --fill: #17223A;
        --line: #22304A;
        --line-strong: #5E6F8E;
        --text: #E6EBF4;
        --text-2: #9AA8C0;
        --accent: #6EA8FE;
        --on-accent: #0A1428;
        --accent-tint: #16264A;
        --accent-text: #8AB8FF;
        --brass: #FBBF24;
        --header-bg: #0F1729;
        --header-text: #E6EBF4;
        --footer-bg: #070D1A;
        --footer-text: #9AA8C0;
        --good: #4ADE80;
        --good-tint: #0F2A1A;
        --warn: #FBBF24;
        --warn-tint: #2E2410;
        --problem: #FB7185;
        --problem-tint: #3A1520;
        --nav-bg: #070D1A;
        --nav-bg-2: #0F1A30;
        --nav-bg-3: #1A2846;
        --nav-text: #C9D3E6;
        --nav-muted: #8696B4;
        --nav-strong: #FFFFFF;
        --nav-mark: #6EA8FE;
        --nav-active-shadow: none;
        --ai: #C4B5FD;
        --ai-tint: #241A42;
        --teal: #5EEAD4;
        --teal-tint: #0E2B28;
        --focus-ring: rgba(110, 168, 254, 0.45);
        --shadow: none;
        --shadow-raised: none;
        --accent-glow: none;
        --scrim: rgba(0, 0, 0, 0.65);
        --emphasis-ground: var(--accent-tint);
        --emphasis-edge: var(--line);
        --emphasis-ink: var(--text);
        --emphasis-link: var(--accent-text);
        --cat-1: #6EA8FE;
        --cat-1-tint: #243656;
        --cat-2: #FBBF24;
        --cat-2-tint: #403B2A;
        --cat-3: #5EEAD4;
        --cat-3-tint: #20444E;
        --cat-4: #C4B5FD;
        --cat-4-tint: #353956;
        --cat-5: #9AA8C0;
        --cat-5-tint: #2C364A;
        --mark-filter: invert(1);
        --logo-filter: brightness(0) invert(1);
        --float-edge: 1px solid var(--line);
        --image-plate: var(--plate);
        --image-plate-inset: 4px;
        --image-plate-radius: var(--radius-control);
    }
}

@media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ground: #0B1220;
        --card: #111A2C;
        --fill: #17223A;
        --line: #22304A;
        --line-strong: #5E6F8E;
        --text: #E6EBF4;
        --text-2: #9AA8C0;
        --accent: #6EA8FE;
        --on-accent: #0A1428;
        --accent-tint: #16264A;
        --accent-text: #8AB8FF;
        --brass: #FBBF24;
        --header-bg: #0F1729;
        --header-text: #E6EBF4;
        --footer-bg: #070D1A;
        --footer-text: #9AA8C0;
        --good: #4ADE80;
        --good-tint: #0F2A1A;
        --warn: #FBBF24;
        --warn-tint: #2E2410;
        --problem: #FB7185;
        --problem-tint: #3A1520;
        --nav-bg: #070D1A;
        --nav-bg-2: #0F1A30;
        --nav-bg-3: #1A2846;
        --nav-text: #C9D3E6;
        --nav-muted: #8696B4;
        --nav-strong: #FFFFFF;
        --nav-mark: #6EA8FE;
        --nav-active-shadow: none;
        --ai: #C4B5FD;
        --ai-tint: #241A42;
        --teal: #5EEAD4;
        --teal-tint: #0E2B28;
        --focus-ring: rgba(110, 168, 254, 0.45);
        --shadow: none;
        --shadow-raised: none;
        --accent-glow: none;
        --scrim: rgba(0, 0, 0, 0.65);
        --emphasis-ground: var(--accent-tint);
        --emphasis-edge: var(--line);
        --emphasis-ink: var(--text);
        --emphasis-link: var(--accent-text);
        --cat-1: #6EA8FE;
        --cat-1-tint: #243656;
        --cat-2: #FBBF24;
        --cat-2-tint: #403B2A;
        --cat-3: #5EEAD4;
        --cat-3-tint: #20444E;
        --cat-4: #C4B5FD;
        --cat-4-tint: #353956;
        --cat-5: #9AA8C0;
        --cat-5-tint: #2C364A;
        --mark-filter: invert(1);
        --logo-filter: brightness(0) invert(1);
        --float-edge: 1px solid var(--line);
        --image-plate: var(--plate);
        --image-plate-inset: 4px;
        --image-plate-radius: var(--radius-control);
    }
}


/* ---------- 2. Reset and Base Styles ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text);
    background: var(--ground);
    line-height: var(--leading);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: pageFadeIn 300ms ease-out;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* D450 (design §3): headings in the product's sans, bold and slightly tight -- page titles
   25 px / 750, headings 20, sub-headings 17 (the type scale above). */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
    color: var(--text);
}

h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 650;
    line-height: var(--leading-snug);
    color: var(--text);
}

h1 { font-size: var(--text-3xl); font-weight: 750; letter-spacing: -0.016em; }

/* A bare page title (the standalone auth pages) keeps .page-title's space below it. */
.container > h1:not([class]) { margin-bottom: var(--space-2); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

a {
    color: var(--accent-text);
    text-decoration: underline;
    transition: color 200ms ease-out;
}

a:hover {
    color: var(--accent-text);
}

img, svg {
    display: block;
    max-width: 100%;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

legend {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-4);
}


/* ---------- 3. Layout Primitives ---------- */

.container {
    max-width: var(--container-medium);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

/* D450 (design §1, "work first"): a page that lists or shows work takes the work area's
   width. .container (medium) holds both lists and forms, so a medium page widens when it
   holds a list, a board, a grid of cards or a home's sections; a form or a page of
   reading keeps --container-medium. The shared task page (its title row) widens from
   --container-narrow to the reading width; the other narrow pages (sign-in, errors, the
   assessments, short forms) stay narrow. */
.container:not(.container--narrow):has(.data-table, .task-board, .card-grid,
                                       .dashboard-grid, .vc-list, .home-section,
                                       .home-tiles, .landing-group) {
    max-width: var(--container-wide);
}

.container--narrow:has(> .page-title-row) {
    max-width: var(--container-medium);
}

main {
    flex: 1;
    padding: var(--space-6) var(--space-6) var(--space-10);
}

/* Card containers (coder-434). One shared container owns the space between cards;
   cards carry no margin. `.card-grid` is the grid, `.card-stack` a one-column stack of
   full-width cards (form sections, report cards), `.dashboard-grid` the dashboard's
   auto-fit tiles. `.stat-grid`, `.admin-card-list` and `.import-wizard` follow the
   same rule with their own gaps. */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
}

.card-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: var(--space-4);
}

/* A card is never flush against anything (coder-435). A titled card section -- a
   heading, then its cards -- owns the space between them; the section that follows
   one carries the space above itself, a step wider so each heading sits closer to
   its own cards than to the section before. */
.landing-group,
.ts-section,
.drill-tiles,
.portfolio-attention,
.leadership-hand-set {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.landing-group ~ .landing-group,
.ts-section + .ts-section,
.portfolio-attention + .portfolio-index,
.drill-tiles + .drill-section,
.sop-composer-history,
.leadership-hand-set {
    margin-top: var(--space-6);
}

/* A heading is never flush on what follows it (coder-436). Section titles, and
   any heading that sits directly in a `.card`, carry `--space-4` below. The
   `:where()` rule has no specificity, so a heading class that sets its own
   margin (`.report-section__title`, `.form-label`) keeps it. A titled card
   section's gap already spaces its heading, so the title there carries none:
   `.landing-group__title` is always the first child of a `.landing-group`. */
/* D450 (design §3): section titles are 15 px / 700 -- a form's sections, a card's own
   title and the named section headings. */
.form-section__title,
.section-title,
.landing-group__title {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.005em;
}

.form-section__title,
.section-title,
:where(.card) > :where(h2, h3, h4) {
    margin-bottom: var(--space-4);
}

.drill-tiles > .section-title,
.portfolio-attention > .section-title,
.leadership-hand-set > .section-title,
.leadership-hand-set > p {
    margin-bottom: 0;
}

/* A heading that follows content inside a card is never flush under it either
   (coder-437): it carries `--space-5` above, a step wider than the space below it,
   so it reads as the start of the next part of the card. A heading that opens its
   card gets none: the card's padding already spaces it. Hidden form fields and
   scripts do not count as content, and an eyebrow -> title pair stays together. */
:where(.card) > :not(input[type="hidden"], script, style, template)
    ~ :where(h2, h3, h4):not(:is(.card-eyebrow, .eyebrow) + *),
:not(input[type="hidden"], script, style, template) ~ .form-section__title {
    margin-top: var(--space-5);
}

/* A heading styled as a field label names the list or form below it, as a
   label names its input: `--space-3`, the heading floor, not a section's 16. */
:is(h2, h3, h4).form-label {
    margin-bottom: var(--space-3);
}

/* A row of page-level buttons. It wraps on a phone and keeps its gap (8 px, the
   action-group gap -- coder-456), and is spaced from the content on either side (a
   breadcrumb above already carries its own space). */
.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

:not(.breadcrumb) + .page-actions {
    margin-top: var(--space-4);
}

.page-actions:not(:last-child) {
    margin-bottom: var(--space-4);
}

/* coder-476: an action row straight after a filter row's fields keeps the 24 px
   form-to-action spacing (the two 16 px margins would collapse to 16). */
.filter-bar + .page-actions {
    margin-top: var(--space-5);
}

.page-intro {
    margin-bottom: var(--space-6);
    max-width: var(--container-narrow);
}

/* --- The page header (coder-696, D450 Phase 4a; design §5 "Page header") ---
   Every page's title block is its `.page-intro`: a breadcrumb (12.5 px), the title (25 px /
   750, `.page-title`), its status chip beside it (`.page-title-row`), one metadata line
   (`.page-meta`: chips and dates, "Fri 27 Nov" through the `human_date` filter) and the
   page's main action on the right. These rules give every page that look from the markup
   it already has:
     * the eyebrow that opens a title block reads as the breadcrumb -- 12.5 px, sentence
       case, the second ink, no rule before it; its links (the steps above this page) are
       the same ink at a lighter weight than the page's own step, until hovered;
       a `.breadcrumb` back link is the same size and ink;
     * the lede under a title is the 13 px subtitle line;
     * at the desktop width, a title block's own action row (`.page-actions`, the Hybrid
       shell's Managing bar) sits on the right, level with the title; four buttons or
       fewer -- a longer row (an SOP's downloads) stays under the title, where it wraps;
       on a phone every action row stays under the title. */
.page-intro > .eyebrow,
.eyebrow:has(+ :is(.page-title, .page-title-row)) {
    margin-bottom: var(--space-2);
    font-size: 0.78125rem;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-2);
}

.page-intro > .eyebrow::before,
.eyebrow:has(+ :is(.page-title, .page-title-row))::before {
    content: none;
}

.page-intro > .eyebrow a,
.eyebrow:has(+ :is(.page-title, .page-title-row)) a {
    color: var(--text-2);
    font-weight: 500;
    text-decoration: none;
}

.page-intro > .eyebrow a:hover,
.eyebrow:has(+ :is(.page-title, .page-title-row)) a:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

.eyebrow .crumb-sep,
.shell-trail .crumb-sep {
    display: inline-flex;
    color: var(--line-strong);
}

.eyebrow .crumb-sep .icon,
.shell-trail .crumb-sep .icon {
    width: 14px;
    height: 14px;
}

/* coder-818 (D520 §3): the breadcrumb trail base.html draws at the head of every page in the
   shell (core/_trail.html) takes the eyebrow's slot and type -- 12.5 px, the second ink,
   its links lighter than the page's own step until hovered -- so the header keeps its
   height. It is as wide as the page's own container beside it, so it starts where the
   title does. On a phone only its link up shows (hybrid_shell.css). */
.shell-trail {
    margin: 0 auto var(--space-2);
    font-size: 0.78125rem;
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--text-2);
}

.shell-trail__steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.shell-trail__step {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.shell-trail a,
.shell-trail__text {
    color: var(--text-2);
    font-weight: 500;
    text-decoration: none;
}

.shell-trail a:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

.shell-trail__up {
    display: none;
}

/* Its width follows the container after it, asked from <main> (a :has() may not hold
   another :has()). */
.shell-trail:has(+ .container--narrow) {
    max-width: var(--container-narrow);
}

main:has(> .shell-trail + .container--narrow > .page-title-row) > .shell-trail {
    max-width: var(--container-medium);
}

/* The work area's width, as `.container` takes it (section 3): keep the two lists alike. */
.shell-trail:has(+ .container--wide),
main:has(> .shell-trail + .container:not(.container--narrow)
         :is(.data-table, .task-board, .card-grid, .dashboard-grid, .vc-list, .home-section,
             .home-tiles, .landing-group)) > .shell-trail {
    max-width: var(--container-wide);
}

/* Sales, Marketing & Events' pages fill the page beside the rail, from its own edge. */
.shell-trail:has(+ .snm) {
    max-width: none;
    padding-inline: 0;
}

.page-intro > .page-lede {
    font-size: var(--text-sm);
}

/* One metadata line: its items in a row that wraps, a middle dot between them; a chip is
   an item. */
.page-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    margin: 0;
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
    color: var(--text-2);
}

.page-meta > * + *::before {
    content: "\00B7";
    margin-right: var(--space-2);
    color: var(--line-strong);
}

.page-meta > :is(.badge, .admin-badge, .status-pill, .status-dot, .priority-pill) + *::before,
.page-meta > * + :is(.badge, .admin-badge, .status-pill, .status-dot, .priority-pill)::before {
    content: none;
    margin: 0;
}

.page-intro:has(> .page-meta) {
    max-width: none;
}

.page-meta + :is(.page-lede, .page-meta) {
    margin-top: var(--space-2);
}

.page-meta strong {
    color: var(--text);
    font-weight: 600;
}

@media (min-width: 641px) {
    .page-intro:has(> :is(.page-actions, .shell-actions)):not(:has(> .page-actions > :nth-child(5))) {
        max-width: none;
    }

    :where(.page-intro:has(> :is(.page-actions, .shell-actions)):not(:has(> .page-actions > :nth-child(5)))) {
        display: grid;
        grid-template-columns: minmax(40%, 1fr) minmax(0, max-content);
        column-gap: var(--space-6);
        align-items: start;
    }

    :where(.page-intro:has(> :is(.page-actions, .shell-actions)):not(:has(> .page-actions > :nth-child(5)))) > * {
        grid-column: 1;
    }

    :where(.page-intro:has(> :is(.page-actions, .shell-actions)):not(:has(> .page-actions > :nth-child(5))))
        > :is(.page-actions, .shell-actions) {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: center;
        justify-content: flex-end;
        margin: 0;
    }

    :where(.page-intro:has(> :is(.page-actions, .shell-actions)):not(:has(> .page-actions > :nth-child(5))))
        > :is(.page-actions, .shell-actions) ~ :not(.page-actions, .shell-actions) {
        grid-column: 1 / -1;
    }

    /* A page with the shell's bar and its own row too: its own row goes under the title. */
    :where(.page-intro) > .shell-actions ~ .page-actions {
        grid-column: 1 / -1;
        grid-row: auto;
        justify-content: flex-start;
        margin-top: var(--space-4);
    }
}

.page-intro > .page-lede {
    max-width: 72ch;
}

/* coder-456: a title with a status pill beside it (the shared task page). The pill
   wraps under the title on a phone. */
.page-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-4);
}

.page-title-row .page-title {
    margin-bottom: 0;
}

/* A task status as a pill, keyed on the internal enum (the words are the label).
   coder-693: the chip family (section 4, "Badges, chips and status"): To Do, Not needed
   and Deferred neutral, In Progress Running, Complete Done. */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    background: var(--line);
    color: var(--text-2);
    white-space: nowrap;
}

.status-pill--in_progress {
    background: var(--accent-tint);
    color: var(--accent-text);
}

.status-pill--completed {
    background: var(--good-tint);
    color: var(--good);
}

/* coder-538: "Added by the app" on the costing task's page. coder-693: neutral (the app
   added it; nothing is drafted or running). */
.status-pill--app {
    background: var(--line);
    color: var(--text-2);
}


/* ---------- 4. Components (alphabetical) ---------- */

/* --- Avatars --- */

/* coder-693 (D450 Phase 3a, design §5 "Avatars"; macros/avatars.html): a person's initials
   on their stable colour (app/core/avatars.py picks a tone from the name), 28 or 34 px; a
   stack overlaps them with a ring of the surface they sit on. */
.avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cat-1);
    color: var(--on-accent);
    font-family: var(--font-body);
    font-size: 0.65625rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    user-select: none;
}

.avatar--34 {
    width: 34px;
    height: 34px;
    font-size: var(--text-xs);
}

.avatar--tone-1 { background: var(--cat-1); color: var(--on-accent); }
.avatar--tone-2 { background: var(--cat-3); color: var(--on-accent); }
.avatar--tone-3 { background: var(--cat-4); color: var(--on-accent); }
.avatar--tone-4 { background: var(--cat-5); color: var(--on-accent); }
.avatar--more { background: var(--line); color: var(--text-2); }

.avatar-stack {
    display: inline-flex;
    align-items: center;
}

.avatar-stack .avatar {
    box-shadow: 0 0 0 2px var(--card);
}

.avatar-stack .avatar + .avatar {
    margin-left: -8px;
}


/* --- Badges, chips and status (D450 Phase 3a) --- */

/* coder-693 (design §5 "Chips and status"; after/phase-3/CHIP_MAP.md in wgit-platform-pm):
   one chip family. Every badge, chip and status mark keeps its class name and takes one
   shape -- a 23 px pill, 12 px / 650, sentence case (the --chip-* tokens) -- and the colour
   of what it means where it is used:
     Draft, Waiting, Approval  amber   --warn on --warn-tint
     Running, Open             blue    --accent-text on --accent-tint
     Done                      green   --good on --good-tint
     Late                      rose    --problem on --problem-tint
     AI drafted                violet  --ai on --ai-tint
     Outside, neutral          grey    --text-2 on --line (a grey that shows on the page and on a card)
   The words always say the state; the colour is never the only sign. A plain .badge is
   neutral. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    background: var(--line);
    color: var(--text-2);
}

/* neutral */
.badge--not-started {
    background: var(--line);
    color: var(--text-2);
}

/* coder-635 (D423 §3): an archived SOP named by work that still points at it. Neutral. */
.badge--archived {
    background: var(--line);
    color: var(--text-2);
}

/* Running (a started task, "Claimed by"). */
.badge--in-progress {
    background: var(--accent-tint);
    color: var(--accent-text);
}

/* Done (complete, answered, from your text, let through, on). */
.badge--complete {
    background: var(--good-tint);
    color: var(--good);
}

/* Approval: its one use is a project task's "Approval" (projects/detail.html). */
.badge--admin {
    background: var(--warn-tint);
    color: var(--warn);
}

/* Waiting / needs you: colours match .flash--warning so the amber "needs attention"
   treatment is consistent between flash messages and pills. --warn ("To price", "Choose
   a task", "Unpublished changes", a stale count) is the same. An Overdue badge
   (`data-overdue`) is Late. */
.badge--warning,
.badge--warn {
    background: var(--warn-tint);
    color: var(--warn);
}

.badge--warning[data-overdue] {
    background: var(--problem-tint);
    color: var(--problem);
}

/* coder-696: Late by its own class (the homes' overdue rows, the workflow header's
   Overdue). */
.badge--late {
    background: var(--problem-tint);
    color: var(--problem);
}

/* Running: a broadcast that is showing now ("active", wgit_admin/broadcasts.html). */
.badge--success {
    background: var(--accent-tint);
    color: var(--accent-text);
}


/* --- Catalog cache staleness indicator (P215, Wave 14 Task .6) --- */
/* The V3-catalog staleness badge/banner the admin context processor injects
   into the admin base layout (CATALOG_V3_CLIENT_SYNC.md v1.2 "Admin UI surfaces
   staleness"). Grouped here so the two `.badge--catalog-*` modifiers sit beside
   the `.badge` base above. Colours via classes only (no inline styles); the copy
   informs without alarming (spec: "should not panic the admin, just inform"). */
.catalog-staleness {
    max-width: var(--container-medium);
    margin: 0 auto var(--space-4);
}

/* Aging / stale: an inline badge row (badge + optional last-sync detail). */
.catalog-staleness--bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-6);
}

.catalog-staleness__detail {
    font-size: var(--text-sm);
    color: var(--text-2);
}

/* Aging -> yellow info badge (the amber info treatment, cf. .badge--in-progress). */
.badge--catalog-aging {
    background: var(--warn-tint);
    color: var(--warn);
}

/* Stale -> orange warning badge. */
.badge--catalog-stale {
    background: var(--problem-tint);
    color: var(--problem);
}

/* Critical -> red banner across the admin UI. Muted bordered fill: it informs,
   it does not panic (spec). */
.catalog-staleness--critical {
    padding: var(--space-3) var(--space-5);
    border: 1px solid var(--problem);
    border-radius: var(--radius-card);
    background: var(--problem-tint);
    color: var(--problem);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.5;
}

/* Never-synced -> neutral "first sync pending" banner (cf. .flash--info). */
.catalog-staleness--pending {
    padding: var(--space-3) var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--accent-tint);
    color: var(--text);
    font-size: var(--text-sm);
    line-height: 1.5;
}


/* --- Icons --- */

/* The sprite itself (core/_shell_sprite.html, at the top of every page's body) takes no room. */
.shell-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* coder-693 (D450 Phase 3a, design §5 "Icons"): an icon from the app-wide sprite
   (core/_shell_sprite.html, drawn once on every page; macros/icons.html `icon`): 1.8 px round
   strokes in currentColor, sized to the text it sits in, 18 px where it stands alone. It is
   always aria-hidden: the words beside it say what the link or button does. */
.icon {
    display: inline-block;
    flex: none;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--18 {
    width: 18px;
    height: 18px;
}

/* An arrow before a back link's words (--lead), or after a forward link's (--trail), sits a
   little apart; in a flex row with its own gap (a button, a breadcrumb) the gap does it. */
.icon--lead {
    margin-right: 0.3em;
}

.icon--trail {
    margin-left: 0.3em;
}

.btn > .icon,
.breadcrumb > .icon {
    margin: 0;
}

/* --- Breadcrumbs --- */

.breadcrumb {
    font-size: 0.78125rem;  /* coder-696: the page header's breadcrumb, 12.5 px */
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.breadcrumb:hover {
    color: var(--accent-text);
    text-decoration: underline;
}


/* --- Buttons --- */

/* coder-456: one button system for every button-like element in the app.
   coder-693 (D450 Phase 3a, design §5 "Buttons"): Direction 1's treatment. Two sizes --
   36 px, and 32 px (.btn--sm) for table rows and dense cards; padding fits the label.
   The control radius, 600 weight, sentence case, normal letter-spacing, and no
   text-transform, set here so a button never inherits one from a heading or an eyebrow
   it sits in. An icon beside the label sits in the button's 8 px gap. Hierarchy:
     primary    filled with --accent, with its soft blue glow (--accent-glow);
     secondary  white (--card) with a --line edge and --text label;
     tertiary   text only, for minor actions;
     success    filled with --good: Approve (coder-693), beside --primary on the button;
     danger     rose-washed, a faint rose line and a leading icon (coder-658:
                Cancel workflow, Remove, Delete, Revoke, Archive).
   At most one primary per action group. Hover, keyboard focus and disabled states
   each keep WCAG AA contrast against the surface the button sits on. */
.btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 36px;
    padding: 0 var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--accent-text);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: normal;
    text-transform: none;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 150ms ease-out, border-color 150ms ease-out,
                color 150ms ease-out, box-shadow 150ms ease-out;
}

/* `display: inline-flex` above would beat the UA `[hidden] { display: none }` rule,
   so a button the JS reveals later would show from the start. */
.btn[hidden] {
    display: none;
}

/* A <summary> styled as a button drops its disclosure marker. */
summary.btn {
    list-style: none;
}

summary.btn::-webkit-details-marker {
    display: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--accent-glow);
}

.btn--primary:hover {
    background: color-mix(in srgb, var(--accent) 80%, var(--text));
    border-color: color-mix(in srgb, var(--accent) 80%, var(--text));
    color: var(--on-accent);
}

/* coder-693: white with a --line edge (design §5), the edge firming on hover. */
.btn--secondary {
    background: var(--card);
    border-color: var(--line);
    color: var(--text);
}

.btn--secondary:hover {
    background: var(--fill);
    border-color: var(--line-strong);
    color: var(--text);
}

.btn--tertiary {
    background: transparent;
    border-color: transparent;
    color: var(--accent-text);
    padding: 0 var(--space-3);
}

.btn--tertiary:hover {
    background: var(--accent-tint);
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* coder-295 defined .btn--danger; coder-658 (fix queue 7, Michael's mockup E) makes it a
   red-washed button: --problem-tint ground, a 1.5 px line of --problem at 40 %, --problem
   text (AA on its ground, light and dark), the standard shape and padding, and a leading
   icon (`macros/icons.html` `danger_icon`). Hover brings the line to full --problem; no
   underline; the focus ring is every button's. Declared after .btn--secondary so it wins
   when both classes meet on one button. */
.btn--danger {
    background: var(--problem-tint);
    border-color: color-mix(in srgb, var(--problem) 40%, transparent);
    color: var(--problem);
}

.btn--danger:hover {
    background: var(--problem-tint);
    border-color: var(--problem);
    color: var(--problem);
    text-decoration: none;
}

/* coder-693 (design §5): Approve. Green with the --on-accent label (white in light, the
   navy ink on dark's light green); written as `btn btn--primary btn--success`, so it is
   still the group's one primary, and declared after --primary so it wins. */
.btn--success {
    background: var(--good);
    border-color: var(--good);
    color: var(--on-accent);
    box-shadow: none;
}

.btn--success:hover {
    background: color-mix(in srgb, var(--good) 80%, var(--text));
    border-color: color-mix(in srgb, var(--good) 80%, var(--text));
    color: var(--on-accent);
}

/* A button's icon (the danger icon, or a sprite icon beside the label): 16 px, 14 px on
   a small button; never squeezed. */
.btn__icon {
    flex: none;
    width: 16px;
    height: 16px;
}

.btn--sm .btn__icon {
    width: 14px;
    height: 14px;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn--sm .icon {
    width: 14px;
    height: 14px;
}

/* Disabled: the label stays readable (--text-2 on --line and on --ground); the button
   just stops looking pressable. */
.btn:disabled,
.btn[aria-disabled="true"] {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text-2);
    cursor: not-allowed;
    text-decoration: none;
    box-shadow: none;
}

.btn--primary:disabled,
.btn--primary[aria-disabled="true"] {
    background: var(--line);
    border-color: var(--line);
}

.btn--secondary:disabled,
.btn--secondary[aria-disabled="true"] {
    background: var(--card);
    border-color: var(--line);
}

.btn--tertiary:disabled {
    border-color: transparent;
}

/* coder-235 -- compact size modifier, usable on any .btn variant: 32 px, for table
   rows and dense cards. Declared after the variants so it also overrides their own
   padding, keeping --sm the same size whatever it is paired with. */
.btn--sm {
    min-height: 32px;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
}

/* coder-456: buttons that belong together. One horizontal row, 8 px apart, that
   wraps on a narrow screen and keeps the gap; never stacked flush. A table row's
   group is right-aligned (.action-group--end) and uses .btn--sm. */
.action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.action-group--end {
    justify-content: flex-end;
}

.action-group > form {
    display: flex;
    margin: 0;
}


/* --- Card (surface for forms and content blocks) --- */
/* coder-694 (D450 Phase 3b; design §5 "Cards"): one card treatment -- `--card` on a 14 px
   radius, a `--line` edge and the `--shadow` lift (dark: no shadow, the edge alone) -- on
   every shared card class (`.card`, `.action-card`, `.stat-card`, `.admin-card-list__row`,
   `.vc-card`, `.task-card`; `.home-tile`, `.home-attention` and `.snm-card` in their sheets).
   Cards are for groups that stand alone; what a card holds is
   never another card (below). */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: var(--space-6);
}

/* Never cards in cards. Inside a card, a grid of figures (`.stat-grid` of `.stat-card`s,
   a project's money) is the card's own divided rows, and an approval's decision form
   (`_decision_form.html`, always drawn inside a card) is a part of the card, a hairline
   under it. A page that nests a whole card in a card is Phase 4's to recompose. */
.card .stat-grid {
    column-gap: var(--space-5);
    row-gap: 0;
}

.card .stat-card {
    padding: var(--space-4) 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.card .workflow-decision {
    padding: 0 0 var(--space-5);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.data-table .workflow-decision {
    padding: 0;
    border: 0;
}


/* --- Cards --- */

.action-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: var(--space-6);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-height: 160px;
    transition: all 200ms ease-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
    transform: translateY(-2px);
    color: inherit;
}

.action-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.action-card--featured {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    grid-column: 1 / -1;
    min-height: 180px;
}

.action-card--featured:hover {
    background: color-mix(in srgb, var(--accent) 88%, var(--on-accent));
    border-color: var(--accent);
    color: var(--on-accent);
}

.action-card--featured .card-eyebrow {
    color: var(--accent-text);
}

/* Required because the global h1-h3 rule (color: --text) wins over
   the --on-accent colour inherited from the featured card. Without this the
   title renders near-invisible on the navy background. */
.action-card--featured .card-title {
    color: var(--on-accent);
}

.action-card--featured .card-meta {
    color: color-mix(in srgb, var(--on-accent) 75%, transparent);
}

.action-card--featured .card-description {
    color: color-mix(in srgb, var(--on-accent) 88%, transparent);
}

.action-card--featured .card-cta {
    color: var(--on-accent);
}

.card-eyebrow {
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-text);
    font-weight: 600;
}

.card-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: var(--leading-snug);
    letter-spacing: -0.005em;
}

.card-description {
    font-size: 0.9375rem;
    color: var(--text-2);
    line-height: 1.55;
    margin-top: auto;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    color: var(--text-2);
    margin-top: var(--space-2);
}

/* coder-599: a Hotel Admin Settings card's one-line state ("Controller: not set"). */
.card-state {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--accent-text);
    margin-top: auto;
}

.card-cta::after {
    content: '\2192';
    transition: transform 200ms ease-out;
}

.action-card:hover .card-cta::after {
    transform: translateX(4px);
}


/* --- Form Actions (submit row at the bottom of a form) --- */

/* coder-456: an action group -- one row, 8 px apart, wrapping on a narrow screen --
   and 24 px below the form's last field (the last .form-group's 16 px bottom margin
   collapses into this one). */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

/* coder-435's wrapping row; every .form-actions wraps since coder-456, so this
   modifier only names the intent where it was already used. */
.form-actions--wrap {
    flex-wrap: wrap;
}

.form-help {
    font-size: var(--text-sm);
    color: var(--text-2);
    margin-top: var(--space-5);
}


/* --- Eyebrow (page-level) --- */

.eyebrow {
    font-size: var(--text-xs);
    color: var(--accent-text);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.eyebrow::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--accent);
}


/* --- Flash Messages --- */

.flash-messages {
    max-width: var(--container-medium);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.flash {
    position: relative;
    padding: var(--space-3) var(--space-5) var(--space-3) calc(var(--space-4) + 16px + var(--space-2));
    border-radius: var(--radius-card);
    font-size: var(--text-sm);
    line-height: 1.5;
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
}

/* coder-695 (D450 Phase 3c, design §5 "Empty, loading, error"): a message takes the chip
   family's colours for what it says -- done green, a problem rose, needs-you amber, a note
   blue (the Running / Open family) -- and an icon before its words, so it is read without
   its colour: a ring with a tick, an exclamation mark, a warning triangle, an "i". The
   icon is a mask in currentColor, as .form-error's; a link inside takes the message's
   colour and keeps its underline. */
.flash::before {
    content: '';
    position: absolute;
    top: calc(var(--space-3) + 0.15em);
    left: var(--space-4);
    width: 16px;
    height: 16px;
    background: currentColor;
}

.flash a {
    color: inherit;
    text-decoration: underline;
}

.flash--success {
    background: var(--good-tint);
    color: var(--good);
}

.flash--success::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm4.6 6.4-6 6.2-3.2-3.1-1.6 1.7 4.8 4.6 7.6-7.8z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm4.6 6.4-6 6.2-3.2-3.1-1.6 1.7 4.8 4.6 7.6-7.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.flash--error {
    background: var(--problem-tint);
    color: var(--problem);
}

.flash--error::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.flash--info {
    background: var(--accent-tint);
    color: var(--accent-text);
}

.flash--info::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 8v7h2.5v-7zm0-4v2.5h2.5V6z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 8v7h2.5v-7zm0-4v2.5h2.5V6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.flash--warning {
    background: var(--warn-tint);
    color: var(--warn);
}

.flash--warning::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2.5 22.5 21h-21zm-1.25 6.5v6h2.5V9zm0 7.5V19h2.5v-2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2.5 22.5 21h-21zm-1.25 6.5v6h2.5V9zm0 7.5V19h2.5v-2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* coder-698 (D450 Phase 4c, the prototype's drafted steps): what the assistant just
   drafted says so in its violet, with the sparkle before its words -- the wizards' "The
   assistant drafted the steps…" and its kin (the `ai` category). */
.flash--ai {
    background: var(--ai-tint);
    color: var(--ai);
    font-weight: 600;
}

.flash--ai::before {
    -webkit-mask: var(--icon-sparkle) center / contain no-repeat;
    mask: var(--icon-sparkle) center / contain no-repeat;
}

/* A category the app does not name draws no icon, and keeps the plain padding. */
.flash:not(.flash--success):not(.flash--error):not(.flash--info):not(.flash--warning):not(.flash--ai) {
    padding-left: var(--space-5);
}

.flash:not(.flash--success):not(.flash--error):not(.flash--info):not(.flash--warning):not(.flash--ai)::before {
    content: none;
}

/* coder-695: three error lines no rule styled -- a dashboard's (`.error-message`), WGIT
   Admin's form error (`.alert--error`) and a vendor's follow-up error (`.text-error`) --
   take the error's rose and its icon. */
.error-message,
.alert--error {
    position: relative;
    padding: var(--space-3) var(--space-5) var(--space-3) calc(var(--space-4) + 16px + var(--space-2));
    border-radius: var(--radius-card);
    background: var(--problem-tint);
    color: var(--problem);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.error-message::before,
.alert--error::before {
    content: '';
    position: absolute;
    top: calc(var(--space-3) + 0.15em);
    left: var(--space-4);
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.text-error {
    color: var(--problem);
    font-weight: 600;
}

.text-error::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: var(--space-1);
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* coder-665 (D430): the demo hotel's one line at the top of every page on its host. */
.demo-banner {
    background: var(--warn-tint);
    border-bottom: 1px solid var(--brass);
    color: var(--warn);
    font-size: var(--text-sm);
    line-height: 1.5;
    padding: var(--space-2) var(--space-4);
    text-align: center;
}

/* coder-305: the Operations edge-provisioning script's captured stdout, flashed
   inline on the page (§2.2 "Inline output on the page"). Reuses `.flash`'s base
   styling; only adds what raw multi-line script output needs that a one-line
   message doesn't -- preserved line breaks and a monospace face. */
.flash--edge-output {
    background: var(--fill);
    border-color: var(--line);
    color: var(--text);
    white-space: pre-wrap;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: var(--text-xs, 0.8rem);
}


/* --- Empty state (coder-695, D450 Phase 3c; design §5 "Empty, loading, error") --- */
/* The one empty pattern, `macros/empty.html`: a 34 px icon tile from the sprite, the page's
   own line, at most one action. The tile is neutral (the neutral chip's grey, which shows
   on the page and on a card): an empty list is not an action, and colour means something.
   It sits in its card or section as a row, never a box of its own (never cards in cards). */
.empty-state {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin: 0;
    padding: var(--space-2) 0;
    color: var(--text-2);
}

/* `display: flex` above would beat the UA `[hidden]` rule (a filter's "No one matches"). */
.empty-state[hidden] {
    display: none;
}

.empty-state__tile {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-control);
    background: var(--line);
    color: var(--text-2);
}

.empty-state__tile .icon {
    width: 18px;
    height: 18px;
}

/* coder-696 (D450 Phase 4a; design §5 "Icon tiles"): an icon from the sprite on a rounded
   square of its colour's tint -- 34 px in a row, 42 px on a tile. The tone says what the
   thing is: blue work and actions, amber waiting on someone or an approval, rose late,
   green done, teal people, equipment and the like. Decorative: the words beside it name
   the thing. */
.icon-tile {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-control);
    background: var(--accent-tint);
    color: var(--accent);
}

.icon-tile .icon {
    width: 18px;
    height: 18px;
}

.icon-tile--lg {
    width: 42px;
    height: 42px;
    border-radius: 11px;
}

.icon-tile--lg .icon {
    width: 20px;
    height: 20px;
}

.icon-tile--blue { background: var(--accent-tint); color: var(--accent); }
.icon-tile--green { background: var(--good-tint); color: var(--good); }
.icon-tile--amber { background: var(--warn-tint); color: var(--warn); }
.icon-tile--rose { background: var(--problem-tint); color: var(--problem); }
.icon-tile--teal { background: var(--teal-tint); color: var(--teal); }
.icon-tile--violet { background: var(--ai-tint); color: var(--ai); }

.empty-state__text {
    flex: 1 1 16rem;
    min-width: 0;
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--text-2);
}

.empty-state__action {
    flex: none;
}

/* A section's or a card's heading, or a lede, is never flush on the empty line under it. */
* + .empty-state {
    margin-top: var(--space-2);
}

/* --- Loading: the skeleton row and a busy button (coder-695; design §5) --- */
/* A placeholder the page already shows while a script loads a list ("Loading folder
   options...") is drawn as a skeleton row: a mark and a bar in the neutral grey, 44 px
   like a row. Its words stay in the page for a screen reader (the list is a live region)
   and are not painted. The bars pulse, and hold still under reduced motion. */
.skeleton-row {
    position: relative;
    display: block;
    height: 44px;
    margin: 0;
    overflow: hidden;
    color: transparent;
    user-select: none;
}

.skeleton-row::before,
.skeleton-row::after {
    content: '';
    position: absolute;
    top: 50%;
    border-radius: var(--radius-pill);
    background: var(--line);
    transform: translateY(-50%);
    animation: skeletonPulse 1.4s ease-in-out infinite;
}

.skeleton-row::before {
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 5px;
}

.skeleton-row::after {
    left: 30px;
    width: min(60%, 320px);
    height: 12px;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* A button whose script is waiting on the server (`aria-busy="true"`, set and cleared by
   the script that already waits): a turning ring after its words, and the progress cursor.
   Under reduced motion the ring holds still; it is still there. */
.btn[aria-busy="true"] {
    cursor: progress;
}

.btn[aria-busy="true"]::after {
    content: '';
    flex: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btnBusy 0.8s linear infinite;
}

@keyframes btnBusy {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-row::before,
    .skeleton-row::after,
    .btn[aria-busy="true"]::after {
        animation: none;
    }
}

/* --- Dialogs and drawers (coder-695, D450 Phase 3c; design §4, §5) --- */
/* One treatment for what opens over the page. A dialog (the native <dialog>, opened with
   showModal(): the image lightbox and the SOP image editor) is a --card panel with the
   20 px --radius-panel and --shadow-raised over a --scrim; its header is the bar at its
   top that holds its close button. A drawer is a panel down the right of the page for a
   detail view (S&M's data views), over the same scrim, its open side rounded. Dark: no
   shadow; the panel carries a --line edge (--float-edge). */
.dialog {
    padding: 0;
    border: 0;
    border-radius: var(--radius-panel);
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow-raised);
    outline: var(--float-edge);
    outline-offset: -1px;
    overflow: hidden;
}

.dialog::backdrop {
    background: var(--scrim);
}

.dialog__header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 56px;
    padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.dialog__close {
    margin-left: auto;
}

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

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 51;
    width: min(780px, 100vw);
    height: 100vh;
    overflow-y: auto;
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-panel) 0 0 var(--radius-panel);
    box-shadow: var(--shadow-raised);
    outline: var(--float-edge);
    outline-offset: -1px;
}

/* --- Footer --- */

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: var(--space-6) 0;
    margin-top: var(--space-12);
}

.footer-inner {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.footer-text {
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* D401: the WG mark, white on the dark footer. */
.footer-mark {
    display: block;
    height: 16px;
    width: auto;
}

.footer-brand-text {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}


/* --- Forms --- */

/* coder-456: 16 px between form groups. */
.form-group {
    margin-bottom: var(--space-4);
}

/* coder-693 (D450 Phase 3a, design §5 "Fields"): labels 12.5 px / 650 in --text-2. */
.form-label {
    display: block;
    font-size: 0.78125rem;
    font-weight: 650;
    color: var(--text-2);
    margin-bottom: var(--space-2);
}

/* coder-458: a `<legend class="form-label">` reads as the labels beside it (Title,
   Description), not in the bare `legend` rule's display face. */
legend.form-label {
    font-family: var(--font-body);
    padding: 0;
}

/* coder-693 (D450 Phase 3a, design §5 "Fields"): 40 px fields with the field radius, a blue
   border and a 4 px --focus-ring halo on focus. The resting edge stays --line-strong, the
   control-border token held to 3:1 (design §2, §7; tools/token_contrast.py), not §5's
   decorative --line: a field's edge is how it is seen as a field. */
.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    min-height: 40px;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-field);
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading);
    color: var(--text);
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--text-2);
}

/* coder-236 -- compact size modifier for .form-input, applied alongside the base
   class (e.g. class="form-input form-input--sm") so :focus/:placeholder/border
   rules keyed on .form-input still apply. One padding step and one type-scale
   step down from the base .form-input, mirroring the .btn -> .btn--sm relationship. */
.form-input--sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}

/* coder-458: small fields are 32 px tall, the height of the .btn--sm beside them; the
   height covers the borders. Paired with .form-select--sm (coder-237) below. A list
   box (`multiple`, or a `size` above one) keeps its rows. */
.form-input--sm:not(textarea),
.form-select--sm:not([multiple], [size]:not([size="1"])) {
    height: 32px;
    min-height: 32px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1.25;
}

/* The `display: block` above beats the UA `[hidden] { display: none }` rule, so a
   textarea the JS hides via the `hidden` attribute (the composer's steps-JSON source)
   would stay visible. Scope the override to `.form-textarea[hidden]` -- lowest blast
   radius -- so `hidden` wins for this control (CODER-057 §D Fix 1). */
.form-textarea[hidden] {
    display: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-2);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* D401: the chevron is drawn from two gradients in --text-2, so it follows the tokens
   (a data-URI SVG would have to write its colour). */
.form-select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
        linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
    background-repeat: no-repeat;
    background-position: calc(100% - 22px) 55%, calc(100% - 17px) 55%;
    background-size: 5px 5px, 5px 5px;
    padding-right: var(--space-8);
}

/* coder-693 (design §5 "Empty, loading, error"; §7): an error is said in rose with an
   icon before it, so it is seen without its colour. The icon is a mask in currentColor
   (a ring with an exclamation mark cut out); the words carry the meaning. */
.form-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--problem);
    margin-top: var(--space-1);
}

.form-error::before {
    content: '';
    flex: none;
    width: 14px;
    height: 14px;
    margin-top: 0.15em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1.25 5v7h2.5V7zm0 9v2.5h2.5V16z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* coder-1100: `display: flex` above would beat the UA `[hidden]` rule (the task SOP's line
   for an assignee who cannot open it, shown only while that is so). */
.form-error[hidden] {
    display: none;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-2);
    margin-top: var(--space-1);
}

/* coder-926 (D562 rule 1, D563 rule 1): a box's limit and its live count ("1,240 of
   10,000"), drawn by the server (text_limits.text_count) or by text_limit.js under the box.
   Over the limit it reads as an error, with the box's own error edge (aria-invalid). */
.text-count {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-2);
    margin: var(--space-1) 0 0;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.text-count--over {
    color: var(--problem);
    font-weight: 600;
}

/* coder-458: a standalone hint paragraph (a card's intro) sits the usual 16 px above
   the field group after it, as the groups sit from each other. */
p.form-hint + .form-group {
    margin-top: var(--space-4);
}

/* The key hint under an agent compose box (coder-146).
 *
 * It lives HERE and not in agent.css deliberately: agent.css is linked by three
 * templates, but the floating "Ask IT" widget is injected from base.html on EVERY
 * page, so a hint styled there would be unstyled almost everywhere it renders.
 *
 * --text-2: AA on --card and --ground (D401's contrast test checks it). Still muted,
 * still quieter than the button, and actually readable.
 *
 * No `display` is set, so the UA's `[hidden] { display: none }` stands unopposed
 * (the trap .form-textarea documents above) -- the server renders this element
 * hidden and agent_compose.js unhides it only where Enter-to-send really bound.
 * All three compose forms are `flex-direction: column` with a `gap`, so the
 * spacing is the container's; a margin here would double it. */
.compose-hint {
    font-size: var(--text-xs);
    color: var(--text-2);
    margin: 0;
}

/* Radio and checkbox groups */
.form-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
}

.form-option input[type="radio"],
.form-option input[type="checkbox"] {
    margin-top: 0.2em;
    accent-color: var(--accent);
    flex-shrink: 0;
}

/* coder-693 (design §5 "Fields"): every checkbox and radio takes the accent, 16 px, with the
   focus halo the fields have. */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.form-option label {
    font-size: var(--text-base);
    color: var(--text);
    line-height: 1.5;
    cursor: pointer;
}

/* Input in error state. coder-693: a 2 px rose edge (a heavier line, not only a different
   colour) and the error line with its icon under it; aria-invalid fields the same. */
.form-input--error,
.form-select--error,
.form-textarea--error,
.form-input[aria-invalid="true"],
.form-select[aria-invalid="true"],
.form-textarea[aria-invalid="true"] {
    border-color: var(--problem);
    box-shadow: inset 0 0 0 1px var(--problem);
}

.form-input--error:focus,
.form-select--error:focus,
.form-textarea--error:focus {
    border-color: var(--problem);
    box-shadow: inset 0 0 0 1px var(--problem), 0 0 0 4px var(--focus-ring);
}

@keyframes formShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.form-group--error {
    animation: formShake 300ms ease-out;
}

/* Checkbox panel (coder-259, onboarding/CHECKBOX_PANEL_DESIGN.md) -- the onboarding
   selection lists (assignable items, internal items, shared folders, email groups) and any
   other user of the retired .form-checkbox-list / .form-checkbox-item / .form-select-all
   classes. coder-698 (D450 Phase 4c): clean checkbox rows in the section's card, divided by
   hairlines -- no inset panel, no tinted head -- the count and Select all on the line above
   them. Colours are the role tokens. */
.form-checkbox-panel {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--card);
}

.form-checkbox-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--line);
}

.form-checkbox-panel__count {
    display: inline-flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: var(--space-1) var(--space-3);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text);
}

.form-checkbox-panel__select-all {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.form-checkbox-panel .form-hint {
    padding: var(--space-3) 0;
    margin: 0;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 44px;
    padding: var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--line);
    font-size: var(--text-base);
    cursor: pointer;
}

.form-checkbox:last-child {
    border-bottom: none;
}

.form-checkbox:has(input:checked) {
    background: var(--accent-tint);
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

/* coder-698: a single checkbox in a settings form (`.form-field > .form-checkbox`, the
   Union / Leader switch) is a line of its own, not a list's row. */
.form-field > .form-checkbox {
    min-height: 0;
    padding: 0;
    border-bottom: 0;
}

.form-field > .form-checkbox:has(input:checked) {
    background: none;
}

/* coder-698 (D450 Phase 4c): `.form-field` and `.form-note` -- the settings pages' and the
   offboarding form's field and its note -- had no rule, so their fields ran together. A
   field takes a form group's room; a note a hint's words. */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.form-field > .form-label,
.form-field > fieldset > .form-label {
    margin-bottom: 0;
}

.form-field > .form-input + .form-label,
.form-field > datalist + input[type="hidden"] + .form-label,
.form-field > fieldset + .form-label {
    margin-top: var(--space-3);
}

.form-note {
    margin: 0;
    font-size: var(--text-sm);
    line-height: var(--leading);
    color: var(--text-2);
}

.form-note + .form-field,
.form-note + .form-actions {
    margin-top: var(--space-5);
}

/* coder-698 (D450 Phase 4c): New Hire Onboarding's choices -- Remote access, the laptop,
   the desk, the phone, Urgency, Union / Leader -- as a row of options a finger can hit,
   the chosen one in the blue tint, not a stack of bare radios. The radios and their
   labels are as they were. */
#onboarding-form fieldset:has(> .form-option) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

#onboarding-form fieldset > .form-label,
#onboarding-form fieldset > .form-hint {
    flex-basis: 100%;
}

#onboarding-form fieldset > .form-option {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    margin: 0;
    padding: 0 0 0 var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--card);
}

#onboarding-form fieldset > .form-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-tint);
}

#onboarding-form fieldset > .form-option:has(input:checked) label {
    color: var(--accent-text);
    font-weight: 600;
}

#onboarding-form fieldset > .form-option input {
    margin: 0;
}

/* The label fills the rest of the option, so the whole box answers a tap; the radio keeps
   its own place at the start. */
#onboarding-form fieldset > .form-option label {
    display: flex;
    align-items: center;
    align-self: stretch;
    padding-right: var(--space-4);
}


/* --- Header --- */

/* D401 (WGIT_LOOK_DESIGN.md §3), D450 (coder-689): one header on both hosts -- the ITOps
   App mark, "ITOps App", a thin divider, then the organization's name (or "WGIT Admin") in
   --text-2. No organization's logo. */
.site-header {
    background: var(--header-bg);
    color: var(--header-text);
    border-bottom: 1px solid var(--line);
    padding: var(--space-4) 0;
}

.header-inner {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.brand:hover {
    color: inherit;
}

/* D450: the ITOps App mark, blue; --logo-filter draws it white on the dark header. */
.app-mark {
    display: block;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    filter: var(--logo-filter);
}

/* The WG mark, black; --mark-filter draws it white on a dark ground (design §9). */
.brand-mark {
    display: block;
    flex-shrink: 0;
    height: 20px;
    width: auto;
    filter: var(--mark-filter);
}

.brand-app {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 750;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: var(--header-text);
    white-space: nowrap;
}

.brand-divider {
    flex-shrink: 0;
    width: 1px;
    height: 20px;
    background: var(--line);
}

.brand-name {
    min-width: 0;
    overflow: hidden;
    font-size: var(--text-base);
    color: var(--text-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* coder-731: WGIT Admin's header search (wgit_admin/_base.html), the app's component
   (shell_search.css) in the place the Hybrid shell's header gives it: after the brand, up
   to 420 px; on a phone, a row of its own under the top bar (below). */
.site-header__search {
    flex: 0 1 420px;
    min-width: 0;
    margin-right: auto;
}

/* The hotel paused page's header strip (auth/suspended.html): the same brand, not a
   link, and nothing beside it. */
.brand--static {
    cursor: default;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--text-sm);
}

.user-name {
    color: var(--text-2);
}

.user-name strong {
    color: var(--text);
    font-weight: 500;
}

.logout-link,
.site-header__help {
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.logout-link:hover,
.site-header__help:hover {
    text-decoration: underline;
}

/* --- The appearance choice (coder-570, D401 §6, WGIT_LOOK_DESIGN.md §9) ---
   Automatic / Light / Dark, the pressed one filled with the accent, on a pill track. In the
   shell's person menu its targets are 44 px. In the header's account area outside the shell
   they are the header's 40 px (coder-456's control heights), and the label is for screen
   readers only. */
.appearance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
}

.appearance__label {
    color: var(--text-2);
    font-size: var(--text-sm);
}

.appearance__choices {
    display: inline-flex;
    gap: var(--space-2);
    padding: var(--space-1);
    background: var(--fill);
    border-radius: var(--radius-pill);
}

.appearance__choice {
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-2);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
}

.appearance__choice:hover {
    color: var(--accent-text);
}

.appearance__choice[aria-pressed="true"] {
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
}

.appearance__choice:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.appearance__status:empty {
    display: none;
}

.appearance__status {
    flex-basis: 100%;
    color: var(--problem);
    font-size: var(--text-sm);
}

.appearance--header .appearance__choice {
    min-width: 40px;
    min-height: 40px;
}

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

/* --- The person's own task mirrors (coder-718, D464 §1) ---
   The Outlook calendar and Microsoft To Do switches, under the appearance choice in the
   person's menu. Each a role="switch" button: a 44 px target around a pill track, the knob
   to the right and the track filled with the accent when on. Turning one off opens a
   confirm under it on a --fill ground: what will be removed, Turn off and Keep it on. */
.task-mirrors {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.task-mirrors__label {
    margin: 0;
    color: var(--text-2);
    font-size: var(--text-sm);
}

.task-mirrors__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.task-mirror__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

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

.task-mirror__name {
    font-size: var(--text-sm);
    font-weight: 600;
}

.task-mirror__hint {
    color: var(--text-2);
    font-size: var(--text-xs);
    line-height: 1.4;
}

.task-mirror__switch {
    position: relative;
    flex: none;
    width: 52px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    cursor: pointer;
}

.task-mirror__switch::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 4px;
    box-sizing: border-box;
    width: 44px;
    height: 24px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--fill);
}

.task-mirror__knob {
    position: absolute;
    top: 14px;
    left: 8px;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-pill);
    background: var(--line-strong);
    transition: left 0.15s ease;
}

.task-mirror__switch[aria-checked="true"]::before {
    border-color: var(--accent);
    background: var(--accent);
}

.task-mirror__switch[aria-checked="true"] .task-mirror__knob {
    left: 28px;
    background: var(--on-accent);
}

.task-mirror__switch:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 0;
}

.task-mirror__switch[aria-busy="true"] {
    cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
    .task-mirror__knob {
        transition: none;
    }
}

.task-mirror__confirm {
    margin-top: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-control);
    background: var(--fill);
}

.task-mirror__confirm[hidden] {
    display: none;
}

.task-mirror__warning {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.task-mirrors__status:empty {
    display: none;
}

.task-mirrors__status {
    color: var(--text-2);
    font-size: var(--text-sm);
}

.task-mirrors__status.is-error {
    color: var(--problem);
}

/* coder-718 (D464 §3): a confirm that opens under its button, with no script -- a <details>
   whose <summary> is drawn as the button (WGIT Admin's "Turn the calendar on" where people
   will move from To Do). The panel says what will happen and holds the real submit. */
.confirm-reveal > summary {
    list-style: none;
    width: fit-content;
}

.confirm-reveal > summary::-webkit-details-marker {
    display: none;
}

.confirm-reveal__panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    max-width: 64ch;
    margin-top: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--fill);
}

.confirm-reveal__panel p {
    margin: 0;
}

/* coder-548: the pin button's short label shows only on the narrowest phones, where the
   header would otherwise not keep one line. */
.pin-button__short {
    display: none;
}

@media (max-width: 359px) {
    .pin-button__long {
        display: none;
    }

    .pin-button__short {
        display: inline;
    }
}


/* --- Sign-in (D401 §3, D450) --- */

/* The ITOps App mark above the title; White Glove IT, the maker, with its WG mark below. */
.signin-logo {
    display: block;
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    filter: var(--logo-filter);
}

.signin-maker {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-2);
}

.signin-mark {
    display: block;
    height: 16px;
    width: auto;
    filter: var(--mark-filter);
}

.signin-hotel {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-2);
}


/* --- Page Title --- */

/* D450 (design §3): a page title is 25 px / 750 with slight negative tracking (20 px
   on a phone), not a display serif; the lede under it reads as a subtitle. */
.page-title {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 1rem + 1.5vw, var(--text-3xl));
    font-weight: 750;
    line-height: var(--leading-tight);
    letter-spacing: -0.016em;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.page-lede {
    font-size: var(--text-base);
    line-height: var(--leading);
    color: var(--text-2);
}


/* --- Progress Bar (assessment screens) --- */

/* coder-693 (D450 Phase 3a, design §5 "Progress"): a 6 px rounded bar, its count in the
   label beside it (.progress-label). */
.progress-bar {
    background: var(--line);
    height: 6px;
    width: 100%;
    position: relative;
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar__fill {
    background: var(--accent);
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 300ms ease-out;
}

.progress-label {
    font-size: var(--text-sm);
    color: var(--text-2);
    padding: var(--space-2) var(--space-6);
}


/* --- Rating Tool (assessment question tiles, coder-215) --- */

.rating-tool__name {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 650;
    color: var(--accent-text);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--space-4);
}

.rating-question {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-4);
}

.rating-question:last-child {
    margin-bottom: 0;
}

.rating-question__label {
    display: block;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-3);
}

.rating-question__sublabel {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-2);
    margin-bottom: var(--space-2);
}

.rating-question__learn-more {
    border-top: 1px solid var(--fill);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
}

/* Answer tiles: equal-width rectangular tiles for the primary comfort/
   proficiency answer row (replaces the old comfort-bubble and frequency-pill
   idioms for that row only). The learn-more axis keeps the .freq-option pill
   treatment (below) unchanged. */
.answer-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-2);
}

.tile-option {
    position: relative;
}

.tile-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tile-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--card);
    padding: 14px 10px;
    font-size: var(--text-sm);
    color: var(--text-2);
    cursor: pointer;
    transition: all 200ms ease-out;
}

.tile-option label:hover {
    border-color: var(--accent);
    background: var(--accent-tint);
    color: var(--accent-text);
}

.tile-option label:hover .comfort-bubble,
.tile-option label:hover .comfort-hint {
    color: var(--accent-text);
}

.tile-option input:checked + label {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 500;
}

.tile-option input:checked + label .comfort-bubble,
.tile-option input:checked + label .comfort-hint {
    color: var(--on-accent);
}

.tile-option input:focus-visible + label {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Comfort tiles carry a number above a hint (the hint wording is P203-guarded). */
.comfort-bubble {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-2);
}

.comfort-hint {
    font-size: var(--text-xs);
    color: var(--text-2);
    text-align: center;
    line-height: 1.25;
}

/* Frequency options: pill-shaped radio buttons.
   .choice-pill-row is the frequency-neutral alias used by the Basics/Cyber
   Section-1 learn-more radios (P559 dropped the frequency question there). */
.frequency-options,
.choice-pill-row {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.freq-option {
    position: relative;
}

.freq-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.freq-option label {
    display: block;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    color: var(--text-2);
    cursor: pointer;
    transition: all 200ms ease-out;
    white-space: nowrap;
}

.freq-option input:checked + label {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.freq-option label:hover {
    border-color: var(--accent);
    color: var(--accent-text);
}

.rating-errors {
    margin-top: var(--space-2);
}


/* --- Scenario Cards (Section 2) --- */
/* coder-268 (assessment/SCENARIO_FORMAT_DESIGN.md): the "Scenario N" label and prompt
   moved to the page-level idiom (eyebrow + serif treatment); the card now wraps only
   the options. .scenario-card__number and .scenario-card__prompt were removed --
   templates reuse .eyebrow directly and .scenario-prompt below. */

.scenario-prompt {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--space-4);
}

.scenario-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: var(--space-5) var(--space-6);
}

.scenario-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.scenario-option {
    position: relative;
}

.scenario-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.scenario-option label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    cursor: pointer;
    transition: all 200ms ease-out;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text);
}

.scenario-option label:hover {
    border-color: var(--accent);
    background: var(--accent-tint);
}

.scenario-option input:checked + label {
    border-color: var(--accent);
    background: var(--accent-tint);
    color: var(--accent-text);
    font-weight: 500;
}

.scenario-option__letter {
    font-weight: 600;
    color: var(--text-2);
    flex-shrink: 0;
    min-width: 18px;
    line-height: 1.5;
}

.scenario-option input:checked + label .scenario-option__letter {
    color: var(--accent-text);
}

/* coder-269: keyboard focus ring, mirrors .tile-option input:focus-visible + label */
.scenario-option input:focus-visible + label {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.scenario-errors {
    margin-top: var(--space-2);
}


/* --- Tool Checklist (Section 4) --- */

.tool-group {
    margin-bottom: var(--space-8);
}

.tool-group__heading {
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
}

.tool-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

/* The report's "tools used" grid (coder-436): three columns, two on a phone,
   where the longest tool name no longer fits a third of the width. A class, not
   an inline `repeat(3,1fr)`, so the phone rule below can reach it (P265). */
.tool-usage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}

.tool-check {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    cursor: pointer;
    transition: border-color 200ms ease-out, background 200ms ease-out;
}

.tool-check:hover {
    border-color: var(--accent);
    background: var(--accent-tint);
}

.tool-check input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.tool-check label {
    font-size: var(--text-base);
    color: var(--accent-text);
    cursor: pointer;
    line-height: 1.4;
}


/* --- Assessment Completion Screen --- */

.completion {
    text-align: center;
    padding: var(--space-10) 0;
}

.completion__check {
    width: 64px;
    height: 64px;
    background: var(--good-tint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
}

.completion__check svg {
    width: 32px;
    height: 32px;
    color: var(--good);
}

.completion__title {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 750;
    color: var(--text);
    margin-bottom: var(--space-4);
}

.completion__lede {
    font-size: var(--text-lg);
    color: var(--text-2);
    max-width: 480px;
    margin: 0 auto var(--space-8);
    line-height: 1.6;
}

.level-display {
    display: inline-block;
    background: var(--good-tint);
    border: 1px solid var(--good);
    border-radius: 4px;
    padding: var(--space-4) var(--space-8);
    margin-bottom: var(--space-8);
}

.level-display__label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    color: var(--good);
    margin-bottom: var(--space-2);
}

.level-display__band {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--good);
    text-transform: capitalize;
}

.completion__actions {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    flex-wrap: wrap;
}


/* --- Admin card list (CODER-017) --- */
/* A general "list of things" component for the WGIT admin surface: each row has a
   title, some read-only meta, a status badge, and drills in (the whole row is the
   link -- not a trailing action). Namespaced `admin-` so it stays off the
   tenant-facing pages that also load main.css.
   Built only on the existing design tokens -- no new token, no new colour literal;
   the badge state colours are the same values the base `.badge--*` modifiers use.
   Reused by tasks 018 (sources / connections) and 019 (tenant hub card grid), so
   it is deliberately module-agnostic. Additive only -- no existing selector edited. */

.admin-card-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

/* The row is an <a>: the whole card drills in (hover mirrors .action-card). */
.admin-card-list__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: var(--space-4) var(--space-5);
    text-decoration: none;
    color: inherit;
    transition: all 200ms ease-out;
}

.admin-card-list__row:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
    color: inherit;
}

.admin-card-list__row:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Left column: title over its read-only meta. min-width:0 lets long meta wrap. */
.admin-card-list__main {
    flex: 1;
    min-width: 0;
}

.admin-card-list__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text);
}

.admin-card-list__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-2);
}

/* Right column: status badge + the drill-in chevron. */
.admin-card-list__aside {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

.admin-card-list__chevron {
    color: var(--text-2);
    transition: transform 200ms ease-out, color 200ms ease-out;
}

.admin-card-list__row:hover .admin-card-list__chevron {
    transform: translateX(4px);
    color: var(--accent-text);
}

.admin-card-list__empty {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: var(--space-5);
    color: var(--text-2);
    font-size: var(--text-sm);
}

/* Status badge: the pill shape of the base `.badge`, namespaced for the admin
   surface. The three state colours reuse the exact values the base
   `.badge--complete` / `.badge--in-progress` / `.badge--not-started` modifiers
   use -- no new literal is introduced. */
.admin-badge {
    display: inline-block;
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: calc(var(--chip-height) - 4px);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    background: var(--line);
    color: var(--text-2);
    white-space: nowrap;
}

/* coder-709 (D450 Phase 5d; design §5 "Chips and status"): WGIT Admin's state words read in
   sentence case, as every chip does -- "Active", "Not set", "Check failed". The words are the
   template's (lower case in the source, and in the tests); only the first letter's case is
   the chip's. `::first-letter` needs a block box, so the chip is an inline block at the chip
   height (its words on one line, centred by the line height) where it was an inline flex. */
.admin-badge::first-letter {
    text-transform: uppercase;
}

/* coder-693: Done -- licensed, set, on, configured, present, enabled, checked. */
.admin-badge--active {
    background: var(--good-tint);
    color: var(--good);
}

/* Waiting: a suspended organization (and the department switch's "Yes"). */
.admin-badge--suspended {
    background: var(--warn-tint);
    color: var(--warn);
}

.admin-badge--not-licensed {
    background: var(--line);
    color: var(--text-2);
}

/* Expired (CODER-018): "was licensed, then lapsed" -- a different fact from
   "never licensed" (the neutral --not-licensed) and the one worth catching while
   scanning. Additive; the three modifiers above are untouched. Reuses the exact
   rust wash + colour the base `.badge--catalog-stale` uses (main.css) -- no new
   colour literal is introduced. */
.admin-badge--expired {
    background: var(--problem-tint);
    color: var(--problem);
}

/* coder-709 (D450 Phase 5d): a failure -- a library's "check failed", a sync or feed run that
   failed, a Learn module's broken link -- is Late, where it sat in the neutral grey
   (CHIP_MAP.md "One class, two jobs"); a warning, or a link that redirects, is Waiting. */
.admin-badge--failed {
    background: var(--problem-tint);
    color: var(--problem);
}

.admin-badge--waiting {
    background: var(--warn-tint);
    color: var(--warn);
}

/* coder-709 (D450 Phase 5d; design §5 "Cards"): a list of things on a WGIT Admin page (an
   organization's modules, connections and sources) is one card of divided rows -- never a
   stack of cards. Each row is still the whole link; it takes the --fill wash on hover. The
   organization's hub of section cards (`--grid`) and Home's compact rows keep their own. */
.admin-card-list:not(.admin-card-list--grid, .admin-card-list--compact) {
    gap: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-card-list:not(.admin-card-list--grid, .admin-card-list--compact) > .admin-card-list__row {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: var(--space-3-5) var(--space-5);
}

.admin-card-list:not(.admin-card-list--grid, .admin-card-list--compact)
    > .admin-card-list__row + .admin-card-list__row {
    border-top: 1px solid var(--line);
}

.admin-card-list:not(.admin-card-list--grid, .admin-card-list--compact) > .admin-card-list__row:hover {
    background: var(--fill);
}

.admin-card-list:not(.admin-card-list--grid, .admin-card-list--compact)
    > .admin-card-list__row:focus-visible {
    box-shadow: inset 0 0 0 3px var(--focus-ring);
}

.admin-card-list:not(.admin-card-list--grid, .admin-card-list--compact) .admin-card-list__title {
    font-size: var(--text-base);
}

.admin-card-list:not(.admin-card-list--grid, .admin-card-list--compact) .admin-card-list__meta {
    margin-top: var(--space-1);
}

/* coder-709 (D450 Phase 5d): WGIT Admin's pages (whatever follows its section tabs). A
   page's cards side by side (Operations) are each their own height; a long value in a cell
   or a line of code wraps rather than widening the page. */
[data-wgit-admin-nav] ~ * .card-grid {
    align-items: start;
}

.cell-url {
    max-width: 30ch;
    word-break: break-all;
}

.code-wrap {
    overflow-wrap: anywhere;
}

/* coder-728 (D465, D466): a standing-context layer's text as it is stored or sent -- the
   editors' preview of the block and a section's history -- its line breaks kept and a long
   line wrapped, on the inset's fill. */
.context-text {
    margin: 0;
    padding: var(--space-4);
    background: var(--fill);
    border-radius: var(--radius-control);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* --- Admin card list: grid layout (CODER-020) --- */
/* The tenant hub (§2.2) lays its eight section cards in a grid, not a single
   stacked column -- a column would reintroduce the scroll this whole sequence set
   out to remove. This is a single additive modifier on the same component; the
   __row is reused UNCHANGED. Additive only -- no existing selector edited, no new
   literal. */
.admin-card-list--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

/* --- Tenant hub groups and the raw config disclosure (coder-561) --- */
/* ADMIN_SURFACE_IA.md §9.2: the hub's cards sit under five headings. Each group is a
   titled card section (`.landing-group`), whose gap already spaces the heading from its
   grid, so the grid's own bottom margin would double the space between groups. */
.admin-hub-group > .admin-card-list {
    margin-bottom: 0;
}

/* The raw config editor on every connection page is a closed <details> at the bottom;
   its summary is the card's heading, with no space under it while the card is closed. */
.admin-raw-config > summary {
    cursor: pointer;
}

.admin-raw-config:not([open]) > summary {
    margin-bottom: 0;
}

/* What the browser already hides in a closed disclosure, hidden in layout too, so the
   summary is the last thing in the card. */
.admin-raw-config:not([open]) > :not(summary) {
    display: none;
}

/* coder-626 (fix queue 6): a long value on a connection page -- the sign-in redirect URI,
   an ID -- wraps at a phone's width rather than scrolling the page sideways, still whole. */
.admin-connection code {
    overflow-wrap: anywhere;
}

/* --- Admin content toggle rows (CODER-022) --- */
/* The Content-tags and Hide-list pages render one row per item: a label, the
   item's current state as an `admin-badge`, and a single contextual op button
   (never a pair, never a checkbox -- there is no set to post, the control is
   per-item). A flex row is the whole need: label grows on the left, badge + the
   one action sit at the right. This replaces the misused `form-option` idiom
   (that class is for checkbox lists that post as a set; these pages post
   per-item). Additive, admin-namespaced, existing tokens only -- no existing
   selector edited, no new colour literal. */
.admin-content-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
}

.admin-content-row__label {
    flex: 1 1 auto;
    color: var(--text);
}

/* --- Admin readiness banner (CODER-020) --- */
/* The tenant hub's headline action (§2): a full-width callout above the card grid
   stating go-live readiness. No banner/callout/alert component existed to reuse
   (the only fit, `.flash`, is a small transient message), so this is an additive,
   admin-namespaced block laying out a prominent title + the Go live button (ready)
   or the unmet-predicate list (not-ready). The two state colours reuse the EXACT
   values the flash treatment uses -- ready mirrors `.flash--success`, not-ready
   mirrors `.flash--warning` -- so no new colour literal is introduced. Additive
   only; no existing selector edited. */
.admin-readiness {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    flex-wrap: wrap;
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-card);
    border: 1px solid transparent;
    margin-bottom: var(--space-6);
}

.admin-readiness--ready {
    background: var(--good-tint);
    border-color: var(--good);
    color: var(--good);
}

.admin-readiness--not-ready {
    background: var(--warn-tint);
    border-color: var(--brass);
    color: var(--warn);
}

.admin-readiness__body {
    flex: 1;
    min-width: 0;
}

.admin-readiness__title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0 0 var(--space-1);
}

.admin-readiness__unmet {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
    font-size: var(--text-sm);
}


/* --- Tabs (coder-694, D450 Phase 3b; design §5 "Tabs") --- */
/* The one tabs component, `macros/tabs.html`: underline tabs with counts. Each tab is a
   link to its own page and the current one carries aria-current="page" -- page tabs (a
   project's, a workflow's, My Tasks' List | Board, the SOP and vendor lists' Current |
   Archived) and the section strips (WGIT Admin, Permissions, the Learning pages). It
   replaces `.admin-subnav`, `.view-switch` and `.architecture__tabs`. The words sit on the
   page's ground on one hairline; the current tab is blue with a 2 px blue rule. A row that
   is wider than its column scrolls sideways inside its own strip, never the page. */
.tabs {
    margin: 0 0 var(--space-5);
}

/* coder-906: `position: relative` makes the list the box a tab's sr-only words are placed
   in, so a tab scrolled out of sight inside the strip never widens the page. */
.tabs__list {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: var(--space-5);
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--line);
}

.tabs__tab {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 44px;
    margin-bottom: -1px;
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    font-size: 0.84375rem;      /* 13.5 px, the prototype's tab */
    font-weight: 600;
    line-height: var(--leading-snug);
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color 150ms ease-out, border-color 150ms ease-out;
}

.tabs__tab:hover {
    color: var(--text);
    border-bottom-color: var(--line-strong);
}

.tabs__tab[aria-current="page"] {
    color: var(--accent-text);
    border-bottom-color: var(--accent);
}

.tabs__tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: var(--radius-control);
}

/* A count the page already shows ("Archived (2)"), as the neutral chip's pill; on the
   current tab it takes the Running chip's blue. */
.tabs__count {
    display: inline-flex;
    align-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 7px;
    padding: 0 7px;
    border-radius: var(--radius-pill);
    background: var(--line);
    color: var(--text-2);
    font-size: 0.6875rem;       /* 11 px */
    font-weight: var(--chip-weight);
    line-height: 1;
}

.tabs__tab[aria-current="page"] .tabs__count {
    background: var(--accent-tint);
    color: var(--accent-text);
}

/* coder-906: where the thing a tab opens stands (Organization rules' sections), a 14 px
   mark after the label in the status chips' colours -- done a green check, started a blue
   dot, waiting an amber dot, not started an empty ring. Its words are the tab's sr-only
   text, so the mark is never the only sign. */
.tabs__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    border-radius: var(--radius-pill);
}

.tabs__status .icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.4;
    vertical-align: 0;
}

.tabs__status--done {
    color: var(--good);
}

.tabs__status--started::before,
.tabs__status--waiting::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--accent);
}

.tabs__status--waiting::before {
    background: var(--warn);
}

.tabs__status--none::before {
    content: "";
    width: 8px;
    height: 8px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-pill);
}

/* Two groups in one strip (the workflow list's whose | which status). */
.tabs__divider {
    flex-shrink: 0;
    align-self: center;
    width: 1px;
    height: 18px;
    background: var(--line-strong);
}

/* The strip a page draws above its content, outside `main`'s container: its tabs line up
   with the wide container, as `.admin-subnav` did. */
.tabs--bar {
    margin: 0;
    padding: var(--space-2) var(--space-6) 0;
}

.tabs--bar .tabs__list {
    max-width: var(--container-wide);
    margin: 0 auto;
}

/* WGIT Admin's fifteen sections: a 16 px gap holds them on one line at 1440; narrower,
   they wrap onto a second line rather than run out of sight past the strip's edge
   (coder-691); a phone keeps the one line that scrolls. The page starts below the strip. */
.tabs[data-wgit-admin-nav] {
    margin-bottom: var(--space-5);
}

@media (min-width: 641px) {
    .tabs[data-wgit-admin-nav] .tabs__list {
        flex-wrap: wrap;
        column-gap: var(--space-4);
        row-gap: 0;
        overflow-x: visible;
    }
}


/* --- Admin Stat Cards --- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

/* P265 / mobile sweep: column-count modifiers replace per-template inline
   `grid-template-columns: repeat(N,1fr)` overrides on `.stat-grid`. An inline
   style would beat the phone-width collapse rule below (inline specificity); a
   shared class lets the `@media (max-width: 640px)` block reach it. Desktop
   column count is unchanged. */
.stat-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: var(--space-5) var(--space-6);
}

.stat-card__value {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 750;
    color: var(--text);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-card__label {
    font-size: var(--text-sm);
    color: var(--text-2);
    font-weight: 500;
}

.stat-card--complete .stat-card__value { color: var(--good); }
.stat-card--progress .stat-card__value { color: var(--warn); }


/* --- Data Table --- */
/* coder-694 (D450 Phase 3b; design §5 "Tables"): dense and readable -- 13 px rows about
   44 px tall on hairlines; the column header 12 px / 650 in sentence case on `--fill`,
   and it stays in view while a long table scrolls past (sticky to the top of whatever
   scrolls: the page, or a box the table scrolls in). Status cells carry 3a's chips. A
   table never scrolls the page sideways: at a phone's width it scrolls inside its own box
   (below). A row header (`tbody th`, a details table's label) is the same words without
   the fill. */
.data-table-wrapper {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

/* Inside a card the card is the box: the wrapper only scrolls (never cards in cards). */
:is(.card, .snm-card) .data-table-wrapper {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    line-height: var(--leading);
}

/* A table on the page's ground, in no card or wrapper, is its own card: the card's ground,
   edge, radius and lift. `separate` with no spacing lets the edge round; the corner cells
   take the radius, so nothing clips (a clip would stop the header sticking). */
.data-table:not(:is(.card, .snm-card, .data-table-wrapper, .home-attention) *) {
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.data-table:not(:is(.card, .snm-card, .data-table-wrapper, .home-attention) *) > :first-child > tr:first-child > :first-child {
    border-top-left-radius: calc(var(--radius-card) - 1px);
}

.data-table:not(:is(.card, .snm-card, .data-table-wrapper, .home-attention) *) > :first-child > tr:first-child > :last-child {
    border-top-right-radius: calc(var(--radius-card) - 1px);
}

.data-table:not(:is(.card, .snm-card, .data-table-wrapper, .home-attention) *) > :last-child > tr:last-child > :first-child {
    border-bottom-left-radius: calc(var(--radius-card) - 1px);
}

.data-table:not(:is(.card, .snm-card, .data-table-wrapper, .home-attention) *) > :last-child > tr:last-child > :last-child {
    border-bottom-right-radius: calc(var(--radius-card) - 1px);
}

.data-table th {
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 650;
    color: var(--text-2);
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: 40px;
    background: var(--fill);
    /* the rule under a stuck header moves with it (a collapsed border would not) */
    border-bottom: 0;
    box-shadow: inset 0 -1px 0 var(--line);
}

.data-table tbody th {
    font-size: var(--text-sm);
    font-weight: 600;
}

.data-table td {
    height: 44px;
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: var(--text);
}

.data-table tbody tr:last-child td,
.data-table tbody tr:last-child th {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: var(--fill);
}

.data-table a {
    text-decoration: none;
    font-weight: 500;
}

.data-table a:hover {
    text-decoration: underline;
}

.data-table .col-name { min-width: 160px; }
.data-table .col-dept { min-width: 140px; }
.data-table .col-status { width: 120px; }
.data-table .col-score { width: 80px; text-align: right; }
.data-table .col-level { width: 110px; }
.data-table .col-actions { width: 100px; text-align: right; }

/* P262 / R3: inline-edit forms inside a table cell (offboarding revocation
   checklist, phone status) wrap their controls rather than forcing a fixed-width
   row, so they stay usable when the table is scrolled/narrowed on a phone. The
   server contract (field names, action, csrf) is untouched -- this is layout
   only. */
.form-inline-edit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* --- Detail List (IT Profile header tiles) ---
   coder-184: supersedes the old P262/R2 trailing-colon `dt::after` rule --
   uppercase micro-labels below take no colon. The `.vc-card__field` /
   `.vc-card__label` / `.vc-card__value` treatment, applied to the header dl. */
.detail-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.detail-list__cell {
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: var(--space-3) var(--space-4);
}

.detail-list__cell--wide {
    grid-column: 1 / -1;
}

.detail-list dt {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: var(--space-1);
}

.detail-list dd {
    font-size: var(--text-base);
    color: var(--text);
    line-height: 1.4;
    overflow-wrap: anywhere;
    margin: 0;
}


/* --- Level Tags --- */

.level-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    text-transform: capitalize;
    background: var(--line);
    color: var(--text-2);
}

/* coder-693: an assessment level -- Beginner needs work (amber), Intermediate on the way
   (blue), Advanced done (green); any other band neutral. */
.level-tag--beginner {
    background: var(--warn-tint);
    color: var(--warn);
}

.level-tag--intermediate {
    background: var(--accent-tint);
    color: var(--accent-text);
}

.level-tag--advanced {
    background: var(--good-tint);
    color: var(--good);
}


/* --- Status Dot --- */

/* coder-693: a status mark is a chip of the family with a 6 px dot of its own colour before
   the words (section 4, "Badges, chips and status"). */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    background: var(--line);
    color: var(--text-2);
}

.status-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Process-engine task states (coder-096). The dot modifier is keyed on the
   INTERNAL enum value -- the user-facing words (To Do / In Progress / Complete)
   are the label beside it, never the class name. `in_progress` renders as the
   `.badge--in-progress` chip in the task tables. coder-693's families:
   Done -- complete, completed, ok; Running / Open -- in_progress, open (a run);
   Waiting -- deferred (a workflow step waiting on another), warning; Late -- critical;
   neutral -- not_started, pending (To Do), not_applicable, unknown, cancelled. */
.status-dot--complete,
.status-dot--completed,
.status-dot--ok {
    background: var(--good-tint);
    color: var(--good);
}

.status-dot--in_progress,
.status-dot--open {
    background: var(--accent-tint);
    color: var(--accent-text);
}

.status-dot--deferred,
.status-dot--warning {
    background: var(--warn-tint);
    color: var(--warn);
}

.status-dot--critical {
    background: var(--problem-tint);
    color: var(--problem);
}

.status-dot--not_started,
.status-dot--pending,
.status-dot--not_applicable,
.status-dot--unknown,
.status-dot--cancelled {
    background: var(--line);
    color: var(--text-2);
}


/* --- Score Bar (inline progress-style bar) --- */

.score-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.score-bar__track {
    flex: 1;
    height: 6px;
    background: var(--line);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.score-bar__fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-pill);
    transition: width 400ms ease-out;
}

.score-bar__value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    min-width: 32px;
    text-align: right;
}


/* coder-1162 (D654): WGIT Admin's Renamed departments -- what followed each rename. */
.rename-counts {
    margin: 0;
    padding-left: var(--space-4);
    font-size: var(--text-sm);
}


/* --- Flag Pills --- */

.flag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* A risk flag (an assessment's or a dashboard's): Late's rose (coder-693), no edge. */
.flag-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    background: var(--problem-tint);
    color: var(--problem);
    border: 0;
}

/* coder-658 (fix queue 6): a task's kind ("Workflow step", "Project task", "Approval" ...)
   is a label, not a flag. coder-693: neutral -- a kind is not a state (Phase 4 gives an
   approval step its amber where the page knows it is one). */
.kind-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    background: var(--line);
    color: var(--text-2);
    border: 0;
}

/* coder-538: the template editor's "Added by the app" on the costing step: neutral. */
.flag-pill--app {
    background: var(--line);
    color: var(--text-2);
}


/* --- Admin Report Section Headings --- */

.report-section {
    margin-bottom: var(--space-8);
}

.report-section__title {
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
}

/* coder-456: a section's buttons, under its title. */
.report-section__actions {
    margin-bottom: var(--space-4);
}


/* --- Level Distribution Bar --- */

.level-bar {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    height: 24px;
    margin-bottom: var(--space-4);
}

.level-bar__segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--on-accent);
    transition: width 400ms ease-out;
}

.level-bar__segment--beginner     { background: var(--brass); }
.level-bar__segment--intermediate { background: var(--accent); }
.level-bar__segment--advanced     { background: var(--good); }


/* --- Department list row --- */

.dept-row {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--fill);
    gap: var(--space-4);
}

.dept-row:last-child { border-bottom: none; }

.dept-row__name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.dept-row__name--inactive {
    color: var(--text-2);
    font-style: italic;
}

.dept-row__count {
    font-size: var(--text-sm);
    color: var(--text-2);
    min-width: 80px;
    text-align: right;
}

.dept-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}


/* --- Required field marker (shared: vendor + composer forms) --- */

.form-required {
    color: var(--problem);
    font-weight: 600;
    margin-left: 0.15em;
}


/* --- Composer / steps builder --- */

/* O1 -- chip multiselect (departments + sub-departments). The <input> checkbox
   stays inside the <label> chip and carries the POST value; the chip is the
   visible control. Selected state is driven by :has(input:checked) (covers the
   [[D261]] server-side pre-check with no JS) and mirrored by a .chip--selected
   class that sop_composer.js keeps in sync on toggle for older engines. */
.chip-multiselect {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    color: var(--accent-text);
    line-height: 1.3;
    cursor: pointer;
    transition: background 200ms ease-out, border-color 200ms ease-out;
}

.chip:hover {
    border-color: var(--accent);
}

/* Keep the underlying checkbox operable + keyboard-focusable, but out of the
   visual chip -- the chip label is the control. */
.chip input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

.chip:focus-within {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.chip__label::before {
    content: '';
    display: inline-block;
    width: 1em;
    margin-right: 0.15em;
}

.chip--selected,
.chip:has(input:checked) {
    background: var(--accent-tint);
    border-color: var(--accent);
    font-weight: 500;
}

/* Check glyph on the selected state (replaces the reserved space above). */
.chip--selected .chip__label::before,
.chip:has(input:checked) .chip__label::before {
    content: '\2713';
    width: auto;
    color: var(--accent-text);
    font-weight: 700;
}

/* D264 -- the composer's OU department tree (parent department + nested
   sub-departments, expanded by default; mirror departments render as a single row).
   Vanilla nested lists; the cascade is JS (sop_composer.js). */
.dept-tree,
.dept-tree__children {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dept-tree__dept {
    margin-bottom: var(--space-2);
}
.dept-tree__children {
    margin-left: var(--space-5);
    border-left: 2px solid var(--line);
    padding-left: var(--space-3);
}
.dept-tree__row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    cursor: pointer;
}
.dept-tree__dept > .dept-tree__row .dept-tree__label {
    font-weight: 600;
}

/* coder-441 (D361 §5) -- a content row's Department(s) shown, not picked: each
   department with its tagged sub-departments beneath it. A department shown only as
   the parent of a tagged sub-department is muted. */
.dept-list,
.dept-list__subs {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dept-list__dept + .dept-list__dept {
    margin-top: var(--space-1);
}
.dept-list__subs {
    margin-left: var(--space-4);
}

/* O2 -- carded steps with a number chip. */
.composer-step {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-4);
}

.composer-step > legend,
.composer-step__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 600;
    color: var(--text);
    padding: 0;
}

/* Retained: still consumed by import_wizard.js's step legend (import_tool/wizard.html).
   CODER-059 removed the composer's chip emit, but this class is NOT orphaned -- the
   import wizard shares it. Removing the rule would leave that chip unstyled. */
.composer-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: var(--text-sm);
    font-weight: 700;
    flex: 0 0 auto;
}

.composer-step__ctrls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.composer-step__body {
    margin-top: var(--space-3);
    padding-left: calc(1.75rem + var(--space-3));
}

.composer-add-step {
    margin-top: var(--space-3);
}

/* D352 §3 / D354: a step's optional question in the SOP step editor -- the
   question, then one row per answer: its label, an arrow, and where it leads. */
.composer-question {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.composer-question__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.composer-question__text,
.composer-question__answers {
    width: 100%;
}

.composer-question__answers {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

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

.composer-answer__label {
    flex: 1 1 12rem;
    min-width: 0;
}

.composer-answer__to {
    flex: 1 1 12rem;
    min-width: 0;
}

.composer-answer__arrow {
    color: var(--text-2);
}

/* coder-439 -- a workflow approval's decision form, a card inside the task page's card. */
.workflow-decision-slot {
    margin: var(--space-4) 0;
}

/* coder-458 -- the workflow template editors' Due field: a short number field followed
   by "days before the workflow is due"; it wraps under the field on a narrow screen. */
.workflow-due-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
}

.workflow-due-field__input {
    width: 7rem;
    flex: 0 0 auto;
}

.workflow-due-field__words {
    font-size: var(--text-sm);
    color: var(--text);
}

.workflow-due-legacy {
    font-size: var(--text-sm);
    color: var(--text);
    margin-bottom: var(--space-2);
}

/* coder-452 -- the filing month: a month and a year select side by side (D359). */
.workflow-month-picker__fields {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.workflow-month-picker__fields .form-select {
    width: auto;
    flex: 1 1 9rem;
    max-width: 14rem;
}

.workflow-manage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* coder-696: the brief, under the page header, at the reading width. coder-697 (Phase
   4b): the header's lede, its label in the metadata's ink. */
.workflow-brief {
    max-width: 72ch;
    margin: var(--space-3) 0 0;
    color: var(--text);
}

.workflow-brief__label {
    margin-right: var(--space-1);
    color: var(--text-2);
    font-weight: 650;
}

/* coder-452 -- a workflow's deliverables, each slot empty or filed in SharePoint. */
.workflow-slots {
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: 0;
}

.workflow-slot {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--line);
    /* coder-749: a refused Mark complete links here; clear of a sticky header. */
    scroll-margin-top: var(--space-8);
}

.workflow-slot__thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 2px;
}

.workflow-slot__body {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.workflow-slot__body > * + * {
    margin-top: var(--space-2);
}

.workflow-attach__actions,
.workflow-attach__progress {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.workflow-attach__progress[hidden],
.workflow-attach [hidden] {
    display: none;
}

/* coder-693 (design §5 "Progress"): the upload's native bar, 6 px in the accent. */
.workflow-attach__progress progress {
    flex: 1 1 10rem;
    max-width: 20rem;
    height: 6px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--line);
    overflow: hidden;
    appearance: none;
    accent-color: var(--accent);
}

.workflow-attach__progress progress::-webkit-progress-bar {
    background: var(--line);
    border-radius: var(--radius-pill);
}

.workflow-attach__progress progress::-webkit-progress-value {
    background: var(--accent);
    border-radius: var(--radius-pill);
}

.workflow-attach__progress progress::-moz-progress-bar {
    background: var(--accent);
    border-radius: var(--radius-pill);
}

.workflow-attach > * + * {
    margin-top: var(--space-3);
}

.workflow-attach__pick {
    cursor: pointer;
}

/* coder-505 (PROJECTS_V2_DESIGN.md §7 item 4) -- a quote's or expense line's files on the
   Budget tab: each opening in SharePoint with its Remove, then Attach files. */
.budget-files {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.budget-files > * + * {
    margin-top: var(--space-2);
}

.budget-files__label {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* coder-949 (D564 rule 7): a project's inform points on its People tab -- one line each,
   wrapping at phone width, with its actions and edit form under it. */
.inform-points__list {
    list-style: none;
    margin: 0 0 var(--space-3);
    padding: 0;
}

.inform-points__item {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.inform-points__line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-3);
    margin: 0;
}

.inform-points__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.inform-points__edit {
    margin-top: var(--space-1);
}

.budget-files__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.budget-files__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    overflow-wrap: anywhere;
    min-width: 0;
}

.budget-files__item > a,
.budget-files__item > span {
    flex: 1 1 12rem;
    min-width: 0;
}

.budget-files__remove {
    margin: 0;
}

.budget-files .workflow-attach {
    position: relative;
}

/* An action below a line's files (which hold the file picker) sits a form's distance off. */
.budget-files + details {
    margin-top: var(--space-5);
}

.budget-files-note {
    margin-bottom: var(--space-5);
}

/* coder-505 -- the report's deliverables (per phase, then per task) and approvals. */
.report-phase,
.report-gate {
    margin-top: var(--space-5);
}

.report-phase > * + *,
.report-gate > * + * {
    margin-top: var(--space-3);
}

.report-phase > * + .report-phase__task {
    margin-top: var(--space-5);
}

.report-phase__task {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.report-gate__label {
    margin-bottom: 0;
    font-weight: 600;
}

.report-gate__send-backs {
    margin-top: var(--space-2);
    padding-left: var(--space-5);
    overflow-wrap: anywhere;
}

.report-quote__name {
    padding-left: var(--space-5);
}

.workflow-approved {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
    font-size: var(--text-sm);
}

/* coder-460 (D367 §4) -- a hand-set date on a non-business day: said so under the
   field, with the business day before offered; the date is kept unless taken. */
.workflow-date-flag {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--warn);
}

.workflow-date-flag[hidden],
.workflow-date-flag [hidden] {
    display: none;
}

/* coder-460 -- the due-date change form's preview of the dates that move. */
.workflow-moving {
    list-style: none;
    margin: var(--space-3) 0 0;
    padding: 0;
}

.workflow-moving li {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--line);
}

/* coder-460 (D365 §5) -- a workflow's priority. High is the one that stands out. */
.priority-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    background: var(--line);
    color: var(--text-2);
    white-space: nowrap;
}

/* coder-693: High is the one that stands out -- rose, as before; Normal and Low neutral,
   Low with an edge in place of the fill. */
.priority-pill--high {
    background: var(--problem-tint);
    color: var(--problem);
}

.priority-pill--low {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--line-strong);
    color: var(--text-2);
}

/* coder-470 (D369 §2-§3) -- the overview progress bar (workflow and project overviews):
   filled to the percentage complete across the span from the start date to the due
   date, a tick at each task's due date (filled done, hollow open, red overdue) and a
   rule for today. */
.progress-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* coder-693 (D450 Phase 3a, design §5 "Progress"): the count under the 6 px bar. */
.progress-card__text {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}

/* The overview's bar holds a track (and its ticks), so it is a frame, not the assessment's
   bar above. */
.progress-card .progress-bar {
    height: auto;
    padding: var(--space-2) 0;
    overflow: visible;
    border-radius: 0;
    background: none;
}

/* coder-693: 6 px, the fill at full strength (it was a pale 10 px band under the ticks);
   each tick wears a ring of the card so it reads on the fill as on the track. */
.progress-bar__track {
    position: relative;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--line);
}

.progress-bar__fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--accent);
}

.progress-bar__tick {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--card);
    box-shadow: 0 0 0 2px var(--card);
    transform: translate(-50%, -50%);
}

.progress-bar__tick--done {
    background: var(--accent);
}

.progress-bar__tick--overdue {
    border-color: var(--problem);
    background: var(--problem);
}

.progress-bar__today {
    position: absolute;
    top: -6px;
    bottom: -6px;
    width: 2px;
    background: var(--brass);
    transform: translateX(-50%);
}

.progress-bar__ends,
.progress-bar__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: 0;
    color: var(--text-2);
    font-size: var(--text-sm);
}

.progress-bar__ends {
    justify-content: space-between;
}

.progress-bar__legend > span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.progress-bar__legend .progress-bar__tick,
.progress-bar__legend .progress-bar__today {
    position: static;
    transform: none;
    box-shadow: none;
}

.progress-bar__legend .progress-bar__today {
    display: inline-block;
    height: 14px;
}

/* coder-523 (D390 §2, §4): a paused or held task's tick -- hollow, dashed, never red. */
.progress-bar__tick--paused {
    border-style: dashed;
    border-color: var(--text-2);
    background: var(--fill);
}

/* coder-523 (D390 §1-§4, §7) -- stalled, paused and held work, and the schedule review.
   Each flag is a word on a pill (never colour alone): Stalled in rust, Paused in stone
   with a dashed edge, Held for review (and Schedule review needed) in amber. */
/* coder-693: the chip family -- Stalled Late (rose), Held for review Waiting (amber), Paused
   neutral with its dashed edge (a pause is never colour alone, D390). */
.task-flag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    border: 1px solid transparent;
    white-space: nowrap;
}

.task-flag--stalled {
    background: var(--problem-tint);
    color: var(--problem);
}

.task-flag--paused {
    border: 1px dashed var(--text-2);
    background: var(--line);
    color: var(--text-2);
}

.task-flag--held {
    background: var(--warn-tint);
    color: var(--warn);
}

.task-flag__line {
    margin-left: var(--space-2);
    color: var(--text-2);
    font-size: var(--text-sm);
}

.task-flag-row {
    margin: var(--space-1) 0 0;
}

.run-flag {
    border-left: 4px solid var(--problem);
}

.run-flag--review {
    border-left-color: var(--brass);
}

.run-flag__list {
    margin: 0 0 var(--space-3);
    padding-left: var(--space-5);
}

.run-flag-line {
    margin-top: var(--space-1);
}

.schedule-prompt {
    border-left: 4px solid var(--brass);
}

/* The prompt in My Tasks sits between the page intro and the blocks below it. */
.container > .schedule-prompt {
    margin-bottom: var(--space-5);
}

/* coder-460 (D365 §1, §4) -- Overdue on my team (My Tasks) and the Nudge forms. */
.overdue-team {
    margin-top: var(--space-8);
}

.nudge-form {
    display: inline;
}

/* coder-452 -- the WGIT admin SharePoint libraries card: one entry per department and
   sub-department. */
.sp-libraries {
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: 0;
}

.sp-library {
    padding: var(--space-4) 0;
    border-top: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.sp-library > * + * {
    margin-top: var(--space-3);
}

.sp-library__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-3);
}

.sp-library__fields .form-group {
    margin-bottom: 0;
}

/* coder-439 -- every step's escalation vendor (the picker step 1 had, per step). Sits
   between the step's body and its question, in the question's divider idiom. */
.composer-step-vendor {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.composer-step-vendor .composer-vendor-current {
    margin-top: 0;
}

/* ==========================================================================
   coder-234 -- SOP composer block-card visual polish.

   sop_composer.js is not the only consumer of .composer-step / .composer-
   step__ctrls / .composer-step__body / .composer-verbiage* / .composer-menu-
   path* / .composer-dropzone* / .content-editor__* -- import_wizard.js
   (app/templates/import_tool/wizard.html, #import-steps-surface) builds its
   own step editor from the SAME class vocabulary. None of those shared base
   rules are touched here. Everything below either:
     (a) is a brand-new class (.composer-block*, .composer-step__toolbar,
         .composer-step__label, .composer-step__title, .composer-block-adder)
         that only sop_composer.js emits, or
     (b) is scoped under #sop-steps-surface -- sop_composer.js's own mount
         point (distinct from the wizard's #import-steps-surface) -- so an
         override can never reach the wizard's markup.
   The verbiage/menu-path in-treatment styling (.composer-verbiage*,
   .composer-menu-path*) is untouched by design (task scope): only its
   parent card chrome is new.
   ========================================================================== */

/* The step toolbar: "Step N", the title input, and the step-level controls
   as one row instead of three stacked, differently-weighted pieces. */
#sop-steps-surface .composer-step__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-3);
    margin-bottom: var(--space-4);
}

#sop-steps-surface .composer-step__label {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    flex: 0 0 auto;
}

#sop-steps-surface .composer-step__title {
    flex: 1 1 220px;
    min-width: 160px;
}

/* Override the shared .composer-step__ctrls block-level margin -- inside the
   toolbar row it is a flex item that hugs the right edge, not a standalone
   block with vertical margin of its own. */
#sop-steps-surface .composer-step__ctrls {
    margin: 0 0 0 auto;
}

/* coder-654 (D429 §4): the SOP wizard's marks beside a step ("Moved from page 3",
   with Undo), under the toolbar; they wrap on a phone. */
#sop-steps-surface .composer-step__marks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-4);
}

#sop-steps-surface .composer-step__mark {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    min-width: 0;
}

#sop-steps-surface .composer-step__body {
    /* No numeral chip has rendered here since CODER-057 -- the indent that
       used to align body text under it is dead weight. */
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Each body block: a small card with a type header row (small-caps label,
   echoing .sop-read .sop-verbiage__label) and grouped controls on the right,
   instead of bare controls floating beside the input. */
#sop-steps-surface .composer-block {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--fill);
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

#sop-steps-surface .composer-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
}

#sop-steps-surface .composer-block__type {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
}

#sop-steps-surface .composer-block__ctrls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

#sop-steps-surface .composer-block__ctrls .btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
}

/* Field weight: the paragraph/heading textarea matches the vendor form's
   .form-textarea idiom (reused as-is for border/background/focus) plus
   auto-grow (sop_composer.js sizes it on input and on mount). The heading
   variant reads as what it produces -- serif, larger, echoing
   .sop-read .sop-step__title. */
#sop-steps-surface .composer-block__text {
    resize: none;
    overflow: hidden;
    min-height: 4.5em;
}

#sop-steps-surface .composer-block__text--heading {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    min-height: 2.75em;
}

/* The adder row: outlined chip/buttons (.btn--secondary, the app's existing
   outlined idiom -- already used by "+ Add step") in one wrapping row,
   never bare text links. */
#sop-steps-surface .composer-block-adder {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

/* Narrow viewports (Michael authors from iOS Safari): stack rather than let
   the toolbar/head rows squeeze into unreadable fragments. Flex-wrap already
   keeps nothing overflowing above this width; below it we force a clean
   stack order instead of a partial wrap. */
@media (max-width: 480px) {
    #sop-steps-surface .composer-step__title {
        flex-basis: 100%;
    }

    #sop-steps-surface .composer-step__ctrls {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    #sop-steps-surface .composer-block__ctrls {
        width: 100%;
        justify-content: flex-end;
    }
}

/* coder-232 -- authoring-side echo of the read view's inset-quote treatment
   (.sop-read .sop-verbiage), so the author sees speech as speech while typing. */
.composer-verbiage {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2) 0 var(--space-2) var(--space-3);
    border-left: 1px solid var(--accent);
}

.composer-verbiage__label {
    max-width: 16rem;
}

.composer-verbiage__text {
    font-family: var(--font-display);
    font-style: italic;
}

/* coder-232 -- the menu-path block: one input, live breadcrumb preview below. */
.composer-menu-path {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.composer-menu-path__preview {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text-2);
}

/* coder-987 (D588 §2) -- Help's link block: its words, where it goes, and an address. */
.composer-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.composer-link .form-select,
.composer-link .form-input {
    max-width: 100%;
}

/* coder-1255 (D706) -- Help's editor: a section that opens in place, its label and text. */
.composer-more {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.composer-more .form-input {
    max-width: 100%;
}

/* coder-987 -- WGIT Admin's Help editor: the page, wizard, module and role keys. */
.help-keys {
    margin-bottom: var(--space-2);
}

.help-keys > summary {
    cursor: pointer;
    font-weight: 600;
    padding: var(--space-1) 0;
}

.help-keys__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    padding: var(--space-1) 0;
}

.help-keys__list code,
.help-keys-cell code {
    overflow-wrap: anywhere;
}

/* O3 -- per-step image dropzone -> thumbnail. */
.composer-dropzone {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-control);
    padding: var(--space-3);
    background: var(--fill);
}

.composer-thumb {
    max-width: 200px;
    max-height: 160px;
    padding: var(--image-plate-inset, 0);
    border-radius: var(--image-plate-radius, 4px);
    border: 1px solid var(--line);
    background: var(--image-plate, transparent);
    display: block;
    cursor: zoom-in;
}

.composer-dropzone__ctrls {
    display: flex;
    gap: var(--space-2);
}

/* O4 -- escalation-vendor search popover + selected chip. */
.composer-vendor-field {
    position: relative;
}

.composer-vendor-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    margin-top: var(--space-1);
    list-style: none;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    max-height: 260px;
    overflow-y: auto;
    padding: var(--space-1);
}

.composer-vendor-results li {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-control);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text);
}

.composer-vendor-results li:hover,
.composer-vendor-results li:focus,
.composer-vendor-results li[aria-selected="true"] {
    background: var(--accent-tint);
    outline: none;
}

/* coder-862: the vendor picker's notes (empty, failed) are not choices. */
.composer-vendor-results li.composer-vendor-note {
    cursor: default;
    color: var(--text-2);
    background: none;
}

.composer-vendor-current {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-2);
}

.composer-vendor-current strong {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    background: var(--accent-tint);
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-weight: 500;
}

/* O5 -- SOP list rows. */
.composer-list {
    list-style: none;
    margin-top: var(--space-3);
}

.composer-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    margin-bottom: var(--space-2);
    background: var(--card);
}

.composer-list li a {
    flex: 1;
    color: var(--accent-text);
    font-weight: 500;
    text-decoration: none;
}

.composer-list li a:hover {
    text-decoration: underline;
}

/* coder-624: the name (a link or plain text) takes the row; Edit sits beside it. */
.composer-list__name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.composer-list li a.home-edit-link {
    flex: none;
    font-weight: 400;
}

.composer-list small {
    color: var(--text-2);
    font-size: var(--text-xs);
}

/* coder-635 (D423 §4): Restore inside the SOP page's Archived notice. */
.sop-restore-form {
    margin: var(--space-2) 0 0;
}

/* coder-635 (D423 §4): the Archived filter's rows wrap their meta and Restore on a phone. */
.composer-list--archived li {
    flex-wrap: wrap;
}

.composer-list--archived form {
    margin: 0;
}

/* coder-635 (D423 §3): the archive page's uses, one per row, its replacement beneath. */
.sop-archive-kind {
    margin: var(--space-5) 0 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.sop-archive-uses {
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: 0;
}

.sop-archive-use {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--line);
}

.sop-archive-use__what {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.sop-archive-use__label {
    font-weight: 500;
}

.sop-archive-use .form-select {
    max-width: 100%;
}


/* --- Troubleshooting search bar --- */

.ts-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.ts-search input[type="search"] {
    flex: 1;
    min-width: 0;
    display: block;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control);
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text);
    transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}

.ts-search input[type="search"]::placeholder {
    color: var(--text-2);
}

.ts-search input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
}


/* --- Content block editor (folded from the retired content_editor.css so the
   JS-emitted step / block bodies render styled under the single main.css that
   base.html loads; retuned to the design tokens above) --- */

.content-editor {
    margin: var(--space-3) 0;
}

.content-editor__label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text);
}

.content-editor__source {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--text-sm);
}

.content-editor__surface {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: var(--space-2);
}

.content-editor__block {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--fill);
}

.content-editor__block[data-block-type="vendor_contact_embed"] {
    font-style: italic;
    color: var(--text-2);
}

.content-editor__block-text {
    flex: 1;
    width: 100%;
}

.content-editor__del {
    flex: 0 0 auto;
}

.content-editor__add {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}


/* ---------- 5. Utilities ---------- */

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

.text-center { text-align: center; }
.text-muted { color: var(--text-2); }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }

/* --- Utilities for the reports and dashboards (coder-708, D450 Phase 5c) ---
   Each stands for one declaration an inline `style=` carried, on the tokens and the
   spacing scale. They replace attributes that beat every rule, so they keep that
   precedence with `!important`; a margin's sides follow the whole margin. */
.text-right { text-align: right !important; }
.text-xs { font-size: var(--text-xs) !important; }
.text-sm { font-size: var(--text-sm) !important; }
.text-base { font-size: var(--text-base) !important; }
.text-lg { font-size: var(--text-lg) !important; }
.text-xl { font-size: var(--text-xl) !important; }
.text-2xl { font-size: var(--text-2xl) !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.font-body { font-family: var(--font-body) !important; }
.text-ink { color: var(--text) !important; }
.text-good { color: var(--good) !important; }
.text-warn { color: var(--warn) !important; }
.text-problem { color: var(--problem) !important; }
.leading { line-height: var(--leading) !important; }
.m-0 { margin: 0 !important; }
.p-0 { padding: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-0-5 { margin-top: var(--space-0-5) !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-5 { margin-top: var(--space-5) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mt-10 { margin-top: var(--space-10) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-5 { margin-bottom: var(--space-5) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }
.ml-1 { margin-left: var(--space-1) !important; }
.ml-2 { margin-left: var(--space-2) !important; }
.ml-auto { margin-left: auto !important; }
.pt-0 { padding-top: 0 !important; }
.pr-0 { padding-right: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }
.pl-5 { padding-left: var(--space-5) !important; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-5 { padding-left: var(--space-5) !important; padding-right: var(--space-5) !important; }
.py-1 { padding-top: var(--space-1) !important; padding-bottom: var(--space-1) !important; }
.py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-col { flex-direction: column !important; }
.flex-1 { flex: 1 !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-5 { gap: var(--space-5) !important; }
.min-w-0 { min-width: 0 !important; }
.no-underline { text-decoration: none !important; }
.nowrap { white-space: nowrap !important; }
.w-full { width: 100% !important; }
.measure-short { max-width: 36ch !important; }
/* A column or control's width (the old literal pixels, in rem). */
.col-bar { min-width: 10rem; }
.col-60 { width: 60%; }
.field-w-xs { max-width: 6.25rem; }
.field-w-md { max-width: 12.5rem; }
.field-w-lg { max-width: 15rem; }


/* --- Reports and dashboards in Direction 1 (coder-708, D450 Phase 5c) ---
   The organization's assessment reports (SWOT, department, user), Learning admin's
   assessment pages, the executive and manager dashboards and their drill pages. Each page's
   container carries `.report-page`. In it a section's title is the 15 px / 700 section title
   in sentence case (it was a 12 px uppercase eyebrow with a rule under it); lists of findings
   are cards of divided rows; figures, chips and tables are the shared components. The words
   on the page are the template's, unchanged. coder-709 (5d) gives WGIT Admin's pages (what
   follows its section tabs) the same section title. */
:is(.report-page, [data-wgit-admin-nav] ~ *) .report-section__title {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.005em;
    text-transform: none;
    color: var(--text);
    padding-bottom: 0;
    border-bottom: 0;
    margin-bottom: var(--space-3);
}

/* A SWOT quadrant's title and its bullets take its colour: green strengths, rose
   weaknesses, blue opportunities, amber threats (the text inks, at 4.5:1). */
:is(.report-section__title, .report-bullet__mark).report-quadrant--strengths { color: var(--good); }
:is(.report-section__title, .report-bullet__mark).report-quadrant--weaknesses { color: var(--problem); }
:is(.report-section__title, .report-bullet__mark).report-quadrant--opportunities { color: var(--accent-text); }
:is(.report-section__title, .report-bullet__mark).report-quadrant--threats { color: var(--warn); }

/* Findings: one card, a divided row each (inside a card, the card's own rows). */
.report-bullets {
    list-style: none;
    margin: 0;
    padding: 0 var(--space-5);
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.card .report-bullets {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.report-bullet {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    padding: var(--space-3-5) 0;
}

.report-bullets--tight .report-bullet {
    padding: var(--space-2-5) 0;
}

.report-bullet + .report-bullet {
    border-top: 1px solid var(--line);
}

.report-bullet__mark {
    flex-shrink: 0;
    margin-top: var(--space-0-5);
    font-weight: 700;
    color: var(--text);
}

.report-bullet__text,
.report-prose {
    font-size: var(--text-base);
    line-height: var(--leading);
    color: var(--text-2);
}

/* A score summary: figures in a row that wraps. */
.report-figures {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-5) var(--space-8);
}

.report-figures--tight {
    gap: var(--space-4) var(--space-6);
}

.report-figures__wide {
    flex: 1;
    min-width: 12rem;
}

.report-value {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
}

.report-value--lg {
    font-size: var(--text-xl);
    font-weight: 700;
}

.report-sublabel {
    margin-bottom: var(--space-0-5);
    font-size: var(--text-sm);
    color: var(--text-2);
}

.report-kicker {
    font-size: var(--text-xs);
    font-weight: 650;
    color: var(--text-2);
}

.report-score-aside {
    float: right;
    font-weight: 500;
    color: var(--text);
}

/* A part of a card under a hairline, and a rule between a report's parts. */
.report-divided {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
}

.report-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: var(--space-8) 0;
}

.report-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(17.5rem, 100%), 1fr));
    gap: var(--space-4);
}

.report-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
}

/* A department report's warning card: a rose edge. */
.report-alert {
    border-left: 4px solid var(--problem);
    padding: var(--space-4) var(--space-5);
}

.report-inset {
    padding: var(--space-4);
    background: var(--fill);
    border-radius: var(--radius-control);
}

.report-code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    word-break: break-all;
}

.report-summary {
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text);
}

.report-glyph {
    font-size: var(--text-lg);
    line-height: var(--leading-tight);
    color: var(--text-2);
}

/* A practice or tool the person does (blue tint and ink) or does not (the fill). */
.practice-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-control);
    background: var(--fill);
}

.practice-row__label {
    font-size: var(--text-sm);
    color: var(--text-2);
}

.practice-row--on {
    background: var(--accent-tint);
}

.practice-row--on :is(.practice-row__label, .report-glyph) {
    color: var(--accent-text);
}

/* A table row that needs eyes (the PCI signal) and one set apart. */
tr.row--alert { background: var(--problem-tint); }
tr.row--quiet { background: var(--fill); }
tr.dept-row--empty { opacity: 0.6; }

/* "Late" in a report's table: the Late chip. */
.badge--late {
    background: var(--problem-tint);
    color: var(--problem);
}

.campaign-variant {
    margin: var(--space-2) 0 var(--space-3) var(--space-6);
    max-width: 23.75rem;
}

.campaign-variant__label {
    font-size: var(--text-xs);
    text-transform: none;
    letter-spacing: 0;
}

@media (min-width: 641px) {
    .card-grid--2 { grid-template-columns: 1fr 1fr; }
}

/* The dashboards: the toolbar and the freshness strip as quiet bands; the custom zone; the
   manager's tiles; the alerts; the tiles' bars, figures and divided rows. */
.dashboard-toolbar,
.freshness-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    font-size: var(--text-sm);
}

.dashboard-toolbar {
    gap: var(--space-5) var(--space-4);
    margin-bottom: var(--space-6);
    padding: var(--space-3) var(--space-4);
}

.freshness-strip {
    gap: var(--space-3) var(--space-5);
    margin: 0 0 var(--space-4);
    padding: var(--space-2-5) var(--space-4);
}

.dashboard-toolbar__form {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    margin: 0;
}

.dashboard-custom-zone__head {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.dashboard-custom-zone__title.page-title {
    font-size: var(--text-xl);
    margin: 0;
}

.custom-slot--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 7.5rem;
    border: 1px dashed var(--line-strong);
    box-shadow: none;
}

.custom-slot__label {
    display: block;
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    font-weight: 600;
}

.manager-tile.card {
    padding: var(--space-5);
}

a.manager-tile {
    display: block;
    color: inherit;
    text-decoration: none;
}

.status-legend__list {
    list-style: none;
    padding: 0;
    margin: var(--space-3) 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: var(--text-xs);
}

.alerts-strip__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.alerts-strip__item {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    padding: var(--space-3) var(--space-4);
}

.alerts-strip__detail {
    list-style: none;
    margin: var(--space-1) 0 0;
    padding: 0;
    font-size: var(--text-sm);
}

.alert-dot-lead {
    flex: none;
    margin-top: var(--space-1);
}

/* A tile's distribution or coverage bar: the progress bar's 6 px track (design §5). Each
   segment's width is its figure, the one style the template keeps. */
.tile-bar {
    display: flex;
    height: 6px;
    margin: var(--space-2) 0;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--line);
}

.tile-bar > *,
.tile-bar__seg {
    height: 100%;
    margin: 0;
    border-radius: 0;
}

.tile-bar > .level-bar__segment--beginner { background: var(--problem); }
.tile-bar > .level-bar__segment--intermediate { background: var(--brass); }
.tile-bar > .level-bar__segment--advanced { background: var(--good); }
.tile-bar > .score-bar__fill { background: var(--good); }
.tile-bar__seg--new { background: var(--good); }
.tile-bar__seg--mid { background: color-mix(in srgb, var(--good) 50%, var(--brass)); }
.tile-bar__seg--late { background: var(--brass); }
.tile-bar__seg--over { background: var(--problem); }
.tile-bar__seg--unknown { background: var(--line-strong); }

/* A tile's figures: small boxes, a number over its label. A risk flag's count keeps the
   flag's rose; a plain count (`--count`) is neutral. */
.tile-figures {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-3);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.flag-pill.tile-figure {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-control);
}

.flag-pill.tile-figure--count {
    background: var(--fill);
    color: var(--text);
}

.tile-figure .report-value {
    color: inherit;
}

.tile-link {
    display: inline-block;
    margin-top: var(--space-3);
}

/* A tile's list: divided rows, a label and its state. */
.tile-rows {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.tile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
}

.tile-row + .tile-row {
    border-top: 1px solid var(--line);
}

/* A drill page's figures, and its raw payload for the curious. */
.detail-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(11.25rem, 100%), 1fr));
    gap: var(--space-3);
}

.detail-raw {
    padding: var(--space-3);
    font-size: var(--text-xs);
    background: var(--fill);
    border-radius: var(--radius-control);
    overflow: auto;
}


/* ---------- 6. Media Queries (mobile-first, scaling up) ---------- */

@media (min-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    /* coder-1175 (fix queue 7): on a phone an SOP's title takes the row's first line whole,
       and Edit, the dot and the status follow on the next, instead of the title being
       squeezed into a column a few letters wide beside them. */
    .composer-list li {
        flex-wrap: wrap;
        row-gap: var(--space-1);
    }

    .composer-list__name {
        flex-basis: 100%;
    }

    /* coder-696: on a phone the page header's metadata line drops its dots (a wrapped
       line would start with one). */
    .page-meta {
        gap: var(--space-1) var(--space-3);
    }

    .page-meta > * + *::before {
        content: none;
    }

    .header-inner {
        padding: 0 var(--space-4);
    }

    /* D401: on a phone the hotel's name gives way first, so the header keeps one line
       beside the pin and Menu buttons; the tab title still names it. */
    .brand-divider,
    .brand-name {
        display: none;
    }

    /* coder-709 (D450 Phase 5d; design §5 "Header"): where the account area drops below the
       brand (WGIT Admin, the portfolio), the brand has its line to itself, so "WGIT Admin"
       stays beside "ITOps App" on a phone as on the desktop; a long name still ellipses. */
    .header-inner--account .brand-divider,
    .header-inner--account .brand-name {
        display: block;
    }

    /* coder-570: outside the shell (WGIT Admin, the portfolio), the account
       area's appearance choice drops below the brand on a phone, and the welcome line
       gives way; the choice's own label stays for screen readers. */
    .header-inner--account {
        flex-wrap: wrap;
    }

    .header-inner--account .user-menu {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: var(--space-2) var(--space-4);
    }

    .header-inner--account .user-name {
        display: none;
    }

    /* coder-731: WGIT Admin's search takes the header's last row, the whole width, as the
       shell's does under its top bar. */
    .site-header__search {
        order: 10;
        flex: 1 1 100%;
        margin-right: 0;
    }

    main {
        padding: var(--space-4) var(--space-4) var(--space-6);
    }

    /* D450 (coder-689): a field's text stays 16 px on a phone, as before, where body text
       is 14.5 px: smaller, Safari zooms the page in on focus. */
    .form-input:not(.form-input--sm),
    .form-select:not(.form-select--sm),
    .form-textarea {
        font-size: 1rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .flash-messages {
        padding: 0 var(--space-4);
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }

    /* P262 / R3 + R3b: app-wide mobile-table fix. Give every table its OWN
       horizontal-scroll context at phone width so wide tables scroll inside their
       card instead of clipping the page -- `display: block` + `overflow-x: auto`
       reaches bare `<table class="data-table">` surfaces too (most app tables are
       not hand-wrapped in `.data-table-wrapper`), so no per-template edit is
       needed. `.index-table` / `.drill-table` are the only non-`data-table`
       content tables (portfolio); they are brought into the same convention here.
       Cell padding is trimmed so more columns fit before scroll kicks in. */
    .data-table,
    .index-table,
    .drill-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: var(--space-2) var(--space-3);
    }

    /* coder-454: a table that opts in with `--reflow` stacks instead of scrolling:
       each row becomes a block and each cell shows its `data-label` above its value,
       so every column is visible without a sideways scroll. The header row stays in
       the accessibility tree, visually hidden like `.sr-only`. */
    .data-table--reflow {
        display: block;
        overflow-x: visible;
    }

    .data-table--reflow thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .data-table--reflow tbody,
    .data-table--reflow tr,
    .data-table--reflow td {
        display: block;
    }

    .data-table--reflow tr {
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--line);
    }

    .data-table--reflow tbody tr:last-child {
        border-bottom: none;
    }

    .data-table--reflow td {
        height: auto;
        border-bottom: none;
        padding: var(--space-1) var(--space-4);
    }

    .data-table--reflow td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: var(--text-xs);
        font-weight: 650;
        color: var(--text-2);
        margin-bottom: var(--space-1);
    }

    /* P265 / mobile sweep: stack stat cards in a single column on a phone. The
       2/3/4-column grids (`.stat-grid` base + `.stat-grid--cols-3/4`) otherwise
       force a too-wide min-content row that overflows the page horizontally. This
       rule wins over `.stat-grid--cols-*` here by source order (equal specificity,
       declared later) so the wide grids collapse without `!important`. */
    .stat-grid {
        grid-template-columns: 1fr;
    }

    /* P265 / mobile sweep: the assessment tool checklist is a 2-column grid; at
       phone width two columns of tool labels crowd and clip, so collapse to one. */
    .tool-checklist {
        grid-template-columns: 1fr;
    }

    .tool-usage-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* P270 / card-layout mobile sweep -- the card counterpart to P262/P265's
       table sweep. The user-facing learning-plan page is a card/section layout
       (`.plan-*`), not a table; those rules sit AFTER this breakpoint and carry
       no phone treatment, so the section-header row and the item rows clip /
       overflow at phone width. These overrides REUSE this breakpoint (no second
       CSS system) and touch phone width (<=640px) ONLY -- the desktop `.plan-*`
       rules are untouched, so no desktop regression. Covers plan_v2.html and
       the plan.html / plan_basics_cyber.html siblings that share the classes. */

    /* The header is a fixed `space-between` row (title block + "N of M done"
       progress) that doesn't stack, so the progress collides with the title at
       narrow width. Stack the progress under the title and trim the padding. */
    .plan-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
        padding: var(--space-4);
    }

    /* `.plan-item__status-block`'s `min-width: 160px` + `.plan-item__main`'s
       `flex: 1 1 280px` forces a row wider than a phone viewport before wrap
       kicks in. Drop the min-width and let the status block take its own full-
       width line under the title; left-align it (it was `flex-end`). `.plan-item`
       already has `flex-wrap: wrap`. The "Take quiz" / "Mark as complete" button
       and the "This didn't help me" flag form stay fully tappable. */
    .plan-item__status-block {
        min-width: 0;
        width: 100%;
        align-items: flex-start;
    }

    /* Trim the item/description horizontal padding from `var(--space-6)` to
       `var(--space-4)` to match the `main` / `.container` phone reduction so the
       card rows keep their width. */
    .plan-items,
    .plan-section__description {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    /* CODER-134: the /email-groups row wraps at phone width -- name and mail each
       take the full width, the type pill and the member count share a line under
       them. Without this the four-item flex row forces a min-content width wider
       than a 375px viewport. (The /vendor-contacts grid needs no counterpart:
       `auto-fill` + `minmax(280px, 1fr)` already collapses to one column.) */
    .eg-list__link {
        flex-wrap: wrap;
    }

    /* coder-708: a report's two-column list of practices or tools is one column. */
    .report-grid-2 {
        grid-template-columns: 1fr;
    }

    .eg-list__name,
    .eg-list__mail {
        flex: 1 1 100%;
    }

    .eg-list__type {
        margin-left: 0;
    }

    .eg-list__members {
        margin-left: auto;
    }
}

/* ---------------------------------------------------------------------------
 * Phase 2 Step 7: user-facing learning plan page
 * ------------------------------------------------------------------------- */

.plan-overview {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.plan-overview__label {
    font-size: var(--text-sm);
    color: var(--text-2);
    flex: 1 1 200px;
}

.plan-overview__bar {
    flex: 2 1 280px;
    height: 8px;
    background: var(--line);
    border-radius: 4px;
    overflow: hidden;
    min-width: 200px;
}

.plan-overview__fill {
    height: 100%;
    background: var(--accent);
    transition: width 200ms ease-out;
}

.plan-overview__pct {
    font-weight: 600;
    color: var(--text);
    min-width: 3em;
    text-align: right;
}

/* One Module Set per <details> block. Open state matches the rest of the
 * app's card chrome. */
.plan-section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-5);
    overflow: hidden;
}

.plan-section[open] {
    border-color: var(--accent);
}

.plan-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    cursor: pointer;
    list-style: none;
    background: var(--fill);
}

.plan-section__header::-webkit-details-marker { display: none; }

.plan-section__header::before {
    content: "▸";
    color: var(--text-2);
    font-size: var(--text-base);
    margin-right: var(--space-2);
    transition: transform 200ms ease-out;
    display: inline-block;
}

.plan-section[open] .plan-section__header::before {
    transform: rotate(90deg);
}

.plan-section__title {
    font-family: var(--font-display, serif);
    font-size: var(--text-xl);
    margin: 0;
    color: var(--text);
}

.plan-section__meta {
    font-size: var(--text-xs);
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.plan-section__progress {
    font-size: var(--text-sm);
    color: var(--text-2);
    white-space: nowrap;
}

.plan-section__description {
    margin: 0;
    padding: var(--space-4) var(--space-6) 0;
    font-size: var(--text-sm);
    color: var(--text-2);
    line-height: 1.55;
}

.plan-items {
    list-style: none;
    margin: 0;
    padding: var(--space-4) var(--space-6);
}

/* Suggested ("elective") group -- offered inside its set, visually set apart so
   it never reads as part of the counted work. Tinted, inset, and lower-contrast
   than the counted list above it. */
.plan-suggested {
    margin: 0 var(--space-6) var(--space-4);
    border: 1px dashed var(--line);
    border-radius: var(--radius-card);
    background: var(--ground);
}

.plan-suggested__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4) 0;
}

.plan-suggested__title {
    font-weight: 600;
    font-size: var(--text-sm);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-2);
}

.plan-suggested__count {
    font-size: var(--text-xs);
    color: var(--text-2);
    white-space: nowrap;
}

.plan-suggested__note {
    margin: var(--space-1) 0 0;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-2);
    line-height: 1.55;
}

.plan-items--suggested {
    padding: var(--space-2) var(--space-4) var(--space-3);
}

.plan-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.plan-item:last-child {
    border-bottom: none;
}

.plan-item--completed {
    opacity: 0.7;
}

.plan-item--skipped {
    opacity: 0.55;
}

.plan-item__main {
    flex: 1 1 280px;
    min-width: 0;
}

.plan-item__title {
    font-size: var(--text-base);
    font-weight: 500;
    margin: 0 0 var(--space-1);
}

.plan-item__title a {
    color: var(--accent-text);
    text-decoration: none;
}

.plan-item__title a:hover {
    text-decoration: underline;
}

.plan-item__meta {
    font-size: var(--text-xs);
    color: var(--text-2);
    margin: 0;
}

.plan-item__priority {
    color: var(--problem);
    font-weight: 500;
}

/* "This didn't help me" flag affordance (Wave 14 .5 / P214). Small and
   unobtrusive: a plain-text disclosure that expands to an optional-comment
   form. v3-backed Tools-to-Adopt items only; hidden once flagged. */
.plan-item__flag {
    margin-top: var(--space-2);
}

.plan-item__flag-toggle {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--text-2);
    cursor: pointer;
}

.plan-item__flag-toggle:hover {
    color: var(--text-2);
    text-decoration: underline;
}

.plan-item__flag-form {
    margin: var(--space-2) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    max-width: 420px;
}

.plan-item__flag-label {
    font-size: var(--text-xs);
    color: var(--text-2);
}

.plan-item__flag-input {
    width: 100%;
    font: inherit;
    font-size: var(--text-sm);
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    resize: vertical;
}

.plan-item__status-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-2);
    min-width: 160px;
}

.plan-item__status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--chip-height);
    padding: 2px var(--chip-pad-x);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    line-height: var(--leading-tight);
    letter-spacing: normal;
    text-transform: none;
    vertical-align: middle;
    background: var(--line);
    color: var(--text-2);
}

/* coder-693: the chip family -- completed Done, in progress Running, the rest neutral. */
.plan-item--completed .plan-item__status {
    background: var(--good-tint);
    color: var(--good);
}

.plan-item--in_progress .plan-item__status {
    background: var(--accent-tint);
    color: var(--accent-text);
}

.plan-quiz {
    margin: 0;
    padding: var(--space-5) var(--space-6);
    background: var(--fill);
    border-top: 1px solid var(--line);
}

.plan-quiz--locked {
    color: var(--text-2);
}

.plan-quiz__title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.plan-quiz--unlocked .plan-quiz__title {
    color: var(--text);
}

.plan-quiz__hint {
    font-size: var(--text-sm);
    margin: 0;
}

/* ---------------------------------------------------------------------------
 * Phase 2 Step 10: user-facing quiz form and results
 * ------------------------------------------------------------------------- */

.quiz-form {
    margin-top: var(--space-4);
}

.quiz-question {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: var(--space-5) var(--space-6);
    margin: 0 0 var(--space-4);
    background: var(--card);
}

.quiz-question__legend {
    padding: 0;
    margin: 0;
}

.quiz-question__number {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-2);
}

.quiz-question__text {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text);
    margin: var(--space-2) 0 var(--space-4);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    cursor: pointer;
    transition: background 200ms ease-out, border-color 200ms ease-out;
}

.quiz-option:hover {
    background: var(--fill);
    border-color: var(--line-strong);
}

.quiz-option input[type="radio"]:checked + span {
    font-weight: 500;
}

.quiz-option:has(input[type="radio"]:checked) {
    background: var(--accent-tint);
    border-color: var(--accent);
}

/* ----- Results page ----- */

.quiz-result-card {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
}

.quiz-result-card__score {
    font-family: var(--font-display, serif);
    font-size: var(--text-4xl);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.quiz-result-card--pass .quiz-result-card__score {
    color: var(--good);
}

.quiz-result-card--fail .quiz-result-card__score {
    color: var(--problem);
}

.quiz-result-card__label {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.quiz-result-card__sub {
    font-size: var(--text-sm);
    color: var(--text-2);
}

.quiz-feedback {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-3);
    background: var(--card);
}

.quiz-feedback--correct {
    border-left: 4px solid var(--good);
}

.quiz-feedback--wrong {
    border-left: 4px solid var(--problem);
}

.quiz-feedback__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quiz-feedback__number {
    color: var(--text-2);
}

.quiz-feedback--correct .quiz-feedback__verdict {
    color: var(--good);
    font-weight: 600;
}

.quiz-feedback--wrong .quiz-feedback__verdict {
    color: var(--problem);
    font-weight: 600;
}

.quiz-feedback__text {
    font-size: var(--text-base);
    margin: 0 0 var(--space-3);
    color: var(--text);
}

.quiz-feedback__answers {
    font-size: var(--text-sm);
    color: var(--text-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.quiz-feedback__explanation {
    font-size: var(--text-sm);
    color: var(--text-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
    line-height: 1.55;
}

/* ---------------------------------------------------------------------------
 * Phase 2 Step 12: landing-page learning plan card
 * ------------------------------------------------------------------------- */

.learning-card .learning-card__progress {
    height: 6px;
    background: var(--line);
    border-radius: 3px;
    overflow: hidden;
    margin: var(--space-3) 0 var(--space-2);
}

.learning-card .learning-card__progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 200ms ease-out;
}

/* ---------------------------------------------------------------------------
 * P269: in-app YouTube training player (learning.watch)
 * Responsive 16:9 embed on the existing .plan-* system -- mobile-first, the box
 * scales to phone width (padding-top reserves the aspect ratio; the iframe fills
 * it absolutely). No second CSS framework.
 * ------------------------------------------------------------------------- */

.video-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    margin: var(--space-4) 0;
    background: var(--footer-bg);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-page__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-4) 0;
}

/* ---------------------------------------------------------------------------
 * P297 — Vendor-contact detail card (the `.vc-*` body the shared
 * `app/content/render.py::render_contact_card` emits). The renderer ALREADY
 * emits structured `vc-card` / `__field` / `__label` / `__value` spans, but
 * main.css carried NO rule for any of them, so on the detail view the label and
 * value ran together inline ("Sales Phone+17786001722"). This adds the missing
 * card treatment — each populated field is its own labelled cell, a small
 * uppercase label ABOVE a prominent value — reusing the existing product tokens
 * and the `.stat-card` idiom so it matches the rest of the app. The same body
 * renders inside the `ts-embed--card` escalation embed (shared renderer), so the
 * styling lands there too — intended. CSS only; no markup/renderer change here
 * (the link-wrap was P296).
 * ------------------------------------------------------------------------- */

/* The escalation embed (`render_vendor_embed`): its label, the contact card and the
   escalation line stack, and the card is never flush against them (coder-437). */
.ts-embed {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.ts-embed--card {
    gap: var(--space-4);
}

.vc-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: var(--space-5) var(--space-6);
}

/* The vendor logo + name head the card, each spanning the full width above the
   field grid. */
.vc-card__logo {
    height: 48px;
    width: auto;
    padding: var(--image-plate-inset, 0);
    border-radius: var(--image-plate-radius, 0);
    background: var(--image-plate, transparent);
}

.vc-card__name {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--fill);
}

/* Each field is its own labelled cell: a small uppercase label stacked ABOVE a
   prominent value (the Get-Help support-card treatment). `flex-direction:
   column` makes the two inline spans stack — that is what fixes the
   run-together defect. */
.vc-card__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--fill);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.vc-card__label {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
}

.vc-card__value {
    font-size: var(--text-base);
    color: var(--text);
    line-height: 1.4;
    word-break: break-word; /* long emails / URLs wrap inside the cell */
}

/* The tappable contact-method anchor (P296: tel:/mailto:/href). Navy by
   default, sage on hover — the product's existing link convention. */
.vc-card__link {
    color: var(--accent-text);
    font-weight: 500;
    text-decoration: none;
}

.vc-card__link:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

/* coder-658 (fix queue 8): the vendor page's What to do, the card's last field, the full
   width; its paragraphs spaced, a long address wrapping at 390. */
.vc-card__field--wide {
    grid-column: 1 / -1;
}

.vc-card__notes p {
    margin: 0;
}

.vc-card__notes p + p,
.vc-card__notes h2 + p,
.vc-card__notes p + h2 {
    margin-top: var(--space-3);
}

.vc-card__notes a {
    overflow-wrap: anywhere;
}

/* Desktop: tile the field cells two-up; the logo and name span the full row. */
@media (min-width: 768px) {
    .vc-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .vc-card__logo,
    .vc-card__name {
        grid-column: 1 / -1;
    }
}

/* ==========================================================================
   SOP import wizard + drag-image-between-steps (CODER-056)
   ========================================================================== */
.import-wizard {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.4fr);
    gap: var(--space-4);
    align-items: start;
}
@media (max-width: 800px) {
    .import-wizard { grid-template-columns: 1fr; }
}
.import-wizard__page {
    max-width: 100%;
    padding: var(--image-plate-inset, 0);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--image-plate, transparent);
    display: block;
    cursor: zoom-in;
}
.import-wizard__preview { position: sticky; top: var(--space-3); }
/* Sticky only earns its keep while the preview sits BESIDE the steps. Once the
   grid collapses to one column the two cards share a horizontal band, and a
   sticky box -- being positioned, and clamped to the whole .import-wizard box
   rather than to its own grid row -- rides the scroll straight down and paints
   on top of the proposal editor (CODER-090). Must follow the rule above: same
   specificity, and a media query adds none. */
@media (max-width: 800px) {
    .import-wizard__preview { position: static; }
}
/* CODER-094: a uniform tile grid. The old flex-wrap row sized every cell to its
   own thumbnail, so a row of mixed-aspect screenshots left the attach selects on
   a ragged line at different heights -- "very strange looking". Equal columns,
   a fixed letterbox for the thumbnail, and the select pinned to the bottom of
   the cell make the controls line up whatever the images are shaped like. */
.import-wizard__images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.import-wizard__image-cell {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-1);
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--fill);
}
/* The letterbox. Fixed height so every tile is the same height; the thumbnail
   is centred and contained inside it rather than setting the tile's size. */
.import-wizard__thumb-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--card);
    overflow: hidden;
}
/* CODER-093: 90px was unreadable for the Opera UI screenshots these documents
   are made of. 140px is the cheap half of the fix; the lightbox is the other
   half. CODER-094 keeps the 140px box and contains the image inside it. */
.import-wizard__thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: var(--image-plate-inset, 0);
    border-radius: var(--image-plate-radius, 0);
    background: var(--image-plate, transparent);
    cursor: zoom-in;
}
.import-wizard__nav {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

/* CODER-093 Phase 3: ONE picker per wizard page ("Images in this document"),
   not one per step -- a 9-step page with a 12-image pool used to paint 108
   thumbnails. The pool is shared across the whole document (LibreOffice emits a
   single resource dict), so the honest place for it is the page, once. */
.import-wizard__pool {
    margin: var(--space-3) 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}
.import-wizard__pool-title {
    font-weight: 600;
    margin-bottom: var(--space-1);
}
/* The attach control: full width, BELOW the thumbnail, inside the cell, and
   pushed to the bottom (margin-top:auto) so selects align across a row. */
.import-wizard__attach {
    margin-top: auto;
}
.import-wizard__attach .form-select {
    width: 100%;
}
/* The per-step chips: an attached image shown small next to its step, with the
   detach control on the chip itself. */
.import-wizard__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.import-wizard__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--fill);
}
.import-wizard__chip img {
    max-width: 56px;
    max-height: 56px;
    padding: var(--image-plate-inset, 0);
    border-radius: var(--image-plate-radius, 0);
    background: var(--image-plate, transparent);
    display: block;
    cursor: zoom-in;
}

/* CODER-093 Phase 2 / CODER-094 Phase 2: the shared image lightbox (lightbox.js).
   CODER-093 sized the image to the viewport and called it zoom. For a PORTRAIT
   page raster the binding cap is max-height, which lands at ~650px wide on a
   landscape monitor -- the same size as the in-column render. Hence explicit
   scale controls, and a stage that scrolls on BOTH axes so a zoomed page pans.
   coder-695 (D450 Phase 3c): the panel's ground, radius, shadow and scrim, and its bar's
   look, are main.css "Dialogs and drawers" (`.dialog`, `.dialog__header`), which
   lightbox.js and sop_image_editor.js add; these rules keep each one's size and layout. */
#lightbox {
    width: 96vw;
    height: 96vh;
    max-width: 96vw;
    max-height: 96vh;
    padding: 0;
    border: 0;
    outline: var(--float-edge);
    outline-offset: -1px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#lightbox::backdrop { background: var(--scrim); }
/* The control bar: fixed within the dialog, above the stage that scrolls. */
.lightbox__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
/* coder-695: the zoom buttons are small secondary buttons (.btn--sm), at least square. */
.lightbox__btn {
    min-width: 34px;
}
.lightbox__readout {
    min-width: 52px;
    text-align: center;
    color: var(--text-2);
}
/* Centring is done with `margin: auto` on the image rather than with
   align-items/justify-content, which clip the overflowing edge of an item bigger
   than its flex container -- and "bigger than the container" is the entire point
   of a zoomed page. */
.lightbox__stage {
    flex: 1 1 auto;
    overflow: auto;
    display: flex;
    background: var(--fill);
}
/* Default state and the [Fit] button: contained in the stage, which is the
   dialog (96vw / 96vh) less the control bar -- the CODER-093 96vw/90vh, minus
   the overflow that a hard vh cap inside a flex column would cause. Any other
   scale sets an explicit pixel width in JS and the stage scrolls to reach it. */
.lightbox__img {
    display: block;
    margin: auto;
    padding: var(--image-plate-inset, 0);
    border-radius: var(--image-plate-radius, 0);
    background: var(--image-plate, var(--fill));
}
.lightbox__img--fit {
    max-width: 100%;
    max-height: 100%;
}
/* coder-695: Close is the header's close button (.dialog__close, a small secondary). */
.lightbox__close {
    margin-left: auto;
}

/* coder-276 -- the mandatory SOP step image editor (sop_image_editor.js).
   Same native-<dialog> chrome idiom as #lightbox (bar + ::backdrop, dialog
   itself unstyled/transparent), scaled to the editor's own needs: a fixed
   toolbar above a scrollable canvas stage. Tool buttons reuse
   .btn/.btn--secondary/.btn--sm -- the editor introduces no new button
   vocabulary, only the active-tool indicator and the canvas stage itself.

   coder-282 -- the stage (.sop-image-editor__wrap) is now a fixed-size flex
   viewport (not a shrink-to-content box) so JS can read its clientWidth/
   clientHeight to compute a fit-to-screen display scale independent of the
   canvas's internal pixel resolution. The canvas elements' CSS width/height
   are set inline by JS per the current zoom level; their width/height
   *attributes* (native resolution) are untouched by any of this. When the
   scaled canvas exceeds the stage, native overflow scrolling (no custom pan
   tool) makes the rest reachable. */
#sop-image-editor {
    width: 96vw;
    max-width: 96vw;
    height: 92vh;
    max-height: 92vh;
    padding: 0;
    border: 0;
    outline: var(--float-edge);
    outline-offset: -1px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#sop-image-editor::backdrop { background: var(--scrim); }
/* coder-377: an unconditional `display: flex` on an ID selector beats the UA
   `dialog:not([open]) { display: none }`, so a closed dialog stayed painted at
   the top of the page. Gate the flex layout on [open]. */
#sop-image-editor:not([open]),
#lightbox:not([open]) { display: none; }
/* coder-456: the bar keeps its 52 px whether or not the Text tool's size select
   (35 px, taller than the 32 px small buttons) is showing, so the stage below never
   changes height under the canvas once its fit scale has been computed. */
.sop-image-editor__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    /* coder-456's fixed height, kept by coder-458: with 32 px small fields the bar is
       49 px whether or not the Text tool's size select shows, but text_label_position
       still lands 2-6 canvas px off horizontally at that stage size without it. */
    min-height: 52px;
    padding: var(--space-2) var(--space-3);
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.sop-image-editor__spacer { flex: 1 1 auto; }
.sop-image-editor__tool--active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}
.sop-image-editor__wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background: var(--fill);
}
.sop-image-editor__canvas { display: block; }
.sop-image-editor__canvas--overlay {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
}
.sop-image-editor__text-input {
    position: absolute;
    z-index: 1;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 1px 4px;
    border: 1px solid var(--accent);
    /* D401: the floating text box over the image keeps a small radius -- at XS it is
       19 px tall, and an 8 px corner would cut into the glyphs it frames. */
    border-radius: 2px;
    background: var(--card);
    color: var(--text);
}
/* coder-287 -- Font Size label+select pair (XS/S/M/L/XL), shown only while
   the Text tool is active (JS toggles display via
   refreshSizeControlVisibility). Replaces coder-284's five toggle buttons;
   the select reuses .form-select/.form-select--sm (coder-237) -- no new
   form-control vocabulary, just width:auto so it doesn't fill the toolbar. */
.sop-image-editor__sizes {
    display: none;
    align-items: center;
    gap: var(--space-2);
}
.sop-image-editor__sizes-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}
.sop-image-editor__sizes .form-select {
    width: auto;
    min-width: 4.5em;
}
/* coder-1172 -- the "Callout number" box, shown only while the Callout tool is active
   (refreshSizeControlVisibility), on the Font Size pair's layout: two digits and the
   browser's arrows, no wider. */
.sop-image-editor__callout-number .form-input {
    width: 4.5em;
}

/* Phase 5 (F8) drag-image-between-steps affordances. */
.composer-dropzone--dragging { opacity: 0.5; }
.composer-step--drop {
    outline: 2px dashed var(--accent-text);
    outline-offset: 2px;
}
.composer-move-block {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
}
/* coder-237 -- token-based compact size modifier for .form-select, mirroring
   .form-input--sm (selects and inputs share the same base rule at
   .form-input, .form-select { ... } above). coder-458: both are 32 px tall
   (the rule beside .form-input--sm), so this keeps the side padding only. */
.form-select--sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}


/* ==========================================================================
   CODER-095 -- the published SOP read view.

   Michael, off the live parking SOP (/troubleshooting/sop/property/4): "the
   semantics are right ... now we just need to work on formatting -- we need it
   to be clean and clear. Think elegant."

   The diagnosis was that `.sop-step`, `.sop-step__title` and `.ts-sop-*` had
   been EMITTED by the renderer since D257 but never styled, so a twelve-step SOP
   arrived as one undifferentiated column of 16px body text: step label, title, body
   prose, guest-facing script and Opera menu path all at identical visual weight.
   Nothing here changes what an SOP says. It changes only what the reader's eye
   is told to do with it.
   ========================================================================== */

.sop-read {
    /* Reading measure. ~70ch of the body face lands near 660px -- long enough for an
       Opera instruction to stay on one line, short enough that the eye finds the
       next line's start without hunting. The .container--medium 960px stays the
       PAGE width so the stale banner and version footer keep their full bleed. */
    --sop-measure: 70ch;
    /* Rail geometry, shared by the disc, the connector and the body indent so the
       three can never drift apart. */
    --sop-disc-size: 2rem;
    --sop-rail-gap: var(--space-5);
}

.sop-read .page-intro {
    max-width: var(--sop-measure);
}

.sop-read .ts-sop-body {
    max-width: var(--sop-measure);
    margin-top: var(--space-8);
}


/* ---------- The step rail ---------- */

/* Each step is a row on a single hairline that runs the length of the SOP, with
   the number carried by a disc sitting ON the line -- the app's existing
   circled-numeral idiom (.composer-step__num), dialled down from the composer's
   sage-on-cream to a quiet stone disc, because on a read view the number is
   orientation, not a call to action. */
.sop-read .sop-step {
    position: relative;
    padding-left: calc(var(--sop-disc-size) + var(--sop-rail-gap));
    padding-bottom: var(--space-8);
}

/* The connector. Runs the full height of the step, so consecutive steps join
   seamlessly; the disc is opaque and painted over its top end. */
.sop-read .sop-step::before {
    content: "";
    position: absolute;
    left: calc(var(--sop-disc-size) / 2);
    top: 0;
    bottom: 0;
    width: 1px;
    margin-left: -0.5px;
    background: var(--line);
}

/* Nothing below the last step to connect to -- a rule trailing into whitespace
   reads as a truncation bug. */
.sop-read .sop-step:last-child::before {
    display: none;
}

.sop-read .sop-step:last-child {
    padding-bottom: var(--space-4);
}

.sop-read .sop-step__disc {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--sop-disc-size);
    height: var(--sop-disc-size);
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--accent-text);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Serif, and a clear size step above the body -- the single change that makes
   the step/title/body hierarchy register at a glance. Optically centred against
   the disc rather than sitting on the same baseline. */
.sop-read .sop-step__title {
    margin: 0 0 var(--space-4);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    padding-top: 0.1em;
}


/* ---------- Body prose ---------- */

.sop-read .sop-prose {
    margin: 0 0 var(--space-4);
    line-height: 1.7;
    color: var(--text);
}

/* coder-1175 (fix queue 10): an address in a step's text is a link, opening a new tab; a
   long one wraps rather than pushing the page sideways on a phone. */
.sop-link {
    overflow-wrap: anywhere;
}

/* coder-1175: a button in an SOP step -- the app's secondary button with the external-link
   icon, opening its address in a new tab. A long label wraps inside the button on a phone. */
.sop-button {
    margin: 0 0 var(--space-4);
}

.sop-button__link {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    overflow-wrap: anywhere;
}

.sop-read .sop-step__main > *:last-child {
    margin-bottom: 0;
}


/* ---------- Guest-facing verbiage ---------- */

/* A line a human reads ALOUD to a guest is a different kind of sentence from an
   instruction about Opera, and it was rendering as the same grey paragraph. The
   inset rule plus italic serif says "this is speech" before a word is read. */
.sop-read .sop-verbiage {
    margin: var(--space-5) 0;
    padding: var(--space-1) 0 var(--space-1) var(--space-5);
    border-left: 1px solid var(--accent);
}

.sop-read .sop-verbiage p {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-style: italic;
    line-height: 1.6;
    color: var(--text);
}

/* The "Suggested Verbiage:" lead-in is a LABEL, not speech -- so it stays in the
   sans face, small and quiet, and does not get the italic treatment. */
.sop-read .sop-verbiage .sop-verbiage__label {
    margin: 0 0 var(--space-2);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
}


/* ---------- Opera menu paths ---------- */

/* `Options>Fixed Charge> Trans Code 2200` is a thing you CLICK, not a thing you
   read. Setting it as a chip lets the eye pick it out of the sentence and stops
   the `>` chain from reading as punctuation. */
.sop-read .sop-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    padding: 0.1em 0.4em;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--fill);
    color: var(--text-2);
    white-space: nowrap;
}


/* ---------- Figures ---------- */

.sop-read .sop-figure {
    margin: var(--space-5) 0;
    text-align: center;
}

/* A step image, wherever a document is read: on the light plate in dark (design §9). */
.sop-figure__img {
    padding: var(--image-plate-inset, 0);
    background: var(--image-plate, transparent);
}

.sop-read .sop-figure__img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--image-plate-radius, 4px);
    background: var(--image-plate, var(--card));
    cursor: zoom-in;
}


/* ---------- Page furniture (emitted since D250/D251, never styled) ---------- */

.sop-read .ts-sop-stale {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-3);
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--brass);
    border-left-width: 3px;
    border-radius: var(--radius-card);
    background: var(--fill);
}

.sop-read .ts-sop-stale__label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--problem);
}

.sop-read .ts-sop-stale__detail {
    font-size: var(--text-sm);
    color: var(--text-2);
}

.sop-read .ts-sop-versioning {
    max-width: var(--sop-measure);
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.sop-read .ts-sop-history__stamp {
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-2);
}

.sop-read .ts-sop-history__list {
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
}

.sop-read .ts-sop-history__item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-1) 0;
    font-size: var(--text-sm);
    color: var(--text-2);
}

.sop-read .ts-sop-history__version {
    font-variant-numeric: tabular-nums;
    color: var(--text);
    font-weight: 600;
}


/* ---------- Document / Guided (D352 §2) ---------- */

/* Every SOP reads two ways. The switch is a pair of quiet tabs under the title;
   the active one carries the navy rule. */
.sop-read .sop-views {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    margin-top: var(--space-5);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--line);
    max-width: var(--sop-measure);
}

.sop-read .sop-views__link {
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
}

.sop-read .sop-views__link--active {
    border-bottom-color: var(--accent);
    color: var(--accent-text);
}

/* The Document view's question: what is asked, then each answer with where it
   leads, so a reader of the page (or of the export) can follow every branch. */
.sop-read .sop-question {
    margin-top: var(--space-5);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--fill);
}

.sop-read .sop-question__text {
    margin: 0 0 var(--space-3);
    font-weight: 600;
    color: var(--text);
}

.sop-read .sop-question__answers {
    margin: 0;
    padding-left: var(--space-5);
}

.sop-read .sop-question__to {
    margin-left: var(--space-2);
    color: var(--text-2);
}

/* The Guided view: one step in a card, its answers as buttons below it. The card
   carries no margin (card spacing is the container's): the view switch above it
   carries the space. */
.sop-read .sop-guided,
.sop-read .sop-guided-end {
    max-width: var(--sop-measure);
}

.sop-read .sop-guided__title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.3;
}

.sop-read .sop-guided__body > *:last-child {
    margin-bottom: 0;
}

.sop-read .sop-guided__question {
    margin-top: var(--space-5);
    border: 0;
}

.sop-read .sop-guided__ask {
    margin-bottom: var(--space-3);
    font-weight: 600;
    color: var(--text);
}

.sop-read .sop-guided__answers {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.sop-read .sop-guided__nav {
    margin-top: var(--space-5);
}

.sop-read .sop-guided-end__card,
.sop-read .sop-guided-end__ticket {
    margin-top: var(--space-4);
}


/* ---------- Narrow viewports ---------- */

/* Below ~600px the rail gutter costs more than it earns, so the disc goes inline
   above the title and the body reclaims the full width. The connector stays --
   it is what makes twelve steps read as a sequence rather than twelve headings. */
@media (max-width: 600px) {
    .sop-read {
        --sop-disc-size: 1.75rem;
        --sop-rail-gap: var(--space-3);
    }

    .sop-read .sop-step__title {
        font-size: var(--text-lg);
    }

    .sop-read .sop-verbiage {
        padding-left: var(--space-4);
    }

    .sop-read .sop-verbiage p {
        font-size: var(--text-base);
    }

    .sop-read .sop-path {
        white-space: normal;
    }
}


/* ==========================================================================
   coder-276 -- print/PDF stylesheet for the published SOP read view.

   Browser print-to-PDF is the export path (no server-side PDF renderer for
   SOPs). One rule: the same read-view DOM as screen, styled for print --
   never a forked print-only template (a later docx exporter mirrors this
   same block->visual mapping, so it must stay centralized here). The print
   header (.sop-print-header, markup in troubleshooting/sop.html) exists in
   the DOM at all times; it is what toggles, screen vs print, not the markup.
   ========================================================================== */

.sop-print-header { display: none; }

@media print {
    /* App chrome: nav, header/footer, buttons, edit affordances, the agent
       widget, flash messages -- none of it belongs on a laminated desk copy. */
    .site-header,
    .site-footer,
    .flash-messages,
    #agent-widget,
    .sop-read .page-actions,
    .sop-read .pin-form,
    .sop-read .ts-sop-versioning {
        display: none !important;
    }

    .sop-print-header {
        display: block;
        margin-bottom: var(--space-6);
        padding-bottom: var(--space-4);
        border-bottom: 1px solid var(--line);
    }
    .sop-print-header__property {
        font-size: var(--text-sm);
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--text-2);
    }
    .sop-print-header__title {
        margin: var(--space-1) 0 var(--space-3);
        font-family: var(--font-display);
        font-size: var(--text-2xl);
        color: var(--text);
    }
    .sop-print-header__meta {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-1) var(--space-6);
        margin: 0;
        font-size: var(--text-sm);
    }
    .sop-print-header__field { display: flex; gap: var(--space-1); }
    .sop-print-header__field dt {
        font-weight: 600;
        color: var(--text-2);
    }
    .sop-print-header__field dd { margin: 0; }

    /* The page-title h1 in .page-intro duplicates .sop-print-header__title --
       .page-intro itself is hidden above via .sop-read .page-actions... no,
       page-intro carries no chrome of its own besides the actions button, so
       only the redundant title needs suppressing; the breadcrumb link is
       inert ink on paper and costs nothing to leave, but the duplicate h1
       would read as a doubled heading directly under the print header. */
    .sop-read .page-intro .page-title { display: none; }

    /* Step containers: avoid an orphaned title at a page bottom, and prefer
       not to split a step body across pages when it reasonably fits on one. */
    .sop-read .sop-step {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .sop-read .sop-step__title {
        break-after: avoid;
        page-break-after: avoid;
    }

    /* Full-width images; the lightbox affordance is inert in print (no click
       handler runs on a printed page, but the zoom cursor/hover cue is
       screen-only chrome). */
    .sop-read .sop-figure__img {
        max-width: 100%;
        cursor: default;
    }
    #lightbox { display: none !important; }
}


/* ==========================================================================
   CODER-100 -- the onsite-calendar surface (List / Week / Month).

   The page was a bare <ul> of raw UTC ISO timestamps against no CSS at all: the
   `.oc-*` classes the P121 card emitted had never been given a rule. This block is
   the whole surface, written in the SOP READ VIEW's idiom rather than a parallel
   style system:

     * a reading measure on the intro (`--oc-measure`), as `.sop-read` does;
     * hairline `--line` rules doing the dividing, not boxes and shadows;
     * `--font-display` for the headings that ORIENT you (the day, the month), the
       body face for everything you read at speed;
     * `--text-2` for anything supporting -- locations, empty lines, day numbers.

   The pill toggle borrows the `.freq-option label` vocabulary (999px radius, stone
   hairline, navy-on-cream when active) so the toggle is a shape the product already
   uses. No JS: the pills are links.
   ========================================================================== */

.oc-read {
    /* Same measure as the SOP read view -- the list view is prose-shaped and wants
       the same ~70ch column. The grids opt out below, since a five- or seven-column
       week needs the full .container--medium width. */
    --oc-measure: 70ch;
}

.oc-read .page-intro {
    max-width: var(--oc-measure);
}


/* ---------- View toggle ---------- */

.oc-views {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-6);
}

.oc-views__pill {
    display: block;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color 200ms ease-out, border-color 200ms ease-out,
                background-color 200ms ease-out;
}

.oc-views__pill:hover {
    border-color: var(--accent);
    color: var(--accent-text);
}

.oc-views__pill--active,
.oc-views__pill--active:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}


/* ---------- Period line + prev/next ---------- */

.oc-period {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
}

.oc-period__label {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text);
}

.oc-period__nav {
    display: flex;
    gap: var(--space-4);
}

.oc-period__step {
    font-size: var(--text-sm);
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
}

.oc-period__step:hover {
    color: var(--accent-text);
}


/* ---------- Graceful states ---------- */

/* Not-configured and temporarily-unavailable. Deliberately NOT a card with a
   border and a shadow: the honest states read better as a quiet paragraph than as
   an object demanding attention. */
.oc-notice {
    max-width: var(--oc-measure);
    margin-top: var(--space-6);
    padding: var(--space-5) 0 var(--space-5) var(--space-5);
    border-left: 1px solid var(--accent);
}

.oc-notice--unavailable {
    border-left-color: var(--brass);
}

.oc-notice__title {
    margin: 0 0 var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--text);
}

.oc-notice__body {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--text-2);
}


/* ---------- List view ---------- */

.oc-days {
    max-width: var(--oc-measure);
    margin-top: var(--space-6);
}

/* One hairline per day, the SOP rail's logic flattened: the rule is what tells you
   five separate days were checked, which is the whole point of rendering the empty
   ones. */
.oc-day {
    padding: var(--space-5) 0;
    border-bottom: 1px solid var(--line);
}

.oc-day:last-child {
    border-bottom: none;
}

.oc-day__label {
    margin: 0 0 var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text);
}

.oc-day--today .oc-day__label::after {
    content: "Today";
    margin-left: var(--space-3);
    padding: 0.1em 0.5em;
    border-radius: var(--radius-pill);
    background: var(--accent-tint);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-text);
    vertical-align: middle;
}

.oc-day__events {
    margin: 0;
    padding: 0;
    list-style: none;
}

.oc-day__empty {
    margin: 0;
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--text-2);
}


/* ---------- One event ---------- */

/* The time leads, in tabular numerals so a column of them aligns; the subject is
   what you read; the location is supporting detail and is set as such. */
.oc-event {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-2) 0;
}

.oc-event__when {
    flex: 0 0 auto;
    min-width: 11ch;
    font-size: var(--text-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.oc-event__subject {
    flex: 1 1 12ch;
    color: var(--text);
}

.oc-event__where {
    flex: 0 1 auto;
    font-size: var(--text-sm);
    color: var(--text-2);
}

/* In a week column there is no room for a row; the three parts stack. */
.oc-event--stacked {
    flex-direction: column;
    gap: 0;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--fill);
}

.oc-event--stacked:last-child {
    border-bottom: none;
}

.oc-event--stacked .oc-event__when {
    min-width: 0;
    font-size: var(--text-xs);
}


/* ---------- Week view ---------- */

.oc-week {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.oc-week__col {
    padding-top: var(--space-3);
    border-top: 2px solid var(--line);
}

/* Today gets the sage rule rather than a filled cell -- the same restraint the
   admin subnav uses to mark its active tab. */
.oc-week__col--today {
    border-top-color: var(--accent);
}

.oc-week__head {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
}

.oc-week__weekday {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
}

.oc-week__date {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.oc-week__events {
    margin: 0;
    padding: 0;
    list-style: none;
}


/* ---------- Month view ---------- */

.oc-month {
    margin-top: var(--space-6);
}

.oc-month__weekdays,
.oc-month__week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.oc-month__weekday {
    padding: var(--space-2) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
}

.oc-month__cell {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-height: 6.5rem;
    padding: var(--space-2);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background: var(--card);
}

.oc-month__week:last-child .oc-month__cell {
    border-bottom: 1px solid var(--line);
}

.oc-month__cell:last-child {
    border-right: 1px solid var(--line);
}

/* Weekends stay in the grid (a month with five columns is not a month) but recede,
   and days belonging to the neighbouring months recede further still. */
.oc-month__cell--weekend {
    background: var(--fill);
}

.oc-month__cell--outside {
    background: var(--ground);
}

.oc-month__cell--today {
    box-shadow: inset 0 2px 0 0 var(--accent);
}

.oc-month__daynum {
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
}

.oc-month__cell--today .oc-month__daynum {
    font-weight: 700;
    color: var(--accent-text);
}

/* A chip has to survive a 13-character column, so it truncates rather than wraps --
   the full text stays reachable in the title attribute. */
.oc-chip {
    display: block;
    overflow: hidden;
    padding: 0.1em 0.35em;
    border-radius: var(--radius-control);
    background: var(--accent-tint);
    font-size: var(--text-xs);
    line-height: 1.5;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--accent-text);
}

.oc-chip__time {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.oc-chip--more {
    background: none;
    color: var(--text-2);
}


/* ---------- Narrow viewports ---------- */

/* Below ~700px a five-column week and a seven-column month are both unreadable, so
   the week collapses to stacked day sections (the list view's shape, which already
   works there) and the month cells shed their chips' minimum height. */
@media (max-width: 700px) {
    .oc-week {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .oc-week__col {
        padding-bottom: var(--space-4);
        border-top: 1px solid var(--line);
    }

    .oc-month__cell {
        min-height: 4.5rem;
        padding: var(--space-1);
    }

    .oc-month__weekday {
        padding: var(--space-1);
    }

    .oc-chip__subject {
        display: none;
    }
}


/* ==========================================================================
   CODER-102 -- add-to-calendar link + the "Today" period step.

   Two small additions inside the CODER-100 `.oc-*` vocabulary; no new tokens, no
   script. The add link is deliberately the quietest thing in an event row: it is an
   escape hatch a reader uses once, not the reason they came to the page, so it sits
   below the location in weight and only reaches navy on hover.
   ========================================================================== */

.oc-event__add {
    flex: 0 0 auto;
    font-size: var(--text-xs);
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color 200ms ease-out;
}

.oc-event__add:hover,
.oc-event__add:focus-visible {
    color: var(--accent-text);
    text-decoration: underline;
}

/* In a week column the row stacks, so the link needs its own line of air rather
   than the baseline gap the flex row gives it. */
.oc-event--stacked .oc-event__add {
    align-self: flex-start;
    margin-top: var(--space-1);
}

/* `.oc-period__step--today` intentionally carries NO rule of its own: Today is the
   same kind of control as Previous/Next -- one of three ways to move the period --
   so it takes `.oc-period__step` wholesale. The modifier stays on the element as a
   hook for the day it needs to differ. */


/* ==========================================================================
   CODER-134 -- the two directory INDEXES: /email-groups (`.eg-*`) and
   /vendor-contacts (`.vc-list*` / `.vc-facet*` / `.vc-empty`).

   Defect class P297 (`.vc-card`) / CODER-095 (the SOP read view) a third time:
   both templates emit a full, structured class vocabulary that main.css carried
   NO rule for, so every span collapsed into one underlined inline anchor and both
   pages read as a wall of links. Additive only -- no existing selector is edited,
   no new token, no new colour literal.
   ========================================================================== */

/* ---------- /email-groups: rows on hairlines, not boxed cards ----------
   A directory is scanned top-to-bottom, so each group takes the quiet
   `.dept-row` / `.oc-day` rule rather than a card border of its own. */

/* coder-708 (D450 Phase 5c): each department is a card of divided rows, its name the
   card's head band (15 px / 700 over a hairline). */
.eg-department {
    margin-bottom: var(--space-5);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.eg-department__name {
    margin: 0;
    padding: var(--space-3-5) var(--space-5);
    border-bottom: 1px solid var(--line);
    font-size: var(--text-lg);
    font-weight: 700;
}

.eg-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The whole row is the link (the `.admin-card-list__row` contract), so the
   hover tint and the focus ring live on the anchor, not on the <li>. */
.eg-list__link {
    display: flex;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: background-color 200ms ease-out;
}

.eg-list__item:last-child .eg-list__link {
    border-bottom: none;
}

.eg-list__link:hover {
    background: var(--accent-tint);
}

.eg-list__link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* The thing the eye scans: no underline until hover. */
.eg-list__name {
    font-weight: 500;
    color: var(--text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.eg-list__link:hover .eg-list__name {
    text-decoration: underline;
}

.eg-list__mail {
    font-size: var(--text-sm);
    color: var(--text-2);
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Pill shape and colour come from `.badge badge--not-started` on the element
   itself (see the template comment); this rule is layout only -- it is what
   pushes the type + count pair to the right of the row, with or without a mail
   address present. */
.eg-list__type {
    margin-left: auto;
    flex-shrink: 0;
}

/* Right-aligned tabular counts so the numbers form a scannable column. */
.eg-list__members {
    flex-shrink: 0;
    min-width: 6.5em;
    text-align: right;
    font-size: var(--text-sm);
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.eg-empty {
    color: var(--text-2);
    font-size: var(--text-sm);
}


/* ---------- /vendor-contacts: short blocks in a card grid ----------
   Michael 2026-07-31: each vendor is a short block carrying its support phone
   and/or email, and the scope badge is gone entirely (it was noise -- the
   `.vc-badge*` classes died with the markup, so no rule is left behind for
   them). The grid is the `.admin-card-list--grid` auto-fill idiom. */

.vc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
    margin: 0 0 var(--space-8);
    padding: 0;
    list-style: none;
}

/* coder-1189 (fix queue 5): the cell holds one link, which fills it, so every card in a
   grid row is as tall as the row's tallest. */
.vc-list__item {
    display: flex;
    min-width: 0;
}

/* The card is one <a> to the vendor's page (the `.admin-card-list__row` contract): the
   hover tint and the focus ring live on the anchor, over the whole card. The lines sit in
   `.vc-list__body`, and a logo, where there is one, beside them top right (coder-1163). */
.vc-list__link {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    gap: var(--space-3);
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: var(--space-4) var(--space-5);
    text-decoration: none;
    color: inherit;
    transition: all 200ms ease-out;
}

.vc-list__link:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
    color: inherit;
}

.vc-list__link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

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

.vc-list__name {
    font-weight: 500;
    color: var(--text);
    overflow-wrap: anywhere;
}

.vc-list__link:hover .vc-list__name {
    text-decoration: underline;
}

/* The `.card-eyebrow` label scale without the sage: the category is an
   orienting tag, not the thing being read. */
.vc-list__category {
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-2);
}

/* The logo is at most 40 px tall and 96 px wide, scaled to fit, on the detail card's image
   plate (dark mode's light ground behind a dark logo). */
.vc-list__logo {
    flex: none;
    width: auto;
    height: auto;
    max-width: 96px;
    max-height: 40px;
    object-fit: contain;
    padding: var(--image-plate-inset, 0);
    border-radius: var(--image-plate-radius, 0);
    background: var(--image-plate, transparent);
}

/* Tag facets in the product's pill vocabulary (`.oc-views__pill` /
   `.freq-option label`). `.vc-search` is gone from the template -- the form
   reuses `.ts-search`, the one search-bar implementation. */
.vc-facets {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-6);
}

.vc-facets__label {
    font-size: var(--text-sm);
    color: var(--text-2);
}

.vc-facets ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.vc-facet {
    display: block;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color 200ms ease-out, border-color 200ms ease-out,
                background-color 200ms ease-out;
}

.vc-facet:hover {
    border-color: var(--accent);
    color: var(--accent-text);
}

.vc-facet--active,
.vc-facet--active:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.vc-empty {
    color: var(--text-2);
    font-size: var(--text-sm);
}

/* coder-1083 (coder-1082 U1): Manage vendors' create links, a plain list above the
   vendors, clear of the heading under it. */
.vc-manage-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0 0 var(--space-6);
    padding: 0;
    list-style: none;
}

/* coder-509 -- the vendor manage list (Current / Archived) and the archive wizard.
   Rows on hairlines like `.eg-list`; the actions sit at the row's end and wrap under
   the name on a narrow screen. */
.vc-manage-edit .tabs {
    margin-bottom: var(--space-4);
}

.vc-manage-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.vc-manage-list__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--line);
}

.vc-manage-list__main {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* coder-624 (D416 §2): Edit beside a name that opens the thing's own page. */
.vc-manage-list__edit,
.home-edit-link {
    margin-left: var(--space-2);
    font-size: var(--text-sm);
}

.vc-manage-list__meta {
    margin-top: var(--space-1);
    font-size: var(--text-sm);
    color: var(--text-2);
}

.vc-archive-table td.vc-archive-table__count {
    white-space: nowrap;
}

.vc-archive-choice {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.vc-archive-choice__detail {
    margin: var(--space-2) 0 0 var(--space-6);
}

.vc-archive-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: var(--space-2) var(--space-5);
    margin: 0 0 var(--space-5);
}

.vc-archive-facts dt {
    font-weight: 600;
}

.vc-archive-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* coder-209 -- recipient chip multiselect (offboarding start form's three
   forward-emails / mailbox-access / files-access fields). Search-driven, unlike
   the fixed-list .chip-multiselect above: a pick appends a removable chip here. */
.recipient-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: var(--accent-tint);
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    color: var(--accent-text);
    line-height: 1.3;
}

.recipient-chip__remove {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--accent-text);
    font-size: var(--text-sm);
    line-height: 1;
    padding: 0;
}

/* System Map (coder-294): repeatable vendor/link rows on the system form, the
   filter bar on the systems list, and the map's SVG layout + side panel. */
/* coder-456: a wrapped row (a phone) puts its Remove 24 px under the fields. */
.repeatable-row {
    display: flex;
    align-items: center;
    gap: var(--space-5) var(--space-3);
    padding: var(--space-2) 0;
    flex-wrap: wrap;
}

.repeatable-row select,
.repeatable-row input {
    flex: 1 1 160px;
}

/* coder-456: a filter row wraps on a phone; a wrapped row sits 24 px below the
   fields above it, the form-to-action spacing. Its buttons go in an .action-group. */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-5) var(--space-4);
    margin-bottom: var(--space-4);
}

/* coder-480: the project's suggested Consulted seats -- one button a person, wrapping with
   a gap. */
.raci-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.filter-bar input,
.filter-bar select {
    max-width: 100%;
}

.filter-bar .form-label {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: var(--text-sm);
}

.system-map__svg {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
    margin-bottom: var(--space-4);
}

.system-map__node circle {
    fill: var(--accent-tint);
    stroke: var(--accent);
    stroke-width: 2;
    cursor: pointer;
}

.system-map__node text {
    font-size: 11px;
    fill: var(--text);
    pointer-events: none;
}

.system-map__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin: var(--space-3) 0;
    font-size: var(--text-sm);
}

.system-map__legend-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.system-map__legend-swatch {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top-width: 3px;
    border-top-style: solid;
}

.system-map__panel {
    display: none;
}

.system-map__panel.is-active {
    display: block;
}

/* coder-474 (D371 §1) -- a step's deliverables beneath it in the workflow overview's
   Steps table: the step's row and its deliverables read as one. */
.workflow-steps tr.workflow-steps__step--with-deliverables td {
    border-bottom: none;
}

.workflow-steps tr.workflow-steps__deliverables td {
    padding-top: 0;
    vertical-align: top;
}

.workflow-steps__deliverables .workflow-slots {
    margin-top: 0;
}

/* coder-475 (D371 §3) -- the Tasks tab, task by phase: each phase a section with its name
   and computed dates, its tasks, and the editors' rename / move / remove controls. */
.project-phase {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.project-phase__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}

.project-phase__head > .project-phase__title {
    margin: 0;
}

.project-phase__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-5) var(--space-4);
    margin-top: var(--space-4);
}

/* coder-1159: the Tasks tab's tables fit their card at 1280 px and wider. Title takes the
   room left (so it wraps less); Assignee, the name beside its avatar, wraps a long name
   rather than holding the line; Status, Planned and Deliverables are as wide as their
   words, Planned on one line; Predecessors is a short list (each name on two lines at most,
   the whole name its tooltip) and a small Add. A milestone is a badge beside its title.
   These are the automatic widths; a person's own (static/js/resizable_columns.js) replace
   them. Below the shell's phone width the table swipes inside its box, as every table does
   there. */
.project-tasks-table th,
.project-tasks-table td {
    padding-inline: var(--space-3);
}

.project-tasks-table:not(.is-col-sized) :is(th[data-col="status"], th[data-col="planned"],
                                            th[data-col="deliverables"]) {
    width: 1%;
}

.project-tasks-table:not(.is-col-sized) th[data-col="assignee"] {
    width: 10rem;
}

.project-tasks-table:not(.is-col-sized) th[data-col="predecessors"] {
    width: 10rem;
}

.project-tasks-table:not(.is-col-sized) :is(.status-pill, td[data-deliverable-count]) {
    white-space: nowrap;
}

.project-tasks-table .person-cell {
    white-space: normal;
}

.project-tasks-table .person-cell > .avatar {
    flex: none;
}

/* The lock before the title, where its column was. */
.project-tasks-table td > .task-lock {
    margin-right: var(--space-1);
    vertical-align: -1px;
}

/* A row's predecessors: each name with its remove control, one under another. */
.project-predecessors__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-predecessor {
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
    font-size: var(--text-xs);
    line-height: 1.35;
}

.project-predecessor + .project-predecessor {
    margin-top: var(--space-1);
}

.project-predecessor__name {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.project-predecessor__remove {
    display: contents;
}

.project-predecessor__x {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: -4px 0 -4px auto;
    padding: 0;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text-2);
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.project-predecessor__x:hover {
    background: var(--fill);
    color: var(--text);
}

.project-predecessor__x:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 0;
}

/* Add, its words in line with the names above it. */
.project-predecessors__add {
    min-height: 28px;
    padding-inline: var(--space-2);
    margin-left: calc(-1 * var(--space-2));
}

.project-predecessors__list + .project-predecessors__add {
    margin-top: var(--space-1);
}

/* A row's picker, opened by its Add: the search box over its Add and Cancel, in the cell,
   24 px between them (coder-456's field-to-action spacing). */
.project-predecessor-form {
    /* coder-930: the picker's hidden label and live line stay inside the table's wrapper. */
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5) var(--space-2);
    margin: var(--space-2) 0 0;
}

.project-predecessor-form[hidden] {
    display: none;
}

/* coder-930 (D562 rule 3): the predecessor picker's list opens in its row, in flow, so the
   table's sideways-scrolling wrapper never clips it. */
.project-predecessor-form .record-picker__list {
    position: static;
    margin-top: var(--space-1);
}

/* coder-1159: the box takes the cell's width, at least wide enough to read a task's name in
   its list (the column widens while it is open); Add and Cancel sit under it. */
.project-predecessor-form {
    min-width: 11rem;
}

.project-predecessor-form .record-picker {
    flex: 1 1 100%;
    min-width: 0;
}

.project-phase__actions > form {
    margin: 0;
}

/* coder-864 (selection B4): the Systems tab's system picker and its Add button, stacked so
   the search box keeps the card's width on a phone. */
.project-system-add {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    max-width: 32rem;
}

.project-system-add .record-picker {
    align-self: stretch;
}

/* coder-864 (selection B4): a step picker's checkboxes, one group per phase, each under
   its phase's name. */
.step-picker__group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.step-picker__phase {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
}

/* coder-536 (GANTT_DESIGN.md): the Gantt tab -- status chips that are the key and a filter,
   the marks key, the whole-project map with its window, the control row, then a name
   column of phase headings and task cards beside a chart whose range always fills its
   width. The server draws the heading, the name column and Not yet scheduled; the rest is
   drawn by projects_gantt.js, which sets .gantt--ready once it has. Colours are :root
   tokens only. */
.gantt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-3) 18px;
    margin-bottom: var(--space-4);
}

.gantt-head > .form-section__title {
    margin: 0;
}

.gantt-head__lede {
    font-size: var(--text-sm);
    color: var(--text-2);
}

.gantt-nojs {
    margin: 0 0 var(--space-4);
}

.gantt-tools[hidden] {
    display: none;
}

/* The chips: a swatch, a word and a count each; pressed while its tasks are shown. */
.gantt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.gantt-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 32px;
    padding: 0 var(--space-3) 0 10px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--accent-text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
}

.gantt-chip:hover {
    border-color: var(--line);
}

.gantt-chip:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.gantt-chip[aria-pressed="false"] {
    border-style: dashed;
    color: var(--text-2);
}

.gantt-chip[aria-pressed="false"] .gantt-swatch {
    opacity: 0.35;
    filter: grayscale(1);
}

.gantt-chip__count {
    padding: 0 7px;
    border-radius: var(--radius-pill);
    background: var(--fill);
    color: var(--text-2);
    font-size: 11.5px;
}

.gantt-chip--reset {
    border-color: transparent;
    color: var(--text-2);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* A state's swatch: the bar's own look, small. */
.gantt-swatch {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 10px;
    border-radius: 3px;
}

.gantt-swatch--done { background: var(--good); }
/* coder-697 (D450 Phase 4b): the bars in the chip family's colours -- In progress blue
   (Running, as its pill), Ready the blue tint with a blue edge (free to start, not
   started), Done green, Waiting grey; today's line keeps `--brass`, the charts' second
   colour (design §2). */
.gantt-swatch--in_progress { background: var(--accent); }
.gantt-swatch--ready { background: var(--accent-tint); box-shadow: inset 0 0 0 1.5px var(--accent); }
.gantt-swatch--waiting { background: var(--line); }
.gantt-swatch--paused,
.gantt-swatch--held { background: var(--hatch); }

.gantt-swatch--stalled {
    background: var(--accent);
    box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--problem);
}

/* The marks key. */
.gantt-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin: 0 0 var(--space-5);
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    color: var(--text-2);
}

.gantt-marks > li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.gantt-mark {
    position: relative;
    display: inline-block;
    flex: none;
}

.gantt-mark--approval {
    width: 22px;
    height: 10px;
    border-radius: 2px;
    background: var(--accent);
}

.gantt-mark--approval::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -1px;
    width: 3px;
    height: 20px;
    border-radius: 2px;
    background: var(--accent);
}

.gantt-mark--milestone {
    width: 11px;
    height: 11px;
    margin: 0 5px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(45deg);
}

.gantt-mark--waits {
    width: 28px;
    height: 0;
    border-top: 1.5px dotted var(--text-2);
}

.gantt-mark--phase {
    width: 28px;
    height: 9px;
    border: 2px solid var(--accent);
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
}

.gantt-mark--today {
    width: 2px;
    height: 16px;
    margin: 0 6px;
    background: var(--brass);
}

.gantt-mark--closed {
    width: 18px;
    height: 16px;
    border: 1px solid var(--line);
    background: var(--fill);
}

/* The whole-project map and its window (navy): drag it, stretch it by a handle, click
   the map to centre it, or use the arrow keys. */
.gantt-map {
    position: relative;
    height: 66px;
    margin-bottom: var(--space-2);
    overflow: clip;
    border-radius: var(--radius-card);
    background: var(--fill);
    cursor: pointer;
    touch-action: none;
    user-select: none;
}

.gantt-map__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.gantt-map__off { fill: var(--line); }
.gantt-map__today { stroke: var(--brass); stroke-width: 1.5; }
.gantt-map__line--done { fill: var(--good); }
.gantt-map__line--in_progress { fill: var(--accent); }
.gantt-map__line--ready { fill: var(--accent); fill-opacity: 0.4; }
.gantt-map__line--waiting,
.gantt-map__line--paused,
.gantt-map__line--held { fill: var(--line-strong); }
.gantt-map__line--stalled { fill: var(--problem); }

.gantt-map__window {
    position: absolute;
    top: 0;
    bottom: 0;
    border: 2px solid var(--accent);
    border-radius: 8px;
    background: var(--accent-tint);
    cursor: grab;
    touch-action: none;
}

.gantt-map__window:active {
    cursor: grabbing;
}

.gantt-map__window:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: -5px;
}

.gantt-map__handle {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 30px;
    margin-top: -15px;
    border-radius: 4px;
    background: var(--accent);
    cursor: ew-resize;
}

.gantt-map__handle::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 4px;
    width: 4px;
    height: 14px;
    border-right: 1px solid var(--ground);
    border-left: 1px solid var(--ground);
}

.gantt-map__handle--start { left: -7px; }
.gantt-map__handle--end { right: -7px; }

/* The control row: what is shown, then Zoom out, Zoom in and Whole project. */
.gantt-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    margin-bottom: var(--space-3);
    font-size: 13px;
    color: var(--text-2);
}

.gantt-controls strong {
    color: var(--text);
    font-weight: 600;
}

.gantt-controls__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Zoom buttons: the site's small secondary button (32 px, 8 px radius) with a stone
   outline, as the mockup has; navy when pressed. */
.gantt-tool,
.gantt-zoom {
    gap: 6px;
    padding: 0 11px 0 9px;
    border-color: var(--line-strong);
    background: var(--card);
}

.gantt-tool:hover:not(:disabled),
.gantt-zoom:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--card);
}

.gantt-zoom {
    font-size: 12.5px;
}

.gantt-tool:disabled,
.gantt-zoom:disabled {
    background: var(--card);
    opacity: 0.45;
    cursor: default;
}

.gantt-zoom[aria-pressed="true"],
.gantt-zoom[aria-pressed="true"]:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
}

.gantt-icon {
    flex: none;
    width: 13px;
    height: 13px;
}

/* The chart: the name column beside the plot. Without the script it is the name column
   alone. coder-545 (v1.2 §2.1): a 2 px navy rule closes the last phase. */
.gantt {
    border-top: 1px solid var(--line);
    border-bottom: 2px solid var(--accent);
}

.gantt--ready {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
}

.gantt-names {
    min-width: 0;
}

.gantt-names__head {
    display: flex;
    align-items: flex-end;
    height: 40px;
    padding: 0 0 var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--line);
    font-size: var(--text-xs);
    color: var(--text-2);
}

/* A phase heading: two rows, each keeping 16 px between its two sides by its flex gap;
   12 px between the rows. coder-545 (GANTT_DESIGN.md v1.2 §2.1, the mockup's 122 px): a
   2 px navy rule above it, which also closes the previous phase, then the light band and
   a 1 px line under it; all three run across the chart too, at the same height. The
   heading starts 16 px under the rule (2 + 14). */
.gantt-phase {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-3);
    height: 122px;
    padding: 14px 10px var(--space-3);
    border-top: 2px solid var(--accent);
    border-bottom: 1px solid var(--line);
    background: var(--fill);
}

.gantt-phase__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-width: 0;
}

/* coder-537 (GANTT_DESIGN.md v1.1 §2, PLAN_STEP_DESIGN.md §3): the heading holds a
   "Phase N" line above the name; the ring follows the name 16 px after it (the row's
   flex gap), level with the name, and a long name ends in an ellipsis with the ring
   still in view. */
.gantt-phase__row--name {
    justify-content: flex-start;
    align-items: flex-end;
}

.gantt-phase__row--name > .gantt-ring {
    margin-bottom: 3px;
}

.gantt-phase__heading {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
    font-weight: 400;
}

/* coder-545 (v1.2 §2.1): "Phase N" at 15 px on its own line, 7 px above the name. Its
   width never sets the heading's (inline-size containment), so a label wider than a
   short name cannot push the ring past 16 px after the name. */
.gantt-phase__number {
    display: block;
    contain: inline-size;
    margin-bottom: 7px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--accent-text);
    white-space: nowrap;
}

.gantt-phase__name {
    display: block;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gantt-phase__dates {
    flex: none;
    font-size: var(--text-xs);
    color: var(--text-2);
    white-space: nowrap;
}

.gantt-phase__zoom {
    display: flex;
    flex: none;
    gap: var(--space-2);
    margin-left: auto;
}

.gantt-phase__zoom[hidden] {
    display: none;
}

.gantt-ring {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
}

.gantt-ring svg {
    width: 18px;
    height: 18px;
}

.gantt-ring__track,
.gantt-ring__done {
    fill: none;
    stroke-width: 3.5;
}

.gantt-ring__track { stroke: var(--line); }

.gantt-ring__done {
    stroke: var(--good);
    stroke-linecap: round;
}

/* A task card: white, a stone border, a 4 px left edge in its status colour; its name
   (a link) and a line of kind, owner and dates; a status pill on the right. coder-545
   (v1.2 §2.1): every row 58 px, the card 6 px in above and below, a 1 px line under the
   row but a phase's last. */
.gantt-task {
    height: 58px;
    padding: 6px 10px 6px 6px;
    border-bottom: 1px solid var(--line);
    transition: opacity 200ms;
}

.gantt-task--last {
    border-bottom: 0;
}

.gantt-task__card {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 0 10px 0 var(--space-3);
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
    transition: box-shadow 150ms, border-color 150ms;
}

.gantt-task.is-hover .gantt-task__card {
    border-color: var(--line);
    box-shadow: var(--shadow);
}

.gantt-task--done .gantt-task__card { border-left-color: var(--good); }
.gantt-task--in_progress .gantt-task__card { border-left-color: var(--accent); }
.gantt-task--ready .gantt-task__card { border-left-color: var(--line-strong); }
.gantt-task--stalled .gantt-task__card { border-left-color: var(--problem); }
.gantt-task--paused .gantt-task__card,
.gantt-task--held .gantt-task__card { border-left-color: var(--line-strong); }

.gantt-task.is-dim,
.gantt-bar.is-dim {
    opacity: 0.16;
}

.gantt-task__text {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.gantt-task__name {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gantt-task__name:hover {
    text-decoration: underline;
}

.gantt-task__meta {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--text-2);
    font-size: 11.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* The pill: the site's status-pill colours. */
.gantt-pill {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--line);
    color: var(--text-2);
    font-size: var(--text-xs);
    font-weight: var(--chip-weight);
    white-space: nowrap;
}

.gantt-pill--done { background: var(--good-tint); color: var(--good); }
.gantt-pill--in_progress { background: var(--accent-tint); color: var(--accent-text); }
.gantt-pill--stalled { background: var(--problem-tint); color: var(--problem); }
.gantt-pill--ready { background: var(--accent-tint); color: var(--accent-text); }

.gantt-pill__lock {
    display: inline-flex;
}

/* The plot: positioned by the script from the name column's own rows. */
.gantt-plot {
    position: relative;
    min-width: 0;
    /* clip, not hidden: never a scroll container, so focus cannot scroll it sideways */
    overflow: clip;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

.gantt-plot.is-panning {
    cursor: grabbing;
}

.gantt-plot__head {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 40px;
    border-bottom: 1px solid var(--line);
}

.gantt-day {
    position: absolute;
    top: 0;
    height: 40px;
    padding-top: 6px;
    color: var(--text-2);
    font-size: 11.5px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.gantt-day b {
    display: block;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 500;
}

.gantt-day--today b {
    color: var(--accent-text);
}

/* Closed days, drawn by the script over the task rows only: never on a heading's band. */
.gantt-off {
    position: absolute;
    background: var(--fill);
}

/* The chart's rows, level with the name column's (coder-545, v1.2 §2.1): a 1 px line
   under each task row but a phase's last; a heading's navy rule, band and line. */
.gantt-rule {
    position: absolute;
    right: 0;
    left: 0;
    border-bottom: 1px solid var(--line);
}

.gantt-rule--last {
    border-bottom: 0;
}

.gantt-rule.is-hover {
    background: var(--accent-tint);
}

.gantt-rule--phase {
    border-top: 2px solid var(--accent);
    border-bottom: 1px solid var(--line);
    background: var(--fill);
}

.gantt-rule--phase.is-hover {
    background: linear-gradient(var(--accent-tint), var(--accent-tint)), var(--fill);
}

.gantt-bracket {
    position: absolute;
    height: 9px;
    border: 2px solid var(--accent);
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
}

.gantt-bracket__done {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: var(--good);
}

/* Bars: 14 px high, 3 px radius; an approval ends in a post, a milestone is a diamond,
   a stalled bar is ringed in the danger colour, paused and held are hatched. */
.gantt-bar {
    position: absolute;
    height: 14px;
    border-radius: 3px;
    transition: opacity 200ms;
}

.gantt-bar:hover,
.gantt-bar:focus-visible {
    filter: brightness(0.92);
}

.gantt-bar:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
}

.gantt-bar--draggable {
    cursor: grab;
}

.gantt-bar.is-dragging {
    cursor: grabbing;
    opacity: 0.85;
}

.gantt-bar--done { background: var(--good); }
.gantt-bar--in_progress,
.gantt-bar--stalled { background: var(--accent); }
.gantt-bar--ready { background: var(--accent-tint); box-shadow: inset 0 0 0 1.5px var(--accent); }
.gantt-bar--waiting { background: var(--line); }
.gantt-bar--paused,
.gantt-bar--held { background: var(--hatch); }

.gantt-bar--stalled {
    box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--problem);
}

.gantt-bar--approval::after {
    content: '';
    position: absolute;
    top: -6px;
    right: -1px;
    width: 3px;
    height: 26px;
    border-radius: 2px;
    background: var(--accent);
}

.gantt-bar--approval.gantt-bar--waiting::after { background: var(--text-2); }
.gantt-bar--approval.gantt-bar--done::after { background: var(--good); }

.gantt-bar--milestone {
    width: 14px;
    border-radius: 2px;
    transform: rotate(45deg);
}

.gantt-links {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}

.gantt-links path {
    fill: none;
    stroke: var(--text-2);
    stroke-width: 1.2;
    stroke-dasharray: 2 3;
}

.gantt-today {
    position: absolute;
    width: 2px;
    background: var(--brass);
    pointer-events: none;
}

.gantt-today::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brass);
}

/* The tooltip, on hover and on keyboard focus. */
.gantt-tip {
    position: fixed;
    z-index: 60;
    max-width: 290px;
    padding: 10px var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
    pointer-events: none;
}

.gantt-tip[hidden] {
    display: none;
}

.gantt-tip strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
}

.gantt-tip__kind {
    display: block;
    margin-bottom: 6px;
    color: var(--text-2);
}

.gantt-tip__state {
    display: block;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.gantt-unscheduled__title {
    margin-top: var(--space-5);
}

@media (prefers-reduced-motion: reduce) {
    .gantt-task,
    .gantt-task__card,
    .gantt-bar {
        transition: none;
    }
}

/* On a phone: a 160 px name column; the cards' second line, the pills, the rings' words
   and the phase dates hidden; names on two lines; the phase zoom buttons as icons, each
   keeping its accessible name. */
@media (max-width: 700px) {
    .gantt--ready {
        grid-template-columns: 160px minmax(0, 1fr);
    }

    .gantt-task__meta,
    .gantt-pill,
    .gantt-ring__words,
    .gantt-phase__dates {
        display: none;
    }

    .gantt-task__name {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: var(--text-xs);
        white-space: normal;
    }

    .gantt-phase__name {
        font-size: 1rem;
    }

    .gantt-zoom {
        padding: 0 8px;
    }

    .gantt-zoom__words {
        display: none;
    }

    .gantt-zoom .gantt-icon {
        width: 14px;
        height: 14px;
    }
}

/* coder-475 (D371 §1-§2) -- a project task's deliverable forms and an approval's
   decisions. */
.project-deliverable__edit {
    margin-top: var(--space-4);
}

/* The add form follows the deliverables list; the remove button follows the edit form:
   each 24 px below the fields above it. */
.project-deliverable__add,
.project-deliverable__edit > form + form {
    margin-top: var(--space-5);
}

.project-deliverable__edit > form:first-of-type,
.project-deliverable__add > form {
    margin-top: var(--space-4);
}

.project-history {
    list-style: none;
    margin: 0;
    padding: 0;
}

.project-history > li + li {
    margin-top: var(--space-2);
}

/* coder-985 (D586 §3-§5) -- a task's Updates card: the requests waiting on its holder, each
   note quoted, and the answer box; Request update's box; the update history, each request
   with its answer. The Team board's Request update on a card and Request updates on all. */
.update-requests__waiting {
    margin-bottom: var(--space-4);
}

.update-requests__note {
    margin: 0 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-left: 3px solid var(--line-strong);
    background: var(--fill);
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.update-requests__ask > form {
    margin-top: var(--space-4);
}

.update-requests__ask + .form-section__title,
.update-requests [data-update-asked] + .form-section__title {
    margin-top: var(--space-5);
}

.update-requests__history p {
    margin: 0;
    overflow-wrap: anywhere;
}

.update-requests__history p + p {
    margin-top: var(--space-1);
}

.update-request__note {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.task-card__ask {
    align-self: flex-start;
    margin-top: var(--space-2);
}

.team-board__ask-all {
    margin: 0 0 var(--space-3);
}

.team-board__ask-all > details > form {
    margin-top: var(--space-3);
    max-width: 40rem;
}

/* coder-475 (D363 §5) -- the Projects site on the WGIT admin SharePoint libraries card. */
.sp-projects {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
}

.sp-projects .sp-library > .form-actions {
    margin-top: var(--space-5);
}

/* coder-478 (D371 §5) -- a project template step's predecessors in the template editor,
   and the start form's plan lists. */
.template-predecessors {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.template-predecessors__list {
    list-style: none;
    margin: 0 0 var(--space-3);
    padding: 0;
}

.template-predecessors__list > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.template-predecessors__list > li + li {
    margin-top: var(--space-2);
}

.template-predecessors__add {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.template-predecessors__add > .form-select {
    flex: 1 1 12rem;
    min-width: 0;
}

/* coder-537 (PLAN_STEP_DESIGN.md §3, §4): "Phase N", a sage line above a phase's name
   wherever a project's or project template's phases are headed (the Tasks tab, the
   report, the template editor); and the costs on each template step -- a field and its
   buttons per line, wrapping on a phone. */
.phase-number {
    display: block;
    margin-bottom: 2px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--accent-text);
}

.template-costs {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.template-costs__row + .template-costs__row,
.template-costs__row + .template-costs__form {
    margin-top: var(--space-2);
}

/* Buttons that wrap below the field keep 24 px from it (coder-456). */
.template-costs__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5) var(--space-2);
}

.template-costs__form > .form-input {
    flex: 1 1 12rem;
    min-width: 0;
}

.template-plan-list {
    margin: 0 0 var(--space-4);
    padding-left: var(--space-5);
}

.template-plan-list > li + li {
    margin-top: var(--space-2);
}

/* coder-478: "n lines to price" beside a project's totals, and the start form's
   too-early warning above its actions. */
.to-price-note {
    margin-bottom: var(--space-5);
}

.start-too-early {
    margin-top: var(--space-5);
}

/* coder-491: the department switch card on the directory placement page. Each part of
   the preview (labels, changes, reach) is headed by a sub-heading spaced from what
   comes before it. */
.dept-switch h3.form-label {
    margin-top: var(--space-5);
}

.dept-switch td .form-select {
    min-width: 12rem;
}

/* coder-504 (D381 §4-§5, PROJECTS_V2_DESIGN.md §5.3, §5.4, §9.4) -- the "Shared outside"
   card on a project and a workflow, its Add confirmation, and the wizard's Share outside. */
.outside-add {
    margin-top: var(--space-6);
}

.outside-add__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space-4) var(--space-5);
}

.outside-add__fields .form-group {
    margin-bottom: 0;
}

.outside-add__levels {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
}

.outside-add__levels .form-option {
    padding: 0;
}

.outside-remove {
    margin: 0;
}

/* coder-533 (D392): the card's History -- adds, ends and what became of each guest. */
.outside-history {
    margin-top: var(--space-5);
}

.outside-history summary {
    cursor: pointer;
    font-weight: 600;
}

.outside-history__list {
    list-style: none;
    padding: 0;
    margin: var(--space-3) 0 0;
    display: grid;
    gap: var(--space-2);
}

.outside-history__list li {
    overflow-wrap: anywhere;
}

.outside-history__list .text-muted {
    margin-right: var(--space-2);
}

.outside-confirm__facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: var(--space-2) var(--space-5);
    margin: var(--space-5) 0;
}

.outside-confirm__facts dt {
    font-weight: 600;
}

.outside-confirm__facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.wiz-outside {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-5);
    display: grid;
    gap: var(--space-5);
}

.wiz-outside__row > * + * {
    margin-top: var(--space-3);
}

.wiz-outside__row p {
    overflow-wrap: anywhere;
}

/* coder-524 (D390 §6-§7) -- the Kanban board of tasks: Waiting, Not started, In progress
   and Done. Four columns side by side on a wide screen; on a phone each column is most of
   the screen wide and the board scrolls sideways inside its own box (never the page), a
   column at a time. Only a mouse drags a card; a finger scrolls. */
.task-board-wrap {
    margin-top: var(--space-5);
}

.task-board__hint {
    margin: 0 0 var(--space-4);
}

.task-board__hint-touch,
.task-board__hint-phone {
    display: none;
}

@media (hover: none), (pointer: coarse) {
    .task-board__hint-drag {
        display: none;
    }

    .task-board__hint-touch {
        display: inline;
    }
}

.task-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(12rem, 1fr));
    gap: var(--space-4);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: var(--space-2);
}

/* coder-697 (D450 Phase 4b, design §5 "Boards"): a column is a tinted lane (`--fill` on
   the page's ground), its heading a dot in the column's own colour, its words and a count
   pill; its cards white, 10 px corners, title over the holder and the date. */
.task-board__column {
    min-width: 0;
    padding: 10px;
    border-radius: 12px;
    background: var(--fill);
    border: 1px solid var(--line);
    scroll-snap-align: start;
    --column-dot: var(--line-strong);
}

.task-board__column[data-board-column="waiting"] { --column-dot: var(--warn); }
.task-board__column[data-board-column="in_progress"] { --column-dot: var(--accent); }
.task-board__column[data-board-column="done"] { --column-dot: var(--good); }

.task-board__column--over {
    outline: 2px dashed var(--accent-text);
    outline-offset: -2px;
}

.task-board__heading {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 10px;
    padding: 2px 4px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: normal;
    word-spacing: 0.06em;
}

.task-board__heading::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--column-dot);
}

.task-board__count {
    margin-left: auto;
    min-width: 1.5rem;
    padding: 0 7px;
    border-radius: var(--radius-pill);
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 650;
    line-height: 18px;
    text-align: center;
}

.task-board__cards {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.task-board__empty {
    padding: var(--space-2) 0;
    color: var(--text-2);
    font-size: var(--text-sm);
}

/* coder-1169: a column shows five cards, the rest `hidden` (which `.task-card`'s grid would
   beat), and "Show 5 more" the width of the column under them. */
.task-card[hidden] {
    display: none;
}

.task-board__more {
    width: 100%;
    margin-top: 9px;
}

.task-card {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    background: var(--card);
    overflow-wrap: anywhere;
}

.task-card--stalled {
    border-left: 4px solid var(--problem);
}

.task-card--paused,
.task-card--held {
    border-style: dashed;
}

/* A mouse drags; text inside a draggable card is not selected by the drag. */
.task-card--draggable {
    cursor: grab;
    user-select: none;
}

.task-card--dragging {
    position: relative;
    z-index: 2;
    cursor: grabbing;
    box-shadow: var(--shadow);
}

.task-card__name {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: var(--leading-snug);
    text-decoration: none;
}

.task-card__name:hover,
.task-card__name:focus-visible {
    color: var(--accent-text);
    text-decoration: underline;
}

/* coder-1077 (FIX_QUEUE 2): a tap or click anywhere on a card opens its task -- the title's
   link is stretched over the whole card -- while Move to…, its menu, Open the task and
   Request update stay their own targets above it. A mouse still drags (`task_board.js`). */
.task-card {
    position: relative;
}

.task-card__name::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.task-card .board-move,
.task-card__ask {
    position: relative;
    z-index: 1;
}

.task-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-3);
    margin: 0;
    color: var(--text-2);
    font-size: 11.5px;
}

/* The holder (avatar, or a team's mark) on the left, the date on the right. */
.task-card__foot {
    justify-content: space-between;
}

.task-card__who {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.task-card__who .avatar {
    width: 22px;
    height: 22px;
    font-size: 9px;
}

.task-card__team {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--teal-tint);
    color: var(--teal);
}

.task-card__team .icon {
    width: 13px;
    height: 13px;
}

.task-card__run {
    color: var(--accent-text);
}

/* Late: rose (coder-697: the Late family, was the warning colour), and the word, never
   colour alone. */
.task-card__due--late {
    color: var(--problem);
    font-weight: 600;
}

.task-card__flag {
    margin: 0;
}

.task-card__flag .task-flag__line {
    display: block;
    margin: var(--space-1) 0 0;
}

.task-card__note {
    margin: 0;
}

.board-move > summary {
    cursor: pointer;
}

.board-move__menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.board-move__note {
    flex-basis: 100%;
    margin: 0;
}

.board-filter {
    display: flex;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin: 0;
}

.board-filter .form-select {
    flex: 0 1 18rem;
    min-width: 0;
}

/* coder-715 (D421 §4): the Team board's own filters -- under the Scope, apart from it --
   in one wrapping row, and the count of the cards they leave. */
.team-board__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-2) var(--space-3);
    margin: 0 0 var(--space-2);
}

.team-board__field {
    flex: 1 1 11rem;
    min-width: 0;
}

.team-board__field--search {
    flex: 2 1 14rem;
}

.team-board__field .form-select,
.team-board__field .form-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.team-board__go {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* coder-865 (selection B5, SEL-0009): Project or workflow and Who are search boxes (the
   record picker's and the people picker's) with their choice said under them, so the row
   lines up at the top: each field's label level with the others', each box as tall as the
   selects beside it, and the buttons under a label's height of space. */
.team-board__filters {
    align-items: flex-start;
}

.team-board__field .record-picker__input,
.team-board__field .wiz-picker__find .form-input {
    height: 32px;
    min-height: 32px;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
}

.team-board__field .wiz-picker__find {
    margin-bottom: var(--space-1);
}

.team-board__field .record-picker__chosen,
.team-board__field .wiz-picker__chosen {
    font-size: var(--text-sm);
}

.team-board__go {
    flex-wrap: wrap;
    row-gap: 0;
}

.team-board__go-space {
    flex-basis: 100%;
}

.team-board__count {
    margin: 0 0 var(--space-3);
    color: var(--text-2);
    font-size: var(--text-sm);
}

.team-board .task-card__name,
.team-board .task-card__run {
    overflow-wrap: anywhere;
}

/* coder-917 (D554 B1): My Tasks' filters -- the Team board's row (above), its fields two to
   a line on a phone; Status, Part of and Kind a checkbox list in a native disclosure that
   opens in the row's flow, never over the page. */
.my-tasks-filters .my-tasks-filters__field {
    flex: 1 1 9rem;
}

.my-tasks-filters .team-board__field--search {
    flex: 2 1 14rem;
}

.my-tasks-filters__pick {
    position: relative;
}

.my-tasks-filters .my-tasks-filters__field:has(.my-tasks-filters__pick[open]) {
    flex-basis: 100%;
}

.my-tasks-filters__summary {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding-right: var(--space-8);
    cursor: pointer;
    list-style: none;
}

.my-tasks-filters__summary-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.my-tasks-filters__summary::-webkit-details-marker {
    display: none;
}

.my-tasks-filters__options {
    margin: var(--space-1) 0 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
    min-width: 0;
}

.my-tasks-filters__options--long {
    max-height: 16rem;
    overflow-y: auto;
}

.my-tasks-filters__option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    font-size: var(--text-sm);
    overflow-wrap: anywhere;
}

.my-tasks-filters__option input {
    margin-top: 3px;
    flex: none;
}

.my-tasks-filters__notes {
    margin: 0 0 var(--space-3);
    padding-left: var(--space-5);
    color: var(--text-2);
    font-size: var(--text-sm);
}

/* coder-630 (D421 §5): the phone's column picker -- four choices with their counts -- and
   the chosen column's cards stacked, instead of columns scrolling sideways (coder-524's
   82 % columns, retired). The checked choice shows its column; `task_board.js` keeps
   `data-board-shown` with it where `:has()` is missing. Not shown on a wide screen. */
.board-picker,
.task-board__moved {
    display: none;
}

@media (max-width: 700px) {
    .task-board__hint-drag,
    .task-board__hint-touch {
        display: none;
    }

    .task-board__hint-phone {
        display: inline;
    }

    /* coder-697 (D450 Phase 4b, design §5 "Boards"): the picker as pills -- the chosen
       column filled blue; the radio stays in the label, drawn off-screen, so the group
       keeps its keys and its name; a 44 px touch target. */
    .board-picker {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2);
        min-width: 0;
        margin: 0 0 var(--space-4);
        padding: 0;
        border: 0;
    }

    .board-picker__choice {
        position: relative;
        display: inline-flex;
        align-items: center;
        min-width: 0;
        min-height: 2.75rem;
        padding: 0 14px;
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-pill);
        background: var(--card);
        color: var(--text-2);
        font-size: 12.5px;
        font-weight: 650;
        cursor: pointer;
        overflow-wrap: anywhere;
    }

    .board-picker__choice:has(:checked) {
        border-color: var(--accent);
        background: var(--accent);
        color: var(--on-accent);
    }

    .board-picker__choice:has(:focus-visible) {
        outline: 2px solid var(--accent-text);
        outline-offset: 2px;
        box-shadow: 0 0 0 4px var(--focus-ring);
    }

    .board-picker__input {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: 0;
        opacity: 0;
        pointer-events: none;
    }

    .task-board__moved:not([hidden]) {
        display: block;
        margin: 0 0 var(--space-4);
    }

    /* coder-1169: Show 5 more as a 44 px touch target, as the picker's pills. */
    .task-board__more {
        min-height: 2.75rem;
    }

    .task-board {
        display: block;
        overflow-x: visible;
        scroll-snap-type: none;
    }

    .task-board__column {
        display: none;
    }

    .task-board-wrap:has([data-board-pick][value="waiting"]:checked) [data-board-column="waiting"],
    .task-board-wrap:has([data-board-pick][value="not_started"]:checked) [data-board-column="not_started"],
    .task-board-wrap:has([data-board-pick][value="in_progress"]:checked) [data-board-column="in_progress"],
    .task-board-wrap:has([data-board-pick][value="done"]:checked) [data-board-column="done"] {
        display: block;
    }

    @supports not selector(:has(*)) {
        .task-board__column[data-board-shown] {
            display: block;
        }
    }
}

/* --- The work pages (coder-697, D450 Phase 4b; design §5 "Step lists", "Boards") ---
   A workflow's steps as a step list, the header's progress line, a task's two columns, the
   step's facts as rows, a person beside their avatar, the project's figures, the Budget
   tab's lines as sections of its card, and a board on the page rather than in a card. */

/* A lane edge's colour: the step's department, else its holder's avatar colour
   (`app/core/avatars.lane_cat`); 0 is none. */
.lane--cat-0 { --lane: transparent; }
.lane--cat-1 { --lane: var(--cat-1); }
.lane--cat-2 { --lane: var(--cat-2); }
.lane--cat-3 { --lane: var(--cat-3); }
.lane--cat-4 { --lane: var(--cat-4); }
.lane--cat-5 { --lane: var(--cat-5); }

/* The steps run edge to edge in their card, under its title. */
.step-card {
    padding-bottom: 0;
    overflow: hidden;
}

.step-list {
    margin: var(--space-4) calc(-1 * var(--space-6)) 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.step-row {
    border-bottom: 1px solid var(--line);
}

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

.step-row__main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 3.5rem;
    padding: 11px var(--space-6) 11px 0;
}

.step-row__lane {
    flex: none;
    align-self: stretch;
    width: 4px;
    margin: -11px 0;
    border-radius: 0 4px 4px 0;
    background: var(--lane);
}

.step-row__n {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: var(--space-2);
    border: 1.5px solid var(--line-strong);
    border-radius: 50%;
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 700;
}

.step-row__n--now {
    border-color: var(--accent);
    color: var(--accent-text);
}

.step-row__n--done {
    border-color: var(--good);
    background: var(--good);
    color: var(--card);
}

.step-row__no-avatar {
    flex: none;
    width: 28px;
}

.step-row__body {
    flex: 1;
    min-width: 0;
}

.step-row__title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    line-height: var(--leading-snug);
    overflow-wrap: anywhere;
}

.step-row__title .kind-chip {
    margin-left: var(--space-1);
}

.step-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    margin: var(--space-1) 0 0;
    color: var(--text-2);
    font-size: 12px;
}

.step-row__holder + *::before,
.step-row__done-by::before {
    content: none;
}

.step-row__meta .task-flag-row,
.step-row__body .task-flag-row {
    margin-top: var(--space-1);
}

.step-row__howto {
    margin: var(--space-1) 0 0;
    font-size: 12.5px;
}

.step-row__when {
    flex: none;
    min-width: 7rem;
    color: var(--text-2);
    font-size: 12.5px;
    text-align: right;
}

.step-row__late {
    color: var(--problem);
    font-weight: 600;
}

.step-row__action {
    flex: none;
}

/* Under a step: its decision, its deliverables, what it reviews -- indented past the
   number. */
.step-row__more {
    padding: 0 var(--space-6) var(--space-4) calc(4px + var(--space-2) + 24px + 14px);
}

.step-row__more .workflow-decision {
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--ground);
}

.step-row__more .workflow-slots {
    margin-top: 0;
}

/* An approval -- on a step row or a board card -- in the Approval family's amber. */
.kind-chip--approval {
    background: var(--warn-tint);
    color: var(--warn);
}

@media (max-width: 640px) {
    .step-row__main {
        flex-wrap: wrap;
        gap: var(--space-2) 10px;
    }

    .step-row__main > .avatar,
    .step-row__no-avatar {
        display: none;
    }

    .step-row__body {
        flex-basis: calc(100% - 4px - 24px - 3 * 10px);
    }

    .step-row__when {
        min-width: 0;
        margin-left: calc(4px + var(--space-2) + 24px + 10px);
        text-align: left;
        font-size: 11.5px;
    }

    .step-row__more {
        padding: 0 var(--space-6) var(--space-4) calc(4px + var(--space-2) + 24px + 10px);
    }
}

/* The header's progress line: a 6 px bar over "2 of 5 done", under the actions on the
   right (its own row first on a phone). */
.workflow-head__side {
    align-items: center;
    gap: var(--space-3) var(--space-4);
}

@media (min-width: 641px) {
    .workflow-head__side {
        flex-direction: column-reverse;
        align-items: flex-end;
    }
}

.head-progress {
    width: 13.75rem;
}

.head-progress__bar {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--line);
    overflow: hidden;
}

.head-progress__bar i {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--good);
}

.head-progress__text {
    margin: 6px 0 0;
    color: var(--text-2);
    font-size: var(--text-xs);
    text-align: right;
}

@media (max-width: 640px) {
    .head-progress {
        width: 100%;
    }

    .head-progress__text {
        text-align: left;
    }
}

/* A board sits on the page, under the tabs; its own heading is for a screen reader. */
.work-board > .report-section__title {
    margin-bottom: 0;
}

.work-board .task-board-wrap {
    margin-top: 0;
}

/* A person in a cell or a row: the avatar, then the name. */
.person-cell {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
}

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

.task-lock {
    display: inline-flex;
    color: var(--text-2);
}

/* A task's page: the work, and beside it the step's facts, from 1100 px. */
.task-page .page-intro {
    max-width: none;
}

/* coder-733: a task's notes sit a form group's gap above the status form; coder-794
   (coder-781 F3): with their line breaks, for the wizard's and the form's tasks alike. */
.task-detail-notes {
    margin-bottom: var(--space-4);
    white-space: pre-line;
}

.task-layout {
    display: grid;
    gap: var(--space-5);
    align-items: start;
}

@media (min-width: 1100px) {
    .task-layout {
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    }
}

.task-howto {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.task-howto .icon {
    color: var(--accent-text);
}

/* Facts as rows: the label on the left, the value on the right, hairlines between. */
.kv-list {
    margin: 0;
}

.kv-list > div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.kv-list > div:last-child {
    border-bottom: 0;
}

.kv-list dt {
    color: var(--text-2);
}

.kv-list dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.kv-list__current dt,
.kv-list__current dd {
    color: var(--text);
    font-weight: 700;
}

.task-facts__brief {
    margin: var(--space-3) 0 0;
}

/* A project's money: four figures across, a tile's 26 px / 750 number over its label's
   line, as the page already writes them. */
.card .project-figures {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 var(--space-5);
    margin-bottom: var(--space-5);
}

.card .project-figures .stat-card__value {
    font-size: 1.625rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

@media (max-width: 640px) {
    .card .project-figures {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* The Budget tab: the costing card and each line are sections of the Budget card. */
.budget-lines {
    gap: 0;
}

.budget-lines > .card {
    padding: var(--space-5) 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

/* coder-765 (PLAN_STEP_DESIGN.md v1.3 §7): "Show costs by phase" at the top of the Budget
   tab (the switch is the task mirrors' own), and, when on, each phase's heading and its
   subtotal, then the total, in the Budget card's lines. */
.budget-by-phase {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.budget-by-phase__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.budget-by-phase__name {
    font-size: var(--text-sm);
    font-weight: 600;
}

.budget-by-phase__hint {
    color: var(--text-2);
    font-size: var(--text-xs);
    line-height: 1.4;
}

.budget-phase__title {
    margin: 0;
    padding: var(--space-5) 0 var(--space-2);
    border-top: 2px solid var(--line-strong);
    font-size: var(--text-lg);
}

.budget-phase__figures {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    margin: 0;
    padding: var(--space-3) 0 var(--space-5);
    border-top: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
}

.budget-phase__figures dt {
    font-weight: 600;
}

.budget-phase__figures dd {
    margin: 0;
}

.budget-phase__figures[data-budget-total] {
    border-top: 2px solid var(--line-strong);
}

/* coder-528: an assistant call working in the background (the project wizard's Plan and
   Schedule, Hotel rules' own words). It sits where the result will appear; the page
   checks back and reloads when the call ends. Reduced motion stills the dot. */
.assistant-wait {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border: 1px dashed var(--brass);
    border-radius: var(--radius-card);
    background: var(--ground);
    font-size: var(--text-sm);
    line-height: 1.5;
}

/* The page-level note (a step where the running call's result does not appear) sits
   above the page's cards; inside a card stack the stack's gap spaces it. */
.assistant-wait[data-assistant-busy] {
    margin-bottom: var(--space-5);
}

.card-stack > .assistant-wait[data-assistant-busy] {
    margin-bottom: 0;
}

.assistant-wait__dot {
    flex: none;
    width: 0.625rem;
    height: 0.625rem;
    margin-top: 0.4rem;
    border-radius: 50%;
    background: var(--brass);
    animation: assistantWait 1.4s ease-in-out infinite;
}

.assistant-wait__body {
    min-width: 0;
}

.assistant-wait__body p {
    margin: 0;
}

.assistant-wait__body p + p {
    margin-top: var(--space-1);
}

.assistant-wait__line {
    font-weight: 600;
    color: var(--text);
}

.assistant-wait__hint {
    color: var(--text-2);
}

@keyframes assistantWait {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

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


/* ==========================================================================
   coder-570 (D401 §9): React Flow's own chrome on the two canvases (the Network Map,
   the Platform map). Each passes React Flow's `colorMode` from the page's mode
   (frontend/src/theme.ts), which sets its .dark class and color-scheme; these point its
   variables at the role tokens so its controls, minimap, dots and labels are the app's
   in both modes rather than React Flow's own greys. The pane stays transparent, so each
   canvas's own ground shows through.
   ========================================================================== */
.react-flow {
    --xy-background-color: transparent;
    --xy-background-pattern-dots-color: var(--line-strong);
    --xy-attribution-background-color: var(--card);
    --xy-minimap-background-color: var(--card);
    --xy-minimap-mask-background-color: color-mix(in srgb, var(--fill) 60%, transparent);
    --xy-minimap-node-background-color: var(--line);
    --xy-controls-button-background-color: var(--card);
    --xy-controls-button-background-color-hover: var(--fill);
    --xy-controls-button-color: var(--text);
    --xy-controls-button-color-hover: var(--text);
    --xy-controls-button-border-color: var(--line);
    --xy-controls-box-shadow: var(--shadow);
    --xy-selection-background-color: color-mix(in srgb, var(--accent) 8%, transparent);
    --xy-selection-border: 1px dotted var(--accent);
    --xy-edge-label-background-color: var(--card);
    --xy-edge-label-color: var(--text);
}

/* They float over the canvas: a --line edge in dark, where --shadow is none. */
.react-flow__controls,
.react-flow__minimap {
    outline: var(--float-edge);
}


/* ==========================================================================
   D450 Phase 4c: the settings cards, a vendor's page and a person's profile (coder-698)
   ========================================================================== */

/* The settings cards (Organization Admin Settings, `action_card(..., data_card=)`): the
   title at a section's size, the description in the secondary ink, and the card's state
   line as a strip on --fill -- what is set now, read at a glance -- over Open. */
.action-card[data-card] {
    min-height: 0;
    padding: var(--space-5);
    gap: var(--space-2);
}

.action-card[data-card] .card-title {
    font-size: var(--text-lg);
    font-weight: 700;
}

.action-card[data-card] .card-description {
    font-size: var(--text-sm);
    color: var(--text-2);
}

.action-card[data-card] .card-state {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 0;
    border-radius: var(--radius-control);
    background: var(--fill);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: var(--leading-snug);
}

/* A vendor's page: its card's fields as rows divided by hairlines -- the label on the left,
   the value on the right (people with their avatar) -- not tinted boxes; What to do the
   full width under its label. Only the vendor's own page: the escalation embed and the
   downloads keep the card's tiles. */
.vc-detail .vc-card {
    grid-template-columns: 1fr;
    gap: 0;
    padding: var(--space-1) var(--space-5) var(--space-2);
}

.vc-detail .vc-card__logo {
    margin-top: var(--space-4);
}

.vc-detail .vc-card__name {
    padding: var(--space-4) 0 var(--space-3);
    border-bottom: 1px solid var(--line);
    font-size: var(--text-lg);
    letter-spacing: normal;
}

.vc-detail .vc-card__field {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1) var(--space-4);
    min-height: 44px;
    padding: var(--space-2) 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
}

.vc-detail .vc-card__field:last-child {
    border-bottom: 0;
}

.vc-detail .vc-card__label {
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
}

.vc-detail .vc-card__value {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: right;
}

.vc-detail .vc-card__field--wide {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-3) 0;
}

.vc-detail .vc-card__field--wide .vc-card__value {
    display: block;
    font-size: var(--text-base);
    font-weight: 400;
    text-align: left;
}

@media (min-width: 768px) {
    .vc-detail .vc-card {
        grid-template-columns: 1fr;
    }
}

/* A person's profile (`profile/profile_detail.html`): their avatar by their name, the
   facts as a card of rows (the label left, the value right; the manager and the director
   with their avatars), and each section's title at a section's size in sentence case, not
   a spaced capital micro-label. */
.profile-facts {
    margin: 0 0 var(--space-5);
    padding: var(--space-1) var(--space-5);
}

.profile-facts .detail-list {
    display: block;
    margin: 0;
}

.profile-facts .detail-list__cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1) var(--space-4);
    min-height: 44px;
    padding: var(--space-2) 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
}

.profile-facts .detail-list__cell:last-child {
    border-bottom: 0;
}

.profile-facts .detail-list dt {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
}

.profile-facts .detail-list dd {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: right;
}

.profile-page .report-section__title {
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text);
}

.profile-page .card h3 {
    margin: var(--space-4) 0 var(--space-1);
    font-size: var(--text-base);
    font-weight: 700;
}

/* coder-735: the short lists on WGIT Admin's Overview and an organization's pages -- one line
   per entry, a hairline between. */
.org-list {
    margin: 0 0 var(--space-3);
    padding: 0;
    list-style: none;
}

.org-list > li {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.org-list > li:last-child {
    border-bottom: 0;
}

.setup-item__aside {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2) var(--space-3);
    max-width: 45%;
}

.setup-item__link {
    font-size: 0.8125rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .setup-checklist .step-row__main {
        flex-wrap: wrap;
    }

    .setup-item__aside {
        max-width: none;
        width: 100%;
        justify-content: flex-start;
        padding-left: calc(24px + var(--space-2) + 14px);
    }
}

/* coder-735 (NAVIGATION_REGROUP.md v1.0): WGIT Admin's five sections and the current section's
   pages, and an organization's frame -- its name, vertical and status, its six sections and the
   current section's pages. Tabs on a desktop, where the pages' row sits close under the
   sections'; on a phone (640 px and under) each is one menu of lists (`.nav-menu`, a
   <details>), so no navigation scrolls sideways. */
.tabs[data-admin-sections] {
    margin-bottom: 0;
}

.tabs[data-admin-pages] {
    margin-bottom: var(--space-5);
}

.tabs[data-admin-pages] .tabs__tab,
.tabs[data-org-pages] .tabs__tab {
    min-height: 40px;
    font-weight: 550;
}

@media (min-width: 641px) {
    .tabs[data-admin-pages] .tabs__list,
    .org-frame .tabs__list {
        flex-wrap: wrap;
        column-gap: var(--space-4);
        row-gap: 0;
        overflow-x: visible;
    }
}

.admin-nav .tabs[data-admin-sections]:last-of-type {
    margin-bottom: var(--space-5);
}

.org-frame {
    margin: 0 0 var(--space-5);
}

.org-frame__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-1) var(--space-4);
    margin: var(--space-2) 0 var(--space-3);
}

.org-frame__name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: var(--leading-snug);
    color: var(--text);
    overflow-wrap: anywhere;
}

.org-frame__meta {
    margin: 0;
}

.org-frame .tabs {
    margin-bottom: var(--space-2);
}

.nav-menu {
    display: none;
}

@media (max-width: 640px) {
    .admin-nav .tabs,
    .org-frame .tabs {
        display: none;
    }

    .nav-menu {
        display: block;
        margin: 0 0 var(--space-4);
        border: 1px solid var(--line);
        border-radius: var(--radius-card);
        background: var(--card);
    }

    .nav-menu--bar {
        margin: var(--space-4) var(--space-6);
    }
}

.nav-menu__summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-4);
    cursor: pointer;
    list-style: none;
}

.nav-menu__summary::-webkit-details-marker {
    display: none;
}

.nav-menu__summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: var(--radius-card);
}

.nav-menu__label {
    flex: none;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-2);
    font-size: var(--text-xs);
    font-weight: 600;
}

.nav-menu__where {
    flex: 1;
    min-width: 0;
    color: var(--text);
    font-weight: 650;
    overflow-wrap: anywhere;
}

.nav-menu[open] > .nav-menu__summary .icon {
    transform: rotate(90deg);
}

.nav-menu__sections,
.nav-menu__pages {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu__sections {
    padding-bottom: var(--space-2);
    border-top: 1px solid var(--line);
}

.nav-menu__section-link,
.nav-menu__page {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-4);
    color: var(--text);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.nav-menu__section-link {
    font-weight: 650;
}

.nav-menu__page {
    padding-left: var(--space-8);
    color: var(--text-2);
    font-size: 0.875rem;
}

.nav-menu__section-link[aria-current],
.nav-menu__page[aria-current="page"] {
    color: var(--accent-text);
}

.nav-menu__page[aria-current="page"] {
    font-weight: 650;
    box-shadow: inset 3px 0 0 var(--accent);
}

/* coder-735 (§4): an organization's setup checklist -- the step list's rows (coder-697), a
   phase heading over each group, a tick for a verified item that is done, an empty ring for one
   that is not, a dash for what is shown without a tick. */
.setup-phase__title {
    margin: var(--space-5) 0 0;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-2);
}

.setup-phase:first-of-type .setup-phase__title {
    margin-top: var(--space-2);
}

.setup-phase .step-list {
    margin-top: var(--space-2);
}

.step-row__n--info,
.step-row__n--unchecked {
    border-style: dashed;
}

.setup-next {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
}

.setup-next__what {
    flex: 1 1 18rem;
    min-width: 0;
    margin: 0;
}

/* coder-744 (LANDING_PAGE.md §3, §3.2): WGIT Admin's Fit requests and Public site pages. */
.fit-detail {
    display: grid;
    grid-template-columns: minmax(10rem, max-content) 1fr;
    gap: var(--space-2) var(--space-4);
    margin: 0;
}

.fit-detail dt {
    font-weight: 600;
    color: var(--text-2);
}

.fit-detail dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.fit-detail__long {
    white-space: pre-wrap;
}

.fit-detail .muted,
.public-site-state .muted {
    color: var(--text-2);
}

.fit-delete > summary {
    list-style: none;
    display: inline-flex;
}

.fit-delete > summary::-webkit-details-marker {
    display: none;
}

.fit-delete[open] > summary {
    margin-bottom: var(--space-3);
}

@media (max-width: 640px) {
    .fit-detail {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }

    .fit-detail dd {
        margin-bottom: var(--space-3);
    }
}

/* coder-833 (D522 §3): Send meeting invite's date, start and length -- one row of three on a
   wide screen, stacked on a phone (each field its own line, no sideways scroll). */
.meeting-when {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

.meeting-when .form-input,
.meeting-when .form-select {
    width: 100%;
    min-width: 0;
}

@media (max-width: 640px) {
    .meeting-when {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* coder-1099 (D615 §2): the task page's Time card -- its day, start and hours in a row, one
   column at 640 px and below, as the meeting form's. */
.task-time-when {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

.task-time-when .form-input {
    width: 100%;
    min-width: 0;
}

@media (max-width: 640px) {
    .task-time-when {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* coder-834 (D522 §4): Find a time -- a day of quarter hours, a column for Everyone and one
   per person; at 640 px and below only the time and Everyone's "busy for n of m". */
.meeting-picker {
    margin-bottom: var(--space-4);
}

.meeting-picker__panel {
    margin-top: var(--space-3);
}

.meeting-picker__status.is-error {
    color: var(--problem);
}

.meeting-grid {
    max-height: 24rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
}

.meeting-grid:empty {
    display: none;
}

.meeting-grid__table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.meeting-grid__table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--card);
    border-bottom: 1px solid var(--line-strong);
    padding: var(--space-2);
    text-align: left;
    font-weight: 600;
    vertical-align: bottom;
}

.meeting-grid__table td,
.meeting-grid__table tbody th {
    border-bottom: 1px solid var(--line);
    padding: 0 var(--space-2);
    height: 2.25rem;
    white-space: nowrap;
}

.meeting-grid__person {
    min-width: 6rem;
}

.meeting-grid__note {
    display: block;
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--text-2);
    white-space: normal;
}

.meeting-grid__slot {
    background: none;
    border: 0;
    padding: var(--space-1) 0;
    font: inherit;
    font-variant-numeric: tabular-nums;
    color: var(--accent-text);
    cursor: pointer;
    min-height: 2.25rem;
    width: 100%;
    text-align: left;
}

.meeting-grid__slot:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: -2px;
}

.meeting-grid__row {
    cursor: pointer;
}

.meeting-grid__all.is-free {
    color: var(--good);
}

.meeting-grid__all.is-busy,
td.meeting-grid__person.is-busy {
    background: var(--warn-tint);
}

td.meeting-grid__person.is-busy {
    color: var(--text-2);
    font-size: var(--text-xs);
}

td.meeting-grid__person.is-unknown {
    background: var(--hatch);
}

.meeting-grid__row.is-chosen th,
.meeting-grid__row.is-chosen .meeting-grid__all {
    background: var(--accent-tint);
}

@media (max-width: 640px) {
    .meeting-grid .meeting-grid__person {
        display: none;
    }
}

/* coder-836 (D525): the Owner field's picker on an SOP's and a vendor's edit form -- each
   person the search finds; who cannot be picked shows the reason and a link or a request. */
.owner-picker {
    position: relative;
}

.owner-picker__list {
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--card);
    box-shadow: var(--shadow);
    max-height: 22rem;
    overflow-y: auto;
}

.owner-picker__item,
.owner-picker__empty {
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--line);
}

.owner-picker__item:first-child,
.owner-picker__empty:first-child {
    border-top: 0;
}

.owner-picker__empty {
    color: var(--text-2);
    font-size: var(--text-sm);
}

.owner-picker__pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--space-2);
    width: 100%;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.owner-picker__pick:hover .owner-picker__name {
    color: var(--accent-text);
}

.owner-picker__pick:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.owner-picker__name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.owner-picker__email {
    color: var(--text-2);
    font-size: var(--text-sm);
    overflow-wrap: anywhere;
}

.owner-picker__who {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-2);
    margin: 0;
}

.owner-picker__tag {
    color: var(--text-2);
    font-size: var(--text-xs);
}

.owner-picker__reason,
.owner-picker__result {
    margin: var(--space-1) 0 0;
    color: var(--text-2);
    font-size: var(--text-sm);
    overflow-wrap: anywhere;
}

.owner-picker__result {
    color: var(--text);
}

.owner-picker__action {
    display: inline-block;
    margin-top: var(--space-2);
    max-width: 100%;
    height: auto;
    white-space: normal;
    text-align: left;
}

/* ==========================================================================
   Ideas (coder-889, D548): an idea's home -- its related ideas, one row each with its
   Remove beside it, and the owner's Promote, Park and Retire side by side, the one opened
   taking the full width for its reason.
   ========================================================================== */

.idea-related {
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
}

.idea-related > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.idea-inline-form {
    display: inline;
    margin: 0;
}

.idea-resolve-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-2);
}

.idea-resolve[open] {
    flex-basis: 100%;
}

.idea-resolve > form {
    margin-top: var(--space-3);
}

/* coder-909 (D548 rules 6, 7): a thing's Ideas section -- its rows in THINGS_AND_HOMES' row
   shape, Remove opening its optional reason beneath the row, and the section's actions in a
   wrapping row; Applies to and a pending link's Approve and Decline on the idea's home. */
.ideas-section__rows {
    margin-bottom: var(--space-3);
}

.ideas-section__row {
    flex-wrap: wrap;
    overflow-wrap: anywhere;
}

.ideas-section__remove[open] {
    flex-basis: 100%;
}

.ideas-section__remove > form {
    margin-top: var(--space-2);
}

.ideas-section__actions,
.idea-link-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* coder-1242 (Meetings M2-1; contract v1.3 §9, §11): an item's Meetings section, in the Ideas
   section's row shape, and Add meeting notes -- its tick on a label and, on a phone, its
   controls at Meetings' 44 px. */
.meetings-section__row {
    flex-wrap: wrap;
    overflow-wrap: anywhere;
}

.add-meeting-notes__form {
    margin-top: var(--space-3);
}

.add-meeting-notes__tick {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
}

@media (max-width: 640px) {
    .add-meeting-notes > summary,
    .add-meeting-notes .btn {
        min-height: 44px;
    }
}

/* coder-913 (D548 rules 8, 10, 14): a row's Act here, For discussion and Remove side by side,
   wrapping on a phone; the suggestions at capture, one tick per line. */
.ideas-section__aside {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 1;
    align-items: flex-start;
    gap: var(--space-2);
    min-width: 0;
    max-width: 100%;
}

.ideas-section__act,
.ideas-section__discuss {
    margin: 0;
}

.idea-suggest__list {
    margin: 0 0 var(--space-3);
    padding: 0;
    list-style: none;
    overflow-wrap: anywhere;
}

.idea-suggest__list li + li {
    margin-top: var(--space-2);
}

.idea-audience {
    margin: 0 0 var(--space-3);
    padding-left: var(--space-5);
    overflow-wrap: anywhere;
}

/* coder-1008 (D597 §5): Sign out is a POST, so each sign-out is a form whose button is drawn
   as the link it replaced (`.logout-link`, the shell's `.shell-person__link`). */
.sign-out-form {
    display: inline;
    margin: 0;
}

.sign-out-form button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.sign-out-form .logout-link {
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* coder-1049 (D609): Once / Repeats on New task and the workflow start form, the Repeating
   list and a schedule's page. Tokens only. */
.repeat-choice__options,
.repeat-ends {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
}

.repeat-ends {
    flex-direction: column;
}

.repeat-choice__option {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
}

.repeat-fields {
    margin: var(--space-3) 0;
    padding: var(--space-4);
    border-radius: var(--radius-panel);
    background: var(--ground);
}

.repeat-fields[hidden],
[data-repeat-group][hidden],
[data-once-only][hidden] {
    display: none;
}

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

.repeat-row__number {
    width: 6rem;
}

.repeat-row__unit {
    width: auto;
    min-width: 8rem;
}

.repeat-row__date {
    width: auto;
}

.repeat-days {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.repeat-days__day {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 44px;
    padding: 0 var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.repeat-preview {
    margin-top: var(--space-3);
}

.repeat-preview__next {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
}

.repeat-preview__next li {
    margin-bottom: var(--space-1);
}

.repeat-preview__starts {
    color: var(--text-2);
}

.repeat-preview__closed {
    color: var(--warn);
    font-size: var(--text-sm);
}

.schedule-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.schedule-inline-form {
    display: inline;
}

.schedule-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-1) var(--space-3);
    margin: 0;
}

.schedule-facts dt {
    color: var(--text-2);
}

.schedule-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.schedule-fixes {
    margin: var(--space-1) 0 0;
    padding-left: var(--space-4);
    font-size: var(--text-sm);
}

.schedule-history {
    margin: 0;
    padding-left: var(--space-4);
}

.schedule-owed {
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
}

/* coder-1053: a schedule's figures -- each label with its line of explanation, the lines
   that are part of a group set in under it. */
.schedule-figures tbody th {
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--text);
    vertical-align: middle;
    white-space: normal;
}

.schedule-figures__label {
    display: block;
    font-weight: 650;
}

.schedule-figures__why {
    display: block;
    color: var(--text-2);
    font-size: var(--text-xs);
}

.schedule-figures__part th {
    padding-left: var(--space-6);
}

.schedule-figures td {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
    .schedule-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .schedule-figures tbody th {
        display: block;
        border-bottom: none;
        padding: var(--space-1) var(--space-4);
    }

    .schedule-figures__part th {
        padding-left: var(--space-6);
    }
}

.my-tasks-repeating {
    margin-top: var(--space-5);
}

/* coder-1146 (D647 rules 3 and 4; contract §11): WGIT Admin's Meetings page and an
   organization's Meetings card -- their controls 44 px on a phone. */
@media (max-width: 640px) {
    [data-meetings-master-page] .btn,
    [data-meetings-card] .btn,
    [data-meetings-card] .form-input {
        min-height: 44px;
    }

    [data-meetings-card] .form-hint a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}
