/* ─── CAD Incident program — Day + Night color pass ───────────────────────
 * Structural skeleton originally built for TASK.md RUN_ID
 * 20260823-new-cad-program-skeleton (structure only, no color, per the
 * user's own "no text or colors for now" scope at the time). This file now
 * also carries RUN_ID 20260823-fill-in-cad-incident-colors's color/visual
 * pass — see that run's Design Specification + Implementation Plan for the
 * full palette rationale. Architecture: a `--cad-*` custom-property token
 * block on `.mdc-cad-window` (Day defaults) overridden by
 * `.mdc-cad-window--night` (Night, ~13 of the tokens actually differ) — see
 * Implementation Plan §2 for why tokens were chosen over duplicated rule
 * blocks. Window chrome (title bar) reuses this codebase's own existing
 * global `--win11-*` tokens (desktop.css/settings-window.css) verbatim and
 * is deliberately theme-invariant. The narrative/comments log is written
 * with literal hex values, also deliberately theme-invariant (see §5 of the
 * Design Specification).
 *
 * Responsive collapse breakpoints below (1000px toolbar, 860px sidebar) are
 * driven by CadIncidentPortal.jsx's own ResizeObserver-set classes (JS-
 * observed real element width, not a browser-viewport media query — this
 * window resizes independently of the browser viewport via `resize: both`).
 * The class names below document the breakpoint values the JS uses; they
 * have no effect on their own.
 *
 * Day/Night mode (RUN_ID 20260825-day-night-mode-and-themes): the window
 * frame/title bar below now key on the SYSTEM-WIDE body.dark-mode/
 * .night-mode classes, never on .mdc-cad-window--night (Mechanism B's own
 * separate, interior-only, deliberately-independent local toggle — see
 * Implementation Plan §5's critical distinction). The --cad-* token block
 * and .mdc-cad-window--night below remain completely untouched and
 * unrelated to this change; the frame is no longer theme-invariant, but
 * everything reading --cad-* still is.
 */

.mdc-cad-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1100px;
    height: 700px;
    min-width: 860px;
    min-height: 560px;
    display: none;
    z-index: 9998;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    /* Day (new default) */
    background: var(--win11-bg-solid-light, #F3F3F3);
    border: none;
    border-radius: var(--win11-radius-lg, 12px);
    box-shadow: var(--win11-shadow-window-light, 0 32px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06));
    line-height: 1.3;

    /* ─── Interior content palette tokens — Day defaults ────────────────── */
    --cad-surface: #F2EFE7;
    --cad-text: #1B1B18;
    --cad-text-muted: #6B6A66;
    --cad-text-disabled: #8B8985;
    --cad-border: rgba(27, 27, 24, 0.18);
    --cad-field-bg: #FFFFFF;
    --cad-field-border: rgba(27, 27, 24, 0.28);
    --cad-accent: #0078D4;
    --cad-accent-text: #005A9E;
    --cad-badge-positive-bg: #2E7D32;
    --cad-badge-positive-text: #FFFFFF;
    --cad-badge-amber-bg: #B45309;
    --cad-badge-amber-text: #FFFFFF;
    --cad-badge-neutral-bg: rgba(27, 27, 24, 0.08);
    --cad-hover: rgba(27, 27, 24, 0.06);
    --cad-active: rgba(27, 27, 24, 0.12);
    --cad-autoscroll-off-border: rgba(27, 27, 24, 0.35);
    --cad-selected-row-bg: #0078D4;
    --cad-selected-row-text: #FFFFFF;
    --cad-focus: #0078D4;
}

/* System-wide Day/Night mode — frame only, never .mdc-cad-window--night. */
body.dark-mode .mdc-cad-window,
body.night-mode .mdc-cad-window {
    /* Night (existing, unchanged) */
    background: var(--win11-bg-solid-dark, #202020);
    box-shadow: var(--win11-shadow-window, 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08));
}

/* ─── Night theme override — redeclares only the tokens that actually
 * differ from Day (Implementation Plan §2); window chrome and the
 * narrative log never read these and are unaffected by this class. ────── */
.mdc-cad-window--night {
    --cad-surface: #111412;
    --cad-text: #4ADE80;
    --cad-text-muted: #4E9C6E;
    --cad-border: rgba(74, 222, 128, 0.25);
    --cad-field-bg: #0B0D0B;
    --cad-field-border: rgba(74, 222, 128, 0.35);
    --cad-accent-text: #4FC3F7;
    --cad-badge-positive-bg: #166534;
    --cad-badge-positive-text: #D1FAE5;
    --cad-badge-neutral-bg: rgba(74, 222, 128, 0.08);
    --cad-hover: rgba(74, 222, 128, 0.08);
    --cad-active: rgba(74, 222, 128, 0.15);
    --cad-autoscroll-off-border: rgba(74, 222, 128, 0.4);
}

/* ─── Typography — must directly match each descendant, not just the window
 * root, because frontend/css/fonts.css's own global `:root, body, body *`
 * rule is itself !important and directly matches every descendant of
 * .mdc-cad-window too. Importance is resolved before specificity, so a
 * !important declaration on .mdc-cad-window alone has no effect on any
 * child's own font-family — only a directly-matching, equally-!important,
 * higher-specificity descendant selector can win. This is the pattern
 * already proven working in call-log-window.css/status-window.css (REPLAN 1
 * correction, Fix 2) — not settings-window.css's root-only pattern, which
 * this file's own prior round copied and which is independently confirmed
 * broken. ─────────────────────────────────────────────────────────────── */
.mdc-cad-window,
.mdc-cad-window * {
    font-family: var(--win11-font, 'Segoe UI', 'Segoe UI Variable', Tahoma, Geneva, Verdana, sans-serif) !important;
}

/* Monospace carve-out — higher specificity (two classes vs. one class +
 * universal) so it deterministically wins over the general-UI rule above
 * for the log, queue table, and mono summary values (Design Spec §5/§6). */
.mdc-cad-window .mdc-cad-log,
.mdc-cad-window .mdc-cad-log *,
.mdc-cad-window .mdc-cad-queue__table,
.mdc-cad-window .mdc-cad-queue__table *,
.mdc-cad-window .mdc-cad-summary-grid__value--mono {
    font-family: 'Consolas', 'Courier New', ui-monospace, monospace !important;
}

.mdc-cad-window.show {
    display: flex;
}

/* ─── Title bar — fixed chrome, never scrolls, now day/night-responsive
 * (system-wide toggle only — see the file-header note above; Mechanism
 * B's own --cad-* interior tokens remain theme-invariant, unaffected). ── */
.mdc-cad-titlebar {
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    /* Day (new default) */
    background: var(--win11-bg-solid-light, #F3F3F3);
    color: #1B1B1B;
    border-bottom: 1px solid currentColor;
    -webkit-user-select: none;
    user-select: none;
}

body.dark-mode .mdc-cad-titlebar,
body.night-mode .mdc-cad-titlebar {
    /* Night (existing, unchanged) */
    background: var(--win11-bg-solid-dark, #202020);
    color: #f3f3f3;
}

.mdc-cad-titlebar__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-left: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mdc-cad-titlebar__label {
    margin-left: 8px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.mdc-cad-titlebar__buttons {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

.mdc-cad-titlebar__btn {
    width: 46px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #1B1B1B;
    cursor: pointer;
    transition: background 0.1s;
    /* Title-bar unification (RUN_ID 20260904-unify-title-bar-across-windows):
     * this window's minimize/maximize/close buttons previously rendered
     * bespoke inline SVG glyphs; adopting the shared WindowTitleBar.jsx
     * component switches them to the same literal Unicode glyphs every
     * other window in this run uses (design spec §3) — a disclosed visual
     * change for this window specifically. font-size/line-height sized for
     * this window's own 32px title-bar height (vs. Settings' 34px).
     */
    font-size: 14px;
    line-height: 1;
}

body.dark-mode .mdc-cad-titlebar__btn,
body.night-mode .mdc-cad-titlebar__btn {
    color: #f3f3f3;
}

.mdc-cad-titlebar__btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.dark-mode .mdc-cad-titlebar__btn:hover,
body.night-mode .mdc-cad-titlebar__btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mdc-cad-titlebar__btn--close:hover {
    background: #e81123;
    color: #fff;
}

/* ─── Toolbar row — fixed chrome, never scrolls, non-wrapping ────────────── */
.mdc-cad-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--cad-surface);
    color: var(--cad-text);
    border-bottom: 1px solid var(--cad-border);
}

.mdc-cad-toolbar__btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    border-right: 1px solid var(--cad-border);
    padding: 6px 4px;
    cursor: pointer;
    background: var(--cad-surface);
    color: var(--cad-text);
}

.mdc-cad-toolbar__btn-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.mdc-cad-toolbar__btn:last-child {
    border-right: none;
}

.mdc-cad-toolbar__btn--active {
    border-bottom: 3px solid var(--cad-accent);
}

.mdc-cad-toolbar__btn--active .mdc-cad-toolbar__btn-label {
    color: var(--cad-accent-text);
}

.mdc-cad-toolbar__btn-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

/* Icon-only collapse below TOOLBAR_COLLAPSE_WIDTH (1000px) — see
 * CadIncidentPortal.jsx. Documented here per the class name it applies. */
.mdc-cad-toolbar--collapsed .mdc-cad-toolbar__btn-label {
    display: none;
}

/* ─── Command bar row — fixed chrome, never scrolls ──────────────────────── */
.mdc-cad-commandbar {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    background: var(--cad-surface);
    color: var(--cad-text);
    border-bottom: 1px solid var(--cad-border);
}

.mdc-cad-commandbar__input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 0 8px;
    height: 28px;
    background: var(--cad-surface);
    color: var(--cad-text);
}

.mdc-cad-commandbar__btn {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-left: 1px solid var(--cad-border);
    cursor: pointer;
    background: var(--cad-surface);
    color: var(--cad-text);
}

/* ─── Status strip row — fixed chrome, never scrolls, 6 independent
 * structural controls ─────────────────────────────────────────────────── */
.mdc-cad-statusbar {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 12px;
    padding: 4px 8px;
    overflow: hidden;
    background: var(--cad-surface);
    color: var(--cad-text);
    border-bottom: 1px solid var(--cad-border);
}

.mdc-cad-statusbar__control {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    border: none;
    font-size: 11px;
}

.mdc-cad-statusbar__priority-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--cad-badge-amber-bg);
}

.mdc-cad-statusbar__control--daynight {
    border: 1px solid var(--cad-border);
    padding: 2px 8px;
    cursor: pointer;
    background: var(--cad-surface);
    color: var(--cad-text);
}

.mdc-cad-statusbar__select {
    background: var(--cad-surface);
    color: var(--cad-text);
    border: 1px solid var(--cad-border);
}

.mdc-cad-statusbar__select option[disabled] {
    color: var(--cad-text-disabled);
}

.mdc-cad-statusbar__badge {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    border: 1px solid var(--cad-border);
    padding: 2px 8px;
}

.mdc-cad-statusbar__unit-icon {
    width: 12px;
    height: 12px;
    border: 1px solid var(--cad-border);
    border-radius: 50%;
}

.mdc-cad-statusbar__gps {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    background: var(--cad-badge-positive-bg);
    color: var(--cad-badge-positive-text);
    border: 1px solid var(--cad-badge-positive-bg);
    padding: 2px 8px;
}

.mdc-cad-statusbar__gps-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--cad-badge-positive-text);
}

/* ─── Location header row — Detail screen only, fixed chrome ─────────────── */
.mdc-cad-location-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 4px 8px;
    background: var(--cad-surface);
    color: var(--cad-text);
    border-bottom: 1px solid var(--cad-border);
}

.mdc-cad-location-header__value {
    flex: 1;
    min-width: 0;
    height: 20px;
    background: var(--cad-field-bg);
    border: 1px solid var(--cad-field-border);
}

/* ─── Body — sidebar + content pane (Detail), full remaining height ──────── */
.mdc-cad-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.mdc-cad-body--list {
    flex-direction: column;
}

/* ─── Sidebar — fixed-width column, full remaining height, own scroll only
 * if the 12-item list exceeds the visible height ─────────────────────────── */
.mdc-cad-sidebar {
    width: 220px;
    flex-shrink: 0;
    overflow-y: auto;
    background: var(--cad-surface);
    color: var(--cad-text);
    border-right: 1px solid var(--cad-border);
}

/* Collapse below SIDEBAR_COLLAPSE_WIDTH (860px) — see CadIncidentPortal.jsx. */
.mdc-cad-sidebar--collapsed {
    width: 48px;
}

.mdc-cad-sidebar--collapsed .mdc-cad-sidebar__label,
.mdc-cad-sidebar--collapsed .mdc-cad-sidebar__badge {
    display: none;
}

.mdc-cad-sidebar--collapsed .mdc-cad-sidebar__item {
    justify-content: center;
}

.mdc-cad-sidebar__nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mdc-cad-sidebar__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-left: 3px solid transparent;
    padding: 6px 10px;
    text-align: left;
    cursor: pointer;
    background: var(--cad-surface);
    color: var(--cad-text);
}

.mdc-cad-sidebar__icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.mdc-cad-sidebar__item--active {
    border-left-color: var(--cad-accent);
}

.mdc-cad-sidebar__item--active .mdc-cad-sidebar__label {
    color: var(--cad-accent-text);
}

.mdc-cad-sidebar__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.mdc-cad-sidebar__badge {
    flex-shrink: 0;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cad-badge-neutral-bg);
    color: var(--cad-text-muted);
    border: 1px solid var(--cad-border);
    border-radius: 8px;
    padding: 0 4px;
}

.mdc-cad-sidebar__badge--nonzero {
    background: var(--cad-badge-amber-bg);
    color: var(--cad-badge-amber-text);
    border-color: var(--cad-badge-amber-bg);
}

/* ─── Content pane — fills remaining width/height, own independent scroll ─── */
.mdc-cad-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 12px;
    background: var(--cad-surface);
    color: var(--cad-text);
}

/* ─── Summary form-grid — two-column label/value grid, 14 fields ─────────── */
.mdc-cad-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.mdc-cad-summary-grid__field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mdc-cad-summary-grid__field--wide {
    grid-column: 1 / -1;
}

.mdc-cad-summary-grid__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: var(--cad-text-muted);
}

.mdc-cad-summary-grid__value {
    height: 24px;
    font-size: 13px;
    color: var(--cad-text);
    background: var(--cad-field-bg);
    border: 1px solid var(--cad-field-border);
}

.mdc-cad-summary-grid__value--mono {
    font-variant-numeric: tabular-nums;
}

.mdc-cad-summary-grid__value-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mdc-cad-summary-grid__value-row .mdc-cad-summary-grid__value {
    flex: 1;
    min-width: 0;
}

.mdc-cad-summary-grid__icon-btn {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cad-field-border);
    background: var(--cad-field-bg);
    color: var(--cad-text-muted);
    cursor: pointer;
}

.mdc-cad-summary-grid__icon-btn svg {
    width: 14px;
    height: 14px;
}

.mdc-cad-summary-grid__icon-btn:hover,
.mdc-cad-summary-grid__icon-btn:active {
    color: var(--cad-accent-text);
}

.mdc-cad-summary-grid__field--wide .mdc-cad-summary-grid__value {
    height: 56px;
}

/* ─── Narrative/comments log — bounded height, own independent scroll,
 * theme-invariant per Design Specification §5: literal hex values only,
 * never a --cad-* token, so it never changes when .mdc-cad-window--night
 * is toggled. ─────────────────────────────────────────────────────────── */
.mdc-cad-log {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    height: 180px;
    flex-shrink: 0;
    background: #14170F;
    color: #4ADE80;
    border: 1px solid currentColor;
    font-variant-numeric: tabular-nums;
}

.mdc-cad-log__header {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    padding: 4px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.25);
}

.mdc-cad-log__autoscroll {
    border: 1px solid var(--cad-autoscroll-off-border);
    color: var(--cad-text);
    background: transparent;
    padding: 2px 8px;
    cursor: pointer;
}

.mdc-cad-log__autoscroll--on {
    border-width: 2px;
    background: var(--cad-accent);
    color: #FFFFFF;
    border-color: var(--cad-accent);
}

.mdc-cad-log__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 8px;
    font-variant-numeric: tabular-nums;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 222, 128, 0.45) #14170F;
}

.mdc-cad-log__body::-webkit-scrollbar {
    width: 14px;
}

.mdc-cad-log__body::-webkit-scrollbar-track {
    background: #14170F;
    border-left: 1px solid rgba(74, 222, 128, 0.25);
}

.mdc-cad-log__body::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.35);
    border: 1px solid rgba(74, 222, 128, 0.6);
}

.mdc-cad-log__body::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 222, 128, 0.55);
}

.mdc-cad-log__body::-webkit-scrollbar-thumb:active {
    background: rgba(74, 222, 128, 0.75);
}

.mdc-cad-log__body::-webkit-scrollbar-button {
    display: block;
    height: 14px;
    background: #14170F;
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.mdc-cad-log__body::-webkit-scrollbar-button:single-button:vertical:decrement {
    border-style: solid;
    border-width: 0 5px 6px 5px;
    border-color: transparent transparent #4ADE80 transparent;
}

.mdc-cad-log__body::-webkit-scrollbar-button:single-button:vertical:increment {
    border-style: solid;
    border-width: 6px 5px 0 5px;
    border-color: #4ADE80 transparent transparent transparent;
}

.mdc-cad-log__empty {
    font-variant-numeric: tabular-nums;
}

/* ─── Generic section shell (CadSectionShell.jsx) — the other 11 sections ── */
.mdc-cad-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mdc-cad-section__header {
    flex-shrink: 0;
    margin-bottom: 8px;
}

.mdc-cad-section__title {
    font-size: 16px;
    font-weight: 600;
}

.mdc-cad-section-list {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mdc-cad-section-list__header {
    display: flex;
    flex-shrink: 0;
    background: var(--cad-field-bg);
    border-bottom: 1px solid var(--cad-field-border);
}

.mdc-cad-section-list__col {
    flex: 1;
    min-width: 0;
    padding: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdc-cad-section-list__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.mdc-cad-section-list__row--empty {
    padding: 8px;
    text-align: center;
}

/* ─── Persons' Citation/Arrest sub-view (CadPersonsPanel.jsx) — added
 * RUN_ID 20260825-cad-bolo-and-persons-citations. Sits below the reused
 * `.mdc-cad-summary-grid` field grid; the charge table itself reuses
 * `.mdc-cad-section-list` verbatim (same empty-state convention as every
 * other list-shape section). ─────────────────────────────────────────── */
.mdc-cad-citations {
    margin-top: 16px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mdc-cad-citations__tabs {
    display: flex;
    flex-shrink: 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--cad-border);
}

.mdc-cad-citations__tab {
    border: none;
    border-right: 1px solid var(--cad-border);
    padding: 6px 14px;
    cursor: pointer;
    background: var(--cad-surface);
    color: var(--cad-text);
}

.mdc-cad-citations__tab:last-child {
    border-right: none;
}

.mdc-cad-citations__tab--active {
    border-bottom: 3px solid var(--cad-accent);
    color: var(--cad-accent-text);
}

.mdc-cad-citations__search {
    flex-shrink: 0;
    height: 28px;
    margin-bottom: 8px;
    padding: 0 8px;
    background: var(--cad-field-bg);
    border: 1px solid var(--cad-field-border);
    color: var(--cad-text);
}

/* ─── Bottom action bar — fixed chrome, present regardless of section ────── */
.mdc-cad-actionbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 6px 8px;
    background: var(--cad-surface);
    color: var(--cad-text);
    border-top: 1px solid var(--cad-border);
}

.mdc-cad-record-nav {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.mdc-cad-record-nav__btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cad-border);
    cursor: pointer;
    background: var(--cad-surface);
    color: var(--cad-text);
}

.mdc-cad-actionbar__buttons {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 4px;
}

.mdc-cad-actionbar__btn {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--cad-border);
    padding: 4px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    font-size: 12px;
    background: var(--cad-surface);
    color: var(--cad-text);
}

/* ─── List screen (CadQueueList.jsx) — queue tab-group + 6-column table ────
 * `.mdc-cad-queue` gets the same base-surface treatment as the Detail
 * screen's own sibling region containers (toolbar/sidebar/content/etc.) —
 * it is the List screen's one direct content region and was the one region
 * container not separately named in Design Specification §7's mapping
 * table; applied here as the mechanical completion of that same rule using
 * only the already-defined --cad-surface/--cad-text tokens (no new color
 * introduced) — see Implementation Notes for this disclosed reasoning. ─── */
.mdc-cad-queue {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--cad-surface);
    color: var(--cad-text);
}

.mdc-cad-queue__tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid var(--cad-border);
}

.mdc-cad-queue__tab {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-right: 1px solid var(--cad-border);
    padding: 6px 14px;
    cursor: pointer;
    background: var(--cad-surface);
    color: var(--cad-text);
}

.mdc-cad-queue__tab--active {
    border-bottom: 3px solid var(--cad-accent);
}

.mdc-cad-queue__tab--active .mdc-cad-queue__tab-label {
    color: var(--cad-accent-text);
}

.mdc-cad-queue__tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    background: var(--cad-badge-neutral-bg);
    color: var(--cad-text-muted);
    border: 1px solid var(--cad-border);
    border-radius: 8px;
    padding: 0 4px;
}

.mdc-cad-queue__tab-badge--nonzero {
    background: var(--cad-badge-amber-bg);
    color: var(--cad-badge-amber-text);
    border-color: var(--cad-badge-amber-bg);
}

.mdc-cad-queue__table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.mdc-cad-queue__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-variant-numeric: tabular-nums;
}

.mdc-cad-queue__table thead th {
    position: sticky;
    top: 0;
    text-align: left;
    padding: 4px;
    background: var(--cad-field-bg);
    border-bottom: 1px solid var(--cad-field-border);
}

.mdc-cad-queue__table td {
    padding: 4px;
    border-bottom: 1px solid var(--cad-border);
}

/* Relative column-width proportions (narrowest -> widest): ST narrowest;
 * Inc #/Code next; Type next; RD narrow-to-medium; Location widest, since
 * street addresses are the longest plausible content in this table. */
.mdc-cad-queue__table th:nth-child(1),
.mdc-cad-queue__table td:nth-child(1) {
    width: 6%;
}

.mdc-cad-queue__table th:nth-child(2),
.mdc-cad-queue__table td:nth-child(2) {
    width: 12%;
}

.mdc-cad-queue__table th:nth-child(3),
.mdc-cad-queue__table td:nth-child(3) {
    width: 14%;
}

.mdc-cad-queue__table th:nth-child(4),
.mdc-cad-queue__table td:nth-child(4) {
    width: 10%;
}

.mdc-cad-queue__table th:nth-child(5),
.mdc-cad-queue__table td:nth-child(5) {
    width: 44%;
}

.mdc-cad-queue__table th:nth-child(6),
.mdc-cad-queue__table td:nth-child(6) {
    width: 14%;
}

/* Location column truncates via ellipsis rather than forcing horizontal
 * scroll or breaking row height, matching settings-window.css's own existing
 * ellipsis-truncation convention. */
.mdc-cad-queue__col--location {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdc-cad-queue__row--empty td {
    text-align: center;
    padding: 8px;
    color: var(--cad-text-muted);
}

/* Red BOLO toolbar icon — reference screenshot's own "red icon" (Origin) —
 * a literal color, not a --cad-* token, matching the narrative log's own
 * theme-invariant-literal-hex precedent for a color no existing token
 * models. */
.mdc-cad-toolbar__btn-icon--bolo {
    color: #DC2626;
}

/* ─── BOLO panel (CadBoloPanel.jsx) — added RUN_ID
 * 20260825-cad-bolo-and-persons-citations. Its own overlay + panel, styled
 * entirely with this window's own --cad-* tokens, deliberately NOT the
 * generic light .mdc-modal/.mdc-modal-overlay system (frontend/css/
 * mdc-ui-lib.css) — see TASK.md Origin step 3. `.mdc-cad-window` (position:
 * fixed) is this overlay's containing block, so it covers exactly this
 * window's own bounds, not the full browser viewport. Starts below the
 * title bar (32px, matching .mdc-cad-titlebar's own height) so the window
 * can still be minimized/closed/moved while the panel is open. By design
 * this also covers the toolbar row (including the other 10 buttons) while
 * open, same as any modal blocking background interaction — confirmed fine
 * by runtime-engineer's live review. ─────────────────────────────────────
 * Fix round (same RUN_ID): runtime-engineer found live that this covered
 * the BOLO toggle button itself too, so a second click to close ("click
 * BOLO again to close") couldn't reach it — Playwright confirmed the
 * overlay intercepted the click. Rather than uncovering the whole toolbar
 * (which would change the deliberate "modal blocks the other 10 buttons"
 * behavior above), `.mdc-cad-toolbar__btn--bolo-toggle` below is lifted
 * into its own stacking context above this overlay's z-index, so only the
 * one button that both opens and closes this panel stays reachable while
 * it's open. */
.mdc-cad-bolo-overlay {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}

/* The BOLO toggle button (11th toolbar button) must stay clickable above
 * its own overlay (z-index: 20) so re-clicking it closes the panel — see
 * comment on .mdc-cad-bolo-overlay above. .mdc-cad-toolbar itself is
 * unpositioned, so this button's z-index participates directly in
 * .mdc-cad-window's stacking context, the same one the overlay is in. */
.mdc-cad-toolbar__btn--bolo-toggle {
    position: relative;
    z-index: 21;
}

.mdc-cad-bolo-panel {
    width: 420px;
    max-width: 92%;
    max-height: 90%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: var(--cad-surface);
    color: var(--cad-text);
    border: 1px solid var(--cad-border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.mdc-cad-bolo-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.mdc-cad-bolo-panel__title {
    font-size: 16px;
    font-weight: 600;
}

.mdc-cad-bolo-panel__close {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cad-border);
    background: var(--cad-surface);
    color: var(--cad-text);
    cursor: pointer;
}

.mdc-cad-bolo-panel__close svg {
    width: 9px;
    height: 9px;
}

.mdc-cad-bolo-panel__field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mdc-cad-bolo-panel__label {
    font-size: 11px;
    color: var(--cad-text-muted);
}

.mdc-cad-bolo-panel__select,
.mdc-cad-bolo-panel__input,
.mdc-cad-bolo-panel__textarea {
    padding: 4px 8px;
    background: var(--cad-field-bg);
    color: var(--cad-text);
    border: 1px solid var(--cad-field-border);
}

.mdc-cad-bolo-panel__select,
.mdc-cad-bolo-panel__input {
    height: 28px;
}

.mdc-cad-bolo-panel__textarea {
    resize: vertical;
}

.mdc-cad-bolo-panel__checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.mdc-cad-bolo-panel__broadcast {
    flex-shrink: 0;
    padding: 6px 10px;
    background: var(--cad-badge-amber-bg);
    color: var(--cad-badge-amber-text);
    border: 1px solid var(--cad-badge-amber-bg);
    cursor: pointer;
    font-weight: 600;
}

.mdc-cad-bolo-panel__list {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--cad-border);
}

.mdc-cad-bolo-panel__list-header {
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--cad-text-muted);
}

.mdc-cad-bolo-panel__list-empty {
    padding: 8px;
    text-align: center;
    color: var(--cad-text-muted);
    border: 1px solid var(--cad-border);
    background: var(--cad-field-bg);
}

/* ─── Hover/active states — every clickable chrome element in this window ── */
.mdc-cad-toolbar__btn:hover,
.mdc-cad-sidebar__item:hover,
.mdc-cad-actionbar__btn:hover,
.mdc-cad-queue__tab:hover,
.mdc-cad-record-nav__btn:hover,
.mdc-cad-commandbar__btn:hover,
.mdc-cad-statusbar__control--daynight:hover,
.mdc-cad-log__autoscroll:hover,
.mdc-cad-summary-grid__icon-btn:hover,
.mdc-cad-citations__tab:hover,
.mdc-cad-bolo-panel__close:hover {
    background: var(--cad-hover);
}

.mdc-cad-toolbar__btn:active,
.mdc-cad-sidebar__item:active,
.mdc-cad-actionbar__btn:active,
.mdc-cad-queue__tab:active,
.mdc-cad-record-nav__btn:active,
.mdc-cad-commandbar__btn:active,
.mdc-cad-statusbar__control--daynight:active,
.mdc-cad-log__autoscroll:active,
.mdc-cad-summary-grid__icon-btn:active,
.mdc-cad-citations__tab:active,
.mdc-cad-bolo-panel__close:active {
    background: var(--cad-active);
}

/* Broadcast BOLO — kept out of the shared neutral hover/active list above
 * deliberately: it carries its own amber accent background, and applying
 * `--cad-hover`/`--cad-active` on top would visually flip it to gray on
 * interaction. A brightness filter preserves the accent instead. */
.mdc-cad-bolo-panel__broadcast:hover {
    filter: brightness(1.1);
}

.mdc-cad-bolo-panel__broadcast:active {
    filter: brightness(0.9);
}

/* ─── Keyboard focus — every focusable element gets a visible outline ────── */
.mdc-cad-window button:focus-visible,
.mdc-cad-window input:focus-visible,
.mdc-cad-window select:focus-visible {
    outline: 2px solid var(--cad-focus, #0078D4);
    outline-offset: 2px;
}

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