:root {
  --ink: var(--report-ink);
  --muted: var(--report-muted);
  --bg: var(--report-canvas);
  --action: var(--report-action);
  color: var(--ink);
  font: 14px/20px var(--report-font);
}

.rail, .top, .workspace {
  background: var(--report-canvas);
}
.rail, .top, .rail nav, .nav-children, .rail-foot {
  border: 0;
  box-shadow: none;
}
.brand-brain {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: 8px;
  background: var(--report-action);
  color: var(--report-surface);
}
.brand-label {
  display: grid;
  font-size: 21px;
  line-height: 24px;
  letter-spacing: -0.5px;
}
.brand-label small {
  color: var(--report-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0;
}
.rail nav { padding-top: 0; }
.rail .nav-group + .nav-group { margin-top: 8px; }
.rail a[aria-current=page], .rail-search {
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}
.rail a[aria-current=page] {
  background: var(--report-selection);
  color: var(--report-action);
}
.rail-search { background: var(--report-chart-surface); }
.mock-label {
  background: var(--report-chart-surface);
  color: var(--report-muted);
  border: 0;
}
:root { --report-gutter: clamp(12px, 1.15vw, 24px); }
.top { padding-inline: var(--report-gutter); }
#content, #etc-workspace {
  max-width: none;
  margin: 0;
  min-width: 0;
  padding: 24px var(--report-gutter) 48px;
}
.report-heading h1, #etc-workspace h1 {
  color: var(--report-heading);
  font-size: 28px;
  line-height: 36px;
  letter-spacing: 0;
}
.day-overview { gap: 20px; }
.day-overview .metric {
  background: var(--report-surface);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--report-shadow-metric);
  padding: 16px 24px;
  gap: 4px;
}
.day-overview .metric:first-child {
  background: var(--report-selection);
  color: var(--report-heading);
}
.day-overview .empty-metric { background: var(--report-empty-bg); }
.day-overview .metric strong {
  font-size: 32px;
  line-height: 40px;
  letter-spacing: 0;
  font-weight: 650;
}
.day-overview .metric span, .day-overview .metric small { color: var(--report-muted); }
.empty-metric strong, .empty-metric span b, .empty-share strong, .empty-share span b {
  color: var(--report-empty-text);
}
.day-overview .metric:last-child span:last-child b { color: var(--report-review); }
.analysis-rules {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.trend-panel, .daily-list, .daily-evidence .record-evidence {
  background: var(--report-surface);
  color: var(--report-ink);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--report-shadow-panel);
}
.trend-panel {
  margin: 24px 0;
  padding: 16px 24px;
}
.trend-heading { margin-bottom: 8px; }
.trend-heading h2, .panel h2, .interval-header h3 {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}
.mileage-chart { height: 148px; }
.mileage-bars {
  background: none;
  border: 0;
}
.mileage-bar, .mileage-key span::before { background: var(--report-series-total); }
.mileage-bar i, .mileage-key span:last-child::before { background: var(--report-series-empty); }
.mileage-slot:is(:hover, :focus-visible) .mileage-bar {
  outline: 2px solid var(--report-control-edge);
  outline-offset: 2px;
}
.mileage-axis, .bar-date, .mileage-key { color: var(--report-muted); }
.bar-pending { color: var(--report-review); }

.daily-workspace { gap: 24px; }
:is(.daily-list .daily-ledger, .report-compact-ledger) :is(th, td), .daily-list .record-pager,
.daily-evidence :is(.interval-total, .interval-row, .interval-foot) {
  border: 0;
  box-shadow: none;
}
:is(.daily-list .daily-ledger, .report-compact-ledger) thead th {
  background: transparent;
  color: var(--report-muted);
  font-weight: 500;
}
:is(.daily-list .daily-ledger, .report-compact-ledger) tbody :is(th,td) {
  font-size: 14px;
  line-height: 20px;
  padding-block: 8px;
}
.daily-list .daily-ledger tbody tr.is-selected td {
  background: var(--report-selection);
  box-shadow: none;
}
.daily-list .daily-ledger tr.is-selected td:first-child { border-radius: 8px 0 0 8px; }
.daily-list .daily-ledger tr.is-selected td:last-child { border-radius: 0 8px 8px 0; }
.daily-list .daily-ledger th:first-child { width: 13%; }
.daily-list .daily-ledger th:nth-child(4) { width: 12%; }
.interval-evidence {
  background: var(--report-surface);
  padding: 20px;
}
.daily-evidence .interval-row.interval-empty {
  background: var(--report-empty-bg);
  color: var(--report-empty-text);
  padding: 10px;
  border-radius: 8px;
}
.interval-empty .interval-status, .interval-total strong { color: var(--report-empty-text); }
.verdict.empty-run {
  background: var(--report-empty-label-bg);
  color: var(--report-empty-text);
}
.interval-review { background: var(--report-review-bg); }
.interval-review .interval-status, .pending.attention { color: var(--report-review); }
.period :is(button, input), .btn, .tools :is(input, select) {
  border-radius: 8px;
  box-shadow: none;
}
.period input, .tools :is(input, select) { border-color: var(--report-control-edge); }
.report-filter { position: relative; display: inline-block; min-width: 0; }
.report-filter::after {
  content: "";
  position: absolute;
  inset-block-start: calc(50% - 5px);
  inset-inline-end: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--report-muted);
  border-bottom: 1.5px solid var(--report-muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.report-filter > select {
  appearance: none;
  max-width: 100%;
  padding-inline: 12px 32px;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  color: var(--report-ink);
  cursor: pointer;
}
.report-filter > select:disabled { cursor: default; }
.report-filter > select:not(:disabled):hover { background-color: var(--report-selection); }
.tools .report-filter > select { min-width: 108px; padding-block: 6px; }
@supports (appearance: base-select) and selector(::picker(select)) {
  .report-filter > select, .report-filter select::picker(select) { appearance: base-select; }
  .report-filter select::picker-icon { display: none; }
  .report-filter select:open { background: var(--report-selection); }
  .report-filter select::picker(select) {
    margin-top: 4px;
    padding: 4px;
    max-block-size: min(320px, 50dvh);
    border: 1px solid var(--report-control-edge);
    border-radius: 8px;
    background: var(--report-surface);
    box-shadow: var(--report-shadow-panel);
  }
  .report-filter option { padding: 8px; border-radius: 6px; }
  .report-filter option::checkmark { color: var(--report-action); }
  .report-filter option:is(:hover, :focus, :checked) {
    color: var(--report-action);
    background: var(--report-selection);
  }
}
:is(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--report-action);
  outline-offset: 2px;
}


#record-rows { overflow-x: auto; }
.daily-list .daily-ledger { min-width: 600px; }

@media (max-width: 1179px) {
  body { min-width: 0; }
  .daily-workspace { grid-template-columns: minmax(0, 1fr); }
  .daily-evidence { position: static; }
  .day-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .rail { width: 148px; padding-inline: 8px; }
  .workspace { margin-left: 148px; }
  .brand { font-size: 20px; }
  .lead { align-items: flex-start; flex-wrap: wrap; }
  .daily-metric { padding: 12px; }
  .day-overview .metric strong { font-size: 24px; }
}

@media (max-width: 520px) {
  .rail {
    position: static;
    width: auto;
    padding: 12px;
    overflow: visible;
  }
  .rail .brand { margin: 0; }
  .rail .rail-search, .rail .rail-foot { display: none; }
  .rail nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
  .rail .nav-group + .nav-group { margin: 0; }
  .workspace { margin-left: 0; }
  .top { height: auto; min-height: 40px; flex-wrap: wrap; }
}

.mileage-bars {
  grid-template-columns: repeat(var(--mileage-columns, 7), minmax(0, 1fr));
}

.month-trend .mileage-chart-window {
  overflow-x: auto;
  padding-inline: 2px;
}

.month-trend .mileage-chart {
  min-width: 690px;
  height: 172px;
}

.month-trend .mileage-bar { width: 70%; max-width: 34px; }
.month-trend .bar-missing { color: var(--report-muted); }
.month-trend .trend-table { max-width: min(100%, 780px); }

.month-panel {
  border: 0;
  border-radius: 16px;
  box-shadow: var(--report-shadow-panel);
  margin-top: 24px;
}

.month-panel .days {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 8px;
}

.month-panel .day-cell {
  background: var(--report-chart-surface);
  border: 1px dashed var(--report-control-edge);
  border-radius: 8px;
}

.month-panel .day-cell.saved {
  background: var(--report-selection);
  border-color: transparent;
  color: var(--report-heading);
}

.month-panel .day-cell:disabled {
  background: var(--report-review-bg);
  border-color: transparent;
}

.month-ledger #ledger, .month-windows { overflow-x: auto; }
.month-ledger .ledger { min-width: 650px; }
.month-ledger .ledger :is(th, td), .month-windows .ledger :is(th, td) { border-top: 0; }
.month-ledger .ledger :is(th, td) { padding-block: 10px; }
.month-ledger .ledger th { background: var(--report-surface); }
.month-ledger .ledger tr.group td { background: var(--report-review-bg); }
#dialog:has(.month-windows) {
  width: min(760px, calc(100vw - 24px));
  min-width: 0;
}
.month-windows { width: 100%; }
.month-windows .ledger { min-width: 580px; }

.period-picker { position: relative; }
.period .period-trigger {
  display: inline-flex;
  width: auto;
  gap: 8px;
  align-items: center;
  padding-inline: 12px;
  border-color: var(--report-control-edge);
  color: var(--report-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.day-period > button[data-shift] {
  width: 32px;
  min-height: 32px;
  font-size: 17px;
}
.period .period-trigger[aria-expanded=true] {
  border-color: var(--report-action);
  background: var(--report-selection);
}
.calendar-mark {
  width: 14px;
  height: 13px;
  color: var(--report-action);
  border: 1px solid currentColor;
  border-radius: 3px;
  position: relative;
}
.calendar-mark::after {
  content: "";
  position: absolute;
  inset: 3px 0 auto;
  border-top: 1px solid currentColor;
}
.period-popup {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  width: 312px;
  padding: 16px;
  color: var(--report-ink);
  background: var(--report-surface);
  border-radius: 14px;
  box-shadow: var(--report-shadow-panel), 0 0 0 1px rgb(23 48 88 / 7%);
}
.period-popup-head, .period-popup-selects {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.period .period-popup-head :is(button, select) {
  min-height: 32px;
  padding: 4px 8px;
  border-color: transparent;
  color: var(--report-action);
}
.period .period-popup-head .report-filter > select {
  margin: 0;
  padding-inline: 8px 32px;
  font-weight: 600;
  background: var(--report-review-bg);
}
.period-grid {
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  gap: 4px;
  margin-top: 12px;
  text-align: center;
}
.period-grid.month-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.period-weekday { color: var(--report-muted); font-size: 12px; }
.period .period-grid button {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 0;
  border-color: transparent;
  border-radius: 8px;
  font-weight: 500;
}
.period .month-grid button { min-height: 44px; }
.period .period-grid button:not(:disabled):hover { background: var(--report-selection); }
.period .period-grid button[data-latest] { border-color: var(--report-action); }
.period :is(.period-grid button, [data-shift], [data-period-shift]):disabled {
  background: var(--report-review-bg);
  color: var(--report-muted);
  border-color: transparent;
  cursor: not-allowed;
}
.period .period-grid button[aria-pressed=true] {
  color: var(--report-surface);
  background: var(--report-action);
  border-color: var(--report-action);
}
.period .period-grid button[aria-pressed=true]:hover {
  color: var(--report-surface);
  background: var(--report-action);
}
.period-popup-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.period .period-popup-foot button {
  width: auto;
  color: var(--report-action);
  border-color: transparent;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .period-popup {
    position: fixed;
    inset: clamp(64px, 10vh, 120px) 12px auto;
    width: min(312px, calc(100vw - 24px));
    margin-inline: auto;
  }
}

.month-actions { flex-wrap: wrap; }

#dialog:has(.export-dialog) {
  width: min(480px, calc(100vw - 24px));
  min-width: 0;
}
.export-dialog { display: grid; gap: 20px; }
.export-dialog h2 { margin: 0; }
.export-period, .export-error { margin: 4px 0 0; font-size: 13px; }
.export-period { color: var(--report-muted); }
.export-error { color: var(--report-error); }
.export-dialog fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}
.export-dialog legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.export-tags, .export-choices { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.export-tags { font-size: 13px; color: var(--report-muted); }
.export-dialog [type="checkbox"] { margin: 0; accent-color: var(--report-action); }
.export-garages { margin-top: 8px; }
.export-garages summary {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--report-selection);
  cursor: pointer;
  font-size: 13px;
}
.export-options {
  display: grid;
  max-height: 148px;
  overflow-y: auto;
  margin-top: 6px;
  padding: 4px;
  border-radius: 8px;
  background: var(--report-review-bg);
}
.export-options label, .export-choices label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.export-choices label { background: var(--report-review-bg); }
.export-options label:hover, .export-choices label:has(:checked),
.export-all[aria-pressed=true] { background: var(--report-selection); }
.export-tag {
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--report-selection);
  color: var(--report-action);
}
.export-dialog .dialogfoot { margin-top: 0; }

dialog.daily-evidence[open]:not(:modal) {
  inset-inline:auto; margin:0; width:auto; max-width:none; max-height:none;
  border:0; padding:0; color:inherit; background:transparent;
}
.daily-evidence .interval-evidence {padding:12px 16px}
.daily-evidence .interval-header {align-items:center}
.daily-evidence .interval-header>div {display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 12px}
.daily-evidence .interval-header p {margin:0}
.daily-evidence .interval-summary-line {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:2px 10px;margin:4px 0 8px}
.daily-evidence .interval-window {margin:0}
.daily-evidence .interval-total {align-items:baseline;gap:6px;margin:0;border:0;padding:0}
.daily-evidence .interval-total strong {font-size:19px}
