/* GPX MAP — design tokens and components. */

:root {
  --bg: #F6F5F1;
  --surface: #ffffff;
  --surface-2: #F1EFEA;
  --surface-3: #EDEBE6;
  --map-bg: #E9E6DF;
  --ink: #1B1A17;
  --ink-2: #33312C;
  --muted: #6B6862;
  --faint: #9A968E;
  --disabled: #B5B1A8;
  --line: rgba(27, 26, 23, .1);
  --line-soft: rgba(27, 26, 23, .06);
  --accent: #E24B2A;
  --accent-soft: #FCEAE5;
  --accent-tint: #FFF6F3;
  --blue: #2C7A9B;
  --focus: 0 0 0 3px rgba(44, 122, 155, .4);
  --shadow-card: 0 1px 2px rgba(27, 26, 23, .04);
  --shadow-menu: 0 12px 32px -12px rgba(27, 26, 23, .25);
  --shadow-float: 0 4px 14px -6px rgba(27, 26, 23, .35);
  --font: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --page-max: 1560px;
  --gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, p { margin: 0; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }

.skip-link { position: absolute; left: 8px; top: -48px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 300; }
.skip-link:focus { top: 8px; }

.label-mobile, .dz-title-mobile { display: none; }

@keyframes gpxSpin { to { transform: rotate(360deg); } }
@keyframes gpxSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* Logo & buttons ----------------------------------------------------------- */

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; }
.logo-text { font-weight: 800; letter-spacing: .14em; font-size: 14px; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 14px 24px;
  font-size: 15px; font-weight: 700; line-height: 1;
  border: 1px solid transparent; text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: rgba(27, 26, 23, .14); }
.btn-light:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 10px; }
.btn-icon-text { height: 40px; padding: 10px 14px; font-size: 14px; border-radius: 11px; }
.btn-square { width: 40px; height: 40px; padding: 0; border-radius: 11px; }

/* Upload page ------------------------------------------------------------- */

.topnav { display: flex; align-items: center; justify-content: space-between; padding: 20px var(--gutter); max-width: var(--page-max); margin: 0 auto; }
.topnav-links { display: flex; gap: 28px; font-size: 14px; font-weight: 600; }
.topnav-links a { color: var(--muted); }
.topnav-links a:hover { color: var(--ink); }

.hero { position: relative; max-width: var(--page-max); margin: 0 auto; padding: 72px var(--gutter) 48px; text-align: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero-title { font-size: 56px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; margin-bottom: 18px; text-wrap: balance; }
.hero-lede { font-size: 18px; line-height: 1.5; color: var(--muted); margin: 0 auto 40px; max-width: 560px; text-wrap: pretty; }

.upload-form { max-width: 720px; margin: 0 auto; }

.dropzone {
  position: relative;
  background: #fff;
  border: 1.5px dashed rgba(27, 26, 23, .16);
  border-radius: 24px;
  padding: 56px 40px;
  box-shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 12px 32px -20px rgba(27, 26, 23, .18);
  transition: all .18s ease;
  text-align: center;
  outline: none;
  cursor: pointer;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--ink); box-shadow: 0 1px 2px rgba(27, 26, 23, .05), 0 24px 48px -24px rgba(27, 26, 23, .25); }
.dropzone:focus-visible { box-shadow: 0 0 0 4px rgba(44, 122, 155, .35); }
.dropzone[data-state="drag"] { border-style: solid; border-color: var(--accent); background: var(--accent-tint); transform: scale(1.012); }
.dropzone[data-state="uploading"] { border-style: solid; cursor: default; }
.dropzone[data-state="error"] { border-color: rgba(226, 75, 42, .35); background: #FFFBFA; }

.gpx-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.dz-state { display: none; }
.dropzone[data-state="idle"] .dz-idle,
.dropzone[data-state="drag"] .dz-drag,
.dropzone[data-state="verifying"] .dz-verifying,
.dropzone[data-state="uploading"] .dz-uploading,
.dropzone[data-state="error"] .dz-error,
.dropzone[data-state="done"] .dz-done { display: block; }
.dropzone[data-state="done"] { border-style: solid; border-color: rgba(27, 26, 23, .18); cursor: default; }
.dz-icon-done { background: var(--ink); color: #fff; }
.dz-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.dropzone[data-state="verifying"] { border-style: solid; cursor: default; }
.turnstile { display: flex; justify-content: center; margin-top: 16px; min-height: 65px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.link-box { max-width: 720px; margin: 26px auto 0; text-align: left; }
.link-or { display: flex; align-items: center; gap: 14px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.link-or::before, .link-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-row { display: flex; gap: 10px; }
.link-input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 14px; border: 1.5px solid rgba(27, 26, 23, .16); background: #fff; font: inherit; font-size: 15px; color: var(--ink); transition: border-color .18s, box-shadow .18s; }
.link-input::placeholder { color: var(--faint); }
.link-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(44, 122, 155, .25); }
.link-row .btn { white-space: nowrap; }
.link-row .btn[disabled] { opacity: .55; cursor: wait; }
.route-opts-box { max-width: 720px; margin: 22px auto 0; text-align: left; }
.route-opts-intro { font-size: 13px; line-height: 1.5; color: var(--faint); margin: 0; }
.link-opts { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.link-opts-label { display: block; padding: 0; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--ink); }
.seg { display: inline-flex; max-width: 100%; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.seg-item { position: relative; flex: 1 1 auto; }
.seg-item input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg-item span { display: block; padding: 10px 22px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--muted); text-align: center; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.seg-item span:hover { color: var(--ink); }
.seg-item input:checked + span { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(27, 26, 23, .12); }
.seg-item input:focus-visible + span { box-shadow: var(--focus); }
.seg-item.is-disabled span, .seg-item input:disabled + span { color: var(--faint); cursor: not-allowed; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); border-radius: 6px; cursor: pointer; }
.check input:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.link-opts.is-off .check { color: var(--faint); cursor: default; }
.link-opts.is-off .check input { cursor: default; }
.link-msg { font-size: 13px; line-height: 1.5; color: var(--faint); margin-top: 14px; }
.link-msg.is-error { color: var(--accent); font-weight: 600; }
.link-msg.is-done { color: var(--ink); font-weight: 600; }
.section-notice { padding-bottom: 0; }

.dz-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 20px; color: var(--ink); transition: background .18s; }
.dz-icon-active { background: var(--accent); color: #fff; }
.dz-icon-error { background: var(--accent-soft); }
.dz-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.dz-or { font-size: 14px; color: var(--faint); margin: 12px 0; }
.dz-foot { font-size: 13px; color: var(--faint); margin-top: 22px; }
.dz-msg { font-size: 15px; color: var(--muted); margin: 8px auto 0; max-width: 400px; }
.dz-error .btn { margin-top: 22px; }
.dz-bar { height: 4px; border-radius: 2px; background: var(--surface-3); max-width: 280px; margin: 22px auto 0; overflow: hidden; position: relative; }
.dz-bar span { position: absolute; left: 0; top: 0; height: 100%; width: 40%; border-radius: 2px; background: var(--accent); animation: gpxSlide 1.3s ease-in-out infinite; }
.noscript-submit { margin-top: 12px; }

.spinner { display: inline-block; border-radius: 50%; border: 3px solid rgba(27, 26, 23, .12); border-top-color: var(--accent); animation: gpxSpin .9s linear infinite; }
.spinner-lg { width: 30px; height: 30px; border-width: 3.5px; }

.how { max-width: 960px; margin: 0 auto; padding: 8px var(--gutter) 72px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.how-step { display: flex; gap: 14px; align-items: flex-start; }
.how-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.how-title { font-weight: 700; font-size: 15px; }
.how-text { font-size: 14px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* Result header ----------------------------------------------------------- */

.rhead { position: sticky; top: 0; z-index: 30; background: rgba(246, 245, 241, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.rhead-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gutter); max-width: var(--page-max); margin: 0 auto; }
.rhead .logo-mark { width: 30px; height: 30px; border-radius: 9px; }
.rhead .logo-text { font-size: 13px; }
.rhead-actions { display: flex; align-items: center; gap: 8px; }

.menu-anchor { position: relative; }
.menu { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid rgba(27, 26, 23, .08); border-radius: 14px; box-shadow: var(--shadow-menu); padding: 6px; display: flex; flex-direction: column; z-index: 40; }
.menu[hidden] { display: none; }
.menu-openin { width: 260px; }
.menu-more { width: 220px; }
.menu-heading { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 12px 6px; }
.menu-link { display: flex; align-items: center; gap: 12px; border-radius: 9px; padding: 9px 12px; color: var(--ink); }
.menu-link:hover { background: var(--surface-2); color: var(--ink); }
.menu-glyph { width: 28px; height: 28px; border-radius: 8px; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.menu-link-text { min-width: 0; }
.menu-link-name { display: block; font-size: 14px; font-weight: 700; }
.menu-link-note { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.menu-item { text-align: left; background: transparent; border: 0; border-radius: 9px; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--ink); }
.menu-item:hover { background: var(--surface-2); }

/* Summary ----------------------------------------------------------------- */

main { display: block; }
.summary { max-width: var(--page-max); margin: 0 auto; padding: 26px var(--gutter) 24px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.eyebrow-accent { color: var(--accent); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.eyebrow-dot { color: #D9D6CF; }
.pill { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.route-title { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; margin: 6px 0 22px; text-wrap: balance; overflow-wrap: anywhere; }
.summary-grid { display: grid; grid-template-columns: repeat(4, max-content); gap: 20px 48px; }
.summary-item { min-width: 0; }
.summary-value { font-size: 38px; line-height: 1; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-unit { font-size: .5em; font-weight: 600; color: var(--muted); margin-left: 5px; }
.summary-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 8px; }

/* Map --------------------------------------------------------------------- */

.mapsec { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.map-wrap {
  position: relative; height: clamp(380px, 64vh, 900px);
  border-radius: 24px; overflow: hidden; background: var(--map-bg);
  box-shadow: 0 1px 2px rgba(27, 26, 23, .05), 0 24px 48px -32px rgba(27, 26, 23, .35);
}
.map-wrap.is-fullscreen { position: fixed; inset: 0; z-index: 100; height: auto; border-radius: 0; box-shadow: none; }
body.map-fullscreen { overflow: hidden; }
.map { position: absolute; inset: 0; z-index: 0; }
.map-missing-key { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--muted); }

.map-overlay { position: absolute; left: 16px; top: 16px; z-index: 6; background: rgba(255, 255, 255, .96); border-radius: 14px; padding: 12px 16px; box-shadow: 0 8px 24px -12px rgba(27, 26, 23, .3); max-width: 320px; }
.map-overlay-name { font-size: 14px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-overlay-line { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.map-wrap.is-fullscreen .map-overlay { display: none; }

.map-controls { position: absolute; right: 16px; top: 16px; z-index: 6; display: flex; flex-direction: column; gap: 8px; }
.map-btn { width: 40px; height: 40px; background: #fff; border: 0; border-radius: 12px; box-shadow: var(--shadow-float); display: grid; place-items: center; color: var(--ink); padding: 0; }
.map-btn:hover { background: var(--surface-2); }
.map-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.map-btn-group { display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: var(--shadow-float); overflow: hidden; }
.map-btn-group .map-btn { box-shadow: none; border-radius: 0; background: transparent; }
.map-btn-group .map-btn:hover { background: var(--surface-2); }
.map-btn-sep { height: 1px; background: rgba(27, 26, 23, .08); margin: 0 8px; }
.icon-fs-exit { display: none; }
.map-wrap.is-fullscreen .icon-fs-enter { display: none; }
.map-wrap.is-fullscreen .icon-fs-exit { display: block; }

.map-fsbar { display: none; position: absolute; left: 16px; bottom: 24px; z-index: 6; background: rgba(255, 255, 255, .96); border-radius: 14px; padding: 12px 16px; box-shadow: 0 8px 24px -12px rgba(27, 26, 23, .3); align-items: center; gap: 14px; }
.map-wrap.is-fullscreen .map-fsbar { display: flex; }
.map-fsbar-name { font-size: 14px; font-weight: 700; }
.map-fsbar-line { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* Info window inside Google Maps */
.iw { font-family: var(--font); color: var(--ink); min-width: 180px; padding: 2px 4px; }
.iw-kind { font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.iw-kind.start { color: var(--ink); }
.iw-kind.finish { color: var(--accent); }
.iw-name { font-weight: 700; margin: 2px 0 6px; font-size: 14px; }
.iw-row { font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Advanced marker pins */
.pin { display: inline-flex; align-items: center; gap: 6px; color: #fff; font: 800 10px/1 var(--font); letter-spacing: .1em; padding: 5px 9px 5px 7px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); white-space: nowrap; border: 2px solid #fff; transform: translateY(6px); }
.pin::before { content: ""; width: 8px; height: 8px; background: #fff; }
.pin-start { background: var(--ink); }
.pin-start::before { border-radius: 50%; }
.pin-finish { background: var(--accent); }

/* Cards ------------------------------------------------------------------- */

.section { max-width: var(--page-max); margin: 0 auto; padding: 24px var(--gutter) 0; }
.card { background: #fff; border: 1px solid var(--line-soft); border-radius: 20px; padding: 26px 28px; box-shadow: var(--shadow-card); }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .card-title { margin: 0; }
.card-note { margin-top: 22px; font-size: 13px; color: var(--muted); }

.details-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 24px; }
.detail { min-width: 0; }
.detail-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; color: var(--ink); }
.detail.is-missing .detail-value { color: var(--disabled); }
.detail-unit { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 5px; letter-spacing: .01em; }

/* Elevation chart --------------------------------------------------------- */

.chart-stats { display: flex; gap: 18px; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-stats b { color: var(--ink); }
.chart-wrap { position: relative; width: 100%; height: 240px; }
.chart { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-hit { cursor: crosshair; }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 14px)); background: var(--ink); color: #fff; border-radius: 10px; padding: 7px 10px; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4); font-variant-numeric: tabular-nums; z-index: 2; }
.chart-tip[hidden] { display: none; }
.chart-tip-km { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .7); }
.chart-tip-ele { font-size: 14px; font-weight: 700; }
.chart-axes { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--faint); margin-top: 4px; padding-left: 48px; }

.notice { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border-radius: 16px; padding: 16px 20px; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.45; }
.notice svg { flex: none; }
.notice-strong { color: var(--ink); }

/* Route information ------------------------------------------------------- */

.info { max-width: var(--page-max); margin: 0 auto; padding: 20px var(--gutter) 56px; }
.info-toggle { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 8px 0; font-size: 14px; font-weight: 700; color: var(--muted); }
.info-toggle:hover { color: var(--ink); }
.info-toggle svg { transition: transform .18s; }
.info-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.info-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; margin-top: 10px; padding: 18px 22px; background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; font-size: 13px; }
.info-panel[hidden] { display: none; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.info-label { color: var(--muted); font-weight: 600; }
.info-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Error page -------------------------------------------------------------- */

.error-panel { max-width: 560px; margin: 48px auto 0; padding: 36px 32px 32px; background: #fff; border: 1px solid var(--line-soft); border-radius: 24px; box-shadow: var(--shadow-card); text-align: center; }
.error-panel .eyebrow { justify-content: center; }
.error-title { margin-top: 8px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.error-message { margin-top: 12px; color: var(--muted); font-size: 15px; }
.error-actions { margin-top: 24px; }
.error-meta { margin-top: 20px; color: var(--faint); font-size: 12px; }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1079px) {
  .hero-title { font-size: 46px; }
  .details-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 699px) {
  :root { --gutter: 20px; }
  .label-desktop, .dz-title-desktop { display: none; }
  .label-mobile, .dz-title-mobile { display: inline; }
  .hero { padding: 28px var(--gutter) 32px; }
  .hero-title { font-size: 36px; }
  .dropzone { padding: 40px 24px; }
  .dz-idle .btn { min-width: 80%; }
  .dz-actions .btn { min-width: 80%; }
  .link-row { flex-direction: column; }
  .seg { display: flex; }
  .seg-item span { padding: 10px 8px; font-size: 14px; }
  .checks { flex-direction: column; gap: 12px; }
  .how-more a { display: block; }
  .how-more-sep { display: none; }
  .how-grid { grid-template-columns: 1fr; }
  .topnav-links a { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; }
  .summary { padding: 18px var(--gutter) 16px; }
  .route-title { font-size: 26px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 18px 24px; }
  .summary-value { font-size: 26px; }
  .mapsec { padding: 0 12px; }
  .map-wrap { height: clamp(380px, 58vh, 700px); border-radius: 18px; }
  .map-overlay { display: none; }
  .section { padding: 16px 12px 0; }
  .card { padding: 20px; }
  .details-grid { grid-template-columns: 1fr 1fr; }
  .chart-wrap { height: 200px; }
  .info { padding: 16px var(--gutter) 40px; }
  .info-panel { grid-template-columns: 1fr; }
  .menu-openin { width: min(260px, calc(100vw - 32px)); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner, .dz-bar span { animation-duration: 3s; }
  .dropzone, .btn { transition: none; }
}

/* Informational pages ----------------------------------------------------- */

.doc { max-width: 760px; margin: 0 auto; padding: 32px var(--gutter) 64px; }
.doc-head { margin-bottom: 40px; }
.doc-title { font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; margin: 10px 0 16px; text-wrap: balance; }
.doc-lede { font-size: 18px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.doc-section { margin-top: 36px; }
.doc-section h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.doc-section p { font-size: 16px; line-height: 1.65; color: var(--ink-2); margin-bottom: 12px; }
.doc-section ul { margin: 0 0 12px; padding-left: 22px; }
.doc-section li { font-size: 16px; line-height: 1.6; color: var(--ink-2); margin-bottom: 8px; }
.doc-section a { color: var(--accent); font-weight: 600; }
.doc-section a:hover { text-decoration: underline; }
.doc-defs { margin: 0; display: grid; gap: 14px; }
.doc-defs > div { background: #fff; border: 1px solid var(--line-soft); border-radius: 14px; padding: 14px 18px; }
.doc-defs dt { font-weight: 700; font-size: 15px; }
.doc-defs dd { margin: 4px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.how-more { margin-top: 28px; text-align: center; font-size: 14px; font-weight: 600; }
.how-more a { color: var(--muted); }
.how-more a:hover { color: var(--ink); }
.how-more-sep { margin: 0 12px; color: var(--faint); }

/* Footer ------------------------------------------------------------------ */

.site-footer { border-top: 1px solid var(--line-soft); margin-top: 24px; }
.site-footer-inner { max-width: var(--page-max); margin: 0 auto; padding: 22px var(--gutter) 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }
.site-footer-links { display: flex; gap: 20px; font-weight: 600; }
.site-footer-links a { color: var(--muted); }
.site-footer-links a:hover { color: var(--ink); }

@media (max-width: 699px) {
  .doc { padding: 20px var(--gutter) 48px; }
  .doc-title { font-size: 30px; }
  .doc-lede { font-size: 16px; }
  .topnav-links { gap: 8px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
}
