:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #111722;
  --panel-2: #151d2a;
  --line: #2b3648;
  --text: #f7f9fd;
  --muted: #9ca8ba;
  --accent: #f15b2a;
  --green: #34d1b2;
  --yellow: #f4c14f;
  --red: #ef6464;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #080b10 0%, #05070a 100%);
  color: var(--text);
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app { width: min(1220px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 40px; }
.hero { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 10px 0 14px; }
.compact-hero h1 { max-width: 740px; font-size: clamp(1.8rem, 3.8vw, 3.35rem); line-height: 1.02; letter-spacing: 0; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, p { margin: 0; }
h2 { font-size: 1.02rem; letter-spacing: 0; }
.lede { max-width: 760px; margin-top: 10px; color: var(--muted); font-size: 0.98rem; line-height: 1.55; }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 4px; }

.search-card, .panel, .metrics article { border: 1px solid rgba(255,255,255,0.09); background: rgba(17, 23, 34, 0.96); border-radius: 10px; box-shadow: 0 18px 48px rgba(0,0,0,0.26); }
.primary-flow { border-color: rgba(52,209,178,0.28); }
.search-card { padding: 16px; }
.section-heading, .panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.quick-label, label { display: grid; gap: 6px; color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.search-row { display: grid; grid-template-columns: minmax(280px, 1fr) 140px 104px; gap: 10px; margin-top: 12px; }
.inputs-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }

input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; color: var(--text); background: #090e17; outline: none; font-weight: 700; }
#quickSearchInput { min-height: 54px; font-size: 1.03rem; border-color: rgba(52,209,178,0.42); }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(52,209,178,0.16); }

.primary, .secondary, .link-button { min-height: 42px; border-radius: 8px; border: 1px solid transparent; padding: 0 13px; display: inline-grid; place-items: center; font-weight: 900; text-decoration: none; white-space: nowrap; }
.search-row .primary, .search-row .link-button { min-height: 54px; }
.primary { color: white; background: var(--accent); }
.secondary, .link-button { color: var(--text); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.link-button { color: var(--green); border-color: rgba(52,209,178,0.35); }
.full { width: 100%; }

.helper { margin-top: 10px; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.helper strong { color: var(--text); }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.metrics article { padding: 14px; }
.metrics article.highlight-metric { border-color: rgba(52,209,178,0.34); background: linear-gradient(180deg, rgba(52,209,178,0.11), rgba(17,23,34,0.96)); }
.metrics span { display: block; color: var(--muted); font-size: 0.7rem; font-weight: 900; text-transform: uppercase; }
.metrics strong { display: block; margin-top: 7px; font-size: clamp(1.2rem, 2.2vw, 2rem); letter-spacing: 0; }

.panel { padding: 16px; }
.priority-panel { margin-top: 12px; border-color: rgba(255,255,255,0.12); }
.chart-panel { margin-top: 12px; }
.badge, .small-muted { color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.badge { padding: 7px 10px; border-radius: 999px; background: rgba(52,209,178,0.12); color: var(--green); }

#trendCanvas { width: 100%; height: min(280px, 38vw); margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: #090e17; }
.trim-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.trim-chip { min-height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; color: var(--muted); background: #090e17; font-weight: 900; }
.trim-chip.active { color: #06110d; background: var(--green); border-color: var(--green); }
.table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th, td { padding: 12px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(255,255,255,0.025); }
td { color: #e7edf8; font-size: 0.88rem; }
tr:last-child td { border-bottom: 0; }
.vehicle { color: var(--text); font-weight: 900; }
.subtle { display: block; margin-top: 4px; color: var(--muted); font-size: 0.76rem; line-height: 1.3; }
.link-text { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { display: inline-grid; min-width: 46px; place-items: center; padding: 6px 8px; border-radius: 999px; color: #06110d; background: var(--green); font-weight: 900; }
.score.mid { background: var(--yellow); }
.score.low { color: white; background: var(--red); }
td a { color: var(--green); font-weight: 900; text-decoration: none; }

@media (max-width: 1050px) { .inputs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .hero, .header-actions, .section-heading, .panel-title { display: grid; justify-content: stretch; }
  .search-row { grid-template-columns: 1fr; }
  .inputs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .app { width: min(100% - 18px, 1220px); padding-top: 12px; }
  .inputs-grid, .metrics { grid-template-columns: 1fr; }
  .compact-hero h1 { font-size: 2rem; }
  .lede { font-size: 0.92rem; }
}
