:root {
  color-scheme: light;
  --ink: #1d2328;
  --muted: #697178;
  --line: #d8dde1;
  --soft: #f3f5f6;
  --paper: #ffffff;
  --accent: #147a56;
  --accent-dark: #0c5d41;
  --warning: #a64b20;
  --selected: #e9f3ee;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.app-header {
  min-height: 92px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}
.brand-block { display: flex; align-items: center; gap: 14px; min-width: 240px; }
.brand-mark {
  width: 54px; height: 54px; display: grid; place-items: center;
  color: #fff; background: var(--ink); font-weight: 800; font-size: 17px;
}
h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.sync-state { margin-top: 4px; color: var(--muted); font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 1px; margin: 0; }
.stats div { padding: 4px 18px; border-left: 1px solid var(--line); }
.stats dt { color: var(--muted); font-size: 12px; }
.stats dd { margin: 2px 0 0; font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 700; }
.disclaimer {
  margin: 0; padding: 9px 28px; border-bottom: 1px solid var(--line);
  color: var(--muted); background: var(--soft); font-size: 12px; line-height: 1.55;
}
.disclaimer strong { color: var(--ink); font-weight: 650; }

.tabs { display: flex; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--soft); }
.tab { height: 46px; padding: 0 20px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }
main { min-height: calc(100vh - 139px); }
.view { display: none; }
.view.active { display: block; }

.search-band, .filter-bar {
  min-height: 72px; padding: 14px 28px; display: flex; align-items: end; gap: 12px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.filter-bar { flex-wrap: wrap; }
.search-band label { align-self: center; font-weight: 650; }
.search-band input { width: min(620px, 65vw); }
input, select {
  height: 38px; border: 1px solid #bfc6cb; background: #fff; color: var(--ink);
  padding: 0 10px; border-radius: 4px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #dcefe7; }
button[type="submit"] {
  height: 38px; padding: 0 18px; border: 1px solid var(--accent-dark); border-radius: 4px;
  color: #fff; background: var(--accent);
}
button[type="submit"]:hover { background: var(--accent-dark); }

.split-layout {
  display: grid; grid-template-columns: minmax(260px, 360px) 1fr;
  height: calc(100vh - 211px); min-height: 320px; overflow: hidden;
}
.result-list {
  min-height: 0; border-right: 1px solid var(--line);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
}
.result-item {
  width: 100%; min-height: 66px; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--line);
  text-align: left; color: var(--ink); background: #fff;
}
.result-item:hover, .result-item.active { background: var(--selected); }
.result-name { display: block; font-weight: 650; line-height: 1.25; }
.result-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.detail-pane { min-width: 0; min-height: 0; overflow: auto; }
.detail-header { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin: 0; font-size: 20px; }
.detail-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.subsection-header { padding: 20px 24px 10px; border-top: 1px solid var(--line); }
.subsection-header h3 { margin: 0; font-size: 16px; }
.subsection-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.caption { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.vehicle-context { color: var(--muted); font-size: 11px; white-space: nowrap; }
td .vehicle-context { display: block; margin-top: 3px; }
.empty-state { padding: 36px 24px; color: var(--muted); }

.filter-bar label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.filter-bar select { min-width: 150px; color: var(--ink); }
.filter-bar input { width: 105px; color: var(--ink); }
.filter-bar .check-label { display: flex; flex: 0 0 auto; align-items: center; flex-direction: row; gap: 7px; min-height: 38px; color: var(--ink); white-space: nowrap; }
.filter-bar .check-label input { width: 16px; height: 16px; accent-color: var(--accent); }
.filter-bar.compact { align-items: center; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; }
td.numeric { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.status { display: inline-flex; min-height: 22px; align-items: center; padding: 0 7px; border-radius: 3px; font-size: 11px; white-space: nowrap; background: var(--soft); color: var(--muted); }
.status.verified { background: #dcefe7; color: var(--accent-dark); }
.status.review { background: #f8e8df; color: var(--warning); }
.verify-control { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); font-size: 11px; }
.verify-control input { width: 15px; height: 15px; accent-color: var(--accent); }
.condition { color: var(--muted); white-space: nowrap; }
.source-excerpt { max-width: 520px; color: var(--muted); font-size: 12px; line-height: 1.45; }

@media (max-width: 820px) {
  .app-header { align-items: flex-start; padding: 14px 16px; flex-direction: column; }
  .stats { width: 100%; grid-template-columns: repeat(2, 1fr); }
  .stats div { border-left: 0; border-top: 1px solid var(--line); padding: 8px 4px; }
  .disclaimer { padding: 9px 16px; }
  .tabs { padding: 0 8px; }
  .tab { padding: 0 12px; }
  .search-band, .filter-bar { padding: 12px 14px; flex-wrap: wrap; align-items: end; }
  .search-band input { width: calc(100vw - 122px); }
  .split-layout { grid-template-columns: 1fr; height: auto; min-height: auto; overflow: visible; }
  .result-list { border-right: 0; min-height: 150px; max-height: 260px; border-bottom: 1px solid var(--line); }
  .detail-pane { min-height: 260px; }
}
