:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #142019;
  background: #f4f7f5;
  font-synthesis: none;
  --surface: #ffffff;
  --surface-soft: #eef3f0;
  --line: #dce5df;
  --text-muted: #68756d;
  --accent: #176a4a;
  --accent-soft: #e1f2ea;
  --danger: #9d2c2c;
  --shadow: 0 18px 45px rgba(28, 54, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(23, 106, 74, 0.10), transparent 35rem),
    #f4f7f5;
  color: #142019;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin-bottom: 26px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  line-height: .98;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
  letter-spacing: -.025em;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 1.04rem;
}

.status-card {
  min-width: 245px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #56a277;
  box-shadow: 0 0 0 5px rgba(86,162,119,.13);
}

.status-card strong,
.status-card span { display: block; }

.status-card span:last-child {
  color: var(--text-muted);
  margin-top: 3px;
  font-size: .82rem;
}

.panel {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.button {
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  font-weight: 750;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.button-secondary {
  color: #fff;
  background: var(--accent);
}

.button-ghost {
  color: var(--accent);
  background: var(--accent-soft);
}

.fuel-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.fuel-tab {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  color: #34433a;
  background: var(--surface-soft);
  font-weight: 750;
}

.fuel-tab[aria-selected="true"] {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.metric-card span {
  display: block;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: -.04em;
}

.filters-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
}

label span {
  display: block;
  margin: 0 0 7px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 750;
}

input, select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: #142019;
  background: #fff;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 106, 74, .11);
}

.result-count {
  margin: 0;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 700;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--text-muted);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

td {
  font-size: .9rem;
}

td strong { font-weight: 800; }

.price-column,
.price-cell {
  text-align: right;
  white-space: nowrap;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  min-width: 76px;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  color: #26352c;
  background: var(--surface-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.price-pill.cheapest {
  color: #0e5a3c;
  background: var(--accent-soft);
}

.station-link {
  color: inherit;
  text-decoration-color: #9eb1a6;
  text-underline-offset: 3px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.comparison-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.comparison-card span,
.comparison-card small {
  display: block;
}

.comparison-card span {
  color: var(--text-muted);
  font-size: .76rem;
  margin-bottom: 6px;
}

.comparison-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.comparison-card small { color: var(--text-muted); }

.metadata-grid {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr;
  gap: 14px;
  margin: 0;
}

.metadata-grid div {
  min-width: 0;
  padding: 14px;
  border-radius: 13px;
  background: var(--surface-soft);
}

dt {
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 800;
  margin-bottom: 5px;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: .9rem;
  font-weight: 700;
}

.empty-state,
.fatal-error {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
}

.fatal-error {
  margin-bottom: 18px;
  border: 1px solid #efcaca;
  border-radius: 18px;
  color: var(--danger);
  background: #fff5f5;
}

.hidden { display: none !important; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--text-muted);
  font-size: .78rem;
  padding: 10px 3px;
}

@media (max-width: 900px) {
  .hero { align-items: stretch; flex-direction: column; }
  .status-card { min-width: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-grid { grid-template-columns: 1fr 1fr; }
  .comparison-grid { grid-template-columns: repeat(2, 1fr); }
  .metadata-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 24px;
  }

  .panel { padding: 16px; border-radius: 16px; }
  .section-heading { align-items: flex-start; }
  .filters-grid,
  .metadata-grid { grid-template-columns: 1fr; }
  .comparison-grid { grid-template-columns: 1fr; }
  .stats-grid { gap: 8px; }
  .metric-card { padding: 14px; }
  footer { flex-direction: column; }
}
