/* ============================================================
   NORTHSTAR COMMAND — SHARED DESIGN SYSTEM
   Flat / data-dense console. Twelve neutral themes, light to dark: whites,
   silvers, greys, tans, browns and blacks. Colour on the page stays reserved
   for status · alerts · graphs · maps.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ── Visual accounting dashboard (nscc-acct-dashboard.js) ── */
.nscc-dash-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--nscc-gap, 0.4rem); margin: 0 0 var(--nscc-pad-md, 0.5rem); }
.nscc-dash-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; padding: var(--nscc-pad-sm, 0.35rem) var(--nscc-pad-md, 0.5rem); border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 8px; background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--text-primary); transition: transform var(--dur-fast, 70ms) var(--ease-out, ease), box-shadow var(--dur-fast, 70ms); box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000); }
.nscc-dash-kpi:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--nscc-hard-shadow, #000000); }
.nscc-dash-kpi:active { transform: translateY(0); }
.nscc-dash-kpi--warn { border-color: var(--nscc-line, #000000); }
.nscc-dash-kpi--positive .nscc-dash-kpi__value { color: #15803d; }
.nscc-dash-kpi--negative .nscc-dash-kpi__value { color: #b91c1c; }
.nscc-dash-kpi__label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.nscc-dash-kpi__value { font-size: 1.25rem; font-weight: 900; line-height: 1.15; }
.nscc-dash-kpi__sub { font-size: 0.66rem; color: var(--text-muted); }

/* Anchor tiles — carry data-nscc-customize-anchor. Grow across the full row
   and hide-affordance; a small lock in the label calls out "required".
   Matt 2026-09-12: "we wouldnt allow someone to remove a function like
   journal entry. you need journal entry to perform a duty." */
.nscc-dash-kpi[data-nscc-customize-anchor] { grid-column: 1 / -1; cursor: default; }
.nscc-dash-kpi[data-nscc-customize-anchor]:hover { transform: none; box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000); }
.nscc-dash-kpi__label--anchor { display: inline-flex; align-items: center; gap: 0.35rem; }
.nscc-dash-kpi__lock { font-size: 0.75rem; opacity: 0.8; }

/* Actions widget — a row of primary buttons instead of a big number. */
.nscc-dash-kpi--actions { flex-direction: column; gap: 0.4rem; padding: var(--nscc-pad-md, 0.5rem); }
.nscc-dash-actions__row { display: flex; flex-wrap: wrap; gap: 0.4rem; width: 100%; }
.nscc-dash-actions__btn { flex: 0 0 auto; }

/* Ops strip — compact single-row header used on Dispatch views. Sits
   above the row list without pushing content down, collapsible per-user,
   each tile opens a glance modal when it carries data-nscc-glance. */
.nscc-ops-strip {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.35rem 0.5rem; margin: 0 0 0.35rem;
    background: var(--bg-sunken, #f4efe4); border: 2px solid var(--border, var(--nscc-line, #000));
    border-radius: 6px;
}
.nscc-ops-strip__anchor { display: flex; align-items: center; gap: 0.3rem; flex: 0 0 auto; padding-right: 0.5rem; border-right: 1.5px solid var(--border-subtle, rgba(0,0,0,0.15)); }
.nscc-ops-strip__btn {
    font: inherit; font-size: 0.72rem; font-weight: 800; padding: 0.25rem 0.55rem;
    border: 1.5px solid var(--border, var(--nscc-line, #000)); border-radius: 5px; cursor: pointer;
    background: var(--brand, #4a6b52); color: var(--bg-card, #f7f3ea);
    box-shadow: 1px 1px 0 var(--border, #000);
    letter-spacing: 0.01em; white-space: nowrap;
}
.nscc-ops-strip__btn:hover { filter: brightness(1.08); }
.nscc-ops-strip__btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--border, #000); }
.nscc-ops-strip__tiles { display: flex; align-items: center; gap: 0.4rem; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
.nscc-ops-tile {
    display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0.05rem;
    padding: 0.3rem 0.55rem; border: 1.5px solid var(--border, var(--nscc-line, #000)); border-radius: 5px;
    background: var(--bg-card, #f7f3ea); box-shadow: 1px 1px 0 var(--border, #000);
    font: inherit; text-align: left; line-height: 1.1; min-width: 88px;
    color: var(--text-primary, #111);
}
.nscc-ops-tile[data-nscc-glance] { cursor: pointer; }
.nscc-ops-tile[data-nscc-glance]:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--border, #000); }
.nscc-ops-tile__label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, #5c5648); }
.nscc-ops-tile__value { font-size: 0.95rem; font-weight: 800; }
.nscc-ops-tile__sub { font-size: 0.6rem; color: var(--text-muted, #5c5648); }
.nscc-ops-tile--warn { border-color: #b8631a; }
.nscc-ops-tile--warn .nscc-ops-tile__value { color: #b8631a; }

/* Per-tile hide, plus a restore control once anything on this screen is
   hidden. The strip deliberately stays one row — a tile cannot nest a button,
   so the hide sits beside the tile in a wrapper and overlays its corner. */
.nscc-ops-tile-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.nscc-ops-tile__hide {
    position: absolute; top: -5px; right: -5px;
    width: 14px; height: 14px; padding: 0; line-height: 1;
    font: inherit; font-size: 0.6rem; font-weight: 800;
    border: 1.5px solid var(--border, var(--nscc-line, #000)); border-radius: 50%;
    background: var(--bg-card, #f7f3ea); color: var(--text-muted, #5c5648);
    cursor: pointer; opacity: 0; transition: opacity 0.1s ease;
}
.nscc-ops-tile-wrap:hover .nscc-ops-tile__hide,
.nscc-ops-tile__hide:focus { opacity: 1; }
.nscc-ops-tile__hide:hover { color: #b8631a; border-color: #b8631a; }
.nscc-ops-strip__restore {
    font: inherit; font-size: 0.65rem; font-weight: 700;
    padding: 0.2rem 0.45rem; border: 1.5px solid var(--border, var(--nscc-line, #000));
    border-radius: 5px; background: transparent;
    color: var(--text-muted, #5c5648); cursor: pointer; flex: 0 0 auto;
    white-space: nowrap;
}
.nscc-ops-strip__restore:hover { color: var(--text-primary, #111); background: rgba(0, 0, 0, 0.05); }
html body:not(#_) select.nscc-ops-strip__restore { width: auto !important; max-width: 12rem !important; flex: 0 0 auto !important; margin: 0 !important; }
.nscc-ops-strip__reset {
    font: inherit; font-size: 0.65rem; font-weight: 700;
    padding: 0.2rem 0.45rem; border: 1.5px solid transparent;
    border-radius: 5px; background: transparent;
    color: var(--text-muted, #5c5648); cursor: pointer; flex: 0 0 auto; white-space: nowrap;
}
.nscc-ops-strip__reset:hover { color: var(--text-primary, #111); border-color: var(--border, var(--nscc-line, #000)); }
/* ☰ drag handle, shown with the ✕ on hover (the dashboards' widget controls). */
.nscc-ops-tile__handle {
    position: absolute; top: -5px; left: -5px; z-index: 1;
    width: 14px; height: 14px; line-height: 12px; text-align: center;
    font-size: 0.55rem; border: 1.5px solid var(--border, var(--nscc-line, #000)); border-radius: 3px;
    background: var(--bg-card, #f7f3ea); color: var(--text-muted, #5c5648);
    cursor: grab; opacity: 0; transition: opacity 0.1s ease; user-select: none;
}
.nscc-ops-tile-wrap:hover .nscc-ops-tile__handle { opacity: 1; }
.nscc-ops-tile-wrap.is-dragging { opacity: 0.45; }
@media (hover: none) {
    /* No hover on touch — keep the hide reachable. */
    .nscc-ops-tile__hide, .nscc-ops-tile__handle { opacity: 1; }
}
.nscc-ops-strip__toggle {
    margin-left: auto; font: inherit; font-size: 0.7rem; font-weight: 700;
    padding: 0.2rem 0.45rem; border: 1.5px dashed var(--border, var(--nscc-line, #000)); border-radius: 5px;
    background: transparent; color: var(--text-primary, #111); cursor: pointer;
    flex: 0 0 auto;
}
.nscc-ops-strip__toggle:hover { background: rgba(0, 0, 0, 0.05); }
/* Collapsed strip: toggle button pins to the RIGHT, matching where the ▲
   collapse button sits when the strip is expanded (▲ on the right of the
   expanded row, ▼ on the right of the collapsed row). Requested by Matt
   2026-09-16 for consistency across Dispatch / Patrol / Courier / Guards. */
.nscc-ops-strip--collapsed { justify-content: flex-end; padding: 0.15rem 0.5rem; }
.nscc-ops-strip--collapsed .nscc-ops-strip__toggle { border-style: solid; }
@media print { .nscc-ops-strip { display: none !important; } }

/* Mini-list widget — top-N rows, each a click-through button. */
.nscc-dash-kpi--list { align-items: stretch; gap: 0.3rem; padding: var(--nscc-pad-md, 0.5rem); cursor: default; }
.nscc-dash-kpi--list:hover { transform: none; }
.nscc-dash-list__body { display: flex; flex-direction: column; gap: 0.2rem; }
.nscc-dash-list__row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name value" "sub sub";
    row-gap: 0.05rem;
    column-gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--border, #d4d4d8);
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.nscc-dash-list__row:hover { background: var(--bg-hover, rgba(0, 0, 0, 0.04)); }
.nscc-dash-list__name { grid-area: name; font-size: 0.78rem; font-weight: 700; }
.nscc-dash-list__value { grid-area: value; font-size: 0.82rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.nscc-dash-list__sub { grid-area: sub; font-size: 0.65rem; color: var(--text-muted); }
.nscc-dash-list__empty { font-size: 0.75rem; color: var(--text-muted); padding: 0.3rem 0.2rem; }
.nscc-dash-list__footer { margin-top: 0.3rem; display: flex; justify-content: flex-end; }
:root.dark .nscc-dash-list__row,
body.dark-theme .nscc-dash-list__row { border-color: rgba(148, 163, 184, 0.5); }
.nscc-dash-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--nscc-gap, 0.4rem); margin-bottom: var(--nscc-pad-md, 0.5rem); }
.nscc-dash-chart-card { border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 0; padding: var(--nscc-pad-sm, 0.35rem) var(--nscc-pad-md, 0.5rem); background: var(--bg-card); box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000); }
.nscc-dash-chart-card__title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0; }
.nscc-dash-chart-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}
.nscc-dash-chart-card__body { min-width: 0; }
.nscc-dash-chart-card__note { font-size: 0.6rem; color: var(--text-muted); margin-top: 0.2rem; }
.nscc-chart-view-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: 6px;
    background: var(--btn-surface, #d4d4d8);
    color: var(--btn-surface-ink, #0f172a);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
}
.nscc-chart-view-btn:hover,
.nscc-chart-view-btn:focus-visible {
    background: var(--btn-surface-hover, #a1a1aa);
    outline: none;
}
:root.dark .nscc-chart-view-btn,
body.dark-theme .nscc-chart-view-btn {
    background: var(--btn-surface, #0c0c0b);
    color: var(--btn-surface-ink, #f8fafc);
    border-color: var(--nscc-line, #ffffff);
}
.exec-chart-card.nscc-dash-chart-card .nscc-dash-chart-card__title,
.exec-chart-card .nscc-dash-chart-card__title {
    margin: 0;
}
.nscc-dash-chart-svg { width: 100%; height: auto; display: block; shape-rendering: geometricPrecision; }
.nscc-dash-chart-label { font-size: 8px; fill: var(--text-muted, #64748b); font-family: monospace; }
.nscc-dash-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.66rem; color: var(--text-muted); }
.nscc-dash-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.nscc-dash-swatch { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--border); display: inline-block; }
.nscc-dash-aging-bar { display: flex; height: 14px; border: 2px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-sunken); }
.nscc-dash-aging--current { background: #16a34a; }
.nscc-dash-aging--overdue { background: #dc2626; }
.nscc-dash-aging--paid { background: #64748b; }
.nscc-dash-cust-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 0.5rem; margin: 0.2rem 0; font-size: 0.78rem; }
.nscc-dash-cust-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nscc-dash-cust-bar { height: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-sunken); overflow: hidden; }
.nscc-dash-cust-fill { height: 100%; background: var(--brand-light, #3f3f46); border-radius: 8px; }
.nscc-dash-cust-amt { font-weight: 800; font-family: var(--font-mono, monospace); font-size: 0.72rem; }
.nscc-dash-recent-table td.r, .nscc-dash-recent-table th.r { text-align: right; }

/* ── AR line breakdown + toolbar labels (IPS billing) ── */
.nscc-ar-row--has-lines { cursor: pointer; }
.nscc-ar-row--has-lines:hover { background: var(--bg-sunken); }
.nscc-ar-lines-row td { padding: 0 !important; background: var(--bg-raised, #fafafa); }
.nscc-ar-lines-table { margin: 0; border: none; }
.nscc-ar-lines-table thead th { font-size: 0.66rem !important; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: transparent !important; }
.nscc-ar-lines-table tbody td { padding: 0.3rem 0.55rem !important; font-size: 0.74rem !important; }
.nscc-ar-line-meta { display: block; color: var(--text-muted); font-size: 0.7rem; }
.nscc-ar-line-extras { display: block; color: var(--text-muted); font-size: 0.66rem; font-style: italic; }
.nscc-finance-toolbar__label { display: inline-flex; flex-direction: column; gap: 0.15rem; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-finance-toolbar__label input[type="date"] { padding: 0.3rem 0.45rem; border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 6px; font-size: 0.8rem; font-weight: 700; }
.nscc-dash-recent-table tbody td { padding: 0.35rem 0.5rem !important; font-size: 0.78rem !important; }

/* ——— Field Payroll panel: pay-basis badges + per-role hour table ——— */
.nscc-fp-badge { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 8px; border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.4; }
.nscc-fp-badge--hourly { background: var(--info-wash, #f4f4f5); color: var(--info-wash-ink, #27272a); }
.nscc-fp-badge--salary { background: var(--info-wash, #f4f4f5); color: var(--info-wash-ink, #27272a); }
.nscc-fp-badge--trips  { background: transparent; color: #92400e; border: 2px solid #f59e0b; }
.nscc-fp-table tbody td { font-size: 0.82rem !important; }
.nscc-fp-table tbody tr:hover { background: var(--bg-raised, #fafafa); }

/* ——— Colour Tokens (light) — cool neutral gray (no pink / peach / cream washes) ——— */
:root {
    /* Surfaces — cool zinc neutrals */
    --bg-page:          #f4f4f5;
    --bg-card:          #ffffff;
    --bg-raised:        #fafafa;
    --bg-sunken:        #e4e4e7;
    --bg-overlay:       #ffffff;
    --bg-atmosphere:    none;
    --bg-grid:          none;
    /* Muted action fill — darker than info/card boxes so buttons do not look like labels */
    --btn-surface:      #d4d4d8;
    --btn-surface-hover:#a1a1aa;
    --btn-surface-ink:  #18181b;

    /* Text */
    --text-primary:     #18181b;
    --text-secondary:   #3f3f46;
    --text-muted:       #52525b;
    --text-inverse:     #fafafa;
    --text-link:        #27272a;

    /* Brand — charcoal (no purple / blue chrome) */
    --brand:            #18181b;
    --brand-light:      #52525b;
    --brand-accent:     #3f3f46;
    --brand-glow:       rgba(24, 24, 27, 0.14);
    --brand-display:    'IBM Plex Sans', 'Segoe UI', sans-serif;

    /* Office chrome — cool tabs (match muted button surface, darker than info cards).
       --chrome-folder-active-ink is the text color on an active (selected) folder
       tab. Default light theme's active bg is dark (#27272a), so light ink reads.
       Each color theme overrides this in its own block so the active-tab text
       contrasts against that theme's --chrome-folder-active — Matt 2026-09-12:
       "make the font colors theme colors. but if they are highlighted fonts don't
       make them black because black is not a highlight for black. same thing with
       white". */
    --chrome-folder:            var(--btn-surface);
    --chrome-folder-deep:       var(--btn-surface-hover);
    --chrome-folder-ink:        var(--btn-surface-ink);
    --chrome-folder-active:     #27272a;
    --chrome-folder-active-ink: #f7f1e4;
    --chrome-folder-label:      #52525b;
    /* Strip behind folder tabs (under LIVE ticker) — same as left menu rail */
    --chrome-folder-strip-bg:  var(--chrome-folder-panel-bg, var(--bg-page));
    --chrome-folder-panel-bg:  var(--bg-page);
    /* Left-nav / menu selection — cool gray (never pink/peach) */
    --nav-selected-bg:      #e4e4e7;
    --nav-selected-ink:     #18181b;
    --nav-selected-bar:     #27272a;

    /* Top banner (the brand row: logo, NORTHSTAR/BEACON, clock, user chip).
       --banner-bg matches --bg-page so the banner blends with the page background.
       --banner-fg / -muted are solved for >= 4.5:1 on --banner-bg, --banner-chip-bg
       AND --bg-raised (the icon buttons keep riding --bg-raised). Each rung
       declares its own hex copy of --bg-page (not a var()) so the token test's
       distance check can parse it. */
    --banner-bg:            #f4f4f5;
    --banner-fg:            #18181b;
    --banner-muted:         #52525b;
    --banner-chip-bg:       #d1d5db;
    /* Theme identity (every data-nscc-theme block overrides these). The
       defaults reproduce the unthemed look: zinc chrome, near-black accent. */
    --accent:               #18181b;
    --accent-ink:           #ffffff;
    --accent-soft:          #e4e4e7;
    --chrome-bg:            #f4f4f5;
    --chrome-bg-2:          #e4e4e7;
    --chrome-line:          #d4d4d8;
    --chrome-ink:           #18181b;
    --chrome-muted:         #52525b;
    --chrome-accent:        #18181b;
    --chrome-icon-filter:   none;
    /* Folder tabs (and in-body sub-tabs) are TWO text-rows tall — labels wrap to a
       consistent two-line height so tabs read as uniform folder tabs. */
    --nscc-folder-tab-h:    2.55rem;
    --nscc-folder-strip-h:  calc((2 * var(--nscc-folder-tab-h)) + 0.4rem);

    /* Primary action / schedule CTAs — charcoal (frost-* kept for CSS compat) */
    --frost-blue:       #3f3f46;
    --frost-blue-hover: #292524;
    --frost-blue-deep:  #1c1917;
    --frost-blue-glow:  rgba(28, 25, 23, 0.18);

    /* Trip lifecycle — KEEP (status / alerts / maps / charts only)
       UNASSIGNED #FF3B30 · PENDING #FF9500 · EN-ROUTE #5856D6 · PICKUP #FFCC00
       IN TRANSIT #007AFF · DELIVERED #34C759 · ASSIGNED #AF52DE */
    --status-unassigned:    #FF3B30;
    --status-unassigned-bg: #FF3B30;
    --status-assigned:      #AF52DE;
    --status-assigned-bg:   #AF52DE;
    --status-secure:        #34C759;
    --status-secure-bg:     #34C759;
    --status-transit:       #007AFF;
    --status-transit-bg:    #007AFF;
    --status-breach:        #FF3B30;
    --status-breach-bg:     #FF3B30;
    --status-pending:       #FF9500;
    --status-pending-bg:    #FF9500;
    --status-scheduled:     #06b6d4;
    --status-scheduled-bg:  #06b6d4;
    --status-enroute:       #5856D6;
    --status-enroute-bg:    #5856D6;
    --status-pickup:        #FFCC00;
    --status-pickup-bg:     #FFCC00;

    /* Alert banner — muted amber (readable, not purple/blue) */
    --alert-banner-bg:      var(--bg-card, #ffffff);
    --alert-banner-fg:      #78350f;
    --alert-banner-border:  #fcd34d;

    /* Soft info / selection washes — zinc only (no baby / powder / sky blue) */
    --info-wash:            #f4f4f5;
    --info-wash-border:     #a1a1aa;
    --info-wash-ink:        #27272a;
    --select-wash:          rgba(24, 24, 27, 0.08);
    --select-glow:          rgba(24, 24, 27, 0.22);

    /* Table / panel surfaces — cool zinc (no slate/sky blue) */
    --bg-elevated:          #fafafa;
    --table-head-bg:        #e4e4e7;
    --table-row-hover:      #f4f4f5;
    --table-row-selected:   #e5e7eb;
    --table-stripe:         #f4f4f5;

    /* Borders — cool zinc hairlines (no warm stone / peach) */
    --border:           #d4d4d8;
    --border-strong:    #a1a1aa;
    --border-focus:     #3f3f46;

    /* Chart neutrals — six categorical shades of the palette's own zinc scale
       for stacked bars, category-mix charts and legend swatches. Not the
       trip-lifecycle status colors (red/amber/green/blue); metadata reads
       as neutral. Every rung below inherits these unless it redefines them,
       and the .dark block flips them so no shade merges into a dark card. */
    --chart-neutral-1:  #18181b;
    --chart-neutral-2:  #3f3f46;
    --chart-neutral-3:  #52525b;
    --chart-neutral-4:  #71717a;
    --chart-neutral-5:  #a1a1aa;
    --chart-neutral-6:  #d4d4d8;

    /* Elevation — nearly flat */
    --shadow-xs:        none;
    --shadow-sm:        none;
    --shadow-md:        none;
    --shadow-lg:        none;
    --shadow-glow-brand:0 0 0 2px rgba(28, 25, 23, 0.2);
    --shadow-glow-green:0 0 0 2px rgba(52, 199, 89, 0.28);
    --shadow-glow-amber:0 0 0 2px rgba(255, 149, 0, 0.28);

    /* Radius — tight, console-like (no capsule pills; ticker chips use their own radius) */
    --radius-xs:        2px;
    --radius-sm:        3px;
    --radius-md:        4px;
    --radius-lg:        6px;
    --radius-xl:        8px;
    --radius-full:      8px;

    /* Typography — compact sans for density */
    --font-sans:        'IBM Plex Sans', 'Segoe UI', sans-serif;
    --font-mono:        'IBM Plex Mono', 'Cascadia Mono', monospace;

    /* Type scale — 7 steps, minimum 0.7rem (~11.2px) for readability */
    --text-2xs:     0.7rem;     /* ~11.2px — smallest allowed */
    --text-xs:      0.75rem;    /* ~12px — labels, badges, captions */
    --text-sm:      0.8125rem;  /* ~13px — table cells, dense body */
    --text-base:    0.875rem;   /* ~14px — default body */
    --text-md:      1rem;       /* ~16px — emphasized, nav items */
    --text-lg:      1.125rem;   /* ~18px — section headings */
    --text-xl:      1.375rem;   /* ~22px — modal/page titles */

    /* Z-index layers — use these instead of arbitrary numbers */
    --z-base:       1;
    --z-sticky:     10;
    --z-header:     2000;
    --z-dropdown:   3000;
    --z-overlay:    5000;
    --z-modal:      9000;
    --z-toast:      10000;
    --z-tooltip:    11000;
    --z-splash:     50000;

    /* Spacing — tight default rhythm (keep usable hit targets) */
    --space-1:  0.15rem;
    --space-2:  0.3rem;
    --space-3:  0.45rem;
    --space-4:  0.6rem;
    --space-5:  0.8rem;
    --space-6:  1rem;
    --space-8:  1.35rem;
    --space-10: 1.65rem;
    --space-12: 2rem;

    /* Density helpers */
    --dense-row-h:      1.55rem;
    --dense-pad-y:      0.2rem;
    --dense-pad-x:      0.4rem;
    --dense-font:       0.8125rem;
    --dense-font-sm:    0.75rem;

    /* Global layout padding scale */
    --nscc-pad-xs: 0.2rem;
    --nscc-pad-sm: 0.35rem;
    --nscc-pad-md: 0.5rem;
    --nscc-pad-lg: 0.7rem;
    --nscc-gap:    0.4rem;
    --nscc-gap-lg: 0.65rem;

    /* Status / accent outline chips — thick colored border */
    --nscc-status-border-w: 4px;

    /* Docs chrome (library / Support Documentation cards) */
    --docs-ink-border:  #000000;
    --docs-ink-shadow:  #000000;
    --docs-logo-tile:   #ffffff;
    --docs-title:       #18181b;
    --docs-link:        #1d4ed8;
    --docs-code-bg:     #e4e4e7;
    --docs-code-fg:     #18181b;

    /* Transitions */
    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring:  cubic-bezier(0.2, 0.9, 0.3, 1);
    --dur-instant:  0ms;
    --dur-fast:     70ms;
    --dur-base:     120ms;
    --dur-slow:     200ms;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ——— Dark Theme — soft charcoal (12-hour shift friendly) ——— */
:root.dark,
body.dark-theme {
    --bg-page:          #151514;
    --bg-card:          #1d1d1b;
    --bg-raised:        #222220;
    --bg-sunken:        #080808;
    --bg-overlay:       #222220;
    --bg-atmosphere:    none;
    --bg-grid:          none;
    /* Darker than info/card surfaces so muted buttons stay distinct */
    --btn-surface:      #0c0c0b;
    --btn-surface-hover:#050504;
    --btn-surface-ink:  #f5f5f4;

    --text-primary:     #c9c9c7;
    --text-secondary:   #d4d4d8;
    --text-muted:       #a1a1aa;
    --text-inverse:     #141413;
    --text-link:        #e4e4e7;

    /* Chart neutrals invert so none of the six shades merges into --bg-card
       (#1c1c1b). Ordered darkest→lightest for parity with the light rung so
       the same segment index reads the same rank of contrast in both themes. */
    --chart-neutral-1:  #f5f5f4;
    --chart-neutral-2:  #d4d4d8;
    --chart-neutral-3:  #a1a1aa;
    --chart-neutral-4:  #71717a;
    --chart-neutral-5:  #52525b;
    --chart-neutral-6:  #3f3f46;

    --brand:            #0c0c0b;
    --brand-light:      #a1a1aa;
    --brand-accent:     #d4d4d8;
    --brand-glow:       rgba(228, 228, 231, 0.14);

    /* Inactive tabs lighter than page; selected stays mid-zinc (not lightened) */
    --chrome-folder:            #71717a;
    --chrome-folder-deep:       #52525b;
    --chrome-folder-ink:        #fafafa;
    --chrome-folder-active:     #3f3f46;
    --chrome-folder-active-ink: #fafafa;
    --chrome-folder-label:      #a1a1aa;
    --chrome-folder-strip-bg:  var(--chrome-folder-panel-bg, var(--bg-page));
    --chrome-folder-panel-bg:  var(--bg-page);
    --nav-selected-bg:      #3f3f46;
    --nav-selected-ink:     #fafafa;
    --nav-selected-bar:     #a1a1aa;

    /* Top banner — matches --bg-page so the banner blends with the page. */
    --banner-bg:            #151514;
    --banner-fg:            #fafafa;
    --banner-muted:         #d4d4d8;
    --banner-chip-bg:       #2a2a28;

    --frost-blue:       #a1a1aa;
    --frost-blue-hover: #d4d4d8;
    --frost-blue-deep:  #e4e4e7;
    --frost-blue-glow:  rgba(228, 228, 231, 0.16);

    --status-unassigned:    #FF3B30;
    --status-unassigned-bg: #FF3B30;
    --status-assigned:      #AF52DE;
    --status-assigned-bg:   #AF52DE;
    --status-secure:        #34C759;
    --status-secure-bg:     #34C759;
    --status-transit:       #007AFF;
    --status-transit-bg:    #007AFF;
    --status-breach:        #FF3B30;
    --status-breach-bg:     #FF3B30;
    --status-pending:       #FF9500;
    --status-pending-bg:    #FF9500;
    --status-scheduled:     #06b6d4;
    --status-scheduled-bg:  #06b6d4;
    --status-enroute:       #5856D6;
    --status-enroute-bg:    #5856D6;
    --status-pickup:        #FFCC00;
    --status-pickup-bg:     #FFCC00;

    --alert-banner-bg:      #422006;
    --alert-banner-fg:      #fde68a;
    --alert-banner-border:  #a16207;

    --info-wash:            #2b2b26;
    --info-wash-border:     #3f3f36;
    --info-wash-ink:        #e4e4e7;
    --select-wash:          rgba(228, 228, 231, 0.1);
    --select-glow:          rgba(228, 228, 231, 0.22);

    --bg-elevated:          #222220;
    --table-head-bg:        #0d0d0d;
    --table-row-hover:      #1d1d1b;
    --table-row-selected:   #3f3f46;
    --table-stripe:         #1a1a19;

    --border:           #424242;
    --border-strong:    #545454;
    --border-focus:     #a1a1aa;

    --docs-ink-border:  #fafafa;
    --docs-ink-shadow:  #fafafa;
    --docs-logo-tile:   #ffffff;
    --docs-title:       #f5f5f4;
    --docs-link:        #93c5fd;
    --docs-code-bg:     #52525b;
    --docs-code-fg:     #fafafa;

    --shadow-xs:        none;
    --shadow-sm:        none;
    --shadow-md:        none;
    --shadow-lg:        none;
}

/* ============================================================================
   THEME LADDER — 12 neutral themes, light to dark. Rebuilt 2026-09-26.

   Whites, silvers, greys, tans, browns and blacks only: no blue, pink or red
   chrome, and a neutral accent (charcoal, graphite, brown, silver) for the
   primary action, selected-nav bar and focus ring. Every earlier theme is
   retired; assets/nscc-theme-cycle.js migrates a saved one to the closest
   neutral theme.

       #   theme     page     banner   accent   ink
        1  White     #ffffff  #ffffff  #27272a  dark
        2  Silver    #f3f4f6  #e2e4e8  #374151  dark
        3  Linen     #faf7f2  #e6d8c2  #6f5238  dark
        4  Pewter    #e7e8ea  #c9ccd1  #3f4046  dark
        5  Sand      #efe7da  #d6c3a5  #6b4f33  dark
        6  Slate     #f4f4f5  #3f3f46  #3f3f46  dark
        7  Walnut    #f6f1ea  #4a3526  #6b4a2e  dark
        8  Stone     #c8c9cc  #2e2f33  #2e2f33  dark
        9  Mocha     #bcae9e  #3b2c21  #3b2c21  dark
       10  Graphite  #2e3033  #1d1e21  #c9ccd1  light  <- dark family
       11  Espresso  #33251a  #1a130e  #d2ae84  light  <- dark family
       12  Onyx      #0f0f10  #000000  #e4e4e7  light  <- dark family

   GENERATED, NOT HAND-PICKED — scripts/gen-theme-ladder.mjs is the source of
   truth and `--emit` reprints everything below this comment. Each theme pins
   page, card, banner and accent; every other token is solved. Invariants the
   script re-checks:
     - every pair of themes differs by >= 25 Euclidean RGB on banner OR page
     - every ink token clears its floor on every surface it sits on

   The dark-family themes carry .dark / .dark-theme so the dark-mode widget
   rules keep applying; see the selector note in the generator.

   Status colours are NOT part of this. The lifecycle hexes and the chip
   treatment are untouched.
   ============================================================================ */

/* Theme  1 — White: white page, white banner. hue 0 · sat 0% · L 100% · dark ink */
html[data-nscc-theme="white"] {
    --bg-page:                   #ffffff;
    --bg-card:                   #ffffff;
    --bg-raised:                 #fbfbfb;
    --bg-sunken:                 #f2f2f2;
    --bg-overlay:                #ffffff;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #f0f0f0;
    --btn-surface-hover:         #e8e8e8;
    --btn-surface-ink:           #333333;
    --text-primary:              #1f1f1f;
    --text-secondary:            #555555;
    --text-muted:                #717171;
    --text-inverse:              #faf9f9;
    --text-link:                 #6f6f77;
    --brand:                     #343434;
    --brand-light:               #717171;
    --brand-accent:              #27272a;
    --brand-glow:                rgba(39, 39, 42, 0.18);
    --chrome-folder-active:      #ffffff;
    --chrome-folder-active-ink:  #1f1f1f;
    --chrome-folder-label:       #717171;
    --nav-selected-bg:           #efeff0;
    --nav-selected-ink:          #1f1f1f;
    --nav-selected-bar:          #27272a;
    --banner-bg:                 #ffffff;
    --banner-fg:                 #343434;
    --banner-muted:              #6a6a6a;
    --banner-chip-bg:            #f2f2f2;
    --frost-blue:                #27272a;
    --frost-blue-hover:          #27272a;
    --frost-blue-deep:           #27272a;
    --frost-blue-glow:           rgba(39, 39, 42, 0.18);
    --alert-banner-bg:           #fbfbfb;
    --alert-banner-fg:           #9d6627;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #efeff0;
    --info-wash-border:          #e6e6e6;
    --info-wash-ink:             #1f1f1f;
    --select-wash:               rgba(39, 39, 42, 0.12);
    --select-glow:               rgba(39, 39, 42, 0.28);
    --bg-elevated:               #fbfbfb;
    --table-head-bg:             #f7f7f7;
    --table-row-hover:           #fbfbfb;
    --table-row-selected:        #efeff0;
    --table-stripe:              #ffffff;
    --border:                    #e6e6e6;
    --border-strong:             #cccccc;
    --border-focus:              #27272a;
    --docs-ink-border:           #1f1f1f;
    --docs-ink-shadow:           #1f1f1f;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #1f1f1f;
    --docs-link:                 #6f6f77;
    --docs-code-bg:              #f2f2f2;
    --docs-code-fg:              #1f1f1f;
    --accent:                    #27272a;
    --accent-ink:                #ffffff;
    --accent-soft:               #efeff0;
    --chrome-bg:                 #ffffff;
    --chrome-bg-2:               #f2f2f2;
    --chrome-line:               #dedede;
    --chrome-ink:                #343434;
    --chrome-muted:              #6a6a6a;
    --chrome-accent:             #686870;
    --chrome-icon-filter:        brightness(0) opacity(0.72);
}

/* Theme  2 — Silver: pale silver, silver banner. hue 219.99999999999963 · sat 14.285714285714382% · L 95.88235294117646% · dark ink */
html[data-nscc-theme="silver"] {
    --bg-page:                   #f3f4f6;
    --bg-card:                   #ffffff;
    --bg-raised:                 #f8f8f9;
    --bg-sunken:                 #e4e7eb;
    --bg-overlay:                #ffffff;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #e2e4e9;
    --btn-surface-hover:         #d9dce2;
    --btn-surface-ink:           #2c313a;
    --text-primary:              #1a1d23;
    --text-secondary:            #4a5263;
    --text-muted:                #636e84;
    --text-inverse:              #f9fafa;
    --text-link:                 #5d6e89;
    --brand:                     #202228;
    --brand-light:               #636e84;
    --brand-accent:              #374151;
    --brand-glow:                rgba(55, 65, 81, 0.18);
    --chrome-folder-active:      #ffffff;
    --chrome-folder-active-ink:  #1a1d23;
    --chrome-folder-label:       #636e84;
    --nav-selected-bg:           #edeff3;
    --nav-selected-ink:          #1a1d23;
    --nav-selected-bar:          #374151;
    --banner-bg:                 #e2e4e8;
    --banner-fg:                 #202228;
    --banner-muted:              #525967;
    --banner-chip-bg:            #d4d7dd;
    --frost-blue:                #374151;
    --frost-blue-hover:          #374151;
    --frost-blue-deep:           #374151;
    --frost-blue-glow:           rgba(55, 65, 81, 0.18);
    --alert-banner-bg:           #f8f8f9;
    --alert-banner-fg:           #9b6527;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #edeff3;
    --info-wash-border:          #d6d9e0;
    --info-wash-ink:             #1a1d23;
    --select-wash:               rgba(55, 65, 81, 0.12);
    --select-glow:               rgba(55, 65, 81, 0.28);
    --bg-elevated:               #f8f8f9;
    --table-head-bg:             #eaecef;
    --table-row-hover:           #f8f8f9;
    --table-row-selected:        #edeff3;
    --table-stripe:              #f6f7f8;
    --border:                    #d6d9e0;
    --border-strong:             #b9bfca;
    --border-focus:              #374151;
    --docs-ink-border:           #1a1d23;
    --docs-ink-shadow:           #1a1d23;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #1a1d23;
    --docs-link:                 #5d6e89;
    --docs-code-bg:              #e4e7eb;
    --docs-code-fg:              #1a1d23;
    --accent:                    #374151;
    --accent-ink:                #ffffff;
    --accent-soft:               #edeff3;
    --chrome-bg:                 #e2e4e8;
    --chrome-bg-2:               #d4d7dd;
    --chrome-line:               #bdc2cb;
    --chrome-ink:                #202228;
    --chrome-muted:              #525967;
    --chrome-accent:             #4c5a70;
    --chrome-icon-filter:        brightness(0) opacity(0.72);
}

/* Theme  3 — Linen: warm white, linen banner. hue 37.50000000000008 · sat 44.444444444444464% · L 96.4705882352941% · dark ink */
html[data-nscc-theme="linen"] {
    --bg-page:                   #faf7f2;
    --bg-card:                   #fffdf9;
    --bg-raised:                 #fcfaf8;
    --bg-sunken:                 #f3ece0;
    --bg-overlay:                #fffdf9;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #f0e9dd;
    --btn-surface-hover:         #ece2d2;
    --btn-surface-ink:           #423724;
    --text-primary:              #282115;
    --text-secondary:            #635235;
    --text-muted:                #836c46;
    --text-inverse:              #fafaf9;
    --text-link:                 #906a49;
    --brand:                     #1e1a12;
    --brand-light:               #836c46;
    --brand-accent:              #6f5238;
    --brand-glow:                rgba(111, 82, 56, 0.18);
    --chrome-folder-active:      #fffdf9;
    --chrome-folder-active-ink:  #282115;
    --chrome-folder-label:       #836c46;
    --nav-selected-bg:           #f5efeb;
    --nav-selected-ink:          #282115;
    --nav-selected-bar:          #6f5238;
    --banner-bg:                 #e6d8c2;
    --banner-fg:                 #1e1a12;
    --banner-muted:              #5e5341;
    --banner-chip-bg:            #dfccb0;
    --frost-blue:                #6f5238;
    --frost-blue-hover:          #6f5238;
    --frost-blue-deep:           #6f5238;
    --frost-blue-glow:           rgba(111, 82, 56, 0.18);
    --alert-banner-bg:           #fcfaf8;
    --alert-banner-fg:           #9d6627;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #f5efeb;
    --info-wash-border:          #e3ded6;
    --info-wash-ink:             #282115;
    --select-wash:               rgba(111, 82, 56, 0.12);
    --select-glow:               rgba(111, 82, 56, 0.28);
    --bg-elevated:               #fcfaf8;
    --table-head-bg:             #f6f0e7;
    --table-row-hover:           #fcfaf8;
    --table-row-selected:        #f5efeb;
    --table-stripe:              #fbf9f6;
    --border:                    #e3ded6;
    --border-strong:             #cfc6b7;
    --border-focus:              #6f5238;
    --docs-ink-border:           #282115;
    --docs-ink-shadow:           #282115;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #282115;
    --docs-link:                 #906a49;
    --docs-code-bg:              #f3ece0;
    --docs-code-fg:              #282115;
    --accent:                    #6f5238;
    --accent-ink:                #ffffff;
    --accent-soft:               #f5efeb;
    --chrome-bg:                 #e6d8c2;
    --chrome-bg-2:               #dfccb0;
    --chrome-line:               #cab89c;
    --chrome-ink:                #1e1a12;
    --chrome-muted:              #5e5341;
    --chrome-accent:             #694e35;
    --chrome-icon-filter:        brightness(0) opacity(0.72);
}

/* Theme  4 — Pewter: light grey, pewter banner. hue 220 · sat 6.666666666666638% · L 91.17647058823529% · dark ink */
html[data-nscc-theme="pewter"] {
    --bg-page:                   #e7e8ea;
    --bg-card:                   #f6f6f7;
    --bg-raised:                 #ebeced;
    --bg-sunken:                 #d9dbde;
    --bg-overlay:                #f6f6f7;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #d7d8db;
    --btn-surface-hover:         #cfd1d4;
    --btn-surface-ink:           #303236;
    --text-primary:              #1d1e21;
    --text-secondary:            #494c53;
    --text-muted:                #626770;
    --text-inverse:              #f9fafa;
    --text-link:                 #676872;
    --brand:                     #050506;
    --brand-light:               #626770;
    --brand-accent:              #3f4046;
    --brand-glow:                rgba(63, 64, 70, 0.18);
    --chrome-folder-active:      #f6f6f7;
    --chrome-folder-active-ink:  #1d1e21;
    --chrome-folder-label:       #626770;
    --nav-selected-bg:           #efeff1;
    --nav-selected-ink:          #1d1e21;
    --nav-selected-bar:          #3f4046;
    --banner-bg:                 #c9ccd1;
    --banner-fg:                 #050506;
    --banner-muted:              #454951;
    --banner-chip-bg:            #bbbfc5;
    --frost-blue:                #3f4046;
    --frost-blue-hover:          #3f4046;
    --frost-blue-deep:           #3f4046;
    --frost-blue-glow:           rgba(63, 64, 70, 0.18);
    --alert-banner-bg:           #ebeced;
    --alert-banner-fg:           #915e24;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #efeff1;
    --info-wash-border:          #ccced2;
    --info-wash-ink:             #1d1e21;
    --select-wash:               rgba(63, 64, 70, 0.12);
    --select-glow:               rgba(63, 64, 70, 0.28);
    --bg-elevated:               #ebeced;
    --table-head-bg:             #dfe0e3;
    --table-row-hover:           #ebeced;
    --table-row-selected:        #efeff1;
    --table-stripe:              #eaebec;
    --border:                    #ccced2;
    --border-strong:             #b1b4ba;
    --border-focus:              #3f4046;
    --docs-ink-border:           #1d1e21;
    --docs-ink-shadow:           #1d1e21;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #1d1e21;
    --docs-link:                 #676872;
    --docs-code-bg:              #d9dbde;
    --docs-code-fg:              #1d1e21;
    --accent:                    #3f4046;
    --accent-ink:                #ffffff;
    --accent-soft:               #efeff1;
    --chrome-bg:                 #c9ccd1;
    --chrome-bg-2:               #bbbfc5;
    --chrome-line:               #a5aab3;
    --chrome-ink:                #050506;
    --chrome-muted:              #454951;
    --chrome-accent:             #47484f;
    --chrome-icon-filter:        brightness(0) opacity(0.72);
}

/* Theme  5 — Sand: sand, tan banner. hue 37.14285714285716 · sat 39.622641509433976% · L 89.60784313725489% · dark ink */
html[data-nscc-theme="sand"] {
    --bg-page:                   #efe7da;
    --bg-card:                   #faf6ef;
    --bg-raised:                 #f0eae1;
    --bg-sunken:                 #e7dbc8;
    --bg-overlay:                #faf6ef;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #e4d9c6;
    --btn-surface-hover:         #dfd2bc;
    --btn-surface-ink:           #423724;
    --text-primary:              #282115;
    --text-secondary:            #58492f;
    --text-muted:                #796441;
    --text-inverse:              #fafaf9;
    --text-link:                 #85623f;
    --brand:                     #000000;
    --brand-light:               #796441;
    --brand-accent:              #6b4f33;
    --brand-glow:                rgba(107, 79, 51, 0.18);
    --chrome-folder-active:      #faf6ef;
    --chrome-folder-active-ink:  #282115;
    --chrome-folder-label:       #796441;
    --nav-selected-bg:           #f5f0ea;
    --nav-selected-ink:          #282115;
    --nav-selected-bar:          #6b4f33;
    --banner-bg:                 #d6c3a5;
    --banner-fg:                 #000000;
    --banner-muted:              #4e4436;
    --banner-chip-bg:            #ceb793;
    --frost-blue:                #6b4f33;
    --frost-blue-hover:          #6b4f33;
    --frost-blue-deep:           #6b4f33;
    --frost-blue-glow:           rgba(107, 79, 51, 0.18);
    --alert-banner-bg:           #f0eae1;
    --alert-banner-fg:           #8f5d24;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #f5f0ea;
    --info-wash-border:          #d5cdc1;
    --info-wash-ink:             #282115;
    --select-wash:               rgba(107, 79, 51, 0.12);
    --select-glow:               rgba(107, 79, 51, 0.28);
    --bg-elevated:               #f0eae1;
    --table-head-bg:             #eae0cf;
    --table-row-hover:           #f0eae1;
    --table-row-selected:        #f5f0ea;
    --table-stripe:              #f1e9de;
    --border:                    #d5cdc1;
    --border-strong:             #c1b5a2;
    --border-focus:              #6b4f33;
    --docs-ink-border:           #282115;
    --docs-ink-shadow:           #282115;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #282115;
    --docs-link:                 #85623f;
    --docs-code-bg:              #e7dbc8;
    --docs-code-fg:              #282115;
    --accent:                    #6b4f33;
    --accent-ink:                #ffffff;
    --accent-soft:               #f5f0ea;
    --chrome-bg:                 #d6c3a5;
    --chrome-bg-2:               #ceb793;
    --chrome-line:               #baa37f;
    --chrome-ink:                #000000;
    --chrome-muted:              #4e4436;
    --chrome-accent:             #5a422b;
    --chrome-icon-filter:        brightness(0) opacity(0.72);
}

/* Theme  6 — Slate: near-white, dark grey banner. hue 240 · sat 4.761904761904756% · L 95.88235294117648% · dark ink */
html[data-nscc-theme="slate"] {
    --bg-page:                   #f4f4f5;
    --bg-card:                   #ffffff;
    --bg-raised:                 #f8f8f9;
    --bg-sunken:                 #e7e7e9;
    --bg-overlay:                #ffffff;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #e4e4e6;
    --btn-surface-hover:         #dcdcdf;
    --btn-surface-ink:           #313135;
    --text-primary:              #1d1d20;
    --text-secondary:            #52525b;
    --text-muted:                #6d6d78;
    --text-inverse:              #f9f9fa;
    --text-link:                 #6d6d79;
    --brand:                     #3f3f46;
    --brand-light:               #6d6d78;
    --brand-accent:              #3f3f46;
    --brand-glow:                rgba(63, 63, 70, 0.18);
    --chrome-folder-active:      #ffffff;
    --chrome-folder-active-ink:  #1d1d20;
    --chrome-folder-label:       #6d6d78;
    --nav-selected-bg:           #efeff1;
    --nav-selected-ink:          #1d1d20;
    --nav-selected-bar:          #3f3f46;
    --banner-bg:                 #3f3f46;
    --banner-fg:                 #ffffff;
    --banner-muted:              #b0b0b8;
    --banner-chip-bg:            #313136;
    --frost-blue:                #3f3f46;
    --frost-blue-hover:          #3f3f46;
    --frost-blue-deep:           #3f3f46;
    --frost-blue-glow:           rgba(63, 63, 70, 0.18);
    --alert-banner-bg:           #f8f8f9;
    --alert-banner-fg:           #9b6527;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #efeff1;
    --info-wash-border:          #d9d9dd;
    --info-wash-ink:             #1d1d20;
    --select-wash:               rgba(63, 63, 70, 0.12);
    --select-glow:               rgba(63, 63, 70, 0.28);
    --bg-elevated:               #f8f8f9;
    --table-head-bg:             #ececee;
    --table-row-hover:           #f8f8f9;
    --table-row-selected:        #efeff1;
    --table-stripe:              #f7f7f7;
    --border:                    #d9d9dd;
    --border-strong:             #bfbfc4;
    --border-focus:              #3f3f46;
    --docs-ink-border:           #1d1d20;
    --docs-ink-shadow:           #1d1d20;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #1d1d20;
    --docs-link:                 #6d6d79;
    --docs-code-bg:              #e7e7e9;
    --docs-code-fg:              #1d1d20;
    --accent:                    #3f3f46;
    --accent-ink:                #ffffff;
    --accent-soft:               #efeff1;
    --chrome-bg:                 #3f3f46;
    --chrome-bg-2:               #313136;
    --chrome-line:               #222226;
    --chrome-ink:                #ffffff;
    --chrome-muted:              #b0b0b8;
    --chrome-accent:             #b0b0b8;
    --chrome-icon-filter:        brightness(0) invert(0.93);
}

/* Theme  7 — Walnut: warm white, walnut banner. hue 34.99999999999998 · sat 40.00000000000007% · L 94.11764705882352% · dark ink */
html[data-nscc-theme="walnut"] {
    --bg-page:                   #f6f1ea;
    --bg-card:                   #fffcf8;
    --bg-raised:                 #f8f4f0;
    --bg-sunken:                 #eee5d8;
    --bg-overlay:                #fffcf8;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #ece3d6;
    --btn-surface-hover:         #e7dbcb;
    --btn-surface-ink:           #423624;
    --text-primary:              #282015;
    --text-secondary:            #614e34;
    --text-muted:                #826946;
    --text-inverse:              #fafaf9;
    --text-link:                 #92653f;
    --brand:                     #4a3526;
    --brand-light:               #826946;
    --brand-accent:              #6b4a2e;
    --brand-glow:                rgba(107, 74, 46, 0.18);
    --chrome-folder-active:      #fffcf8;
    --chrome-folder-active-ink:  #282015;
    --chrome-folder-label:       #826946;
    --nav-selected-bg:           #f6efea;
    --nav-selected-ink:          #282015;
    --nav-selected-bar:          #6b4a2e;
    --banner-bg:                 #4a3526;
    --banner-fg:                 #ffffff;
    --banner-muted:              #cfbfb4;
    --banner-chip-bg:            #624632;
    --frost-blue:                #6b4a2e;
    --frost-blue-hover:          #6b4a2e;
    --frost-blue-deep:           #6b4a2e;
    --frost-blue-glow:           rgba(107, 74, 46, 0.18);
    --alert-banner-bg:           #f8f4f0;
    --alert-banner-fg:           #996326;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #f6efea;
    --info-wash-border:          #dfd8ce;
    --info-wash-ink:             #282015;
    --select-wash:               rgba(107, 74, 46, 0.12);
    --select-glow:               rgba(107, 74, 46, 0.28);
    --bg-elevated:               #f8f4f0;
    --table-head-bg:             #f1eadf;
    --table-row-hover:           #f8f4f0;
    --table-row-selected:        #f6efea;
    --table-stripe:              #f8f3ee;
    --border:                    #dfd8ce;
    --border-strong:             #cabfb0;
    --border-focus:              #6b4a2e;
    --docs-ink-border:           #282015;
    --docs-ink-shadow:           #282015;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #282015;
    --docs-link:                 #92653f;
    --docs-code-bg:              #eee5d8;
    --docs-code-fg:              #282015;
    --accent:                    #6b4a2e;
    --accent-ink:                #ffffff;
    --accent-soft:               #f6efea;
    --chrome-bg:                 #4a3526;
    --chrome-bg-2:               #624632;
    --chrome-line:               #79573e;
    --chrome-ink:                #ffffff;
    --chrome-muted:              #cfbfb4;
    --chrome-accent:             #d9bda6;
    --chrome-icon-filter:        brightness(0) invert(0.93);
}

/* Theme  8 — Stone: light grey, charcoal banner. hue 225 · sat 6.06060606060604% · L 87.05882352941177% · dark ink */
html[data-nscc-theme="stone"] {
    --bg-page:                   #dcdde0;
    --bg-card:                   #eaebed;
    --bg-raised:                 #e0e1e3;
    --bg-sunken:                 #ced0d4;
    --bg-overlay:                #eaebed;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #cccdd1;
    --btn-surface-hover:         #c4c6ca;
    --btn-surface-ink:           #303136;
    --text-primary:              #1d1e20;
    --text-secondary:            #43454c;
    --text-muted:                #5c5f68;
    --text-inverse:              #f9fafa;
    --text-link:                 #60626a;
    --brand:                     #2e2f33;
    --brand-light:               #5c5f68;
    --brand-accent:              #2e2f33;
    --brand-glow:                rgba(46, 47, 51, 0.18);
    --chrome-folder-active:      #eaebed;
    --chrome-folder-active-ink:  #1d1e20;
    --chrome-folder-label:       #5c5f68;
    --nav-selected-bg:           #efeff0;
    --nav-selected-ink:          #1d1e20;
    --nav-selected-bar:          #2e2f33;
    --banner-bg:                 #2e2f33;
    --banner-fg:                 #ffffff;
    --banner-muted:              #b0b2b8;
    --banner-chip-bg:            #3f4046;
    --frost-blue:                #2e2f33;
    --frost-blue-hover:          #2e2f33;
    --frost-blue-deep:           #2e2f33;
    --frost-blue-glow:           rgba(46, 47, 51, 0.18);
    --alert-banner-bg:           #e0e1e3;
    --alert-banner-fg:           #875822;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #efeff0;
    --info-wash-border:          #c1c3c8;
    --info-wash-ink:             #1d1e20;
    --select-wash:               rgba(46, 47, 51, 0.12);
    --select-glow:               rgba(46, 47, 51, 0.28);
    --bg-elevated:               #e0e1e3;
    --table-head-bg:             #d4d5d9;
    --table-row-hover:           #e0e1e3;
    --table-row-selected:        #efeff0;
    --table-stripe:              #dfe0e2;
    --border:                    #c1c3c8;
    --border-strong:             #a6a8b0;
    --border-focus:              #2e2f33;
    --docs-ink-border:           #1d1e20;
    --docs-ink-shadow:           #1d1e20;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #1d1e20;
    --docs-link:                 #60626a;
    --docs-code-bg:              #ced0d4;
    --docs-code-fg:              #1d1e20;
    --accent:                    #2e2f33;
    --accent-ink:                #ffffff;
    --accent-soft:               #efeff0;
    --chrome-bg:                 #2e2f33;
    --chrome-bg-2:               #3f4046;
    --chrome-line:               #505259;
    --chrome-ink:                #ffffff;
    --chrome-muted:              #b0b2b8;
    --chrome-accent:             #b0b1b8;
    --chrome-icon-filter:        brightness(0) invert(0.93);
}

/* Theme  9 — Mocha: light tan, dark brown banner. hue 33.59999999999996 · sat 23.364485981308416% · L 79.01960784313727% · dark ink */
html[data-nscc-theme="mocha"] {
    --bg-page:                   #d6cbbd;
    --bg-card:                   #e5ddd2;
    --bg-raised:                 #d7cfc3;
    --bg-sunken:                 #ccbfad;
    --bg-overlay:                #e5ddd2;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #c9bcac;
    --btn-surface-hover:         #c3b4a2;
    --btn-surface-ink:           #31291e;
    --text-primary:              #261f17;
    --text-secondary:            #44382a;
    --text-muted:                #63533e;
    --text-inverse:              #fafaf9;
    --text-link:                 #6e523d;
    --brand:                     #3b2c21;
    --brand-light:               #63533e;
    --brand-accent:              #3b2c21;
    --brand-glow:                rgba(59, 44, 33, 0.18);
    --chrome-folder-active:      #e5ddd2;
    --chrome-folder-active-ink:  #261f17;
    --chrome-folder-label:       #63533e;
    --nav-selected-bg:           #f4efeb;
    --nav-selected-ink:          #261f17;
    --nav-selected-bar:          #3b2c21;
    --banner-bg:                 #3b2c21;
    --banner-fg:                 #ffffff;
    --banner-muted:              #c2afa0;
    --banner-chip-bg:            #523d2e;
    --frost-blue:                #3b2c21;
    --frost-blue-hover:          #3b2c21;
    --frost-blue-deep:           #3b2c21;
    --frost-blue-glow:           rgba(59, 44, 33, 0.18);
    --alert-banner-bg:           #d7cfc3;
    --alert-banner-fg:           #784e1e;
    --alert-banner-border:       #da8a2f;
    --info-wash:                 #f4efeb;
    --info-wash-border:          #c0b2a0;
    --info-wash-ink:             #261f17;
    --select-wash:               rgba(59, 44, 33, 0.12);
    --select-glow:               rgba(59, 44, 33, 0.28);
    --bg-elevated:               #d7cfc3;
    --table-head-bg:             #d0c4b4;
    --table-row-hover:           #d7cfc3;
    --table-row-selected:        #f4efeb;
    --table-stripe:              #d8cdc0;
    --border:                    #c0b2a0;
    --border-strong:             #ab9982;
    --border-focus:              #3b2c21;
    --docs-ink-border:           #261f17;
    --docs-ink-shadow:           #261f17;
    --docs-logo-tile:            #ffffff;
    --docs-title:                #261f17;
    --docs-link:                 #6e523d;
    --docs-code-bg:              #ccbfad;
    --docs-code-fg:              #261f17;
    --accent:                    #3b2c21;
    --accent-ink:                #ffffff;
    --accent-soft:               #f4efeb;
    --chrome-bg:                 #3b2c21;
    --chrome-bg-2:               #523d2e;
    --chrome-line:               #694e3b;
    --chrome-ink:                #ffffff;
    --chrome-muted:              #c2afa0;
    --chrome-accent:             #c7ae9b;
    --chrome-icon-filter:        brightness(0) invert(0.93);
}

/* Theme 10 — Graphite: dark grey, silver accent. hue 216 · sat 5.154639175257736% · L 19.019607843137255% · light ink · DARK FAMILY (also carries .dark) */
html.dark[data-nscc-theme="graphite"],
html[data-nscc-theme="graphite"],
html[data-nscc-theme="graphite"] body.dark-theme {
    --bg-page:                   #2e3033;
    --bg-card:                   #383a3e;
    --bg-raised:                 #414347;
    --bg-sunken:                 #27282b;
    --bg-overlay:                #383a3e;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #44474b;
    --btn-surface-hover:         #4f5257;
    --btn-surface-ink:           #f2f2f3;
    --text-primary:              #f4f5f5;
    --text-secondary:            #d8dadc;
    --text-muted:                #afb2b6;
    --text-inverse:              #101418;
    --text-link:                 #aeb2ba;
    --brand:                     #1d1e21;
    --brand-light:               #afb2b6;
    --brand-accent:              #c9ccd1;
    --brand-glow:                rgba(201, 204, 209, 0.18);
    --chrome-folder-active:      #383a3e;
    --chrome-folder-active-ink:  #f4f5f5;
    --chrome-folder-label:       #afb2b6;
    --nav-selected-bg:           #3d4148;
    --nav-selected-ink:          #f4f5f5;
    --nav-selected-bar:          #c9ccd1;
    --banner-bg:                 #1d1e21;
    --banner-fg:                 #e9eaec;
    --banner-muted:              #989ba5;
    --banner-chip-bg:            #2e2f34;
    --frost-blue:                #c9ccd1;
    --frost-blue-hover:          #c9ccd1;
    --frost-blue-deep:           #c9ccd1;
    --frost-blue-glow:           rgba(201, 204, 209, 0.18);
    --alert-banner-bg:           #414347;
    --alert-banner-fg:           #dba86e;
    --alert-banner-border:       #dd923c;
    --info-wash:                 #3d4148;
    --info-wash-border:          #4b4e53;
    --info-wash-ink:             #f4f5f5;
    --select-wash:               rgba(201, 204, 209, 0.12);
    --select-glow:               rgba(201, 204, 209, 0.28);
    --bg-elevated:               #414347;
    --table-head-bg:             #3f4246;
    --table-row-hover:           #414347;
    --table-row-selected:        #3d4148;
    --table-stripe:              #333538;
    --border:                    #4b4e53;
    --border-strong:             #63686e;
    --border-focus:              #c9ccd1;
    --docs-ink-border:           #f4f5f5;
    --docs-ink-shadow:           #f4f5f5;
    --docs-logo-tile:            #414347;
    --docs-title:                #f4f5f5;
    --docs-link:                 #aeb2ba;
    --docs-code-bg:              #27282b;
    --docs-code-fg:              #f4f5f5;
    --accent:                    #c9ccd1;
    --accent-ink:                #131416;
    --accent-soft:               #3d4148;
    --chrome-bg:                 #1d1e21;
    --chrome-bg-2:               #2e2f34;
    --chrome-line:               #3e4147;
    --chrome-ink:                #e9eaec;
    --chrome-muted:              #989ba5;
    --chrome-accent:             #969ca6;
    --chrome-icon-filter:        brightness(0) invert(0.93);
}

/* Theme 11 — Espresso: dark brown, tan accent. hue 26.400000000000002 · sat 32.467532467532465% · L 15.098039215686276% · light ink · DARK FAMILY (also carries .dark) */
html.dark[data-nscc-theme="espresso"],
html[data-nscc-theme="espresso"],
html[data-nscc-theme="espresso"] body.dark-theme {
    --bg-page:                   #33251a;
    --bg-card:                   #3d2e22;
    --bg-raised:                 #4a382a;
    --bg-sunken:                 #291e15;
    --bg-overlay:                #3d2e22;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #4f3b2b;
    --btn-surface-hover:         #5e4634;
    --btn-surface-ink:           #ede5de;
    --text-primary:              #f4efeb;
    --text-secondary:            #dcccbf;
    --text-muted:                #c0a18a;
    --text-inverse:              #181410;
    --text-link:                 #caa06f;
    --brand:                     #1a130e;
    --brand-light:               #c0a18a;
    --brand-accent:              #d2ae84;
    --brand-glow:                rgba(210, 174, 132, 0.18);
    --chrome-folder-active:      #3d2e22;
    --chrome-folder-active-ink:  #f4efeb;
    --chrome-folder-label:       #c0a18a;
    --nav-selected-bg:           #493a27;
    --nav-selected-ink:          #f4efeb;
    --nav-selected-bar:          #d2ae84;
    --banner-bg:                 #1a130e;
    --banner-fg:                 #e5dbd4;
    --banner-muted:              #a98d79;
    --banner-chip-bg:            #31241a;
    --frost-blue:                #d2ae84;
    --frost-blue-hover:          #d2ae84;
    --frost-blue-deep:           #d2ae84;
    --frost-blue-glow:           rgba(210, 174, 132, 0.18);
    --alert-banner-bg:           #4a382a;
    --alert-banner-fg:           #d69d5c;
    --alert-banner-border:       #dd923c;
    --info-wash:                 #493a27;
    --info-wash-border:          #534337;
    --info-wash-ink:             #f4efeb;
    --select-wash:               rgba(210, 174, 132, 0.12);
    --select-glow:               rgba(210, 174, 132, 0.28);
    --bg-elevated:               #4a382a;
    --table-head-bg:             #4b3626;
    --table-row-hover:           #4a382a;
    --table-row-selected:        #493a27;
    --table-stripe:              #3a2a1d;
    --border:                    #534337;
    --border-strong:             #725c4c;
    --border-focus:              #d2ae84;
    --docs-ink-border:           #f4efeb;
    --docs-ink-shadow:           #f4efeb;
    --docs-logo-tile:            #4a382a;
    --docs-title:                #f4efeb;
    --docs-link:                 #caa06f;
    --docs-code-bg:              #291e15;
    --docs-code-fg:              #f4efeb;
    --accent:                    #d2ae84;
    --accent-ink:                #181510;
    --accent-soft:               #493a27;
    --chrome-bg:                 #1a130e;
    --chrome-bg-2:               #31241a;
    --chrome-line:               #483527;
    --chrome-ink:                #e5dbd4;
    --chrome-muted:              #a98d79;
    --chrome-accent:             #c29057;
    --chrome-icon-filter:        brightness(0) invert(0.93);
}

/* Theme 12 — Onyx: near-black, silver accent. hue 240 · sat 3.225806451612903% · L 6.078431372549019% · light ink · DARK FAMILY (also carries .dark) */
html.dark[data-nscc-theme="onyx"],
html[data-nscc-theme="onyx"],
html[data-nscc-theme="onyx"] body.dark-theme {
    --bg-page:                   #0f0f10;
    --bg-card:                   #1a1a1c;
    --bg-raised:                 #222224;
    --bg-sunken:                 #080808;
    --bg-overlay:                #1a1a1c;
    --bg-atmosphere:             none;
    --bg-grid:                   none;
    --btn-surface:               #252528;
    --btn-surface-hover:         #303033;
    --btn-surface-ink:           #dfdfe1;
    --text-primary:              #efeff0;
    --text-secondary:            #acacb1;
    --text-muted:                #8a8a91;
    --text-inverse:              #101018;
    --text-link:                 #93939f;
    --brand:                     #000000;
    --brand-light:               #8a8a91;
    --brand-accent:              #e4e4e7;
    --brand-glow:                rgba(228, 228, 231, 0.18);
    --chrome-folder-active:      #1a1a1c;
    --chrome-folder-active-ink:  #efeff0;
    --chrome-folder-label:       #8a8a91;
    --nav-selected-bg:           #1f1f23;
    --nav-selected-ink:          #efeff0;
    --nav-selected-bar:          #e4e4e7;
    --banner-bg:                 #000000;
    --banner-fg:                 #d9d9d9;
    --banner-muted:              #818181;
    --banner-chip-bg:            #121212;
    --frost-blue:                #e4e4e7;
    --frost-blue-hover:          #e4e4e7;
    --frost-blue-deep:           #e4e4e7;
    --frost-blue-glow:           rgba(228, 228, 231, 0.18);
    --alert-banner-bg:           #222224;
    --alert-banner-fg:           #d69d5c;
    --alert-banner-border:       #dd923c;
    --info-wash:                 #1f1f23;
    --info-wash-border:          #2d2d30;
    --info-wash-ink:             #efeff0;
    --select-wash:               rgba(228, 228, 231, 0.12);
    --select-glow:               rgba(228, 228, 231, 0.28);
    --bg-elevated:               #222224;
    --table-head-bg:             #202022;
    --table-row-hover:           #222224;
    --table-row-selected:        #1f1f23;
    --table-stripe:              #141415;
    --border:                    #2d2d30;
    --border-strong:             #45454a;
    --border-focus:              #e4e4e7;
    --docs-ink-border:           #efeff0;
    --docs-ink-shadow:           #efeff0;
    --docs-logo-tile:            #222224;
    --docs-title:                #efeff0;
    --docs-link:                 #93939f;
    --docs-code-bg:              #080808;
    --docs-code-fg:              #efeff0;
    --accent:                    #e4e4e7;
    --accent-ink:                #131316;
    --accent-soft:               #1f1f23;
    --chrome-bg:                 #000000;
    --chrome-bg-2:               #121212;
    --chrome-line:               #242424;
    --chrome-ink:                #d9d9d9;
    --chrome-muted:              #818181;
    --chrome-accent:             #868693;
    --chrome-icon-filter:        brightness(0) invert(0.93);
}

/* ============================================================
   BASE RESETS & BODY
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--text-primary);
    background-color: var(--bg-page);
    background-image: none;
    background-attachment: scroll;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--dur-slow) var(--ease-out),
                color var(--dur-slow) var(--ease-out);
}

/* ============================================================
   BUTTON SYSTEM  (unified across all apps)
   ============================================================ */

/* Base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.32rem 0.7rem;
    border: 2.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    transition:
        background-color var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out),
        opacity var(--dur-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255,255,255,0);
    transition: background var(--dur-fast) var(--ease-out);
}

.btn:hover::after  { background: rgba(255,255,255,0.06); }
.btn:active        { transform: translateY(1px); }
.btn:active::after { background: rgba(0,0,0,0.05); }

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow-brand);
}

/* Primary — muted fill (darker than info/card boxes) */
.btn-primary {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border: var(--nscc-line-w, 2.5px) solid var(--nscc-line, #000000);
    box-shadow: none;
}
.btn-primary:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
    border-color: var(--nscc-line, #000000);
    box-shadow: none;
    transform: translateY(-1px);
}

/* Frost / schedule — outlined accent */
.btn-frost,
.btn-submit-schedule {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: 2.5px solid var(--frost-blue-deep, #1c1917) !important;
    box-shadow: none !important;
}
.btn-frost:hover:not(:disabled):not([aria-disabled="true"]),
.btn-submit-schedule:hover:not(:disabled):not([aria-disabled="true"]) {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--frost-blue-deep, #1c1917) !important;
    box-shadow: none !important;
    transform: translateY(-1px);
}
.btn-frost:disabled,
.btn-frost[aria-disabled="true"],
.btn-submit-schedule:disabled,
.btn-submit-schedule[aria-disabled="true"] {
    opacity: 0.55;
    transform: none;
    box-shadow: none !important;
}

/* Secondary — muted fill */
.btn-secondary {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border: var(--nscc-line-w, 2.5px) solid var(--nscc-line, #000000);
    box-shadow: none;
}
.btn-secondary:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
    border-color: var(--nscc-line, #000000);
    box-shadow: none;
    transform: translateY(-1px);
}

/* Ghost — same muted fill as other gray/black actions */
.btn-ghost {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border: var(--nscc-line-w, 2.5px) solid var(--nscc-line, #000000);
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
    border-color: var(--nscc-line, #000000);
}
:root.dark .btn-ghost,
body.dark-theme .btn-ghost {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border-color: var(--nscc-line, #ffffff);
}
:root.dark .btn-ghost:hover,
body.dark-theme .btn-ghost:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
}

/* Success — outlined green */
.btn-success {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: var(--nscc-status-border-w, 4px) solid var(--status-secure, #16a34a) !important;
    box-shadow: none !important;
}
:root.dark .btn-success,
body.dark-theme .btn-success {
    color: #ffffff !important;
    border-color: var(--status-secure, #22c55e) !important;
}
.btn-success:hover {
    background: transparent !important;
    background-color: transparent !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Warning — outlined amber */
.btn-warning {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: var(--nscc-status-border-w, 4px) solid var(--status-pending, #d97706) !important;
    box-shadow: none !important;
}
:root.dark .btn-warning,
body.dark-theme .btn-warning {
    color: #ffffff !important;
    border-color: #fbbf24 !important;
}
.btn-warning:hover {
    background: transparent !important;
    background-color: transparent !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Danger — outlined red */
.btn-danger {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: var(--nscc-status-border-w, 4px) solid var(--status-breach, #dc2626) !important;
    box-shadow: none !important;
}
:root.dark .btn-danger,
body.dark-theme .btn-danger {
    color: #ffffff !important;
    border-color: #f87171 !important;
}
.btn-danger:hover {
    background: transparent !important;
    background-color: transparent !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Outline variant — muted gray fill like other black/gray actions */
.btn-outline-primary {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border: var(--nscc-line-w, 2.5px) solid var(--nscc-line, #000000);
    box-shadow: none;
}
.btn-outline-primary:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
    border-color: var(--nscc-line, #000000);
}

/* Sizes */
.btn-xs   { padding: 0.3rem 0.75rem; font-size: 0.75rem; }
.btn-sm   { padding: 0.4rem 1rem;    font-size: 0.8125rem; }
.btn-lg   { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-xl   { padding: 1rem 2rem;      font-size: 1.125rem; letter-spacing: 0.02em; }
.btn-block { width: 100%; }

/* Disabled */
.btn:disabled, .btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* Icon-only circular */
.btn-icon {
    padding: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
}
.btn-icon.btn-sm { width: 1.875rem; height: 1.875rem; font-size: 0.875rem; }
.btn-icon.btn-lg { width: 2.75rem;  height: 2.75rem;  font-size: 1.25rem; }

/* ============================================================
   BADGE / STATUS CHIPS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.2em 0.65em;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    background: transparent;
    color: var(--text-primary);
    border: 4px solid #64748b;
    box-shadow: none;
}

.badge-unassigned { background: transparent; color: var(--text-primary); border: 4px solid #FF3B30; }
.badge-assigned   { background: transparent; color: var(--text-primary); border: 4px solid #AF52DE; }
.badge-secure     { background: transparent; color: var(--text-primary); border: 4px solid #34C759; }
.badge-transit    { background: transparent; color: var(--text-primary); border: 4px solid #007AFF; }
.badge-breach     { background: transparent; color: var(--text-primary); border: 4px solid #FF3B30; }
.badge-pending    { background: transparent; color: var(--text-primary); border: 4px solid #FF9500; }
.badge-scheduled  { background: transparent; color: var(--text-primary); border: 4px solid #06b6d4; }
.badge-pickup     { background: transparent; color: var(--text-primary); border: 4px solid #FFCC00; }
.badge-neutral    { background: transparent; color: var(--text-primary); border: 4px solid #64748b; }
.badge-primary    { background: transparent; color: var(--text-primary); border: 4px solid var(--brand-light, #0d9488); }

/* Legacy aliases for backward compat */
.badge.green  { background: transparent; color: var(--text-primary); border: 4px solid #34C759; }
.badge.amber  { background: transparent; color: var(--text-primary); border: 4px solid #FF9500; }

/* Dark mode: outline chips keep light ink (not white-on-fill) */
:root.dark .badge, body.dark-theme .badge,
:root.dark [class*="badge-"], body.dark-theme [class*="badge-"] {
    color: #fafaf9 !important;
    background: transparent !important;
}

/* ============================================================
   CARD BASE
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition:
        box-shadow var(--dur-base) var(--ease-out),
        transform  var(--dur-base) var(--ease-out),
        border-color var(--dur-base) var(--ease-out);
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.card-interactive {
    cursor: pointer;
}
.card-interactive:hover { transform: translateY(-2px); }
.card-interactive:active { transform: translateY(0); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
input[type="search"] {
    display: block;
    width: 100%;
    padding: 0.55rem 0.875rem;
    background: var(--bg-card);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--dur-fast);
}
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea {
    display: block;
    width: 100%;
    padding: 0.55rem 0.875rem;
    background: var(--bg-card);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--dur-fast);
}
.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow-brand);
}
input[type="search"]:focus {
    outline: none;
    border-color: var(--nscc-line, #000000);
    box-shadow: var(--shadow-sm);
}
.input:hover:not(:disabled):not(:focus),
input[type="text"]:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus) {
    background: var(--bg-sunken);
}
input[type="search"]:hover:not(:disabled):not(:focus) {
    background: var(--bg-sunken);
    border-color: var(--nscc-line, #000000);
}
.input::placeholder { color: var(--text-muted); }

/* ============================================================
   DROPDOWN / SELECT SYSTEM
   ============================================================ */
:root {
    --nscc-select-height: 32px;
    --nscc-select-padding-x: 0.4rem;
    --nscc-select-padding-y: 0.2rem;
    --nscc-select-font-size: 0.8125rem;
    --nscc-select-radius: var(--radius-sm);
    --nscc-select-chevron-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6573' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --nscc-select-chevron-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b0bc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --nscc-select-chevron: var(--nscc-select-chevron-light);
}

:root.dark,
body.dark-theme {
    --nscc-select-chevron: var(--nscc-select-chevron-dark);
}

select,
.nscc-select,
.form-select,
.nscc-form-select,
.nscc-support-select,
.select-control,
.form-control-panel,
.filter-select {
    display: block;
    width: 100%;
    min-height: var(--nscc-select-height);
    height: auto;
    padding: var(--nscc-select-padding-y) calc(var(--nscc-select-padding-x) + 1.1rem) var(--nscc-select-padding-y) var(--nscc-select-padding-x);
    background-color: var(--bg-card);
    background-image: var(--nscc-select-chevron);
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 0.75rem;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: var(--nscc-select-radius);
    box-shadow: none;
    font-family: var(--font-sans);
    font-size: var(--nscc-select-font-size);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    color-scheme: light;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    transition: background-color 60ms linear;
}

:root.dark select,
:root.dark .nscc-select,
:root.dark .form-select,
:root.dark .nscc-form-select,
:root.dark .nscc-support-select,
:root.dark .select-control,
:root.dark .form-control-panel,
:root.dark .filter-select,
body.dark-theme select,
body.dark-theme .nscc-select,
body.dark-theme .form-select,
body.dark-theme .nscc-form-select,
body.dark-theme .nscc-support-select,
body.dark-theme .select-control,
body.dark-theme .form-control-panel,
body.dark-theme .filter-select {
    border-color: var(--nscc-line, #ffffff);
    color-scheme: dark;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

select:active,
select:focus,
.nscc-select:active,
.nscc-select:focus,
.form-select:active,
.form-select:focus,
.filter-select:active,
.filter-select:focus {
    transform: none;
}

select:hover:not(:disabled),
.nscc-select:hover:not(:disabled),
.form-select:hover:not(:disabled),
.nscc-form-select:hover:not(:disabled),
.nscc-support-select:hover:not(:disabled),
.select-control:hover:not(:disabled),
.filter-select:hover:not(:disabled) {
    background-color: var(--bg-raised);
    box-shadow: none;
    border-color: var(--nscc-line, #000000);
}

:root.dark select:hover:not(:disabled),
body.dark-theme select:hover:not(:disabled),
:root.dark .nscc-select:hover:not(:disabled),
body.dark-theme .nscc-select:hover:not(:disabled),
:root.dark .form-select:hover:not(:disabled),
body.dark-theme .form-select:hover:not(:disabled),
:root.dark .nscc-form-select:hover:not(:disabled),
body.dark-theme .nscc-form-select:hover:not(:disabled),
:root.dark .select-control:hover:not(:disabled),
body.dark-theme .select-control:hover:not(:disabled),
:root.dark .filter-select:hover:not(:disabled),
body.dark-theme .filter-select:hover:not(:disabled) {
    border-color: var(--nscc-line, #ffffff);
}

input.form-control-panel:hover:not(:disabled),
textarea.form-control-panel:hover:not(:disabled) {
    background-color: var(--bg-sunken);
    box-shadow: none;
}

select:focus,
.nscc-select:focus,
.form-select:focus,
.nscc-form-select:focus,
.nscc-support-select:focus,
.select-control:focus,
.form-control-panel:focus,
.filter-select:focus,
select:active,
select:open,
.nscc-select:active,
.nscc-select:open,
.form-select:active,
.form-select:open,
.nscc-form-select:active,
.nscc-form-select:open,
.select-inline--ghost:focus,
.select-inline--ghost:active,
.select-inline--ghost:open,
.select-compact:focus,
.select-compact:active,
.select-compact:open {
    outline: none;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    box-shadow: none;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

:root.dark select:focus,
:root.dark select:active,
:root.dark select:open,
body.dark-theme select:focus,
body.dark-theme select:active,
body.dark-theme select:open,
:root.dark .nscc-select:focus,
:root.dark .nscc-form-select:focus,
:root.dark .select-control:focus,
:root.dark .filter-select:focus,
body.dark-theme .nscc-select:focus,
body.dark-theme .nscc-form-select:focus,
body.dark-theme .select-control:focus,
body.dark-theme .filter-select:focus {
    border-color: var(--nscc-line, #ffffff) !important;
}

select:disabled,
.nscc-select:disabled,
.form-select:disabled,
.select-control:disabled,
.form-control-panel:disabled,
.filter-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    box-shadow: none;
}

select option,
.form-select option,
.nscc-form-select option,
.nscc-support-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
}

/* Panel selects ΓÇö card surface (Reports, Batch, Planner, Support); not sunken gray */
select.form-control-panel,
select.select-control,
.nscc-form-select,
.nscc-support-select {
    background-color: var(--bg-card);
    -webkit-text-fill-color: var(--text-primary);
    opacity: 1;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Sunken background variant ΓÇö text inputs only (forms, modals, batch tools) */
input.form-control-panel,
textarea.form-control-panel {
    background-color: var(--bg-sunken);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
}

/* Compact toolbar / planner week pickers */
select.nscc-form-select--compact,
select.form-control-panel.nscc-form-select--compact {
    min-height: 32px;
    padding: 0.35rem calc(0.5rem + 1.1rem) 0.35rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.35;
}

/* Compact map / toolbar filters */
.filter-select {
    width: auto;
    font-size: 0.8125rem;
    font-weight: 700;
}

.filter-select--compact {
    min-height: 30px;
    height: auto;
    padding: 0.25rem 1.75rem 0.25rem 0.5rem !important;
    line-height: 1.35;
    font-size: 0.75rem;
}

.filter-select--wide { width: 100%; }

/* Pill-shaped toolbar filters (card view, ops toolbar) */
.select-toolbar {
    width: auto;
    min-height: 32px;
    height: auto;
    padding: 0.4rem 1.75rem 0.4rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.select-toolbar--branch { max-width: 220px; }

/* Dispatch table inline selects */
.select-inline {
    width: 100%;
    min-height: auto;
    height: auto;
    padding: 0.2rem 1.25rem 0.28rem 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.35;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-md);
}

.select-inline--dispatch {
    font-size: 11pt;
    font-weight: 700;
    padding: 0.15rem 1.25rem 0.22rem 0.25rem;
    line-height: 1.35;
}

.select-inline--dispatch.select-inline--ghost {
    font-size: 11pt;
    padding-right: 1.1rem;
}

.select-inline--ghost {
    background-color: transparent;
    background-image: var(--nscc-select-chevron);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    box-shadow: none;
    padding-left: 0.2rem;
    padding-right: 1.1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: var(--font-mono);
    min-height: auto;
    height: auto;
}

.select-inline--ghost:hover:not(:disabled) {
    background-color: var(--bg-sunken);
    box-shadow: none;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
}

.select-inline--ghost:focus,
.select-inline--ghost:active,
.select-inline--ghost:open {
    background-color: var(--bg-sunken);
    box-shadow: none;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    border-radius: var(--radius-xs);
}

:root.dark .select-inline--ghost,
body.dark-theme .select-inline--ghost {
    border-color: var(--nscc-line, #ffffff);
}

:root.dark .select-inline--ghost:hover:not(:disabled),
:root.dark .select-inline--ghost:focus,
:root.dark .select-inline--ghost:active,
:root.dark .select-inline--ghost:open,
body.dark-theme .select-inline--ghost:hover:not(:disabled),
body.dark-theme .select-inline--ghost:focus,
body.dark-theme .select-inline--ghost:active,
body.dark-theme .select-inline--ghost:open {
    border-color: var(--nscc-line, #ffffff) !important;
}

/* Gantt / timeline compact selects */
.select-compact {
    min-height: auto;
    height: auto;
    padding: 0.2rem 1.1rem 0.28rem 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.35;
    border-radius: var(--radius-xs);
    background-color: var(--bg-sunken);
    box-shadow: none;
}

.select-compact--flex { flex: 1; min-width: 0; }
.select-compact--block { width: 100%; margin-bottom: 6px; }

.select-compact:hover:not(:disabled) {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-md);
}

/* Primary dispatch table filter row */
.select-filter-row {
    flex: 1 1 auto;
    max-width: 140px;
    min-height: auto;
    height: auto;
    padding: 0.25rem 1.25rem 0.3rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.35;
    border-radius: var(--radius-xs);
}

.nscc-location-combobox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    max-width: 140px;
    min-width: 0;
    padding: 0;
    background: var(--bg-card);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
}

:root.dark .nscc-location-combobox,
body.dark-theme .nscc-location-combobox {
    border-color: var(--nscc-line, #ffffff);
}

.nscc-location-combobox.select-filter-row {
    min-height: auto;
    height: auto;
}

.nscc-location-combobox__trigger {
    width: 100%;
    min-height: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.35;
    padding: 0.25rem 0.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.nscc-location-combobox__trigger.has-value {
    color: var(--text-primary);
}

.nscc-location-combobox__trigger:hover,
.nscc-location-combobox__trigger:focus {
    color: var(--text-primary);
    outline: none;
}

.nscc-location-combobox__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 120;
    min-width: 220px;
    width: max-content;
    max-width: min(320px, 85vw);
    padding: 0.35rem;
    background: var(--bg-card);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    color: var(--text-primary);
}

:root.dark .nscc-location-combobox__panel,
body.dark-theme .nscc-location-combobox__panel {
    border-color: var(--nscc-line, #ffffff);
}

.nscc-location-combobox__search {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.3rem;
    padding: 0.25rem 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    background: var(--bg-card);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: var(--radius-xs);
    outline: none;
}

:root.dark .nscc-location-combobox__search,
body.dark-theme .nscc-location-combobox__search {
    border-color: var(--nscc-line, #ffffff);
}

.nscc-location-combobox__search:focus {
    border-color: var(--nscc-line, #000000);
}

:root.dark .nscc-location-combobox__search:focus,
body.dark-theme .nscc-location-combobox__search:focus {
    border-color: var(--nscc-line, #ffffff);
}

.nscc-location-combobox__menu {
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nscc-location-combobox__option {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nscc-location-combobox__option:hover,
.nscc-location-combobox__option.is-active {
    background: rgba(88, 86, 214, 0.14);
    color: var(--text-primary);
}

.nscc-location-combobox__empty {
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

.nscc-location-combobox.is-open {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow-brand);
}

.nscc-location-combobox:hover {
    background-color: var(--bg-raised);
    box-shadow: 3px 3px 0 var(--border);
}

/* Pulse / analytics monospace selects */
.select-pulse {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    padding: 0.375rem 1.75rem 0.375rem 0.5rem;
    border-radius: var(--radius-xs);
}

/* Chart metric micro-select */
.select-chart-metric {
    min-height: auto;
    height: auto;
    padding: 0.05rem 1rem 0.05rem 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.47rem;
    font-weight: 800;
    border-radius: 2px;
    background-color: var(--bg-sunken);
    box-shadow: none;
}

/* Form switcher inside bordered header bar (mobile apps) */
.form-switcher {
    flex: 1;
    width: auto;
    min-height: auto;
    height: auto;
    padding: 0;
    padding-right: 1rem;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0;
}

.form-switcher:hover,
.form-switcher:focus {
    background: transparent;
    box-shadow: none;
    border: none;
}

/* Custom nav dropdown panel */
.nav-dropdown-content {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-dropdown-content .nav-btn {
    color: var(--text-secondary);
}

.nav-dropdown-content .nav-btn:hover {
    background: var(--bg-sunken) !important;
    color: var(--text-primary) !important;
}

.nav-dropdown-content .nav-btn.active {
    background: var(--brand-light) !important;
    color: var(--text-inverse) !important;
    border: 2px solid var(--border) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--bg-sunken);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-full);
    transition: background var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
}
.slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    transition: transform var(--dur-base) var(--ease-spring), background var(--dur-base);
}
input:checked + .slider {
    background: var(--brand-light);
    border-color: var(--nscc-line, #000000);
    box-shadow: 0 0 0 3px var(--brand-glow);
}
input:checked + .slider::before {
    transform: translateX(22px);
    background: var(--bg-card, #fff);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.35);
    overflow: auto;
}
.modal.open { display: flex; align-items: center; justify-content: center; }
.modal-content {
    background: var(--bg-page, #f4f4f5);
    border: 4px solid var(--nscc-line, #000000);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-5);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow: auto;
    animation: modalIn var(--dur-base) var(--ease-out);
    position: relative;
    margin: 0;
    will-change: opacity, transform;
    color: var(--text-primary);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: var(--space-6);
    padding: 0.55rem 0.85rem;
    background: var(--bg-card, #ffffff);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: 8px;
    box-sizing: border-box;
}
.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
    text-transform: none;
}

.close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem; height: 2rem;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-sunken);
    color: var(--text-secondary);
    font-size: 1.125rem;
    cursor: pointer;
    transition: background var(--dur-fast), color var(--dur-fast);
    line-height: 1;
}
.close-btn:hover { background: var(--bg-sunken); color: var(--text-primary); }

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
}
.setting-row:first-of-type { border-top: none; }

/* ============================================================
   TOPBAR (Mobile Apps)
   ============================================================ */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1rem 0.625rem;
    padding-top: max(0.875rem, env(safe-area-inset-top, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 10000 !important;
    box-shadow: var(--shadow-xs);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 48%;
    overflow: hidden;
}

.brand-star {
    font-size: 1.375rem;
    color: var(--text-primary);
    filter: drop-shadow(0 0 6px var(--brand-glow));
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; overflow: hidden; }
.brand-name {
    font-size: 0.95rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-unit {
    font-size: 0.6rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 58%;
    overflow: hidden;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
    overflow: hidden;
}

.topbar .user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
.topbar .user-name {
    font-size: 0.75rem; font-weight: 700; color: var(--text-primary); line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%;
}
.topbar .user-role {
    font-size: 0.58rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%;
}
.topbar-user > :last-child { flex-shrink: 0; }

/* Base (non-topbar) ΓÇö kept for any legacy field-app usage */
.user-info { display: flex; flex-direction: column; text-align: right; }
.user-name  { font-size: 0.75rem; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.user-role  { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Keep topbar clear of demo phone notch / Dynamic Island overlays */
html.nscc-demo-phone-viewport .topbar,
html.nscc-in-phone-frame .topbar {
    padding-top: 2.85rem;
}

.avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border-strong);
}

/* ============================================================
   BOTTOM NAVIGATION (Mobile Apps)
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 10000 !important;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0 max(1.25rem, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(13,27,42,0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-md);
    transition: color var(--dur-fast), background var(--dur-fast);
    user-select: none;
}

.nav-item .nav-icon {
    font-size: 1.35rem;
    transition: transform var(--dur-fast) var(--ease-spring);
}

.nav-item:hover { color: var(--text-secondary); }

.nav-item.active {
    color: var(--text-primary);
}
.nav-item.active .nav-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px var(--brand-glow));
}

/* ============================================================
   STATUS INDICATOR (Pulse Dot)
   ============================================================ */
.pulse-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: var(--radius-full);
    position: relative;
}
.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-full);
    animation: pulse 2.5s infinite;
    opacity: 0.5;
}
.pulse-dot.green { background: var(--status-secure); }
.pulse-dot.green::after { background: var(--status-secure); box-shadow: 0 0 0 3px var(--status-secure); }
.pulse-dot.amber { background: var(--status-pending); }
.pulse-dot.amber::after { background: var(--status-pending); box-shadow: 0 0 0 3px var(--status-pending); }
.pulse-dot.blue { background: var(--status-transit); }
.pulse-dot.blue::after { background: var(--status-transit); box-shadow: 0 0 0 3px var(--status-transit); }
.pulse-dot.red { background: var(--status-breach); }
.pulse-dot.red::after { background: var(--status-breach); box-shadow: 0 0 0 3px var(--status-breach); }
.pulse-dot.purple { background: var(--status-unassigned); }
.pulse-dot.purple::after { background: var(--status-unassigned); box-shadow: 0 0 0 3px var(--status-unassigned); }

@keyframes pulse {
    0%   { opacity: 0.6; transform: scale(1); }
    50%  { opacity: 0;   transform: scale(2); }
    100% { opacity: 0;   transform: scale(2); }
}

/* ============================================================
   VIEWS / ANIMATIONS
   ============================================================ */
.view { display: none; }
.view.active { display: block; animation: fadeSlideIn var(--dur-fast) var(--ease-out); }

@keyframes fadeSlideIn {
    from { opacity: 0.85; }
    to   { opacity: 1; }
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================/* --- LAYOUT UTILS & OVERFLOW FIXES --- */
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex-wrap { flex-wrap: wrap; }
.card { overflow: hidden; display: flex; flex-direction: column; }
.btn { white-space: nowrap; flex-shrink: 0; }

input:not([type="checkbox"]):not([type="radio"]):not([type="date"]):not([type="hidden"]) {
    height: 38px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 1200px) {
    .kanban-board { grid-template-columns: 1fr; }
}

/* ============================================================
   UTILITY HELPERS
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.text-mono     { font-family: var(--font-mono); }
.text-brand { color: var(--text-primary); }
.text-secure { color: var(--text-primary); }
.text-transit  { color: var(--status-transit); }
.text-breach   { color: var(--status-breach); }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-upper    { text-transform: uppercase; letter-spacing: 0.06em; }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.font-bold     { font-weight: 700; }
.font-black    { font-weight: 800; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: 0.5rem; }
.gap-4         { gap: 1rem; }
.w-full        { width: 100%; }
.mt-auto       { margin-top: auto; }
/* ============================================================
   BRANDING & LOGO UTILS
   ============================================================ */
.sidebar-brand-star img,
.brand-star img,
.topbar-brand img,
.sim-label img {
    object-fit: contain;
    filter: brightness(0); /* Force absolute black in light mode */
    transition: filter var(--dur-base);
}

.dark .sidebar-brand-star img,
.dark-theme .sidebar-brand-star img,
.dark .brand-star img,
.dark-theme .brand-star img,
.dark .topbar-brand img,
.dark-theme .topbar-brand img,
.dark .sim-label img {
    filter: brightness(0) invert(1); /* Absolute white in dark mode */
}

/* ============================================================
   CONNECTIVITY BANNER (Store & Forward)
   ============================================================ */
.connectivity-banner {
    background: transparent;
    color: #000000;
    -webkit-text-fill-color: #000000;
    padding: var(--space-2) var(--space-4);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    z-index: 9999;
    position: relative;
    border: 4px solid #FF3B30;
    box-shadow: none;
    transition: all var(--dur-normal, 0.3s) ease;
}
.connectivity-banner.hidden {
    display: none;
}
.connectivity-banner.minimized {
    position: fixed;
    top: 0;
    right: var(--space-4);
    left: auto;
    width: auto;
    max-width: calc(100vw - var(--space-8));
    padding: var(--space-2) var(--space-3);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}
.connectivity-banner.minimized .banner-text,
.connectivity-banner.minimized .banner-icon {
    display: none;
}
.connectivity-banner:not(.minimized) .banner-pill-label {
    display: none;
}
.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    position: relative;
}
.connectivity-banner:not(.minimized) .banner-content {
    padding-right: 2rem;
}
.banner-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.banner-pill-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.banner-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-inverse, #ffffff);
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-xs);
    font-size: 0.65rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background var(--dur-fast, 0.15s) ease;
}
.connectivity-banner:not(.minimized) .banner-toggle-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
.banner-toggle-btn:hover,
.banner-toggle-btn:focus-visible {
    background: rgba(255, 255, 255, 0.35);
    outline: none;
}

/* Compact sync badge ΓÇö queued / syncing / synced / offline */
.nscc-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 26px;
    padding: 0 0.65rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
    box-sizing: border-box;
    transition: background-color var(--dur-fast, 70ms), border-color var(--dur-fast, 70ms);
}
.nscc-sync-badge:hover {
    background: var(--bg-raised);
}
.nscc-sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--nscc-sync-color, #34C759);
    flex-shrink: 0;
}
.nscc-sync-badge[data-state="syncing"] .nscc-sync-dot {
    animation: nscc-sync-pulse 1s ease-in-out infinite;
}
.nscc-sync-badge[data-state="queued"] .nscc-sync-dot,
.nscc-sync-badge[data-state="offline"] .nscc-sync-dot {
    animation: nscc-sync-pulse 1.4s ease-in-out infinite;
}
@keyframes nscc-sync-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}
@media (max-width: 640px) {
    .nscc-sync-label { max-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; }
}


/* ========================================================= */
/* MOBILE & TABLET RESPONSIVENESS                            */
/* ========================================================= */
@media (max-width: 900px) {
    #main-layout {
        display: flex;
        flex-direction: column;
    }
    #app-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid var(--border);
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem;
    }
    #sidebar-nav {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }
    #primary-view {
        grid-template-columns: 1fr;
    }
    #primary-right-panel {
        display: none; /* Hide batching and side pulse on mobile */
    }
    .top-tabs {
        flex-wrap: wrap;
    }
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    .table-container {
        overflow-x: auto;
    }
}

/* ============================================================
   STATUS CHIPS — clear fill, black text, colored border, rounded square
   (Do NOT use [class*="status"] wildcards — they paint kanban columns.)
   ============================================================ */

.ref-status-pill,
.status-badge,
.status-chip,
.ops-chip,
.trip-status,
.nscc-dispatch-status-pill,
.nscc-pulse-action-chip__status,
.nscc-pulse-segment-tip__status-pill,
.nscc-fp-badge,
.cm-status-badge,
.badge-secure,
.badge-success,
.badge-pending,
.badge-pickup,
.badge-transit,
.badge-assigned,
.badge-unassigned,
.badge-scheduled,
.badge-danger,
.badge-en-route,
.badge-current,
.badge.green,
.badge.amber,
.badge.transit,
.badge.delivered,
.status-secure,
.status-pending,
.status-pickup,
.status-transit,
.status-assigned,
.status-unassigned,
.status-scheduled,
.status-exception,
.status-conflict,
.status-en-route,
.status-current,
.status.green,
.status.amber,
.timeline-event-inline {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    border-width: var(--nscc-status-border-w, 4px) !important;
    border-style: solid !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-weight: 800 !important;
    opacity: 1 !important;
}

.ref-status-pill.delivered,
.ref-status-pill.secure,
.ref-status-pill.success,
.ref-status-pill.accepted,
.badge-secure,
.badge-success,
.badge.green,
.badge.delivered,
.status-secure,
.status.green,
.timeline-event-inline.delivered,
.nscc-dispatch-status-pill[data-status="delivered"] {
    border-color: #34C759 !important;
}

.ref-status-pill.pending,
.ref-status-pill.pending-pickup,
.ref-status-pill.pickup-pending,
.badge-pending,
.status-pending,
.badge.amber,
.status.amber,
.nscc-dispatch-status-pill[data-status="pending"],
.nscc-dispatch-status-pill[data-status="pending pickup"] {
    border-color: #FF9500 !important;
}

.ref-status-pill.pickup,
.badge-pickup,
.status-pickup,
.nscc-dispatch-status-pill[data-status="pickup"] {
    border-color: #FFCC00 !important;
}

.ref-status-pill.transit,
.ref-status-pill.current,
.badge-transit,
.badge-current,
.status-transit,
.status-current,
.badge.transit,
.timeline-event-inline.transit,
.nscc-dispatch-status-pill[data-status="transit"],
.nscc-dispatch-status-pill[data-status="in transit"] {
    border-color: #007AFF !important;
}

.ref-status-pill.en-route,
.ref-status-pill.enroute,
.badge-en-route,
.status-en-route,
.nscc-dispatch-status-pill[data-status="en-route"] {
    border-color: #5856D6 !important;
}

.ref-status-pill.assigned,
.badge-assigned,
.status-assigned,
.nscc-dispatch-status-pill[data-status="assigned"] {
    border-color: #AF52DE !important;
}

.ref-status-pill.unassigned,
.badge-unassigned,
.status-unassigned,
.ref-status-pill.exception,
.ref-status-pill.conflict,
.badge-danger,
.status-exception,
.status-conflict,
.nscc-dispatch-status-pill[data-status="unassigned"] {
    border-color: #FF3B30 !important;
}

.ref-status-pill.scheduled,
.badge-scheduled,
.status-scheduled {
    border-color: #06b6d4 !important;
}

/* Action buttons — outline status style (clear fill / black ink / bright border) */
.btn-success,
.btn-checkin,
.sim-btn.active {
    background: transparent !important;
    background-color: transparent !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #34C759 !important;
    box-shadow: none !important;
}
.btn-success:hover,
.btn-checkin:hover,
.sim-btn.active:hover {
    background: transparent !important;
    background-color: transparent !important;
    filter: brightness(1.05);
}
.btn-warning,
.btn-checkout {
    background: transparent !important;
    background-color: transparent !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #FF9500 !important;
    box-shadow: none !important;
}
.btn-warning:hover,
.btn-checkout:hover {
    background: transparent !important;
    background-color: transparent !important;
    filter: brightness(1.05);
}
.btn-danger {
    background: transparent !important;
    background-color: transparent !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #FF3B30 !important;
    box-shadow: none !important;
}
.btn-danger:hover {
    background: transparent !important;
    background-color: transparent !important;
    filter: brightness(1.05);
}

/* Card assign control uses standard filter-select styling */
.card-assign-control select { cursor: pointer; }

/* ΓöÇΓöÇ NSCC Compact Date Navigation (shared across all screens) ΓöÇΓöÇ */
.nscc-date-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: transparent;
    padding: 0;
    border: none;
    height: 1.5rem;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
}

.nscc-date-nav__btn,
.nscc-date-nav .date-nav-btn,
.nscc-date-nav .nscc-custom-date-arrow,
.nscc-date-nav .date-nav-arrow {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000);
    transition: background 0.15s ease;
    outline: none;
}

.nscc-date-nav__btn:hover,
.nscc-date-nav .date-nav-btn:hover,
.nscc-date-nav .nscc-custom-date-arrow:hover,
.nscc-date-nav .date-nav-arrow:hover {
    background: var(--bg-sunken);
}

.nscc-date-nav__field {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-card, #fff);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: 3px;
    height: 1.5rem;
    padding: 0 0.35rem;
    box-sizing: border-box;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000);
}

.nscc-date-nav__field input[type="date"] {
    background: transparent;
    border: none;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    padding: 0;
    margin: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: auto;
    min-width: 6.5rem;
    -webkit-appearance: none;
    appearance: none;
}

.nscc-date-nav__text,
.nscc-date-nav .nscc-custom-date-text {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.02em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1;
}

.nscc-date-nav__text:hover,
.nscc-date-nav .nscc-custom-date-text:hover {
    color: var(--text-primary);
}

.nscc-date-nav__cal,
.nscc-date-nav .nscc-custom-date-cal {
    background: transparent;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    color: var(--text-primary);
    outline: none;
}

.nscc-date-nav__cal:hover,
.nscc-date-nav .nscc-custom-date-cal:hover {
    transform: scale(1.1);
}

.nscc-date-nav__today,
.nscc-date-nav .nscc-custom-date-today,
.nscc-date-nav .today-date-btn {
    height: 1.5rem;
    padding: 0 0.45rem;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: 3px;
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-size: 0.6rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000);
    white-space: nowrap;
    outline: none;
    line-height: 1;
}

.nscc-date-nav__today:hover,
.nscc-date-nav .nscc-custom-date-today:hover,
.nscc-date-nav .today-date-btn:hover {
    background: var(--bg-sunken);
}

.nscc-date-nav__hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    border: none;
    padding: 0;
    margin: 0;
}

/* Legacy aliases ΓÇö map old class names to compact nav */
.nscc-custom-date-selector,
.condensed-date-selector,
.pulse-date-picker-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: transparent;
    padding: 0;
    border: none;
    height: 1.5rem;
    box-sizing: border-box;
}

.dispatch-date-control.nscc-date-nav,
.nscc-date-nav.dispatch-date-control {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    gap: 0.2rem;
    height: 1.5rem;
}

/* ΓöÇΓöÇ NSCC schedule / gantt time-slot grid cells ΓöÇΓöÇ */
.nscc-time-slot {
    position: absolute;
    top: 0;
    bottom: 0;
    box-sizing: border-box;
    border-right: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    pointer-events: none;
}
.nscc-time-slot--interactive {
    pointer-events: auto;
    cursor: pointer;
    z-index: 2;
}
.nscc-time-slot--interactive:hover {
    background: var(--select-wash, rgba(24, 24, 27, 0.08));
}
.nscc-schedule-hour-grid {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
}
.nscc-schedule-hour-grid .nscc-schedule-hour-cell {
    min-height: 2.5rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.6rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
    border-right: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    box-sizing: border-box;
}
.nscc-schedule-hour-grid .nscc-schedule-hour-cell:nth-child(24n) {
    border-right: none;
}
.nscc-schedule-hour-grid--scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    margin-bottom: 1rem;
}
.nscc-schedule-hour-grid--scroll .nscc-schedule-hour-cell {
    flex: 0 0 3.25rem;
    min-height: 2.75rem;
    border-right: 2px solid var(--border);
    border-bottom: none;
}
.nscc-schedule-hour-grid--scroll .nscc-schedule-hour-cell:last-child {
    border-right: none;
}

/* ΓöÇΓöÇ Demo phone viewport (standalone mobile apps on desktop) ΓöÇΓöÇ */
:root {
    --nscc-phone-width: 390px;
    --nscc-phone-height: 844px;
}

html.nscc-demo-phone-viewport {
    background: #05080f;
    min-height: 100%;
}

html.nscc-demo-phone-viewport body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    background:
        radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.18) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 35%, rgba(255,255,255,0.15) 0%, transparent 100%),
        #05080f;
    overflow: auto;
}

html.nscc-demo-phone-viewport .nscc-phone-shell {
    position: relative;
    width: var(--nscc-phone-width);
    max-width: 100%;
    height: var(--nscc-phone-height);
    max-height: calc(100vh - 48px);
    flex-shrink: 0;
    background: #000;
    border-radius: 44px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.75),
        inset 0 0 0 2px #2a2a2a,
        inset 0 0 0 10px #111,
        inset 0 0 0 12px #222;
    overflow: hidden;
    transform: translateZ(0);
}

html.nscc-demo-phone-viewport .nscc-phone-notch {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 126px;
    height: 28px;
    background: #000;
    border-radius: 0 0 18px 18px;
    z-index: 10000001;
    box-shadow: inset 0 -4px 8px rgba(0,0,0,0.5);
    pointer-events: none;
}

html.nscc-demo-phone-viewport .nscc-phone-notch::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 7px;
    width: 10px;
    height: 10px;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #111, 0 0 4px rgba(100,200,255,0.2);
}

html.nscc-demo-phone-viewport .mobile-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 34px;
    overflow: hidden;
}

/* ============================================================
   DARK MODE ΓÇö GLOBAL BLACK-TEXT / BLACK-ICON OVERRIDES
   Ensures no hardcoded black survives into dark theme.
   ============================================================ */

/* Transit wildcard also sets color:#000 ΓÇö override in dark */
:root.dark [class*="transit"]:not(.connectivity-banner),
body.dark-theme [class*="transit"]:not(.connectivity-banner) {
    color: #ffffff !important;
}

/* Any non-brand img that was forced to black in light mode
   should be white in dark mode (covers icon sets, illustrations).
   Not a Leaflet map's own images (class leaflet-tile, leaflet-marker-icon, leaflet-marker-shadow): the map tiles and
   the pin are pictures, and whitened they left the location map blank (owner, 2026-10-22). */
:root.dark img:not([class*="avatar"]):not([class*="photo"]):not([class*="pravatar"]):not([src*="pravatar"]):not([class*="leaflet-"]),
body.dark-theme img:not([class*="avatar"]):not([class*="photo"]):not([class*="pravatar"]):not([src*="pravatar"]):not([class*="leaflet-"]) {
    filter: brightness(0) invert(1);
}

/* Brand logos: stone tile in light; invert tile + gray star in dark (see rules below). */
:root.dark .sim-label img,
body.dark-theme .sim-label img {
    filter: invert(1) brightness(0.72) !important;
    background: #d4d4d8 !important;
    border: 1.5px solid #9ca3af;
}

/* Consistent NorthStar mark (stone tile) across chrome, apps, FS banner */
.nscc-brand-logo,
.brand-star img,
.sidebar-brand-star img,
.topbar-brand img,
.nscc-bo-fs-brand img {
    background: #d4d4d8 !important;
    border-radius: 8px;
    padding: 3px;
    box-sizing: border-box;
    filter: none !important;
}
/* Header chrome logo: match page/window background in light mode (not a white tile).
   OAuth gate logo stays on a white tile — do not fold .nscc-auth-logo into this rule. */
.nscc-chrome-brand-mark img,
.nscc-chrome-brand-row .nscc-chrome-brand-mark img {
    background: var(--bg-page, #f4f4f5) !important;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    border-radius: 8px;
    padding: 3px;
    box-sizing: border-box;
    filter: none !important;
}
/* OAuth gate logo: white tile + black border (unchanged) */
.nscc-auth-logo {
    background: #ffffff !important;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    border-radius: 8px;
    padding: 3px;
    box-sizing: border-box;
    filter: none !important;
}
:root.dark .nscc-brand-logo,
:root.dark .brand-star img,
:root.dark .sidebar-brand-star img,
:root.dark .topbar-brand img,
:root.dark .nscc-bo-fs-brand img,
body.dark-theme .nscc-brand-logo,
body.dark-theme .brand-star img,
body.dark-theme .sidebar-brand-star img,
body.dark-theme .topbar-brand img,
body.dark-theme .nscc-bo-fs-brand img {
    background: #d4d4d8 !important;
    filter: invert(1) brightness(0.72) !important;
}
:root.dark .nscc-chrome-brand-mark img,
:root.dark .nscc-chrome-brand-row .nscc-chrome-brand-mark img,
body.dark-theme .nscc-chrome-brand-mark img,
body.dark-theme .nscc-chrome-brand-row .nscc-chrome-brand-mark img {
    /* Dark chrome: keep white tile so the mark reads on dark page */
    background: #ffffff !important;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    filter: none !important;
}
:root.dark .nscc-auth-logo,
body.dark-theme .nscc-auth-logo {
    background: #ffffff !important;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    filter: none !important;
}
:root.dark .nscc-chrome-brand-mark,
body.dark-theme .nscc-chrome-brand-mark,
:root.dark button.nscc-chrome-brand-mark,
body.dark-theme button.nscc-chrome-brand-mark {
    border-color: #9ca3af !important;
}
:root.dark .nscc-chrome-brand-row button.nscc-chrome-brand-mark,
body.dark-theme .nscc-chrome-brand-row button.nscc-chrome-brand-mark {
    background: var(--banner-chip-bg, #4b5563) !important;
}

/* Inline SVG fill/stroke: catch svg elements rendered black */
:root.dark svg path[fill="#000000"],
:root.dark svg path[fill="black"],
:root.dark svg rect[fill="#000000"],
:root.dark svg circle[fill="#000000"],
body.dark-theme svg path[fill="#000000"],
body.dark-theme svg path[fill="black"],
body.dark-theme svg rect[fill="#000000"],
body.dark-theme svg circle[fill="#000000"] {
    fill: #ffffff;
}
:root.dark svg path[stroke="#000000"],
:root.dark svg path[stroke="black"],
body.dark-theme svg path[stroke="#000000"],
body.dark-theme svg path[stroke="black"] {
    stroke: #ffffff;
}

/* ============================================================
   UI CONSISTENCY NORMALIZATION LAYER
   Enforces uniform heading sizes, button styles, table headers,
   container spacing, and input styling across all view sections.
   ============================================================ */

/* Primary screen titles — match chrome title bar (1.15rem / 800 / black box in styles.css).
   Do not force 1.5rem on erp-connect / master-data / overview screen titles. */
.view-section h2.section-title,
.view-section h2.panel-title {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    text-transform: none;
    line-height: 1.25;
}
.view-section h2:first-of-type:not(.erp-connect-title):not(.master-data-title):not(.nscc-overview-intro__title):not(.modal-title-strong),
.view-section .master-data-shell > div > h2:not(.erp-connect-title):not(.master-data-title) {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    text-transform: none;
    line-height: 1.25;
}

/* Secondary headings (h3 within view sections): uniform 1.1rem / 800 / brand-light */
.view-section h3,
.view-section h3.section-subtitle,
.view-section .panel-header h3 {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    text-transform: none;
    line-height: 1.2;
}

/* Gantt/timeline header bars ΓÇö normalize to consistent 1rem / 700 */
.view-section .gantt-header,
.view-section .timeline-header,
.view-section .scheduler-header {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    margin: 0 0 1rem !important;
    background: var(--bg-sunken);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
}

/* ΓöÇΓöÇ "Save to PDF" Buttons ΓöÇΓöÇ */
/* All PDF export buttons: muted fill darker than info boxes */
.view-section .st-pdf-btn,
.view-section button[class*="pdf"],
.view-section .btn[class*="pdf"] {
    background: var(--btn-surface) !important;
    color: var(--btn-surface-ink) !important;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    cursor: pointer;
}
.view-section .st-pdf-btn:hover,
.view-section button[class*="pdf"]:hover,
.view-section .btn[class*="pdf"]:hover {
    background: var(--btn-surface-hover) !important;
    border-color: var(--nscc-line, #000000) !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* ΓöÇΓöÇ Action Buttons ("+ New", "Manage Groups", etc.) ΓöÇΓöÇ */
/* All primary action buttons in view sections: muted fill, darker than cards */
.view-section .btn-primary,
.view-section button[class*="new-template"],
.view-section button[class*="manage"],
.view-section .nscc-action-btn {
    background: var(--btn-surface) !important;
    color: var(--btn-surface-ink) !important;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}
.view-section .btn-primary:hover,
.view-section button[class*="new-template"]:hover,
.view-section button[class*="manage"]:hover,
.view-section .nscc-action-btn:hover {
    background: var(--btn-surface-hover) !important;
    border-color: var(--nscc-line, #000000) !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Submit schedule stays frost blue even under view-section primary overrides */
.view-section .btn-frost,
.view-section .btn-submit-schedule,
.view-section button[onclick*="nsccPlannerSubmit"] {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: 2.5px solid var(--frost-blue-deep, #1c1917) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
}
.view-section .btn-frost:hover:not(:disabled):not([aria-disabled="true"]),
.view-section .btn-submit-schedule:hover:not(:disabled):not([aria-disabled="true"]),
.view-section button[onclick*="nsccPlannerSubmit"]:hover:not(:disabled):not([aria-disabled="true"]) {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--frost-blue-deep, #1c1917) !important;
    box-shadow: none !important;
}

/* ΓöÇΓöÇ Table Headers ΓöÇΓöÇ */
/* All tables in view sections: uniform header background, font, padding */
.view-section table thead th,
.view-section .table thead th,
.view-section .data-table thead th {
    background: var(--table-head-bg, var(--bg-sunken)) !important;
    color: var(--text-primary) !important;
    font-size: 0.8125rem !important;
    font-weight: 800 !important;
    padding: 0.55rem 0.7rem !important;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border);
}

/* Table body cells: consistent padding */
.view-section table tbody td,
.view-section .table tbody td,
.view-section .data-table tbody td {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.8125rem !important;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: left;
}

/* ΓöÇΓöÇ Master Data Shell Containers ΓöÇΓöÇ */
/* All Back Office / master-data screens: uniform padding (Master Data keeps capped width) */
.view-section .master-data-shell {
    padding: 1.25rem 1.5rem 2rem !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* Accounting / HR / Payroll / Forms permanently use the full available width */
#accounting-view .master-data-shell,
#accounting-view .master-data-shell--finance,
#accounting-view .nscc-bo-fullwidth,
#back-office-view .master-data-shell--finance,
#back-office-view .back-office-payroll-mount,
#back-office-payroll-mount.master-data-shell,
#back-office-payroll-panel,
#back-office-payroll-panel.nscc-bo-fullwidth,
#ops-field-view .master-data-shell--ops,
#form-management-view .master-data-shell,
#form-management-view .master-data-shell--finance,
#form-management-view .nscc-forms-shell {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}
#accounting-view .nscc-finance-panel,
#accounting-view .nscc-erp-tab-panel,
#back-office-payroll-panel .nscc-finance-panel,
#back-office-payroll-panel .nscc-erp-tab-panel,
#form-management-view .nscc-forms-panel,
#form-management-view .nscc-erp-tab-panel {
    width: 100% !important;
    max-width: none !important;
}
#accounting-view .nscc-table,
#accounting-view .master-data-table,
#back-office-payroll-panel .nscc-table,
#back-office-payroll-panel .master-data-table,
#accounting-view .bo-table-scroll-wrap,
#back-office-payroll-panel .bo-table-scroll-wrap,
#accounting-view .erp-queue-table-wrap--bo-fill,
#back-office-payroll-panel .erp-queue-table-wrap--bo-fill,
#accounting-view .master-data-table-shell,
#back-office-payroll-panel .master-data-table-shell {
    width: 100% !important;
    max-width: none !important;
}
#accounting-view .nscc-finance-cards,
#back-office-payroll-panel .nscc-finance-cards {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
@media (min-width: 1400px) {
    #accounting-view .nscc-finance-cards,
    #back-office-payroll-panel .nscc-finance-cards {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* Sticky table headers are intentionally OFF for Accounting / HR / Payroll.
   These screens stack several tables in one scrolling panel; with each table's
   thead sticking at top:0 in the same scroll container, the headers collided
   and overlapped while scrolling ("a row that freezes and the info behind it
   moves but doesn't work right"). A correct sticky header needs each table in
   its own overflow-scroll wrapper — a larger change for a future enhancement.
   Until then, let the finance tables scroll normally. */

/* Screen tools: compact density + find */
.nscc-bo-screen-chrome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.9rem;
    /* No boxed border/background — it read as an unnecessary card around the
       screen tools. Just a plain inline row that sits below the pills. */
    padding: 0;
    margin: 0 0 0.55rem;
    border: none;
    background: transparent;
    /* Not sticky — it froze at the top while content scrolled behind it. */
    position: static;
    box-sizing: border-box;
}
/* In-body sub-folder tabs (AP Bills / POs / Runs / Vendors, Ops folders, etc.).
   These deliberately EMULATE the top chrome folder tabs — same tab shape, colors,
   and active/hover behavior — so nested navigation reads as the same tab metaphor,
   just one level down. The nav's bottom border is the baseline the tabs sit on. */
.nscc-subfolder-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 2px;
    align-items: flex-end;
    margin: 0 0 0.7rem;
    border-bottom: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
}
.nscc-subfolder-nav .nscc-erp-tab-btn {
    position: relative;
    z-index: 1;
    margin: 0 0 -2px 0;
    padding: 0.26rem 0.6rem 0.3rem !important;
    font-size: 0.72rem !important;
    font-weight: 700;
    /* Two text-rows tall, matching the top folder tabs: labels wrap to two lines
       and every tab shares a uniform two-row height. */
    white-space: normal;
    max-width: 7rem;
    min-height: var(--nscc-folder-tab-h, 2.55rem) !important;
    max-height: var(--nscc-folder-tab-h, 2.55rem) !important;
    overflow: hidden;
    height: auto !important;
    line-height: 1.15 !important;
    text-align: center;
    align-items: center;
    justify-content: center;
    display: inline-flex;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    border-bottom: none !important;
    border-radius: 10px 10px 0 0 !important;
    background: var(--chrome-folder, #e8eef4) !important;
    color: var(--chrome-folder-ink, #0d1b2a) !important;
    transform: translateY(2px);
}
.nscc-subfolder-nav .nscc-erp-tab-btn:hover {
    z-index: 2;
    background: var(--bg-raised, #f1f5f9) !important;
    transform: translateY(1px);
}
.nscc-subfolder-nav .nscc-erp-tab-btn.active,
.nscc-subfolder-nav .nscc-erp-tab-btn[aria-selected="true"] {
    z-index: 4;
    color: var(--text-inverse, #fff) !important;
    background: var(--chrome-folder-active, #1a2b45) !important;
    border-bottom: 2px solid var(--chrome-folder-panel-bg, var(--bg-card, #fff)) !important;
    transform: translateY(0);
}
/* Max screen space: once the user drills into a sub-folder (a .nscc-subnav-row is
   visible in the active back-office screen), body gets .nscc-bo-drilled and the top
   pillar folder-tab strip collapses. The breadcrumb "‹ Back" and the left menu stay
   as pillar switchers; the strip returns at each pillar's overview. Toggled by
   nsccSyncBoStripCollapse() in app-nav.js. */
body.nscc-bo-drilled #nscc-chrome-folder-tabs {
    display: none !important;
}
/* One-row Apple-style sub-nav: back breadcrumb + folder-tab-styled sub-folder
   tabs (+ optional right-aligned mode control). Baseline-aligned so the crumb and
   the folder tabs share the same bottom edge. */
.nscc-subnav-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.7rem;
    /* Space reserved on the right so an absolutely-pinned mode control
       (.nscc-crumb-mode) never overlaps the pills — they wrap under it instead. */
    position: relative;
    padding-right: 4rem;
}
/* When there's no pinned mode control, don't leave dead right-padding. */
.nscc-subnav-row:not(:has(.nscc-crumb-mode)) { padding-right: 0; }
.nscc-subnav-row .nscc-subfolder-nav { margin: 0; }
/* Folder-tab strips are capped at two ROWS OF TABS tall on every screen (each tab
   is itself two text-rows), then scroll rather than growing and eating the screen. */
.nscc-subfolder-nav {
    max-height: var(--nscc-folder-strip-h, 5.5rem);
    overflow-y: auto;
    overflow-x: hidden;
}
#nscc-chrome-folder-tabs {
    max-height: calc(var(--nscc-folder-strip-h, 5.5rem) + 0.5rem);
    overflow-y: auto;
}
/* Ops / back-office screens: the written screen descriptions ("Inventory — bulk
   stock…") are redundant with the folder-tab hover, so hide them in daily-use
   screens. The info lives on the tab's hover tooltip (data-nscc-desc). */
#ops-field-view .nscc-today-hint,
#accounting-view .nscc-today-hint,
#back-office-payroll-panel .nscc-today-hint,
#executive-dashboard-view .nscc-today-hint {
    display: none !important;
}
.nscc-crumb-back {
    border: 2px solid var(--border, #0f172a);
    background: var(--bg-card, #fff);
    color: var(--text-primary, #0d1b2a);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    line-height: 1.2;
}
.nscc-crumb-back:hover { background: var(--bg-sunken, #e8eef4); }
.nscc-crumb-here { font-size: 0.72rem; font-weight: 800; color: var(--text-secondary, #475569); }
.nscc-crumb-sep { color: var(--text-muted, #94a3b8); font-weight: 800; }
/* Compact, non-intrusive Advanced/Easy control at the far right of a one-row
   sub-nav (Ops). Reuses the tab click handler (data-ops-tab) but reads as a
   small mode switch, not a peer tab. */
.nscc-crumb-mode {
    /* Pinned to the far right of the sub-nav row and never displaced: it is
       absolutely positioned, and the row reserves right padding so the pills wrap
       to the next line rather than pushing or overlapping this control. */
    position: absolute;
    top: 0;
    right: 0;
    border: 1px dashed var(--border, #0f172a);
    background: var(--bg-card, #fff);
    color: var(--text-secondary, #475569);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
}
.nscc-crumb-mode:hover { background: var(--bg-sunken, #e8eef4); color: var(--text-primary, #0d1b2a); }
.nscc-bo-dense-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.nscc-bo-screen-find {
    min-width: 12rem;
    flex: 1 1 14rem;
    max-width: 22rem;
    padding: 0.35rem 0.55rem;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: var(--radius-md, 10px);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
}
:root.dark .nscc-bo-screen-find,
body.dark-theme .nscc-bo-screen-find {
    border-color: rgba(245, 245, 244, 0.68);
    background: transparent;
}
/* Find-on-this-screen match rows — cleared on click/type elsewhere */
tr.nscc-bo-find-hit,
.nscc-bo-find-hit {
    outline: 2px solid #ca8a04;
    outline-offset: -2px;
    background: rgba(250, 204, 21, 0.28) !important;
}
:root.dark tr.nscc-bo-find-hit,
:root.dark .nscc-bo-find-hit,
body.dark-theme tr.nscc-bo-find-hit,
body.dark-theme .nscc-bo-find-hit {
    outline-color: #facc15;
    background: rgba(250, 204, 21, 0.18) !important;
}
.nscc-bo-screen-chrome__hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
}
html.nscc-bo-dense #accounting-view .nscc-table td,
html.nscc-bo-dense #accounting-view .nscc-table th,
html.nscc-bo-dense #back-office-payroll-panel .nscc-table td,
html.nscc-bo-dense #back-office-payroll-panel .nscc-table th,
.nscc-bo-dense .nscc-table td,
.nscc-bo-dense .nscc-table th {
    padding-top: 0.22rem !important;
    padding-bottom: 0.22rem !important;
    font-size: 0.74rem !important;
}
html.nscc-bo-dense #accounting-view .nscc-finance-card,
html.nscc-bo-dense #back-office-payroll-panel .nscc-finance-card,
.nscc-bo-dense .nscc-finance-card {
    padding: 0.35rem 0.5rem !important;
}
html.nscc-bo-dense #accounting-view .nscc-overview-section,
html.nscc-bo-dense #back-office-payroll-panel .nscc-overview-section {
    margin-bottom: 0.65rem;
}

/* Day-to-day action bars scroll with the page. They were sticky, which left
   the Accounting Overview "Open:" row pinned while everything under it
   scrolled (Matt 2026-09-07: no bar on any screen stays put). */
#accounting-view .nscc-finance-toolbar,
#back-office-payroll-panel .nscc-finance-toolbar {
    position: static;
    background: var(--bg-page, var(--bg-card));
    padding: 0.35rem 0;
}

/* All search/filter inputs: black border */
.md-search-input,
.st-search,
.master-data-search,
.comms-contact-search,
.nscc-portal-search__input,
.global-search input,
.nscc-location-combobox__search,
input[type="search"],
input[type="text"].master-data-search,
input[type="text"].md-search-input,
input[type="text"].st-search,
.view-section .md-search-input,
.view-section .st-search,
.view-section input[type="search"],
.view-section input[type="text"].master-data-search {
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000) !important;
    border-radius: var(--radius-md) !important;
    background: var(--bg-card) !important;
    box-shadow: none !important;
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.md-search-input:focus,
.st-search:focus,
.master-data-search:focus,
.comms-contact-search:focus,
.nscc-portal-search__input:focus,
.global-search input:focus,
.nscc-location-combobox__search:focus,
input[type="search"]:focus,
input[type="text"].master-data-search:focus,
input[type="text"].md-search-input:focus,
input[type="text"].st-search:focus,
.view-section .md-search-input:focus,
.view-section .st-search:focus,
.view-section input[type="search"]:focus,
.view-section input[type="text"].master-data-search:focus {
    outline: none;
    border-color: var(--nscc-line, #000000) !important;
    box-shadow: var(--shadow-sm) !important;
}

/* ΓöÇΓöÇ Filter/Toolbar Bars ΓöÇΓöÇ */
/* Consistent filter bar spacing and alignment */
.view-section .filter-bar,
.view-section .toolbar-filters,
.view-section .form-control-panel-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* ΓöÇΓöÇ Status Badge Consistency ΓöÇΓöÇ */
/* Count badges in support tickets and similar: uniform style */
.view-section .count-badge,
.view-section .status-pill {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    padding: 0.2rem 0.7rem !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-color: var(--nscc-line, #000000) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

/* ΓöÇΓöÇ Back Office Panel Headers ΓöÇΓöÇ */
/* Uniform header bar for all BO panels */
.view-section .panel-header,
.view-section .master-data-header {
    padding: 0.75rem 1rem !important;
    background: var(--bg-sunken) !important;
    border: 2px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 1.25rem !important;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-section .panel-header p,
.view-section .master-data-header p {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    margin: 0.35rem 0 0 !important;
    max-width: 42rem;
}

/* ΓöÇΓöÇ Section Description Text ΓöÇΓöÇ */
.view-section .section-description {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    margin: 0.35rem 0 0 !important;
}

/* ΓöÇΓöÇ Card Panels in Back Office ΓöÇΓöÇ */
.view-section .card.panel-card,
.view-section .card.bo-card {
    padding: 1rem 1.15rem !important;
    margin-bottom: 1.25rem !important;
    border: 2px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
}

/* ΓöÇΓöÇ Date Navigation Controls ΓöÇΓöÇ */
/* Consistent date nav styling across schedule screens */
.view-section .nscc-date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-section .nscc-date-nav button {
    background: var(--bg-card);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: var(--radius-full);
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.view-section .nscc-date-nav button:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ΓöÇΓöÇ Planner Tab Pills ΓöÇΓöÇ */
/* Active vs inactive planner sub-tabs */
.view-section .planner-tab-pill {
    padding: 0.3rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    border-radius: var(--radius-full) !important;
    border: 2px solid var(--border) !important;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
}

.view-section .planner-tab-pill.active {
    background: var(--brand-light) !important;
    color: #ffffff !important;
}

.view-section .planner-tab-pill:not(.active) {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.view-section .planner-tab-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Native finance (AHP) — kept from mainline */
/* Native finance (AHP) */
.nscc-finance-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; margin: 0 0 0.65rem; }
.nscc-finance-card { background: var(--bg-card); border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: var(--radius-md, 10px); padding: 0.5rem 0.65rem; }
button.nscc-finance-card.nscc-overview-kpi {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
    width: 100%; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
    transition: transform var(--dur-fast, 70ms) var(--ease-out, ease), box-shadow var(--dur-fast, 70ms);
    box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000);
}
button.nscc-finance-card.nscc-overview-kpi:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--nscc-hard-shadow, #000000); }
button.nscc-finance-card.nscc-overview-kpi:active { transform: translateY(0); }
/* Two classes so this outranks the plain .modal-content-lg (500px) cap that
   ships in styles.css and loads after this file — same specificity would
   otherwise let load order decide, silently shrinking every glance drill-down
   (HR active people / states / leave pending / expenses pending, etc.). */
.modal-content-lg.nscc-glance-modal__content { max-width: min(720px, 96vw); }
.nscc-glance-modal__sub { margin: 0 1rem 0.5rem; }
.nscc-glance-modal__summary {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 1rem 0.75rem;
}
.nscc-glance-modal__stat {
    display: flex; flex-direction: column; gap: 0.1rem; min-width: 7rem;
    padding: 0.4rem 0.55rem; border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 8px; background: var(--bg-card);
}
.nscc-glance-modal__stat span { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-glance-modal__stat strong { font-size: 1.05rem; font-weight: 900; }
.nscc-glance-modal__stat--warn { border-color: #b45309; }
.nscc-glance-modal__filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    margin: 0 1rem 0.65rem; padding: 0.45rem 0.55rem;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 8px; background: var(--bg-card);
}
.nscc-glance-modal__filters[hidden] { display: none !important; }
.nscc-glance-modal__filters label {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
}
.nscc-glance-modal__filters select {
    padding: 0.3rem 0.45rem; border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 6px; font-size: 0.85rem; font-weight: 600;
    text-transform: none; letter-spacing: normal; color: var(--text);
}
.nscc-glance-modal__body { margin: 0 1rem 0.75rem; max-height: min(50vh, 420px); overflow: auto; }
.nscc-glance-modal__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 1rem 1rem; }
.nscc-glance-row-click { cursor: pointer; }
.nscc-glance-row-click:hover { background: var(--bg-elevated, var(--bg-card)); }
.nscc-glance-modal__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.5rem; margin: 0.5rem 0 0; padding: 0.5rem; border-top: 2px dashed var(--border); align-items: end; }
.nscc-glance-modal__form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-glance-modal__form input, .nscc-glance-modal__form select, .nscc-glance-modal__form textarea { padding: 0.35rem 0.5rem; border: 2px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.nscc-glance-modal__form button[type="submit"] { grid-column: 1 / -1; justify-self: end; }
.nscc-finance-card__label { display: block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.nscc-finance-card__value { font-size: 1.05rem; font-weight: 900; line-height: 1.2; }
.nscc-finance-card__value--compact { font-size: 1rem; }
.nscc-finance-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0 0 0.65rem; padding: 0.5rem 0.65rem; box-sizing: border-box; background: var(--bg-card); border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: var(--radius-md, 10px); }
.nscc-finance-ap-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .nscc-finance-ap-grid { grid-template-columns: 1fr 1fr; } }
.nscc-finance-ap-section h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.nscc-ap-form-grid, .nscc-ar-new-form .nscc-ap-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; margin: 0.5rem 0 1rem; align-items: end; }
.nscc-ap-form-grid label, .nscc-ar-new-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-ap-form-grid input, .nscc-ap-form-grid select, .nscc-ar-new-form input { padding: 0.35rem 0.5rem; border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 6px; font-size: 0.85rem; }
.nscc-ap-new-bill, .nscc-ar-new-form, .nscc-gl-manual-je { margin: 0 0 0.75rem; }
.nscc-manual-je-form label { display: block; margin: 0 0 0.5rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-manual-je-form input[type="text"] { width: 100%; padding: 0.35rem 0.5rem; border: 2px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.nscc-mje-line { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.5rem; margin: 0 0 0.35rem; }
.nscc-mje-line select, .nscc-mje-line input { padding: 0.35rem 0.5rem; border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 6px; font-size: 0.85rem; }
.nscc-finance-reports-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .nscc-finance-reports-grid { grid-template-columns: 1fr 1fr; } }
.nscc-report-total td { border-top: 2px solid var(--border); }
.nscc-report-runner { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 800px) { .nscc-report-runner { grid-template-columns: 1fr; } }
.nscc-report-catalog h3 { margin: 0 0 0.5rem; font-size: 0.9rem; }
.nscc-report-catalog-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 0.5rem 0.65rem; margin: 0 0 0.35rem; border: 2px solid var(--border); border-radius: 8px; background: var(--bg-card); cursor: pointer; }
.nscc-report-catalog-item.active { border-color: var(--brand); background: var(--bg-elevated, var(--bg-card)); }
.nscc-report-catalog-item__name { font-weight: 800; font-size: 0.82rem; }
.nscc-report-catalog-item__group { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.nscc-report-asof { display: block; margin-top: 0.75rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.nscc-report-asof input { display: block; width: 100%; margin-top: 0.25rem; padding: 0.35rem; border: 2px solid var(--border); border-radius: 6px; }
.nscc-report-preview-pane { min-width: 0; }
.nscc-report-preview-scroll { overflow: auto; max-height: 60vh; border: 2px solid var(--border); border-radius: 8px; padding: 0.5rem; background: var(--bg-card); }
.nscc-report-preview-head h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.nscc-report-preview-table { font-size: 0.75rem; }
.nscc-roundtrip-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0; padding: 0.5rem; border: 2px dashed var(--brand); border-radius: 8px; background: var(--bg-raised); }
.nscc-roundtrip-toolbar .nscc-file-btn { margin: 0; cursor: pointer; }
.nscc-roundtrip-preview { margin: 0.5rem 0 1rem; padding: 0.75rem; border: 2px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.nscc-roundtrip-preview h4 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.nscc-roundtrip-preview--error { border-color: #dc2626; background: rgba(220,38,38,0.06); }
.nscc-sod-override-box { margin: 0.5rem 0 0.75rem; padding: 0.65rem 0.75rem; border: 2px dashed var(--border); border-radius: 8px; background: var(--bg-card); }
.nscc-sod-override-label { display: flex; align-items: flex-start; gap: 0.4rem; font-size: 0.82rem; cursor: pointer; }
.nscc-sod-override-active { margin: 0.35rem 0 0.65rem; font-size: 0.78rem; }
.badge-warn { background: transparent; color: var(--text-primary); border: 4px solid #FF9500; border-radius: 8px; }
/* Global rule — every screen that renders a KPI tile row (Sales pipeline
   health, HR risks, Compliance credentials, Payroll, Acct dashboard,
   Executive Dashboard) uses .exec-kpi-grid and expects side-by-side tiles.
   Previously scoped to .exec-dash-shell, which left every other consumer
   stacking vertically. The .exec-dash-shell rule stays for its slightly
   tighter margin-bottom / gap tuning inside the Exec Dash. */
.exec-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.exec-dash-shell .exec-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
/* Cards blend with the theme background instead of forcing a bright white
   rectangle. Matt 2026-09-12: "none of the screens that have boxes should have
   the bright white backgrounds. they need to match the themes." Transparent
   lets each card inherit whatever its container / theme paints beneath. */
/* overflow:hidden so a colored child (sparkline area fill, colored value
   text, a nested colored border) can't bleed past the 8px rounded corners
   of the box. Same pattern used on .nscc-dash-aging-bar / .nscc-dash-cust-bar
   above. */
.exec-kpi-card { border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 8px; padding: 0.55rem 0.65rem; background: transparent; overflow: hidden; min-width: 0; }
.exec-kpi-card--brand { border-color: var(--nscc-line, #000000); }
.exec-kpi-card--positive .exec-kpi-card__value { color: #15803d; }
.exec-kpi-card--negative .exec-kpi-card__value { color: #b91c1c; }
.exec-kpi-card--accent-green .exec-kpi-card__value { color: #15803d; }
.exec-kpi-card--accent-blue .exec-kpi-card__value { color: #1d4ed8; }
.exec-kpi-card--warn { border-color: var(--nscc-line, #000000); }
.exec-kpi-card--link {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.exec-kpi-card--link:hover,
.exec-kpi-card--link:focus-visible {
    border-color: var(--nscc-line, #000000);
    box-shadow: 0 0 0 1px #000000;
    outline: none;
}
.exec-kpi-card--active {
    border-color: var(--nscc-line, #000000);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
    background: rgba(13, 148, 136, 0.06);
}
.exec-kpi-card__hint {
    margin-top: 0.3rem;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--brand);
}
.exec-kpi-card__label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); overflow-wrap: anywhere; min-width: 0; }
.exec-kpi-card__value { font-size: 1.35rem; font-weight: 900; line-height: 1.2; margin-top: 0.15rem; overflow-wrap: anywhere; min-width: 0; }
.exec-kpi-card__sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; overflow-wrap: anywhere; min-width: 0; }
.nscc-linkish {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--brand);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.nscc-linkish:hover,
.nscc-linkish:focus-visible { color: var(--brand-light, #14b8a6); outline: none; }
.nscc-row-flash,
.nscc-portal-row--flash {
    animation: nscc-row-flash-pulse 1.4s ease;
}
@keyframes nscc-row-flash-pulse {
    0% { background: rgba(13, 148, 136, 0.28); }
    100% { background: transparent; }
}
.exec-dash-section { margin: 0 0 1rem; }
.exec-dash-section__title { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 800; }
.exec-dash-shortcuts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 1rem; }
.exec-dash-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.exec-dash-filter label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.exec-dash-filter select { margin-left: 0.35rem; padding: 0.3rem 0.45rem; border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 6px; }
.exec-state-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.5rem; }
.exec-state-card { border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 8px; padding: 0.55rem 0.65rem; background: transparent; font-size: 0.78rem; overflow: hidden; min-width: 0; }
.exec-state-card__head { font-weight: 800; margin-bottom: 0.25rem; }
.exec-state-card__stats { display: flex; flex-wrap: wrap; gap: 0.5rem; color: var(--text-muted); font-size: 0.7rem; margin-bottom: 0.25rem; }
.exec-state-card__meta { font-size: 0.68rem; color: var(--text-muted); }
.exec-kpi-card__value-row { display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; min-width: 0; }
.nscc-payroll-estimate-banner {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.75rem;
    border: 2px solid var(--alert-banner-border, #fcd34d);
    border-radius: 8px;
    background: var(--alert-banner-bg, #fffbeb);
    color: var(--alert-banner-fg, #78350f);
    font-size: 0.78rem;
    line-height: 1.4;
}
.nscc-payroll-estimate-banner strong { font-weight: 800; }
.exec-pillar-ready {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}
.exec-pillar-ready__card {
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    background: var(--bg-card);
    overflow: hidden;
    min-width: 0;
}
.exec-pillar-ready__name {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.exec-pillar-ready__status {
    font-size: 0.95rem;
    font-weight: 900;
    margin-top: 0.15rem;
}
.exec-pillar-ready__status--ready { color: #15803d; }
.exec-pillar-ready__status--partial { color: #a16207; }
.exec-pillar-ready__note {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}
.exec-sparkline-wrap {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.1rem 0.15rem 0;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.03);
}
.exec-sparkline { width: 160px; height: 48px; display: block; shape-rendering: geometricPrecision; }
.exec-sparkline__area { fill-opacity: 0.18; }
.exec-sparkline__line { stroke-width: 2; }
.exec-sparkline__end { stroke: #fff; stroke-width: 1; }
.exec-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.65rem; }
.exec-chart-card { border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 8px; padding: 0.5rem 0.6rem; background: transparent; overflow: hidden; min-width: 0; }
.exec-chart-card__title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.35rem; }
.exec-chart-card--link {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.exec-chart-card--link:hover,
.exec-chart-card--link:focus-visible {
  border-color: var(--brand, #1c1917);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, #1c1917) 25%, transparent);
  outline: none;
}
.exec-chart-card__hint {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.exec-chart-svg { width: 100%; height: auto; display: block; shape-rendering: geometricPrecision; }
.exec-chart-label { font-size: 10px; fill: var(--text-muted, #64748b); font-family: monospace; }
.exec-chart-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; font-size: 0.65rem; color: var(--text-muted); }
.exec-chart-legend-item { display: inline-flex; align-items: center; gap: 0.25rem; }
.exec-drill-panel {
    margin-top: 1rem;
    padding: 0.85rem 1rem 1rem;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: 10px;
    background: var(--bg-card, #fff);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.exec-drill-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.exec-drill-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}
.exec-drill-panel__lead {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.exec-drill-panel__subtitle {
    margin: 0.85rem 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.exec-drill-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}


/* ============================================================
   FLAT / DATA-DENSE CONSOLE OVERRIDES (light + dark)
   Color stays on status chips, alerts, charts, graphs, maps.
   ============================================================ */

html, body,
.app-container,
.main-content,
.top-header,
.nscc-chrome-brand-row {
    background-image: none !important;
}

.card,
.panel,
.modal,
.modal-content,
.drawer,
.popover,
.dropdown-menu,
.job-card:not([data-trip-status]),
.trip-card,
.batch-card,
.gantt-alert-card,
.timeline-pending-trip,
.nscc-kpi-card,
.finance-card,
.overview-card {
    box-shadow: none !important;
    border-radius: 0 !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-color: var(--nscc-line, #000000) !important;
}
/* Modals: thicker frame than cards/panels */
.modal-content,
.trip-modal-content {
    border-width: 4px !important;
}
:root.dark .card,
:root.dark .panel,
:root.dark .drawer,
:root.dark .popover,
:root.dark .dropdown-menu,
:root.dark .batch-card,
:root.dark .trip-card,
:root.dark .job-card:not([data-trip-status]),
:root.dark .gantt-alert-card,
:root.dark .timeline-pending-trip,
:root.dark .nscc-kpi-card,
:root.dark .finance-card,
:root.dark .overview-card,
body.dark-theme .card,
body.dark-theme .panel,
body.dark-theme .drawer,
body.dark-theme .popover,
body.dark-theme .dropdown-menu,
body.dark-theme .batch-card,
body.dark-theme .trip-card,
body.dark-theme .job-card:not([data-trip-status]),
body.dark-theme .gantt-alert-card,
body.dark-theme .timeline-pending-trip,
body.dark-theme .nscc-kpi-card,
body.dark-theme .finance-card,
body.dark-theme .overview-card {
    border-color: rgba(245, 245, 244, 0.68) !important;
    background: transparent !important;
    background-color: transparent !important;
}
/* Dark modals: solid panel + dimmed scrim (never clear glass) */
:root.dark .modal,
body.dark-theme .modal {
    background: rgba(0, 0, 0, 0.55) !important;
    background-color: rgba(0, 0, 0, 0.55) !important;
}
:root.dark .modal-content,
:root.dark .trip-modal-content,
body.dark-theme .modal-content,
body.dark-theme .trip-modal-content {
    border-width: 4px !important;
    border-color: rgba(245, 245, 244, 0.68) !important;
    background: var(--bg-card, #1c1c1b) !important;
    background-color: var(--bg-card, #1c1c1b) !important;
}

.job-card:hover,
.trip-card:hover,
.batch-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--nscc-line, #000000) !important;
}
:root.dark .job-card:hover,
:root.dark .trip-card:hover,
:root.dark .batch-card:hover,
body.dark-theme .job-card:hover,
body.dark-theme .trip-card:hover,
body.dark-theme .batch-card:hover {
    border-color: rgba(245, 245, 244, 0.85) !important;
}

/* Tables — denser rows, hairline rules */
table,
.data-table,
.nscc-table,
.master-table,
.nscc-table {
    border-collapse: collapse;
    font-size: var(--dense-font);
}

table th,
table td,
.data-table th,
.data-table td,
.nscc-table th,
.nscc-table td,
.master-table th,
.master-table td,
.nscc-table th,
.nscc-table td {
    padding: var(--dense-pad-y) var(--dense-pad-x) !important;
    border-color: var(--border) !important;
    line-height: 1.25;
}

table th,
.data-table th,
.nscc-table th,
.master-table th,
.nscc-table th {
    font-size: var(--dense-font-sm);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--table-head-bg, var(--bg-sunken)) !important;
    color: var(--text-secondary);
}

/* Chrome / nav — flat zinc, not earth folder gold */
.nscc-folder-tab,
.folder-tab,
.pulse-folder-tab,
[class*="folder-tab"] {
    background: var(--chrome-folder) !important;
    color: var(--chrome-folder-ink) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    box-shadow: none !important;
}

.nscc-folder-tab.active,
.folder-tab.active,
.pulse-folder-tab.active,
[class*="folder-tab"].active {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--bg-card) !important;
}

/* Inputs — 1px theme hairline. Native <select> keeps 2px black (select rules above
   + styles.css); do not pull dropdowns back to --border. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
textarea,
.form-control:not(select),
.form-control-panel:not(select),
.select-toolbar,
.nscc-search-input,
.search-input,
.input {
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: var(--dense-font);
}

input:focus,
textarea:focus,
.form-control:not(select):focus,
.form-control-panel:not(select):focus,
.input:focus {
    border-color: var(--border-focus) !important;
    outline: none;
    box-shadow: var(--shadow-glow-brand) !important;
}

/* Neutral chrome badges stay muted; status/trip chips keep color */
.badge:not([class*="status"]):not(.trip-status):not(.job-status):not(.ref-status-pill),
.mode-badge,
.chip:not([class*="status"]):not(.ops-chip),
.tag:not([class*="status"]) {
    background: var(--bg-sunken) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    font-weight: 600;
}

/* Status / alert / ops chips — transparent fill, black text, colored border */
.status,
.status-chip,
.status-badge,
.trip-status,
.job-status,
.ref-status-pill,
.ops-chip,
[class*="status-"] {
    border-radius: 8px !important;
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    box-shadow: none !important;
    font-weight: 700;
}

/* Header / ticker — flat strip (light chrome banner stays granite) */
.top-header,
.ticker-strip,
#ticker-container,
.nscc-ticker {
    background: var(--bg-card) !important;
    border: none !important;
    box-shadow: none !important;
}
html:not(.dark) body:not(.dark-theme) .nscc-chrome-brand-row,
body:not(.dark-theme) .nscc-chrome-brand-row {
    background: var(--banner-bg, var(--chrome-brand-row-bg, #e4e4e7)) !important;
    border: none !important;
    box-shadow: none !important;
}
:root.dark .nscc-chrome-brand-row,
body.dark-theme .nscc-chrome-brand-row {
    background: var(--banner-bg, var(--bg-card)) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Left / top nav */
.nav-item,
.top-tab,
.sidebar-item,
.nscc-nav-item {
    border-radius: var(--radius-sm) !important;
}

/* Kill leftover warm-earth hardcodes when tokens already apply */
:root.dark body,
body.dark-theme {
    background-color: var(--bg-page);
    color: var(--text-primary);
}

/* Ops alert / jeopardy banners — purple signal color (allowed) */
.nscc-ops-alert,
.nscc-pulse-alert,
.connectivity-banner.warn,
.banner-warn,
[class*="pulse"][class*="alert"],
.alert-banner {
    background: var(--alert-banner-bg) !important;
    color: var(--alert-banner-fg) !important;
    border: 1px solid var(--alert-banner-border) !important;
    box-shadow: none !important;
    border-radius: var(--radius-sm) !important;
}


/* ==========================================================================
   Action buttons — muted gray/black fill (darker than info boxes);
   success / warning / danger / frost keep transparent + status borders.
   ========================================================================== */
html body .btn.btn-primary,
html body .btn.btn-secondary,
html body .btn.btn-ghost,
html body .btn.btn-outline-primary,
html body .btn.btn-strong,
html body .view-section .btn-primary,
html body .view-section .nscc-action-btn,
html body .view-section .st-pdf-btn,
html body .view-section .btn[class*="pdf"],
html body button.btn[onclick*="saveToPdf"],
html body button.btn[onclick*="print"],
html body button.btn[onclick*="Print"],
html body button.btn[onclick*="submit"],
html body button.btn[onclick*="Submit"] {
    background: var(--btn-surface) !important;
    background-color: var(--btn-surface) !important;
    color: var(--btn-surface-ink) !important;
    border: var(--nscc-line-w, 2.5px) solid var(--nscc-line, #000000) !important;
    box-shadow: none !important;
}
html body .btn.btn-primary:hover,
html body .btn.btn-secondary:hover,
html body .btn.btn-ghost:hover,
html body .btn.btn-outline-primary:hover,
html body .btn.btn-strong:hover,
html body .view-section .btn-primary:hover,
html body .view-section .nscc-action-btn:hover,
html body .view-section .st-pdf-btn:hover,
html body .view-section .btn[class*="pdf"]:hover {
    background: var(--btn-surface-hover) !important;
    background-color: var(--btn-surface-hover) !important;
}
:root.dark .btn.btn-primary,
:root.dark .btn.btn-secondary,
:root.dark .btn.btn-ghost,
:root.dark .btn.btn-outline-primary,
:root.dark .btn.btn-strong,
body.dark-theme .btn.btn-primary,
body.dark-theme .btn.btn-secondary,
body.dark-theme .btn.btn-ghost,
body.dark-theme .btn.btn-outline-primary,
body.dark-theme .btn.btn-strong,
:root.dark .view-section .btn-primary,
:root.dark .view-section .nscc-action-btn,
:root.dark .view-section .st-pdf-btn,
body.dark-theme .view-section .btn-primary,
body.dark-theme .view-section .nscc-action-btn,
body.dark-theme .view-section .st-pdf-btn {
    border-color: var(--nscc-line, #ffffff) !important;
}
html body .btn.btn-success,
html body .btn.btn-warning,
html body .btn.btn-danger,
html body .btn.btn-frost,
html body .btn.btn-submit-schedule,
html body button.btn[onclick*="cancel"],
html body button.btn[onclick*="Cancel"],
html body button.btn[onclick*="signOut"],
html body button.btn[onclick*="SignOut"] {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
html body .btn.btn-success {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #34C759 !important;
}
html body .btn.btn-warning {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #FF9500 !important;
}
html body .btn.btn-danger,
html body button.btn[onclick*="signOut"],
html body button.btn[onclick*="Cancel"],
html body button.btn[onclick*="cancel"] {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #FF3B30 !important;
}
html body .btn.btn-frost,
html body .btn.btn-submit-schedule {
    color: var(--text-primary) !important;
    border: 2.5px solid var(--frost-blue-deep, #1c1917) !important;
}
:root.dark .btn.btn-success,
body.dark-theme .btn.btn-success {
    color: #ffffff !important;
    border-color: #22c55e !important;
}
:root.dark .btn.btn-danger,
body.dark-theme .btn.btn-danger {
    color: #ffffff !important;
    border-color: #f87171 !important;
}


/* Table row hover / selected — zinc washes (never baby/sky blue fills) */
.view-section table tbody tr:hover > td,
.view-section .data-table tbody tr:hover > td,
.nscc-table tbody tr:hover > td,
.master-data-table tbody tr:hover > td,
.data-table tr:hover td {
    background: var(--table-row-hover, var(--info-wash, #f4f4f5)) !important;
}
.view-section table tbody tr.is-selected > td,
.view-section table tbody tr.selected > td,
.nscc-table tbody tr.is-selected > td,
.nscc-table tbody tr.selected > td,
.master-data-table tbody tr.is-selected > td,
.master-data-table tbody tr.selected > td,
.data-table tr.is-selected td,
.data-table tr.selected td,
.nscc-hr-state-row.is-selected,
.custom-export-history-row--selected {
    background: var(--table-row-selected, #e5e7eb) !important;
}
:root.dark .view-section table tbody tr.is-selected > td,
:root.dark .nscc-table tbody tr.is-selected > td,
body.dark-theme .view-section table tbody tr.is-selected > td,
body.dark-theme .nscc-table tbody tr.is-selected > td,
:root.dark .nscc-hr-state-row.is-selected,
body.dark-theme .nscc-hr-state-row.is-selected {
    background: var(--table-row-selected, #3f3f46) !important;
}

/* ── Customize mode (assets/nscc-customize.js, feature-flag gated) ──
   Edit-mode chrome for reordering dashboard tiles. Slice 1: KPI row on the
   Accounting Overview only. Flat / high-contrast to match the console look —
   the accent border and the dashed drop target come from the console's
   existing 2px-solid-black stroke vocabulary, not from a new color system. */
.nscc-customize-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 var(--nscc-pad-sm, 0.35rem);
}
.nscc-customize-toggle {
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.3rem 0.7rem;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000);
    transition: transform var(--dur-fast, 70ms) var(--ease-out, ease),
                box-shadow var(--dur-fast, 70ms),
                background var(--dur-fast, 70ms);
}
.nscc-customize-toggle:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--nscc-hard-shadow, #000000); }
.nscc-customize-toggle:active { transform: translateY(0); box-shadow: 1px 1px 0 var(--nscc-hard-shadow, #000000); }
.nscc-customize-toggle--on {
    background: #fef3c7;   /* amber-100, high-contrast on the flat console ground */
    color: #78350f;
}
:root.dark .nscc-customize-toggle,
body.dark-theme .nscc-customize-toggle {
    border-color: #f4f4f5;
    box-shadow: 2px 2px 0 #f4f4f5;
}
:root.dark .nscc-customize-toggle--on,
body.dark-theme .nscc-customize-toggle--on {
    background: #7c2d12;
    color: #fef3c7;
}

/* Grid gets a subtle dashed frame while editing so the user sees the region
   that's now interactive. No layout shift — outline stays outside the box. */
body.nscc-customize-active .nscc-dash-kpi-grid[data-nscc-customize-screen] {
    outline: 2px dashed #d97706;
    outline-offset: 4px;
    border-radius: 6px;
}
/* Grab cursor on every draggable tile. Locked tiles (slice 4+) never get
   draggable=true, so this styling never touches them. */
body.nscc-customize-active .nscc-dash-kpi[draggable="true"] { cursor: grab; }
body.nscc-customize-active .nscc-dash-kpi[draggable="true"]:active { cursor: grabbing; }
/* Ghost the tile being carried so the drop target reads clearly. */
.nscc-dash-kpi.nscc-customize-dragging { opacity: 0.35; }
/* Drop target — thicker outline, kept inside the box so tiles don't shift. */
.nscc-dash-kpi.nscc-customize-drop-target {
    outline: 2px dashed #d97706;
    outline-offset: -2px;
}
/* A little "you can drag me" affordance in the bottom-right of each tile.
   Only shows in edit mode. Uses ::after so no extra DOM. */
body.nscc-customize-active .nscc-dash-kpi[draggable="true"]::after {
    content: "⋮⋮";
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
    letter-spacing: -1px;
    pointer-events: none;
}
/* Hide affordance — a ✕ span injected by nscc-customize.js on each tile in
   edit mode. Positioned top-right, absolutely, on top of the .nscc-dash-kpi
   button. Own pointerdown+click to keep the parent button silent. */
.nscc-customize-hide {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    display: none;   /* only visible inside edit mode via body class below */
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    color: #78350f;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 1px 1px 0 var(--nscc-hard-shadow, #000000);
    z-index: 2;
    user-select: none;
}
body.nscc-customize-active .nscc-customize-hide { display: inline-flex; }
.nscc-customize-hide:hover {
    background: #b91c1c;
    color: #fff;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000);
}
:root.dark .nscc-customize-hide,
body.dark-theme .nscc-customize-hide {
    background: #7c2d12;
    color: #fef3c7;
    border-color: #f4f4f5;
    box-shadow: 1px 1px 0 #f4f4f5;
}

/* Restore strip — a row of chips just below the KPI grid, only shown in
   edit mode when there is at least one hidden tile. */
.nscc-customize-restore {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    margin: 0 0 var(--nscc-pad-sm, 0.35rem);
    background: var(--bg-card);
    border: 2px dashed #d97706;
    border-radius: 6px;
}
.nscc-customize-restore-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-right: 4px;
}
.nscc-customize-restore-btn {
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 1px 1px 0 var(--nscc-hard-shadow, #000000);
}
.nscc-customize-restore-btn:hover {
    background: #d7f5e2;
    color: #14532d;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000);
}
:root.dark .nscc-customize-restore-btn,
body.dark-theme .nscc-customize-restore-btn {
    border-color: #f4f4f5;
    box-shadow: 1px 1px 0 #f4f4f5;
}
/* The tile is a <button> — needs position:relative for the ::after anchor. */
.nscc-dash-kpi { position: relative; }

/* Toast — bottom-center pill, appears only during customize actions. */
.nscc-customize-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(60px);
    background: #111827;
    color: #f4f4f5;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: transform var(--dur-fast, 180ms) var(--ease-out, ease),
                opacity var(--dur-fast, 180ms);
    pointer-events: none;
    z-index: 10000;
    max-width: 90vw;
    text-align: center;
}
.nscc-customize-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
:root.dark .nscc-customize-toast,
body.dark-theme .nscc-customize-toast {
    background: #f4f4f5;
    color: #111827;
}
@media (prefers-reduced-motion: reduce) {
    .nscc-customize-toggle,
    .nscc-customize-toast { transition: opacity var(--dur-fast, 180ms); }
    .nscc-customize-toggle:hover { transform: none; }
}

/* Integrations catalog modal (nscc-integrations-modal.js). A browsable list
   of every ERP / accounting / HR / payroll / etc. system NSCC talks to. */
.nscc-int-modal-host { position: fixed; inset: 0; z-index: 9500; }
.nscc-int-modal__backdrop {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(2px);
}
.nscc-int-modal {
    position: absolute; top: 5vh; left: 50%; transform: translateX(-50%);
    width: min(920px, 94vw); max-height: 90vh; overflow: auto;
    background: var(--bg-card, #fff); color: var(--text-primary, #111827);
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); border-radius: 12px;
    box-shadow: 6px 6px 0 var(--nscc-hard-shadow, #000000); padding: 1.25rem 1.5rem;
}
.nscc-int-modal__head { position: relative; margin-bottom: 0.85rem; }
.nscc-int-modal__title { margin: 0 0 0.25rem; font-size: 1.1rem; font-weight: 800; }
.nscc-int-modal__sub { margin: 0 3rem 0 0; font-size: 0.78rem; color: var(--text-muted, #6b7280); }
.nscc-int-modal__close {
    position: absolute; top: -0.5rem; right: -0.75rem;
    border: var(--nscc-line-w, 2px) solid var(--nscc-line, #000000); background: var(--bg-card); color: var(--text-primary);
    width: 2rem; height: 2rem; border-radius: 50%; font-size: 1.35rem; line-height: 1; cursor: pointer;
    box-shadow: 2px 2px 0 var(--nscc-hard-shadow, #000000);
}
.nscc-int-modal__close:hover { background: var(--bg-raised); }
.nscc-int-modal__toolbar {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0 0.75rem;
    border-bottom: 1px solid var(--border, #d4d4d8); margin-bottom: 0.75rem;
}
.nscc-int-modal__filter {
    flex: 1 1 auto; padding: 0.4rem 0.6rem;
    border: 1px solid var(--border, #d4d4d8); border-radius: 6px; font: inherit;
}
.nscc-int-modal__count { flex: 0 0 auto; font-size: 0.75rem; color: var(--text-muted, #6b7280); }
.nscc-int-cat { margin-bottom: 1rem; }
.nscc-int-cat__head {
    display: flex; align-items: baseline; gap: 0.5rem;
    padding: 0.35rem 0 0.35rem; border-bottom: 1px solid var(--border, #d4d4d8); margin-bottom: 0.5rem;
}
.nscc-int-cat__title { margin: 0; font-size: 0.9rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.nscc-int-cat__count { font-size: 0.7rem; color: var(--text-muted, #6b7280); }
.nscc-int-cat__hint { margin: 0 0 0.4rem; font-size: 0.72rem; color: var(--text-muted, #6b7280); }
.nscc-int-cat__rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.5rem; }
.nscc-int-row {
    border: 1px solid var(--border, #d4d4d8); border-radius: 8px; padding: 0.5rem 0.65rem; background: var(--bg-raised, #fff);
}
.nscc-int-row__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.2rem; }
.nscc-int-row__name { font-weight: 800; font-size: 0.85rem; }
.nscc-int-row__meta { font-size: 0.68rem; color: var(--text-muted, #6b7280); margin-bottom: 0.25rem; }
.nscc-int-row__hint { margin: 0 0 0.3rem; font-size: 0.72rem; }
.nscc-int-row__actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.nscc-int-doc-link { font-size: 0.72rem; color: var(--text-link, #2563eb); text-decoration: none; }
.nscc-int-doc-link:hover { text-decoration: underline; }
.nscc-int-row__btn {
    font: inherit; font-size: 0.68rem; font-weight: 800; padding: 0.2rem 0.55rem;
    border-radius: 6px; border: 1px solid var(--nscc-line, #000000); cursor: pointer; letter-spacing: 0.02em;
}
.nscc-int-row__btn--primary   { background: #14532d; color: #ecfccb; }
.nscc-int-row__btn--secondary { background: #e5e7eb; color: #111827; }
.nscc-int-row__btn--danger    { background: #7f1d1d; color: #fee2e2; }
.nscc-int-row__btn:hover { filter: brightness(1.08); }
.nscc-int-row__intent {
    display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.4rem;
    font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
    border-radius: 999px; border: 1px dashed var(--nscc-line, #000000);
}
.nscc-int-row__intent--connected    { background: #dcfce7; color: #14532d; border-style: solid; }
.nscc-int-row__intent--suggested    { background: #fef3c7; color: #78350f; }
.nscc-int-row__intent--sandbox-on   { background: #dbeafe; color: #1e3a8a; }
.nscc-int-status {
    display: inline-block; padding: 0.05rem 0.4rem; font-size: 0.62rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.05em; border-radius: 999px; border: 1px solid var(--nscc-line, #000000);
}
.nscc-int-status--live    { background: #dcfce7; color: #14532d; }
.nscc-int-status--beta    { background: #fef9c3; color: #713f12; }
.nscc-int-status--planned { background: #e5e7eb; color: #374151; }
.nscc-int-status--sandbox { background: #dbeafe; color: #1e3a8a; }
:root.dark .nscc-int-modal,
body.dark-theme .nscc-int-modal { border-color: var(--nscc-line, #ffffff); box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.55); }
:root.dark .nscc-int-row,
body.dark-theme .nscc-int-row { background: var(--bg-raised, #1a1a1a); border-color: rgba(148, 163, 184, 0.5); }
:root.dark .nscc-int-modal__close,
body.dark-theme .nscc-int-modal__close { background: #1a1a1a; color: #f4f4f5; border-color: var(--nscc-line, #ffffff); }
@media print { .nscc-int-modal-host { display: none !important; } }


/* ============================================================================
   THEMED SURFACE LAYER — applies only when a theme is chosen (data-nscc-theme).

   Routes the chrome the twelve themes are built around — banner, ticker,
   sidebar, logo, folder tabs, widgets, KPI tiles, filter bar, form controls
   and buttons — through the theme tokens instead of the hard-coded zinc,
   2px #000 borders and hard offset shadows those components carry in
   styles.css. Unthemed pages (no data-nscc-theme) are untouched.

   Every rule is prefixed `html[data-nscc-theme] body:not(#_)` and marked
   !important. styles.css loads after this file and many of its rules are
   themselves !important, some keyed to .dark at (0,3,0) or to element ids, so
   the rule needs both. `:not(#_)` matches every body (no element has id "_")
   and exists only to add one id's worth of specificity; it lets the theme win
   without rewriting hundreds of rules in styles.css.
   CSS only — no markup or behaviour depends on anything here.
   ============================================================================ */
html[data-nscc-theme], html[data-nscc-theme] body:not(#_) {
    --ui-radius: 8px;
    --ui-radius-sm: 6px;
    --ui-shadow: rgba(15, 23, 42, 0.08);
    --ui-elev-1: 0 1px 2px var(--ui-shadow), 0 1px 3px var(--ui-shadow);
    --ui-font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    --ui-mono: "IBM Plex Mono", ui-monospace, monospace;
    --chrome-logo-box-bg: var(--chrome-bg);
    --chrome-brand-row-bg: var(--chrome-bg);
    --ticker-bar-gray: var(--chrome-bg);
    --ticker-bar-ink: var(--chrome-ink);
}
html.dark[data-nscc-theme], html[data-nscc-theme] body.dark-theme { --ui-shadow: rgba(0, 0, 0, 0.35); }

/* ---- 2. Surface language ------------------------------------------------ */
html[data-nscc-theme] body,
html[data-nscc-theme] body:not(#_) .app-container,
html[data-nscc-theme] body:not(#_) #live-ops-container,
html[data-nscc-theme] body:not(#_) .main-content { background: var(--bg-page) !important; color: var(--text-primary) !important; font-family: var(--ui-font) !important; }

/* Header: one calm bar, no boxed widgets */
html[data-nscc-theme] body:not(#_) .top-header { background: var(--bg-card) !important; border-bottom: 1px solid var(--border) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-row { background: var(--bg-card) !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-mark,
html[data-nscc-theme] body:not(#_) .user-profile { background: transparent !important; border: 1px solid transparent !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-mark img { filter: none; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-name { color: var(--text-primary) !important; letter-spacing: .06em; font-weight: 700 !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-sub,
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-sub svg text { color: var(--text-muted) !important; fill: var(--text-muted) !important; }

/* Clocks: quiet tabular figures instead of yellow-highlighted boxes */
html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone { background: var(--bg-raised) !important; border: 1px solid var(--border) !important; border-radius: var(--ui-radius-sm) !important; box-shadow: none !important; padding: 3px 10px !important; }
html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone-time,
html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone-time * { font-family: var(--ui-mono) !important; font-weight: 500 !important; background: transparent !important; color: var(--text-primary) !important; font-variant-numeric: tabular-nums; box-shadow: none !important; border: 0 !important; padding: 0 !important; }
html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone-time-ampm { color: var(--text-muted) !important; margin-left: 2px; }
html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone-name { color: var(--text-muted) !important; font-weight: 600 !important; letter-spacing: .06em; font-size: 10px !important; }

/* Ticker */
html[data-nscc-theme] body:not(#_) .dispatch-ticker { background: var(--bg-card) !important; color: var(--text-muted) !important; border-bottom: 1px solid var(--border) !important; }
html[data-nscc-theme] body:not(#_) .ticker-seg { background: var(--bg-raised) !important; border: 1px solid var(--border) !important; border-radius: 999px !important; color: var(--text-secondary) !important; font-weight: 500 !important; font-style: normal !important; }

/* Sidebar */
html[data-nscc-theme] body:not(#_) .nscc-app-sidebar { background: var(--chrome-bg) !important; border-right: 1px solid var(--border) !important; }
html[data-nscc-theme] body:not(#_) .nscc-app-nav-main { background: transparent !important; box-shadow: none !important; color: var(--text-muted) !important; border-radius: var(--ui-radius-sm) !important; }
html[data-nscc-theme] body:not(#_) .nscc-app-nav-main:hover { background: var(--bg-sunken) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) .nscc-app-nav-main.is-current { background: var(--accent-soft) !important; color: var(--accent) !important; box-shadow: inset 3px 0 0 var(--accent) !important; }

/* Folder tabs: text tabs with an accent underline; the selected label is always legible */
html[data-nscc-theme] body:not(#_) .nscc-chrome-folder-tabs { background: var(--bg-page) !important; }
html[data-nscc-theme] body:not(#_) .nscc-erp-tab-btn { font-family: var(--ui-font) !important; font-weight: 500 !important; font-size: 12.5px !important; background: var(--bg-raised) !important; color: var(--text-secondary) !important; border: 1px solid var(--border-strong) !important; border-bottom: 0 !important; border-radius: 8px 8px 0 0 !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .nscc-erp-tab-btn:hover { background: var(--bg-sunken) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) .nscc-erp-tab-btn.active { background: var(--bg-card) !important; color: var(--text-primary) !important; border-color: var(--border-strong) !important; font-weight: 600 !important; box-shadow: inset 0 2px 0 var(--accent) !important; }
html[data-nscc-theme] body:not(#_) .nscc-tab-group__label { color: var(--text-muted) !important; font-weight: 600 !important; letter-spacing: .08em; }

/* Filter bar */
html[data-nscc-theme] body:not(#_) .daily-pulse-controls { background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: var(--ui-radius) !important; box-shadow: var(--ui-elev-1) !important; }
html[data-nscc-theme] body:not(#_) .daily-pulse-controls label,
html[data-nscc-theme] body:not(#_) .daily-pulse-controls .pulse-filter-label { color: var(--text-muted) !important; font-weight: 600 !important; letter-spacing: .06em; }

/* Form controls: one face, one height, 1px borders */
html[data-nscc-theme] body:not(#_) select,
html[data-nscc-theme] body:not(#_) input[type="text"],
html[data-nscc-theme] body:not(#_) input[type="date"],
html[data-nscc-theme] body:not(#_) input[type="search"] { font-family: var(--ui-font) !important; font-weight: 500 !important; background-color: var(--bg-card) !important; color: var(--text-primary) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--ui-radius-sm) !important; box-shadow: none !important; }
/* Daily Pulse's two filters were 10px monospace; they read at body size now. */
html[data-nscc-theme] body:not(#_) .daily-pulse-controls select { font-size: 13px !important; }
html[data-nscc-theme] body:not(#_) select:focus, html[data-nscc-theme] body:not(#_) input:focus { outline: 2px solid var(--accent) !important; outline-offset: 1px; }

/* Buttons: primary = accent, everything else = quiet secondary */
html[data-nscc-theme] body:not(#_) .daily-pulse-refresh-btn,
html[data-nscc-theme] body:not(#_) .btn-primary { font-family: var(--ui-font) !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important; border-radius: var(--ui-radius-sm) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .daily-pulse-refresh-btn { background: var(--accent) !important; color: var(--accent-ink) !important; border: 1px solid var(--accent) !important; }
html[data-nscc-theme] body:not(#_) .btn-primary { background: var(--accent) !important; color: var(--accent-ink) !important; border: 1px solid var(--accent) !important; }
/* Daily Pulse's filter bar already has its primary action (Refresh); its PDF
   export is a secondary action, so it takes the quiet outline there. */
html[data-nscc-theme] body:not(#_) .daily-pulse-controls .btn-primary { background: var(--bg-card) !important; color: var(--text-primary) !important; border: 1px solid var(--border-strong) !important; }
html[data-nscc-theme] body:not(#_) .nscc-date-nav__today,
html[data-nscc-theme] body:not(#_) .nscc-date-nav button,
html[data-nscc-theme] body:not(#_) .pulse-date-picker-pill { font-family: var(--ui-font) !important; font-weight: 600 !important; background: var(--bg-card) !important; color: var(--text-primary) !important; border: 1px solid var(--border-strong) !important; box-shadow: none !important; }

/* Widgets */
html[data-nscc-theme] body:not(#_) .exec-widget { background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: 10px !important; box-shadow: var(--ui-elev-1) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) .exec-widget__head { border-bottom: 1px solid var(--border) !important; }
html[data-nscc-theme] body:not(#_) .exec-widget__title { font-size: 15px !important; font-weight: 600 !important; color: var(--text-primary) !important; letter-spacing: -.005em; }
html[data-nscc-theme] body:not(#_) .exec-widget__head button,
html[data-nscc-theme] body:not(#_) .exec-widget__head [class*="badge"],
html[data-nscc-theme] body:not(#_) .exec-widget__highlight-toggle { color: var(--text-muted) !important; border-color: var(--border) !important; background: transparent !important; box-shadow: none !important; }

/* KPI tiles: label, figure, note — no hard offset shadow */
html[data-nscc-theme] body:not(#_) .nscc-dash-kpi { background: var(--bg-raised) !important; border: 1px solid var(--border) !important; border-radius: var(--ui-radius) !important; box-shadow: none !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) .nscc-dash-kpi__label { color: var(--text-muted) !important; font-weight: 600 !important; letter-spacing: .06em; font-size: 10.5px !important; }
html[data-nscc-theme] body:not(#_) .nscc-dash-kpi__value { font-size: 26px !important; font-weight: 600 !important; color: var(--text-primary) !important; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
html[data-nscc-theme] body:not(#_) .nscc-dash-kpi * { color: inherit; }
html[data-nscc-theme] body:not(#_) .nscc-dash-kpi small, html[data-nscc-theme] body:not(#_) .nscc-dash-kpi__sub, html[data-nscc-theme] body:not(#_) .nscc-dash-kpi__note { color: var(--text-muted) !important; }

/* Frame, tab text, date field, header tool cluster */
html[data-nscc-theme] body:not(#_) .nscc-scroll-shell,
html[data-nscc-theme] body:not(#_) .views-container,
html[data-nscc-theme] body:not(#_) .main-content > * { border-color: var(--border) !important; }
html[data-nscc-theme] body:not(#_) .nscc-erp-tab-btn *, html[data-nscc-theme] body:not(#_) .nscc-erp-tab-btn.active * { color: inherit !important; background: transparent !important; }
html[data-nscc-theme] body:not(#_) .nscc-date-nav input,
html[data-nscc-theme] body:not(#_) .nscc-date-nav [class*="date"] { border: 1px solid var(--border-strong) !important; border-radius: var(--ui-radius-sm) !important; background: var(--bg-card) !important; color: var(--text-primary) !important; font-family: var(--ui-font) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .nscc-date-nav { border: 0 !important; background: transparent !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .dispatch-ticker * { font-style: normal !important; }
html[data-nscc-theme] body:not(#_) .top-header [class*="toggle"], html[data-nscc-theme] body:not(#_) .top-header [class*="quick"] { border-color: var(--border) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster { background: transparent !important; border: 0 !important; box-shadow: none !important; gap: 4px; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster .btn { background: var(--bg-raised) !important; border: 1px solid var(--border) !important; border-radius: var(--ui-radius-sm) !important; color: var(--text-secondary) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .ticker-label { background: transparent !important; color: var(--accent) !important; font-weight: 700 !important; letter-spacing: .08em; border: 0 !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) #live-ops-container.views-container { border: 1px solid var(--border) !important; border-radius: 10px 10px 0 0 !important; }
html[data-nscc-theme] body:not(#_) .nscc-date-nav__field { border: 1px solid var(--border-strong) !important; border-radius: var(--ui-radius-sm) !important; background: var(--bg-card) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .nscc-date-nav__text { font-family: var(--ui-font) !important; font-weight: 500 !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) .nscc-erp-tab-btn,
html[data-nscc-theme] body:not(#_) .nscc-erp-tab-btn.active { -webkit-text-fill-color: currentColor !important; outline: 0 !important; }
/* Every folder tab keeps its outline, selected or not, in every theme. */
/* Folder-tab strips (in-page sub-tabs and every modal: Admin Console, System
   Settings, trip details, employee center) end in the same 1px theme line the
   tabs are outlined with, instead of the 2px #000 rule in styles.css, and the
   selected tab sits over that line so it opens into its panel. */
html[data-nscc-theme] body:not(#_) .nscc-erp-tabs { border-bottom: 1px solid var(--border-strong) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .nscc-erp-tabs .nscc-erp-tab-btn.active { position: relative !important; margin-bottom: -1px !important; z-index: 1 !important; }

/* ---- 3. Coloured chrome: header, ticker and sidebar take the theme's identity ---- */
html[data-nscc-theme] body:not(#_) .top-header,
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-row { background: var(--chrome-bg) !important; color: var(--chrome-ink) !important; border-bottom-color: var(--chrome-line) !important; }
html[data-nscc-theme] body:not(#_) .dispatch-ticker { background: var(--chrome-bg) !important; color: var(--chrome-muted) !important; border-bottom: 1px solid var(--chrome-line) !important; }
html[data-nscc-theme] body:not(#_) .ticker-seg { background: var(--chrome-bg-2) !important; border-color: var(--chrome-line) !important; color: var(--chrome-ink) !important; }
html[data-nscc-theme] body:not(#_) .ticker-label { color: var(--chrome-accent) !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-name { color: var(--chrome-ink) !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-sub, html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-sub svg text { color: var(--chrome-muted) !important; fill: var(--chrome-muted) !important; }
html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone { background: var(--chrome-bg-2) !important; border-color: var(--chrome-line) !important; }
html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone-time, html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone-time * { color: var(--chrome-ink) !important; }
html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone-time-ampm, html[data-nscc-theme] body:not(#_) .nscc-header-clock-zone-name { color: var(--chrome-muted) !important; }
html[data-nscc-theme] body:not(#_) .top-header .nscc-header-clock-date, html[data-nscc-theme] body:not(#_) .top-header [class*="clock-date"], html[data-nscc-theme] body:not(#_) .top-header .user-info, html[data-nscc-theme] body:not(#_) .top-header .user-info *, html[data-nscc-theme] body:not(#_) .top-header a { color: var(--chrome-ink) !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster .btn { background: var(--chrome-bg-2) !important; border-color: var(--chrome-line) !important; color: var(--chrome-ink) !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster .btn svg, html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster .btn img { filter: none; color: var(--chrome-ink) !important; }
html[data-nscc-theme] body:not(#_) .nscc-app-sidebar { background: var(--chrome-bg) !important; border-right-color: var(--chrome-line) !important; }
html[data-nscc-theme] body:not(#_) .nscc-app-sidebar * { color: var(--chrome-muted); }
html[data-nscc-theme] body:not(#_) .nscc-app-nav-main { color: var(--chrome-muted) !important; }
html[data-nscc-theme] body:not(#_) .nscc-app-nav-main:hover { background: var(--chrome-bg-2) !important; color: var(--chrome-ink) !important; }
html[data-nscc-theme] body:not(#_) .nscc-app-nav-main.is-current { background: var(--chrome-bg-2) !important; color: var(--chrome-ink) !important; box-shadow: inset 3px 0 0 var(--chrome-accent) !important; }
html[data-nscc-theme] body:not(#_) .nscc-app-nav-main.is-current * { color: var(--chrome-ink) !important; }
html[data-nscc-theme] body:not(#_) .nscc-header-clock-sub { color: var(--chrome-muted) !important; -webkit-text-fill-color: currentColor !important; }
html[data-nscc-theme] body:not(#_) .ticker-label { -webkit-text-fill-color: currentColor !important; color: var(--chrome-accent) !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster .btn { background: transparent !important; border-color: transparent !important; filter: var(--chrome-icon-filter, brightness(0) invert(.93)); }
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster .btn:hover { filter: var(--chrome-icon-filter, brightness(0) invert(1)); opacity: 1; }

/* Light banners (Paper, Cloud): the logo tile keeps a hairline so it doesn't float */

/* ---- 4. Logo: same star-in-a-tile mark, recoloured to the banner ---------------
   The mark is drawn as a mask and painted with the banner's ink, so it is white on
   the dark banners and near-black on the light banners (White through Sand). The name follows the same ink. */
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-mark img {
  object-position: -9999px 0; background: var(--chrome-ink) !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; filter: none !important;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect x='3.5' y='3.5' width='93' height='93' rx='17' fill='none' stroke='%23000' stroke-width='7'/><g transform='translate%2815 15%29 scale%28.7%29'><path d='M50 0 L58 42 L100 50 L58 58 L50 100 L42 58 L0 50 L42 42 Z'/><path d='M50 25 L54 46 L75 50 L54 54 L50 75 L46 54 L25 50 L46 46 Z' fill-opacity='.6'/></g></svg>") center / contain no-repeat; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect x='3.5' y='3.5' width='93' height='93' rx='17' fill='none' stroke='%23000' stroke-width='7'/><g transform='translate%2815 15%29 scale%28.7%29'><path d='M50 0 L58 42 L100 50 L58 58 L50 100 L42 58 L0 50 L42 42 Z'/><path d='M50 25 L54 46 L75 50 L54 54 L50 75 L46 54 L25 50 L46 46 Z' fill-opacity='.6'/></g></svg>") center / contain no-repeat;
}
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-name { color: var(--chrome-ink) !important; -webkit-text-fill-color: currentColor !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-sub, html[data-nscc-theme] body:not(#_) .nscc-chrome-brand-sub svg text { color: var(--chrome-muted) !important; fill: var(--chrome-muted) !important; -webkit-text-fill-color: currentColor !important; }

/* Banner quick controls (alerts, preferences, mute, theme). styles.css lays
   them out as a 2x2 grid of 26px boxes with overflow hidden and a fixed 20px
   glyph, which clips the two-emoji preferences icon (👤⚙︎, 36px wide) on both
   sides. One row of buttons that grow to fit their glyph shows every icon
   whole. [hidden] buttons (Comms Hub when switched off) stay hidden. */
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster { display: flex !important; align-items: center !important; gap: 4px !important; padding: 0 !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster .btn:not([hidden]) { display: inline-flex !important; align-items: center !important; justify-content: center !important; width: auto !important; min-width: 30px !important; height: 30px !important; padding: 0 5px !important; overflow: visible !important; border-radius: var(--ui-radius-sm) !important; }
html[data-nscc-theme] body:not(#_) .nscc-chrome-icon-cluster .nscc-chrome-glyph { display: inline-flex !important; align-items: center !important; width: auto !important; height: auto !important; font-size: 16px !important; line-height: 1 !important; white-space: nowrap !important; }

/* ---- 5. Banner widgets (assets/nscc-banner-widgets.js) -------------------------
   The middle of the banner is a row of widgets the user picks and orders in My
   preferences: the clock, weather, live trips, alerts, connection and, when
   placed there, the LIVE ticker. The row is a grid of 12 equal cells; each
   widget spans a run of them (grid-column, set by the module) and fills it. Free
   cells show as dashed + boxes while the banner is pointed at or a widget is
   being dragged. The cards take the banner's own chrome tokens, so they follow
   every theme. */
/* The brand and the quick controls keep their natural width; the widgets take
   the space between them and wrap to a second line rather than run under
   either side (styles.dab8423a95.css's 1fr/auto/1fr let a wide middle collapse both). */
html body:not(#_) .nscc-chrome-brand-row { grid-template-columns: max-content minmax(0, 1fr) max-content !important; }
html body:not(#_) .nscc-banner-widgets { display: grid !important; grid-template-columns: repeat(12, minmax(0, 1fr)) !important; grid-auto-rows: minmax(44px, auto) !important; align-items: center !important; padding: 4px 0 6px !important; box-sizing: border-box !important; gap: 6px !important; width: 100% !important; min-width: 0 !important; justify-self: stretch !important; }
html body:not(#_) .nscc-banner-widgets > * { grid-row: 1 !important; min-width: 0 !important; }
html body:not(#_) .nscc-banner-widgets > .nscc-bw-off { display: none !important; }
html body:not(#_) .nscc-bw { position: relative !important; display: inline-flex !important; width: 100% !important; height: 44px !important; min-width: 0 !important; max-width: none !important; margin: 0 !important; padding: 0 !important; box-sizing: border-box !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 10px !important; background: var(--chrome-bg-2, #e4e4e7) !important; color: var(--chrome-ink, #18181b) !important; -webkit-text-fill-color: currentColor !important; box-shadow: none !important; }
html body:not(#_) .nscc-bw-main { display: inline-flex !important; flex: 1 1 auto !important; width: 100% !important; overflow: hidden !important; align-items: center !important; gap: 8px !important; height: 100% !important; min-width: 0 !important; margin: 0 !important; padding: 0 12px 0 10px !important; border: 0 !important; border-radius: 10px !important; background: transparent !important; color: inherit !important; -webkit-text-fill-color: currentColor !important; font: inherit !important; text-align: left !important; white-space: nowrap !important; box-shadow: none !important; cursor: default; }
html body:not(#_) button.nscc-bw-main { cursor: pointer; }
html body:not(#_) .nscc-bw:has(> button.nscc-bw-main:hover) { border-color: var(--chrome-accent, currentColor) !important; }
html body:not(#_) button.nscc-bw-main:focus-visible { outline: 2px solid var(--chrome-accent, #2563eb) !important; outline-offset: 2px !important; }
html body:not(#_) .nscc-bw.is-hot { border-color: var(--chrome-accent, currentColor) !important; box-shadow: inset 0 -2px 0 var(--chrome-accent, currentColor) !important; }
html body:not(#_) .nscc-bw-icon { font-size: 18px !important; line-height: 1 !important; flex: 0 0 auto; }
html body:not(#_) .nscc-bw-body { display: flex !important; flex-direction: column !important; min-width: 0 !important; line-height: 1.15 !important; }
html body:not(#_) .nscc-bw-value { font-size: 15px !important; font-weight: 800 !important; font-variant-numeric: tabular-nums; color: var(--chrome-ink, #18181b) !important; }
html body:not(#_) .nscc-bw-label { font-size: 10.5px !important; font-weight: 600 !important; color: var(--chrome-muted, #52525b) !important; overflow: hidden !important; text-overflow: ellipsis !important; max-width: 12rem; }
html body:not(#_) .nscc-bw--connection .nscc-bw-icon { color: #16a34a !important; font-size: 12px !important; }
html body:not(#_) .nscc-bw--connection.is-hot .nscc-bw-icon { color: #dc2626 !important; }

/* The demo environment's DEMO widget: red on black with a red border, the look of
   the old -DEMO / DEMO- flags beside the clock. The same in every theme — it is a
   warning, not decoration. */
html body:not(#_) .nscc-bw.nscc-bw--demo { background: #000000 !important; border: 2px solid #dc2626 !important; color: #dc2626 !important; }
html body:not(#_) .nscc-bw--demo .nscc-bw-main { justify-content: center !important; padding: 0 8px !important; }
html body:not(#_) .nscc-bw--demo .nscc-bw-icon, html body:not(#_) .nscc-bw--demo .nscc-bw-label { display: none !important; }
html body:not(#_) .nscc-bw--demo .nscc-bw-value { color: #dc2626 !important; -webkit-text-fill-color: #dc2626 !important; font-size: 0.95rem !important; font-weight: 900 !important; letter-spacing: 0.06em !important; }

/* US time zones, highlighted: the yellow hour some dispatchers want. The yellow is the
   point of this widget, so it stays yellow in every theme; the plain clocks never use it. */
html body:not(#_) .nscc-bw-zones { gap: 10px !important; padding: 0 10px !important; }
html body:not(#_) .nscc-bw-zone { display: inline-flex !important; flex-direction: column !important; align-items: center !important; line-height: 1.1 !important; }
html body:not(#_) .nscc-bw-zone-time { font-family: var(--ui-mono, ui-monospace, monospace) !important; font-size: 13px !important; font-weight: 600 !important; font-variant-numeric: tabular-nums; color: var(--chrome-ink, #18181b) !important; white-space: nowrap !important; }
html body:not(#_) .nscc-bw-hl { background: #ffeb3b !important; color: #1a1500 !important; -webkit-text-fill-color: #1a1500 !important; border-radius: 3px !important; padding: 0 3px !important; box-shadow: 0 0 0 1px rgba(255, 193, 7, .6) !important; }
html body:not(#_) .nscc-bw-zone-name { font-size: 9.5px !important; font-weight: 700 !important; letter-spacing: .06em !important; color: var(--chrome-muted, #52525b) !important; }

/* Widget controls — the dashboards' ✕ (hide) and ☰ (drag), on hover or keyboard focus. */
html body:not(#_) #nscc-header-clock-host { position: relative !important; }
html body:not(#_) .dispatch-ticker { position: relative; }
html body:not(#_) .nscc-bw-ctl { position: absolute !important; top: -7px !important; right: -7px !important; z-index: 5 !important; display: inline-flex !important; gap: 3px !important; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
html body:not(#_) [data-bw]:hover > .nscc-bw-ctl, html body:not(#_) [data-bw]:focus-within > .nscc-bw-ctl { opacity: 1; pointer-events: auto; }
html body:not(#_) .nscc-bw-drag, html body:not(#_) .nscc-bw-look-btn, html body:not(#_) .nscc-bw-size, html body:not(#_) .nscc-bw-more, html body:not(#_) .nscc-bw-hide { display: inline-flex !important; align-items: center !important; justify-content: center !important; width: 18px !important; height: 18px !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 50% !important; background: var(--chrome-bg, #fff) !important; color: var(--chrome-ink, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 700 10px/1 var(--font-sans, sans-serif) !important; box-shadow: none !important; }
html body:not(#_) .nscc-bw-drag { cursor: grab !important; border-radius: 4px !important; user-select: none; }
html body:not(#_) .nscc-bw-hide, html body:not(#_) .nscc-bw-look-btn { cursor: pointer !important; }
html body:not(#_) .nscc-bw-look-btn { font-size: 10px !important; }
html body:not(#_) .nscc-bw-look-btn:hover { border-color: var(--chrome-accent, currentColor) !important; }
/* ⋯ (Move to start / left / right — moving without dragging, 2026-10-05). */
html body:not(#_) .nscc-bw-more { cursor: pointer !important; border-radius: 4px !important; }
html body:not(#_) .nscc-bw-drag:focus-visible, html body:not(#_) .nscc-bw-more:focus-visible { border-color: var(--chrome-accent, currentColor) !important; outline: none !important; }
html body:not(#_) .nscc-bw-menu { position: absolute !important; top: 20px !important; right: 0 !important; z-index: 40 !important; display: flex !important; flex-direction: column !important; min-width: 9rem; padding: 3px !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 6px !important; background: var(--chrome-bg, #fff) !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important; }
html body:not(#_) .nscc-bw-menu-item { display: block !important; width: 100% !important; margin: 0 !important; padding: 0.35rem 0.55rem !important; border: 0 !important; border-radius: 4px !important; background: transparent !important; color: var(--chrome-ink, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 600 0.75rem/1.2 var(--font-sans, sans-serif) !important; text-align: left !important; white-space: nowrap; cursor: pointer; }
html body:not(#_) .nscc-bw-menu-item:hover, html body:not(#_) .nscc-bw-menu-item:focus { background: rgba(127, 127, 127, 0.18) !important; outline: none !important; }
html body:not(#_) [data-bw]:has(> .nscc-bw-ctl > .nscc-bw-menu) > .nscc-bw-ctl { opacity: 1; pointer-events: auto; z-index: 40 !important; }
html body:not(#_) .nscc-bw-size { cursor: pointer !important; width: auto !important; min-width: 18px !important; padding: 0 4px !important; border-radius: 9px !important; font-size: 9.5px !important; }
html body:not(#_) .nscc-bw-size:hover { border-color: var(--chrome-accent, currentColor) !important; }
html body:not(#_) .nscc-bw-hide:hover { border-color: var(--chrome-accent, currentColor) !important; }
/* Only widgets in the banner row move; the ticker in its top strip just hides. */
html body:not(#_) .dispatch-ticker:not(.nscc-bw-ticker) .nscc-bw-drag, html body:not(#_) .dispatch-ticker:not(.nscc-bw-ticker) .nscc-bw-size, html body:not(#_) .dispatch-ticker:not(.nscc-bw-ticker) .nscc-bw-more { display: none !important; }
html body:not(#_) .dispatch-ticker:not(.nscc-bw-ticker) > .nscc-bw-ctl { top: 50% !important; right: 6px !important; transform: translateY(-50%); }
/* Moving a widget: press anywhere on it and drag. It follows the pointer, lifted
   above the row; the cells it will land in light up under it (red: no room), and a
   widget it would swap with gets the same outline. */
html body:not(#_) #nscc-banner-widgets > [data-bw] { touch-action: none; }
html body:not(#_) .nscc-banner-widgets > .is-dragging { position: relative !important; z-index: 40 !important; opacity: .92 !important; box-shadow: 0 10px 24px rgba(0,0,0,.28) !important; transition: none !important; pointer-events: none; }
html.nscc-bw-dragging, html.nscc-bw-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
html body:not(#_) .nscc-banner-widgets > .nscc-bw-drop { grid-row: 1 !important; z-index: 3 !important; height: 44px !important; box-sizing: border-box !important; border: 2px dashed var(--chrome-accent, #2563eb) !important; border-radius: 10px !important; background: color-mix(in srgb, var(--chrome-accent, #2563eb) 20%, transparent) !important; pointer-events: none !important; }
html body:not(#_) .nscc-banner-widgets > .nscc-bw-drop.is-bad { border-color: #dc2626 !important; background: rgba(220, 38, 38, .16) !important; }
html body:not(#_) .nscc-banner-widgets > .nscc-bw-drop[hidden] { display: none !important; }
html body:not(#_) .nscc-banner-widgets > .is-drop-target { outline: 2px dashed var(--chrome-accent, #2563eb) !important; outline-offset: 2px !important; background: color-mix(in srgb, var(--chrome-accent, #2563eb) 14%, var(--chrome-bg-2, #e4e4e7)) !important; }
html body:not(#_) #nscc-banner-widgets > [data-bw]:not(.nscc-bw-ticker) { cursor: grab; }

/* A clock's own colors (🎨): text, background, and the zone row's hour highlight.
   Two ids in the selector so they win over the theme's clock-ink rules. */
html body:not(#_) #nscc-banner-widgets > [data-bw].bw-ink,
html body:not(#_) #nscc-banner-widgets > [data-bw].bw-ink *:not(.nscc-bw-ctl, .nscc-bw-ctl *, .nscc-bw-hl) { color: var(--bw-ink) !important; -webkit-text-fill-color: var(--bw-ink) !important; }
html body:not(#_) #nscc-banner-widgets > [data-bw].bw-ink .nscc-bw-label,
html body:not(#_) #nscc-banner-widgets > [data-bw].bw-ink .nscc-bw-zone-name { opacity: .8; }
html body:not(#_) #nscc-banner-widgets > [data-bw].bw-bg { background: var(--bw-bg) !important; border-radius: 10px !important; }
html body:not(#_) #nscc-banner-widgets > [data-bw].bw-bg > .nscc-header-clock { background: transparent !important; }
html body:not(#_) #nscc-banner-widgets > [data-bw].bw-hl .nscc-bw-hl { background: var(--bw-hl) !important; color: var(--bw-hl-ink, #1a1500) !important; -webkit-text-fill-color: var(--bw-hl-ink, #1a1500) !important; box-shadow: none !important; }

/* The clock settings panel, under its widget. */
html body:not(#_) .nscc-banner-widgets > .nscc-bw-look { position: absolute !important; top: 100% !important; left: calc((var(--bw-look-col, 1) - 1) / 12 * 100%) !important; z-index: 35 !important; display: flex !important; flex-direction: column !important; gap: 8px !important; width: 17.5rem !important; max-width: calc(100vw - 32px) !important; margin-top: 6px !important; padding: 10px !important; box-sizing: border-box !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 10px !important; background: var(--chrome-bg, #fff) !important; color: var(--chrome-ink, #18181b) !important; -webkit-text-fill-color: currentColor !important; box-shadow: 0 8px 22px rgba(0,0,0,.22) !important; font: 600 12px var(--font-sans, sans-serif) !important; cursor: default; }
html body:not(#_) .nscc-banner-widgets > .nscc-bw-look.is-right { left: auto !important; right: calc((12 - var(--bw-look-end, 12)) / 12 * 100%) !important; }
html body:not(#_) .nscc-bw-look-head { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 8px !important; }
html body:not(#_) .nscc-bw-look-title { font-weight: 800 !important; font-size: 12.5px !important; }
html body:not(#_) .nscc-bw-look-row { display: flex !important; flex-direction: column !important; gap: 4px !important; margin: 0 !important; }
html body:not(#_) .nscc-bw-look-name { font-size: 10.5px !important; letter-spacing: .04em !important; color: var(--chrome-muted, #52525b) !important; }
html body:not(#_) .nscc-bw-look-swatches { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 4px !important; }
html body:not(#_) .nscc-bw-swatch { width: 20px !important; height: 20px !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 50% !important; background: var(--sw, transparent) !important; box-shadow: none !important; cursor: pointer; }
html body:not(#_) .nscc-bw-swatch--default { width: auto !important; padding: 0 7px !important; border-radius: 10px !important; background: var(--chrome-bg-2, #e4e4e7) !important; color: var(--chrome-ink, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 700 10px/1 var(--font-sans, sans-serif) !important; }
html body:not(#_) .nscc-bw-swatch[aria-pressed="true"] { outline: 2px solid var(--chrome-accent, #2563eb) !important; outline-offset: 2px !important; }
html body:not(#_) .nscc-bw-look-pick { width: 26px !important; height: 22px !important; min-width: 0 !important; margin: 0 0 0 2px !important; padding: 0 !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 6px !important; background: transparent !important; cursor: pointer; }
html body:not(#_) .nscc-bw-look-style { width: 100% !important; font-size: 12px !important; padding: 3px 6px !important; }
html body:not(#_) .nscc-bw-look-checks { display: flex !important; gap: 14px !important; }
html body:not(#_) .nscc-bw-look-check { display: inline-flex !important; align-items: center !important; gap: 5px !important; margin: 0 !important; font-weight: 600 !important; cursor: pointer; }
html body:not(#_) .nscc-bw-look-done, html body:not(#_) .nscc-bw-look-reset { height: 24px !important; margin: 0 !important; padding: 0 9px !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 6px !important; background: var(--chrome-bg-2, #e4e4e7) !important; color: var(--chrome-ink, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 600 11px var(--font-sans, sans-serif) !important; box-shadow: none !important; cursor: pointer; }
html body:not(#_) .nscc-bw-look-reset { align-self: flex-start !important; }
/* Free cells: a dashed box with a + in every empty cell. Hidden until the person
   presses in the banner's widget area (.is-open, set by the module) or drags a widget. */
html body:not(#_) .nscc-bw-cell { display: flex !important; align-items: center !important; justify-content: center !important; width: 100% !important; height: 44px !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; box-sizing: border-box !important; border: 1px dashed var(--chrome-line, #9ca3af) !important; border-radius: 10px !important; background: transparent !important; color: var(--chrome-muted, #52525b) !important; -webkit-text-fill-color: currentColor !important; font: 600 16px/1 var(--font-sans, sans-serif) !important; box-shadow: none !important; cursor: pointer; opacity: 0; transition: opacity .12s ease; }
html body:not(#_) .nscc-banner-widgets > .nscc-bw-cell { pointer-events: none; }
html body:not(#_) .nscc-banner-widgets.is-open > .nscc-bw-cell, html body:not(#_) .nscc-banner-widgets.is-arranging > .nscc-bw-cell { opacity: 1; pointer-events: auto; }
html body:not(#_) .nscc-bw-cell:hover, html body:not(#_) .nscc-bw-cell:focus-visible, html body:not(#_) .nscc-banner-widgets.is-arranging > .nscc-bw-cell:hover { border-style: solid !important; border-color: var(--chrome-accent, currentColor) !important; color: var(--chrome-ink, #18181b) !important; background: var(--chrome-bg-2, #e4e4e7) !important; }
/* The multi-zone clock fits whatever cells it is given: its zone boxes share the
   width and the time shrinks rather than spill into the next widget. */
/* A widget with a line under it (the time-zone clock's date) is as tall as its
   content, and the row grows to fit it: the line never rides the banner's edge. */
html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host { height: auto !important; min-height: 44px !important; overflow: visible !important; }
html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host .nscc-header-clock-sub { display: block !important; margin: 3px 0 0 !important; line-height: 1.25 !important; }
html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host { justify-self: stretch !important; justify-content: center !important; width: 100% !important; min-width: 0 !important; max-width: none !important; }
html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host > .nscc-header-clock { width: 100% !important; min-width: 0 !important; }
html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host .nscc-header-clock-zones-row, html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host .nscc-header-clock-zones { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host .nscc-header-clock-zone { flex: 1 1 0 !important; min-width: 0 !important; overflow: hidden !important; padding-left: 3px !important; padding-right: 3px !important; container-type: inline-size; }
html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host .nscc-header-clock-zone-time { font-size: clamp(8px, 14cqw, 15px) !important; white-space: nowrap !important; }
html body:not(#_) .nscc-banner-widgets > #nscc-header-clock-host .nscc-header-clock-zone-name { font-size: clamp(7px, 10cqw, 10px) !important; white-space: nowrap !important; }
/* The + menu: hidden widgets to put in that cell. */
html body:not(#_) .nscc-banner-widgets > .nscc-bw-picker { position: absolute !important; top: 100% !important; left: calc((var(--bw-picker-col, 1) - 1) / 12 * 100%) !important; z-index: 30 !important; display: flex !important; flex-direction: column !important; gap: 2px !important; min-width: 12rem !important; margin-top: 4px !important; padding: 6px !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 8px !important; background: var(--chrome-bg, #fff) !important; box-shadow: 0 6px 16px rgba(0,0,0,.2) !important; }
html body:not(#_) .nscc-bw-picker-title { padding: 2px 6px 4px !important; font: 700 10.5px var(--font-sans, sans-serif) !important; letter-spacing: .04em !important; color: var(--chrome-muted, #52525b) !important; }
html body:not(#_) .nscc-bw-picker-item { display: block !important; width: 100% !important; margin: 0 !important; padding: 5px 8px !important; border: 0 !important; border-radius: 6px !important; background: transparent !important; color: var(--chrome-ink, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 600 12px var(--font-sans, sans-serif) !important; text-align: left !important; box-shadow: none !important; cursor: pointer; white-space: nowrap !important; }
html body:not(#_) .nscc-bw-picker-item:hover, html body:not(#_) .nscc-bw-picker-item:focus-visible { background: var(--chrome-bg-2, #e4e4e7) !important; }
/* "Show hidden widget" + "Reset layout" — the dashboards' toolbar, last in the row. */
/* It floats just under the row, so it never takes room from the widgets. */
html body:not(#_) .nscc-banner-widgets { position: relative !important; }
html body:not(#_) .nscc-banner-widgets > .nscc-bw-tools { position: absolute !important; top: 100% !important; left: 50% !important; transform: translateX(-50%); z-index: 20 !important; display: inline-flex !important; align-items: center !important; gap: 6px !important; margin-top: 2px !important; padding: 4px 6px !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 8px !important; background: var(--chrome-bg, #fff) !important; box-shadow: 0 4px 12px rgba(0,0,0,.18) !important; white-space: nowrap !important; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
html body:not(#_) .nscc-banner-widgets > .nscc-bw-tools::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; }
html body:not(#_) .nscc-banner-widgets.is-open > .nscc-bw-tools { opacity: 1; pointer-events: auto; }
html body:not(#_) .nscc-bw-restore, html body:not(#_) .nscc-bw-reset { height: 26px !important; margin: 0 !important; padding: 0 8px !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 6px !important; background: var(--chrome-bg-2, #e4e4e7) !important; color: var(--chrome-ink, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 600 11px var(--font-sans, sans-serif) !important; box-shadow: none !important; cursor: pointer; }
html body:not(#_) .nscc-bw-restore { width: auto !important; max-width: 11rem !important; }
/* Nothing left in the row: nothing pops up by itself. The empty area shows a faint
   outline on hover so it can be found; pressing it opens the + cells and controls. */
html body:not(#_) .nscc-banner-widgets[data-count="0"]:not(.is-open) { min-height: 44px !important; border-radius: 10px !important; cursor: pointer; }
html body:not(#_) .nscc-banner-widgets[data-count="0"]:not(.is-open):hover { outline: 1px dashed var(--chrome-line, #9ca3af) !important; outline-offset: -1px; }
html body:not(#_) .nscc-bw-reset { white-space: nowrap !important; }
@media (hover: none) {
    html body:not(#_) .nscc-bw-ctl { opacity: 1; pointer-events: auto; }
}

/* The LIVE ticker as a banner widget: a framed, shorter strip filling its cells. */
html body:not(#_) .nscc-banner-widgets > .dispatch-ticker.nscc-bw-ticker { --ticker-bar-height: 42px; display: flex !important; flex: none !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; height: 44px !important; min-height: 44px !important; max-height: 44px !important; border: 1px solid var(--chrome-line, #9ca3af) !important; border-radius: 10px !important; overflow: visible !important; background: var(--chrome-bg-2, #e4e4e7) !important; }
html body:not(#_) .nscc-banner-widgets > .dispatch-ticker.nscc-bw-ticker > .dispatch-ticker-viewport { border-radius: 0 10px 10px 0; }
html body:not(#_) .nscc-banner-widgets > .dispatch-ticker.nscc-bw-ticker > .ticker-label { border-radius: 10px 0 0 10px; }
/* …or hidden entirely (the ticker's own on/off switch in Admin still wins too). */
html body:not(#_) .dispatch-ticker.nscc-ticker-placement-hidden { display: none !important; }

/* Boxes inside widgets (assets/nscc-inner-widgets.js): every box in a widget's box
   grid is a widget too — ☰ drags it within its own widget, ✕ hides it, and "Show
   hidden widget" / "Reset layout" under the grid bring it back. Same look as the
   banner's controls; shown on hover or keyboard focus, always on touch screens. */
html body:not(#_) .nscc-inner-box { position: relative !important; }
html body:not(#_) .nscc-inner-box.nscc-inner-off { display: none !important; }
html body:not(#_) .nscc-inner-ctl { position: absolute !important; top: -7px !important; right: -7px !important; z-index: 6 !important; display: inline-flex !important; gap: 3px !important; margin: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
html body:not(#_) .nscc-inner-box:hover > .nscc-inner-ctl, html body:not(#_) .nscc-inner-box:focus-within > .nscc-inner-ctl { opacity: 1; pointer-events: auto; }
html body:not(#_) .nscc-inner-drag, html body:not(#_) .nscc-inner-more, html body:not(#_) .nscc-inner-hide { display: inline-flex !important; align-items: center !important; justify-content: center !important; width: 18px !important; height: 18px !important; margin: 0 !important; padding: 0 !important; box-sizing: border-box !important; border: 1px solid var(--border-strong, #9ca3af) !important; border-radius: 50% !important; background: var(--bg-card, #fff) !important; color: var(--text-primary, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 700 10px/1 var(--font-sans, sans-serif) !important; text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important; }
html body:not(#_) .nscc-inner-drag { cursor: grab !important; border-radius: 4px !important; user-select: none; }
html body:not(#_) .nscc-inner-hide { cursor: pointer !important; }
/* ⋯ (Move to start / left / right — moving without dragging, 2026-10-05). */
html body:not(#_) .nscc-inner-more { cursor: pointer !important; border-radius: 4px !important; }
html body:not(#_) .nscc-inner-drag:focus-visible, html body:not(#_) .nscc-inner-more:focus-visible { border-color: var(--accent, currentColor) !important; outline: none !important; }
html body:not(#_) .nscc-inner-menu { position: absolute !important; top: 20px !important; right: 0 !important; z-index: 20 !important; display: flex !important; flex-direction: column !important; min-width: 9.5rem; padding: 3px !important; border: 1px solid var(--border-strong, #9ca3af) !important; border-radius: 6px !important; background: var(--bg-card, #fff) !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important; }
html body:not(#_) .nscc-inner-menu__item { display: block !important; padding: 0.35rem 0.55rem !important; border-radius: 4px !important; font: 600 0.75rem/1.2 var(--font-sans, sans-serif) !important; color: var(--text-primary, #18181b) !important; text-transform: none !important; letter-spacing: 0 !important; white-space: nowrap; cursor: pointer; text-align: left !important; }
html body:not(#_) .nscc-inner-menu__item:hover, html body:not(#_) .nscc-inner-menu__item:focus { background: var(--bg-hover, rgba(0, 0, 0, 0.06)) !important; outline: none !important; }
html body:not(#_) .nscc-inner-box:has(> .nscc-inner-ctl > .nscc-inner-menu) > .nscc-inner-ctl { opacity: 1; pointer-events: auto; z-index: 30 !important; }
html body:not(#_) .nscc-inner-box:has(> .nscc-inner-ctl > .nscc-inner-menu) { z-index: 30; }
html body:not(#_) .nscc-inner-hide:hover, html body:not(#_) .nscc-inner-hide:focus-visible { border-color: var(--accent, currentColor) !important; outline: none !important; }
html body:not(#_) .nscc-inner-box.is-dragging { opacity: .45 !important; }
html body:not(#_) .nscc-inner-grid.is-arranging > .nscc-inner-box:not(.is-dragging) { outline: 1px dashed var(--border-strong, #9ca3af) !important; outline-offset: 2px !important; }
/* The grid's "Show hidden widget" + "Reset layout": a full-width row after the
   boxes, shown only after the person presses in that grid (.is-open), like the
   banner's; pressing elsewhere or Esc puts it away. */
html body:not(#_) .nscc-inner-tools { grid-column: 1 / -1 !important; flex: 0 0 100% !important; display: flex !important; justify-content: flex-end !important; align-items: center !important; gap: 6px !important; margin: 0 !important; padding: 0 !important; opacity: 0; transition: opacity .12s ease; }
html body:not(#_) .nscc-inner-tools { display: none !important; }
html body:not(#_) .nscc-inner-grid.is-open > .nscc-inner-tools { display: flex !important; opacity: 1; }
/* The bar floats under the grid's right edge instead of taking a grid cell:
   as a cell it re-flowed an auto-fit row (every box narrower) the moment a
   press opened it, so the press ended on a different box than it started
   (2026-10-05). */
html body:not(#_) .nscc-inner-grid.is-open { position: relative; }
html body:not(#_) .nscc-inner-grid.is-open > .nscc-inner-tools { position: absolute !important; top: 100% !important; right: 0 !important; z-index: 7 !important; margin-top: 3px !important; padding: 3px 4px !important; border-radius: 6px !important; background: var(--bg-card, #fff) !important; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important; flex: 0 0 auto !important; }
html body:not(#_) .nscc-inner-restore, html body:not(#_) .nscc-inner-reset { width: auto !important; height: 24px !important; margin: 0 !important; padding: 0 8px !important; border: 1px solid var(--border-strong, #9ca3af) !important; border-radius: 6px !important; background: var(--bg-card, #fff) !important; color: var(--text-primary, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 600 11px var(--font-sans, sans-serif) !important; box-shadow: none !important; cursor: pointer; }
html body:not(#_) .nscc-inner-restore { max-width: 14rem !important; }
@media (hover: none) {
    html body:not(#_) .nscc-inner-ctl { opacity: 1; pointer-events: auto; }
}

/* My preferences → Banner widgets editor */
.nscc-bw-pref-title { font-size: 0.85rem; margin: 0 0 0.5rem; }
.nscc-bw-pref-note { font-size: 0.7rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.nscc-bw-pref-clock { display: block; font-size: 0.75rem; font-weight: 700; margin-top: 0.75rem; }
.nscc-bw-setting { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 0.75rem; font-weight: 700; }
.nscc-bw-setting-name { min-width: 6.5rem; }
.nscc-bw-setting select { font-size: 0.75rem; padding: 3px 6px; max-width: 14rem; }

/* ---- 6. Screen polish: every border and hard shadow follows the theme --------
   styles.css and the older half of this file drew panels, tables, filters and
   buttons with hard-coded 2px black lines (white ones on dark), plus offset
   "sticker" shadows. Each of those now reads --nscc-line / --nscc-line-w /
   --nscc-hard-shadow with the old value as its fallback, so a theme sets them
   once, here: the theme's own strong border, a 1px hairline, no offset shadow.
   Declared on body too — body.dark-theme redeclares --border-strong, and a
   custom property resolves where it is declared. */
html[data-nscc-theme],
html[data-nscc-theme] body { --nscc-line: var(--border-strong); --nscc-line-w: 1px; --nscc-hard-shadow: transparent; }
/* Screens that write the same black line straight into their markup. */
html[data-nscc-theme] body:not(#_) [style*="solid #000"],
html[data-nscc-theme] body:not(#_) [style*="solid black"] { border-color: var(--nscc-line) !important; }
html[data-nscc-theme] body:not(#_) [style*="2px solid #000"],
html[data-nscc-theme] body:not(#_) [style*="1.5px solid #000"] { border-width: 1px !important; }
html[data-nscc-theme] body:not(#_) [style*="px 0 #000"] { box-shadow: none !important; }

/* ---- 7. Window controls (assets/nscc-window-controls.js) ----------------------
   Every pop-up window: ⛶ Expand then ✕ Close, top right, the same 28px buttons
   in every window and every theme — the same ✕ the widgets hide with. The old
   close buttons (.close-btn, .modal-close, .btn-close, bare ×) are moved into
   this group, so their own positioning rules are neutralised here. */
html body:not(#_) .nscc-win { position: relative !important; }
html body:not(#_) .nscc-win-ctl { position: absolute !important; top: 10px !important; right: 10px !important; z-index: 30 !important; display: inline-flex !important; align-items: center !important; gap: 6px !important; margin: 0 !important; }
html body:not(#_) .nscc-win-ctl .nscc-win-btn { position: static !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; width: 28px !important; min-width: 28px !important; height: 28px !important; margin: 0 !important; padding: 0 !important; border: 1px solid var(--border-strong, #9ca3af) !important; border-radius: 6px !important; background: var(--bg-raised, #f4f4f5) !important; color: var(--text-primary, #18181b) !important; -webkit-text-fill-color: currentColor !important; font: 700 14px/1 var(--font-sans, sans-serif) !important; box-shadow: none !important; opacity: 1 !important; transform: none !important; cursor: pointer !important; }
html body:not(#_) .nscc-win-ctl .nscc-win-btn:hover { border-color: var(--accent, currentColor) !important; background: var(--bg-card, #fff) !important; }
html body:not(#_) .nscc-win-ctl .nscc-win-btn:focus-visible { outline: 2px solid var(--text-primary, #000) !important; outline-offset: 2px !important; }
html body:not(#_) .nscc-win-ctl .nscc-win-expand[aria-pressed="true"] { background: var(--accent-soft, var(--bg-card)) !important; border-color: var(--accent, currentColor) !important; }
/* Keep the title clear of the controls. */
html body:not(#_) .nscc-win > .modal-header, html body:not(#_) .nscc-win > .nscc-win-ctl + h2, html body:not(#_) .nscc-win > .nscc-win-ctl + h3 { padding-right: 76px !important; }
/* Expanded: the window fills the screen (a 16px margin), and its body scrolls. */
html body:not(#_) .nscc-win.nscc-win--max { position: fixed !important; inset: 16px 16px 16px 64px !important; width: auto !important; max-width: none !important; height: auto !important; max-height: none !important; margin: 0 !important; transform: none !important; overflow: auto !important; }

/* ---- 8. Screen bodies match the theme (Daily Pulse and every older screen) ------
   The lower half of Daily Pulse and many older screens drew their panels inline:
   the theme's grey "sunken" well as the panel colour, a 2px border, uppercase
   monospace titles, and status chips on a mid-grey fill with 4px coloured
   borders. On a light theme that turned the bottom of the page grey. Panels are
   cards now, exactly like the widgets: card colour, 1px theme line, 10px corners. */
html[data-nscc-theme] body:not(#_) { --nscc-status-border-w: 1px; }
html body:not(#_) .nscc-pulse-lower { display: flex !important; flex-direction: column !important; gap: 10px !important; padding: 6px 0 0 !important; font-family: var(--font-sans, inherit) !important; }
html body:not(#_) .nscc-pulse-tiles { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px !important; }
@media (max-width: 640px) { html body:not(#_) .nscc-pulse-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
html body:not(#_) .nscc-pulse-panel { display: flex !important; flex-direction: column !important; gap: 10px !important; margin: 0 !important; padding: 12px 14px !important; background: var(--bg-card) !important; border: 1px solid var(--nscc-line, var(--border-strong)) !important; border-radius: 10px !important; box-shadow: none !important; }
html body:not(#_) .nscc-pulse-panel__title { margin: 0 !important; font: 600 15px/1.3 var(--font-sans, inherit) !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-primary) !important; }
html body:not(#_) .nscc-pulse-chart { min-height: 140px; display: flex; align-items: center; justify-content: center; background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: 8px !important; overflow: hidden; }
html body:not(#_) .nscc-pulse-chart, html body:not(#_) .nscc-pulse-chart * { font-family: var(--font-sans, inherit) !important; }
html body:not(#_) .nscc-pulse-chips { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; }
html body:not(#_) .nscc-pulse-chip { display: inline-flex !important; align-items: center !important; gap: 6px !important; margin: 0 !important; padding: 3px 10px 3px 8px !important; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent) !important; border-radius: 999px !important; background: color-mix(in srgb, var(--c) 12%, var(--bg-card)) !important; color: var(--text-primary) !important; -webkit-text-fill-color: currentColor !important; font: 600 12px/1.4 var(--font-sans, inherit) !important; cursor: pointer; box-shadow: none !important; }
html body:not(#_) .nscc-pulse-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
html body:not(#_) .nscc-pulse-chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
html body:not(#_) .nscc-pulse-chip:hover { border-color: var(--c) !important; }
.nscc-pulse-chip { --c: var(--text-muted); }
.nscc-pulse-chip--unassigned { --c: var(--status-unassigned, #FF3B30); }
.nscc-pulse-chip--pending { --c: var(--status-pending, #FF9500); }
.nscc-pulse-chip--enroute { --c: var(--status-enroute, #5856D6); }
.nscc-pulse-chip--pickup { --c: var(--status-pickup, #FFCC00); }
.nscc-pulse-chip--transit { --c: var(--status-transit, #007AFF); }
.nscc-pulse-chip--secure { --c: var(--status-secure, #34C759); }
.nscc-pulse-chip--breach { --c: var(--status-breach, #FF3B30); }
html body:not(#_) .nscc-pulse-note { font-size: 12.5px; font-style: italic; color: var(--text-muted); }
/* Trip metrics chart with nothing to draw ("No trips loaded." / "No assigned trips yet — N unassigned."). */
html body:not(#_) .nscc-pulse-chart-empty { color: var(--text-muted); font-size: 9.5pt; font-family: monospace; }
/* The strips Daily Pulse pulls in from other modules. */
html[data-nscc-theme] body:not(#_) .nscc-compliance-pulse-strip,
html[data-nscc-theme] body:not(#_) .nscc-pulse-action-strip,
html[data-nscc-theme] body:not(#_) .nscc-pulse-action-strip--active { background: var(--bg-card) !important; border: 1px solid var(--nscc-line, var(--border-strong)) !important; border-radius: 10px !important; font-family: var(--font-sans, inherit) !important; }
html[data-nscc-theme] body:not(#_) .nscc-pulse-action-strip--clear { border-color: var(--status-secure, #34C759) !important; background: color-mix(in srgb, var(--status-secure, #34C759) 7%, var(--bg-card)) !important; }
html[data-nscc-theme] body:not(#_) .nscc-pulse-action-strip__header { background: transparent !important; border: 0 !important; padding: 0 !important; }
html[data-nscc-theme] body:not(#_) .nscc-pulse-action-strip__title { font: 600 14px/1.3 var(--font-sans, inherit) !important; letter-spacing: 0 !important; text-transform: none !important; }
/* Any older screen that still paints a panel as a grey well with a 2px border
   (written straight into its markup) gets the same card treatment. */
html[data-nscc-theme] body:not(#_) [style*="background:var(--bg-sunken)"][style*="2px solid var(--border)"],
html[data-nscc-theme] body:not(#_) [style*="background: var(--bg-sunken)"][style*="2px solid var(--border)"],
html[data-nscc-theme] body:not(#_) [style*="background:var(--bg-sunken)"][style*="border:2px solid"],
html[data-nscc-theme] body:not(#_) [style*="background: var(--bg-sunken)"][style*="border: 2px solid"] { background: var(--bg-card) !important; border-width: 1px !important; border-color: var(--nscc-line, var(--border-strong)) !important; }
/* Screens that name a font the app never loads ('Inter' — the dispatch list, a few
   previews) fell back to Segoe UI on Windows and monospace elsewhere. They use the
   app's own face like every other screen. */
html[data-nscc-theme] body:not(#_) [style*="font-family: 'Inter'"],
html[data-nscc-theme] body:not(#_) [style*="font-family:Inter"],
html[data-nscc-theme] body:not(#_) [style*="font-family: Inter"] { font-family: var(--font-sans, 'IBM Plex Sans', system-ui, sans-serif) !important; }
/* Dispatch: the ops strip is a card, like the widget toolbar on the dashboards. */
html[data-nscc-theme] body:not(#_) .nscc-ops-strip { background: var(--bg-card) !important; border: 1px solid var(--nscc-line, var(--border-strong)) !important; border-radius: 10px !important; box-shadow: none !important; }
/* Dispatch board: columns sit on the page as light cards, not grey wells. */
html[data-nscc-theme] body:not(#_) .kanban-column { background: var(--bg-raised) !important; border: 1px solid var(--nscc-line, var(--border-strong)) !important; border-radius: 10px !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .kanban-column .column-header { background: var(--bg-card) !important; border-bottom: 1px solid var(--border) !important; border-radius: 10px 10px 0 0 !important; }
html[data-nscc-theme] body:not(#_) .kanban-column .column-header h3 { font: 600 13px/1.3 var(--font-sans, inherit) !important; letter-spacing: .05em !important; }

/* ---- 9. Every staff page follows the theme ---------------------------------------
   The field apps (courier, guard, patrol, mobile), ops, versions, sign-in and the
   docs pages load nscc-theme-cycle.js in <head>, so they open in the person's
   theme like the main app. These rules bring their own chrome onto the same
   tokens: one 1px theme line, no hard offset shadows, folder tabs like the main
   app's (.nscc-erp-tab-btn), and sign-in buttons that stay legible in every theme.
   The customer portal and the contract / HR signing pages are documents shown to
   customers and new hires and keep their own light look. */
html[data-nscc-theme] body.traffic-cop-host:not(#_) { background: var(--bg-page) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-card,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-brand-masthead,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-banner { background: var(--bg-card) !important; color: var(--text-primary) !important; border: 1px solid var(--nscc-line, var(--border-strong)) !important; box-shadow: var(--ui-elev-1, none) !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-card:hover { border-color: var(--accent, var(--border-strong)) !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-brand-name,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .traffic-cop-title,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-card h3,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-banner strong { color: var(--text-primary) !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-brand-product,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .traffic-cop-sub,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-card p,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-meta,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-section-title { color: var(--text-muted) !important; }
/* The ops pages' navigation is a row of folder tabs, as in the main app. */
html[data-nscc-theme] body.traffic-cop-host:not(#_) .traffic-cop-nav { display: flex !important; flex-wrap: wrap !important; gap: 2px !important; padding: 0 !important; background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--border-strong) !important; border-radius: 0 !important; box-shadow: none !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .traffic-cop-nav a { margin: 0 0 -1px !important; padding: 7px 14px !important; font-family: var(--ui-font, inherit) !important; font-weight: 500 !important; font-size: 12.5px !important; background: var(--bg-raised) !important; color: var(--text-secondary) !important; -webkit-text-fill-color: currentColor !important; border: 1px solid var(--border-strong) !important; border-radius: var(--ui-radius-sm, 6px) var(--ui-radius-sm, 6px) 0 0 !important; box-shadow: none !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .traffic-cop-nav a:hover { background: var(--bg-sunken) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .traffic-cop-nav a.active { background: var(--bg-card) !important; color: var(--text-primary) !important; border-bottom-color: var(--bg-card) !important; font-weight: 600 !important; box-shadow: inset 0 2px 0 var(--accent) !important; }
/* Sign-in buttons (nscc-sso.js), on every page that shows the sign-in card. */
html[data-nscc-theme] body:not(#_) .nscc-auth-google,
html[data-nscc-theme] body:not(#_) .nscc-auth-microsoft { background: var(--bg-raised) !important; color: var(--text-primary) !important; -webkit-text-fill-color: var(--text-primary) !important; border: 1px solid var(--border-strong) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) .nscc-auth-google:hover,
html[data-nscc-theme] body:not(#_) .nscc-auth-microsoft:hover { background: var(--bg-sunken) !important; border-color: var(--accent) !important; }
/* The ops hero is the page's banner: it takes each theme's banner colour, as the
   main app's banner does, instead of a fixed blue gradient. */
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-hero { background: var(--banner-bg, var(--chrome-bg)) !important; color: var(--banner-fg, var(--chrome-ink)) !important; border: 1px solid var(--nscc-line, var(--border-strong)) !important; box-shadow: none !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-hero-title,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-hero-lede,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-hero-eyebrow,
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-hero .nscc-ops-eyebrow { color: var(--banner-fg, var(--chrome-ink)) !important; -webkit-text-fill-color: currentColor !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-hero-logo { filter: var(--chrome-icon-filter, none) !important; }
html[data-nscc-theme] body.traffic-cop-host:not(#_) .nscc-ops-hero .btn-ghost { background: transparent !important; color: var(--banner-fg, var(--chrome-ink)) !important; -webkit-text-fill-color: currentColor !important; border: 1px solid color-mix(in srgb, currentColor 45%, transparent) !important; }
/* Pop-up windows, every page: the theme's one 1px line (older rules drew 4px, in
   near-white on the dark themes). */
html[data-nscc-theme] body:not(#_) .modal-content,
html[data-nscc-theme] body:not(#_) .trip-modal-content { border: 1px solid var(--border-strong) !important; }
/* The field apps' top bar and bottom menu sit at z-index 10000: a window opens
   above them, so its ⛶ / ✕ are never under the bar. */
html body:not(#_):has(> .mobile-container) .modal.open,
html body:not(#_):has(> .mobile-container) .modal[style*="flex"],
html body:not(#_):has(> .mobile-container) .modal[style*="block"] { z-index: 10020 !important; }
/* Field apps: fixed light panels written inline (the identity card's login-time
   box, info notes) read as glaring patches on the dark themes. There they take the
   theme's sunken surface; the pale green / blue notes keep their hue as a dim tint. */
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background: #eef2f7"],
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background: #f8fafc"],
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background:#f8fafc"],
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background: #ffffff"],
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background:#fff;"],
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background:#fff\""] { background: var(--bg-sunken) !important; color: var(--text-primary) !important; border-color: var(--border-strong) !important; }
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background: #f0fdf4"] { background: rgba(22, 163, 74, .14) !important; border-color: rgba(22, 163, 74, .45) !important; }
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background: #eff6ff"] { background: rgba(37, 99, 235, .14) !important; border-color: rgba(37, 99, 235, .45) !important; }
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background: #eef2f7"] strong + *,
html.dark[data-nscc-theme] body:not(#_):has(> .mobile-container) [style*="background: #eef2f7"] span { color: var(--text-primary) !important; }
/* Behind a field-app window the screen dims, as in the main app, rather than being
   covered by a solid page colour. The location consent page fills the screen. */
html[data-nscc-theme] body:not(#_):has(> .mobile-container) .modal:not(#disclaimer-modal) { background: rgba(0, 0, 0, .45) !important; }

/* ============================================================
   10. Theme audit fixes (2026-09-28)
   Found by the 12-theme audit (every screen, folder tab and window; text contrast,
   off-palette grey patches, thick or white borders, missing ⛶ / ✕). Each rule
   below answers a finding; the audit is described in docs/NSCC_UI_STANDARDS.md.
   ============================================================ */

/* Status colours used as TEXT. The --status-* fills are bright (#34C759 …) and
   read at ~2:1 on the light themes; text takes an ink of the same hue that clears
   3:1 on every theme — darker on the nine light themes, lighter on the dark three. */
html[data-nscc-theme] {
    --status-secure-ink:     #176a2d;
    --status-pending-ink:    #8a4c00;
    --status-transit-ink:    #0b5bc2;
    --status-assigned-ink:   #7630ad;
    --status-unassigned-ink: #ad1f15;
}
html.dark[data-nscc-theme] {
    --status-secure-ink:     #62d884;
    --status-pending-ink:    #fbbf4d;
    --status-transit-ink:    #74aeff;
    --status-assigned-ink:   #cc9af2;
    --status-unassigned-ink: #ff7d73;
}
/* Field-app and mobile stat counters (Active / Trips / Pending / Unassigned / Forms). */
html[data-nscc-theme] body:not(#_) #c-active,
html[data-nscc-theme] body:not(#_) #s-active,
html[data-nscc-theme] body:not(#_) .stat-val[style*="34C759" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="52, 199, 89"],
html[data-nscc-theme] body:not(#_) .stat-val[style*="22c55e" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="16a34a" i] { color: var(--status-secure-ink) !important; }
html[data-nscc-theme] body:not(#_) #c-pending,
html[data-nscc-theme] body:not(#_) #s-pending,
html[data-nscc-theme] body:not(#_) .stat-val[style*="f59e0b" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="FF9500" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="245, 158, 11"] { color: var(--status-pending-ink) !important; }
html[data-nscc-theme] body:not(#_) #c-trips,
html[data-nscc-theme] body:not(#_) #s-trips,
html[data-nscc-theme] body:not(#_) .stat-val[style*="3b82f6" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="007AFF" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="59, 130, 246"] { color: var(--status-transit-ink) !important; }
html[data-nscc-theme] body:not(#_) #c-forms,
html[data-nscc-theme] body:not(#_) .stat-val[style*="8b5cf6" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="AF52DE" i] { color: var(--status-assigned-ink) !important; }
html[data-nscc-theme] body:not(#_) #s-unassigned,
html[data-nscc-theme] body:not(#_) #c-unassigned,
html[data-nscc-theme] body:not(#_) .stat-val[style*="ef4444" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="FF3B30" i],
html[data-nscc-theme] body:not(#_) .stat-val[style*="239, 68, 68"] { color: var(--status-unassigned-ink) !important; }
/* Other green status words: GPS bar, "ONLINE", role line, ledger stamp. */
html[data-nscc-theme] body:not(#_) #global-gps-bar,
html[data-nscc-theme] body:not(#_) #global-gps-label,
html[data-nscc-theme] body:not(#_) #digest-ledger-hash,
html[data-nscc-theme] body:not(#_) #emp-modal-role[style*="--status-secure"],
html[data-nscc-theme] body:not(#_) span[style*="color:var(--status-secure)"],
html[data-nscc-theme] body:not(#_) span[style*="color: var(--status-secure)"] { color: var(--status-secure-ink) !important; }
/* "Live" badges (ops pages, Versions): white on a light green fill reads 2.3:1. */
html[data-nscc-theme] body:not(#_) .nscc-ops-badge--live { background: var(--status-secure-ink) !important; color: #fff !important; border-color: transparent !important; }
html.dark[data-nscc-theme] body:not(#_) .nscc-ops-badge--live { color: #0c1a10 !important; }

/* Location / dispatch consent pages and the route digest were written with fixed
   slate inks and pale panels: on the dark themes the title and terms went black on
   black, and on the warm light themes the panels showed as cold grey patches. Inside
   them every such colour takes the theme's own. */
html[data-nscc-theme] body:not(#_) :is(#disclaimer-modal, #route-digest-modal, #employee-card-modal) :is([style*="color: #0f172a" i], [style*="color:#0f172a" i], [style*="color: #1e293b" i], [style*="color:#1e293b" i], [style*="color: #334155" i], [style*="color:#334155" i]) { color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) :is(#disclaimer-modal, #route-digest-modal, #employee-card-modal) :is([style*="color: #475569" i], [style*="color:#475569" i], [style*="color: #64748b" i], [style*="color:#64748b" i], [style*="color: #94a3b8" i], [style*="color:#94a3b8" i]) { color: var(--text-secondary) !important; }
html[data-nscc-theme] body:not(#_) :is(#disclaimer-modal, #route-digest-modal, #employee-card-modal) :is([style*="background: #f8fafc" i], [style*="background:#f8fafc" i], [style*="background: #eef2f7" i], [style*="background:#eef2f7" i], [style*="background: #f1f5f9" i], [style*="background:#f1f5f9" i]) { background: var(--bg-sunken) !important; }
html[data-nscc-theme] body:not(#_) :is(#disclaimer-modal, #route-digest-modal, #employee-card-modal) :is([style*="#e2e8f0" i], [style*="#cbd5e1" i], [style*="#bfdbfe" i], [style*="#bbf7d0" i]) { border-color: var(--border) !important; }
/* The consent page's blue / green notes: a tint of their hue on every theme, with
   the theme's ink, instead of a fixed pale box with a fixed dark heading. */
html[data-nscc-theme] body:not(#_) #disclaimer-modal [style*="background: #eff6ff" i],
html[data-nscc-theme] body:not(#_) #disclaimer-modal [style*="background:#eff6ff" i] { background: color-mix(in srgb, var(--status-transit-ink) 12%, var(--bg-card)) !important; border-color: color-mix(in srgb, var(--status-transit-ink) 40%, var(--bg-card)) !important; }
html[data-nscc-theme] body:not(#_) #disclaimer-modal [style*="background: #f0fdf4" i],
html[data-nscc-theme] body:not(#_) #disclaimer-modal [style*="background:#f0fdf4" i] { background: color-mix(in srgb, var(--status-secure-ink) 12%, var(--bg-card)) !important; border-color: color-mix(in srgb, var(--status-secure-ink) 40%, var(--bg-card)) !important; }
html[data-nscc-theme] body:not(#_) #disclaimer-modal :is([style*="background: #eff6ff" i], [style*="background:#eff6ff" i], [style*="background: #f0fdf4" i], [style*="background:#f0fdf4" i]) :is(h3, h4, strong, span, p) { color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) #disclaimer-modal [style*="color: #16a34a" i] { color: var(--status-secure-ink) !important; }
html[data-nscc-theme] body:not(#_) #disclaimer-modal #agree-label span { color: var(--text-primary) !important; }

/* The sign-in card: fixed cream on some pages, dark on others, with fixed slate
   hint lines that vanished on the dark themes. It is a window like any other —
   the theme's card, its one line, its inks. */
html[data-nscc-theme] body:not(#_) .nscc-auth-card { background: var(--bg-card) !important; color: var(--text-primary) !important; border: 1px solid var(--border-strong) !important; box-shadow: 0 20px 40px rgba(0, 0, 0, .25) !important; }
html[data-nscc-theme] body:not(#_) .nscc-auth-title { background: none !important; color: var(--text-primary) !important; -webkit-text-fill-color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) :is(.nscc-auth-subtitle, .nscc-auth-status, .nscc-auth-ms-hint, #nscc-auth-ms-hint, #nscc-auth-diag-link, .nscc-auth-footer) { color: var(--text-secondary) !important; -webkit-text-fill-color: currentColor !important; }

/* The old dark-mode layer outlined cards, panels and windows in near-white
   (rgba(245,245,244,.68)); under a theme they take the theme's one line colour. */
html.dark[data-nscc-theme] body:not(#_) :is(.card, .panel, .drawer, .popover, .dropdown-menu, .batch-card, .trip-card, .modal-content, .trip-modal-content, .modal-header, .erp-staging-modal-header, .top-header, .master-data-shell, .nscc-erp-panel, .nscc-table-scroll, .job-card:not([data-trip-status]), .gantt-alert-card, .timeline-pending-trip, .nscc-kpi-card, .finance-card, .overview-card, .master-data-header-box, .nscc-bo-screen-find) { border-color: var(--border-strong) !important; }
html.dark[data-nscc-theme] body:not(#_) :is(.job-card, .trip-card, .batch-card):hover { border-color: var(--accent) !important; }
html[data-nscc-theme] body:not(#_) #digest-print-area { border-color: var(--border) !important; }
html[data-nscc-theme] body:not(#_) #route-digest-modal .modal-header { border-bottom-color: var(--border) !important; }

/* Buttons: one 1px line everywhere (red "Sign out / End shift" buttons drew 4px). */
html[data-nscc-theme] body:not(#_) .btn-danger { border-width: 1px !important; }
/* Avatar initials: white on a white disc on the light themes. */
html[data-nscc-theme] body:not(#_) #profile-avatar-initials { background: var(--accent) !important; color: var(--accent-ink, #fff) !important; -webkit-text-fill-color: currentColor !important; }
/* Report / template builders: their bordered buttons fell back to the browser's grey. */
html[data-nscc-theme] body:not(#_) :is(#report-builder-modal, #template-builder-modal) .btn.btn-bordered { background: var(--bg-raised) !important; color: var(--text-primary) !important; border: 1px solid var(--border-strong) !important; }

/* The dark themes' --brand is near-black (#1d1e21 / #1a130e / #000): right as a
   fill, invisible as text. Where --brand is used as a text colour it takes the
   theme's link / primary ink there instead. */
html.dark[data-nscc-theme] body:not(#_) :is(.nscc-linkish, .exec-kpi-card__hint, .lf-kpi-value, .wt-link, .nscc-demo-progress-title, .diag-card h3, .nscc-portal-link, .nscc-portal-back a) { color: var(--text-link, var(--text-primary)) !important; -webkit-text-fill-color: currentColor !important; }
html.dark[data-nscc-theme] body:not(#_) :is(a, span, div, button, strong, b)[style*="color:var(--brand"],
html.dark[data-nscc-theme] body:not(#_) :is(a, span, div, button, strong, b)[style*="color: var(--brand"] { color: var(--text-link, var(--text-primary)) !important; }
html.dark[data-nscc-theme] body:not(#_) .nscc-wt-widget-grip { color: var(--text-muted) !important; border-color: var(--border-strong) !important; background: var(--bg-raised) !important; }
/* The findings-count badge on the monitoring landing: the accent with its own ink
   (dark ink on its old green read 2.8:1; light on light on the dark themes). */
html[data-nscc-theme] body:not(#_) .wt-badge { background: var(--accent) !important; color: var(--accent-ink) !important; -webkit-text-fill-color: var(--accent-ink) !important; }
html[data-nscc-theme] body:not(#_) .wt-badge--crit { background: var(--status-unassigned-ink) !important; color: var(--bg-card) !important; -webkit-text-fill-color: var(--bg-card) !important; }
/* Screen tool strips ("New trip", "Add guard", …): the theme's primary button,
   not --brand fill with --bg-card ink (dark on dark on the dark themes). */
html[data-nscc-theme] body:not(#_) .nscc-ops-strip__btn { background: var(--accent) !important; color: var(--accent-ink) !important; border: 1px solid var(--accent) !important; box-shadow: none !important; }
/* Report catalogue names (Payroll Reports, …) were fixed black. */
html[data-nscc-theme] body:not(#_) .nscc-report-catalog-item__name { color: var(--text-primary) !important; }
/* Required-field asterisks. */
html[data-nscc-theme] body:not(#_) #nscc-support-form span[style*="FF3B30" i],
html[data-nscc-theme] body:not(#_) .required-star,
html[data-nscc-theme] body:not(#_) .req { color: var(--status-unassigned-ink) !important; }
/* The NorthStar mark on About / Support took a fixed stone tile — a grey patch on
   the light themes. It sits on the theme's card with its one line, as the
   header's mark does. */
html[data-nscc-theme]:not(.dark) body:not(#_) .nscc-brand-logo { background: var(--bg-card) !important; border: 1px solid var(--border-strong) !important; }
/* Map "OFFLINE MOCK MODE" plate: a fixed navy plate, so its caption takes a fixed
   light ink rather than the theme's muted ink (2.9:1 on Stone / Mocha). */
html[data-nscc-theme] body:not(#_) [style*="rgba(11,19,41,0.85)"] > div[style*="--text-muted"] { color: #cbd5e1 !important; }
/* Daily Pulse bar chart: each row's label and count were painted in the bar's
   bright fill colour (~2.2:1 on the light themes). They take the matching ink. */
html[data-nscc-theme] body:not(#_) :is(.nscc-pulse-chart, #main-daily-pulse-container) :is([style*="color:#FF3B30" i]) { color: var(--status-unassigned-ink) !important; }
html[data-nscc-theme] body:not(#_) :is(.nscc-pulse-chart, #main-daily-pulse-container) :is([style*="color:#FF9500" i], [style*="color:#FFCC00" i], [style*="color:#ea580c" i]) { color: var(--status-pending-ink) !important; }
html[data-nscc-theme] body:not(#_) :is(.nscc-pulse-chart, #main-daily-pulse-container) :is([style*="color:#5856D6" i]) { color: var(--status-assigned-ink) !important; }
html[data-nscc-theme] body:not(#_) :is(.nscc-pulse-chart, #main-daily-pulse-container) :is([style*="color:#007AFF" i], [style*="color:#06b6d4" i]) { color: var(--status-transit-ink) !important; }
html[data-nscc-theme] body:not(#_) :is(.nscc-pulse-chart, #main-daily-pulse-container) :is([style*="color:#34C759" i], [style*="color:#14b8a6" i]) { color: var(--status-secure-ink) !important; }

/* Status hues written inline as a text colour (color: var(--status-…)) — dashboard
   KPI counts and the like — take the ink. background-color is left alone: the
   selectors only match "color" at the start of a declaration. */
html[data-nscc-theme] body:not(#_) :is([style^="color:var(--status-secure)"], [style^="color: var(--status-secure)"], [style*=";color:var(--status-secure)"], [style*="; color:var(--status-secure)"], [style*="; color: var(--status-secure)"], [style*=";color: var(--status-secure)"]) { color: var(--status-secure-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:var(--status-pending)"], [style^="color: var(--status-pending)"], [style*=";color:var(--status-pending)"], [style*="; color:var(--status-pending)"], [style*="; color: var(--status-pending)"], [style*=";color: var(--status-pending)"]) { color: var(--status-pending-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:var(--status-transit)"], [style^="color: var(--status-transit)"], [style*=";color:var(--status-transit)"], [style*="; color:var(--status-transit)"], [style*="; color: var(--status-transit)"], [style*=";color: var(--status-transit)"]) { color: var(--status-transit-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:var(--status-assigned)"], [style^="color: var(--status-assigned)"], [style*=";color:var(--status-assigned)"], [style*="; color:var(--status-assigned)"], [style*="; color: var(--status-assigned)"], [style*=";color: var(--status-assigned)"]) { color: var(--status-assigned-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:var(--status-unassigned)"], [style^="color: var(--status-unassigned)"], [style*=";color:var(--status-unassigned)"], [style*="; color:var(--status-unassigned)"], [style*="; color: var(--status-unassigned)"], [style*=";color: var(--status-unassigned)"]) { color: var(--status-unassigned-ink) !important; }
/* Earth-green inline ink (#4a6b52) reads 1.7:1 on the dark themes. */
html.dark[data-nscc-theme] body:not(#_) [style*="color:#4a6b52" i],
html.dark[data-nscc-theme] body:not(#_) [style*="color: #4a6b52" i] { color: var(--status-secure-ink) !important; }
/* Amber warning text (#b45309) is right on light surfaces, 2.3:1 on dark ones. */
html[data-nscc-theme] body:not(#_) :is(.nscc-cell-sub[style*="b45309" i], .nscc-cell-sub[style*="180, 83, 9"]) { color: var(--status-pending-ink) !important; }

/* Review-queue filter pills: the selected pill is the accent with its own ink, and
   the count inside any pill reads on its sunken chip. */
html[data-nscc-theme] body:not(#_) .nscc-prq-toolbar-group .active { background: var(--accent) !important; color: var(--accent-ink) !important; }
html[data-nscc-theme] body:not(#_) .nscc-prq-count { background: var(--bg-sunken) !important; color: var(--text-primary) !important; }

/* A plain .btn with no variant got nothing from any theme rule and fell to the
   browser's grey button. Lowest specificity (:where) — it only replaces the browser
   default; every component's own button styling still wins. */
:where(html[data-nscc-theme]) :where(button.btn, input.btn) { background-color: var(--btn-surface); color: var(--btn-surface-ink); border-color: var(--border-strong); }
:where(html[data-nscc-theme]) :where(button.btn, input.btn):disabled { opacity: .55; }
/* Unstyled links fell to the browser's #0000EE — 1.1:1 on the dark themes. */
:where(html[data-nscc-theme]) :where(a:not([class]):not([style*="color"])) { color: var(--text-link, var(--text-primary)); }

/* Support › Documentation cards used the docs "ink" line — near-white 2px on the
   dark themes, fixed white panels on the light ones. They are cards: the theme's
   surfaces and one line. */
html[data-nscc-theme] body:not(#_) .support-docs-shell .nscc-support-docs__brand { background: var(--bg-card) !important; border: 1px solid var(--border-strong) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) .support-docs-shell .nscc-support-doc-link { background: var(--bg-raised) !important; border: 1px solid var(--border-strong) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) #nscc-docs-theme-toggle { background: var(--btn-surface) !important; color: var(--btn-surface-ink) !important; border: 1px solid var(--border-strong) !important; }
/* Inline grey-500 muted text (#6b7280) in report renderers: 2.8:1 on the warm and
   dark themes. It is the theme's secondary ink. */
html[data-nscc-theme] body:not(#_) [style*="color:#6b7280" i],
html[data-nscc-theme] body:not(#_) [style*="color: #6b7280" i] { color: var(--text-secondary) !important; }
/* Data Health status chips: fixed pale green / sand fills with a 2px black frame and
   a hard shadow. A tint of the status hue on the theme's card, one line, its ink. */
html[data-nscc-theme] body:not(#_) #data-health-view [style*="background:#e8efe4" i] { background: color-mix(in srgb, var(--status-secure-ink) 14%, var(--bg-card)) !important; }
html[data-nscc-theme] body:not(#_) #data-health-view [style*="background:#f5e6d0" i] { background: color-mix(in srgb, var(--status-pending-ink) 14%, var(--bg-card)) !important; }
html[data-nscc-theme] body:not(#_) #data-health-view [style*="border:2px solid #000"] { border: 1px solid var(--border-strong) !important; box-shadow: none !important; }
html[data-nscc-theme] body:not(#_) #data-health-view [style*="color:#4a6b52" i] { color: var(--status-secure-ink) !important; }
html[data-nscc-theme] body:not(#_) #data-health-view [style*="color:#b8631a" i] { color: var(--status-pending-ink) !important; }
/* Docs chrome (Help, Library, the Markdown viewer) carried its own light / dark
   palette (nscc-docs-chrome.css, redefined on body.dark-theme): white cards on
   every light theme, a black or near-white 2px ink frame. Under a theme its
   variables are the theme's. */
html[data-nscc-theme]:root,
html[data-nscc-theme] body:not(#_) {
    --docs-page-bg: var(--bg-page);
    --docs-card-bg: var(--bg-card);
    --docs-raised-bg: var(--bg-raised);
    --docs-ink-border: var(--border-strong);
    --docs-ink-shadow: transparent;
    --docs-chip-bg: var(--btn-surface);
    --docs-chip-ink: var(--btn-surface-ink);
    --docs-title: var(--text-primary);
    --docs-body: var(--text-secondary);
    --docs-muted: var(--text-muted);
    --docs-table-head-bg: var(--table-head-bg);
    --docs-table-head-fg: var(--text-primary);
    --docs-table-stripe: var(--table-stripe);
    --docs-link: var(--text-link);
}
/* Docs masthead logo: the dark themes invert every image to white, tile included
   (a blank white square). The tile goes transparent, so the star shows white on
   the card inside the theme's line. */
html.dark[data-nscc-theme] body:not(#_) :is(.nscc-brand-mark, .nscc-docs-lib-hero__brand) img { background: transparent !important; border-color: var(--border-strong) !important; }
/* Status hues written inline as a literal text colour (color:#EF4444 on a trip
   card's "Unassigned", …) take the matching ink, as the var() form does above.
   Only "color" at the start of a declaration matches, never background-color. */
html[data-nscc-theme] body:not(#_) :is([style^="color:#34C759" i], [style^="color: #34C759" i], [style*=";color:#34C759" i], [style*="; color:#34C759" i], [style*="; color: #34C759" i], [style^="color:#22c55e" i], [style^="color: #22c55e" i], [style*=";color:#22c55e" i], [style*="; color:#22c55e" i], [style*="; color: #22c55e" i], [style^="color:#16a34a" i], [style^="color: #16a34a" i], [style*=";color:#16a34a" i], [style*="; color:#16a34a" i], [style*="; color: #16a34a" i]) { color: var(--status-secure-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:#ea580c" i], [style^="color: #ea580c" i], [style*=";color:#ea580c" i], [style*="; color:#ea580c" i], [style*="; color: #ea580c" i], [style^="color:#f59e0b" i], [style^="color: #f59e0b" i], [style*=";color:#f59e0b" i], [style*="; color:#f59e0b" i], [style*="; color: #f59e0b" i], [style^="color:#FF9500" i], [style^="color: #FF9500" i], [style*=";color:#FF9500" i], [style*="; color:#FF9500" i], [style*="; color: #FF9500" i], [style^="color:#b8631a" i], [style^="color: #b8631a" i], [style*=";color:#b8631a" i], [style*="; color:#b8631a" i], [style*="; color: #b8631a" i], [style^="color:#b45309" i], [style^="color: #b45309" i], [style*=";color:#b45309" i], [style*="; color:#b45309" i], [style*="; color: #b45309" i], [style^="color:#d97706" i], [style^="color: #d97706" i], [style*=";color:#d97706" i], [style*="; color:#d97706" i], [style*="; color: #d97706" i]) { color: var(--status-pending-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:#3b82f6" i], [style^="color: #3b82f6" i], [style*=";color:#3b82f6" i], [style*="; color:#3b82f6" i], [style*="; color: #3b82f6" i], [style^="color:#007AFF" i], [style^="color: #007AFF" i], [style*=";color:#007AFF" i], [style*="; color:#007AFF" i], [style*="; color: #007AFF" i], [style^="color:#2563eb" i], [style^="color: #2563eb" i], [style*=";color:#2563eb" i], [style*="; color:#2563eb" i], [style*="; color: #2563eb" i]) { color: var(--status-transit-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:#8b5cf6" i], [style^="color: #8b5cf6" i], [style*=";color:#8b5cf6" i], [style*="; color:#8b5cf6" i], [style*="; color: #8b5cf6" i], [style^="color:#AF52DE" i], [style^="color: #AF52DE" i], [style*=";color:#AF52DE" i], [style*="; color:#AF52DE" i], [style*="; color: #AF52DE" i], [style^="color:#5856D6" i], [style^="color: #5856D6" i], [style*=";color:#5856D6" i], [style*="; color:#5856D6" i], [style*="; color: #5856D6" i]) { color: var(--status-assigned-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:#ef4444" i], [style^="color: #ef4444" i], [style*=";color:#ef4444" i], [style*="; color:#ef4444" i], [style*="; color: #ef4444" i], [style^="color:#FF3B30" i], [style^="color: #FF3B30" i], [style*=";color:#FF3B30" i], [style*="; color:#FF3B30" i], [style*="; color: #FF3B30" i], [style^="color:#dc2626" i], [style^="color: #dc2626" i], [style*=";color:#dc2626" i], [style*="; color:#dc2626" i], [style*="; color: #dc2626" i]) { color: var(--status-unassigned-ink) !important; }
/* Ops strip warning values (#b8631a) read 2.6:1 on the dark themes. */
html[data-nscc-theme] body:not(#_) .nscc-ops-tile--warn .nscc-ops-tile__value { color: var(--status-pending-ink) !important; }
/* Status chips, pills and badges: the themes set --nscc-status-border-w to 1px,
   but the global chip rule in styles.css (and a later copy) wrote 4px literally.
   One line in the status colour, like every other line. (Trips Gantt blocks keep
   the 4px their renderer writes inline — a status mark on a large block.) */
html[data-nscc-theme] body:not(#_) :is(.badge, .chip, .tag, .pill, .nscc-chip, .nscc-tag, .nscc-badge, .mode-badge, .trip-status, .job-status, .ref-status-pill, .nscc-dispatch-status-pill, .nscc-fp-badge, .ops-chip, .nscc-pulse-action-chip__status, .cm-status-badge, .cm-trip-card) { border-width: 1px !important; }
/* Avatar initials sit on their own generated colour; a context rule forced dark ink. */
html[data-nscc-theme] body:not(#_) .nscc-avatar-initials { color: #fff !important; -webkit-text-fill-color: #fff !important; }
/* LIVE ticker chip close (×): a fixed 85% white disc under the chip's own ink,
   which is white on the dark banners. It takes the chip's colours. */
html[data-nscc-theme] body:not(#_) .ticker-seg-close { background: transparent !important; color: inherit !important; border-color: currentColor !important; }
/* Folder tabs inside a window (Trip details): the old dark layer framed them in
   white. They take the theme's line. */
html.dark[data-nscc-theme] body:not(#_) .modal :is(.nscc-erp-tabs, [role="tablist"], div) .nscc-erp-tab-btn { border-color: var(--border-strong) !important; }
/* Pale status boxes written inline (#dbeafe blue, #dcfce7 green, #fef3c7 amber,
   #fee2e2 red, #ede9fe violet) stay glaring on the dark themes, under text that
   already takes the light ink. There they are a tint of the hue on the card. */
html.dark[data-nscc-theme] body:not(#_) :is([style*="background:#dbeafe" i], [style*="background: #dbeafe" i], [style*="background:#eff6ff" i]) { background: color-mix(in srgb, var(--status-transit-ink) 16%, var(--bg-card)) !important; }
html.dark[data-nscc-theme] body:not(#_) :is([style*="background:#dcfce7" i], [style*="background: #dcfce7" i], [style*="background:#f0fdf4" i]) { background: color-mix(in srgb, var(--status-secure-ink) 16%, var(--bg-card)) !important; }
html.dark[data-nscc-theme] body:not(#_) :is([style*="background:#fef3c7" i], [style*="background: #fef3c7" i], [style*="background:#fffbeb" i]) { background: color-mix(in srgb, var(--status-pending-ink) 16%, var(--bg-card)) !important; }
html.dark[data-nscc-theme] body:not(#_) :is([style*="background:#fee2e2" i], [style*="background: #fee2e2" i], [style*="background:#fef2f2" i]) { background: color-mix(in srgb, var(--status-unassigned-ink) 16%, var(--bg-card)) !important; }
html.dark[data-nscc-theme] body:not(#_) :is([style*="background:#ede9fe" i], [style*="background: #ede9fe" i], [style*="background:#f5f3ff" i]) { background: color-mix(in srgb, var(--status-assigned-ink) 16%, var(--bg-card)) !important; }
/* Data Health's muted earth ink (#8a7355) on the warm themes: 2.9:1. */
html[data-nscc-theme] body:not(#_) #data-health-view [style*="color:#8a7355" i] { color: var(--text-secondary) !important; }
html[data-nscc-theme] body:not(#_) #data-health-view [style*="; color:#7a2b1e" i] { color: var(--status-unassigned-ink) !important; }
/* Trip details custody lines: "Pending" in the bright amber fill read 2:1. */
html[data-nscc-theme] body:not(#_) #nscc-trip-modal-panel .is-pending { color: var(--status-pending-ink) !important; }
html[data-nscc-theme] body:not(#_) #nscc-trip-modal-panel .is-verified { color: var(--status-secure-ink) !important; }
/* Status badges are outline chips with the theme's ink (styles.dab8423a95.css); a later
   .badge-unassigned rule painted black ink, invisible on the dark themes. */
html[data-nscc-theme] body:not(#_) .badge { color: var(--text-primary) !important; -webkit-text-fill-color: var(--text-primary) !important; }
/* Availability week grid (employee card, time off): day cells were written as white
   text on a status fill, and the global "clear fill, status border" rule removes
   the fill, leaving white on white. The border carries the status; the text is the
   theme's ink. */
html[data-nscc-theme] body:not(#_) [style*="grid-template-columns:repeat(7, minmax(0, 1fr))"] > [title] :is(div, span) { color: var(--text-primary) !important; -webkit-text-fill-color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) [style*="grid-template-columns:repeat(7, minmax(0, 1fr))"] > [title] { color: var(--text-primary) !important; }

/* The monitoring screens (Master Data › its landing, runs, findings, gallery …)
   carried their own fixed earth palette (--wt-*: cream panels, earth-green chips,
   2px black frames with a hard black offset shadow). Under a theme each of its
   variables is the theme's own. The palette is injected on :root at runtime;
   :root + the theme attribute outranks it. */
html[data-nscc-theme]:root {
    --wt-black: var(--border-strong);
    --wt-text-muted: var(--text-muted);
    --wt-bg-card: var(--bg-card);
    --wt-bg-sunken: var(--bg-sunken);
    --wt-brand: var(--accent);
    --wt-brand-dark: var(--text-primary);
    --wt-good: var(--status-secure-ink);
    --wt-border: var(--text-muted);
    --wt-border-light: var(--border);
    --wt-warn: var(--status-pending-ink);
    --wt-crit: var(--status-unassigned-ink);
    --wt-nudge: var(--accent-soft);
}
/* One 1px line, no hard offset shadow. */
html[data-nscc-theme] body:not(#_) :is(.wt-card, .wt-scenario-card, .wt-badge, .wt-ticket-open, .wt-textarea, [style*="solid var(--wt-black)"], [style*="solid rgba(0,0,0,0.28)"]) { border-width: 1px !important; }
html[data-nscc-theme] body:not(#_) :is(.wt-card, .wt-scenario-card, [style*="0 var(--wt-black)"]) { box-shadow: none !important; }
/* Chips on the soft accent ("running", "medium") and the fixed earth ink. */
html[data-nscc-theme] body:not(#_) :is(.wt-sev--MEDIUM, .wt-chip--running, .wt-pill--running, [style*="color:#3f3426" i], [style*="color: #3f3426" i]) { color: var(--text-primary) !important; }
/* Pale warning banner and chat bubbles written inline. */
html[data-nscc-theme] body:not(#_) [style*="background:#f7ebd7" i] { background: color-mix(in srgb, var(--status-pending-ink) 12%, var(--bg-card)) !important; }
html[data-nscc-theme] body:not(#_) [style*="background:#dfe7d5" i] { background: var(--accent-soft) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) [style*="background:#f0e6d2" i] { background: var(--bg-raised) !important; color: var(--text-primary) !important; }
html[data-nscc-theme] body:not(#_) [style*="background:rgba(74,107,82,0.12)"] { background: var(--bg-raised) !important; }

/* Semantic inks written inline as var(--success) / var(--warn) / var(--danger)
   (fills with a literal fallback): as text they take the status inks. */
html[data-nscc-theme] body:not(#_) :is([style^="color:var(--success"], [style^="color: var(--success"], [style*=";color:var(--success"], [style*="; color:var(--success"], [style*="; color: var(--success"]) { color: var(--status-secure-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:var(--warn"], [style^="color: var(--warn"], [style*=";color:var(--warn"], [style*="; color:var(--warn"], [style*="; color: var(--warn"]) { color: var(--status-pending-ink) !important; }
html[data-nscc-theme] body:not(#_) :is([style^="color:var(--danger"], [style^="color: var(--danger"], [style*=";color:var(--danger"], [style*="; color:var(--danger"], [style*="; color: var(--danger"]) { color: var(--status-unassigned-ink) !important; }
