:root {
  --bg: #f6f8f6;
  --panel: #ffffff;
  --soft: #edf2ed;
  --softer: #f4f7f3;
  --line: #e0e7e2;
  --line-strong: #c9d4cc;
  --text: #20332e;
  --muted: #677a70;
  --faint: #93a298;
  --green: #176a52;
  --green-strong: #12533f;
  --ok-bg: #e3f1ea;
  --ok: #176a52;
  --warn-bg: #faeeda;
  --warn: #854f0b;
  --bad-bg: #fcebeb;
  --bad: #a32d2d;
  --drive: #29795f;
  --work: #bd9755;
  --avail: #85a8bc;
  --rest: #d1ddd4;
  --covered: #4f9d7c;
  --hatch: #b9c6bd;
  --assumed-stripe: #f3f7f4;
  --assumed-edge: #4f9d7c;
  --focus: #243e2b;
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161b19;
    --panel: #1e2522;
    --soft: #26302c;
    --softer: #222a27;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.22);
    --text: #e6ece8;
    --muted: #a3b1a9;
    --faint: #7d8b83;
    --green: #5dbb94;
    --green-strong: #7fd0ad;
    --ok-bg: #1f4a39;
    --ok: #b5e3cd;
    --warn-bg: #5a3806;
    --warn: #fac775;
    --bad-bg: #6e1f1f;
    --bad: #f7c1c1;
    --drive: #3f9f7d;
    --work: #c9a462;
    --avail: #6f97ad;
    --rest: #3b4a43;
    --covered: #3f8f6c;
    --hatch: #56655d;
    --assumed-stripe: #6f857a;
    --assumed-edge: #3f8f6c;
    --focus: #d9f0e4;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
summary {
  outline-offset: 3px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  font-weight: 600;
  margin: 4px 0 4px;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 10px;
}
h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 18px 0 8px;
}
.muted,
.sub {
  color: var(--muted);
}
.sub {
  margin: 0;
}
.small,
.fine,
.note {
  font-size: 12px;
}
.fine,
.note {
  color: var(--muted);
  line-height: 1.6;
}
.note {
  margin: 8px 0 0;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.9px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 13px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.nowrap {
  white-space: nowrap;
}

/* Shell */
.app {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--soft);
  border-right: 1px solid var(--line);
  padding: 26px 14px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -1.3px;
  display: flex;
  align-items: center;
  margin: 0 8px 18px;
}
.brand-icon {
  background: var(--green);
  color: var(--panel);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 29px;
  height: 29px;
  border-radius: 7px;
  font-size: 24px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  padding-bottom: 2px;
  box-sizing: border-box;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.12);
  margin-right: 2px;
}
.brand-dot {
  color: var(--green);
}
.fleet-label {
  font-size: 12px;
  color: var(--muted);
  margin: 0 8px 12px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 16px 8px 4px;
}
.nav {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.nav:hover {
  color: var(--text);
}
.nav.active {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 0 8px;
  font-size: 11px;
  color: var(--muted);
}
.sidebar-bottom p {
  margin-bottom: 8px;
  line-height: 1.6;
}
main {
  padding: 0 32px;
  max-width: 1240px;
  min-width: 0;
}
header {
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.crumb {
  font-size: 12px;
  color: var(--faint);
  min-width: 0;
}
.crumb a {
  color: var(--muted);
  text-decoration: none;
}
.crumb a:hover {
  text-decoration: underline;
}
.crumb .sep {
  padding: 0 8px;
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
  gap: 10px;
  align-items: center;
}
.user-name {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  padding: 32px 0;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}
footer span {
  font-size: 11px;
  color: var(--faint);
}
footer .foot-links {
  font-size: 13px;
  color: var(--muted);
}
footer .foot-links span {
  font-size: inherit;
  color: inherit;
}
.legal-links {
  margin-top: 12px;
}

/* Controls */
.primary,
.secondary,
.danger {
  border-radius: 6px;
  padding: 8px 13px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.primary {
  background: var(--green);
  color: var(--panel);
}
.primary:hover {
  background: var(--green-strong);
}
.secondary {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line-strong);
}
.secondary:hover {
  border-color: var(--muted);
}
.danger {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: transparent;
}
.quiet {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 12px;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--green);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.upload-label {
  cursor: pointer;
  position: relative;
}
.upload-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.upload-label:focus-within {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
select,
input,
textarea {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 13px;
  min-width: 0;
  max-width: 100%;
}
textarea {
  width: 100%;
  font: 12px/1.5 ui-monospace, monospace;
  padding: 12px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}
.toolbar label,
.range label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.toolbar .grow {
  flex: 1 1 220px;
}
.toolbar .grow input {
  width: 100%;
}
.range {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.chips .spacer {
  width: 10px;
}
.chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
}
.chip[aria-pressed="true"] {
  background: var(--text);
  color: var(--panel);
  border-color: var(--text);
}

/* Page head */
.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.head-side {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  background: var(--soft);
  color: var(--muted);
}
.tag.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.tag.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.tag.bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.tag.hatched {
  background: repeating-linear-gradient(45deg, var(--soft) 0 3px, var(--line-strong) 3px 4px);
  color: var(--text);
}
a.tag {
  text-decoration: none;
}
.tags {
  display: inline-flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* Surfaces */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.card.flat {
  background: var(--softer);
  border: 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.metric b {
  display: block;
  font-size: 22px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.metric span,
.metric small {
  font-size: 12px;
  color: var(--muted);
  display: block;
}
.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 4px 16px;
}
.two > div {
  min-width: 0;
}
.scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}
th {
  text-align: left;
  font-weight: 550;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  background: var(--softer);
  white-space: nowrap;
}
th button {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-weight: inherit;
}
td {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: break-word;
}
td small,
td .small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}
tr.clickable {
  cursor: pointer;
}
tr.clickable:hover td {
  background: var(--softer);
}
table.plain {
  border: 0;
  background: none;
}
table.plain td {
  border-top: 1px solid var(--line);
  padding: 8px 4px;
}
table.plain tr:first-child td {
  border-top: 0;
}
table.plain td:first-child {
  color: var(--muted);
  width: 38%;
}
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}
.empty h3 {
  color: var(--text);
  margin-top: 0;
}
.notice-box {
  padding: 11px 14px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 8px;
  font-size: 13px;
  margin: 12px 0;
}
.notice-box a {
  color: inherit;
}
.interpretation {
  border-left: 3px solid var(--line-strong);
  padding: 2px 0 2px 12px;
  margin: 14px 0 4px;
}
#notice {
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 18px;
  font-size: 13px;
}
details > summary {
  cursor: pointer;
}
details.more {
  margin-top: 12px;
  font-size: 13px;
}
details.more > summary {
  color: var(--muted);
}
details.more[open] > summary {
  margin-bottom: 10px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: 20px 0 16px;
  overflow-x: auto;
}
.tabs a {
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 9px 13px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
}
.tabs a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 550;
}
.tabs .count {
  font-size: 11px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 999px;
  padding: 0 6px;
  margin-left: 5px;
}

/* Bars */
.bar {
  position: relative;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--softer);
}
.bar.tall {
  height: 18px;
}
.bar > * {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 1px;
}
.bar > button:hover,
.bar > button:focus-visible {
  filter: brightness(0.85);
  outline: 2px solid var(--focus);
  outline-offset: -1px;
  z-index: 2;
}
.gap,
.bar.gap,
.bar > .gap {
  background: repeating-linear-gradient(
    45deg,
    transparent 0 3px,
    var(--hatch) 3px 4px
  );
}
.bar.gap {
  background-color: transparent;
}
/* Opt-in analysis assumption over a gap: solid rest with wide light stripes and an
   edge, so it reads as neither recorded rest (flat) nor no data (fine hatch). */
.assumed,
.bar > .assumed {
  background:
    repeating-linear-gradient(-45deg, transparent 0 5px, var(--assumed-stripe) 5px 7px),
    var(--rest);
  box-shadow: inset 0 0 0 1px var(--assumed-edge);
  z-index: 1;
}
.legend i.assumed {
  box-shadow: inset 0 0 0 1px var(--assumed-edge);
}
.tag.assumed {
  color: var(--text);
}
/* Terminal interval of a download whose time is unknown: not a reading. */
.bar > .inferred {
  opacity: 0.35;
}
.bar b {
  font-weight: 450;
  font-size: 10px;
  color: #fff;
  padding-left: 4px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  position: absolute;
  inset: 0;
  text-align: left;
}
.driving {
  background: var(--drive);
}
.work {
  background: var(--work);
}
.availability {
  background: var(--avail);
}
.break_rest {
  background: var(--rest);
}
.covered {
  background: var(--covered);
}
.d0 {
  background: #534ab7;
}
.d1 {
  background: #0f6e56;
}
.d2 {
  background: #b35c1e;
}
.d3 {
  background: #2f6fb0;
}
.d4 {
  background: #8a3f86;
}
.d5 {
  background: #6b7d1f;
}
.nocard {
  background: var(--bad);
}
.hl {
  box-shadow: inset 0 0 0 2px var(--bad);
  z-index: 3;
  pointer-events: none;
  background: transparent;
}
.dim {
  opacity: 0.4;
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  flex-wrap: wrap;
}
.legend span {
  white-space: normal;
  overflow-wrap: anywhere;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  vertical-align: -1px;
  border-radius: 2px;
}
.legend i.outline {
  border: 1px solid var(--line-strong);
}
.legend i.hl-key {
  box-shadow: inset 0 0 0 2px var(--bad);
}
.axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--faint);
}
.day-grid {
  display: grid;
  grid-template-columns: 84px minmax(220px, 1fr) minmax(120px, 190px) repeat(4, minmax(78px, max-content));
  gap: 0 12px;
  align-items: center;
  min-width: 720px;
}
.day-grid .head-cell {
  font-size: 11px;
  color: var(--faint);
  margin-bottom: 4px;
}
/* Bars start after the source label column in .bands. */
.day-grid > .axis {
  position: relative;
  margin-left: 80px;
}
/* Follows the pointer over the bars; covers the hour labels beneath it. */
.axis-marker {
  position: absolute;
  top: 0;
  bottom: -4px;
  border-left: 1px solid var(--text);
  pointer-events: none;
}
.axis-marker b {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  padding: 0 4px;
  border-radius: 3px;
  background: var(--text);
  color: var(--panel);
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tip {
  position: fixed;
  z-index: 50;
  max-width: 320px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--panel);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
/* One day: its cells share the parent's columns, text lines up with the first
   bar, and the space between days is wider than the space inside one. */
.day-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: start;
  margin: 0 -8px;
  padding: 6px 8px;
  border-radius: 6px;
}
.day-row:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.day-row .day-link span,
.day-row .day-meta {
  line-height: 14px;
}
.day-grid .right {
  text-align: right;
}
.day-grid .row-flag {
  outline: 2px solid var(--bad);
  outline-offset: 3px;
  border-radius: 3px;
}
.day-link {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  color: var(--text);
  font-size: 13px;
}
.day-link small {
  display: block;
  color: var(--faint);
  font-size: 11px;
}
/* Date and weekday as two columns: weekdays line up, and the gap stays even
   when a date renders wider than its column. */
.day-link > span {
  display: grid;
  grid-template-columns: minmax(3.4em, max-content) auto;
  column-gap: 6px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}
.day-link .weekday {
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}
.day-link:hover .date {
  text-decoration: underline;
}
.day-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bands {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
}
.band-source {
  font-size: 10px;
  line-height: 14px;
  color: var(--faint);
  letter-spacing: 0.3px;
}
.day-grid.single > .axis {
  margin-left: 0;
}
.day-grid.single .bands {
  grid-template-columns: minmax(0, 1fr);
}
.day-grid.single .band-note {
  grid-column: auto;
}
.source-pick {
  margin: 10px 0 8px;
}
.band-note {
  grid-column: 2;
  font-size: 10px;
  color: var(--faint);
}
.coverage-grid {
  display: grid;
  grid-template-columns: minmax(130px, 210px) minmax(220px, 1fr) 60px;
  gap: 8px 12px;
  align-items: center;
  min-width: 560px;
}
.lanes {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}
.lanes small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.lanes small.ok {
  color: var(--ok);
}
.lanes small.warn {
  color: var(--warn);
}
.lanes small.bad {
  color: var(--bad);
}

/* Review items */
.item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  margin-top: 8px;
}
.item > summary {
  list-style: none;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.item > summary::-webkit-details-marker {
  display: none;
}
.item > summary::before {
  content: "▸";
  color: var(--faint);
  margin-right: -4px;
}
.item[open] > summary::before {
  content: "▾";
}
.item > summary > span:first-of-type {
  flex: 1;
}
.item[open] > summary {
  border-bottom: 1px solid var(--line);
}
.item .body {
  padding: 14px;
}
.item.withdrawn {
  opacity: 0.7;
}
.item.flash {
  box-shadow: 0 0 0 3px var(--warn-bg);
}
.cmp {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.check {
  margin-top: 14px;
}
.check b {
  font-weight: 600;
}
.check p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Source files */
.upload-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 16px;
}
.upload-list > .muted {
  padding: 14px 0;
  margin: 0;
}
.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.upload-row:last-child {
  border: 0;
}
.upload-row.flash {
  background: var(--warn-bg);
}
.upload-info {
  min-width: 0;
}
.upload-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.upload-meta {
  color: var(--faint);
  font-size: 11px;
  margin-top: 4px;
}
.upload-reason {
  font-size: 11px;
  color: var(--warn);
  line-height: 1.5;
  margin-top: 6px;
  max-width: 680px;
}
.file-code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
}
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--ok-bg);
  color: var(--ok);
  white-space: nowrap;
}
.badge.rejected,
.badge.flagged {
  background: var(--warn-bg);
  color: var(--warn);
}
/* Signature verification: green verified, red mismatch, amber could not check. */
.auth-badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
}
.auth-badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.auth-badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.auth-badge.bad {
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 600;
}
.upload-auth,
.signature-line {
  margin-top: 4px;
}
.badge.queued,
.badge.parsed {
  background: var(--soft);
  color: var(--muted);
}
.type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  background: var(--soft);
  color: var(--muted);
}
.type-badge.driver_card {
  background: var(--ok-bg);
  color: var(--ok);
}
.type-badge.workshop_card,
.type-badge.card,
.type-badge.unknown {
  background: var(--warn-bg);
  color: var(--warn);
}
.card-details {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
}
.card-number {
  font-family: ui-monospace, monospace;
  margin-left: 8px;
  color: var(--muted);
}
.card-extra {
  color: var(--muted);
}
.mono {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

/* Settings and privacy */
.privacy {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.privacy p {
  margin-top: 12px;
  max-width: 760px;
  line-height: 1.7;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Settings */
.settings-form h2 {
  margin-top: 26px;
}
.setting-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
}
.setting-card:hover {
  border-color: var(--muted);
}
.setting-card:has(.setting-box:checked) {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
.setting-card:has(.setting-box:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.setting-card.static {
  cursor: default;
}
.setting-card.static:hover {
  border-color: var(--line-strong);
}
.setting-card > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.setting-card select {
  margin-top: 12px;
  max-width: 360px;
}
.setting-box {
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  display: grid;
  place-content: center;
  background: var(--panel);
  border: 1.5px solid var(--muted);
  border-radius: 5px;
  cursor: pointer;
}
.setting-box:focus-visible {
  outline: none;
}
.setting-box:checked {
  background: var(--green);
  border-color: var(--green);
}
.setting-box:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid var(--panel);
  border-top: 0;
  border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}
.setting-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.setting-head b {
  font-weight: 600;
}
.setting-summary {
  margin-top: 3px;
  font-size: 13px;
}
.setting-detail {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}
.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding: 12px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.save-bar button:disabled {
  cursor: default;
}
.save-status {
  margin-right: auto;
  font-size: 13px;
  color: var(--muted);
}

/* Login */
.login-card {
  max-width: 440px;
  margin: 10vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 36px;
  border-radius: 12px;
}
.login-card .brand {
  margin: 0 0 28px;
}
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 16px;
}
.login-card input {
  height: 40px;
}
.login-card .primary {
  width: 100%;
  justify-content: space-between;
  padding: 11px 16px;
  margin-bottom: 18px;
}
.login-card h1 {
  font-size: 27px;
  margin-bottom: 10px;
}
#login-error {
  font-size: 12px;
  color: var(--bad);
}

/* Evidence dialog */
dialog {
  width: 720px;
  max-width: calc(100vw - 32px);
  max-height: 85vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.25);
  padding: 26px;
  color: var(--text);
  background: var(--panel);
}
dialog::backdrop {
  background: rgba(10, 30, 20, 0.4);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
}
dialog h2 {
  margin: 0 0 18px;
}
.evidence-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.evidence-card h3 {
  margin-top: 0;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  background: var(--softer);
  padding: 10px;
  border-radius: 6px;
  max-height: 260px;
  overflow: auto;
}

/* Headings focused in code on a view change only: no ring. */
main h1[tabindex="-1"]:focus {
  outline: none;
}

@media (max-width: 900px) {
  main {
    padding: 0 20px;
  }
  .app {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar .brand {
    margin: 0;
    font-size: 21px;
  }
  .fleet-label,
  .nav-label,
  .sidebar-bottom p {
    display: none;
  }
  /* The ranked review list: one card per row instead of a wide table. */
  table.ranked thead {
    display: none;
  }
  table.ranked,
  table.ranked tbody {
    display: block;
  }
  table.ranked tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  table.ranked tr:last-child {
    border-bottom: 0;
  }
  table.ranked td {
    display: block;
    padding: 0;
    border: 0;
  }
  table.ranked td:first-child {
    grid-row: span 4;
  }
  /* One view shows at a time: keep every destination reachable in a row. */
  .nav-strip {
    order: 3;
    flex-basis: 100%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 2px;
  }
  .nav {
    white-space: nowrap;
    background: var(--panel);
  }
  .sidebar-bottom {
    margin: 0;
  }
  main {
    padding: 0 16px;
  }
  header {
    flex-wrap: wrap;
    padding: 10px 0;
  }
  .user-name {
    display: none;
  }
  .login-card {
    margin: 24px 16px;
    padding: 26px;
  }
  .lanes {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}

.account-card {
  padding: 24px;
  margin: 24px 0 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.account-card form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.account-card form h3 { flex-basis: 100%; margin: 0 0 4px; }
.account-card label { display: grid; gap: 7px; flex: 1 1 240px; max-width: 360px; }
.account-card input { width: 100%; min-width: 0; }
.account-card form button { margin: 0; }
.account-card > button, .account-card > a { margin: 8px 12px 8px 0; }
#provider-buttons { display: grid; gap: 10px; margin-bottom: 18px; }
#provider-buttons a { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
#auth-screen form { display: grid; gap: 16px; }
#auth-screen label { display: grid; gap: 7px; }
#auth-screen label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 10px; }
#auth-screen input[type=checkbox] { width: auto; }
#auth-screen > a { display: inline-block; margin-top: 18px; }

/* Plans: locked features, locked drivers and teasers. */
.empty.locked {
  border: 1px dashed var(--warn);
}
.card.teaser,
.card.locked-row {
  border-left: 3px solid var(--warn);
}
.card.teaser p,
.card.locked-row p {
  margin: 0.25rem 0;
}

.billing-card .plan-line { font-size: 1.05rem; }
.billing-card .warn { color: var(--warn); }
.billing-form label { display: inline-flex; flex-direction: column; margin: 0 0.75rem 0.5rem 0; }
.billing-form input[type="number"] { width: 7rem; }
.plan-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.plan-option { border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.75rem; }
.plan-option.current { border-width: 2px; }
.plan-option ul { margin: 0.25rem 0 0.5rem 1rem; padding: 0; }
.size-bar { height: 0.6rem; border-radius: 3px; background: var(--soft); border: 1px solid var(--line); overflow: hidden; max-width: 24rem; }
.size-bar span { display: block; height: 100%; background: var(--green); }
.size-bar.full span { background: var(--warn); }
.upload-note { font-size: 0.85rem; opacity: 0.85; margin-top: 0.15rem; }
.confirming { font-weight: 600; }

/* Locale text can wrap without narrowing evidence bands or hiding labels. */
.head-cell, .band-source { overflow-wrap: anywhere; }
.day-meta { white-space: normal; overflow: visible; text-overflow: clip; }
.language-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; min-width: 0; }
.language-picker select { max-width: 100%; }
.language-error { flex-basis: 100%; color: var(--bad); }
button, .button { white-space: normal; overflow-wrap: anywhere; }

.table-scroll { max-width: 100%; min-width: 0; }
.item > summary { flex-wrap: wrap; }
.item > summary > span:first-of-type { flex: 1 1 12rem; min-width: 0; }
.item > summary .tag { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

/* PDF report options: a disclosure in the page head, not a modal. */
.report-menu {
  position: relative;
}
.report-menu > summary {
  list-style: none;
  cursor: pointer;
}
.report-menu > summary::-webkit-details-marker {
  display: none;
}
.report-options {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.report-options label {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}
.report-options .primary {
  justify-self: start;
}
@media (max-width: 640px) {
  .report-options {
    position: fixed;
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
    width: auto;
  }
}

/* Help: a small "?" beside a concept, the help centre and its articles. */
.help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
}
.help-link:hover,
.help-link:focus-visible {
  color: var(--green);
  border-color: var(--green);
}
.help-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
}
.help-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 10px;
  margin-top: 16px;
}
.help-card {
  display: block;
  min-width: 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.help-card:hover,
.help-card:focus-visible {
  border-color: var(--line-strong);
}
.help-card b {
  display: block;
  margin-bottom: 2px;
}
.help-card span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
}
.help-hits {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.help-hits li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.help-hits small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.help-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 28px;
  margin-top: 18px;
}
.help-layout:has(.help-toc) {
  grid-template-columns: 200px minmax(0, 1fr);
}
.help-toc {
  position: sticky;
  top: 16px;
  align-self: start;
  font-size: 13px;
}
.help-toc ul {
  margin: 6px 0 0;
  padding-left: 16px;
}
.help-toc li {
  margin: 3px 0;
}
.help-article {
  max-width: 46rem;
  min-width: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.help-article h2 {
  margin-top: 26px;
}
.help-section {
  scroll-margin-top: 16px;
  border-radius: 8px;
}
.help-section.flash {
  box-shadow: 0 0 0 3px var(--warn-bg);
}
.help-callout p {
  color: var(--text);
}
@media (max-width: 900px) {
  .help-layout:has(.help-toc) {
    grid-template-columns: minmax(0, 1fr);
  }
  .help-toc {
    position: static;
  }
}

/* Getting started: derived steps, what happens next, first failure. */
.onboarding,
.onboarding-failure,
.what-next {
  margin-top: 18px;
}
.onboarding-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.onboarding-head h2 {
  margin: 0 0 2px;
}
.onboarding-head p {
  margin: 0;
}
.onboarding-steps {
  list-style: none;
  margin: 14px 0 6px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 10px;
}
.onboarding-steps li {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--softer);
  overflow-wrap: anywhere;
}
.onboarding-steps li > div {
  min-width: 0;
}
.onboarding-steps li p {
  margin: 2px 0 4px;
  font-size: 13px;
  color: var(--muted);
}
.onboarding-steps li .tag {
  margin-left: 6px;
}
.onboarding-steps li.done {
  opacity: 0.75;
}
.step-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
}
.done .step-mark {
  background: var(--ok-bg);
  border-color: var(--ok-bg);
  color: var(--ok);
}
.ok-text {
  color: var(--ok);
  font-weight: 600;
}
.onboarding-failure {
  border-color: var(--warn);
  background: var(--warn-bg);
}
.onboarding-failure h2 {
  margin-top: 0;
  color: var(--warn);
}
.onboarding-failure p {
  overflow-wrap: anywhere;
}
.what-next p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}
/* The live demo (plan §4.1): a banner above every screen of a demo session. */
.demo-banner {
  background: var(--warn-bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 14px;
}
.demo-banner p {
  margin: 0 0 6px;
}
.demo-banner .demo-why {
  font-size: 13px;
  color: var(--muted);
}
.demo-banner .demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}
.demo-entry {
  margin-top: 14px;
}
.demo-entry .button {
  margin-right: 6px;
}
