@import url("theme.css");

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--night); color: var(--ink); font-family: var(--body); line-height: 1.5; }
[hidden] { display: none !important; }
img, canvas { display: block; max-width: 100%; }
button, select, input { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--electric); outline-offset: 5px; }
h1,h2,h3,h4,p { margin: 0; }
h1,h2,h3 { font-family: var(--display); line-height: 1.06; font-weight: 550; letter-spacing: -.047em; }
h2 { font-size: clamp(36px, 5.4vw, 78px); }
h3 { font-size: 24px; letter-spacing: -.035em; }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.shell { width: min(100% - var(--gutter) * 2, 1350px); margin-inline: auto; }
.eyebrow { color: var(--muted); font-family: var(--mono); font-size: 10.5px; line-height: 1.4; text-transform: uppercase; letter-spacing: .12em; font-weight: 400; }
.signal { display: flex; align-items: center; gap: 10px; }
.signal::before { content: ""; width: 17px; height: 1px; background: var(--electric); }
.skip-link { position: fixed; z-index: 20; left: 20px; top: 10px; background: var(--electric); color: var(--dark-ink); padding: 10px 18px; transform: translateY(-150%); border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.noscript { margin-block: 20px; }
.site-header { position: sticky; top: 0; z-index: 10; background: #0e1118f5; border-bottom: 1px solid #c1d2ff18; backdrop-filter: blur(14px); }
.header-inner { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.main-nav { display: flex; align-items: center; gap: 7px; }
.main-nav a { font-size: 14px; font-weight: 550; color: var(--muted); min-height: 42px; display: grid; place-items: center; padding: 0 14px; border-radius: 7px; transition: color .2s, background .2s; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); background: #c2d4ff0e; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 48px; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; font: 500 12px/1.35 var(--mono); letter-spacing: .015em; white-space: nowrap; cursor: pointer; transition: background .22s, color .22s, border-color .22s, transform .25s var(--ease); }
.button:active { transform: translateY(1px); }
.button span[aria-hidden] { font-size: 17px; font-weight: 500; }
.header-cta { justify-self: end; min-height: 39px; padding: 7px 12px 7px 14px; color: var(--ink); border-color: #dce6ff2b; }
.header-cta:hover, .button-outline:hover { background: #e1e9fb12; border-color: #dce6ff5a; }
.button-primary { color: white; background: var(--cobalt); border-color: var(--cobalt); box-shadow: 0 6px 28px #315efe35; }
.button-primary:hover { background: #2555ed; border-color: #2555ed; transform: translateY(-2px); }
.button-outline { color: var(--ink); background: transparent; border-color: var(--line); }
.button-dark { color: var(--cream); background: var(--dark-ink); }
.button-dark:hover { background: #2e3e5b; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.text-link { display: inline-flex; gap: 8px; align-items: center; width: fit-content; color: var(--electric); font-size: 14px; font-weight: 650; text-underline-offset: 4px; }
.text-link:hover { text-decoration: underline; }

.release-top, .panel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; border: 1px solid currentColor; border-radius: 4px; padding: 3px 7px; font: 10px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.pill-go { color: var(--go); background: #76aefa13; }
.pill-stop { color: var(--stop); background: #f5907e14; }
.pill-warn { color: var(--warn); background: #f7cb8110; }
.pill-warn::before { border-radius: 1px; transform: rotate(45deg); }
.pill-neutral { color: #bcc9e1; }
.pill-neutral::before { display: none; }
.middot { color: var(--electric); }
@keyframes rise-in { from { opacity: 0; transform: translateY(17px); } to { opacity: 1; transform: translateY(0); } }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: clip; }
.panel-top { padding: 17px 19px; border-bottom: 1px solid var(--line); }
.map-canvas { width: 100%; height: 100%; }
.map-label { position: absolute; left: 13px; bottom: 10px; padding: 4px 6px; border-radius: 3px; background: #111a2bed; color: #bcc9e1; font: 9px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.metric { display: flex; flex-direction: column; gap: 5px; }
.metric dt, .metric-caption { color: var(--muted); font-size: 12px; order: 2; line-height: 1.36; }
.metric dd { font-size: clamp(20px, 2.4vw, 32px); font-weight: 560; letter-spacing: -.055em; line-height: 1; font-variant-numeric: tabular-nums; margin: 0; }
.metric dd.metric-text { font-size: 16px; line-height: 1.13; letter-spacing: -.015em; }
.reveal { transition: opacity .72s var(--ease), transform .72s var(--ease); }
.reveal.ready { opacity: 0; transform: translateY(18px); }
.map-wrap { position: relative; background: #121a2b; }

.site-footer { background: var(--night-deep); border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 15px; align-items: center; min-height: 82px; font-size: 13px; color: var(--muted); }
.footer-inner .wordmark { color: var(--ink); font-size: 26px; }
.footer-inner .mark { width: 20px; height: 18px; }
.footer-inner a:last-child:hover { color: var(--ink); }

.workspace { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 30px; min-height: calc(100vh - 155px); padding-block: 33px 64px; }
.workspace-sidebar { position: sticky; top: 106px; align-self: start; padding: 12px 17px 20px 0; border-right: 1px solid var(--line); }
.workspace-sidebar > .eyebrow { padding-left: 10px; margin-bottom: 13px; }
.workspace-nav { display: flex; flex-direction: column; gap: 3px; }
.workspace-nav a { display: flex; gap: 9px; align-items: center; min-height: 42px; color: var(--muted); font-size: 14px; padding-inline: 10px; border: 1px solid transparent; border-radius: 7px; white-space: nowrap; }
.workspace-nav a i { width: 18px; text-align: center; font-style: normal; font-size: 17px; }
.workspace-nav a[aria-current="page"], .workspace-nav a:hover { color: var(--ink); background: #202b40; }
.workspace-nav a[aria-current="page"] { border-color: #475d97; }
.workspace-nav [aria-current="page"] i { color: var(--electric); }
.workspace-logger { margin: 17px 0 0 11px; }
.workspace-content { min-width: 0; animation: rise-in .38s var(--ease) both; }
.work-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 21px; }
.work-head h1 { font-size: clamp(34px, 4.1vw, 57px); }
.work-head .eyebrow { margin-bottom: 6px; }
.work-head p.work-subtitle { color: var(--muted); margin-top: 6px; font-size: 14px; }
.work-head .pill { align-self: flex-start; margin-top: 3px; }
.vehicle-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.vehicle-option { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 11px 13px; min-height: 55px; }
.vehicle-option:hover { border-color: #7489b8; }
.vehicle-option[aria-current="true"] { border-color: #87a4ff; background: #222e4b; box-shadow: inset 0 0 0 1px #87a4ff22; }
.vehicle-option strong { font-weight: 600; letter-spacing: -.02em; }
.dispatch-grid { display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.25fr); gap: 12px; }
.work-card { padding: 18px; }
.work-card h2 { font-size: 24px; letter-spacing: -.04em; }
.work-card h3 { font-size: 19px; }
.work-card p { color: var(--muted); font-size: 14px; }
.release-card .release-top { gap: 7px; }
.release-card .confidence { font-family: var(--display); font-size: clamp(51px, 6vw, 87px); line-height: 1.04; letter-spacing: -.092em; font-weight: 540; font-variant-numeric: tabular-nums; margin-top: 8px; }
.confidence-caption { color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; }
.confidence-caption b { color: var(--ink); font-weight: 550; }
.release-card .explanation { margin-block: 13px; }
.release-card .confidence-rule { position: relative; height: 5px; background: #3d4870; margin-block: 15px; border-radius: 7px; }
.confidence-rule > span { display: block; height: 100%; border-radius: 7px; background: var(--go); transition: width .34s var(--ease); }
.confidence-rule.is-stop > span { background: var(--stop); }
.confidence-rule > i { position: absolute; top: -4px; width: 2px; height: 13px; background: #f1f5ff; border-radius: 1px; }
.work-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; border-top: 1px solid var(--line); padding: 13px 0 0; margin: 0; }
.work-metrics .metric + .metric { padding-left: 12px; border-left: 1px solid var(--line); }
.map-card .panel-top { min-height: 52px; }
.map-wrap { height: 268px; }
.map-card-legend { border-top: 1px solid var(--line); padding: 10px 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px 15px; color: var(--muted); font: 10px var(--mono); }
.key-item { display: flex; align-items: center; gap: 7px; }
.key-item::before { content: ""; display: block; width: 8px; height: 8px; background: var(--key-color, var(--electric)); border-radius: 50%; flex: none; }
.key-item.key-line::before { width: 18px; height: 2px; border-radius: 0; }
.key-item.key-dashed::before { width: 17px; height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--key-color, var(--warn)); }
.key-item.key-ring::before { width: 9px; height: 9px; background: none; border: 1px solid var(--key-color, var(--go)); }
.wide-panel { grid-column: 1/-1; }
.forecast-chart { width: 100%; height: 225px; margin-top: 12px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
.card-heading p { margin-top: 4px; }
.chart-key { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font: 10px var(--mono); }
.chart-control { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 11px; color: var(--muted); font-size: 12px; }
.chart-control input { flex: 1 1 130px; accent-color: var(--electric); min-height: 28px; }
.chart-control output { min-width: 170px; font: 11px var(--mono); color: var(--ink); }
.charge-list, .risk-list, .replay-events { list-style: none; padding: 0; margin: 10px 0 0; }
.charge-list li { border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 10px; padding: 11px 0; }
.charge-list strong, .risk-list strong { display: block; color: var(--ink); font-size: 14px; font-weight: 580; }
.charge-list small { font: 10px var(--mono); color: var(--muted); }
.risk-list li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.risk-list li::before { content: "◇"; color: var(--warn); margin-right: 7px; }
.refusal-card { background: #292619; border-color: #6d5e3d; padding: clamp(18px, 4vw, 35px); }
.refusal-card h2 { margin-block: 14px 9px; font-size: clamp(32px, 4.2vw, 51px); color: var(--warn); }
.refusal-card p { max-width: 670px; color: #e7ddc4; font-size: 16px; }
.lever { display: inline-flex; min-height: 44px; align-items: center; justify-content: flex-start; text-align: left; white-space: normal; margin: 8px 6px 0 0; }
.lever[aria-pressed="true"] { color: var(--electric); border-color: var(--electric); }
.lever-result { margin-top: 10px; min-height: 21px; }
.lever-result b { color: var(--electric); }

.replay-status { border-radius: 8px; padding: 10px 13px; background: #203551; color: var(--go); font-size: 15px; font-weight: 610; margin-bottom: 13px; }
.replay-status.is-divert { color: #ffe5df; background: #5b3127; }
.replay-status.is-warn { color: #fceac3; background: #4a3c25; }
.replay-events li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.replay-events button { border: 0; background: transparent; color: var(--muted); display: flex; gap: 9px; align-items: center; width: 100%; min-height: 32px; padding: 0; text-align: left; }
.replay-events button[aria-current="step"] { color: var(--electric); }
.replay-events time { font: 10px var(--mono); min-width: 43px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.filter-bar label, .form-field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.filter-bar label:first-child { flex: 1 1 220px; }
.filter-bar input, .filter-bar select, .form-field input { min-height: 44px; width: 100%; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; }
.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
.data-table th { padding: 12px; font: 10px var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 400; }
.data-table td { border-top: 1px solid var(--line); padding: 10px 12px; }
.data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
.data-table td:nth-child(n+2) { white-space: nowrap; }
.data-table tr:hover td { background: #202b40; }
.result-count { color: var(--muted); font: 11px var(--mono); margin: 0 0 8px; }
.evidence-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 13px; }
.evidence-bars { display: grid; gap: 16px; margin: 16px 0 6px; }
.bar-set { display: grid; gap: 5px; }
.bar-title { color: var(--ink); font-size: 13px; margin-bottom: 2px; }
.bar-row { align-items: center; display: grid; grid-template-columns: minmax(70px,87px) 1fr 46px; gap: 9px; color: var(--muted); font-size: 11px; }
.bar-track { display: block; height: 7px; border-radius: 3px; background: #333e57; overflow: hidden; }
.bar-fill { height: 100%; display: block; background: #a6b2c9; border-radius: 3px; }
.bar-row:last-child .bar-fill { background: var(--electric); }
.evidence-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.evidence-stats dd { font-size: clamp(22px, 2.8vw, 36px); }
.evidence-grid p + p { margin-top: 10px; }
.engine-sequence { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.engine-sequence .eyebrow { color: var(--electric); display: block; margin-bottom: 9px; }
.engine-sequence h2 { margin-bottom: 8px; }

.field-view { background: #e7ecf5; color: var(--dark-ink); color-scheme: light; min-height: calc(100vh - 155px); }
.field-grid { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1fr); gap: 9%; align-items: start; max-width: 1010px; padding-block: clamp(34px, 6vw, 81px); }
.field-intro { padding-top: 14px; }
.field-intro .eyebrow, .phone .eyebrow { color: #4f607c; }
.field-intro .signal::before { background: #4f607c; }
.field-intro h1 { font-size: clamp(42px, 6vw, 85px); margin-block: 10px 14px; }
.field-intro p:not(.eyebrow) { color: #435472; max-width: 330px; font-size: 16px; margin-bottom: 15px; }
.field-intro .text-link { color: #234ba2; }
.field-view :focus-visible { outline-color: #285abd; }
.phone { width: min(100%, 485px); justify-self: center; border: 1px solid #bbc7df; border-radius: 24px; padding: 16px; background: #f8faff; box-shadow: 0 22px 65px #202a4216; }
.phone-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.phone-head .pill { color: #435570; }
.field-tabs, .language-tabs { display: flex; gap: 4px; align-items: center; background: #e5eaf4; border: 1px solid #d8deed; border-radius: 8px; padding: 3px; }
.field-tabs { margin-bottom: 14px; }
.field-tabs button, .language-tabs button { min-height: 38px; flex: 1; padding: 5px 10px; color: #42536f; background: transparent; border-radius: 5px; border: 1px solid transparent; font-size: 13px; font-weight: 590; white-space: nowrap; }
.language-tabs button { min-height: 32px; padding-inline: 6px; }
.field-tabs button[aria-pressed="true"], .language-tabs button[aria-pressed="true"] { color: #19243a; background: white; border-color: #d2daea; }
.phone-title { font-size: 27px; font-weight: 570; margin-bottom: 8px; }
.driver-status { display: grid; gap: 3px; border-radius: 11px; margin-bottom: 12px; min-height: 65px; padding: 10px 12px; background: #e0ebff; color: #244775; }
.driver-status strong { font-size: 20px; letter-spacing: -.035em; font-weight: 660; line-height: 1.14; }
.driver-status span { font-size: 13px; line-height: 1.34; }
.driver-status.is-divert { background: #74392e; color: #fff1e9; }
.driver-status.is-warn { background: #f4e5c3; color: #634923; }
.driver-readings { display: grid; grid-template-columns: 1.08fr 1fr; gap: 12px; padding: 12px 0 11px; margin: 0; border-block: 1px solid #d8deed; }
.driver-readings .metric + .metric { border-left: 1px solid #d8deed; padding-left: 12px; }
.phone .metric dt { color: #4f607c; font-size: 12px; }
.driver-readings .metric dd { font-size: clamp(32px, 9vw, 52px); }
.driver-readings .metric:nth-child(2) dd { color: #40567a; font-size: clamp(28px, 8vw, 44px); }
.field-slider { display: flex; flex-direction: column; gap: 6px; margin-block: 13px; }
.field-slider input { width: 100%; min-height: 23px; accent-color: #325dbb; margin: 0; }
.field-slider output { color: #4f607c; font: 11px var(--mono); }
.phone .button { white-space: normal; min-height: 45px; }
.phone .actions > * { flex: 1 1 auto; }
.field-secondary { background: #e5eaf4; color: #243855; border-color: #cad5e9; }
.field-secondary:hover { background: #d8e1f3; }
.phone .fine-print { margin-top: 10px; color: #4f607c; font-size: 12px; }
.ride-route { display: flex; flex-direction: column; gap: 8px; margin-block: 13px; padding-left: 12px; border-left: 2px solid #9bafdc; }
.ride-route span { font-size: 14px; font-weight: 620; }
.ride-result .driver-status { margin-top: 13px; }
.ride-result .ride-choice { border: 1px solid #d4ddef; background: #edf3ff; border-radius: 10px; padding: 12px; }
.ride-choice strong { display: block; margin-block: 3px 8px; font-weight: 650; }
.ride-choice .work-metrics { border-color: #cad5e9; }
.ride-choice .work-metrics .metric + .metric { border-color: #cad5e9; }
.ride-choice .metric dd { font-size: 24px; }
.ride-result details { margin-top: 10px; color: #394a66; font-size: 13px; }
.ride-result summary { cursor: pointer; min-height: 35px; padding-block: 7px; }
.logger-form { display: grid; gap: 10px; margin-block: 12px; }
.phone .form-field { color: #40536f; font-weight: 550; }
.phone .form-field input { background: #fff; color: #1e2b42; border-color: #bfcadf; }
.logger-readings { padding-left: 18px; color: #485674; font-size: 14px; }
.form-status { color: #264a82; font-size: 13px; margin-top: 7px; }

@media (max-width: 1050px) {
  .header-inner { gap: 12px; }
  .workspace { grid-template-columns: 150px minmax(0,1fr); gap: 17px; }
  .workspace-sidebar { padding-right: 10px; }
}
@media (max-width: 800px) {
  .header-inner { min-height: 64px; }
  .wordmark { font-size: 29px; }
  .header-cta { display: none; }
  .header-inner { grid-template-columns: auto 1fr; }
  .main-nav { justify-self: end; gap: 2px; }
  .main-nav a { padding-inline: 8px; min-height: 42px; font-size: 13px; }
  .dispatch-grid { grid-template-columns: 1fr 1fr; }
  .workspace { display: block; padding-top: 16px; }
  .workspace-sidebar { display: block; position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; margin-bottom: 16px; }
  .workspace-sidebar > .eyebrow, .workspace-logger { display: none; }
  .workspace-nav { display: flex; flex-direction: row; overflow-x: auto; padding-block: 4px; }
  .workspace-nav a { padding-inline: 8px; }
}
@media (max-width: 630px) {
  html { scroll-padding-top: 76px; }
  .driver-card-preview { justify-self: start; }
  .dispatch-grid, .evidence-grid, .field-grid { grid-template-columns: 1fr; }
  .field-grid { gap: 23px; }
  .work-head h1 { font-size: 36px; }
  .work-head .pill { font-size: 9px; }
  .work-card { padding: 14px; }
  .vehicle-option { align-content: center; justify-content: flex-start; padding: 8px; gap: 5px; }
  .vehicle-option .pill { font-size: 8px; white-space: normal; }
  .vehicle-option .pill::before { display: none; }
  .map-wrap { height: 230px; }
  .field-intro { padding-top: 0; }
  .field-intro p:not(.eyebrow) { margin-bottom: 6px; }
  .field-intro h1 { margin-block: 6px; }
  .phone { border-radius: 16px; padding: 12px; }
  .footer-inner { flex-wrap: wrap; padding-block: 14px; min-height: 67px; font-size: 11px; }
}
@media (max-width: 390px) {
  :root { --gutter: 15px; }
  .header-inner { gap: 7px; }
  .main-nav a { padding-inline: 7px; font-size: 13px; white-space: nowrap; }
  .main-nav [data-nav="home"] { display: none; }
  .button { gap: 7px; padding-inline: 11px; font-size: 11px; }
  .engine-sequence { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal.ready { opacity: 1; transform: none; }
}

.map-card { margin: 0; }
.vehicle-option strong { font-weight: 600; }
.battery-details { margin-top: 10px; color: #405372; font-size: 13px; }
.battery-details summary { cursor: pointer; width: fit-content; min-height: 38px; padding-block: 9px; font-weight: 550; }

.workspace .map-card {
  background: #121b2a;
  border-color: #48618c;
}
.workspace .map-card-legend { color: #c1cde7; }
.workspace .release-card { background: linear-gradient(150deg, #1b2740, #151d2b 65%); }
.workspace .vehicle-option[aria-current="true"] { box-shadow: inset 0 0 0 1px #89aaff29; }
