@font-face {
  font-family: ETC;
  src: url("../assets/fonts/ETCFont.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --purple: #4800ff;
  --ink: #161616;
  --muted: #656565;
  --surface: rgba(255, 255, 255, .96);
  --border: rgba(20, 20, 20, .12);
  font-family: Bahnschrift, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, .map-app, .map-canvas { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #dce4da; color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.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; }

.map-app { position: relative; isolation: isolate; }
.map-canvas { position: absolute; inset: 0; background: #f4f4f2; cursor: grab; }
.map-canvas:active { cursor: grabbing; }
/* Lighten terrain immediately, including newly loaded tiles while zooming. */
.map-canvas.is-rail-mode { background: #f4f4f2; }
.map-canvas.is-rail-monochrome { background: #f4f4f4; }
.map-canvas.is-rail-monochrome .etc-terrain { filter: grayscale(1); }
.etc-terrain { background: transparent; }
.map-canvas.is-rail-mode .etc-terrain::after {
  content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.48); pointer-events: none;
}
.ol-zoom, .ol-attribution { display: none; }
.ol-mouse-position {
  position: absolute;
  top: auto;
  right: 12px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(20,20,20,.12);
  background: rgba(255,255,255,.9);
  box-shadow: 0 2px 8px rgba(0,0,0,.16);
  color: #333;
  font: 600 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.map-app.is-filter-open .ol-mouse-position { display: none; }
.ol-scale-line { left: auto; right: 12px; bottom: 38px; background: rgba(255,255,255,.84); }
.ol-scale-line-inner { color: #222; border-color: #222; }

.map-search-shell {
  position: absolute;
  z-index: 20;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.map-brand {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(0,0,0,.17);
}
.map-brand img { object-fit: contain; }
.map-search-wrap { position: relative; width: min(470px, calc(100vw - 102px)); }
.map-search-wrap input {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: 0;
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(0,0,0,.17);
  color: #111;
  font-size: 16px;
}
.map-search-wrap input:focus { border-color: rgba(72,0,255,.44); box-shadow: 0 8px 30px rgba(72,0,255,.18); }
#clearSearch {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #666;
  font-size: 25px;
  cursor: pointer;
}
#clearSearch:hover { background: #f0f0f0; }
.map-search-results {
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  overflow: auto;
  max-height: min(620px, calc(100vh - 105px));
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(0,0,0,.2);
}
.map-search-results__header { position: sticky; z-index: 2; top: -7px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -7px -7px 4px; padding: 11px 12px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.97); }
.map-search-results__header strong { font-size: 12px; }
.map-search-results__header button { min-height: 30px; padding: 0 9px; border: 1px solid #d8d0ed; border-radius: 8px; background: #f2eeff; color: #32138b; font-size: 10px; font-weight: 800; cursor: pointer; }
.map-search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #111;
  text-align: left;
  cursor: pointer;
}
.map-search-result:hover, .map-search-result:focus-visible { background: #f0ecff; outline: 0; }
.map-search-result i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #ebe7f7; color: var(--purple); font-style: normal; font-weight: 800; }
.map-search-result.is-station i { border: 3px solid #222; background: #fff; color: transparent; }
.map-search-result strong, .map-search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-search-result strong { font-size: 14px; }
.map-search-result small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.map-search-result small.is-detail { color: #858585; font-size: 10px; }
.map-search-empty { margin: 0; padding: 16px; color: var(--muted); text-align: center; }

.map-regions {
  position: absolute;
  z-index: 12;
  top: max(80px, calc(env(safe-area-inset-top) + 80px));
  left: 80px;
  display: flex;
  gap: 7px;
  max-width: calc(100vw - 96px);
  overflow-x: auto;
  padding: 1px 4px 7px;
  scrollbar-width: none;
}
.map-regions::-webkit-scrollbar { display: none; }
.map-regions button, .map-layers button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  color: #252525;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.map-regions button:hover, .map-layers button:hover { background: #f5f3fa; }

.map-trip-planner {
  position: absolute;
  z-index: 18;
  top: 128px;
  left: 84px;
  width: min(390px, calc(100vw - 100px));
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 30px;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(19,138,74,.25);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(0,0,0,.16);
}
.map-trip-planner[hidden] { display: none !important; }
.map-trip-planner__badge { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #138a4a; color: #fff; font-weight: 900; }
.map-trip-planner small, .map-trip-planner strong { display: block; }
.map-trip-planner small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.map-trip-planner strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.map-trip-planner > span:last-child { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.map-trip-planner button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #eee; color: #555; font-size: 20px; cursor: pointer; }

.map-layers {
  position: absolute;
  z-index: 13;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 7px;
}
.map-layers button { display: flex; align-items: center; gap: 7px; opacity: .66; }
.map-layers button.is-active { opacity: 1; border-color: rgba(72,0,255,.35); color: #2d00a1; }
details.map-layers { display: block; overflow: visible; }
.map-layers summary { cursor: pointer; list-style: none; background: #fff; border: 1px solid #ddd; border-radius: 14px; padding: 13px 18px; box-shadow: 0 4px 20px #0002; font-weight: 750; }
.map-layers summary::-webkit-details-marker { display: none; }
.map-layers summary span { color: #4800ff; font-size: 23px; vertical-align: middle; margin-right: 7px; }
.map-layers-content { position: absolute; right: 0; top: calc(100% + 10px); width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 200px); overflow-y: auto; padding: 18px; background: #fff; border-radius: 20px; box-shadow: 0 8px 40px #0003; }
.rail-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0; }
.rail-mode-grid button { flex-direction: column; justify-content: center; padding: 9px; font-size: 12px; opacity: 1; }
.rail-preview { display: block; width: 100%; height: 42px; border-radius: 8px; background: repeating-linear-gradient(35deg,#e7eddb 0 13px,#ccd6c0 14px 16px,#e7eddb 17px 30px); }
.rail-preview.network { background: repeating-linear-gradient(35deg,#eef0eb 0 15px,#000000 16px 18px,#eef0eb 19px 30px); }
.rail-preview.gauge { background: linear-gradient(35deg,#eff6ff 30%,#0000ff 31% 35%,#eff6ff 36% 60%,#ffc800 61% 65%,#eff6ff 66%); }
.rail-preview.power { background: linear-gradient(35deg,#eff6ff 30%,#fa48ff 31% 35%,#eff6ff 36% 60%,#ff0000 61% 65%,#eff6ff 66%); }
#railStatus { font-size: 12px; line-height: 1.5; color: #586174; }
.rail-legend { margin: 12px 0 20px; }
.rail-legend > div { display: flex; gap: 8px; margin: 9px 0; font-size: 12px; }
.rail-legend i { flex: 0 0 20px; height: 4px; margin-top: 6px; border-radius: 3px; }
.rail-legend small { color: #626b79; }
.map-layer-extras { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
@media (max-width: 760px) {
  details.map-layers { overflow: visible; }
  .map-layers-content { top: auto; bottom: calc(100% + 10px); right: auto; left: 0; max-height: calc(100dvh - 180px); }
}
.layer-dot { width: 12px; height: 12px; display: inline-block; border-radius: 50%; }
.layer-dot.station { border: 3px solid #171717; background: white; }
.layer-dot.poi { background: var(--purple); box-shadow: inset 0 0 0 2px white; }
.layer-line { width: 18px; height: 4px; display: inline-block; border-radius: 3px; background: linear-gradient(90deg,#ff4d4d,#4800ff,#00a56a); }
.layer-disruption { width: 17px; height: 17px; display: inline-grid; place-items: center; border-radius: 50%; background: #d52432; color: #fff; font-size: 11px; font-weight: 950; }
#toggleDisruptions.is-active { border-color: rgba(213,36,50,.45); color: #a11420; }
#mapDisruptionCount { min-width: 17px; height: 17px; display: inline-grid; place-items: center; padding: 0 4px; border-radius: 9px; background: #eee; color: #555; font-size: 9px; }

.map-filter-panel {
  position: absolute;
  z-index: 30;
  top: 66px;
  right: 16px;
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 82px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 14px 42px rgba(0,0,0,.24);
}
.map-filter-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.map-filter-panel header small, .map-filter-panel header strong { display: block; }
.map-filter-panel header small { color: var(--purple); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.map-filter-panel header strong { margin-top: 2px; font-size: 19px; }
.map-filter-panel header span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.map-filter-panel header button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eee; font-size: 21px; cursor: pointer; }
.map-filter-panel section { padding: 13px 0; border-top: 1px solid var(--border); }
.map-filter-panel h2 { margin: 0 0 9px; font-size: 13px; }
.map-filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.map-filter-grid label, .map-filter-lines label { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 9px; background: #f5f5f7; font-size: 12px; font-weight: 700; cursor: pointer; }
.map-filter-grid input, .map-filter-lines input { accent-color: var(--purple); }
.map-filter-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 230px; overflow: auto; }
.map-filter-lines label i { width: 13px; height: 5px; flex: 0 0 auto; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.map-filter-lines label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-filter-reset { width: 100%; min-height: 40px; border: 1px solid var(--purple); border-radius: 10px; background: #f1edff; color: #2d00a1; font-weight: 800; cursor: pointer; }

.map-zoom {
  position: absolute;
  z-index: 14;
  right: 16px;
  bottom: 72px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(0,0,0,.16);
}
.map-zoom button { width: 44px; height: 44px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: #222; font-size: 22px; cursor: pointer; }
.map-zoom button:last-child { border-bottom: 0; font-size: 19px; }
.map-zoom button:hover { background: #f1eff5; }

.map-welcome {
  position: absolute;
  z-index: 11;
  left: 16px;
  bottom: 18px;
  min-width: 280px;
  padding: 14px 46px 14px 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(0,0,0,.15);
}
.map-welcome p, .map-welcome strong, .map-welcome span, .map-welcome small { display: block; margin: 0; }
.map-welcome .eyebrow { color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.map-welcome strong { margin-top: 3px; font-size: 14px; }
.map-welcome span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.map-welcome small { margin-top: 6px; color: #777; font-size: 10px; }
.map-welcome button { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: #777; cursor: pointer; }

.map-route-summary {
  position: absolute;
  z-index: 24;
  left: 16px;
  bottom: 18px;
  width: min(460px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 150px));
  overflow: hidden;
  padding: 20px 48px 17px 18px;
  border: 1px solid rgba(72,0,255,.24);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 9px 30px rgba(0,0,0,.2);
}
.map-route-summary > p { margin: 0 0 4px; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.map-route-summary > strong { display: block; overflow: hidden; margin: 0 0 5px; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.map-route-summary > span { display: block; margin-bottom: 11px; color: var(--muted); font-size: 12px; }
.map-route-summary__close { position: absolute; top: 9px; right: 9px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f1f1; color: #555; font-size: 22px; cursor: pointer; }
.map-route-summary__handle { display: none; }
.map-route-variants { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 9px; }
.map-route-variants button { flex: 0 0 auto; min-height: 32px; padding: 0 10px; border: 1px solid #d5d1e0; border-radius: 999px; background: #fff; color: #444; font-size: 11px; font-weight: 800; cursor: pointer; }
.map-route-variants button.is-active { border-color: var(--purple); background: #efeaff; color: #2d00a1; }
.map-route-steps { max-height: min(320px, 35vh); overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.map-route-step { width: 100%; display: grid; grid-template-columns: 7px minmax(0,1fr); gap: 10px; align-items: stretch; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--border); background: #fff; color: #222; text-align: left; cursor: pointer; }
.map-route-step:last-child { border-bottom: 0; }
.map-route-step:hover, .map-route-step.is-active { background: #f1edff; }
.map-route-step i { width: 7px; min-height: 34px; border-radius: 5px; }
.map-route-step strong, .map-route-step small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-route-step strong { font-size: 12px; }
.map-route-step small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.map-route-actions { display: flex; gap: 7px; margin-top: 10px; }
.map-route-actions a, .map-route-actions button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--purple); border-radius: 9px; background: #fff; color: #2d00a1; font-size: 12px; font-weight: 800; text-decoration: none; cursor: pointer; }
.map-route-actions a { background: var(--purple); color: #fff; }

.map-details {
  position: absolute;
  z-index: 25;
  left: 16px;
  bottom: 18px;
  width: min(410px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 12px 38px rgba(0,0,0,.24);
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.map-details__close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f1f1; color: #555; font-size: 22px; cursor: pointer; }
.map-details__type { margin: 0 38px 6px 0; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.map-details h1 { margin: 0 36px 8px 0; font-size: clamp(21px, 4vw, 28px); line-height: 1.08; }
.map-details__rating { margin: -1px 0 9px; color: #805a00; font-size: 13px; font-weight: 850; }
.map-details__description { margin: 0 0 12px; color: #505050; font-size: 14px; line-height: 1.45; }
.map-details__address { margin: -3px 0 12px; color: #555; font-size: 13px; }
.map-details__address::before { content: "⌖ "; color: var(--purple); font-weight: 900; }
.map-details__notice { margin: 0 0 12px; padding: 9px 11px; border-radius: 10px; background: #fff3cd; color: #624b00; font-size: 12px; font-weight: 700; line-height: 1.35; }
.map-opening { margin: 0 0 13px; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.map-opening__summary { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 0; background: #f7f7f8; color: #222; text-align: left; cursor: pointer; }
.map-opening__summary span { font-size: 13px; font-weight: 850; }
.map-opening__summary span.is-open { color: #147a36; }
.map-opening__summary span.is-closed { color: #b3261e; }
.map-opening__summary small { color: var(--muted); font-size: 10px; }
.map-opening__week { padding: 5px 11px 8px; background: #fff; }
.map-opening__day { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid #eee; font-size: 11px; }
.map-opening__day.is-today { color: var(--purple); font-weight: 800; }
.map-details__coords { width: max-content; margin: 0 0 13px; padding: 6px 9px; border-radius: 8px; background: #eeeef1; color: #383838; font: 600 12px/1 ui-monospace,SFMono-Regular,Consolas,monospace; }
.map-details__lines { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 15px; }
.map-line-chip { padding: 4px 8px; border-radius: 999px; color: white; font-size: 11px; font-weight: 800; text-decoration: none; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.map-details__services { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.map-service-chip { padding: 5px 8px; border-radius: 999px; background: #eeeaf9; color: #32138b; font-size: 11px; font-weight: 750; }
.map-reviews { margin: 0 0 14px; border: 1px solid var(--border); border-radius: 12px; background: #fafafa; overflow: hidden; }
.map-reviews summary { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 850; }
.map-reviews summary::-webkit-details-marker { display: none; }
.map-reviews summary::after { content: '+'; margin-left: auto; }
.map-reviews[open] summary::after { content: '−'; }
.map-reviews summary small { color: var(--muted); font-size: 10px; }
.map-reviews article { padding: 11px 12px; border-top: 1px solid var(--border); }
.map-reviews article > p { margin: 0; color: #4d4d4d; font-size: 11px; line-height: 1.45; }
.map-reviews article > p:first-child { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.map-reviews article strong { color: #222; }
.map-reviews article span { color: #805a00; font-size: 10px; text-align: right; }
.map-companies { margin: 0 0 14px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #faf9ff; }
.map-companies h2 { margin: 0 0 8px; color: #32138b; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.map-company { padding: 8px 0; border-top: 1px solid #e7e2f5; }
.map-company:first-child { border-top: 0; }
.map-company strong, .map-company span { display: block; }
.map-company strong { font-size: 12px; }
.map-company span { margin-top: 3px; color: #5b5b5b; font-size: 11px; line-height: 1.35; }
.map-details__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.map-action { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid #d6d6d6; border-radius: 11px; background: white; color: #222; font-weight: 750; text-decoration: none; cursor: pointer; }
.map-action.primary { border-color: var(--purple); background: var(--purple); color: white; }

.map-loading { position: absolute; z-index: 50; inset: 0; display: grid; place-content: center; gap: 14px; background: #f3f4f2; text-align: center; transition: opacity .3s, visibility .3s; }
.map-loading.is-done { opacity: 0; visibility: hidden; }
.map-loading span { width: 42px; height: 42px; justify-self: center; border: 4px solid #ddd; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
.map-loading strong { font-size: 14px; }

body.is-embed :is(.map-search-shell, .map-regions, .map-trip-planner, .map-layers, .map-filter-panel, .map-zoom, .map-welcome, .map-route-summary, .map-details, .ol-mouse-position, .ol-scale-line) {
  display: none !important;
}

body.is-embed .map-canvas {
  cursor: default;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .map-search-shell { top: max(10px, env(safe-area-inset-top)); left: 10px; }
  .map-brand { width: 48px; height: 48px; border-radius: 14px; }
  .map-search-wrap { width: calc(100vw - 78px); }
  .map-search-wrap input { height: 48px; border-radius: 14px; font-size: 15px; }
  #clearSearch { top: 4px; }
  .map-regions { top: max(66px, calc(env(safe-area-inset-top) + 66px)); left: 6px; max-width: calc(100vw - 12px); }
  .map-trip-planner { top: max(112px, calc(env(safe-area-inset-top) + 112px)); left: 8px; width: calc(100vw - 16px); }
  .map-layers { top: auto; right: auto; left: 10px; bottom: 12px; max-width: calc(100vw - 74px); overflow-x: auto; scrollbar-width: none; }
  .map-layers button { min-height: 40px; padding: 0 12px; box-shadow: 0 4px 16px rgba(0,0,0,.16); }
  .map-zoom { right: 10px; bottom: 12px; }
  .map-zoom button { width: 43px; height: 43px; }
  .map-welcome { display: none; }
  .map-filter-panel { position: fixed; top: auto; right: 0; bottom: 0; width: 100%; max-height: 78vh; border-radius: 22px 22px 0 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .map-route-summary { position: fixed; left: 0; bottom: 0; width: 100%; max-height: 72vh; padding: 29px 18px max(16px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; transition: max-height .25s; }
  .map-route-summary__handle { position: absolute; top: 3px; left: 50%; width: 54px; height: 20px; display: block; padding: 0; border: 0; background: transparent; transform: translateX(-50%); cursor: pointer; }
  .map-route-summary__handle i { width: 34px; height: 4px; display: block; margin: auto; border-radius: 4px; background: #bbb; }
  .map-route-summary.is-collapsed { max-height: 132px; }
  .map-route-summary.is-collapsed :is(.map-route-variants,.map-route-steps,.map-route-actions) { display: none; }
  .map-details { left: 8px; bottom: 62px; width: calc(100vw - 16px); max-height: calc(100vh - 132px); padding: 18px; border-radius: 18px; }
  .ol-mouse-position, .ol-scale-line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.rail-details h2 { margin: 16px 36px 8px 0; font-size: 15px; }
#railDetailGauge { margin: 0; font-size: 18px; font-weight: 750; }
#railDetailSystems { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
#railDetailSystems li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.4; }
#railDetailSystems i { flex: 0 0 22px; height: 6px; border: 1px solid #0002; border-radius: 3px; }
#railDetailSystems small { color: #626b79; }

.map-line-note { font-size: 12px; line-height: 1.4; color: #626b79; margin: 12px 0; }

#railMonochrome[hidden] { display: none; }
#railMonochrome { width: 100%; justify-content: center; margin-bottom: 8px; }
