:root {
    color-scheme: light;
    --brand: #c2ab3e;
    --brand-hover: #ac952c;
    --brand-ink: #635416;
    --brand-soft: #f7f2dc;
    --ink: #202b32;
    --muted: #606d76;
    --subtle: #7b8790;
    --line: #dde3e6;
    --surface: #ffffff;
    --canvas: #f4f6f7;
    --surface-alt: #f8fafb;
    --sidebar: #202c30;
    --sidebar-text: #c5cfd1;
    --sidebar-muted: #9caeb1;
    --sidebar-hover: #2c3a3e;
    --sidebar-selected: #37433c;
    --danger: #ac3b36;
    --danger-soft: #fbeeed;
    --ok: #286747;
    --ok-soft: #eaf5ee;
    --warning: #85550b;
    --warning-soft: #fcf3df;
    --focus: #30748b;
    --scroll-thumb: #a4b1b7;
    --scroll-track: #eef2f3;
    --scroll-hover: #7b8d96;
    --scroll-active: #5b707b;
    --font-body: 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Bahnschrift', 'Segoe UI Variable Display', 'Segoe UI', sans-serif;
    --font-data: 'Cascadia Mono', 'Consolas', ui-monospace, monospace;
    --radius-control: 7px;
    --radius-panel: 12px;
    --space-panel: 24px;
    --sidebar-width: 232px;
    --z-header: 100;
    --z-feedback: 300;
    --z-dialog: 600;
}
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; scroll-padding-block: 24px; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--scroll-track); }
*::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 2px solid var(--scroll-track); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }
*::-webkit-scrollbar-thumb:active { background: var(--scroll-active); }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, a.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 17px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--brand); color: var(--ink); font: 600 13px/1.4 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 120ms, border-color 120ms; }
button:hover:not(:disabled), a.button:hover { background: var(--brand-hover); text-decoration: none; }
button:active:not(:disabled), a.button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary, a.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px #202b3205; }
button.secondary:hover:not(:disabled), a.button.secondary:hover { background: var(--surface-alt); border-color: var(--scroll-thumb); }
button.link-button { min-height: 32px; padding: 4px 7px; color: var(--brand-ink); background: transparent; font-size: 13px; }
button.link-button:hover:not(:disabled) { background: var(--brand-soft); }
button.link-button.danger { color: var(--danger); }
button.link-button.danger:hover:not(:disabled) { background: var(--danger-soft); }
button.danger-button { background: var(--danger); color: var(--surface); }
button.danger-button:hover:not(:disabled) { background: #902e2a; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1:focus { outline: none; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 43px; padding: 10px 12px; margin-top: 7px; background: var(--surface); color: var(--ink); border: 1px solid #bec9cf; border-radius: var(--radius-control); font: 400 14px/1.5 var(--font-body); }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
input:hover:not(:disabled):not(:read-only), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--scroll-hover); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: var(--surface-alt); color: var(--muted); }
input[type=checkbox] { display: inline-block; width: 19px; height: 19px; min-height: 0; accent-color: var(--brand-ink); padding: 0; margin: 0; flex-shrink: 0; cursor: pointer; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
textarea { min-height: 170px; resize: none; }
label { display: block; color: var(--ink); font-size: 13px; font-weight: 600; margin-bottom: 18px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
h1 { font: 600 clamp(26px, 2.3vw, 34px)/1.2 var(--font-display); letter-spacing: -.8px; margin: 0 0 9px; }
h2 { font: 600 17px/1.35 var(--font-display); letter-spacing: -.2px; margin: 0; }
h3 { font: 600 15px/1.4 var(--font-body); margin: 14px 0 8px; }
p { margin: 8px 0 18px; }
small { font-size: 12px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.icon { flex-shrink: 0; vertical-align: middle; }
.gold { color: var(--brand-ink); }
.muted { color: var(--muted); }
.danger { color: var(--danger); }
.eyebrow { margin: 0 0 10px; font-size: 11px; font-weight: 650; letter-spacing: 1.3px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; padding: 10px 18px; background: var(--surface); color: var(--ink); z-index: var(--z-dialog); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.workspace { display: flex; min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); padding: 28px 16px 18px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; overflow-y: auto; z-index: var(--z-header); --scroll-track: var(--sidebar); --scroll-thumb: #506268; }
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--surface); font: 600 23px/1.2 var(--font-display); letter-spacing: -.5px; white-space: nowrap; padding: 2px 4px; }
.wordmark:hover { color: var(--surface); text-decoration: none; }
.workspace-logo { flex-shrink: 0; object-fit: contain; padding: 3px; background: var(--surface); border-radius: var(--radius-control); }
.capture-thumbnail { display: flex; align-items: center; justify-content: center; width: 105px; height: 75px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-alt); }
.capture-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.capture-thumbnail span { padding: 8px; color: var(--muted); font-size: 12px; text-align: center; white-space: normal; }
.web-label { color: var(--sidebar-text); border: 1px solid #54656a; padding: 3px 4px; border-radius: 3px; font: 600 8px var(--font-body); letter-spacing: 1px; }
.nav-caption { color: var(--sidebar-muted); font-size: 10px; font-weight: 600; letter-spacing: 1.4px; padding: 40px 12px 14px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a, .sidebar-bottom>a { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 44px; border-radius: var(--radius-control); color: var(--sidebar-text); font-size: 13px; }
.sidebar a:hover { background: var(--sidebar-hover); color: var(--surface); text-decoration: none; }
.sidebar nav a.active, .sidebar-bottom>a.active { background: var(--sidebar-selected); color: #efdaa1; box-shadow: inset 3px 0 var(--brand); }
.sidebar-bottom { margin-top: auto; padding-top: 32px; }
.sidebar-bottom .incident-link { border: 1px solid #506167; color: var(--sidebar-text); margin-bottom: 12px; }
.profile { display: flex; gap: 11px; align-items: center; border-top: 1px solid #435459; margin-top: 20px; padding: 22px 5px 10px; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; background: #46584e; color: #f6ebbe; border-radius: 50%; flex-shrink: 0; font-size: 14px; }
.profile div { min-width: 0; }
.profile strong { display: block; color: var(--surface); font-size: 13px; font-weight: 600; }
.profile small { display: block; color: var(--sidebar-muted); font-size: 11px; overflow-wrap: anywhere; }
button.signout { color: var(--sidebar-text); background: transparent; padding: 8px; justify-content: flex-start; width: 100%; }
button.signout:hover:not(:disabled) { background: var(--sidebar-hover); }
.workspace-main { margin-left: var(--sidebar-width); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 68px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar>span { color: var(--muted); font-size: 11px; letter-spacing: 1px; font-weight: 600; }
.topbar>div { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.topbar a { margin-left: 14px; padding: 10px; border-left: 1px solid var(--line); color: var(--ink); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 5px; }
.page-content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 34px; flex: 1; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.page-heading .eyebrow { margin-bottom: 10px; }
.page-heading>.actions { flex-shrink: 0; }
.area-select { width: 168px; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); overflow: hidden; box-shadow: 0 2px 3px #202b3203; }
.padded { padding: var(--space-panel); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--line); min-height: 76px; }
.panel-heading h2 { display: flex; align-items: center; gap: 9px; }
.panel-heading p { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.padded .panel-heading { padding: 0 0 18px; margin-bottom: 22px; min-height: 0; }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--brand-ink); }
.text-link .icon { width: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
.stats-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); color: var(--ink); min-width: 0; border-top: 3px solid var(--line); }
a.stat:hover { text-decoration: none; border-color: var(--brand); }
.stat>span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.stat>span .icon { width: 18px; color: var(--subtle); }
.stat strong { display: block; margin: 9px 0 5px; font: 500 36px/1.2 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.stat strong small { color: var(--subtle); font: 400 20px var(--font-body); }
.stat em { font-size: 12px; font-style: normal; color: var(--muted); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(270px, 1fr); gap: 24px; align-items: start; }
.stack { display: grid; gap: 24px; align-content: start; }
.health-panel { padding: 0 24px 24px; }
.health-panel .panel-heading { padding: 20px 0; }
.health-number { margin-top: 20px; font: 500 54px/1.2 var(--font-display); letter-spacing: -2px; }
.health-panel>p { font-size: 13px; color: var(--muted); }
.health-track { height: 8px; margin: 22px 0 13px; border-radius: 5px; background: var(--line); overflow: hidden; }
.health-track span { display: block; height: 100%; background: var(--ok); }
.health-counts { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.community-card { background: var(--brand-soft); border: 1px solid #e5dfc2; border-radius: var(--radius-panel); padding: 24px; overflow: hidden; }
.community-card .eyebrow { color: var(--brand-ink); }
.community-card h2 { margin: 12px 0; font-size: 22px; line-height: 1.35; }
.community-card p { color: var(--muted); font-size: 13px; }
.community-card a { display: inline-flex; align-items: center; gap: 10px; color: var(--brand-ink); font-weight: 600; font-size: 13px; }
.community-card::after { content: ''; display: block; height: 110px; margin: 22px -24px -24px; background: url('/images/community-road.png') center 55%/cover; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.quick-links>a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); display: flex; align-items: center; gap: 16px; padding: 22px; color: var(--ink); }
.quick-links>a:hover { border-color: var(--brand); text-decoration: none; }
.quick-links>a>.icon:first-child { background: var(--brand-soft); padding: 11px; box-sizing: content-box; border-radius: 9px; color: var(--brand-ink); }
.quick-links>a>.icon:last-child { margin-left: auto; color: var(--muted); width: 17px; }
.quick-links strong { font-size: 14px; font-weight: 600; }
.quick-links small { display: block; margin-top: 4px; font-size: 12px; }
.table-wrap { overflow: auto; min-height: 200px; max-height: 680px; scrollbar-gutter: stable; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 13px; }
th { position: sticky; top: 0; background: var(--surface-alt); padding: 13px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: .5px; font-weight: 650; text-transform: uppercase; white-space: nowrap; z-index: 1; }
td { padding: 16px 20px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: middle; min-width: 90px; }
td:first-child { min-width: 140px; }
td:last-child { white-space: nowrap; }
td strong { color: var(--ink); font-weight: 600; }
td small { display: block; font-size: 12px; margin-top: 5px; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--surface-alt); }
.plate { display: inline-block; white-space: nowrap; background: var(--surface); border: 1px solid #aebbc0; border-left: 3px solid var(--brand); border-radius: 4px; color: var(--ink); padding: 5px 9px; font: 600 13px/1.4 var(--font-data); letter-spacing: .5px; }
.badge { display: inline-block; padding: 4px 9px; color: #53616a; background: #edf1f3; border: 1px solid #dce3e7; border-radius: 5px; font-size: 11px; line-height: 1.5; font-weight: 600; white-space: nowrap; }
.badge.known { background: var(--ok-soft); color: var(--ok); border-color: #cde5d5; }
.badge.suspicious { background: var(--warning-soft); color: var(--warning); border-color: #ecdcb5; }
.badge.dangerous { background: var(--danger-soft); color: var(--danger); border-color: #efd1ce; }
.empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; text-align: center; color: var(--muted); }
.empty>.icon { width: 32px; height: 32px; margin-bottom: 10px; color: var(--subtle); }
.empty h1, .empty h3 { color: var(--ink); text-align: center; }
.empty p { font-size: 13px; max-width: 48ch; }
.empty a { font-weight: 600; }
.empty button { margin-top: 12px; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 34px; border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 12px; }
.workspace-footer>span { font-size: 11px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; padding: 22px 24px; margin-bottom: 24px; }
.filter-bar label { flex: 1 1 145px; min-width: 0; margin: 0; }
.filter-fields { display: contents; }
.report-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; }
.report-filters .filter-fields { display: contents; }
.report-filters>.filter-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 18px; gap: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 22px; margin-bottom: 24px; }
.area-card { padding: 24px; }
.area-symbol { display: inline-flex; padding: 12px; background: var(--brand-soft); border-radius: 9px; color: var(--brand-ink); margin-bottom: 16px; }
.area-card>.badge { float: right; margin-top: 8px; }
.area-card h2 { font-size: 21px; }
.area-card p { color: var(--muted); font-size: 13px; }
.area-card .actions { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 28px 0 16px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.editor { margin-bottom: 26px; border-color: #c4c9ad; box-shadow: 0 4px 16px #202b3208; }
.editor>form:not(.filter-bar) { max-width: 900px; }
.editor .panel-heading { margin-bottom: 22px; }
.camera-group { margin-bottom: 22px; scroll-margin-top: 24px; }
.mono { font-family: var(--font-data); font-size: 12px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.inline-search { display: flex; align-items: center; gap: 10px; }
.inline-search input { margin: 0; }
.inline-search .search-control { width: 260px; }
.tabs { display: flex; gap: 20px; }
.tabs button { border-radius: 0; background: transparent; color: var(--muted); border-bottom: 2px solid transparent; padding: 12px 0; font-size: 13px; }
.tabs button.selected { border-color: var(--brand); color: var(--ink); }
.tabs button:hover:not(:disabled) { background: transparent; color: var(--brand-ink); }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 17px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 24px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 13px; }
dl { margin: 22px 0; }
dt { margin-top: 20px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; color: var(--muted); }
dd { margin: 6px 0 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.padded>p { color: var(--muted); font-size: 14px; }
.image-panel { padding: 16px; }
.image-panel img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: contain; border-radius: var(--radius-control); background: var(--surface-alt); margin-bottom: 16px; }
.notification { display: flex; gap: 18px; padding: 24px; border-bottom: 1px solid var(--line); }
.notification.unread { background: var(--surface-alt); box-shadow: inset 3px 0 var(--brand); }
.notification-icon { width: 40px; height: 40px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 9px; color: var(--brand-ink); flex-shrink: 0; }
.notification>div { flex: 1; min-width: 0; }
.notification h3 { margin-top: 0; }
.notification p { color: var(--muted); overflow-wrap: anywhere; }
.notification small { display: block; margin-bottom: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.toggle-row strong { font-weight: 600; font-size: 14px; }
.toggle-row small { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; padding-top: 18px; }
.area-choices { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 20px; }
.area-choices .check { padding: 0; }
.danger-zone { border-color: #e7cfcb; }
.danger-zone>button.danger-button { background: var(--surface); color: var(--danger); border-color: #d5aaa5; }
.network-map { margin-bottom: 24px; }
.google-camera-map { width: 100%; height: clamp(300px, 48vh, 520px); }
.camera-map-marker { position: relative; display: flex; justify-content: center; cursor: pointer; }
.camera-map-marker-label { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(220px, 60vw); padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: 600 13px/1.4 'Segoe UI', system-ui, sans-serif; text-align: center; overflow-wrap: anywhere; box-shadow: 0 2px 5px #0002; }
.camera-map-marker:hover .camera-map-marker-label { border-color: var(--brand-ink); }
.network-map>svg { display: block; width: 100%; max-height: 330px; }
.network-map a:hover circle { fill: var(--brand); }
.auth-layout { min-height: 100dvh; display: flex; flex-direction: column; background: var(--canvas); }
.auth-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px clamp(24px, 5vw, 76px); }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font: 600 26px/1.2 var(--font-display); letter-spacing: -.8px; }
.auth-brand:hover { text-decoration: none; color: var(--ink); }
.auth-brand img { object-fit: contain; display: block; }
.auth-support { color: var(--muted); font-size: 13px; font-weight: 500; }
.auth-support span { margin-left: 5px; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 24px 42px; }
.auth-panel { width: 100%; max-width: 500px; padding: 38px 40px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--radius-panel); box-shadow: 0 12px 40px #202b3208, 0 2px 6px #202b3203; }
.card { width: 100%; padding: 0; }
.card h1 { font: 600 30px/1.2 var(--font-display); letter-spacing: -.7px; margin-bottom: 10px; text-align: left; }
.auth-kicker { font-size: 10px; font-weight: 650; letter-spacing: 1.3px; color: var(--brand-ink); margin: 0 0 15px; }
.auth-description, .card .subtitle { color: var(--muted); font-size: 14px; margin: 0 0 29px; line-height: 1.6; }
.auth-panel label { font-size: 13px; margin-bottom: 19px; }
.auth-panel input { min-height: 46px; }
.auth-panel .row { display: flex; gap: 18px; }
.auth-panel .row label { flex: 1; min-width: 0; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-label-row label { margin: 0; }
.auth-label-row a { font-size: 12px; font-weight: 600; color: var(--brand-ink); }
.auth-panel .auth-submit { width: 100%; min-height: 46px; margin-top: 24px; background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 600; position: relative; }
.auth-panel .auth-submit:hover:not(:disabled) { background: var(--sidebar-hover); }
.auth-submit>span { position: absolute; right: 17px; font-size: 20px; font-weight: 400; }
.auth-panel .error { margin: 18px 0 0; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 23px; margin: 27px 0 0; }
.auth-switch a { color: var(--brand-ink); font-weight: 650; margin-left: 3px; }
.auth-note { font-size: 11px; text-align: center; color: var(--muted); margin: 17px 0 0; }
.auth-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px clamp(24px, 5vw, 76px); font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.auth-footer>span:first-child { font-weight: 600; }
.field-help { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 6px; }
.social-login { text-align: center; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.social-login>span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.social-login-buttons { display: grid; gap: 10px; }
.social-login-buttons button { width: 100%; }
.social-login>p { margin: 12px 0 0; font-size: 12px; }
.social-login .link-button { display: inline; min-height: 24px; padding: 0; }
@media (max-width: 600px) {
    .auth-header { padding: 22px 22px 15px; }
    .auth-brand { font-size: 23px; gap: 10px; }
    .auth-brand img { width: 32px; height: 37px; }
    .auth-support { font-size: 12px; }
    .auth-main { padding: 20px 18px 32px; align-items: flex-start; }
    .auth-panel { padding: 29px 25px; border-radius: 10px; }
    .auth-panel .row { display: block; }
    .auth-footer { padding: 18px 22px; font-size: 10px; }
    .card h1 { font-size: 28px; }
}
.secret-control { display: block; position: relative; }
.secret-control>input { padding-right: 64px; }
.secret-toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; min-height: 0; padding: 4px 8px; background: transparent; color: var(--brand-ink); font-size: 12px; }
.secret-toggle:hover:not(:disabled) { background: var(--brand-soft); }
.search-control { position: relative; display: flex; align-items: center; width: 100%; min-width: 0; }
.search-control>.icon { position: absolute; left: 12px; width: 17px; color: var(--muted); pointer-events: none; }
.search-control>input { padding-left: 38px; padding-right: 40px; margin-top: 0; }
label>.search-control { margin-top: 7px; }
.search-clear { position: absolute; right: 5px; min-height: 30px; min-width: 30px; padding: 0; background: transparent; color: var(--muted); font-size: 22px; font-weight: 400; }
.search-clear:hover:not(:disabled) { background: var(--surface-alt); }
.field-error, .validation-message { display: block; margin-top: 6px; font-size: 12px; color: var(--danger); font-weight: 400; }
input[aria-invalid=true], select[aria-invalid=true], input.invalid, select.invalid { border-color: var(--danger); }
.validation-errors { color: var(--danger); padding-left: 20px; }
.error, .success { border-radius: var(--radius-control); padding: 13px 16px; margin: 0 0 18px; font-size: 13px; }
.error { color: var(--danger); background: var(--danger-soft); }
.success { color: var(--ok); background: var(--ok-soft); }
.page-progress { position: fixed; inset: 0; z-index: var(--z-feedback); display: grid; place-items: center; background: rgb(255 255 255 / 45%); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); pointer-events: none; }
.loading-content { display: flex; flex-direction: column; align-items: center; color: var(--ink); transform: translateY(32px); }
.loading-content>span { font-size: 14px; font-weight: 600; }
.feedback-viewport { position: fixed; z-index: var(--z-feedback); bottom: 22px; right: 24px; width: min(440px, calc(100vw - 40px)); display: grid; gap: 10px; }
.feedback-message { display: flex; gap: 12px; margin: 0; border: 1px solid currentColor; box-shadow: 0 6px 24px #202b3215; }
.feedback-message p { margin: 4px 0 0; }
.feedback-message strong { font-weight: 650; }
.feedback-message>.icon, .feedback-message>span { margin-top: 2px; flex-shrink: 0; }
.confirmation-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px #101e3040; overflow: auto; z-index: var(--z-dialog); }
.confirmation-dialog::backdrop { background: #10202988; }
.dialog-heading { display: flex; align-items: center; gap: 13px; padding: 24px 26px 0; }
.dialog-heading h2 { font-size: 22px; }
.dialog-symbol { padding: 10px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); }
.dialog-body { padding: 16px 26px 20px; }
.dialog-body>p { color: var(--muted); margin: 0; line-height: 1.7; }
.dialog-body>label { margin: 18px 0 0; }
.dialog-body .error { margin-top: 16px; }
.dialog-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px; background: var(--surface-alt); border-top: 1px solid var(--line); }
.dialog-actions button { min-width: 105px; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 800ms linear infinite; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; width: 100%; background: var(--warning-soft); padding: 16px 24px; z-index: var(--z-feedback); color: var(--warning); }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
#startup-error-details { margin-top: 12px; }
#startup-error-details summary { cursor: pointer; }
#startup-error-message { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30vh; overflow-y: auto; font: 12px/1.5 var(--font-data); }
html:has(.startup-loading) { scrollbar-gutter: auto; background: #fff; }
.startup-loading { position: fixed; inset: 0; display: grid; place-items: center; background: #fff; }
.logo-loader { position: relative; aspect-ratio: 16 / 9; }
.startup-logo { width: min(720px, 90vw, 115vh); }
.compact-logo { width: min(320px, 80vw); }
.logo-animation, .logo-still { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-animation { position: absolute; inset: 0; visibility: hidden; }
.logo-loader[data-ready="true"] .logo-animation { visibility: visible; }
.logo-loader[data-ready="true"] .logo-still { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
    .logo-loader[data-ready="true"] .logo-animation { visibility: hidden; }
    .logo-loader[data-ready="true"] .logo-still { visibility: visible; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1250px) {
    .overview-grid { grid-template-columns: 1fr; }
    .overview-grid>.stack { grid-template-columns: 1fr 1fr; }
    .page-heading { flex-wrap: wrap; }
    .stats-grid { gap: 14px; }
    .stat { padding: 18px; }
    .panel-heading { flex-wrap: wrap; }
}
@media (max-width: 1020px) {
    :root { --sidebar-width: 208px; }
    .page-content { padding: 28px 24px; }
    .topbar { padding: 0 24px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid, .settings-grid { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: 1fr; }
    .wordmark { font-size: 20px; gap: 8px; }
    .sidebar { padding-inline: 12px; }
    .sidebar nav a, .sidebar-bottom>a { gap: 10px; }
    .report-filters { grid-template-columns: 1fr 1fr; }
    .workspace-footer { margin-inline: 24px; }
    .inline-search { flex: 1; }
    .inline-search .search-control { width: 100%; }
}
@media (max-width: 760px) {
    .workspace { display: block; }
    .sidebar { position: relative; width: 100%; padding: 15px 18px; overflow: visible; }
    .sidebar>.wordmark { font-size: 23px; }
    .sidebar .nav-caption { display: none; }
    .sidebar nav { display: flex; overflow-x: auto; gap: 5px; margin: 16px -4px 0; padding: 4px 4px 7px; }
    .sidebar nav a { flex-shrink: 0; padding: 10px 12px; min-height: 40px; }
    .sidebar nav a .icon { width: 17px; }
    .sidebar nav a.active { box-shadow: inset 0 -3px var(--brand); }
    .sidebar-bottom { display: flex; align-items: center; gap: 10px; padding-top: 7px; flex-wrap: wrap; }
    .sidebar-bottom>a, .sidebar-bottom .incident-link { min-height: 36px; padding: 7px 10px; margin: 0; font-size: 12px; border: none; }
    .sidebar-bottom>a .icon { width: 16px; }
    .profile { display: none; }
    button.signout { width: auto; min-height: 36px; padding: 7px 10px; font-size: 12px; margin-left: auto; }
    button.signout .icon { width: 16px; }
    .workspace-main { margin-left: 0; }
    .topbar { min-height: 48px; padding: 0 20px; }
    .topbar>span { font-size: 10px; }
    .topbar>div { font-size: 11px; }
    .page-content { padding: 25px 20px 35px; }
    .page-heading { gap: 19px; margin-bottom: 24px; }
    .page-heading>.actions { width: 100%; }
    .stats-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .overview-grid>.stack { grid-template-columns: 1fr; }



    .filter-bar { padding: 20px; gap: 16px; }
    .panel-heading { padding: 20px; gap: 15px; }
    .padded { padding: 22px; }
    .workspace-footer { margin-inline: 20px; font-size: 11px; }
    .workspace-footer>span { font-size: 10px; }
    .feedback-viewport { right: 16px; bottom: 16px; }
    .table-wrap { max-height: 540px; }
    td, th { padding-inline: 16px; }
    .report-filters { grid-template-columns: 1fr 1fr; }
    .report-filters label:first-child { grid-column: 1/-1; }
}
@media (max-width: 460px) {
    .page-content { padding-inline: 16px; }
    .topbar { padding-inline: 16px; }
    .topbar>div { font-size: 0; }
    .topbar .status-dot { display: none; }
    .topbar a { margin-left: 0; border-left: none; }
    .stats-grid { gap: 12px; }
    .stats-grid.three { grid-template-columns: 1fr; }
    .stats-grid.three .stat { display: grid; grid-template-columns: 1fr auto; align-items: center; }
    .stats-grid.three .stat strong { grid-column: 2; grid-row: 1/3; margin: 0; }
    .stat { padding: 17px; }
    .stat strong { font-size: 32px; }
    .stat em { font-size: 11px; }
    .form-grid { grid-template-columns: 1fr; }
    .filter-bar label { flex-basis: 100%; }
    .report-filters { grid-template-columns: 1fr; }
    .inline-search { width: 100%; }
    .tabs { gap: 17px; }
    .workspace-footer>span { display: none; }
    .card .row { display: block; }
    .dialog-actions { padding: 16px; }
    .pagination { padding: 16px; gap: 8px; flex-wrap: wrap; }
    .pagination button { padding-inline: 12px; }
    .sidebar-bottom { gap: 0; }
    .sidebar-bottom>a { padding-inline: 7px; }
    .sidebar-bottom .icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
    * { scrollbar-color: auto; }
    :where(a, button, input, select, textarea):focus-visible { outline-color: Highlight; }
    .badge, .plate, .stat, .panel { border-color: CanvasText; }
    .confirmation-dialog::backdrop { background: Canvas; opacity: .8; }
}
