/* Everon house style for the census-resolver demo.
 *
 * The portal's UI library (ec-frontend `src/ui/*`) is React + CSS Modules + Radix and
 * cannot be imported into Jinja. So the TOKEN LAYER is ported here verbatim from
 * ec-frontend `src/styles/index.css`, and the handful of components this demo needs are
 * rebuilt on top of those same tokens. Tokens are the sync point: if the design system
 * moves, re-port this :root block and the components follow.
 *
 * Ported 2026-09-16 under tickets[6592]. Do not hand-edit hex values — change the token.
 */

/* ============================================================ TOKENS  */

:root {
    /* === GRAY === */
    --color-gray-50: hsl(0deg 0% 100%);
    --color-gray-100: hsl(223deg 100% 99%);
    --color-gray-150: hsl(230deg 43% 97%);
    --color-gray-200: hsl(223deg 54% 97%);
    --color-gray-300: hsl(223deg 37% 96%);
    --color-gray-400: hsl(223deg 24% 94%);
    --color-gray-500: hsl(223deg 14% 90%);
    --color-gray-600: hsl(223deg 10% 86%);
    --color-gray-650: hsl(223deg 5% 75%);
    --color-gray-700: hsl(223deg 4% 63%);
    --color-gray-800: hsl(223deg 3% 43%);
    --color-gray-900: hsl(223deg 4% 35%);
    --color-gray-950: hsl(240deg 100% 7%);
    --color-white-alpha-100: hsl(0deg 0% 100% / 0.1);
    --color-white-alpha-200: hsl(0deg 0% 100% / 0.2);
    --color-white-alpha-400: hsl(0deg 0% 100% / 0.4);

    /* === BLUE === */
    --color-blue-100: hsl(212deg 100% 95%);
    --color-blue-600: hsl(240deg 66% 52%);
    --color-blue-700: hsl(240deg 64% 41%);
    --color-blue-alpha-100: hsl(241deg 100% 63% / 0.1);

    /* === LIGHT BLUE === */
    --color-light-blue-400: hsl(186deg 100% 50%);
    --color-light-blue-500: hsl(187deg 97% 46%);
    --color-light-blue-800: hsl(193deg 81% 27%);
    --color-light-blue-alpha-100: hsl(186deg 100% 50% / 0.1);

    /* === RED === */
    --color-red-100: hsl(22deg 100% 92%);
    --color-red-400: hsl(15deg 100% 61%);
    --color-red-600: hsl(8deg 96% 48%);
    --color-red-700: hsl(6deg 94% 40%);
    --color-red-alpha-100: hsl(8deg 96% 48% / 0.1);

    /* === ORANGE / YELLOW === */
    --color-orange-100: hsl(43deg 100% 91%);
    --color-orange-700: hsl(33deg 95% 33%);
    --color-orange-alpha-100: hsl(43deg 98% 48% / 0.1);
    --color-yellow-100: hsl(43deg 100% 91%);
    --color-yellow-700: hsl(33deg 95% 33%);

    /* === GREEN === */
    --color-green-100: hsl(128deg 79% 93%);
    --color-green-500: hsl(130deg 65% 45%);
    --color-green-700: hsl(130deg 66% 29%);
    --color-green-alpha-100: hsl(130deg 65% 45% / 0.1);

    /* === BRAND VIOLET — the Everon ramp === */
    --color-brand-violet-50: hsl(250deg 100% 99%);
    --color-brand-violet-100: hsl(250deg 100% 96%);
    --color-brand-violet-200: hsl(250deg 100% 90%);
    --color-brand-violet-300: hsl(250deg 100% 85%);
    --color-brand-violet-400: hsl(250deg 98% 76%);
    --color-brand-violet-500: hsl(250deg 88% 63%);
    --color-brand-violet-600: hsl(250deg 71% 55%);
    --color-brand-violet-700: hsl(250deg 51% 45%);
    --color-brand-violet-750: hsl(250deg 50% 38%);
    --color-brand-violet-800: hsl(250deg 50% 30%);
    --color-brand-violet-900: hsl(250deg 50% 20%);
    --color-brand-violet-950: hsl(250deg 49% 14%);

    /* Spacing */
    --spacing-3xs: 0.125rem;
    --spacing-2xs: 0.25rem;
    --spacing-xs: 0.375rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-base: 1rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    --spacing-3xl: 2.5rem;
    --spacing-4xl: 3rem;

    /* Radius */
    --radius-xxs: 0.25rem;
    --radius-xs: 0.375rem;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px hsl(208deg 24% 14% / 0.06);
    --shadow-md: 0 4px 11px -1px hsl(208deg 24% 14% / 0.08);
    --shadow-lg: 0 10px 24px -4px hsl(208deg 24% 14% / 0.12);

    /* Type */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.5rem;
    --font-size-xl: 2rem;
    --font-size-display-sm: 1.75rem;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Focus ring */
    --ring-width: 2px;
    --ring-color: var(--vendor-500);
}

/* === EVERON VENDOR SCOPE ===
   The design system's documented way to add a scope: copy a vendor block, rename the
   selector, swap the hex. Everon = the brand-violet ramp. Set on <body>. */
[data-vendor-scope="everon"] {
    --vendor-50: var(--color-brand-violet-50);
    --vendor-100: var(--color-brand-violet-100);
    --vendor-200: var(--color-brand-violet-200);
    --vendor-300: var(--color-brand-violet-300);
    --vendor-400: var(--color-brand-violet-400);
    --vendor-500: var(--color-brand-violet-500);
    --vendor-600: var(--color-brand-violet-600);
    --vendor-700: var(--color-brand-violet-700);
    --vendor-750: var(--color-brand-violet-750);
    --vendor-800: var(--color-brand-violet-800);
    --vendor-950: var(--color-brand-violet-950);
    --vendor-alpha-50: hsl(250deg 88% 63% / 0.05);
    --vendor-alpha-100: hsl(250deg 88% 63% / 0.1);
    --vendor-alpha-150: hsl(250deg 88% 63% / 0.15);

    /* Semantic layer — recomputed against this scope's --vendor-* values. */
    --surface-ground: var(--color-gray-150);
    --surface-card: var(--color-gray-50);
    --surface-contrast: var(--vendor-950);
    --surface-primary: var(--vendor-50);
    --surface-secondary: var(--color-gray-100);
    --surface-secondary-hover: var(--color-gray-200);
    --surface-input: var(--color-gray-50);
    --surface-table-header: var(--vendor-600);

    --text-primary: var(--color-gray-950);
    --text-secondary: var(--color-gray-800);
    --text-contrast: var(--color-gray-50);
    --text-on-brand: var(--color-gray-50);
    --text-brand: var(--vendor-500);
    --text-positive: var(--color-green-700);
    --text-negative: var(--color-red-600);
    --text-disabled: var(--color-gray-700);

    --border-primary: var(--color-gray-500);
    --border-strong: var(--color-gray-600);
    --border-focus: var(--vendor-500);
    --border-negative: var(--color-red-400);
    --border-positive: var(--color-green-500);

    --button-primary: var(--vendor-500);
    --button-primary-hover: var(--vendor-600);
    --button-primary-pressed: var(--vendor-700);
    --button-tertiary: var(--color-gray-50);
    --button-tertiary-hover: var(--vendor-100);
    --border-button-tertiary: var(--color-gray-600);

    --brand-glow: color-mix(in srgb, var(--vendor-500) 30%, transparent);
    --brand-glow-soft: color-mix(in srgb, var(--vendor-500) 18%, transparent);
}

/* ============================================================ RESET  */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Onest, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--surface-ground);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
figure {
    margin: 0;
}

a {
    color: var(--text-brand);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: var(--ring-width) solid var(--ring-color);
    outline-offset: 2px;
}

/* ============================================================ APP SHELL  */

.app-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-base);
    padding: var(--spacing-md) var(--spacing-2xl);
    background: var(--surface-contrast);
    color: var(--text-contrast);
    box-shadow: var(--shadow-sm);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.01em;
    color: var(--text-contrast);
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    color: var(--vendor-400);
}

.brand-sub {
    color: var(--color-white-alpha-400);
    font-weight: var(--font-weight-regular);
}

.app-bar-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-white-alpha-400);
}

.env-chip {
    padding: var(--spacing-3xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    background: var(--color-white-alpha-100);
    border: 1px solid var(--color-white-alpha-200);
    color: var(--text-contrast);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Signed-in user + sign out, AUTH_MODE=admin_handoff only. tickets[7323] */
.app-bar-user {
    color: var(--text-contrast);
    font-weight: var(--font-weight-medium);
}

.app-bar-link {
    color: var(--color-white-alpha-400);
    text-decoration: underline;
}

.app-bar-link:hover {
    color: var(--text-contrast);
}

/* The sign-in and sign-in-outcome pages: one narrow card, centred. */
.signin-card {
    width: 100%;
    max-width: 32rem;
    margin: var(--spacing-2xl) auto 0;
}

.page {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

/* ============================================================ STEP NAV  */

.steps {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    background: var(--surface-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.step {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-base);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.step:hover {
    background: var(--surface-secondary-hover);
    text-decoration: none;
}

.step[aria-current="page"] {
    background: var(--vendor-alpha-100);
    color: var(--text-brand);
}

.step[aria-disabled="true"] {
    color: var(--text-disabled);
    pointer-events: none;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background: var(--surface-secondary);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

.step[aria-current="page"] .step-num {
    background: var(--button-primary);
    color: var(--text-on-brand);
}

/* ============================================================ VIEW SWITCH  */

.viewswitch {
    display: inline-flex;
    gap: var(--spacing-3xs);
    padding: var(--spacing-3xs);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
    width: fit-content;
}

.viewtab {
    padding: var(--spacing-sm) var(--spacing-base);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.viewtab:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.viewtab[aria-current="page"] {
    background: var(--surface-card);
    color: var(--text-brand);
    box-shadow: var(--shadow-sm);
}

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

.card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-base);
    padding: var(--spacing-xl);
    background: var(--surface-card);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card[data-variant="bordered"] {
    border-color: var(--border-primary);
    box-shadow: none;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.card-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
}

.card-desc {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.page-title {
    font-size: var(--font-size-display-sm);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.section-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

/* ============================================================ BUTTONS  */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: fit-content;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.btn[data-variant="primary"] {
    background: var(--button-primary);
    color: var(--text-on-brand);
    box-shadow: 0 1px 2px var(--brand-glow-soft);
}

.btn[data-variant="primary"]:hover {
    background: var(--button-primary-hover);
}

.btn[data-variant="primary"]:active {
    background: var(--button-primary-pressed);
}

.btn[data-variant="secondary"] {
    background: var(--button-tertiary);
    color: var(--text-primary);
    border-color: var(--border-button-tertiary);
}

.btn[data-variant="secondary"]:hover {
    background: var(--button-tertiary-hover);
    text-decoration: none;
}

.btn:is([disabled], [aria-disabled="true"]) {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.btn[data-size="sm"] {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
}

/* ============================================================ FORMS  */

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: var(--spacing-base);
}

.field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.field-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

input[type="text"],
input:not([type]),
input[type="file"],
select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: inherit;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--surface-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-glow-soft);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--vendor-500);
    cursor: pointer;
}

fieldset.group {
    margin: 0;
    padding: var(--spacing-lg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
}

fieldset.group > legend {
    padding: 0 var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-3xl) var(--spacing-xl);
    text-align: center;
    border: 2px dashed var(--vendor-200);
    border-radius: var(--radius-md);
    background: var(--vendor-alpha-50);
}

.dropzone input[type="file"] {
    max-width: 24rem;
}

/* The native "Choose Files" button, restyled as `.btn[data-variant="secondary"]
   data-size="sm"` so it reads as one of ours. The input stays native — keyboard, screen
   reader and "N files" label all come from the browser. tickets[7186] */
input[type="file"] {
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    margin-right: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-md);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.25rem;
    color: var(--text-primary);
    background: var(--button-tertiary);
    border: 1px solid var(--border-button-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

input[type="file"]:hover::file-selector-button {
    background: var(--button-tertiary-hover);
    border-color: var(--vendor-300);
}

input[type="file"]:active::file-selector-button {
    background: var(--vendor-200);
}

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

.table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-card);
}

table.data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--font-size-xs);
    font-variant-numeric: tabular-nums;
}

table.data th,
table.data td {
    padding: var(--spacing-xs) var(--spacing-sm);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-gray-500);
    white-space: nowrap;
}

/* Header labels wrap. `nowrap` here was the single biggest cost in the roster:
   "Net post-tax allotment" alone held a column at 155px. Wrapping to two lines lets the
   whole 16-column roster fit a 1280px desktop without a horizontal scrollbar, which is
   what makes the Totals row checkable against the rows above it. Data cells keep `nowrap`
   so no money figure ever breaks across lines.

   A header aligns with ITS OWN COLUMN, so it sits directly over the values beneath it:
   left above text, right above figures. Centring every header was the cause of the
   "nothing lines up" reading of these tables — a centred label above a left-aligned name
   and a right-aligned amount looks misaligned against both, in every table on the site.
   A header that genuinely spans several columns is the one that should be centred, and
   that case is handled by [colspan] below. #6652 */
table.data thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-table-header);
    color: var(--text-on-brand);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xs);
    letter-spacing: 0.01em;
    white-space: normal;
    text-align: center;
    vertical-align: middle;
}

/* A group header really does sit above its whole group, so it centres over them. This is
   the roster's two-row header — "Monthly", "Annual" and the rest. */
table.data thead th[colspan] {
    text-align: center;
}

/* A header sits over its own column's content. Money is right-aligned so its header is too;
   a status badge is centred so its header is too — that last one is why the Status label
   looked shunted left of the badges beneath it. #6662 */
table.data th.center,
table.data td.center {
    text-align: center;
}

table.data tbody tr:nth-child(even) {
    background: var(--color-gray-200);
}

table.data tbody tr:hover {
    background: var(--vendor-alpha-50);
}

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

/* Data cells only. A money column still right-aligns its figures so the decimal points line
   up down the column, which is the whole reason a reader can scan them — but the HEADER above
   it centres with every other header. #6662 */
table.data td.num {
    text-align: right;
}

table.data td.num,
table.data th.num {
    font-variant-numeric: tabular-nums;
}

/* A form's confirming action sits at the end of the row, where the eye finishes reading
   rather than where it started. #6652 */
.actions-end {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

table.data td.wrap {
    white-space: normal;
    min-width: 9rem;
}

/* The employer roster is the one table with 16 columns, 11 of them money, and at 1280px it
   was still 238px wider than its container. Measured, not guessed: the cost was ordinary
   cell padding multiplied by 32 edges, two name columns held open by `nowrap` (a surname
   like "Escareno Rodriguez" alone demanded 137px), and a 9rem floor under the notes column
   whose widest cell holds 396 characters. Tightening those three lands it at exactly its
   container with the font UNCHANGED — shrinking the type would make a table of dollar
   figures harder to read, which defeats the point of it fitting. Scoped to `.roster` so the
   upload and census tables keep their comfortable spacing. #6652 */
table.data.roster th,
table.data.roster td {
    padding-left: 4px;
    padding-right: 4px;
}

/* The gutter between two columns is the sum of the padding either side of the border, so a
   right-aligned figure followed by a left-aligned one reads as "jammed against the next
   column" even though the padding is symmetric — Payroll reduction against Status was
   exactly this. Widening the padding is not available: 16 columns already fit their
   container to the pixel, and 5px puts the table 28px over again (measured). A visible
   column rule solves it instead, by making the boundary explicit rather than leaving the
   eye to infer it from whitespace that is not there. #6662 */
table.data.roster tbody td + td,
table.data.roster thead tr:last-child th + th {
    border-left: 1px solid var(--color-gray-200);
}

table.data.roster thead tr:last-child th + th {
    border-left-color: var(--vendor-500, rgba(255, 255, 255, 0.25));
}

table.data.roster tbody td:nth-child(2),
table.data.roster tbody td:nth-child(3) {
    white-space: normal;
}

table.data.roster td.wrap {
    min-width: 5rem;
}

/* Uploaded files: one row per file. A table needed column widths, and with byte counts and
   table counts gone there was nothing left to justify them — the widths were the ragged
   spacing Keaton kept seeing. #6662 */
.filelist {
    list-style: none;
    margin: var(--spacing-sm) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.filelist li {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm, 6px);
    background: var(--color-gray-200);
}

.filelist .filename {
    font-weight: var(--font-weight-semibold);
    word-break: break-all;
}

/* Field coverage as a bar per field. "wage: 58" is a number you have to hold the row count
   beside to interpret; a bar is the comparison already made. */
table.data.coverage {
    margin-top: var(--spacing-sm);
}

/* A bar is a block element, so it sits at the top of its cell while the text beside it is
   centred by its line box — 5px out on every row. Cells centre their content instead. */
table.data td {
    vertical-align: middle;
}

.meter {
    display: block;
    width: 100%;
    min-width: 6rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--color-gray-300, #d8d8e0);
    overflow: hidden;
}

/* The fill's colour moves CONTINUOUSLY with how complete the field is, rather than flipping
   to a warning colour the moment one employee is missing. 57 of 58 is not a problem and must
   not look like one; 12 of 58 is, and should. `--complete` is set per row from the actual
   ratio. The solid declaration first is the fallback for anything without color-mix. #6662 */
.meter-fill {
    display: block;
    height: 100%;
    /* The track's radius only clips the LEFT end of a partial fill; its right end is a cut
       edge inside the track and reads as broken off. Rounding the fill itself finishes it. */
    border-radius: 999px;
    background: var(--vendor-600);
    background: color-mix(
        in srgb,
        var(--vendor-600) var(--complete, 100%),
        var(--color-orange-700)
    );
}

/* Switch on the left, export hard right, sharing one baseline. */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* The footer's two percentage cells use different denominators; the qualifier is what stops
   the Totals figure reading as a broken sum of the column above it. */
.denom {
    display: block;
    font-size: 0.85em;
    font-weight: var(--font-weight-regular, 400);
    opacity: 0.75;
    white-space: nowrap;
}

/* Per-row disclosures, moved out of the roster's last column. Folded away by default so the
   table is the thing you see, but present and complete — the assumptions are how a reader
   checks that no figure here was guessed. #6652 */
.disclosures {
    margin-top: var(--spacing-md);
    font-size: var(--font-size-xs);
}

.disclosures > summary {
    cursor: pointer;
    color: var(--vendor-700);
    font-weight: var(--font-weight-semibold);
    padding: var(--spacing-xs) 0;
}

.disclosure-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--spacing-xs) var(--spacing-md);
    margin: var(--spacing-sm) 0 0;
}

.disclosure-list dt {
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

.disclosure-list dd {
    margin: 0;
}

/* The mapping page puts a field picker in a table cell. `width: 100%` of a cell sized
   to its shortest content collapses it to a few characters, so the operator cannot read
   what a column is mapped to — the one decision that page exists to capture. */
table.data select {
    min-width: 17rem;
}

/* A deduction column's "per paycheck / monthly / yearly" sits under its field picker. */
table.data select.cadence {
    display: block;
    margin-top: var(--spacing-xs);
}

/* Grouped header: a banner row above the labels, so a reader can see at a glance which
   columns are monthly, which are annual, and which three sum to the gross saving. */
table.data thead tr.group-row th {
    background: var(--vendor-750);
    color: var(--text-on-brand);
    text-align: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-top: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    border-bottom: none;
}

table.data thead tr.group-row th.group {
    border-left: 1px solid var(--vendor-500);
}

table.data thead tr.group-row + tr th {
    top: 1.85rem; /* sticks below the banner row, which is the first sticky layer */
}

/* Roster footer: Totals / Averages. Sticks to the bottom so the figures stay in view on a
   long roster, and reads as a summary band rather than another data row. */
table.data tfoot th,
table.data tfoot td {
    position: sticky;
    bottom: 0;
    background: var(--surface-secondary);
    border-top: 2px solid var(--vendor-500);
    border-bottom: none;
    font-weight: var(--font-weight-semibold);
}

table.data tfoot tr:first-child th,
table.data tfoot tr:first-child td {
    border-bottom: 1px solid var(--color-gray-500);
}

/* The "Totals (43 eligible)" label spans the roster's three identity columns, so it centres
   over them the same way a group header centres over its group — left-aligning it left it
   sitting out of step with every cell beside it in its own row. #6662 */
table.data tfoot th {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.foot-count {
    font-weight: var(--font-weight-regular);
    color: var(--text-secondary);
}

/* Key/value summary table — row headers down the left. */
table.kv th {
    background: var(--surface-secondary);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

table.kv td {
    font-weight: var(--font-weight-semibold);
}

/* ============================================================ BANNERS + BADGES  */

.banner {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-base);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: var(--font-size-sm);
}

.banner[data-type="warning"] {
    background: var(--color-orange-alpha-100);
    border-color: var(--color-orange-100);
    color: var(--color-orange-700);
}

.banner[data-type="error"] {
    background: var(--color-red-alpha-100);
    border-color: var(--color-red-100);
    color: var(--color-red-700);
}

.banner[data-type="success"] {
    background: var(--color-green-alpha-100);
    border-color: var(--color-green-100);
    color: var(--color-green-700);
}

.banner[data-type="info"] {
    background: var(--color-light-blue-alpha-100);
    border-color: var(--color-blue-100);
    color: var(--color-light-blue-800);
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    background: var(--color-gray-300);
    color: var(--color-gray-900);
}

.badge[data-type="success"] {
    background: var(--color-green-alpha-100);
    color: var(--color-green-700);
}

.badge[data-type="error"] {
    background: var(--color-red-alpha-100);
    color: var(--color-red-700);
}

.badge[data-type="warning"] {
    background: var(--color-orange-alpha-100);
    color: var(--color-orange-700);
}

.badge[data-type="info"] {
    background: var(--color-light-blue-alpha-100);
    color: var(--color-light-blue-800);
}

.badge[data-type="brand"] {
    background: var(--vendor-alpha-100);
    color: var(--text-brand);
}

/* ============================================================ DRAFT WATERMARK  */

.watermark {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid var(--color-red-400);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: var(--color-red-alpha-100);
    color: var(--color-red-700);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: var(--font-size-xs);
}

/* ============================================================ UTILITIES  */

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

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

.negative {
    color: var(--text-negative);
    font-weight: var(--font-weight-semibold);
}

.row-inactive td {
    color: var(--text-disabled);
}

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

.inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.disclosure-list {
    padding-left: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

code {
    padding: 0.05rem var(--spacing-2xs);
    border-radius: var(--radius-xxs);
    background: var(--surface-secondary);
    border: 1px solid var(--color-gray-500);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.95em;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--spacing-base);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3xs);
    padding: var(--spacing-base);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.stat-value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.site-footer {
    padding: var(--spacing-lg) var(--spacing-2xl) var(--spacing-3xl);
    max-width: 1440px;
    margin: 0 auto;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-primary);
}

/* ============================================================ RESPONSIVE  */

@media screen and (max-width: 1023px) {
    .page,
    .site-footer {
        padding-left: var(--spacing-base);
        padding-right: var(--spacing-base);
    }

    .app-bar {
        padding-left: var(--spacing-base);
        padding-right: var(--spacing-base);
    }
}

@media screen and (max-width: 767px) {
    .page-title {
        font-size: var(--font-size-lg);
    }

    .app-bar-meta {
        display: none;
    }
}

/* Upload progress — tickets[6774]. Shown only while a bundle is still being read; a layout
   we have seen before finishes before it appears. */
.progress-track {
    height: 0.5rem;
    background: var(--color-brand-violet-100);
    border-radius: var(--radius-xxs);
    overflow: hidden;
    margin: var(--spacing-md) 0 var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: var(--color-brand-violet-500);
    border-radius: var(--radius-xxs);
    transition: width 300ms ease;
}

/* The work is genuinely indeterminate between counted steps, so the bar breathes rather than
   pretending to a precision it does not have. */
@media (prefers-reduced-motion: reduce) {
    .progress-fill {
        transition: none;
    }
}
