:root {
  --paper: #f2eee5;
  --paper-deep: #e9e3d8;
  --ink: #1e2a25;
  --ink-soft: #53615a;
  --ink-faint: #859088;
  --forest: #315a4a;
  --forest-deep: #234438;
  --forest-pale: #dbe7dc;
  --orange: #c86e3f;
  --orange-pale: #f3ddd0;
  --line: #d8d1c4;
  --white: #fbfaf7;
  --shadow: 0 18px 52px rgba(42, 54, 45, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { width: min(1440px, 100%); margin: 0 auto; padding: 0 42px 28px; }
.topbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; color: var(--paper); background: var(--forest); border-radius: 50%; }
.brand-mark svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { display: grid; gap: 1px; }
.brand-name { font-family: Georgia, "Songti SC", serif; font-size: 19px; letter-spacing: .02em; }
.brand-subtitle { color: var(--ink-faint); font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.topbar-meta { display: flex; align-items: center; gap: 19px; color: var(--ink-faint); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.mode-pill, .format-pill { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px var(--orange-pale); }

.intro-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(430px, .96fr); gap: clamp(40px, 8vw, 126px); align-items: center; padding: 76px 0 82px; }
.intro-copy { max-width: 640px; }
.eyebrow, .panel-index { margin: 0; color: var(--orange); font-size: 10px; font-weight: 750; letter-spacing: .17em; line-height: 1.4; }
.intro-copy h1 { max-width: 600px; margin: 15px 0 22px; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 5.1vw, 76px); font-weight: 400; letter-spacing: -.035em; line-height: 1.08; }
.intro-copy h1 em { color: var(--forest); font-style: normal; }
.intro-lede { max-width: 530px; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.85; }
.principle-row { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 38px; }
.principle { display: flex; align-items: center; gap: 10px; }
.principle-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--forest); background: var(--forest-pale); border-radius: 50%; }
.principle-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.principle span:last-child { display: grid; gap: 2px; }
.principle strong { font-size: 12px; font-weight: 700; }
.principle small { color: var(--ink-faint); font-size: 11px; }

.planner-panel { padding: 30px 31px 28px; background: var(--white); border: 1px solid rgba(216, 209, 196, .86); box-shadow: var(--shadow); }
.panel-heading, .card-heading, .map-card-header, .summary-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2, .map-card-header h2, .summary-topline h2, .card-heading h2 { margin: 7px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 24px; font-weight: 400; letter-spacing: -.02em; }
.text-button { margin-top: 2px; padding: 5px 0; color: var(--forest); background: transparent; border: 0; border-bottom: 1px solid currentColor; font-size: 12px; }
.text-button:hover { color: var(--orange); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 10px; align-items: end; margin-top: 29px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field-label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.field-dot { width: 8px; height: 8px; border-radius: 50%; }
.start-dot { background: var(--forest); box-shadow: 0 0 0 3px var(--forest-pale); }
.end-dot { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-pale); }
.field input { width: 100%; min-width: 0; height: 45px; padding: 0 13px; color: var(--ink); background: #f7f5ef; border: 1px solid var(--line); border-radius: 2px; outline: none; font-size: 14px; transition: border-color .2s, box-shadow .2s, background .2s; }
.field input:focus, .compact-field input:focus { background: var(--white); border-color: var(--forest); box-shadow: 0 0 0 3px rgba(49, 90, 74, .1); }
.field input::placeholder { color: #a0a79e; font-size: 12px; }
.field-input-wrap { position: relative; display: block; }
.field-input-wrap input { padding-right: 42px; }
.input-icon-button { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--forest); background: transparent; border: 0; border-radius: 50%; transform: translateY(-50%); }
.input-icon-button:hover:not(:disabled) { background: var(--forest-pale); }
.input-icon-button:disabled { cursor: wait; opacity: .5; }
.input-icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.location-source { min-height: 13px; color: var(--forest); font-size: 10px; line-height: 1.2; }
.location-source:empty { visibility: hidden; }
.route-arrow { display: grid; place-items: center; height: 45px; color: var(--ink-faint); }
.route-arrow svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.swap-button { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 4px 0; color: var(--ink-faint); background: transparent; border: 0; border-bottom: 1px solid transparent; font-size: 10px; }
.swap-button:hover { color: var(--forest); border-bottom-color: currentColor; }
.swap-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.field-hint { margin: 9px 0 0; color: var(--ink-faint); font-size: 11px; }
.waypoint-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.waypoint-entry { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.waypoint-entry input { width: 100%; min-width: 0; height: 36px; padding: 0 10px; color: var(--ink); background: #f7f5ef; border: 1px solid var(--line); border-radius: 2px; outline: none; font-size: 11px; }
.waypoint-entry input:focus { background: var(--white); border-color: var(--forest); box-shadow: 0 0 0 3px rgba(49, 90, 74, .1); }
.compact-action { height: 36px; padding: 0 12px; color: var(--forest); background: var(--forest-pale); border: 1px solid var(--forest-pale); border-radius: 2px; font-size: 11px; font-weight: 700; }
.compact-action:hover { color: var(--white); background: var(--forest); }
.waypoints-list { display: grid; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.waypoints-list:empty { display: none; }
.waypoint-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 34px; padding: 4px 0; border-bottom: 1px solid #ebe7de; }
.waypoint-number { display: grid; place-items: center; width: 20px; height: 20px; color: var(--orange); background: var(--orange-pale); border-radius: 50%; font-family: Georgia, "Songti SC", serif; font-size: 10px; }
.waypoint-copy { display: grid; gap: 2px; min-width: 0; }
.waypoint-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.waypoint-copy small { overflow: hidden; color: var(--ink-faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.waypoint-actions { display: flex; gap: 3px; }
.waypoint-actions button { width: 24px; height: 24px; padding: 0; color: var(--ink-faint); background: transparent; border: 1px solid transparent; border-radius: 2px; font-size: 11px; }
.waypoint-actions button:hover:not(:disabled) { color: var(--forest); border-color: var(--line); background: #f7f5ef; }
.waypoint-actions button:disabled { opacity: .28; }
.waypoint-hint { margin-top: 8px; }
.map-stage.is-adding { cursor: crosshair; }
.preference-block { margin-top: 26px; padding-top: 21px; border-top: 1px solid var(--line); }
.preference-heading { display: flex; justify-content: space-between; align-items: center; }
.preference-heading output { color: var(--forest); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.range-wrap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; margin-top: 13px; }
.range-caption { color: var(--ink-faint); font-size: 10px; }
.range-caption-right { color: var(--orange); }
input[type="range"] { width: 100%; height: 5px; margin: 0; appearance: none; background: linear-gradient(90deg, var(--forest) 0%, var(--orange) 72%, #d9d4c9 72%); border-radius: 8px; outline: none; }
input[type="range"]::-webkit-slider-thumb { width: 16px; height: 16px; appearance: none; background: var(--white); border: 3px solid var(--orange); border-radius: 50%; box-shadow: 0 1px 4px rgba(30, 42, 37, .18); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; background: var(--white); border: 3px solid var(--orange); border-radius: 50%; box-shadow: 0 1px 4px rgba(30, 42, 37, .18); }
.quick-values { display: flex; gap: 7px; margin-top: 12px; }
.quick-value { padding: 5px 10px; color: var(--ink-faint); background: transparent; border: 1px solid transparent; border-radius: 2px; font-size: 11px; }
.quick-value:hover { color: var(--forest); border-color: var(--line); }
.quick-value.is-active { color: var(--forest); background: var(--forest-pale); border-color: var(--forest-pale); font-weight: 700; }
.constraint-row { display: grid; grid-template-columns: 125px minmax(0, 1fr) minmax(0, 1fr); gap: 23px; align-items: end; margin-top: 23px; }
.compact-field { display: grid; gap: 8px; }
.number-input-wrap { display: flex; align-items: center; height: 38px; padding: 0 10px; background: #f7f5ef; border: 1px solid var(--line); }
.number-input-wrap input { width: 100%; height: 100%; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 13px; }
.number-input-wrap span { color: var(--ink-faint); font-size: 12px; }
.switch-field { display: flex; align-items: center; gap: 10px; min-width: 0; padding-bottom: 2px; }
.switch-field > input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; flex: 0 0 auto; width: 34px; height: 20px; background: #cfcfc6; border-radius: 20px; transition: background .2s; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; content: ""; background: var(--white); border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s; }
.switch-field input:checked + .switch { background: var(--forest); }
.switch-field input:checked + .switch::after { transform: translateX(14px); }
.switch-field input:focus-visible + .switch { outline: 3px solid rgba(49, 90, 74, .2); outline-offset: 2px; }
.switch-field span:last-child { display: grid; gap: 2px; min-width: 0; }
.switch-field strong { font-size: 11px; }
.switch-field small { overflow: hidden; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 49px; margin-top: 28px; padding: 0 16px 0 19px; color: var(--white); background: var(--forest); border: 0; border-radius: 2px; font-size: 13px; font-weight: 700; transition: background .2s, transform .2s; }
.primary-button:hover { background: var(--forest-deep); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.primary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cancel-button { display: block; width: 100%; min-height: 32px; margin-top: 7px; color: var(--ink-faint); background: transparent; border: 0; font-size: 10px; }
.cancel-button:hover { color: var(--orange); }
.form.is-planning .primary-button svg { animation: route-spin 1s linear infinite; }
@keyframes route-spin { to { transform: rotate(360deg); } }
.form-status { min-height: 16px; margin: 11px 0 0; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.form-status.warning { color: var(--orange); }
.gpx-import { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.gpx-import-copy { display: grid; gap: 3px; min-width: 0; }
.gpx-import-copy strong { color: var(--ink); font-size: 11px; }
.gpx-import-copy span { color: var(--ink-faint); font-size: 10px; line-height: 1.45; }
.import-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 108px; height: 36px; padding: 0 12px; color: var(--forest); background: transparent; border: 1px solid var(--forest); border-radius: 2px; font-size: 11px; font-weight: 700; transition: color .2s, background .2s; }
.import-button:hover:not(:disabled) { color: var(--white); background: var(--forest); }
.import-button:disabled { cursor: wait; opacity: .58; }
.import-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.import-status { min-height: 15px; margin: 8px 0 0; color: var(--forest); font-size: 10px; line-height: 1.45; }
.import-status.error { color: #a1442d; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr); gap: 20px; align-items: stretch; }
.map-card, .route-summary, .elevation-card, .interop-card { min-width: 0; background: var(--white); border: 1px solid rgba(216, 209, 196, .86); }
.map-card { overflow: hidden; }
.map-card-header { padding: 25px 27px 20px; }
.map-card-header h2 { font-size: 22px; }
.map-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding-top: 2px; }
.map-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; color: var(--forest); background: var(--forest-pale); border-radius: 2px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.map-badge.muted { color: var(--ink-faint); background: #f3f0e9; font-weight: 500; }
.map-badge.source-badge.online { color: var(--forest); background: var(--forest-pale); font-weight: 700; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.map-stage { position: relative; min-height: 440px; background: #ede9df; }
.street-map { display: none; width: 100%; height: 100%; min-height: 440px; }
.map-stage.has-street-map .street-map { display: block; }
.map-stage.has-street-map #route-map { display: none; }
.map-stage.has-street-map:not(.tile-fallback) .map-scale { display: none; }
#route-map { display: block; width: 100%; height: 100%; min-height: 440px; }
.leaflet-container { color: var(--ink); font: inherit; }
.leaflet-control-attribution { font-size: 9px; }
.leaflet-popup-content { margin: 10px 12px; font-size: 11px; line-height: 1.45; }
.leaflet-tooltip.route-point-tooltip { padding: 0; border: 0; border-radius: 5px; background: transparent; box-shadow: none; white-space: normal; }
.leaflet-tooltip.route-point-tooltip::before { display: none; }
.leaflet-tooltip.route-point-tooltip::after { position: absolute; z-index: -1; top: 50%; left: 50%; width: var(--route-label-line-length, 0px); height: 1px; background: rgba(77, 69, 57, .55); content: ""; transform: rotate(var(--route-label-line-angle, 0rad)); transform-origin: left center; pointer-events: none; }
.route-point-label { display: inline-flex; align-items: center; gap: 5px; max-width: 168px; min-height: 29px; padding: 3px 7px 3px 4px; color: #24352d; background: rgba(255, 255, 255, .97); border: 1px solid #bdb7aa; border-radius: 5px; box-shadow: 0 2px 5px rgba(30, 42, 37, .2); font-size: 12px; font-weight: 700; line-height: 20px; text-align: left; }
.route-point-label:hover, .route-point-label:focus-visible { border-color: var(--forest); background: #fff; outline: 2px solid rgba(49, 90, 74, .28); outline-offset: 1px; }
.route-point-label-number { flex: 0 0 auto; min-width: 21px; height: 21px; padding: 0 3px; color: #fff; background: #a64c24; border-radius: 4px; font-size: 11px; line-height: 21px; text-align: center; font-variant-numeric: tabular-nums; }
.route-point-label--start .route-point-label-number { background: var(--forest); }
.route-point-label--end .route-point-label-number { background: #704336; }
.route-point-label-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .route-point-label { max-width: 120px; min-height: 28px; gap: 4px; font-size: 11px; }
}
/* Keep the SVG route visible when the tile provider fails. The Leaflet
   container remains mounted underneath so a later tile load can recover. */
.map-stage.tile-fallback .street-map { position: absolute; inset: 0; z-index: 1; display: block; min-height: 0; background: transparent; pointer-events: none; }
.map-stage.tile-fallback #route-map { position: absolute; inset: 0; z-index: 2; display: block; min-height: 0; pointer-events: auto; }
.map-stage.tile-fallback .map-scale, .map-stage.tile-fallback .map-note { z-index: 3; }
.map-scale { position: absolute; left: 23px; bottom: 25px; z-index: 1000; display: grid; gap: 4px; color: var(--ink-soft); font-size: 10px; pointer-events: none; }
.map-scale span { display: block; width: 65px; height: 5px; border-right: 1px solid currentColor; border-left: 1px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat; }
.map-note { position: absolute; right: 18px; bottom: 18px; z-index: 1000; display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; color: var(--ink-soft); background: rgba(251, 250, 247, .82); border: 1px solid rgba(216, 209, 196, .86); font-size: 10px; backdrop-filter: blur(4px); pointer-events: none; }
.map-note-dot { width: 6px; height: 6px; background: var(--orange); border-radius: 50%; }
.map-note:has(#map-note-text) .map-note-dot { transition: background .2s; }
.map-legend { display: flex; flex-wrap: wrap; gap: 15px; padding: 15px 27px 18px; color: var(--ink-faint); font-size: 10px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 22px; height: 0; border-top: 2px solid var(--forest); }
.legend-dot { width: 8px; height: 8px; border: 2px solid var(--white); border-radius: 50%; box-shadow: 0 0 0 1px currentColor; }
.legend-dot.start { color: var(--forest); background: var(--forest); }
.legend-dot.end { color: var(--orange); background: var(--orange); }
.legend-pin { width: 8px; height: 8px; background: var(--orange); border: 2px solid var(--white); border-radius: 50% 50% 50% 0; box-shadow: 0 0 0 1px var(--orange); transform: rotate(-45deg); }

.route-summary { display: flex; flex-direction: column; padding: 25px 25px 21px; }
.summary-topline h2 { font-size: 22px; }
.route-score { min-width: 54px; padding-top: 5px; color: var(--orange); font-family: Georgia, "Songti SC", serif; font-size: 27px; text-align: right; }
.scenic-score-panel { margin-top: 17px; padding: 13px 0 2px; border-top: 1px solid var(--line); }
.scenic-score-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.scenic-score-stars { color: var(--orange); font-family: Georgia, "Songti SC", serif; font-size: 17px; letter-spacing: 1px; white-space: nowrap; }
.scenic-score-value { color: var(--forest); font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.scenic-score-status { margin: 4px 0 0; color: var(--ink-faint); font-size: 10px; }
.scenic-features-block { margin-top: 11px; }
.scenic-section-label { color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.scenic-features-list { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 6px 0 0; padding: 0; color: var(--ink-soft); font-size: 10px; list-style: none; }
.scenic-features-list li { position: relative; padding-left: 10px; }
.scenic-features-list li::before { position: absolute; top: .52em; left: 0; width: 4px; height: 4px; content: ""; background: var(--orange); border-radius: 50%; }
.scenic-features-list .scenic-empty-note { padding-left: 0; color: var(--ink-faint); }
.scenic-features-list .scenic-empty-note::before { display: none; }
.scenic-score-details { margin-top: 9px; color: var(--ink-faint); font-size: 10px; }
.scenic-score-details summary { width: fit-content; cursor: pointer; color: var(--forest); }
.scenic-score-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; margin: 7px 0 0; padding: 0; list-style: none; }
.scenic-score-breakdown li { display: flex; justify-content: space-between; gap: 8px; }
.scenic-score-breakdown strong { color: var(--forest); font-variant-numeric: tabular-nums; }
.scenic-score-breakdown .scenic-empty-note { grid-column: 1 / -1; color: var(--ink-faint); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 27px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { display: grid; gap: 4px; min-width: 0; }
.metric span { color: var(--ink-faint); font-size: 10px; }
.metric strong { color: var(--forest); font-size: 23px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.metric small { color: var(--ink-faint); font-size: 10px; }
.route-submetrics { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 11px; color: var(--ink-faint); font-size: 10px; }
.route-submetrics strong { color: var(--ink-soft); font-weight: 700; font-variant-numeric: tabular-nums; }
.ride-plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding: 10px 0 2px; border-top: 1px solid #ebe7de; }
.ride-plan-item { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ride-plan-item > span:last-child { display: grid; gap: 2px; min-width: 0; }
.ride-plan-item small { color: var(--ink-faint); font-size: 9px; white-space: nowrap; }
.ride-plan-item strong { overflow: hidden; color: var(--forest); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ride-plan-icon { display: grid; flex: 0 0 auto; place-items: center; width: 21px; height: 21px; color: var(--orange); background: var(--orange-pale); border-radius: 50%; font-family: Georgia, serif; font-size: 14px; line-height: 1; }
.supplies-panel { margin-top: 15px; padding-top: 12px; border-top: 1px solid #ebe7de; }
.supplies-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.supplies-status { color: var(--ink-faint); font-size: 9px; font-weight: 500; white-space: nowrap; }
.supplies-list { display: grid; gap: 0; max-height: 164px; margin-top: 6px; overflow-y: auto; scrollbar-width: thin; }
.supply-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; align-items: start; min-height: 40px; padding: 7px 0; border-bottom: 1px solid #f0ece4; }
.supply-item:last-child { border-bottom: 0; }
.supply-km { color: var(--orange); font-size: 10px; font-variant-numeric: tabular-nums; }
.supply-copy { display: grid; gap: 2px; min-width: 0; }
.supply-copy strong { color: var(--ink); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.supply-copy small { color: var(--ink-faint); font-size: 9px; }
.supply-copy a { width: fit-content; color: var(--forest); font-size: 9px; text-decoration: underline; text-underline-offset: 2px; }
.supplies-empty { margin: 7px 0 2px; color: var(--ink-faint); font-size: 10px; line-height: 1.4; }
.stops-heading { display: flex; justify-content: space-between; align-items: center; margin-top: 23px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.stops-heading span:last-child { color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.stops-list { display: grid; gap: 0; margin: 10px 0 0; padding: 0; list-style: none; }
.stop-item { position: relative; display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; min-height: 55px; padding: 7px 0; border-bottom: 1px solid #ebe7de; }
.stop-item:last-child { border-bottom: 0; }
.stop-number { display: grid; place-items: center; width: 23px; height: 23px; color: var(--orange); background: var(--orange-pale); border-radius: 50%; font-family: Georgia, "Songti SC", serif; font-size: 12px; }
.stop-copy { display: grid; gap: 3px; min-width: 0; }
.stop-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.stop-copy small { color: var(--ink-faint); font-size: 10px; }
.stop-copy .stop-source { color: var(--orange); font-size: 9px; line-height: 1.35; }
.stop-source-link { width: fit-content; color: var(--forest); font-size: 9px; line-height: 1.35; text-decoration: underline; text-underline-offset: 2px; }
.stop-source-link:hover { color: var(--orange); }
.stop-distance { color: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stop-item button { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; }
.stop-item:hover { background: #f8f5ef; }
.summary-footer { margin-top: auto; padding-top: 17px; }
.summary-footer p { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 15px; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.check-icon { display: grid; flex: 0 0 auto; place-items: center; width: 15px; height: 15px; color: var(--forest); background: var(--forest-pale); border-radius: 50%; font-size: 10px; font-weight: 800; }
.summary-footer p:has(#export-note-text) { align-items: flex-start; }
.datum-field { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; margin: 0 0 13px; color: var(--ink-faint); font-size: 10px; }
.datum-field select { width: 100%; height: 30px; padding: 0 7px; color: var(--ink-soft); background: #f7f5ef; border: 1px solid var(--line); border-radius: 2px; font-size: 10px; }
.export-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 43px; color: var(--white); background: var(--orange); border: 0; border-radius: 2px; font-size: 12px; font-weight: 750; transition: background .2s, transform .2s; }
.export-button:hover:not(:disabled) { background: #b85e32; transform: translateY(-1px); }
.export-button:disabled { cursor: not-allowed; opacity: .45; }
.export-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 36px; margin-top: 8px; color: var(--forest); background: var(--forest-pale); border: 1px solid rgba(49, 90, 74, .22); border-radius: 2px; font-size: 11px; font-weight: 700; transition: background .2s, transform .2s; }
.share-button:hover:not(:disabled) { background: #dce9df; transform: translateY(-1px); }
.share-button:disabled { cursor: not-allowed; opacity: .45; }
.share-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.export-status { min-height: 15px; margin: 9px 0 0; color: var(--forest); font-size: 10px; line-height: 1.4; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr); gap: 20px; margin-top: 20px; }
.elevation-card, .interop-card { padding: 24px 26px 21px; }
.profile-caption { padding-top: 5px; color: var(--ink-faint); font-size: 10px; }
.profile-chart-wrap { height: 190px; margin-top: 21px; }
#profile-chart { display: block; width: 100%; height: 100%; overflow: visible; }
.profile-axis { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: 10px; }
.interop-card { display: flex; flex-direction: column; }
.ready-badge { display: inline-flex; align-items: center; gap: 5px; padding-top: 3px; color: var(--forest); font-size: 10px; font-weight: 700; }
.ready-badge span { display: grid; place-items: center; width: 15px; height: 15px; color: var(--white); background: var(--forest); border-radius: 50%; font-size: 9px; }
.interop-list { display: grid; gap: 17px; margin-top: 30px; }
.interop-item { display: grid; grid-template-columns: 31px 1fr; gap: 11px; align-items: start; }
.interop-number { color: var(--orange); font-family: Georgia, "Songti SC", serif; font-size: 16px; line-height: 1.1; }
.interop-item span:last-child { display: grid; gap: 4px; }
.interop-item strong { font-size: 12px; }
.interop-item small { color: var(--ink-faint); font-size: 10px; line-height: 1.45; }
.interop-footnote { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 18px; color: var(--ink-faint); font-size: 10px; }
.info-icon { display: grid; place-items: center; width: 15px; height: 15px; color: var(--forest); border: 1px solid var(--forest); border-radius: 50%; font-family: Georgia, serif; font-size: 10px; font-weight: 700; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 27px; color: var(--ink-faint); font-size: 10px; letter-spacing: .03em; }

/* SVG map styling */
.map-water { fill: #c9ddd9; opacity: .7; }
.map-hill { fill: #d8dfd1; opacity: .82; }
.map-road { fill: none; stroke: #d0c8bb; stroke-width: 2; opacity: .72; }
.map-road.secondary { stroke-width: 1; opacity: .63; }
.route-halo { fill: none; stroke: #fbfaf7; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; opacity: .92; }
.route-line { fill: none; stroke: var(--forest); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.route-line-inner { fill: none; stroke: #77a284; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 8; }
.route-marker { stroke: var(--white); stroke-width: 3; }
.route-marker.start { fill: var(--forest); }
.route-marker.end { fill: var(--orange); }
.route-label { fill: var(--ink); font-family: Inter, "Microsoft YaHei", sans-serif; font-size: 12px; font-weight: 700; paint-order: stroke; stroke: #ede9df; stroke-width: 5px; stroke-linejoin: round; }
.route-label.subtle { fill: var(--ink-soft); font-size: 10px; font-weight: 500; }
.scenic-pin { fill: var(--orange); stroke: var(--white); stroke-width: 2.5; }
.scenic-pin-core { fill: var(--white); }
.scenic-label-bg { fill: rgba(251, 250, 247, .88); stroke: #d8d1c4; stroke-width: 1; }
.scenic-label { fill: var(--ink); font-family: Inter, "Microsoft YaHei", sans-serif; font-size: 10px; font-weight: 700; }
.profile-grid-line { stroke: #e2ddd3; stroke-width: 1; stroke-dasharray: 2 7; }
.profile-grid-label { fill: #a0a79e; font-family: Inter, sans-serif; font-size: 9px; }
.profile-marker { fill: var(--orange); stroke: var(--white); stroke-width: 2; }

@media (max-width: 1050px) {
  .app-shell { padding: 0 26px 24px; }
  .intro-grid { grid-template-columns: minmax(0, 1fr) minmax(370px, .88fr); gap: 42px; padding: 59px 0 66px; }
  .intro-copy h1 { font-size: clamp(42px, 5.6vw, 65px); }
  .workspace-grid, .lower-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, .62fr); }
}

@media (max-width: 820px) {
  .app-shell { padding: 0 18px 20px; }
  .topbar { min-height: 72px; }
  .topbar-meta { gap: 10px; font-size: 10px; }
  .intro-grid { display: block; padding: 36px 0 42px; }
  .intro-copy { max-width: 680px; }
  .intro-copy h1 { max-width: 600px; font-size: clamp(42px, 9vw, 62px); }
  .planner-panel { max-width: 640px; margin-top: 30px; }
  .workspace-grid, .lower-grid { display: block; }
  .route-summary { margin-top: 16px; min-height: 0; }
  .lower-grid { margin-top: 16px; }
  .interop-card { margin-top: 16px; min-height: 290px; }
  .map-stage, #route-map { min-height: 400px; }
}

@media (max-width: 520px) {
  .app-shell { padding: 0 13px 18px; }
  .brand-subtitle { display: none; }
  .format-pill { display: none; }
  .intro-grid { padding-top: 24px; padding-bottom: 27px; }
  .intro-copy h1 { margin-top: 10px; font-size: 39px; line-height: 1.12; }
  .intro-lede { margin-top: 13px; font-size: 13px; line-height: 1.65; }
  .principle-row { gap: 12px; margin-top: 19px; }
  .principle { gap: 7px; }
  .principle-icon { width: 27px; height: 27px; }
  .principle strong { font-size: 11px; }
  .principle small { font-size: 10px; }
  .planner-panel { margin-top: 23px; padding: 20px 15px 18px; }
  .panel-heading h2, .map-card-header h2, .summary-topline h2, .card-heading h2 { font-size: 20px; }
  .text-button { min-height: 44px; padding: 10px 2px; margin-top: -8px; }
  .field-row { grid-template-columns: 1fr; gap: 11px; }
  .route-arrow { display: none; }
  .field input { height: 48px; padding: 0 12px; font-size: 15px; }
  .field-hint { font-size: 10px; line-height: 1.45; }
  .constraint-row { grid-template-columns: 1fr; gap: 17px; align-items: start; }
  .compact-field { max-width: 130px; }
  .number-input-wrap { height: 44px; }
  .switch-field { min-height: 44px; padding-bottom: 0; }
  .switch { width: 38px; height: 23px; }
  .switch::after { width: 17px; height: 17px; }
  .switch-field input:checked + .switch::after { transform: translateX(15px); }
  .waypoint-entry { grid-template-columns: 1fr; }
  .compact-action { width: 100%; min-height: 44px; }
  .waypoint-actions button { width: 40px; height: 40px; font-size: 14px; }
  .quick-values { gap: 6px; }
  .quick-value { flex: 1; min-height: 44px; padding: 8px 7px; }
  .primary-button { position: sticky; bottom: 10px; z-index: 4; height: 54px; margin-top: 22px; border-radius: 4px; box-shadow: 0 8px 22px rgba(30, 42, 37, .18); }
  .gpx-import { grid-template-columns: 1fr; gap: 11px; }
  .import-button { width: 100%; min-height: 46px; }
  .gpx-import-copy span { font-size: 10px; }
  .workspace-grid { display: flex; flex-direction: column; gap: 12px; }
  .route-summary { order: -1; margin-top: 0; }
  .map-card-header { display: block; padding: 22px 17px 17px; }
  .map-badges { justify-content: flex-start; margin-top: 13px; }
  .map-stage { min-height: 0; height: auto; aspect-ratio: 16 / 10; }
  #route-map, .street-map { min-height: 0; height: 100%; }
  .map-legend { padding: 13px 17px 16px; gap: 11px; }
  .route-summary, .elevation-card, .interop-card { padding: 22px 17px 19px; }
  .datum-field { grid-template-columns: 1fr; gap: 5px; }
  .metric-grid { gap: 6px; margin-top: 21px; padding: 14px 0; }
  .metric strong { font-size: 20px; }
  .scenic-score-panel { margin-top: 13px; }
  .scenic-score-breakdown { grid-template-columns: 1fr 1fr; gap: 5px 9px; }
  .supplies-list { max-height: 180px; }
  .export-button { min-height: 50px; }
  .profile-chart-wrap { height: 160px; }
  .footer { display: grid; gap: 5px; padding-top: 21px; }
}

@media (max-width: 380px) {
  .app-shell { padding-right: 10px; padding-left: 10px; }
  .topbar { min-height: 64px; }
  .brand-mark { width: 33px; height: 33px; }
  .brand-name { font-size: 17px; }
  .intro-copy h1 { font-size: 35px; }
  .planner-panel { padding-right: 13px; padding-left: 13px; }
  .map-card-header, .route-summary, .elevation-card, .interop-card { padding-right: 14px; padding-left: 14px; }
  .metric span, .metric small { font-size: 9px; }
  .metric strong { font-size: 18px; }
  .route-submetrics { gap: 9px; font-size: 9px; }
}
