/* AutoSniper Price Drops — Bloomberg-dense terminal aesthetic
 * --------------------------------------------------------------
 * Top section: catalog page (topbar + ticker + statbar + table).
 * Bottom section: existing listing-detail dashboard (preserved
 * verbatim — uses the legacy --card / --border / --fg aliases that
 * are mapped to the new tokens in :root below).
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* === Bloomberg palette === */
  --bg:           #0a0a0a;
  --bg-1:         #0f0f0f;
  --bg-2:         #141414;
  --bg-3:         #1a1a1a;
  --line:         #1f1f1f;
  --line-2:       #2a2a2a;
  --text:         #ededed;
  --text-dim:     #8a8a8a;
  --text-dimmer:  #5a5a5a;
  --accent:       #FF8A2E;
  --accent-dim:   #FF8A2E99;
  --accent-glow:  #FF8A2E22;
  --good:         #4ade80;
  --good-dim:     #4ade8099;
  --bad:          #ff5757;
  --warn:         #ffc93c;
  --info:         #5BD5FF;

  /* === Legacy aliases for existing detail-page CSS === */
  --bg-elevated:   var(--bg-1);
  --card:          var(--bg-1);
  --card-hover:    var(--bg-2);
  --border:        var(--line);
  --border-strong: var(--line-2);
  --fg:            var(--text);
  --fg-strong:     var(--text);
  --muted:         var(--text-dim);
  --muted-soft:    var(--text-dimmer);
  --primary:       var(--accent);
  --primary-soft:  var(--accent-glow);
  --accent-soft:   var(--accent-glow);
  --warn-soft:     rgba(255, 201, 60, 0.10);
  --danger:        var(--bad);
  --danger-soft:   rgba(255, 87, 87, 0.12);
  --info-soft:     rgba(91, 213, 255, 0.10);
  --radius-sm:     3px;
  --radius:        4px;
  --radius-lg:     6px;
  --shadow:        0 1px 2px rgba(0,0,0,0.4);
  --shadow-lift:   0 8px 24px rgba(0,0,0,0.6);
  --maxw:          1280px;
  --header-h:      52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 'Inter', system-ui, sans-serif;
  font-feature-settings: 'cv11','ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.01em;
}
.dim     { color: var(--text-dim); }
.dimmer  { color: var(--text-dimmer); }
.good    { color: var(--good); }
.bad     { color: var(--bad); }
.accent-text { color: var(--accent); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 80% -200px, var(--accent-glow), transparent 60%),
    var(--bg);
}

/* ─── Topbar ─────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.topbar-l, .topbar-r { display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 26px; height: 26px;
  background: var(--accent);
  display: grid; place-items: center;
  position: relative;
  border-radius: 2px;
}
.logo-cross {
  color: #000; font-weight: 800; font-size: 18px; line-height: 1;
  transform: rotate(45deg);
  font-family: 'JetBrains Mono', monospace;
}
.logo-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600; font-size: 13px; letter-spacing: 0.04em;
}
.logo-tld { color: var(--text-dim); font-weight: 400; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text-dim);
  padding: 4px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.status-pill .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 var(--good);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(74,222,128,0.5); }
  100% { box-shadow: 0 0 0 8px rgba(74,222,128,0);   }
}
.clock {
  font-size: 11px; color: var(--text-dim); letter-spacing: 0.02em;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.btn-ghost:hover { color: var(--text); border-color: #3a3a3a; }
.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #000;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.1); }

/* ─── Ticker ─────────────────────────────────────────────────── */
.ticker {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  height: 30px;
  overflow: hidden;
}
.ticker-tag {
  display: flex; align-items: center;
  padding: 0 12px;
  background: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  color: #000; letter-spacing: 0.08em;
  flex-shrink: 0;
}
.ticker-track { flex: 1; overflow: hidden; position: relative; }
.ticker-row {
  display: inline-flex; white-space: nowrap;
  animation: scroll 60s linear infinite;
}
@keyframes scroll {
  0%   { transform: translateX(0);    }
  100% { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 24px;
  border-right: 1px solid var(--line);
  font-size: 11px;
  height: 30px;
}
.ticker-time { color: var(--text-dim); font-size: 10px; }
.ticker-id   { color: var(--accent);   font-size: 10px; }
.ticker-text { color: var(--text); }
.ticker-drop { font-size: 11px; }

/* ─── Main ───────────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: 20px 20px 60px;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px;
  padding: 16px 0 24px;
}
.page-eyebrow {
  font-size: 10px; color: var(--accent);
  letter-spacing: 0.16em; margin-bottom: 8px;
}
.page-title {
  font-size: 38px; line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 12px; font-weight: 700;
}
.page-title-dim { color: var(--text-dim); font-weight: 400; }
.page-sub {
  font-size: 12px; color: var(--text-dim);
  max-width: 720px; letter-spacing: 0.01em;
}
.page-head-r { display: flex; gap: 8px; }

/* ─── Statbar ────────────────────────────────────────────────── */
.statbar {
  display: grid;
  /* 3 tiles after the no-judgement sweep (was 5). `auto-fit` adapts:
     ~140px per tile → narrow phones stack to 1 column, wider screens
     fit 2 or 3 across. Grid `gap: 1px` over a line-colored background
     gives us clean inter-tile dividers automatically — no per-tile
     borders, no stray double-lines on the last row. */
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
  margin-bottom: 28px;
}
.stat {
  background: var(--bg-1);
  padding: 14px 18px;
}
.stat-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; color: var(--text-dim);
  letter-spacing: 0.1em; margin-bottom: 6px;
}
.stat-val {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.1;
  color: var(--text);
}
.stat-val.is-good   { color: var(--good); }
.stat-val.is-bad    { color: var(--bad); }
.stat-val.is-accent { color: var(--accent); }
.stat-sub {
  font-size: 10px; color: var(--text-dimmer);
  margin-top: 4px; letter-spacing: 0.04em;
}

/* ─── Section header ─────────────────────────────────────────── */
.section-h {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.sh-num {
  font-size: 10px; color: var(--accent); letter-spacing: 0.1em;
}
.sh-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.sh-rule {
  flex: 1; height: 1px;
  background: linear-gradient(to right, var(--line), transparent);
}
.sh-meta {
  font-size: 10px; color: var(--text-dim); letter-spacing: 0.04em;
}

/* ─── Filter bar ─────────────────────────────────────────────── */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  margin-bottom: 0;
  border-bottom: 0;
}
.fb-group { display: flex; flex-direction: column; gap: 4px; }
.fb-group label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--text-dim);
  letter-spacing: 0.08em;
}
.fb-group select, .fb-group input {
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 6px 8px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 3px;
  outline: none;
  min-width: 130px;
  transition: border-color 0.12s;
}
.fb-group select:focus, .fb-group input:focus { border-color: var(--accent); }
.fb-group select:disabled { opacity: 0.5; cursor: not-allowed; }
.fb-group.sort select { min-width: 180px; }
.fb-spacer { flex: 1; }
.btn-clear {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  padding: 6px 10px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  font-weight: 600;
  border-radius: 3px;
  align-self: flex-end;
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn-clear:hover { color: var(--bad); border-color: var(--bad); }
.btn-apply {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #000;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  border-radius: 3px;
  align-self: flex-end;
}
.btn-apply:hover { filter: brightness(1.1); }

/* ─── Deals Table ────────────────────────────────────────────── */
.table-wrap {
  border: 1px solid var(--line);
  background: var(--bg-1);
  overflow-x: auto;
}
.deals-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}
.deals-table tbody td { border-bottom: 1px solid var(--line); }
.deals-table thead th {
  position: sticky; top: 52px;
  background-color: var(--bg-2);
  background-image: linear-gradient(var(--bg-2), var(--bg-2));
  text-align: left;
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 10px 10px;
  white-space: nowrap;
  user-select: none;
  z-index: 50;
  box-shadow: inset 0 -1px 0 var(--line-2), 0 6px 12px -6px rgba(0,0,0,0.9);
}
.deals-table thead th a {
  color: inherit; text-decoration: none;
  display: inline-flex; align-items: center;
}
.deals-table thead th a:hover { color: var(--text); }
.deals-table thead th.num { text-align: right; }
.deals-table thead th.hi  { color: var(--text); }
.sort-arrow { color: var(--accent); margin-left: 4px; font-size: 8px; }

.deals-table tbody tr.row {
  transition: background 0.08s;
  cursor: pointer;
}
.deals-table tbody tr.row:hover { background: var(--bg-2); }
.deals-table td {
  padding: 12px 14px;
  vertical-align: middle;
  white-space: nowrap;
}
.deals-table td.num { text-align: right; }
.deals-table td.hi  { font-weight: 700; }

.density-compact .deals-table td { padding: 12px 14px; }

.id-cell { color: var(--text-dim); }

.vehicle-cell { min-width: 240px; white-space: normal; width: 100%; }
.vehicle-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600;
  color: var(--accent); letter-spacing: -0.005em;
}
.vehicle-title a { color: inherit; text-decoration: none; }
.vehicle-title a:hover { text-decoration: underline; text-decoration-color: var(--accent-dim); }
.vehicle-flags { display: inline-flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.flag-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid;
}
/* Domain-specific signal pills (distress / relisted / drop / changes / typo) */
.flag-distress { color: var(--warn);  border-color: var(--warn);  background: rgba(255,201,60,0.10); }
.flag-relisted { color: var(--info);  border-color: var(--info);  background: rgba(91,213,255,0.10); }
.flag-drop     { color: var(--good);  border-color: var(--good);  background: rgba(74,222,128,0.10); }
.flag-raise    { color: var(--bad);   border-color: var(--bad);   background: rgba(255,87,87,0.10); }
.flag-changes  { color: var(--text-dim); border-color: var(--line-2); background: rgba(255,255,255,0.02); }
.flag-typo     { color: var(--accent); border-color: var(--accent); border-style: dashed; background: var(--accent-glow); }

.score-cell { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.score-num {
  font-weight: 600; min-width: 22px; text-align: right;
}
.score-bar {
  width: 44px; height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.score-bar-fill { height: 100%; transition: width 0.3s; }

.spark-cell { width: 100px; padding: 4px 10px !important; color: var(--accent); }
.spark-cell svg { display: block; }

.src-cell { font-size: 10px; color: var(--text-dim); letter-spacing: 0.04em; }

.highlight-deals .deals-table tr.row td.accent-text { color: var(--accent); }

.empty {
  padding: 60px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

#load-more {
  display: block; width: 100%;
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--line);
  border-top: 0;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
#load-more:hover { background: var(--bg-2); color: var(--accent); }

.footer {
  display: flex; justify-content: space-between;
  margin-top: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--text-dimmer);
  letter-spacing: 0.06em;
}
.footer a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); }
.footer a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ─── Desktop column widths ──────────────────────────────────────
   With only 4 columns and a narrower max-width, give the title room
   to breathe and keep numeric columns tight + right-aligned. */
.deals-table .vehicle-cell { padding-right: 16px; }
.deals-table td.year-cell  { width: 60px;  white-space: nowrap; }
.deals-table td.km-cell    { width: 110px; white-space: nowrap; }
.deals-table td.price-cell { width: 140px; white-space: nowrap; padding-right: 16px; }

/* ─── Responsive ─────────────────────────────────────────────── */
/* Statbar handles its own responsiveness via `auto-fit` + grid gap;
   no width-specific overrides needed any more. */

@media (max-width: 768px) {
  .clock, .status-pill { display: none; }
  .topbar { padding: 0 12px; }
  .main { padding: 12px 12px 60px; }
  .page-title { font-size: 26px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .filterbar { padding: 10px; }
  .fb-group select, .fb-group input { min-width: 100%; }
  .fb-group { flex: 1 1 45%; }
}

/* ─── Mobile: rows stack into 2 lines per listing ─────────────── */
@media (max-width: 640px) {
  .table-wrap { overflow-x: hidden; }
  .deals-table,
  .deals-table tbody,
  .deals-table tr { display: block; width: 100%; }

  .deals-table tr.row {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "vehicle vehicle"
      "year    price"
      "km      price";
    column-gap: 12px;
    row-gap: 2px;
    align-items: baseline;
  }
  .deals-table tr.row td {
    border: 0;
    padding: 0;
    white-space: normal;
    width: auto;
  }
  .deals-table .vehicle-cell { grid-area: vehicle; padding-right: 0; margin-bottom: 6px; }
  .deals-table .year-cell    { grid-area: year;    text-align: left; font-size: 11px; color: var(--accent-dim); }
  .deals-table .km-cell      { grid-area: km;      text-align: left; font-size: 11px; color: var(--accent-dim); }
  .deals-table .price-cell   { grid-area: price;   text-align: right; align-self: center; font-size: 16px; padding-right: 0; }

  .vehicle-title { font-size: 13.5px; line-height: 1.3; }
}

/* =====================================================================
   Listing detail dashboard — preserved from prior design.
   Uses the legacy --card / --border / --fg / --muted aliases that map
   to the Bloomberg tokens above.
   ===================================================================== */

.section {
  background: var(--card); border: 1px solid var(--border);
  padding: 16px; border-radius: var(--radius); margin-bottom: 16px;
}
.section h2 {
  margin: 0 0 12px 0; font-size: 16px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}

.deal-bar {
  background: var(--border); height: 8px; border-radius: 4px;
  position: relative; margin: 12px 0;
}
.deal-bar-fill { background: var(--accent); height: 100%; border-radius: 4px; }

.kv {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 4px 16px; font-size: 14px;
}
.history-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: 0; }

.pct-good { color: var(--good); }
.pct-bad  { color: var(--bad); }
.pct-na   { color: var(--muted); font-size: 14px; font-weight: 400; }

.dash-header { margin-bottom: 24px; }
.dash-header .back-link {
  color: var(--muted); text-decoration: none; font-size: 14px;
  display: inline-block; margin-bottom: 8px;
}
.dash-header .back-link:hover { color: var(--fg); }
.dash-header h1 {
  margin: 0 0 6px 0; font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em;
  font-family: 'Inter', sans-serif;
}
.dash-header .meta-line { color: var(--muted); font-size: 16px; }

.stale-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--warn-soft);
  border: 1px solid rgba(255, 201, 60, 0.4);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 14px; line-height: 1.5;
}
.stale-banner .stale-icon { font-size: 20px; color: var(--warn); flex: 0 0 auto; }
.stale-banner strong { color: var(--warn); }

.dash-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 720px) { .dash-grid { grid-template-columns: 1fr; } }

.tile {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.tile h3 {
  margin: 0; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.tile-big { font-size: 32px; font-weight: 700; line-height: 1.1; font-family: 'Inter', sans-serif; }
.tile-sub { color: var(--muted); font-size: 14px; }
.tile-text p { margin: 4px 0; line-height: 1.55; font-family: 'Inter', sans-serif; }
.tile-cta {
  margin-top: 8px;
  display: inline-block;
  background: var(--accent); color: #000;
  text-decoration: none; padding: 10px 14px; border-radius: 4px;
  font-weight: 700; font-size: 11px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.06em;
  width: fit-content;
}
.tile-cta:hover { filter: brightness(1.1); }

.gauge-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-top: 4px;
}
.gauge-wrap .gauge-pct {
  font-size: 36px; font-weight: 800; line-height: 1;
  font-family: 'Inter', sans-serif;
}
.gauge-wrap .gauge-verdict {
  font-size: 13px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}

.distribution { position: relative; padding: 36px 0 28px 0; }
.distribution svg { display: block; width: 100%; height: 50px; }
.distribution .marker-label {
  position: absolute; top: 0; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.distribution .scale-labels { position: relative; height: 18px; margin-top: 4px; }
.distribution .scale-label {
  position: absolute; transform: translateX(-50%);
  font-size: 11px; color: var(--muted);
}
.distribution .scale-label .v { color: var(--fg); font-weight: 600; display: block; }

.tiles-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 16px;
}

.kv-tile {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 16px;
}
.kv-tile h3 {
  margin: 0 0 8px 0; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.kv-tile .kv-pair { font-size: 14px; line-height: 1.6; }
.kv-tile .kv-pair .label { color: var(--muted); margin-right: 6px; }
.kv-tile .kv-bignum { font-size: 22px; font-weight: 700; margin: 4px 0; font-family: 'Inter', sans-serif; }
.kv-tile .kv-good { color: var(--good); }
.kv-tile .kv-warn { color: var(--warn); }

.comp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.comp-table thead th {
  text-align: left; color: var(--muted); font-weight: 600;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.comp-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.comp-table tbody tr:last-child td { border-bottom: 0; }
.comp-table .col-price { font-weight: 600; }
.comp-table a { color: var(--fg); text-decoration: none; font-size: 13px; }
.comp-table a:hover { color: var(--accent); }
.comp-table .self-row { background: var(--accent-glow); }
.comp-table .self-row td:first-child::before {
  content: "▶ "; color: var(--accent); font-weight: 700;
}
.comp-table .peer-tag {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; background: var(--border); color: var(--muted);
  margin-left: 4px;
}

.history-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 720px) { .history-wrap { grid-template-columns: 1fr; } }
.history-summary .history-headline {
  font-size: 28px; font-weight: 800; line-height: 1.1;
  font-family: 'Inter', sans-serif;
}
.history-summary .history-headline.kv-good { color: var(--good); }
.history-summary .history-headline.kv-warn { color: var(--warn); }
.history-summary .history-sub {
  color: var(--muted); font-size: 13px; line-height: 1.5;
}
.history-summary .history-sub strong { color: var(--fg); }

.history-chart-wrap { min-width: 0; }
.price-chart {
  display: block; width: 100%; height: 110px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px;
}
.chart-axis {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: 11px; color: var(--muted);
}

.history-list { grid-column: 1 / -1; margin-top: 8px; }
.history-list .history-list-head {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 700; margin-bottom: 6px;
}
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history-table tr { border-bottom: 1px solid var(--border); }
.history-table tr:last-child { border-bottom: 0; }
.history-table td { padding: 8px 6px; }
.history-table .hist-date { color: var(--muted); width: 130px; }
.history-table .hist-price { font-weight: 600; }
.history-table .hist-delta {
  text-align: right; font-size: 13px; font-variant-numeric: tabular-nums;
}
.history-table .hist-delta.kv-good { color: var(--good); }
.history-table .hist-delta.kv-warn { color: var(--warn); }
.history-table .src-tag {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; border-radius: 8px;
  background: var(--border); color: var(--muted);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}

.cluster-callout {
  margin-top: 12px; padding: 10px 12px;
  background: var(--warn-soft);
  border: 1px solid rgba(255, 201, 60, 0.35);
  border-radius: 6px;
}
.cluster-callout .cluster-callout-title {
  font-size: 13px; font-weight: 700; color: var(--warn);
  margin-bottom: 4px;
}
.diff-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.diff-table td { padding: 4px 6px; vertical-align: top; }
.diff-table .diff-field { color: var(--muted); width: 90px; }
.diff-table .diff-prev { color: var(--muted); text-decoration: line-through; }
.diff-table .diff-arrow { color: var(--muted); width: 20px; text-align: center; }
.diff-table .diff-current { font-weight: 600; }
.diff-table .diff-current.kv-warn { color: var(--warn); }

.chart-axis .chart-legend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--muted);
}
.chart-axis .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 2px;
}
.chart-axis .dot-prev { background: var(--muted); }
.chart-axis .dot-cur  { background: var(--accent); }

.dash-footer {
  display: flex; gap: 12px; margin-top: 24px;
  flex-wrap: wrap;
}
.dash-footer a, .dash-footer button {
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 12px 16px; font-size: 12px; cursor: pointer;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.06em;
}
.dash-footer a:hover { color: var(--accent); border-color: var(--accent); }
.dash-footer a.primary {
  background: var(--accent); color: #000; border-color: var(--accent);
  font-weight: 700;
}
.dash-footer .lookup-form {
  display: flex; gap: 8px; flex: 1; min-width: 240px;
}
.dash-footer .lookup-form input {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 12px; font-size: 13px; flex: 1;
  font-family: 'JetBrains Mono', monospace;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.match-score {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #27272a;
  color: #a1a1aa;
}


/* Price was/now/discount in listing card */
.price-was {
  text-decoration: line-through;
  color: #71717a;
  font-size: 12px;
  margin-right: 6px;
}
.price-now {
  color: #f4f4f5;
  font-weight: 600;
}
.price-discount {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.discount-cell {
  width: 60px;
  min-width: 60px;
  text-align: center;
  padding: 0 4px;
}

.validated-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
