/* 철도 계획 노선도 — 지도(왼쪽, 끌기·확대) | 노선 설명(오른쪽). 휴대폰은 위아래로 */
.brand { color: inherit; }
.rail-page {
  display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 360px;
  height: calc(100dvh - 56px - var(--safe-t) - 32px - 34px); max-width: 1800px; margin: 0 auto; box-sizing: content-box;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(16px + var(--safe-b)) max(16px, env(safe-area-inset-left));
}
@media (width < 900px) {
  .rail-page { display: flex; flex-direction: column; height: auto; gap: 12px; padding-top: 12px; }
  .rail-view { height: 72dvh; flex: none !important; }
  .rail-info .scroll { overflow: visible; }
}
.rail-map .asof { font-weight: 400; font-size: 12px; margin-left: 4px; }
.tog { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; padding-right: 6px; }
.tog input { accent-color: var(--accent); margin: 0; }

.rail-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 6px; flex: none; }
.rail-chips .chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 99px; padding: 3px 10px 3px 8px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.rail-chips .chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.rail-chips .chip:hover { background: var(--hover); color: var(--ink); }
.rail-chips .chip[aria-pressed="true"] { color: var(--ink); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); font-weight: 650; }
.rail-chips .chip.all { padding-left: 10px; }
.rail-chips .chip.all[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }

.rail-stage { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0 10px 6px; font-size: 11.5px; color: var(--muted); flex: none; }
.rail-stage span { display: inline-flex; align-items: center; gap: 5px; }
.rail-stage svg { width: 28px; height: 10px; stroke: var(--ink); }

.rail-view { position: relative; flex: 1; min-height: 0; border-radius: 12px; overflow: hidden; background: var(--bg); touch-action: none; cursor: grab; }
.rail-view.drag { cursor: grabbing; }
.rail-zoom { position: absolute; right: 8px; top: 8px; display: grid; gap: 4px; z-index: 1; }
.rail-zoom .icon-btn { width: 32px; height: 32px; background: var(--surface); border: 1px solid var(--line); font-size: 16px; line-height: 1; }

.rail-svg { display: block; width: 100%; height: 100%; stroke: none; user-select: none; -webkit-user-select: none; }
.rail-svg .river { fill: none; stroke: color-mix(in srgb, #4a90d9 16%, var(--bg)); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.rail-svg .river-t { fill: color-mix(in srgb, #4a90d9 60%, var(--muted)); font-size: 12px; font-style: italic; }
.rail-svg .ln { fill: none; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.rail-svg .ln.build { stroke-dasharray: 9 5; stroke-linecap: butt; }
.rail-svg .ln.design { stroke-dasharray: 4 5; stroke-linecap: butt; }
.rail-svg .ln.stall { stroke-dasharray: .1 7; stroke-width: 5.5; }
.rail-svg .ln.plan { stroke-dasharray: .1 7; stroke-width: 3.5; opacity: .75; }
.rail-svg .ln-in { fill: none; stroke: var(--surface); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }   /* 개통 임박 = 두 줄 */
.rail-svg .hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; }
.rail-svg g.line { transition: opacity .15s; }
.rail-svg g.line.dim { opacity: .12; }
.rail-svg g.line.dim .hit { cursor: pointer; }
.rail-svg .st { fill: var(--surface); stroke-width: 2; }
.rail-svg .st.x { stroke: var(--ink); stroke-width: 2.2; }
.rail-svg .lb { fill: var(--ink); font-size: 11px; paint-order: stroke; stroke: var(--bg); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.rail-svg .lb.x { font-weight: 650; }
.rail-svg .lb.dim { opacity: .3; }
.rail-svg .pl { fill: var(--accent); }
.rail-svg .pl-t { fill: var(--accent); font-size: 11px; font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.rail-svg.no-places .places { display: none; }

.rail-list { list-style: none; margin: 0; padding: 0 4px; display: grid; gap: 6px; }
.rail-item { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; cursor: pointer; }
.rail-item:hover { background: var(--hover); }
.rail-item.on { background: color-mix(in srgb, var(--c) 8%, transparent); }
.rail-item .r1 { display: flex; align-items: center; gap: 6px; }
.rail-item .nm { font-weight: 650; font-size: 14px; margin-right: auto; }
.rail-item .stg { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; color: var(--muted); background: var(--hover); white-space: nowrap; }
.rail-item .stg[data-s="open"], .rail-item .stg[data-s="soon"] { color: #fff; background: var(--accent); }
.rail-item .stg[data-s="build"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rail-item .when { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rail-item .route { font-size: 11.5px; color: var(--muted); }
.rail-item .tx { font-size: 12.5px; }
.rail-item .src { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; }
.rail-item .src a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.rail-item .src a:hover { color: var(--ink); }
