:root {
  --bg: #f6f3ea;
  --panel: #fffdf8;
  --line: #d6cfc0;
  --text: #2b2b28;
  --muted: #5d5a53;
  --accent: #0f766e;
  --accent-2: #f97316;
  --good: #15803d;
  --bad: #b91c1c;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Space Grotesk', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, #fff9e8, var(--bg));
}

.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.35;
}

.shape-a {
  width: 320px;
  height: 320px;
  background: #fde68a;
  top: -80px;
  right: -80px;
}

.shape-b {
  width: 280px;
  height: 280px;
  background: #99f6e4;
  left: -60px;
  bottom: -50px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1200px, 94vw);
  margin: 24px auto 40px;
  display: grid;
  gap: 16px;
}

.hero {
  background: linear-gradient(145deg, #fff, #fff5e7);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  animation: riseIn 420ms ease;
}

.kicker {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.hero h1 {
  margin: 6px 0;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
}

.subtitle,
.run-meta,
.muted {
  margin: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  transform: translateY(8px);
  opacity: 0;
  animation: riseIn 420ms ease forwards;
}

.stat-card .label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-card .value {
  margin: 8px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--mono);
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.check-control {
  align-content: end;
}

.check-control input {
  width: auto;
}

.filter-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.btn {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.btn-ghost {
  background: #fff;
  color: var(--text);
}

.charts-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.histogram {
  display: grid;
  gap: 6px;
}

.hist-row {
  display: grid;
  grid-template-columns: 1fr 4fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
}

.hist-bar {
  height: 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #14b8a6);
}

.trend-chart {
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  border-bottom: 1px solid #ece7db;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th[data-sort] {
  cursor: pointer;
  user-select: none;
}

tbody tr:hover {
  background: #fff5e5;
}

.sparkline {
  width: 96px;
  height: 24px;
}

.star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.change-log {
  display: grid;
  gap: 8px;
}

.change-item {
  border: 1px solid #ebe2d2;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.new { background: #dcfce7; color: var(--good); }
.badge.price_changed,
.badge.attributes_changed { background: #dbeafe; color: #1d4ed8; }
.badge.removed { background: #fee2e2; color: var(--bad); }

.change-diff {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--mono);
}

#map {
  height: 300px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .page {
    width: 96vw;
    margin-top: 12px;
  }

  .panel,
  .hero {
    padding: 12px;
  }
}
