/* ═══════════════════════════════════════════════════════════
   CYCLER – Stylesheet
   Minimalistic professional design, full light / dark mode
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --bg:          #F7F8FA;
  --surface:     #FFFFFF;
  --surface-alt: #F0F2F5;
  --border:      #E2E6EC;
  --text:        #1A1D2E;
  --text-muted:  #6B7693;
  --text-subtle: #9AA3BB;
  --accent:      #E8532A;
  --accent-dim:  rgba(232, 83, 42, 0.12);
  --accent-hover:#D44420;
  --success:     #16A34A;
  --warning:     #D97706;
  --danger:      #DC2626;

  --radius-s:  6px;
  --radius-m:  10px;
  --radius-l:  16px;
  --radius-xl: 22px;

  --shadow-s: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-m: 0 4px 14px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-l: 0 8px 32px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);

  --header-h: 60px;
  --sidebar-w: 300px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg:          #0D1117;
  --surface:     #161B27;
  --surface-alt: #1E2436;
  --border:      #2A3148;
  --text:        #E4EAF6;
  --text-muted:  #8691AE;
  --text-subtle: #5A6480;
  --accent:      #FF6B47;
  --accent-dim:  rgba(255, 107, 71, 0.14);
  --accent-hover:#FF855E;
  --shadow-s: 0 1px 3px rgba(0,0,0,.3);
  --shadow-m: 0 4px 14px rgba(0,0,0,.35);
  --shadow-l: 0 8px 32px rgba(0,0,0,.4);
}

/* ── Reset & base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  line-height: 1.5;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 0.95rem; }
p  { color: var(--text-muted); font-size: 0.9rem; }

.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 5px;
}

/* ── Header ────────────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-s);
  transition: background var(--transition), border-color var(--transition);
}

.app-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo svg { color: var(--accent); }

.header-spacer { flex: 1; }

.header-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: none;
}
@media (min-width: 700px) { .header-tagline { display: block; } }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius-m);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.theme-toggle:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.icon-sun, .icon-moon { pointer-events: none; }
[data-theme="dark"] .icon-sun { display: none; }
:not([data-theme="dark"]) .icon-moon { display: none; }

/* ── Layout ────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  transition: background var(--transition), border-color var(--transition);
}

/* Main */
.main-area {
  flex: 1;
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ── Sidebar param sections ───────────────────────────────── */
.param-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-s);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.param-section-header:hover { background: var(--surface-alt); }

.param-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  flex: 1;
}

.param-section-chevron {
  color: var(--text-subtle);
  transition: transform 0.2s;
}
.param-section.collapsed .param-section-chevron { transform: rotate(-90deg); }
.param-section.collapsed .param-section-body { display: none; }

.param-section-body {
  padding: 4px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Form controls ─────────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

input:focus, select:focus { border-color: var(--accent); background: var(--surface); }

select { appearance: none; cursor: pointer; }

.input-with-unit {
  position: relative;
}
.input-with-unit input { padding-right: 36px; }
.input-unit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-subtle);
  pointer-events: none;
}

/* Slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slider-row input[type="range"] {
  flex: 1;
  padding: 0;
  border: none;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}
.slider-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  min-width: 40px;
  text-align: right;
}

/* Tag chips for cassette/chainring display */
.gear-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.gear-tag {
  padding: 2px 7px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
}

.card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px; }

/* ── Tab bar ────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface-alt);
  border-radius: var(--radius-m);
  width: fit-content;
}

.tab-btn {
  padding: 6px 16px;
  border-radius: var(--radius-s);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
}
.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-s);
}
.tab-btn:not(.active):hover { color: var(--text); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Route card ─────────────────────────────────────────────── */
.route-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
@media (min-width: 900px) {
  .route-form-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* GPX upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-l);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.upload-zone-icon { color: var(--text-subtle); margin-bottom: 10px; }
.upload-zone h3 { font-size: 0.95rem; margin-bottom: 4px; }
.upload-zone p  { font-size: 0.82rem; }

.gpx-preset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.gpx-preset-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}
#gpx-preset-select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}
#gpx-preset-select:focus {
  outline: none;
  border-color: var(--accent);
}

.gpx-loaded-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-m);
  margin-bottom: 16px;
}
.gpx-filename { font-size: 0.85rem; font-weight: 600; color: var(--accent); flex: 1; }
.gpx-clear-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.7;
}
.gpx-clear-btn:hover { opacity: 1; }

/* Target input area */
.target-input-area { margin: 16px 0; }

.target-type-toggle {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface-alt);
  border-radius: var(--radius-m);
  width: fit-content;
  margin-bottom: 12px;
}
.target-type-btn {
  padding: 5px 14px;
  border-radius: var(--radius-s);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
}
.target-type-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-s);
}

.target-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 700px) { .target-fields { grid-template-columns: 1fr 1fr 1fr; } }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  padding: 9px 20px;
  border-radius: var(--radius-m);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s, opacity var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

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

.btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--border); }

/* ── Stats grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-s);
  transition: background var(--transition), border-color var(--transition);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-subtle);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.stat-unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

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

/* Zone colour band on stat card */
.stat-card.zone-1 { border-top: 3px solid #60A5FA; }
.stat-card.zone-2 { border-top: 3px solid #34D399; }
.stat-card.zone-3 { border-top: 3px solid #FCD34D; }
.stat-card.zone-4 { border-top: 3px solid #FB923C; }
.stat-card.zone-5 { border-top: 3px solid #F87171; }
.stat-card.zone-6 { border-top: 3px solid #C026D3; }

/* ── Charts area ────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 960px) {
  .charts-grid-2 { grid-template-columns: 3fr 2fr; }
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
}

.chart-card-header {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chart-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-card-body {
  padding: 16px;
  position: relative;
}

.chart-canvas-wrap { position: relative; }

#map {
  height: 320px;
  border-radius: 0;
  width: 100%;
  background: var(--surface-alt);
}

/* ── Feasibility banner ──────────────────────────────────────  */
.feasibility-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-l);
  border: 1px solid;
  background: var(--surface);
}
.feasibility-banner.ok     { border-color: #16A34A; }
.feasibility-banner.warn   { border-color: #D97706; }
.feasibility-banner.bad    { border-color: #DC2626; }

.feasibility-icon { font-size: 1.4rem; flex-shrink: 0; }
.feasibility-title { font-weight: 700; font-size: 0.95rem; }
.feasibility-text  { font-size: 0.83rem; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* ── Gear analysis table ─────────────────────────────────────  */
.gear-analysis-wrap { overflow-x: auto; }

.gear-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.gear-table th {
  text-align: left;
  padding: 7px 12px;
  background: var(--surface-alt);
  color: var(--text-subtle);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  white-space: nowrap;
}
.gear-table td {
  padding: 7px 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.gear-table tr:hover td { background: var(--surface-alt); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-ok      { background: #DCFCE7; color: #15803D; }
.badge-warn    { background: #FEF3C7; color: #B45309; }
.badge-bad     { background: #FEE2E2; color: #B91C1C; }
[data-theme="dark"] .badge-ok   { background: rgba(22,163,74,.2);  color: #4ADE80; }
[data-theme="dark"] .badge-warn { background: rgba(217,119,6,.2);  color: #FCD34D; }
[data-theme="dark"] .badge-bad  { background: rgba(220,38,38,.2);  color: #F87171; }

/* Power zone pill */
.zone-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
}

/* ── Force breakdown bar ─────────────────────────────────────  */
.force-bar-wrap { margin-top: 8px; }
.force-bar-legend { display: flex; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.force-bar-legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.76rem; color: var(--text-muted); }
.force-bar-dot { width: 10px; height: 10px; border-radius: 50%; }
.force-bar-track {
  height: 10px;
  border-radius: 6px;
  background: var(--border);
  overflow: hidden;
  display: flex;
}
.force-bar-segment { height: 100%; transition: width 0.4s ease; }

/* ── Utility ─────────────────────────────────────────────────  */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.fw-700      { font-weight: 700; }

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* Spinning loader */
.loader {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: 12px; padding: 16px 0; }

/* Error message */
.error-msg {
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: #FEE2E2;
  border: 1px solid #FECACA;
  color: #991B1B;
  font-size: 0.85rem;
}
[data-theme="dark"] .error-msg {
  background: rgba(220,38,38,.15);
  border-color: rgba(220,38,38,.3);
  color: #F87171;
}

/* ── Landing page ────────────────────────────────────────── */
.landing-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header-launch-btn {
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-s);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.header-launch-btn:hover { opacity: 0.85; }

/* Hero */
.landing-hero {
  padding: 80px 24px 72px;
  text-align: center;
  background: linear-gradient(160deg, var(--bg) 60%, var(--accent-dim));
  border-bottom: 1px solid var(--border);
}
.landing-hero-inner {
  max-width: 680px;
  margin: 0 auto;
}
.landing-hero-badge {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}
.landing-hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}
.landing-hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}
.landing-cta-btn {
  display: inline-block;
  padding: 13px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-m);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}
.landing-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* Sections */
.landing-section {
  padding: 64px 24px;
}
.landing-section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.landing-cta-section {
  padding: 72px 24px;
}
.landing-container {
  max-width: 960px;
  margin: 0 auto;
}
.landing-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}
.landing-section-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.65;
}

/* Feature cards */
.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.landing-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 24px;
}
.landing-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-m);
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.landing-feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.landing-feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Assumptions */
.landing-assumptions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 32px;
  margin-top: 8px;
}
.landing-assumption-group h4 {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 14px;
}
.landing-assumption-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.landing-assumption-group li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
}
.landing-assumption-group li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--border);
}
.landing-assumption-group li strong {
  color: var(--text);
}
.landing-assumption-group p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Footer */
.landing-footer {
  padding: 20px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

@media (max-width: 600px) {
  .landing-assumptions { grid-template-columns: 1fr; }
  .landing-hero { padding: 56px 20px 48px; }
}

/* ── Power zone report ───────────────────────────────────── */
.zone-stacked-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 16px;
  gap: 2px;
}
.zone-bar-seg {
  transition: width 0.4s ease;
  border-radius: 2px;
  flex-shrink: 0;
}
.zone-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zone-row {
  display: grid;
  grid-template-columns: 10px 1fr 120px auto auto;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}
.zone-row-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.zone-row-name {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}
.zone-row-range {
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
}
.zone-row-time {
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}
.zone-row-pct {
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  min-width: 36px;
}
.zone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.zone-mini-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.zone-mini-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Leaflet dark mode adjustments */
[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85); }
[data-theme="dark"] .leaflet-control-attribution { background: var(--surface) !important; color: var(--text-muted) !important; }
[data-theme="dark"] .leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }

/* ── Responsive collapse ──────────────────────────────────── */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main-area { padding: 16px; }
  .route-form-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
