.map-card { padding: 24px; overflow: hidden; }
.map-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.map-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.map-controls .map-filter { padding: 8px 12px; border-radius: 99px; font-size: .86rem; font-weight: 700; }
.map-controls .map-filter.active { background: var(--sea-deep); color: #fff; border-color: var(--sea-deep); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.map-stage { position: relative; min-width: 0; }
.real-map { height: 560px; width: 100%; background: #e7ede7; isolation: isolate; z-index: 0; font-family: inherit; }
.map-loading { padding: 24px; color: #435850; }
.real-map .leaflet-control-attribution { font-size: 10px; color: #34454b; background: rgba(255,255,255,.94); }
.real-map .leaflet-control-attribution a { color: #145b73; }
.real-map .leaflet-control-scale-line { color: #243c40; border-color: #324b4f; background: rgba(255,255,255,.85); }
.real-map .leaflet-bar a { color: #233b40; }
.real-map .leaflet-interactive:focus-visible { outline: 3px solid #e89e35; }
.real-map .leaflet-tooltip { border: 0; border-radius: 5px; padding: 3px 7px; color: #233b40; font-family: inherit; font-size: 11px; font-weight: 750; box-shadow: 0 1px 5px #233b4033; }
.real-map .leaflet-popup-content { margin: 17px; width: min(260px, 60vw) !important; }
.real-map .leaflet-popup-content-wrapper { background: var(--surface-strong); color: var(--ink); border-radius: 12px; }
.real-map .leaflet-popup-tip { background: var(--surface-strong); }
.map-pin { border: none; background: transparent; }
.map-pin > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50% 50% 50% 3px; transform: rotate(-45deg); background: var(--route-color, #175a6a); border: 2px solid #fff; color: #fff; box-shadow: 0 2px 7px #183d4555; }
.map-pin b { transform: rotate(45deg); font-size: 12px; font-weight: 800; }
.map-pin.home > span { background: #243b40; }
.map-arrow { pointer-events: none; background: none; border: 0; }
.map-arrow span { display: block; color: var(--route-color); font-size: 20px; line-height: 20px; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.map-popup h3 { font-size: 15px; margin: 0 0 4px; }
.map-popup p { margin: 8px 0; font-size: 12px; line-height: 1.65; }
.map-popup .popup-ko { color: var(--muted); font-size: 12px; }
.map-popup code { display: block; font-size: 11px; overflow-wrap: anywhere; color: var(--ink); }
.popup-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.popup-actions a, .popup-actions button { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: var(--surface); color: var(--sea-deep); font: inherit; font-size: 11px; cursor: pointer; text-decoration: none; }
.route-panel { min-width: 0; height: 560px; overflow: auto; overscroll-behavior: contain; background: var(--surface-strong); border-left: 1px solid var(--line); padding: 19px 16px; }
.route-panel h3 { margin: 2px 0 8px; font-size: 1.14rem; line-height: 1.45; }
.route-eyebrow { color: var(--sea-deep); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; margin: 0 0 6px; }
.route-caption { color: var(--muted); font-size: .82rem; line-height: 1.8; margin: 8px 0 15px; }
.route-day-card { display: block; width: 100%; text-align: left; border: 1px solid var(--soft-line); border-left: 4px solid var(--route-color); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 12px; margin: 9px 0; cursor: pointer; }
.route-day-card:hover { border-color: var(--route-color); }
.route-day-card strong, .route-day-card small, .route-day-card span { display: block; }
.route-day-card strong { font-size: .94rem; margin: 3px 0 7px; }
.route-day-card small { color: var(--muted); font-size: .82rem; }
.route-day-card span { color: var(--route-color); font-size: .86rem; font-weight: 750; }
.route-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.route-stat { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; flex: 1; min-width: 98px; }
.route-stat strong { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.route-stat span { color: var(--muted); font-size: .82rem; }
.route-stop-strip { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 12px 0; }
.route-stop-strip button { padding: 5px 7px; border: 0; background: var(--surface); color: var(--sea-deep); border-radius: 4px; cursor: pointer; font-size: .82rem; }
.route-stop-strip > span { color: var(--muted); font-size: .82rem; }
.route-leg { margin-top: 12px; border: 1px solid var(--soft-line); border-radius: 10px; overflow: hidden; }
.route-leg.selected { border-color: var(--route-color); box-shadow: 0 0 0 1px var(--route-color); }
.route-leg-select { display: block; width: 100%; background: var(--surface); border: 0; color: var(--ink); text-align: left; padding: 12px; cursor: pointer; }
.route-leg-select strong { display: block; font-size: .86rem; line-height: 1.65; }
.route-leg-select small { display: block; font-size: .82rem; color: var(--muted); margin-top: 5px; }
.route-leg-select .leg-km { font-size: .87rem; font-weight: 800; color: var(--route-color); display: inline-block; margin: 6px 0 0; }
.route-leg-note { padding: 0 12px 10px; background: var(--surface); }
.route-leg-note p { font-size: .82rem; color: var(--muted); line-height: 1.75; margin: 0 0 7px; }
.leg-links { display: flex; flex-wrap: wrap; gap: 10px; }
.leg-links a { font-size: .82rem; font-weight: 700; color: var(--sea-deep); text-underline-offset: 3px; }
.route-key { display: flex; flex-wrap: wrap; gap: 7px 18px; align-items: center; margin: 14px 0 6px; font-size: .82rem; color: var(--muted); }
.route-key span { display: inline-flex; align-items: center; gap: 6px; }
.route-key i { display: inline-block; width: 23px; border-top: 3px solid var(--sea); }
.route-key .rail-key { border-top: 3px dashed #b06716; }
.map-legend { margin: 7px 0; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.map-data-note { border-top: 1px solid var(--soft-line); margin-top: 14px; padding-top: 12px; font-size: .82rem; color: var(--muted); }
.map-data-note summary { cursor: pointer; color: var(--ink); }
.map-data-note p { line-height: 1.85; margin-bottom: 8px; }
.map-popup .map-data-note button, .map-popup .map-data-note a { display: inline-block; margin: 8px 8px 0 0; font-size: 12px; color: var(--sea-deep); }
.map-popup .map-data-note button { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: var(--surface); cursor: pointer; }
.map-basemap-note { position: absolute; top: 12px; left: 54px; right: 12px; z-index: 2; background: #fff5db; border: 1px solid #dcad56; border-radius: 9px; color: #694d17; font-size: 12px; padding: 10px; box-shadow: 0 2px 12px #0001; }
.map-basemap-note button { border: 0; background: none; color: #694d17; text-decoration: underline; cursor: pointer; font: inherit; margin-left: 8px; }
.map-card button:focus-visible, .map-card a:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
[data-theme="dark"] .map-controls .map-filter.active { color: #10252c; }
[data-theme="dark"] .route-day-card span, [data-theme="dark"] .route-leg-select .leg-km { color: color-mix(in srgb, var(--route-color) 58%, #fff); }
@media (max-width: 1023px) {
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .real-map { height: 460px; }
  .route-panel { height: auto; max-height: none; border-left: 0; border-top: 1px solid var(--line); }
  .route-day-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .route-day-card { margin: 0; }
  .route-legs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .route-leg { margin-top: 0; }
}
@media (max-width: 767px) {
  .map-card { padding: 16px; }
  .map-controls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .map-controls .map-filter { grid-column: span 2; min-width: 0; padding: 9px 4px; font-size: .82rem; }
  .map-controls .map-filter:nth-child(n+4) { grid-column: span 3; }
  .map-toolbar { gap: 12px; }
  .real-map { height: 400px; }
  .route-panel { padding: 16px 13px; }
  .route-legs { grid-template-columns: minmax(0, 1fr); }
  .route-day-card { padding: 10px; }
  .route-day-card strong { font-size: .86rem; }
  .real-map .leaflet-tooltip { font-size: 10px; }
  .real-map .leaflet-popup-content { width: min(230px, 55vw) !important; }
}
@media print {
  .map-layout { display: block; }
  .real-map { height: 430px; }
  .route-panel { height: auto; overflow: visible; }
  .map-toolbar, .leaflet-control-zoom { display: none; }
  .route-leg { break-inside: avoid; }
}
.poi-filters { display: flex; gap: 8px; padding: 8px 16px; flex-wrap: wrap; }
.poi-filters[hidden] { display: none; }
.poi-filters [aria-pressed="true"] { border-color: var(--sea); background: var(--surface-strong); color: var(--sea-deep); }
.poi-glyph { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--sea); box-shadow: 0 2px 5px #0003; }
.area-poi-pin .poi-glyph { border-style: dashed; }
.daily-poi-row { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .82rem; }
.daily-poi-row summary { cursor: pointer; }
.daily-poi-row a { display: inline-block; margin: 4px 8px 4px 0; color: var(--sea-deep); }
.map-popup > a { display: block; padding: 6px 0; }
