/* ── Statistics tab (Explore view) ─────────────────────────────────────────
   Dashboard ⇄ Statistics tab bar + the Statistics panel contents. Uses the
   existing design tokens; no new colors/branding. Single-column layout that
   lives inside the Explore panel on both desktop and mobile. */

/* Tab bar — pinned under the brand, above the scroll region. */
.explore-tabs {
  display: flex;
  gap: 6px;
  padding: var(--space-3) var(--space-4) 0;
  flex-shrink: 0;
}
.explore-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.explore-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Tab panels. Each restores the column gap that .explore-content-scroll
   normally applies between its direct children (we nested them one level). */
.explore-tab-panel[hidden] { display: none !important; }
#explore-tab-dashboard,
#explore-tab-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── Time-range segmented control ─────────────────────────────────────── */
.stats-range {
  display: flex;
  gap: 4px;
  background: var(--color-surface-alt);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 3px;
}
.stats-range-btn {
  flex: 1;
  padding: 6px 8px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
}
.stats-range-btn.active {
  background: var(--color-primary);
  color: #fff;
}

/* ── Summary banner ───────────────────────────────────────────────────── */
.stats-banner {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.45;
  background: var(--color-primary-muted);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.stats-banner b { color: var(--color-primary); font-weight: 700; }

/* ── KPI tiles + stat grid ────────────────────────────────────────────── */
.stats-kpis,
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stats-kpi {
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.stats-kpi-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stats-kpi-icon svg { width: 18px; height: 18px; }
.stats-kpi-body { min-width: 0; }
.stats-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stats-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 4px;
  line-height: 1.1;
}
.stats-kpi-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

/* ── Sections ─────────────────────────────────────────────────────────── */
.stats-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stats-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.stats-section-title svg { width: 16px; height: 16px; color: var(--color-primary); flex-shrink: 0; }

/* Icon-topped stat cards — Trip Highlights + Stay Statistics grids. */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.stats-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
}
.stats-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.stats-card-icon svg { width: 18px; height: 18px; }
.stats-card-value { font-size: 18px; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.stats-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stats-card-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── States visited ───────────────────────────────────────────────────── */
.stats-states {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stats-states-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
}
.stats-states-count span {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.stats-badge {
  margin-left: auto;
  background: var(--color-primary-muted);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.stats-states-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stats-state-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  border: 0.5px solid var(--color-border);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* ── Empty state ──────────────────────────────────────────────────────── */
.stats-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-text-muted);
}
.stats-empty-icon { font-size: 34px; margin-bottom: 8px; }
.stats-empty-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}
.stats-empty-sub { font-size: 13px; line-height: 1.5; }

/* ── At-a-glance (Explore "Statistics" tab) ───────────────────────────────── */
.stats-glance { display: flex; flex-direction: column; gap: var(--space-4); }
.stats-glance-link {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 4px 0;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}
.stats-glance-link:hover { text-decoration: underline; }

/* ── Full dedicated page (#view-stats) ────────────────────────────────────── */
.stats-page { padding: var(--space-4); }
#stats-page-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 1280px;
  margin: 0;
  /* Teal tints (no global teal token); matches the design system. */
  --sp-teal-light: rgba(127,195,165,0.14);
  --sp-teal-mid:   rgba(127,195,165,0.22);
  --sp-teal-edge:  rgba(127,195,165,0.30);
}
#stats-page-body .stats-banner { font-size: var(--text-base); padding: 18px 20px; }

/* Generic card + headings */
.sp-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.sp-pad { padding: 20px; }
.sp-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sp-card-title,
.sp-section-title {
  font-family: var(--font-family-display);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  color: var(--color-text);
}
.sp-section-title { margin-bottom: 18px; }
/* tk-009 #26: Places card header toggle (visited / future planned) */
.sp-places-toggle { display: inline-flex; margin-bottom: 18px; }
.sp-tinted { background: var(--sp-teal-light); border-color: var(--sp-teal-edge); }

/* Stat cards row */
.sp-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sp-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.sp-stat-top { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.sp-stat-ico {
  width: 42px; height: 42px; border-radius: var(--radius-full); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sp-stat-ico svg { width: 21px; height: 21px; }
.sp-stat-ico.green { background: var(--color-primary-muted); color: var(--color-primary); }
.sp-stat-ico.amber { background: var(--color-accent-muted); color: #a8842f; }
.sp-stat-ico.teal  { background: var(--sp-teal-mid); color: var(--color-primary); }
.sp-stat-label { font-size: var(--text-sm); color: var(--color-text-secondary); font-weight: var(--font-medium); }
.sp-stat-value { font-family: var(--font-family-display); font-size: 30px; font-weight: var(--font-bold); letter-spacing: -0.02em; line-height: 1; color: var(--color-text); }
.sp-stat-value .sp-unit { font-size: var(--text-lg); font-weight: var(--font-medium); color: var(--color-text-muted); margin-left: 4px; }
.sp-stat-note { font-size: var(--text-sm); margin-top: 11px; font-weight: var(--font-medium); color: var(--color-text-muted); }
.sp-trend { display: inline-flex; align-items: center; gap: 4px; }
.sp-trend svg { width: 13px; height: 13px; }
.sp-trend.up { color: var(--color-primary); }
.sp-trend.down { color: var(--color-error); }
.sp-note-muted { color: var(--color-text-muted); }

/* Charts row */
.sp-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sp-donut-wrap { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 18px; }
.sp-donut-box { position: relative; width: 180px; height: 180px; }
.sp-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.sp-dc-value { font-family: var(--font-family-display); font-size: 24px; font-weight: var(--font-bold); letter-spacing: -0.02em; color: var(--color-text); }
.sp-dc-label { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 2px; }
.sp-legend { display: flex; flex-direction: column; gap: 13px; }
.sp-legend-row { display: flex; align-items: center; gap: 10px; font-size: var(--text-base); }
.sp-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.sp-legend-name { color: var(--color-text-secondary); flex: 1; }
.sp-legend-val { font-weight: var(--font-semibold); color: var(--color-text); }
.sp-line-box { height: 220px; position: relative; }

/* Trip highlights */
.sp-hl-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sp-hl { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px; padding: 8px 6px; }
.sp-hl-ico { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--color-accent); }
.sp-hl-ico svg { width: 28px; height: 28px; }
.sp-hl-cat { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.3; min-height: 30px; display: flex; align-items: center; }
.sp-hl-val { font-family: var(--font-family-display); font-size: var(--text-base); font-weight: var(--font-semibold); line-height: 1.2; color: var(--color-text); }
.sp-hl-sub { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* States visited */
.sp-states { display: grid; grid-template-columns: 1fr 280px; overflow: hidden; }
.sp-states-main { padding: 20px; }
.sp-states-list { display: flex; flex-wrap: wrap; gap: 7px; }
.sp-state-pill { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--color-text-secondary); background: var(--color-surface-alt); border: 1px solid var(--color-border); padding: 5px 11px; border-radius: var(--radius-full); }
.sp-states-empty { font-size: var(--text-sm); color: var(--color-text-muted); }
.sp-map svg { width: 100%; height: auto; display: block; max-height: 320px; }
.sp-state { transition: fill-opacity 0.15s ease; }
.sp-state.on { cursor: default; }
.sp-state.on:hover { fill-opacity: 1 !important; }
.sp-states-side { background: var(--sp-teal-light); padding: 24px 22px; display: flex; flex-direction: column; justify-content: center; gap: 18px; border-left: 1px solid var(--sp-teal-edge); }
.sp-states-count { display: flex; align-items: center; gap: 13px; }
.sp-sc-ico { width: 50px; height: 50px; border-radius: var(--radius-full); background: var(--color-primary-muted); color: var(--color-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sp-sc-ico svg { width: 24px; height: 24px; }
.sp-sc-num { font-family: var(--font-family-display); font-size: 36px; font-weight: var(--font-bold); line-height: 1; color: var(--color-text); }
.sp-sc-lbl { font-size: var(--text-base); color: var(--color-text-secondary); margin-top: 4px; }
.sp-states-divider { height: 1px; background: var(--color-border); }
.sp-badge { align-self: flex-start; background: var(--color-primary-muted); color: var(--color-primary); font-size: var(--text-sm); font-weight: var(--font-semibold); padding: 6px 13px; border-radius: var(--radius-full); }

/* Bottom area — Stay statistics + Travel footprint are stacked full-width
   (NOT side-by-side, per the latest design). */
.sp-bottom { display: flex; flex-direction: column; gap: 16px; }
.sp-ms-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 12px; }
.sp-ms { display: flex; align-items: center; gap: 12px; }
.sp-ms-ico { width: 42px; height: 42px; border-radius: var(--radius-full); background: var(--color-primary-muted); color: var(--color-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sp-ms-ico svg { width: 20px; height: 20px; }
.sp-ms-lbl { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.25; }
.sp-ms-val { font-family: var(--font-family-display); font-size: var(--text-xl); font-weight: var(--font-bold); line-height: 1.1; color: var(--color-text); }
.sp-ms-val .u { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--color-text-muted); margin-left: 2px; }

/* ── Travel footprint (redesigned) ────────────────────────────────────────── */
.fp-card { }
/* Title sits left; leaf sits immediately to its right (not pushed across). */
.fp-head { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.fp-leaf { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }

.fp-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 0;
  align-items: center;
}
/* `position: relative` anchors the absolutely-positioned scenic image; the
   wide right padding reserves room for it so the hero/caption copy never runs
   underneath. */
.fp-left  { position: relative; padding-right: 148px; }
/* Shift the copy column (section-label + hero + caption) down 4px without
   touching the image — the image is absolutely positioned at top: 0 of
   .fp-left so it ignores this. Scoped to .fp-left only so the .fp-right
   "That's equivalent to" label stays at its original top. */
.fp-left > .fp-section-label { padding-top: 9px; }
.fp-right { padding-left: 32px; border-left: 1px solid var(--color-border); }
.fp-section-label { font-size: var(--text-base); font-weight: var(--font-medium); color: var(--color-text-secondary); margin-bottom: 10px; }
/* Copy block on the left grows to fill, scenic image vertically centered
   against the copy block to its right. */
.fp-hero-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.fp-hero-row > div:first-child { flex: 1; min-width: 0; }
.fp-hero-row > .fp-scene { align-self: center; }
.fp-hero { display: flex; align-items: baseline; gap: 8px; }
.fp-hero-num { font-family: var(--font-family-display); font-size: 48px; font-weight: var(--font-bold); letter-spacing: -0.03em; line-height: 0.9; color: var(--color-text); }
.fp-hero-unit { font-family: var(--font-family-display); font-size: var(--text-xl); font-weight: var(--font-semibold); color: var(--color-text-secondary); }
.fp-caption { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 10px; line-height: 1.45; }
.fp-scene {
  position: absolute;
  top: 0;
  right: 24px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
}

.fp-eq-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-accent-muted);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: background 0.15s ease;
}
.fp-eq-card:hover, .fp-eq-card:focus-visible { background: rgba(201,164,92,0.22); }
.fp-eq-card .fp-eq-icon { width: 66px; height: 66px; border-radius: 50%; background: rgba(201,164,92,0.28); color: #a8842f; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fp-eq-body { flex: 1; min-width: 0; }
.fp-eq-num { font-family: var(--font-family-display); font-size: 34px; font-weight: var(--font-bold); letter-spacing: -0.02em; line-height: 1; color: var(--color-text); }
.fp-eq-text { font-size: var(--text-base); color: var(--color-text-secondary); margin-top: 4px; }
.fp-eq-chev { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-secondary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: color 0.15s ease, border-color 0.15s ease; }
.fp-eq-card:hover .fp-eq-chev { color: var(--color-primary); border-color: var(--color-primary); }

/* Dots are centered under the equivalence card. */
.fp-dots, .fp-dots.left { display: flex; gap: 7px; margin-top: 16px; justify-content: center; }
.fp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-border); cursor: pointer; transition: background 0.15s ease, width 0.15s ease; }
.fp-dot.active { background: var(--color-primary); width: 20px; border-radius: var(--radius-full); }

/* The strip spans the full width of the card. Copy block sits on the left at
   a fixed width; the formula grows to fill the remaining width and spreads its
   chips edge-to-edge so the whole strip reads as one balanced row. */
.fp-calc {
  margin-top: 22px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
}
.fp-calc-head { flex: 0 0 280px; min-width: 0; }
.fp-calc-title { font-family: var(--font-family-display); font-size: var(--text-base); font-weight: var(--font-semibold); margin-bottom: 4px; color: var(--color-text); }
.fp-calc-desc { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.45; }

/* Formula fills the rest of the strip and distributes its 5 chips + 4 ops
   evenly across that space. flex-grow on the chips/ops handles the spacing
   so the row hugs both edges of its container without overflow. */
.fp-formula {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}
.fp-fchip { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; width: 88px; flex-shrink: 0; }
.fp-fchip .fc-ico { width: 50px; height: 50px; border-radius: 50%; background: var(--color-surface); border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fp-fchip .fc-ico img { width: 34px; height: 34px; object-fit: contain; }
.fp-fchip .fc-lbl { font-size: 12px; color: var(--color-text-muted); line-height: 1.2; }
.fp-fchip .fc-val { font-size: 13px; font-weight: var(--font-semibold); color: var(--color-text); white-space: nowrap; }
.fp-op { font-size: var(--text-lg); color: var(--color-text-muted); font-weight: var(--font-medium); margin-top: 16px; flex-shrink: 0; }
.fp-foot { margin-top: 14px; font-size: var(--text-sm); color: var(--color-text-muted); }

/* ── Page header (title + timeframe controls) ─────────────────────────────── */
.sp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sp-page-title { font-family: var(--font-family-display); font-size: 32px; font-weight: var(--font-bold); letter-spacing: -0.02em; line-height: 1.1; color: var(--color-text); }
.sp-page-sub { font-size: var(--text-base); color: var(--color-text-secondary); margin-top: 6px; margin-bottom: 2px; }
.sp-page-disclaimer {
  font-size: calc(var(--text-base) - 3px);
  font-style: italic;
  color: var(--color-text-secondary);
  margin-top: 0;
}
.sp-controls { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.sp-segmented {
  display: flex;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.sp-seg-btn {
  border: none; background: transparent; font: inherit;
  color: var(--color-text-secondary); font-weight: var(--font-medium); font-size: var(--text-base);
  padding: 9px 18px; border-radius: var(--radius-full); cursor: pointer; white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.sp-seg-btn:hover { color: var(--color-text); }
.sp-seg-btn.active { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.sp-cal-wrap { position: relative; }
.sp-cal-btn {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  color: var(--color-text-secondary); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.sp-cal-btn svg { width: 20px; height: 20px; }
.sp-cal-btn:hover, .sp-cal-btn.active { color: var(--color-primary); border-color: var(--color-primary); }
.sp-date-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 8px;
}
.sp-date-pop[hidden] { display: none; }
/* Flatpickr inline calendar — brand-tinted range styling */
.sp-date-pop .flatpickr-calendar.inline {
  box-shadow: none; background: transparent;
}
.sp-date-pop .flatpickr-day.selected,
.sp-date-pop .flatpickr-day.startRange,
.sp-date-pop .flatpickr-day.endRange,
.sp-date-pop .flatpickr-day.selected:hover,
.sp-date-pop .flatpickr-day.startRange:hover,
.sp-date-pop .flatpickr-day.endRange:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.sp-date-pop .flatpickr-day.inRange {
  background: var(--color-primary-muted);
  border-color: var(--color-primary-muted);
  box-shadow: -5px 0 0 var(--color-primary-muted), 5px 0 0 var(--color-primary-muted);
  color: var(--color-text);
}
.sp-date-pop .flatpickr-day.today { border-color: var(--color-accent); }

/* CO₂ impact rating pill (Travel footprint header) */
.sp-impact { font-size: var(--text-sm); font-weight: var(--font-semibold); padding: 4px 11px; border-radius: var(--radius-full); white-space: nowrap; }
.sp-impact.low  { background: var(--color-success-light); color: var(--color-success); }
.sp-impact.med  { background: var(--color-warning-light); color: var(--color-warning); }
.sp-impact.high { background: var(--color-error-light); color: var(--color-error); }
/* ── Explorer persona (States-visited panel) ──────────────────────────────── */
.sp-persona { display: flex; gap: 13px; align-items: flex-start; }
.sp-persona-ico { width: 36px; height: 36px; flex-shrink: 0; color: var(--color-primary); display: flex; }
.sp-persona-ico svg { width: 32px; height: 32px; }
.sp-persona-title { font-family: var(--font-family-display); font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--color-text); margin-bottom: 3px; }
.sp-persona-desc { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.5; }
.sp-badge-scope { font-size: 11px; font-weight: var(--font-semibold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: -6px; }
.sp-deepdive { display: flex; align-items: center; gap: 7px; font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--color-accent); background: var(--color-accent-muted); padding: 7px 11px; border-radius: var(--radius-md); }
.sp-deepdive svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Responsive */
@media (max-width: 940px) {
  .sp-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sp-hl-grid { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .sp-charts { grid-template-columns: 1fr; }
  .sp-states { grid-template-columns: 1fr; }
  .sp-states-side { border-left: none; border-top: 1px solid var(--sp-teal-edge); }
  /* Travel footprint: stack the left/right halves and let the formula wrap. */
  .fp-grid { grid-template-columns: 1fr; }
  .fp-left  { padding-right: 140px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--color-border); }
  /* On mobile, push the scenic image down so it visually centres on the
     hero number + caption (rather than the section label above them). */
  .fp-scene { top: 40px; }
  .fp-right { padding-left: 0; border-left: none; }
  .fp-dots { justify-content: center; }
  /* Stacked mobile layout: copy goes first, formula starts directly below it
     (no extra vertical gap from the desktop flex centring). */
  .fp-calc { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
  .fp-calc-head { flex: 0 0 auto; max-width: none; }
  .fp-formula { flex-wrap: wrap; align-items: flex-start; justify-content: flex-start; flex: 0 0 auto; gap: 14px; }
}
@media (max-width: 620px) {
  .sp-stat-grid { grid-template-columns: 1fr 1fr; }
  .sp-hl-grid { grid-template-columns: repeat(2, 1fr); }
  .sp-ms-grid { grid-template-columns: repeat(2, 1fr); }
  .sp-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  /* Smaller scenic circle on narrow phones — pushed down so it visually
     centres on the hero number + caption (52px below the column top) and a
     touch closer to the right edge. */
  .fp-left  { padding-right: 110px; }
  .fp-scene { width: 92px; height: 92px; top: 35px; right: 14px; }
  /* "Your emissions this time period" stays on one line on phones — tighten
     the font + suppress wrapping. Also pull it up 3px on mobile by overriding
     the desktop padding-top from 9 → 6. Image isn't touched. */
  .fp-left > .fp-section-label { font-size: 13px; white-space: nowrap; padding-top: 6px; }
}
