/* Modern Dark Terminal Theme for Daily Fuel Cycle & Best Day to Fill Radar */

:root {
  --bg: #0b0f17;
  --bg-subtle: #111827;
  --panel: #151d2c;
  --panel-hover: #1c273a;
  --border: #232f42;
  --border-hover: #334460;
  --border-focus: #3b82f6;

  --text: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent: #3b82f6;
  --accent-hover: #2563eb;

  /* Verdict Colors */
  --action-buy: #10b981;
  --action-buy-bg: rgba(16, 185, 129, 0.14);
  --action-buy-border: rgba(16, 185, 129, 0.4);

  --action-wait: #f59e0b;
  --action-wait-bg: rgba(245, 158, 11, 0.14);
  --action-wait-border: rgba(245, 158, 11, 0.4);

  --action-spike: #f43f5e;
  --action-spike-bg: rgba(244, 63, 94, 0.14);
  --action-spike-border: rgba(244, 63, 94, 0.4);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px -4px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Site Header */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.site-header h1 {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--panel-hover);
  border-color: var(--border-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

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

.btn-icon {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: #fff;
  background: var(--panel-hover);
}

/* Main Container */
.main-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  width: 100%;
}

/* Status Bar */
.status-bar {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-bar.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.status-bar.error {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fca5a5;
}

/* Overview Summary Stats */
.overview-section {
  margin-bottom: 24px;
}

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

.summary-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
}

.summary-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
}

.summary-card.stat-buy .summary-value {
  color: var(--action-buy);
}

.summary-card.stat-wait .summary-value {
  color: var(--action-wait);
}

.summary-card.stat-spike .summary-value {
  color: var(--action-spike);
}

/* Toolbar & City Selector */
.toolbar-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 24px;
}

.toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Segmented City Tabs */
.segmented-control {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  overflow-x: auto;
}

.segment-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.segment-btn.active {
  background: var(--panel-hover);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Fuel Pills */
.market-pills {
  display: inline-flex;
  gap: 6px;
  overflow-x: auto;
}

.pill-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pill-btn:hover {
  border-color: var(--border-hover);
  color: #fff;
}

.pill-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent);
  color: #93c5fd;
}

.tank-quick-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

.tank-quick-badge strong {
  color: #fff;
}

/* Verdict Hero Card */
.verdict-section {
  margin-bottom: 24px;
}

.verdict-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.verdict-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #10b981);
}

.verdict-card.verdict-buy::before {
  background: linear-gradient(90deg, #059669, #10b981);
}

.verdict-card.verdict-wait::before {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.verdict-card.verdict-spike::before {
  background: linear-gradient(90deg, #e11d48, #f43f5e);
}

.verdict-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.city-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.city-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.cycle-info-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.badge-verdict {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-verdict.buy {
  background: var(--action-buy-bg);
  border: 1px solid var(--action-buy-border);
  color: var(--action-buy);
}

.badge-verdict.wait {
  background: var(--action-wait-bg);
  border: 1px solid var(--action-wait-border);
  color: var(--action-wait);
}

.badge-verdict.spike {
  background: var(--action-spike-bg);
  border: 1px solid var(--action-spike-border);
  color: var(--action-spike);
}

.verdict-headline-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verdict-headline {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.verdict-phase-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  display: inline-block;
  align-self: flex-start;
}

/* Cycle Visualizer Track */
.cycle-visualizer-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cycle-visualizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cycle-vis-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.cycle-vis-status {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cycle-track {
  display: flex;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: #1e2638;
}

.cycle-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}

.seg-bottom {
  width: 25%;
  background: rgba(16, 185, 129, 0.25);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.seg-spike {
  width: 15%;
  background: rgba(244, 63, 94, 0.4);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.seg-peak {
  width: 20%;
  background: rgba(244, 63, 94, 0.25);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.seg-dropping {
  width: 40%;
  background: rgba(245, 158, 11, 0.25);
}

.cycle-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #fff;
  box-shadow: 0 0 10px #fff;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}

.pointer-pin {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: -4px;
}

.pointer-label {
  display: none;
}

.cycle-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Card Metrics Row */
.card-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.metric-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.price-val-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.price-unit {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

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

.text-accent {
  color: #60a5fa;
}

.text-buy {
  color: var(--action-buy);
}

/* AI Rationale Box */
.ai-rationale-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
}

.confidence-tag {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.confidence-tag strong {
  color: #fff;
}

.rationale-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.savings-tip-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #a7f3d0;
}

.tip-icon {
  font-size: 1rem;
}

/* Grid Details: Calculator + Stations */
.grid-details-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.detail-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.detail-card-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Calculator Body */
.calc-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
}

.calc-slider-val {
  font-size: 0.95rem;
  color: var(--text);
}

.calc-slider-val strong {
  color: #fff;
  font-size: 1.15rem;
}

.range-slider {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent);
}

.calc-presets-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.preset-btn {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--border-hover);
  color: #fff;
}

.preset-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent);
  color: #93c5fd;
}

.calc-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.calc-result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-result-box.highlight-box {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.calc-result-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.calc-result-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.calc-result-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.calc-savings-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.banner-icon {
  font-size: 1.5rem;
}

.banner-text {
  display: flex;
  flex-direction: column;
}

.banner-strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: #34d399;
}

.banner-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Suburb Search & Stations */
.suburb-search-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fuelcheck-commentary-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.65) 100%);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-md);
  padding: 11px 13px;
}

.fc-badge-icon {
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

.fc-badge-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fc-badge-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6ee7b7;
  letter-spacing: 0.01em;
}

.fc-badge-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.suburb-search-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suburb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
}

.suburb-search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 36px 10px 38px;
  font-family: inherit;
  font-size: 0.92rem;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.suburb-search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: #0f1624;
}

.suburb-search-input::placeholder {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-clear-search:hover {
  color: #fff;
}

.suburb-quick-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.suburb-chips-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  margin-right: 2px;
}

.suburb-chip {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.suburb-chip:hover {
  border-color: var(--border-hover);
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.suburb-chip.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--accent);
  color: #93c5fd;
}

.suburb-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.results-count-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.results-sort-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

/* Stations List */
.stations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 2px;
}

.station-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}

.station-row:hover {
  border-color: var(--border-hover);
  background: #141c2c;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.station-row.cheapest-station {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.station-row.cheapest-station:hover {
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.station-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.station-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.station-name-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  transition: color 0.15s ease;
}

.station-row:hover .station-name-title {
  color: #60a5fa;
}

.station-brand-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.station-address {
  font-size: 0.72rem;
  color: var(--text-dim);
  max-width: 290px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-maps-hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  transition: color 0.15s ease;
}

.station-row:hover .station-maps-hint {
  color: #93c5fd;
}

.station-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.station-price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.station-price {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
}

.station-cheapest-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.station-discount-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--action-buy);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.station-empty-state {
  padding: 24px 16px;
  text-align: center;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* Drawer / Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: none;
}

.modal-backdrop.active {
  display: block;
}

.watchlist-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 90vw;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.watchlist-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.drawer-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-unit {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.text-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 12px;
  outline: none;
}

.text-input:focus {
  border-color: var(--accent);
}

.select-control {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 28px 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

.select-control:focus {
  border-color: var(--accent);
}

.form-help {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.drawer-tools-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg);
  margin-top: auto;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ========================================================
   Mobile & Responsive Layout
   ======================================================== */
@media (max-width: 860px) {
  .header-inner {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .site-header h1 {
    font-size: 1.1rem;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 42px;
  }

  .main-container {
    padding: 14px 12px;
  }

  .summary-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .summary-card:first-child {
    grid-column: 1 / -1;
  }

  .summary-value {
    font-size: 1.25rem;
  }

  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .segmented-control {
    width: 100%;
    display: flex;
  }

  .segment-btn {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    font-size: 0.76rem;
  }

  .market-pills {
    width: 100%;
    display: flex;
  }

  .pill-btn {
    flex: 1;
    text-align: center;
    padding: 7px 6px;
    font-size: 0.74rem;
  }

  .card-metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .grid-details-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .watchlist-drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: none;
  }

  .drawer-header {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .drawer-body {
    padding: 16px 14px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .text-input,
  .select-control {
    font-size: 16px;
    /* Prevents auto-zoom on iOS */
    min-height: 42px;
  }
}

@media (max-width: 420px) {
  .site-header h1 {
    font-size: 1.02rem;
  }

  .city-title {
    font-size: 1.2rem;
  }

  .verdict-headline {
    font-size: 1.15rem;
  }

  .calc-presets-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
