:root,
[data-theme="dark"] {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e8eef4;
  --muted: #8b9cb3;
  --accent: #3d9cf0;
  --accent-dim: #2563a8;
  --rain: #4ade80;
  --storm: #f87171;
  --wind: #a78bfa;
  --map-bg: #1e293b;
  --chart-tick: #8b9cb3;
  --chart-grid: #2d3a4d;
  --wind-arrow-fg: rgba(232, 238, 244, 0.92);
}

[data-theme="light"] {
  --bg: #eef1f6;
  --surface: #ffffff;
  --border: #c8d1dc;
  --text: #15202b;
  --muted: #5c6b7a;
  --accent: #1a6fd4;
  --accent-dim: #1557a8;
  --rain: #15803d;
  --storm: #b91c1c;
  --wind: #6d28d9;
  --map-bg: #d8e0ea;
  --chart-tick: #4a5a6a;
  --chart-grid: #c5ced9;
  --wind-arrow-fg: rgba(21, 32, 43, 0.88);
}

/* Warm fair-weather palette: mint fields, teal accents, soft sun */
[data-theme="spring"] {
  --bg: #e8f4ec;
  --surface: #fdfffe;
  --border: #9dcfb0;
  --text: #143828;
  --muted: #3a6348;
  --accent: #0f766e;
  --accent-dim: #0d5c56;
  --rain: #059669;
  --storm: #dc2626;
  --wind: #7c3aed;
  --map-bg: #cfe9d8;
  --chart-tick: #2f5a40;
  --chart-grid: #b0dfc4;
  --wind-arrow-fg: rgba(20, 56, 40, 0.9);
}

/* Coast / seafoam: Spring-like softness with cyan–sky blues */
[data-theme="sea"] {
  --bg: #e5f0f8;
  --surface: #fbfdff;
  --border: #8dbdd8;
  --text: #0f2d42;
  --muted: #3d5f78;
  --accent: #0c6a9e;
  --accent-dim: #084a72;
  --rain: #0284c7;
  --storm: #dc2626;
  --wind: #6d28d9;
  --map-bg: #c4e2f2;
  --chart-tick: #2a5570;
  --chart-grid: #a3cde8;
  --wind-arrow-fg: rgba(15, 45, 66, 0.9);
}

/* Autumn: warm cream fields, rust & amber accents, soft maple glow */
[data-theme="fall"] {
  --bg: #f3ebe2;
  --surface: #fffbf7;
  --border: #d4b896;
  --text: #3d2918;
  --muted: #6b5344;
  --accent: #b45309;
  --accent-dim: #92400e;
  --rain: #4d7c0f;
  --storm: #b91c1c;
  --wind: #9333ea;
  --map-bg: #e9d5c4;
  --chart-tick: #5c4033;
  --chart-grid: #ddc8b4;
  --wind-arrow-fg: rgba(61, 41, 24, 0.9);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

[data-theme="spring"] body {
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(
      168deg,
      #d8f0e4 0%,
      #f2faf5 32%,
      #faf6ec 68%,
      #e5f2fa 100%
    )
    fixed;
  color: var(--text);
}

.header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

[data-theme="spring"] .header {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(236, 252, 242, 0.94) 55%,
    rgba(255, 252, 248, 0.96) 100%
  );
  border-bottom-color: rgba(157, 207, 176, 0.85);
  box-shadow: 0 6px 28px rgba(15, 118, 110, 0.07);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  [data-theme="spring"] .header h1 {
    background-image: linear-gradient(115deg, #0f766e 0%, #059669 42%, #ca8a04 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.theme-switcher {
  flex-shrink: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.22rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.theme-option {
  padding: 0.42rem 0.72rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.theme-option:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.045);
}

[data-theme="dark"] .theme-option:hover {
  background: rgba(255, 255, 255, 0.07);
}

.theme-option--active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-option--active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="spring"] .theme-switcher {
  border-color: rgba(157, 207, 176, 0.9);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(15, 118, 110, 0.08);
}

[data-theme="spring"] .theme-option:hover {
  background: rgba(15, 118, 110, 0.08);
}

[data-theme="spring"] .theme-option--active {
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
  color: #0d9488;
  box-shadow:
    0 2px 10px rgba(15, 118, 110, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 900px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  min-height: 62vh;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  padding: 1rem;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 62vh;
}

@media (max-width: 900px) {
  .panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

[data-theme="spring"] .card {
  border-radius: 14px;
  border-color: rgba(157, 207, 176, 0.75);
  box-shadow:
    0 4px 22px rgba(13, 148, 136, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

[data-theme="spring"] .subtitle code {
  background: rgba(15, 118, 110, 0.1);
  color: #0d5c56;
  padding: 0.1em 0.38em;
  border-radius: 5px;
  font-size: 0.92em;
}

[data-theme="spring"] button.primary {
  background: linear-gradient(145deg, #2dd4bf 0%, #0d9488 42%, #059669 100%);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.32);
}

[data-theme="spring"] button.primary:hover:not(:disabled) {
  filter: brightness(1.04);
}

[data-theme="spring"] .panel {
  background: rgba(253, 255, 254, 0.35);
}

[data-theme="spring"] .chart-card {
  border-radius: 14px;
  border-color: rgba(157, 207, 176, 0.65);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.05);
}

[data-theme="spring"] .forecast-active-place {
  background: linear-gradient(
    165deg,
    rgba(20, 184, 166, 0.14) 0%,
    rgba(251, 191, 36, 0.08) 100%
  );
  border-left-color: #0d9488;
}

[data-theme="spring"] .forecast-range-btn--active {
  border-color: #10b981;
  background: rgba(5, 150, 105, 0.14);
  color: #065f46;
}

[data-theme="spring"] .forecast-geocode-results li button:hover {
  background: rgba(20, 184, 166, 0.12);
}

[data-theme="spring"] .forecast-day-card:hover {
  border-color: rgba(5, 150, 105, 0.45);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.1);
}

[data-theme="spring"] .forecast-day-card--selected {
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.45);
}

[data-theme="spring"] .forecast-day-card .fd-temps .fd-max-line {
  color: #ea580c;
}

[data-theme="spring"] .forecast-day-card .fd-temps .fd-min-line {
  color: #0e7490;
}

[data-theme="spring"] .forecast-day-card .fd-precip {
  color: #047857;
}

[data-theme="spring"] .progress-bar {
  background: linear-gradient(90deg, #14b8a6, #059669);
}

[data-theme="sea"] body {
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(
      168deg,
      #c8e4f2 0%,
      #f0f9ff 35%,
      #e8f4fc 70%,
      #dbeafe 100%
    )
    fixed;
  color: var(--text);
}

[data-theme="sea"] .header {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(236, 248, 255, 0.94) 55%,
    rgba(248, 252, 255, 0.96) 100%
  );
  border-bottom-color: rgba(141, 189, 216, 0.9);
  box-shadow: 0 6px 28px rgba(12, 106, 158, 0.08);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  [data-theme="sea"] .header h1 {
    background-image: linear-gradient(115deg, #0369a1 0%, #0891b2 42%, #2563eb 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

[data-theme="sea"] .theme-switcher {
  border-color: rgba(141, 189, 216, 0.95);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(12, 106, 158, 0.1);
}

[data-theme="sea"] .theme-option:hover {
  background: rgba(12, 106, 158, 0.08);
}

[data-theme="sea"] .theme-option--active {
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  color: #0369a1;
  box-shadow:
    0 2px 10px rgba(12, 106, 158, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="sea"] .card {
  border-radius: 14px;
  border-color: rgba(141, 189, 216, 0.75);
  box-shadow:
    0 4px 22px rgba(12, 106, 158, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

[data-theme="sea"] .subtitle code {
  background: rgba(12, 106, 158, 0.11);
  color: #084a72;
  padding: 0.1em 0.38em;
  border-radius: 5px;
  font-size: 0.92em;
}

[data-theme="sea"] button.primary {
  background: linear-gradient(145deg, #38bdf8 0%, #0284c7 40%, #0369a1 100%);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

[data-theme="sea"] button.primary:hover:not(:disabled) {
  filter: brightness(1.04);
}

[data-theme="sea"] .panel {
  background: rgba(251, 253, 255, 0.45);
}

[data-theme="sea"] .chart-card {
  border-radius: 14px;
  border-color: rgba(141, 189, 216, 0.65);
  box-shadow: 0 4px 20px rgba(12, 106, 158, 0.06);
}

[data-theme="sea"] .forecast-active-place {
  background: linear-gradient(
    165deg,
    rgba(56, 189, 248, 0.16) 0%,
    rgba(14, 165, 233, 0.1) 100%
  );
  border-left-color: #0284c7;
}

[data-theme="sea"] .forecast-range-btn--active {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.14);
  color: #075985;
}

[data-theme="sea"] .forecast-geocode-results li button:hover {
  background: rgba(56, 189, 248, 0.14);
}

[data-theme="sea"] .forecast-day-card:hover {
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.12);
}

[data-theme="sea"] .forecast-day-card--selected {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.45);
}

[data-theme="sea"] .forecast-day-card .fd-temps .fd-max-line {
  color: #c2410c;
}

[data-theme="sea"] .forecast-day-card .fd-temps .fd-min-line {
  color: #0369a1;
}

[data-theme="sea"] .forecast-day-card .fd-precip {
  color: #0369a1;
}

[data-theme="sea"] .progress-bar {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
}

[data-theme="fall"] body {
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(
      168deg,
      #f0dcc8 0%,
      #faf0e8 32%,
      #fff5ed 68%,
      #fde8dc 100%
    )
    fixed;
  color: var(--text);
}

[data-theme="fall"] .header {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 246, 237, 0.94) 55%,
    rgba(255, 250, 245, 0.96) 100%
  );
  border-bottom-color: rgba(212, 184, 150, 0.92);
  box-shadow: 0 6px 28px rgba(180, 83, 9, 0.09);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  [data-theme="fall"] .header h1 {
    background-image: linear-gradient(115deg, #c2410c 0%, #ea580c 38%, #b45309 72%, #ca8a04 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

[data-theme="fall"] .theme-switcher {
  border-color: rgba(212, 184, 150, 0.95);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(180, 83, 9, 0.1);
}

[data-theme="fall"] .theme-option:hover {
  background: rgba(180, 83, 9, 0.09);
}

[data-theme="fall"] .theme-option--active {
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
  color: #c2410c;
  box-shadow:
    0 2px 10px rgba(180, 83, 9, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="fall"] .card {
  border-radius: 14px;
  border-color: rgba(212, 184, 150, 0.78);
  box-shadow:
    0 4px 22px rgba(146, 64, 14, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

[data-theme="fall"] .subtitle code {
  background: rgba(180, 83, 9, 0.12);
  color: #92400e;
  padding: 0.1em 0.38em;
  border-radius: 5px;
  font-size: 0.92em;
}

[data-theme="fall"] button.primary {
  background: linear-gradient(145deg, #fb923c 0%, #ea580c 42%, #c2410c 100%);
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.35);
}

[data-theme="fall"] button.primary:hover:not(:disabled) {
  filter: brightness(1.04);
}

[data-theme="fall"] .panel {
  background: rgba(255, 251, 247, 0.42);
}

[data-theme="fall"] .chart-card {
  border-radius: 14px;
  border-color: rgba(212, 184, 150, 0.68);
  box-shadow: 0 4px 20px rgba(146, 64, 14, 0.06);
}

[data-theme="fall"] .forecast-active-place {
  background: linear-gradient(
    165deg,
    rgba(251, 146, 60, 0.18) 0%,
    rgba(234, 88, 12, 0.1) 100%
  );
  border-left-color: #ea580c;
}

[data-theme="fall"] .forecast-range-btn--active {
  border-color: #f97316;
  background: rgba(251, 146, 60, 0.16);
  color: #9a3412;
}

[data-theme="fall"] .forecast-geocode-results li button:hover {
  background: rgba(251, 146, 60, 0.14);
}

[data-theme="fall"] .forecast-day-card:hover {
  border-color: rgba(234, 88, 12, 0.42);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.12);
}

[data-theme="fall"] .forecast-day-card--selected {
  border-color: #ea580c;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.4);
}

[data-theme="fall"] .forecast-day-card .fd-temps .fd-max-line {
  color: #b91c1c;
}

[data-theme="fall"] .forecast-day-card .fd-temps .fd-min-line {
  color: #b45309;
}

[data-theme="fall"] .forecast-day-card .fd-precip {
  color: #4d7c0f;
}

[data-theme="fall"] .progress-bar {
  background: linear-gradient(90deg, #fb923c, #c2410c);
}

.card > h2,
.card .getting-started-summary h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
}

.card > h2 {
  margin: 0 0 0.65rem;
}

.getting-started-details {
  margin: 0;
}

.card .getting-started-summary {
  margin: 0 0 0.65rem;
  cursor: pointer;
  list-style: none;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.card .getting-started-summary h2 {
  margin: 0;
  display: inline;
}

.getting-started-details[open] > .getting-started-summary {
  margin-bottom: 0;
}

.getting-started-details[open] > .getting-started-list {
  margin-top: 0;
}

.card .getting-started-summary::marker {
  content: "";
}

.card .getting-started-summary::-webkit-details-marker {
  display: none;
}

.card .getting-started-summary::before {
  content: "▶";
  font-size: 0.65em;
  opacity: 0.85;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}

.getting-started-details[open] > .getting-started-summary::before {
  content: "▼";
}

.getting-started-list {
  margin: 0.65rem 0 0;
  padding: 0 0 0 1.2rem;
  line-height: 1.5;
}

.getting-started-list li {
  margin-bottom: 0.5rem;
}

.getting-started-list li:last-child {
  margin-bottom: 0;
}

.getting-started-list code {
  font-size: 0.9em;
}

.card label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.ride-time-shift {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
}

.ride-time-shift label {
  margin-top: 0;
}

.ride-time-shift input[type="range"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0.35rem 0 0.15rem;
  accent-color: var(--accent);
}

.ride-time-shift-readout {
  margin: 0.25rem 0 0 !important;
  line-height: 1.35;
}

.card input[type="number"],
.card input[type="datetime-local"],
.card input[type="password"],
.card input[type="url"],
.card select,
.weather-source-select {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.file-label {
  display: block;
  cursor: pointer;
}

.file-label input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.file-label span {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background: var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
}

.file-label:hover span {
  background: var(--accent-dim);
}

button.primary {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dim));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

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

button.secondary {
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

button.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

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

.route-or {
  text-align: center;
  margin: 0.5rem 0 0.15rem !important;
  font-size: 0.72rem !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.url-row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.url-row input[type="url"] {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.muted.small {
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}

.check-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
}

.check-row input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.check-row span {
  line-height: 1.35;
}

.header a,
.timeline-wrap a {
  color: var(--accent);
}

/* Met-style wind scale (0–60 km/h); colour stops align with tick positions */
.wind-scale-pill {
  display: flex;
  align-items: stretch;
  margin-top: 0.65rem;
  min-height: 26px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.wind-scale-unit-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 0.55rem 0 0.65rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #e8ecff;
  background: #3d4a86;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.wind-scale-gradient-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 26px;
}

.wind-scale-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #4a5da1 0%,
    #3eaad4 8.333%,
    #4eb052 16.667%,
    #a7bb43 33.333%,
    #b58d4a 50%,
    #a2467d 66.667%,
    #4d7a9b 100%
  );
}

.wind-scale-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.wind-scale-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.wind-scale-tick-edge-start {
  left: 5px;
  transform: translateY(-50%);
}

.wind-scale-tick-edge-end {
  left: auto;
  right: 5px;
  transform: translateY(-50%);
}

/* Temperature comfort scale 0–36 °C (matches tempComfortToRgb stops in app.js) */
.temp-scale-pill {
  display: flex;
  align-items: stretch;
  margin-top: 0.5rem;
  min-height: 22px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.temp-scale-pill .temp-scale-unit-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 0.45rem 0 0.55rem;
  font-size: 0.58rem;
  font-weight: 700;
  color: #e0f2fe;
  background: #172554;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.temp-scale-gradient-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 22px;
}

.temp-scale-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #1e3a8a 0%,
    #7dd3fc 16.667%,
    #facc15 33.333%,
    #22c55e 50%,
    #f97316 66.667%,
    #dc2626 100%
  );
}

.temp-scale-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: 0.58rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.temp-scale-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.temp-scale-tick-edge-start {
  left: 4px;
  transform: translateY(-50%);
}

.temp-scale-tick-edge-end {
  left: auto;
  right: 4px;
  transform: translateY(-50%);
}

/* Grade |%| 0–25 → blue … black (matches gradePercentToRgb in app.js) */
.grade-scale-pill {
  display: flex;
  align-items: stretch;
  margin-top: 0.5rem;
  min-height: 22px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.grade-scale-pill .grade-scale-unit-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 0.45rem 0 0.55rem;
  font-size: 0.58rem;
  font-weight: 700;
  color: #e0e7ff;
  background: #1e1b4b;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.grade-scale-gradient-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 22px;
}

.grade-scale-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    #2563eb 0%,
    #4f46e5 34%,
    #7c3aed 67%,
    #0a0a0a 100%
  );
}

.grade-scale-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: 0.58rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.grade-scale-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.grade-scale-tick-edge-start {
  left: 4px;
  transform: translateY(-50%);
}

.grade-scale-tick-edge-end {
  left: auto;
  right: 4px;
  transform: translateY(-50%);
}

.leaflet-div-icon.route-endpoint-divicon {
  background: transparent !important;
  border: none !important;
}

.route-endpoint-start svg,
.route-endpoint-finish svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.legend {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend li {
  margin-bottom: 0.35rem;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
}

.swatch.wind {
  background: var(--wind);
}

.swatch.route-temp {
  background: linear-gradient(
    90deg,
    #1e3a8a 0%,
    #7dd3fc 20%,
    #facc15 40%,
    #22c55e 55%,
    #f97316 75%,
    #dc2626 100%
  );
}

.swatch.rain {
  background: var(--rain);
}

.swatch.storm {
  background: var(--storm);
}

.swatch.swatch-start {
  width: 20px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    #16a34a 0%,
    #16a34a 45%,
    #f9fafb 45%,
    #f9fafb 55%,
    #111827 55%,
    #111827 100%
  );
}

.map-wrap {
  position: relative;
  min-height: 400px;
}

#map {
  position: absolute;
  inset: 0;
  background: var(--map-bg);
}

.timeline-wrap {
  padding: 1rem 1.25rem 2rem;
  border-top: 1px solid var(--border);
}

.timeline-wrap h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.charts-intro {
  margin: 0 0 1rem;
  max-width: 720px;
}

.charts-empty {
  margin: 0;
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
}

.charts-empty.hidden {
  display: none;
}

.charts-content.hidden {
  display: none;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1rem 0.75rem;
  margin-bottom: 1rem;
}

.chart-card--sunshine {
  margin-bottom: 0;
  border-color: rgba(251, 191, 36, 0.22);
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.08);
}

.chart-headline {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
}

.chart-headline .wind-head-main {
  display: block;
}

.chart-headline .sub {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.2rem;
}

.chart-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.wind-arrow-strip {
  position: relative;
  height: 45px;
  margin: 0.35rem 0 0.25rem;
  border-bottom: 1px solid var(--border);
}

.wind-arrow-slot {
  position: absolute;
  bottom: 4px;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--wind-arrow-fg);
}

.wind-arrow-slot svg {
  width: 22.5px;
  height: 22.5px;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
}

.chart-canvas-wrap {
  position: relative;
  height: 200px;
  margin-top: 0.5rem;
}

.chart-canvas-wrap--tall {
  height: 260px;
}

.chart-legend-inline {
  margin: 0.5rem 0 0;
  padding-bottom: 0.25rem;
}

.progress-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.progress-wrap.hidden {
  display: none;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

/* Leaflet wind marker */
.wind-marker-inner {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
}

.wind-marker-inner svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

.wind-calm-dot-inner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.65);
  margin: 0 auto;
}

.rain-teardrop-marker {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.rain-teardrop-marker svg {
  width: 26px;
  height: 32px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.leaflet-div-icon.wind-leaflet-icon,
.leaflet-div-icon.rain-teardrop-leaflet-icon {
  background: transparent !important;
  border: none !important;
}

/* —— 10-day place forecast (WU-style layout, app dark theme) —— */
.forecast-section {
  border-top: 1px solid var(--border);
}

.forecast-intro {
  max-width: 820px;
}

.forecast-toolbar-card {
  margin-bottom: 1rem;
  max-width: 640px;
}

.forecast-toolbar-card label {
  margin-top: 0;
}

.forecast-search-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  margin-top: 0.35rem;
}

.forecast-search-row input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.forecast-active-place {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(61, 156, 240, 0.1), var(--bg));
  border-left: 4px solid var(--accent);
}

.forecast-active-place-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.forecast-active-place-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.forecast-active-place-meta {
  margin: 0.4rem 0 0;
  line-height: 1.4;
}

.forecast-geocode-results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  max-height: 200px;
  overflow-y: auto;
}

.forecast-geocode-results.hidden {
  display: none;
}

.forecast-geocode-results li button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.forecast-geocode-results li:last-child button {
  border-bottom: none;
}

.forecast-geocode-results li button:hover {
  background: rgba(61, 156, 240, 0.12);
}

.forecast-content.hidden {
  display: none;
}

.forecast-range-toolbar {
  margin-bottom: 1rem;
  max-width: 1200px;
}

.forecast-range-toolbar-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.forecast-range-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.forecast-range-btn {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.forecast-range-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.forecast-range-btn--active {
  border-color: var(--accent);
  background: rgba(61, 156, 240, 0.18);
  color: #b8d9f8;
}

[data-theme="light"] .forecast-range-btn--active {
  color: var(--accent);
  background: rgba(26, 111, 212, 0.12);
}

.forecast-range-hint {
  margin: 0.5rem 0 0;
}

.forecast-range-tip {
  margin: 0.35rem 0 0;
  font-size: 0.72rem !important;
}

.forecast-day-tiles-legend {
  margin: 0.5rem 0 0;
  font-size: 0.72rem !important;
  line-height: 1.45;
  max-width: 52rem;
}

.forecast-day-tiles-legend strong {
  color: var(--text);
  font-weight: 600;
}

.forecast-daily-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 1rem;
  max-width: 1200px;
}

.forecast-scroll-btn {
  flex: 0 0 auto;
  width: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  align-self: center;
  min-height: 5.5rem;
}

.forecast-scroll-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.forecast-daily-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  scrollbar-width: thin;
}

.forecast-daily-strip {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  width: max-content;
}

.forecast-day-card {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  width: 108px;
  padding: 0.5rem 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.forecast-day-card > * {
  position: relative;
  z-index: 1;
}

/* Rain wallpaper (behind snow if both); semi-transparent so temp band shows through */
.forecast-day-card--rainy::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='52' viewBox='0 0 40 52'%3E%3Cellipse cx='12' cy='14' rx='4' ry='5.5' fill='%232563eb' fill-opacity='0.35'/%3E%3Cellipse cx='28' cy='32' rx='3.5' ry='5' fill='%233b82f6' fill-opacity='0.32'/%3E%3Cellipse cx='26' cy='10' rx='2.8' ry='4' fill='%2360a5fa' fill-opacity='0.38'/%3E%3Cellipse cx='6' cy='36' rx='3' ry='4.5' fill='%233b82f6' fill-opacity='0.28'/%3E%3C/svg%3E");
  background-size: 40px 52px;
}

/* Snowflake tile over temp shading */
.forecast-day-card--snowy::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='52' viewBox='0 0 40 52'%3E%3Ctext x='5' y='16' fill='%23ffffff' fill-opacity='0.52' font-size='11' font-family='system-ui,sans-serif'%3E%E2%9D%84%3C/text%3E%3Ctext x='24' y='32' fill='%23ffffff' fill-opacity='0.48' font-size='10' font-family='system-ui,sans-serif'%3E%E2%9D%84%3C/text%3E%3Ctext x='13' y='46' fill='%23ffffff' fill-opacity='0.55' font-size='12' font-family='system-ui,sans-serif'%3E%E2%9D%84%3C/text%3E%3Ctext x='28' y='14' fill='%23ffffff' fill-opacity='0.4' font-size='9' font-family='system-ui,sans-serif'%3E%E2%9D%84%3C/text%3E%3C/svg%3E");
  background-size: 40px 52px;
}

.forecast-day-card--rainy.forecast-day-card--snowy::after {
  opacity: 0.5;
}

/* Daily summary tint: dry sub-zero → dark grey; else blend of daily min/max (midpoint of max and daily mean) bands; rain/snow = pattern overlays */

.forecast-day-card--subzero {
  background: rgba(55, 65, 81, 0.55);
}

.forecast-day-card--cool {
  background: rgba(147, 197, 253, 0.42);
}

.forecast-day-card--mild {
  background: rgba(52, 211, 153, 0.35);
}

.forecast-day-card--warm {
  background: linear-gradient(
    135deg,
    rgba(74, 222, 128, 0.38) 0%,
    rgba(251, 191, 36, 0.42) 100%
  );
}

/*
 * Good riding: no meaningful precip + daily mean &gt; 5 °C (#429b46 overlay on temp band).
 * --good-riding-shade: max &lt; 15 °C → overlay at 75% opacity so underlying tint shows through.
 */
.forecast-day-card--good-riding::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: #429b46;
  opacity: 1;
}

.forecast-day-card--good-riding.forecast-day-card--good-riding-shade::before {
  opacity: 0.75;
}

.forecast-day-card--good-riding {
  color: rgba(255, 255, 255, 0.95);
}

.forecast-day-card--good-riding .fd-date {
  color: #ecfdf5;
}

.forecast-day-card--good-riding .fd-temps {
  color: rgba(236, 253, 245, 0.95);
}

.forecast-day-card--good-riding .fd-temps .fd-min-line {
  color: #bfdbfe;
}

.forecast-day-card--good-riding .fd-temps .fd-max-line {
  color: #fef9c3;
}

.forecast-day-card--good-riding .fd-desc,
.forecast-day-card--good-riding .fd-precip {
  color: rgba(209, 250, 229, 0.92);
}

[data-theme="dark"] .forecast-day-card--good-riding {
  color: rgba(255, 255, 255, 0.95);
  box-shadow: none;
}

[data-theme="dark"] .forecast-day-card--good-riding .fd-date {
  color: #ecfdf5;
}

[data-theme="dark"] .forecast-day-card--good-riding .fd-temps .fd-max-line {
  color: #fef9c3;
}

[data-theme="dark"] .forecast-day-card--good-riding .fd-temps .fd-min-line {
  color: #bfdbfe;
}

[data-theme="dark"] .forecast-day-card--good-riding .fd-desc,
[data-theme="dark"] .forecast-day-card--good-riding .fd-precip {
  color: rgba(209, 250, 229, 0.92);
}

.forecast-day-card--hot {
  background: rgba(249, 115, 22, 0.36);
}

.forecast-day-card--veryhot {
  background: rgba(239, 68, 68, 0.38);
}

.forecast-day-card:hover {
  border-color: rgba(61, 156, 240, 0.55);
}

.forecast-day-card:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.forecast-day-card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 156, 240, 0.45);
}

.forecast-day-card .fd-date {
  font-weight: 600;
  color: var(--text);
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.forecast-day-card .fd-temps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.forecast-day-card .fd-temps .fd-min-line {
  font-weight: 600;
  color: #93c5fd;
}

.forecast-day-card .fd-temps .fd-max-line {
  font-weight: 600;
  color: #f87171;
}

.forecast-day-card .fd-icon-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  margin: 0.15rem 0;
  min-height: 1.65rem;
}

.forecast-day-card .fd-icon-row .fd-icon {
  font-size: 1.65rem;
  line-height: 1.2;
}

.forecast-day-card .fd-wind-badge {
  display: inline-flex;
  align-items: center;
  font-size: 1.2rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
    sans-serif;
}

.forecast-day-card--good-riding .fd-wind-badge,
[data-theme="dark"] .forecast-day-card--good-riding .fd-wind-badge {
  /* Native 💨 colors */
  color: inherit;
  opacity: 1;
}

.forecast-day-card .fd-desc {
  font-size: 0.68rem;
  line-height: 1.25;
  margin-bottom: 0.35rem;
  min-height: 2.5em;
}

.forecast-day-card .fd-precip {
  font-size: 0.68rem;
  color: #86efac;
}

.forecast-day-card .fd-precip--bike {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.2rem;
}

.forecast-day-card .fd-bike {
  font-size: 1.35rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
    sans-serif;
}

.forecast-charts-stack {
  max-width: 1200px;
}

.forecast-chart-card .forecast-chart-legend {
  margin: 0 0 0.35rem;
}

.forecast-chart-canvas {
  height: 200px;
}

.forecast-chart-card--last {
  margin-bottom: 0;
}
