:root {
  --ink: #07111f;
  --ink-2: #17263a;
  --paper: #f4f7fa;
  --white: #fff;
  --line: #dbe3ec;
  --muted: #68778a;
  --blue: #38bdf8;
  --orange: #f97316;
  --green: #10b981;
  --yellow: #fbbf24;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
.subpage-header { position: sticky; z-index: 1000; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 25px; min-height: 64px; padding: 10px 3vw; border-bottom: 1px solid rgba(148, 163, 184, .22); background: rgba(7, 17, 31, .96); color: #fff; }
.subpage-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; white-space: nowrap; }
.subpage-brand span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; color: var(--blue); font-weight: 900; }
.subpage-brand b { font-size: 13px; }
.subpage-header nav { display: flex; gap: 22px; overflow-x: auto; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; scrollbar-width: none; }
.subpage-header nav::-webkit-scrollbar { display: none; }
.subpage-header nav a { color: #cbd5e1; text-decoration: none; }
.subpage-header nav a:hover { color: #fff; }
.tool-kicker, .analysis-label { margin: 0; color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(34px, 4vw, 62px); line-height: .98; letter-spacing: 0; }
h1 em { color: var(--blue); font-style: normal; }

.route-workspace { display: grid; grid-template-columns: minmax(310px, 27vw) minmax(0, 1fr); min-height: calc(100vh - 64px); }
.route-sidebar { display: flex; flex-direction: column; gap: 22px; max-height: calc(100vh - 64px); overflow: auto; padding: 40px 30px 30px; border-right: 1px solid rgba(148, 163, 184, .2); background: var(--ink); color: #fff; }
.route-sidebar h1 { margin-top: 10px; font-size: clamp(35px, 3.2vw, 52px); }
.route-select-label, .speed-label { color: #94a3b8; font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.route-select { width: 100%; margin-top: -13px; padding: 12px 10px; border: 1px solid rgba(148, 163, 184, .3); border-radius: 7px; outline: 0; background: #101d2e; color: #fff; font-size: 12px; }
.route-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.route-summary div { padding: 10px; border: 1px solid rgba(148, 163, 184, .2); border-radius: 7px; background: rgba(255, 255, 255, .05); }
.route-summary strong, .route-summary span { display: block; }
.route-summary strong { color: #fff; font-size: 18px; }
.route-summary span { margin-top: 3px; color: #94a3b8; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.route-controls { display: grid; grid-template-columns: 38px 1fr 38px; gap: 7px; }
.route-controls button { min-height: 38px; border: 0; border-radius: 7px; }
.square-control { background: #1f3045; color: #fff; font-size: 17px; }
.play-control { background: var(--orange); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.play-control span { margin-right: 5px; }
.speed-label { display: flex; align-items: center; justify-content: space-between; }
.speed-label select { padding: 5px 7px; border: 1px solid rgba(148, 163, 184, .25); border-radius: 6px; background: #101d2e; color: #fff; font-size: 9px; }
.route-stop-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.route-stop-list button { display: grid; grid-template-columns: 27px minmax(0, 1fr); width: 100%; padding: 9px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #cbd5e1; text-align: left; }
.route-stop-list button:hover { background: rgba(255, 255, 255, .07); }
.route-stop-list button.active { border-color: rgba(56, 189, 248, .45); background: rgba(56, 189, 248, .12); color: #fff; }
.route-stop-list button span { color: #64748b; font-size: 9px; font-variant-numeric: tabular-nums; }
.route-stop-list button b, .route-stop-list button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-stop-list button b { font-size: 11px; }
.route-stop-list button small { margin-top: 3px; color: #94a3b8; font-size: 8px; }

.route-stage { position: relative; min-height: calc(100vh - 64px); overflow: hidden; background: #dce8ed; }
.route-map { width: 100%; height: 100%; min-height: inherit; }
.route-photo-stage { position: absolute; z-index: 500; right: 26px; bottom: 28px; display: grid; grid-template-columns: minmax(0, 360px) 200px; width: min(580px, calc(100% - 52px)); min-height: 185px; margin: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, .4); border-radius: 8px; background: var(--ink); box-shadow: 0 18px 45px rgba(7, 17, 31, .3); }
.route-photo-stage > img { width: 100%; height: 100%; min-height: 210px; object-fit: cover; transition: opacity .2s ease; }
.route-photo-stage figcaption { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 20px; color: #fff; }
.route-photo-stage span, .route-photo-stage small { color: #94a3b8; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.route-photo-stage strong { margin: 7px 0; font-size: 22px; line-height: 1.05; }
.route-photo-count { margin-top: 12px; color: var(--blue) !important; }
.route-photo-rail { grid-column: 1 / -1; display: grid; grid-auto-columns: 76px; grid-auto-flow: column; gap: 6px; overflow-x: auto; padding: 7px; border-top: 1px solid rgba(148, 163, 184, .22); background: #101d2e; scrollbar-width: thin; }
.route-photo-rail button { width: 76px; height: 52px; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 5px; background: #17263a; opacity: .65; }
.route-photo-rail button:hover, .route-photo-rail button.active { border-color: var(--orange); opacity: 1; }
.route-photo-rail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.route-stage-progress { position: absolute; z-index: 600; right: 0; bottom: 0; left: 0; height: 6px; background: rgba(7, 17, 31, .2); }
.route-stage-progress span { display: block; width: 0; height: 100%; background: var(--orange); transition: width .4s ease; }
.route-marker { display: grid !important; place-items: center; border: 0; background: transparent; }
.route-marker span { display: grid; place-items: center; width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: var(--ink); color: #fff; box-shadow: 0 3px 10px rgba(7, 17, 31, .35); font-size: 8px; font-weight: 900; }
.route-marker.active span { width: 30px; height: 30px; background: var(--orange); }
.route-analysis { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(360px, 1fr) minmax(320px, 1.35fr); gap: 35px; align-items: center; padding: 60px 5vw 70px; background: #fff; }
.route-analysis h2 { margin: 8px 0 0; font-size: clamp(28px, 3vw, 45px); }
.analysis-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.analysis-stats div { min-height: 82px; padding: 15px; background: var(--paper); }
.analysis-stats strong, .analysis-stats span { display: block; }
.analysis-stats strong { font-size: 25px; }
.analysis-stats span { margin-top: 5px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.segment-chart { display: grid; gap: 8px; margin-top: 14px; }
.segment-row { display: grid; grid-template-columns: minmax(100px, 150px) 1fr 54px; gap: 9px; align-items: center; font-size: 9px; }
.segment-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segment-track { height: 8px; background: #e8edf3; }
.segment-track b { display: block; height: 100%; background: var(--blue); }
.segment-row small { color: var(--muted); text-align: right; }

.portal-main { min-height: calc(100vh - 64px); }
.portal-intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 8vw; align-items: end; padding: 58px 5vw 50px; background: var(--ink); color: #fff; }
.portal-intro h1 { margin-top: 12px; }
.portal-intro-copy { display: grid; grid-template-columns: auto 1fr; gap: 8px 15px; align-items: end; }
.portal-intro-copy strong { color: var(--green); font-size: 52px; line-height: .9; }
.portal-intro-copy span { max-width: 280px; color: #e2e8f0; font-size: 14px; font-weight: 800; }
.portal-intro-copy p { grid-column: 1 / -1; margin: 10px 0 0; color: #94a3b8; font-size: 12px; }
.portal-map-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 370px; min-height: 510px; background: #dce8ed; }
.portal-map { min-height: 510px; }
.portal-preview { display: grid; grid-template-rows: 230px 1fr; min-width: 0; background: #fff; }
.portal-preview > img { width: 100%; height: 230px; object-fit: cover; }
.portal-preview > div { padding: 27px; }
.portal-preview span { color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.portal-preview h2 { margin: 8px 0 10px; font-size: 31px; line-height: 1.05; }
.portal-preview p { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.portal-preview a { display: inline-flex; margin-top: 5px; padding: 10px 12px; border-radius: 7px; background: var(--ink); color: #fff; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.portal-browser { padding: 52px 5vw 80px; }
.portal-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.portal-toolbar label { display: grid; gap: 7px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.portal-toolbar input { width: min(360px, 80vw); padding: 10px 0; border: 0; border-bottom: 1px solid var(--ink); outline: 0; background: transparent; color: var(--ink); font-size: 13px; letter-spacing: 0; text-transform: none; }
.portal-years { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.portal-years button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 9px; }
.portal-years button.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.portal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.portal-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.portal-card > img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.portal-card-body { padding: 13px; }
.portal-card-body span { color: var(--orange); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.portal-card-body h2 { min-height: 34px; margin: 7px 0; font-size: 15px; line-height: 1.12; }
.portal-card-body p { display: -webkit-box; min-height: 28px; overflow: hidden; margin-bottom: 12px; color: var(--muted); font-size: 9px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.portal-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.portal-card-actions a, .portal-card-actions button { padding: 7px 8px; border: 0; border-radius: 6px; font-size: 8px; font-weight: 900; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.portal-card-actions a { background: var(--ink); color: #fff; }
.portal-card-actions button { background: #e0f2fe; color: #0369a1; }
.portal-result-count { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.portal-map-marker { display: grid !important; place-items: center; border: 0; background: transparent; }
.portal-map-marker span { display: grid; place-items: center; width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; background: var(--green); box-shadow: 0 3px 9px rgba(7, 17, 31, .3); color: #fff; font-size: 7px; font-weight: 900; }
.portal-map-marker.active span { width: 28px; height: 28px; background: var(--orange); }
.subpage-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 5vw 30px; background: #030712; color: #94a3b8; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.subpage-footer a { color: var(--blue); text-decoration: none; }
.leaflet-control-attribution { display: none; }
.leaflet-control-zoom { overflow: hidden; border: 0 !important; border-radius: 7px !important; }
.leaflet-control-zoom a { border-color: #26364a !important; background: var(--ink) !important; color: #fff !important; }

@media (max-width: 1100px) {
  .route-workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .route-analysis { grid-template-columns: 1fr 1fr; }
  .route-analysis > div:last-child { grid-column: 1 / -1; }
  .portal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .subpage-header { align-items: flex-start; flex-direction: column; padding: 10px 4vw 12px; }
  .subpage-header nav { width: 100%; }
  .route-workspace { display: block; }
  .route-sidebar { max-height: none; padding: 32px 5vw; }
  .route-stop-list { grid-template-columns: repeat(2, 1fr); }
  .route-stage { min-height: 650px; }
  .route-analysis { grid-template-columns: 1fr; }
  .route-analysis > div:last-child { grid-column: auto; }
  .portal-map-layout { grid-template-columns: 1fr; }
  .portal-preview { grid-template-columns: 190px minmax(0, 1fr); grid-template-rows: 1fr; }
  .portal-preview > img { height: 100%; min-height: 230px; }
  .portal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .subpage-header nav { gap: 15px; }
  .route-sidebar h1 { font-size: 38px; }
  .route-stop-list { grid-template-columns: 1fr; }
  .route-stage { min-height: 570px; }
  .route-photo-stage { right: 12px; bottom: 18px; grid-template-columns: 1fr; width: calc(100% - 24px); min-height: 0; }
  .route-photo-stage > img { height: 190px; min-height: 0; }
  .route-photo-stage figcaption { padding: 14px 16px; }
  .route-analysis { padding: 45px 5vw 55px; }
  .segment-row { grid-template-columns: 92px 1fr 46px; }
  .portal-intro { grid-template-columns: 1fr; padding: 42px 5vw; }
  .portal-intro-copy { margin-top: 12px; }
  .portal-map { min-height: 400px; }
  .portal-preview { display: block; }
  .portal-preview > img { height: 210px; min-height: 0; }
  .portal-toolbar { align-items: flex-start; flex-direction: column; }
  .portal-years { justify-content: flex-start; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .portal-card-body h2 { font-size: 13px; }
  .portal-card-actions { align-items: stretch; flex-direction: column; }
  .portal-card-actions a, .portal-card-actions button { text-align: center; }
  .subpage-footer { flex-direction: column; }
}
