:root {
  --ink: #18332b;
  --ink-muted: #5e706a;
  --paper: #f4f2ea;
  --surface: #fffdf7;
  --forest: #1d5b49;
  --forest-deep: #124236;
  --moss: #8faa74;
  --sand: #ded7c7;
  --water: #3e7691;
  --amber: #a46322;
  --amber-soft: #fff2da;
  --line: #dcd8cd;
  --shadow: 0 18px 48px rgba(35, 56, 48, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
a { color: var(--forest-deep); text-underline-offset: 0.18em; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #e2a83a; outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  transform: translateY(-150%);
  border-radius: 0.5rem;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  min-height: 78px;
  padding: 0 4vw;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid rgba(24, 51, 43, 0.1);
  background: rgba(255, 253, 247, 0.94);
}
.brand { display: inline-flex; align-items: center; gap: 0.8rem; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50% 50% 45% 55%;
  background: var(--forest);
  color: white;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; letter-spacing: 0.01em; }
.brand small { margin-top: 0.12rem; color: var(--ink-muted); font-size: 0.74rem; letter-spacing: 0.07em; text-transform: uppercase; }
.site-header nav { display: flex; align-self: stretch; gap: 0.35rem; }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-header nav a[aria-current="page"] { color: var(--forest-deep); border-color: var(--forest); }
.account-menu { justify-self: end; display: flex; align-items: center; gap: 0.6rem; font-size: 0.84rem; }
.account-menu form { margin: 0; }
.role-badge, .status-label {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f1e8;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.text-button { border: 0; background: none; color: var(--forest-deep); cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.secondary-button { display: inline-flex; align-items: center; min-height: 42px; padding: 0.65rem 0.85rem; border: 1px solid #adc0b7; border-radius: 0.55rem; background: #f5f7f2; color: var(--forest-deep); cursor: pointer; font-size: 0.84rem; font-weight: 750; text-decoration: none; }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }

.coverage-banner {
  padding: 0.7rem 4vw;
  border-bottom: 1px solid #e6c38d;
  background: var(--amber-soft);
  color: #674016;
  font-size: 0.88rem;
  text-align: center;
}
.coverage-banner a { margin-left: 0.5rem; color: #674016; font-weight: 750; }

.page-shell { width: min(1240px, 92vw); margin: 0 auto; padding: 3.2rem 0 5rem; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 3rem; }
.compact-page-heading { margin-bottom: 2rem; }
.breadcrumb { display: flex; gap: 0.55rem; margin: -1rem 0 2rem; color: var(--ink-muted); font-size: 0.8rem; }
.eyebrow { margin: 0 0 0.6rem; color: var(--forest); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; color: var(--ink); font-weight: 500; }
h1 { max-width: 820px; margin-bottom: 0.8rem; font-size: clamp(2.35rem, 5vw, 4.7rem); line-height: 0.98; letter-spacing: -0.045em; }
h2 { margin-bottom: 0; font-size: clamp(1.55rem, 2.6vw, 2.15rem); line-height: 1.08; letter-spacing: -0.025em; }
h3 { margin-bottom: 0; font-size: 1.35rem; line-height: 1.15; }
.lede { max-width: 760px; margin: 0; color: var(--ink-muted); font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.6; }
.coverage-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.56rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.8rem; font-weight: 750; }
.coverage-chip span { width: 9px; height: 9px; border-radius: 50%; background: var(--moss); box-shadow: 0 0 0 4px rgba(143, 170, 116, 0.18); }
.coverage-chip.attention { border-color: #e2bd7e; background: var(--amber-soft); color: #744819; }
.coverage-chip.attention span { background: var(--amber); box-shadow: 0 0 0 4px rgba(164, 99, 34, 0.15); }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin: 0 0 1.35rem; }
.section-heading.compact { align-items: start; margin-bottom: 1.5rem; }
.section-heading.compact > a { font-size: 0.78rem; }
.section-tools { display: grid; justify-items: end; gap: 0.35rem; }
.section-tools > a { font-size: 0.78rem; }
.candidate-pattern-heading { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.definition { max-width: 540px; margin: 0; color: var(--ink-muted); font-size: 0.87rem; line-height: 1.55; }
.large-definition { max-width: none; margin-bottom: 1rem; font-size: 0.95rem; }
.page-actions { margin-top: 1rem; }
.filter-panel { margin: -1rem 0 3rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 1rem; background: rgba(255, 253, 247, 0.72); }
.filter-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.filter-heading .eyebrow { margin-bottom: 0.25rem; }
.filter-heading > div > strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 500; }
.filter-heading a { font-size: 0.82rem; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.filter-grid label { display: grid; align-content: start; gap: 0.35rem; color: var(--ink-muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.035em; text-transform: uppercase; }
.filter-grid input, .filter-grid select { width: 100%; min-height: 42px; padding: 0.55rem 0.65rem; border: 1px solid #bfc5bb; border-radius: 0.5rem; background: white; color: var(--ink); font-size: 0.84rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.filter-grid select[multiple] { min-height: 86px; }
.filter-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.filter-actions .primary-button { margin-top: 0; }
.filter-actions span { color: var(--ink-muted); font-size: 0.76rem; }
.filter-error { margin: -1rem 0 2rem; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 2.7rem; }
.metric-card { min-height: 155px; padding: 1.25rem; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: 0 8px 30px rgba(35, 56, 48, 0.035); }
.metric-card > span { color: var(--ink-muted); font-size: 0.78rem; font-weight: 750; letter-spacing: 0.03em; text-transform: uppercase; }
.metric-card strong { margin: auto 0 0.45rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.1rem, 3.2vw, 3.25rem); font-weight: 500; line-height: 1; }
.metric-card small { color: var(--ink-muted); font-size: 0.76rem; line-height: 1.4; }
.metric-card.primary { background: var(--forest-deep); color: white; border-color: var(--forest-deep); }
.metric-card.primary > span, .metric-card.primary small { color: #d8e5df; }
.metric-card.warning { border-color: #e3c58f; background: #fffbf1; }
.metric-card.share { background: #e9efe2; border-color: #cedbbf; }
.time-value { font-size: 1.35rem !important; line-height: 1.15 !important; }

.content-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 1rem; }
.content-grid > * { min-width: 0; }
.content-grid.equal-grid { grid-template-columns: 1fr 1fr; }
.content-grid.explore-grid { grid-template-columns: 1fr minmax(250px, 0.38fr); }
.panel { min-width: 0; margin-bottom: 1rem; padding: clamp(1.2rem, 2.4vw, 2rem); border: 1px solid var(--line); border-radius: 1.2rem; background: var(--surface); box-shadow: var(--shadow); }
.bar-list { display: grid; gap: 1rem; margin-bottom: 2rem; }
.bar-list > div { display: grid; grid-template-columns: 110px 1fr 35px; gap: 0.75rem; align-items: center; font-size: 0.84rem; }
.bar-list strong { text-align: right; }
meter { width: 100%; height: 0.9rem; border: 0; border-radius: 99px; background: #ece9df; }
meter::-webkit-meter-bar { border: 0; border-radius: 99px; background: #ece9df; }
meter::-webkit-meter-optimum-value { border-radius: 99px; background: var(--forest); }
meter::-moz-meter-bar { border-radius: 99px; background: var(--forest); }
.gate-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0 0 1.5rem; }
.gate-summary > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.65rem; padding: 1rem; border-radius: 0.8rem; background: #f0f3ed; }
.gate-summary strong { grid-column: 2; font-family: Georgia, "Times New Roman", serif; font-size: 2.5rem; font-weight: 500; }
.direction-icon { grid-row: 1 / span 2; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: 50%; background: var(--forest); color: white; font-size: 1.3rem; }
.direction-icon.outbound { background: var(--water); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table caption { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0 0 0 0); }
.data-table th, .data-table td { padding: 0.8rem 0.65rem; border-bottom: 1px solid var(--line); text-align: left; }
.data-table thead th { color: var(--ink-muted); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.data-table tbody th { font-weight: 600; }
.data-table td:last-child { font-variant-numeric: tabular-nums; }
.compact-table { max-width: 450px; }
.table-scroll { overflow-x: auto; }
.status-label.open { color: #7a3f19; background: #fff0dd; border-color: #ecc48f; }
.status-label.unresolved { color: #6e5315; background: #fff8d9; border-color: #eadb86; }
.status-label.reconciled { color: #295842; background: #ebf5ed; border-color: #bdd6c5; }
.status-label.site_related { color: #295842; background: #ebf5ed; border-color: #bdd6c5; }
.status-label.pass_through { color: #24546a; background: #e9f3f7; border-color: #bad2dc; }
.status-label.unknown { color: #6e5315; background: #fff8d9; border-color: #eadb86; }
.detail-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.detail-list > div { padding-right: 1rem; border-right: 1px solid var(--line); }
.detail-list > div:last-child { border: 0; }
.detail-list dt { margin-bottom: 0.45rem; color: var(--ink-muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.detail-list dd { margin: 0; font-size: 0.92rem; }
.empty-state { padding: 1.4rem; margin-bottom: 1.5rem; border: 1px dashed #cfcabc; border-radius: 0.8rem; background: #f8f6ef; }
.empty-state p { margin: 0.4rem 0 0; color: var(--ink-muted); font-size: 0.86rem; line-height: 1.5; }
.healthy-empty { border-color: #bad3bd; background: #f0f7ef; }
.comparison-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: -1rem 0 2.7rem; overflow: hidden; border: 1px solid var(--line); border-radius: 1rem; background: var(--line); }
.comparison-strip > div { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1rem; padding: 1rem 1.2rem; background: var(--surface); }
.comparison-strip span { color: var(--ink-muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.comparison-strip strong { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; }
.comparison-strip small { color: var(--ink-muted); }
.hour-chart { display: grid; gap: 0.65rem; margin: 0 0 2rem; }
.compact-chart { margin-bottom: 1.2rem; }
.hour-bar { display: grid; grid-template-columns: minmax(160px, 220px) 1fr 35px; align-items: center; gap: 0.75rem; font-size: 0.8rem; }
.hour-bar time { color: var(--ink-muted); }
.hour-bar strong { text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { height: 0.72rem; overflow: hidden; border-radius: 999px; background: #ece9df; }
.bar-track > span { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: var(--forest); }
.breakdown-list { display: grid; gap: 0.8rem; margin: 0; }
.breakdown-list > div { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.breakdown-list > div:last-child { border: 0; }
.breakdown-list dt { font-weight: 700; }
.breakdown-list dd { grid-row: 1 / span 2; grid-column: 2; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; }
.breakdown-list small { color: var(--ink-muted); }
.type-list { display: grid; gap: 0.9rem; }
.type-list > div { display: grid; grid-template-columns: minmax(90px, 0.8fr) 1fr 35px 50px; align-items: center; gap: 0.7rem; font-size: 0.84rem; }
.type-list strong { text-align: right; }
.type-list small { color: var(--ink-muted); text-align: right; }
.heatmap-scroll { padding-bottom: 0.5rem; }
.heatmap-table { width: 100%; min-width: 980px; border-spacing: 3px; font-size: 0.7rem; table-layout: fixed; }
.heatmap-table caption { position: absolute; overflow: hidden; width: 1px; height: 1px; clip: rect(0 0 0 0); }
.heatmap-table th { color: var(--ink-muted); font-weight: 700; text-align: center; }
.heatmap-table th:first-child { width: 48px; text-align: left; }
.heatmap-table td { height: 31px; border: 1px solid rgba(24, 51, 43, 0.08); border-radius: 0.28rem; text-align: center; font-variant-numeric: tabular-nums; }
.heatmap-table td span { opacity: 0.82; }
.heatmap-table td a { display: grid; height: 100%; place-items: center; color: inherit; font-weight: 750; }
.heat-0 { background: #f2f0e8; }
.heat-1 { background: #dce7d5; }
.heat-2 { background: #bed5b7; }
.heat-3 { background: #8faf83; color: #17332b; }
.heat-4 { background: #4f8068; color: white; }
.heat-5 { background: var(--forest-deep); color: white; }
.heat-legend { display: flex; justify-content: flex-end; align-items: center; gap: 0.3rem; margin-top: 0.8rem; color: var(--ink-muted); font-size: 0.72rem; }
.heat-legend i { width: 20px; height: 12px; border: 1px solid rgba(24, 51, 43, 0.08); border-radius: 0.2rem; }
.explore-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.result-count { color: var(--ink-muted); font-size: 0.82rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; color: var(--ink-muted); font-size: 0.82rem; }
.identity-search-panel { border-color: #c8d7cd; }
.inline-search-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 1rem; align-items: end; }
.inline-search-form > div { display: grid; gap: 0.4rem; }
.inline-search-form label { font-size: 0.78rem; font-weight: 750; }
.inline-search-form input { width: 100%; min-height: 48px; padding: 0.72rem 0.8rem; border: 1px solid #bfc5bb; border-radius: 0.55rem; background: white; color: var(--ink); letter-spacing: 0.06em; text-transform: uppercase; }
.inline-search-form input:focus { border-color: var(--forest); }
.inline-search-form small { color: var(--ink-muted); font-size: 0.74rem; }
.inline-search-form .primary-button { margin-top: 0; white-space: nowrap; }
.vehicle-table { min-width: 1040px; }
.plate-link { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; letter-spacing: 0.05em; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0.25rem 0.5rem; border: 1px solid #bfd0c4; border-radius: 999px; background: #edf4ec; color: var(--forest-deep); font-size: 0.7rem; font-weight: 750; }
.muted-text { color: var(--ink-muted); }
.status-label.retained { color: #295842; background: #ebf5ed; border-color: #bdd6c5; }
.status-label.expired { color: #675d4e; background: #f1eee7; border-color: #d5cfc1; }
.breakdown-list dd.text-value { max-width: 170px; font-family: inherit; font-size: 0.88rem; font-weight: 650; line-height: 1.35; text-align: right; }
.vehicle-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.passage-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card strong.text-metric { font-family: inherit; font-size: clamp(1rem, 1.8vw, 1.35rem); font-weight: 750; line-height: 1.25; }
.reason-line { margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.privacy-note { margin: 1rem 0 0; color: var(--ink-muted); font-size: 0.76rem; text-align: center; }
.narrow-panel { max-width: 760px; }
.compact-admin-metrics { grid-template-columns: repeat(2, minmax(0, 260px)); }
.admin-tag-table { min-width: 680px; }
.tag-swatch { width: 0.72rem; height: 0.72rem; display: inline-block; margin-right: 0.45rem; border: 1px solid rgba(24, 51, 43, 0.2); border-radius: 50%; background: var(--tag-color); vertical-align: -0.05rem; }
.admin-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.admin-form > div { display: grid; gap: 0.4rem; }
.admin-form label, .tag-change-form label { color: var(--ink); font-size: 0.78rem; font-weight: 750; }
.admin-form input:not([type="checkbox"]), .admin-form select, .admin-form textarea, .tag-change-form select { width: 100%; min-height: 46px; padding: 0.68rem 0.75rem; border: 1px solid #bfc5bb; border-radius: 0.55rem; background: white; color: var(--ink); }
.admin-form textarea { min-height: 92px; resize: vertical; }
.admin-form small { color: var(--ink-muted); font-size: 0.74rem; line-height: 1.4; }
.admin-form input[type="color"] { max-width: 90px; padding: 0.25rem; }
.admin-form .errorlist { margin: 0; padding-left: 1.2rem; color: #7a3f19; font-size: 0.78rem; }
.check-row { display: flex; align-items: center; gap: 0.65rem; min-height: 44px; }
.check-row input { width: 1.1rem; height: 1.1rem; }
.tag-management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.tag-management-card { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 0.8rem; background: #f8f7f1; }
.tag-management-card > div:first-child { display: grid; grid-template-columns: auto 1fr; align-items: center; }
.tag-management-card > div:first-child small { grid-column: 2; margin-top: 0.2rem; color: var(--ink-muted); }
.tag-management-card > .status-label { margin-top: 0.8rem; }
.tag-change-form { display: grid; gap: 0.55rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.tag-change-form .secondary-button { justify-content: center; }
.confirmation-panel { border-color: #b7cdbd; background: #f3f7f1; }
.confirmation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 1.5rem; }
.confirmation-actions .primary-button { margin-top: 0; }
.preview-details { margin-top: 1.5rem; }
.filter-summary { margin: -1rem 0 1rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--surface); font-size: 0.82rem; }
.filter-summary a { margin-left: 0.6rem; }
.audit-table { min-width: 880px; }
.audit-metadata { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin: 1.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.audit-metadata div { padding: 0.8rem; border-radius: 0.6rem; background: #f4f3ed; }
.audit-metadata dt { color: var(--ink-muted); font-size: 0.7rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.audit-metadata dd { margin: 0.35rem 0 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.opaque-id { overflow-wrap: anywhere; }
.correction-grid { align-items: start; }
.correction-grid .panel { height: 100%; }
.choice-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-fieldset legend { margin-bottom: 0.5rem; font-size: 0.78rem; font-weight: 750; }
.choice-fieldset ul { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.choice-fieldset label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem; align-items: start; padding: 0.7rem; border: 1px solid var(--line); border-radius: 0.55rem; background: #f8f7f1; line-height: 1.35; }
.choice-fieldset input { width: 1.05rem; height: 1.05rem; margin-top: 0.08rem; }
.preview-selection, .encrypted-note { margin-top: 1rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 0.65rem; background: rgba(255, 255, 255, 0.7); }
.preview-selection ul { margin: 0.55rem 0 0; padding-left: 1.2rem; }
.preview-selection li + li { margin-top: 0.35rem; }
.encrypted-note p { margin: 0.45rem 0 0; color: var(--ink-muted); }
.correction-table { min-width: 820px; }
.content-grid.vehicle-history-grid { grid-template-columns: 1fr; }
.vehicle-history-grid .data-table { min-width: 650px; }
.event-reference-list { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; min-width: 130px; }
.event-reference-list a { white-space: nowrap; }

footer { padding: 1.5rem 4vw 2.5rem; border-top: 1px solid rgba(24, 51, 43, 0.1); color: var(--ink-muted); font-size: 0.76rem; text-align: center; }

.login-page { display: grid; place-items: center; padding: 2rem; background: radial-gradient(circle at 20% 10%, #f9f3dc 0, transparent 35%), linear-gradient(145deg, #ecf0e7, #f5f1e7 55%, #e2ebe5); }
.login-card { width: min(100%, 470px); padding: clamp(1.7rem, 5vw, 3rem); border: 1px solid rgba(24, 51, 43, 0.13); border-radius: 1.4rem; background: rgba(255, 253, 247, 0.96); box-shadow: 0 30px 80px rgba(35, 56, 48, 0.16); }
.login-brand { margin-bottom: 3.5rem; }
.login-card h1 { font-size: clamp(2.4rem, 8vw, 3.7rem); }
.stacked-form { display: grid; margin-top: 2rem; }
.stacked-form label { margin: 0.9rem 0 0.4rem; color: var(--ink); font-size: 0.78rem; font-weight: 750; }
.stacked-form input { width: 100%; min-height: 48px; padding: 0.72rem 0.8rem; border: 1px solid #bfc5bb; border-radius: 0.55rem; background: white; color: var(--ink); }
.stacked-form input:focus { border-color: var(--forest); }
.primary-button { min-height: 48px; margin-top: 1.35rem; padding: 0.75rem 1.1rem; border: 1px solid var(--forest-deep); border-radius: 0.55rem; background: var(--forest-deep); color: white; font-weight: 750; cursor: pointer; text-decoration: none; }
.primary-button:hover { background: var(--forest); }
.primary-button.inline { display: inline-flex; align-items: center; margin-top: 1rem; }
.form-error { margin-top: 1.3rem; padding: 0.8rem; border-left: 4px solid var(--amber); background: var(--amber-soft); color: #6f4318; font-size: 0.86rem; }
.login-footnote { margin: 2rem 0 0; color: var(--ink-muted); font-size: 0.76rem; text-align: center; }
.error-page { max-width: 680px; padding: 5rem 0; }
.error-page p:not(.eyebrow) { color: var(--ink-muted); font-size: 1.1rem; }

@media (max-width: 950px) {
  .site-header { grid-template-columns: 1fr auto; gap: 1rem; padding: 0.75rem 4vw; }
  .site-header nav { grid-row: 2; grid-column: 1 / -1; min-height: 44px; border-top: 1px solid var(--line); }
  .site-header nav a { padding: 0 0.8rem; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid.equal-grid { grid-template-columns: 1fr; }
  .content-grid.explore-grid { grid-template-columns: 1fr; }
  .explore-metrics { grid-template-columns: 1fr 1fr; }
  .detail-list { grid-template-columns: 1fr 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .vehicle-metrics { grid-template-columns: 1fr 1fr; }
  .passage-metrics { grid-template-columns: 1fr 1fr; }
  .tag-management-grid { grid-template-columns: 1fr; }
  .audit-metadata { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .site-header { display: flex; flex-wrap: wrap; }
  .site-header .brand { flex: 1 1 170px; }
  .account-menu > span:first-child { display: none; }
  .site-header nav { order: 3; flex: 1 0 100%; display: grid; grid-template-columns: 1fr 1fr; margin-top: 0.35rem; }
  .site-header nav a { min-height: 44px; justify-content: center; padding: 0 0.3rem; font-size: 0.82rem; }
  .coverage-banner { text-align: left; line-height: 1.45; }
  .coverage-banner a { display: inline-block; margin-left: 0; }
  .page-shell { width: min(92vw, 540px); padding-top: 2.3rem; }
  .page-heading { display: grid; align-items: start; margin-bottom: 2.3rem; }
  h1 { font-size: clamp(2.3rem, 12vw, 3.5rem); }
  .section-heading { display: grid; gap: 0.6rem; }
  .section-tools { justify-items: start; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 135px; }
  .metric-card:first-child { grid-column: 1 / -1; }
  .metric-card strong { font-size: 2.5rem; }
  .bar-list > div { grid-template-columns: 90px 1fr 30px; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list > div { padding: 0 0 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .filter-panel { margin-top: 0; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-actions { align-items: flex-start; flex-direction: column; }
  .button-row { justify-content: flex-start; }
  .inline-search-form { grid-template-columns: 1fr; }
  .inline-search-form .primary-button { width: 100%; justify-content: center; }
  .comparison-strip { grid-template-columns: 1fr; }
  .hour-bar { grid-template-columns: minmax(105px, 150px) 1fr 28px; }
  .type-list > div { grid-template-columns: minmax(80px, 0.8fr) 1fr 28px 42px; }
  .login-page { padding: 1rem; }
  .login-card { padding: 1.5rem; }
  .login-brand { margin-bottom: 2.5rem; }
  .vehicle-metrics { grid-template-columns: 1fr; }
  .passage-metrics { grid-template-columns: 1fr; }
  .compact-admin-metrics { grid-template-columns: 1fr; }
  .audit-metadata { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .role-badge { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card:first-child { grid-column: auto; }
  .gate-summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .site-header nav, .account-menu, .coverage-banner form { display: none; }
  .site-header { display: block; border: 0; padding: 0 0 1rem; }
  .page-shell { width: 100%; padding: 1rem 0; }
  .metric-card, .panel { break-inside: avoid; box-shadow: none; }
  body { background: white; }
}
