/* Koerstijd — Design System */

:root {
  --orange: #E04E2C;
  --orange-dark: #C7421F;
  --orange-soft: #FFEFE8;
  --ink: #1A1F26;
  --cream: #FAF7F0;
  --soft: #F4EFE6;
  --panel: #fff;
  --border: rgba(0,0,0,0.08);
  --text-muted: rgba(26,31,38,0.6);
  --text-faint: rgba(26,31,38,0.4);
  --green: #22C55E;
  --amber: #F59E0B;
  --blue: #3F7FA8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-dark="true"] {
  --cream: #13171D;
  --soft: #1F2530;
  --panel: #1A1F26;
  --border: rgba(255,255,255,0.08);
  --text-muted: rgba(244,239,230,0.6);
  --text-faint: rgba(244,239,230,0.4);
  --orange-soft: rgba(224,78,44,0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
[data-dark="true"] body, [data-dark="true"] { color: #F4EFE6; }

a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px;
  border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); background-clip: content-box; }

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.logo-mark { width: 26px; height: 26px; color: #1A1F26; transition: color .3s; }
[data-dark="true"] .logo-mark { color: #F4EFE6; }
.logo-text { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.logo-dot { color: var(--orange); }
.logo.lg .logo-mark { width: 40px; height: 40px; }
.logo.lg .logo-text { font-size: 28px; }

/* ── Top Navigation ───────────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,240,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 56px;
  display: flex; align-items: center; justify-content: space-between;
}
[data-dark="true"] .topnav { background: rgba(19,23,29,0.85); }

.topnav-nav { display: flex; gap: 4px; }
.topnav-item {
  background: transparent; color: inherit; border: none;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background 0.12s; text-decoration: none; display: inline-block;
}
.topnav-item:hover { background: rgba(0,0,0,0.04); }
.topnav-item.active { background: rgba(0,0,0,0.05); }
[data-dark="true"] .topnav-item:hover { background: rgba(255,255,255,0.06); }
[data-dark="true"] .topnav-item.active { background: rgba(255,255,255,0.07); }

.topnav-right { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 999px; background: var(--orange);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
}
.avatar-menu {
  position: absolute; top: 40px; right: 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 6px; min-width: 180px;
  display: none; z-index: 200; color: var(--ink);
}
.avatar-menu.open { display: block; }
[data-dark="true"] .avatar-menu { color: #F4EFE6; }
.avatar-menu a, .avatar-menu button {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: none; background: transparent; cursor: pointer; color: inherit;
  font-size: 13.5px; font-weight: 500; border-radius: var(--radius-sm);
  text-decoration: none;
}
.avatar-menu a:hover, .avatar-menu button:hover { background: var(--soft); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em;
  cursor: pointer; border: 1px solid transparent; transition: background 0.15s;
  white-space: nowrap; text-decoration: none; font-family: inherit;
}
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; gap: 6px; }
.btn-lg { height: 54px; padding: 0 24px; font-size: 16px; gap: 10px; }
.btn-full { width: 100%; }

.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2A3038; }
.btn-outline { background: #fff; color: var(--ink); border-color: rgba(0,0,0,0.12); }
.btn-outline:hover { background: var(--soft); }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: rgba(0,0,0,0.04); }
.btn-soft { background: var(--soft); color: var(--ink); }
.btn-soft:hover { background: #E8E0D2; }
[data-dark="true"] .btn-soft { color: #F4EFE6; }
[data-dark="true"] .btn-soft:hover { background: rgba(255,255,255,0.1); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── Chips ────────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  background: #fff; color: var(--ink); border: 1px solid rgba(0,0,0,0.1);
  transition: all 0.12s; font-family: inherit;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
[data-dark="true"] .chip { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
[data-dark="true"] .chip.active { background: rgba(255,255,255,0.15); }

/* ── Form fields ──────────────────────────────────────────────────────────── */
.field-wrap { position: relative; }
.field-label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 6px;
}
.field {
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 14px;
  border: 1.5px solid rgba(0,0,0,0.1); border-radius: var(--radius-md);
  background: #fff; transition: border-color 0.15s;
}
.field:focus-within { border-color: var(--orange); }
.field input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 14px; font-weight: 500; color: inherit;
  padding: 0;
}
.field-icon { color: var(--text-muted); flex-shrink: 0; }
[data-dark="true"] .field { background: #1F2530; border-color: rgba(255,255,255,0.1); }

.input-standalone {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid rgba(0,0,0,0.1); border-radius: var(--radius-md);
  background: #fff; font-size: 14px; font-weight: 500;
  outline: none; transition: border-color 0.15s; color: inherit;
}
.input-standalone:focus { border-color: var(--orange); }
[data-dark="true"] .input-standalone { background: #1F2530; border-color: rgba(255,255,255,0.1); }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-body { padding: 20px 24px; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--radius-md); padding: 12px 16px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: #FFE8E4; color: #C7421F; }
.alert-success { background: #DCFCE7; color: #15803D; }
.alert-info { background: rgba(63,127,168,0.1); color: var(--blue); }

/* ── Stat ─────────────────────────────────────────────────────────────────── */
.stat { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; }
.stat svg { opacity: 0.55; }

/* ── Rating badge ─────────────────────────────────────────────────────────── */
.rating-badge {
  display: inline-flex; align-items: baseline; gap: 2px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  color: #fff; font-weight: 700;
}
.rating-badge .big { font-size: 16px; }
.rating-badge .small { font-size: 10px; opacity: 0.85; }

/* ── Landing page ─────────────────────────────────────────────────────────── */
.hero { padding: 80px 56px 40px; max-width: 1440px; margin: 0 auto; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--soft); border-radius: 999px;
  font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 24px;
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--orange); }

.hero h1 {
  font-size: 72px; line-height: 0.98; font-weight: 700;
  letter-spacing: -0.035em; margin: 0 0 24px; text-wrap: balance;
}
.hero h1 em { font-style: italic; font-family: Georgia, serif; font-weight: 500; }
.hero-subtitle {
  font-size: 19px; line-height: 1.5; color: var(--text-muted);
  max-width: 540px; margin: 0 0 36px; text-wrap: pretty;
}
.hero-actions { display: flex; gap: 12px; }

.hero-stats {
  display: flex; gap: 40px; margin-top: 56px;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.hero-stat-n { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.hero-stat-l { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Map preview card on landing */
.hero-map-card {
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  height: 560px; box-shadow: 0 30px 80px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--border); background: var(--panel);
}
#hero-map { position: absolute; inset: 0; }

.hero-map-overlay {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  background: var(--panel); border-radius: var(--radius-md); padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.hero-map-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.hero-map-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

/* Features section */
.features { padding: 60px 56px 100px; max-width: 1440px; margin: 0 auto; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card { background: var(--panel); padding: 28px 28px 32px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; color: var(--orange);
}
.feature-card h3 { font-size: 18px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
.feature-card p { font-size: 14.5px; line-height: 1.5; color: var(--text-muted); margin: 0; text-wrap: pretty; }

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--cream); padding: 24px; }
.auth-card {
  background: var(--panel); border-radius: var(--radius-xl); padding: 40px;
  width: 100%; max-width: 460px; box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-subtitle { font-size: 14px; color: var(--text-muted); margin: 0 0 28px; }
.auth-field-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--text-muted); margin-top: 18px; }
.auth-switch a { color: var(--orange); font-weight: 600; text-decoration: none; }

/* ── Planner ──────────────────────────────────────────────────────────────── */
.planner-layout {
  height: calc(100vh - 57px);
  display: grid; grid-template-columns: 440px 1fr;
}
.planner-panel {
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.planner-panel-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--border); }
.planner-panel-body { flex: 1; overflow-y: auto; padding: 20px 28px; }
.planner-panel-footer { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

.planner-map { position: relative; }
#planner-map, #route-map { width: 100%; height: 100%; }

/* Steps progress */
.steps-progress { display: flex; gap: 6px; margin-top: 18px; }
.step-bar { flex: 1; height: 4px; border-radius: 999px; background: rgba(0,0,0,0.08); transition: background 0.2s; }
.step-bar.active { background: var(--orange); }
[data-dark="true"] .step-bar { background: rgba(255,255,255,0.1); }

/* Section label */
.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
}
.section-hint { font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }

/* Surface row */
.surface-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: #fff; border: 1.5px solid rgba(0,0,0,0.1); border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.12s; font-family: inherit; color: inherit; text-align: left;
  width: 100%;
}
.surface-row.active { background: var(--orange-soft); border-color: var(--orange); }
[data-dark="true"] .surface-row { background: #1F2530; border-color: rgba(255,255,255,0.1); }
[data-dark="true"] .surface-row.active { background: rgba(224,78,44,0.1); }

.surface-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.surface-name { font-size: 14px; font-weight: 600; }
.surface-sub { font-size: 12px; color: var(--text-muted); }
.surface-check {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(0,0,0,0.18);
  background: transparent; transition: all 0.12s;
}
.surface-check.checked { background: var(--orange); border-color: var(--orange); color: #fff; }

/* Stop card (planner) */
.stop-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: transparent;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.12s; font-family: inherit; color: inherit;
  text-align: left; width: 100%;
}
.stop-card.selected { background: var(--soft); border-color: var(--orange); }
.stop-cat-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.stop-num {
  width: 24px; height: 24px; border-radius: 999px; flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,0.18); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  transition: all 0.12s;
}
.stop-num.selected { background: var(--orange); border-color: var(--orange); }

/* ── Route result ─────────────────────────────────────────────────────────── */
.route-layout {
  height: calc(100vh - 57px);
  display: grid; grid-template-columns: 1fr 420px;
}
.route-main { display: flex; flex-direction: column; }
.route-map-wrap { flex: 1; position: relative; }
.route-panel {
  background: var(--panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}

/* Elevation chart */
.elevation-strip {
  height: 200px; border-top: 1px solid var(--border); background: var(--panel);
  display: flex; flex-direction: column;
}
.elevation-strip-header {
  padding: 16px 24px 8px; display: flex; align-items: center; justify-content: space-between;
}
.elevation-chart-wrap { flex: 1; padding: 0 16px 16px; overflow: hidden; }
#elevation-svg { width: 100%; height: 100%; display: block; }

/* Stats bar */
.route-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.route-stat-label { font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase; opacity: 0.55; margin-bottom: 4px; }
.route-stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.route-stat-unit { font-size: 12px; opacity: 0.55; font-weight: 500; }

/* Timeline */
.timeline { position: relative; }
.timeline-line {
  position: absolute; left: 13px; top: 26px; bottom: 26px;
  width: 2px; background: var(--border);
}
.timeline-row { display: flex; gap: 14px; padding: 10px 8px; align-items: center; min-height: 48px; }
.timeline-icon { width: 28px; display: flex; justify-content: center; flex-shrink: 0; position: relative; z-index: 1; }
.timeline-dot { width: 14px; height: 14px; border-radius: 999px; border: 2px solid #fff; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-sub { font-size: 12px; opacity: 0.6; }
.timeline-photo { width: 44px; height: 44px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--soft); }

/* Stop marker badge */
.stop-marker-badge {
  width: 28px; height: 28px; border-radius: 999px; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ── Wind advisor ─────────────────────────────────────────────────────────── */
.wind-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.wind-header {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: rgba(63,127,168,0.07); border-bottom: 1px solid var(--border);
}
.wind-speed-big { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.wind-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.wind-recommendation { display: flex; align-items: flex-start; gap: 10px; }
.wind-icon-badge {
  width: 28px; height: 28px; border-radius: 999px; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.wind-dir-toggle { display: flex; gap: 6px; padding: 4px; background: var(--soft); border-radius: 10px; }
.wind-dir-opt {
  flex: 1; padding: 8px 10px; border-radius: 7px; border: none;
  background: transparent; cursor: pointer; font-family: inherit; text-align: left; color: inherit;
  transition: all 0.12s;
}
.wind-dir-opt.active { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
[data-dark="true"] .wind-dir-opt.active { background: rgba(255,255,255,0.1); }

.wind-alt { padding: 14px 18px; border-top: 1px solid var(--border); background: rgba(124,154,63,0.05); }
.wind-forecast-wrap { padding: 14px 18px; border-top: 1px solid var(--border); }
.wind-forecast-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.wind-forecast-cell {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.wind-forecast-cell.in-ride { background: rgba(224,78,44,0.06); border-color: rgba(224,78,44,0.2); }
.wind-speed-bar { width: 100%; height: 3px; background: rgba(0,0,0,0.06); border-radius: 999px; margin-top: 4px; overflow: hidden; }

/* ── My Routes ────────────────────────────────────────────────────────────── */
.my-routes-wrap { max-width: 1280px; margin: 0 auto; padding: 40px 56px 80px; }
.route-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.route-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.route-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.1); }
.route-card-map { height: 200px; position: relative; background: var(--soft); }
.route-card-body { padding: 18px 22px 20px; }

.ridden-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; background: var(--green); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.route-card-export {
  position: absolute; bottom: 12px; right: 12px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--ink); color: #fff; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s;
}
.route-card:hover .route-card-export { opacity: 1; transform: translateY(0); }

/* Favorite toggle — always shown */
.route-card-fav {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 999px;
  background: rgba(255,255,255,0.92); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  color: #CBD5E1; transition: background 0.15s, color 0.15s, transform 0.15s;
}
.route-card-fav:hover { background: #fff; color: #E04E2C; transform: scale(1.1); }
.route-card-fav.active { color: #E04E2C; background: #fff; }
.route-card-fav .fav-filled { display: none; }
.route-card-fav.active .fav-filled { display: flex; }
.route-card-fav.active .fav-outline { display: none; }

/* Delete — shown on hover */
.route-card-delete {
  position: absolute; top: 52px; right: 12px;
  width: 32px; height: 32px; border-radius: 999px;
  background: rgba(255,255,255,0.92); color: #94A3B8; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  opacity: 0; transform: scale(0.85); transition: opacity 0.15s, transform 0.15s, background 0.15s, color 0.15s;
}
.route-card:hover .route-card-delete { opacity: 1; transform: scale(1); }
.route-card-delete:hover { background: #E04E2C; color: #fff; }

.rating-picker { display: flex; align-items: center; gap: 10px; }
.rating-segs { flex: 1; display: flex; gap: 3px; }
.rating-seg {
  flex: 1; height: 22px; border-radius: 4px; border: none; cursor: pointer;
  font-size: 10px; font-weight: 700; font-family: inherit; transition: background 0.1s;
}

/* ── Modal / Export ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,17,23,0.55);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--panel); border-radius: var(--radius-xl);
  width: 100%; max-width: 540px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.modal-header { padding: 28px 32px 8px; }
.modal-header h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.modal-body { padding: 20px 32px 28px; display: flex; flex-direction: column; gap: 10px; }
.modal-footer { padding: 14px 32px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

.export-option {
  background: var(--soft); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; text-align: left; font-family: inherit; color: inherit; transition: all 0.12s;
  width: 100%;
}
.export-option.primary { border-color: var(--orange); }
.export-option:hover { background: #E8E0D2; }
.export-option-icon {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: #fff;
}
.export-option.primary .export-option-icon { background: var(--orange); color: #fff; }

/* ── Admin ────────────────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--ink); color: #F4EFE6;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.admin-sidebar-logo { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.admin-nav { padding: 12px; flex: 1; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(244,239,230,0.7); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: all 0.12s; margin-bottom: 2px;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.06); color: #F4EFE6; }
.admin-nav-item.active { background: rgba(255,255,255,0.1); color: #F4EFE6; }
.admin-content { flex: 1; background: #f6f6f4; overflow-y: auto; }
.admin-top { padding: 24px 32px; background: #fff; border-bottom: 1px solid rgba(0,0,0,0.07);
  display: flex; align-items: center; justify-content: space-between; }
.admin-top h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.015em; }
.admin-body { padding: 32px; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th { padding: 12px 16px; background: #f8f8f6; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); text-align: left; border-bottom: 1px solid rgba(0,0,0,0.07); }
.admin-table td { padding: 12px 16px; font-size: 13.5px; border-bottom: 1px solid rgba(0,0,0,0.05); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafaf8; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.admin-stat { background: #fff; border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow-sm); }
.admin-stat-n { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; }
.admin-stat-l { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Stop detail modal ────────────────────────────────────────────────────── */
.stop-detail-modal .modal-box { max-width: 500px; }
.stop-detail-img { height: 200px; background: var(--soft); }
.stop-detail-body { padding: 24px 28px 28px; }

/* ── Map overlay tools ────────────────────────────────────────────────────── */
.map-tool {
  width: 40px; height: 40px; border-radius: 10px; background: var(--panel);
  border: 1px solid var(--border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: inherit; box-shadow: var(--shadow-sm);
}
.map-tools { display: flex; flex-direction: column; gap: 8px; }

/* ── Wind compass SVG ─────────────────────────────────────────────────────── */
.wind-compass { flex-shrink: 0; }

/* ── Ridden check ─────────────────────────────────────────────────────────── */
.ridden-check {
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  border: 1.5px solid rgba(0,0,0,0.2); display: flex; align-items: center;
  justify-content: center; color: #fff; flex-shrink: 0; background: transparent;
  transition: all 0.12s;
}
.ridden-check.checked { background: var(--green); border-color: var(--green); }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 0.9s linear infinite; transform-origin: center; }

/* ── Surface legend strip ─────────────────────────────────────────────────── */
.surface-strip {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border-radius: 999px; padding: 6px;
  border: 1px solid var(--border); display: flex; gap: 4px;
  box-shadow: var(--shadow-md);
}
.surface-strip-item { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 12px; font-weight: 500; }

/* ── Wind overlay on map ──────────────────────────────────────────────────── */
.map-wind-pill {
  position: absolute; left: 50%; transform: translateX(-50%); top: 70px;
  background: rgba(255,255,255,0.92); border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px; padding: 6px 12px 6px 8px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm); pointer-events: none;
  font-size: 12px; font-weight: 600;
}
[data-dark="true"] .map-wind-pill { background: rgba(26,31,38,0.92); border-color: rgba(255,255,255,0.08); }

/* ── PlaceAutocompleteElement (new Places API) ────────────────────────────── */
gmp-placeautocomplete {
  display: block;
  width: 100%;
  --gmp-input-font-family: 'Inter Tight', sans-serif;
  --gmp-input-font-size: 14px;
  --gmp-input-border-radius: var(--radius-md);
  --gmp-input-border: 1.5px solid rgba(0,0,0,0.1);
  --gmp-input-background: #fff;
  --gmp-input-color: #1A1F26;
  --gmp-input-placeholder-color: #9CA3AF;
  --gmp-input-box-shadow: none;
  --gmp-input-outline: none;
}
[data-dark="true"] gmp-placeautocomplete {
  --gmp-input-background: #1F2530;
  --gmp-input-border: 1.5px solid rgba(255,255,255,0.1);
  --gmp-input-color: #F4EFE6;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
/* ── Hamburger button (hidden on desktop) ─────────────────────────────────── */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: var(--radius-sm);
}
.nav-hamburger span {
  display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: all .2s;
}
[data-dark="true"] .nav-hamburger span { background: #F4EFE6; }

/* Mobile nav drawer: base styling (display controlled via inline style in HTML) */
#mobile-nav-drawer a:hover, #mobile-nav-drawer button:hover { background: var(--soft) !important; }
[data-dark="true"] #mobile-nav-drawer > div:last-child { background: #1E2430 !important; }
[data-dark="true"] #mobile-nav-drawer a, [data-dark="true"] #mobile-nav-drawer button { color: #F4EFE6 !important; }

@media (max-width: 1024px) {
  .hero { padding: 60px 32px 40px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-map-card { height: 400px; }
  .hero h1 { font-size: 52px; }
  .features { padding: 40px 32px 60px; }
  .features-grid { grid-template-columns: 1fr; }
  .planner-layout, .route-layout { grid-template-columns: 1fr; }
  .planner-panel, .route-panel { display: none; }
  .route-grid { grid-template-columns: 1fr; }
  .admin-sidebar { width: 60px; }
  .admin-nav-item span { display: none; }
  .topnav { padding: 14px 24px; }
}

@media (max-width: 640px) {
  /* Nav */
  .topnav { padding: 12px 16px; }
  .topnav-nav { display: none; }
  .topnav-right .btn { display: none; }
  .topnav-right .avatar { display: flex; }
  .nav-hamburger { display: flex; }

  /* Hero */
  .hero { padding: 40px 20px 32px; }
  .hero h1 { font-size: 36px; }
  .hero-subtitle { font-size: 15px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 20px; }
  .hero-map-card { height: 280px; }
  .features { padding: 32px 20px 48px; }
  footer { padding: 24px 20px !important; }

  /* My routes */
  .my-routes-wrap { padding: 24px 16px 60px; }
  .route-grid { grid-template-columns: 1fr; gap: 12px; }
  .route-card-map { height: 160px; }
  .route-card-body { padding: 14px 16px 16px; }

  /* Route detail */
  .route-layout { grid-template-columns: 1fr; }

  /* Login */
  .auth-wrap { padding: 24px 16px; }
  .auth-card { padding: 28px 20px; }
}
