:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --text: #1c2622;
  --muted: #5d6b65;
  --line: #dde3e0;
  --brand: #1f5f45;
  --brand-soft: #e3efe9;
  --ok: #2f7d4f;
  --warn: #a35a10;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 4px 16px rgba(20, 40, 30, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111715;
    --surface: #19211e;
    --text: #e6ece9;
    --muted: #97a59f;
    --line: #2b3632;
    --brand: #7cc6a2;
    --brand-soft: #1f2e28;
    --ok: #7cc6a2;
    --warn: #e9a35a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

main { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - 1180px) / 2));
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1000;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand-mark { color: var(--brand); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); background: var(--brand-soft); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; padding: 32px 0 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--brand); font-weight: 600; margin: 0 0 8px; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 16px; }
.season { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); font-size: .95rem; }
.season-tussenseizoen { background: color-mix(in srgb, var(--warn) 14%, transparent); }

/* Weer */
.weather-now { display: flex; gap: 14px; align-items: center; }
.weather-icon { font-size: 2.6rem; }
.weather-temp { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.weather-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.weather-facts div, .stats div, .stats-inline div { display: flex; flex-direction: column; }
dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
dd { margin: 0; font-weight: 600; }
.forecast { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.forecast li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.weather .small { margin: 10px 0 0; }

/* Planner */
.plan { margin-bottom: 32px; scroll-margin-top: 80px; }
.plan-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 12px 0 4px; }
.plan-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); flex: 1 1 160px; }
select, button, .button {
  font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
button[type=submit], .button {
  background: var(--brand); color: var(--surface); border-color: var(--brand);
  font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap;
}
button[type=submit]:hover, .button:hover { filter: brightness(1.1); }
.empty { margin-top: 16px; color: var(--muted); }

.suggestions { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.suggestion { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.suggestion.top { border-color: var(--brand); background: var(--brand-soft); }
.suggestion-head { display: flex; gap: 12px; align-items: center; }
.rank {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--surface); font-weight: 700;
}
.suggestion-title { font-weight: 700; text-decoration: none; color: var(--text); }
.suggestion-title:hover { text-decoration: underline; }
.reasons { list-style: none; padding: 0; margin: 10px 0 0; font-size: .9rem; }
.reasons li { padding-left: 20px; position: relative; margin: 4px 0; }
.reasons li::before { position: absolute; left: 0; }
.reasons .ok::before { content: "✓"; color: var(--ok); font-weight: 700; }
.reasons .warn::before { content: "!"; color: var(--warn); font-weight: 800; left: 5px; }

/* Overzicht */
.explore-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .9rem; padding: 6px 12px; border-radius: 999px; background: var(--surface); cursor: pointer; }
.chip.active { background: var(--chip, var(--brand)); border-color: var(--chip, var(--brand)); color: #fff; }

.map { border-radius: var(--radius); border: 1px solid var(--line); background: var(--brand-soft); z-index: 0; }
.map-overview { height: 440px; margin-bottom: 20px; }
.map-route { height: 460px; }

.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.route-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.route-card:hover, .route-card.hl { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20, 40, 30, .12); }
.route-card.off-season { opacity: .55; }
.route-card.off-season:hover { opacity: 1; }
.route-card[hidden] { display: none; }
.route-card p { margin: 0; font-size: .92rem; }
.route-card-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.badge {
  font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent, var(--brand)) 15%, transparent); color: var(--accent, var(--brand));
}
.badge.plain { background: var(--brand-soft); color: var(--muted); }
.level-makkelijk { --accent: #2f7d4f; }
.level-gemiddeld { --accent: #b07a10; }
.level-zwaar { --accent: #b42a2a; }
@media (prefers-color-scheme: dark) {
  .badge { color: color-mix(in srgb, var(--accent, var(--brand)) 60%, #fff); }
}

.stats-inline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 4px 0 0; }
.stats-inline dd { font-size: .92rem; }
.seasons { display: flex; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* Profiel */
.profile { display: block; width: 100%; height: auto; overflow: visible; }
.profile.mini { height: 56px; margin: 8px 0 4px; }
.profile .grid { stroke: var(--line); stroke-width: 1; }
.profile .axis { fill: var(--muted); font-size: 11px; }
.profile .poi { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.profile .cursor { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
.profile .cursor-dot { fill: var(--text); stroke: var(--surface); stroke-width: 2; }
.profile-wrap { cursor: crosshair; touch-action: pan-y; }
.profile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.profile-card { margin-top: 20px; }

/* Routedetail */
.crumbs { padding: 20px 0 0; }
.crumbs a { text-decoration: none; font-size: .95rem; }
.route-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; padding: 16px 0 20px; }
.route-head .lead { margin: 0; }
.stats {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 0 0 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
}
.stats dd { font-size: 1.3rem; }
.route-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.route-side { display: flex; flex-direction: column; gap: 16px; }
.route-side p { margin: 0 0 12px; }
.startfinish { display: grid; gap: 8px; margin: 0; }
.tips { margin: 0; padding-left: 20px; }
.tips li { margin-bottom: 6px; }
.waypoints { list-style: none; margin: 0; padding: 0; counter-reset: wp; }
.waypoints li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.waypoints li:last-child { border-bottom: 0; }

/* Leaflet-labels */
.wp-label {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 6px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow);
}
.wp-label::before { display: none; }
.leaflet-popup-content a { font-weight: 700; }

.footer { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.footer p { margin: 4px 0; }

@media (max-width: 900px) {
  .hero, .route-layout { grid-template-columns: 1fr; }
  .suggestions { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 6px; position: static; }
  .map-overview, .map-route { height: 320px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .route-head .button { width: 100%; text-align: center; }
}
