/* ==========================================================================
   지하철 실시간 도착정보 — UI v2 (2026-09-24)
   토큰(색·간격·반경) → 앱 셸 → 검색/노선 선택 → 하단 탭·시트 → 도착정보 → 열차 현황 →
   사이드 메뉴/설정 → 앱 소개 → 세로 2열 배치 → 데스크톱 순서. 클래스명은 JS와 동일하게 유지한다.
   ========================================================================== */

/* ---- 1. 토큰 ---------------------------------------------------------------- */
:root {
    --bg: #f3f5f9; --surface: #ffffff; --surface-2: #eef1f6; --surface-3: #e3e8f0;
    --ink: #111827; --ink-2: #374151; --muted: #667085; --subtle: #98a2b3; --line: #e4e8ef;
    --primary: #2f6bff; --primary-strong: #1f54d8; --primary-soft: #e8efff;
    --danger: #e5484d; --danger-soft: #fdecec; --warn: #d97706; --success: #12a06b; --success-soft: #e3f7ee;
    --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 10px rgba(16, 24, 40, .05);
    --shadow-2: 0 10px 32px rgba(16, 24, 40, .12);
    --ring: #111827; --tray: #e6ebf5;
    --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
    --ad-h: 0px; /* 하단 고정 배너를 숨기는 동안 본문이 그 영역까지 쓰도록 높이를 0으로 둔다(광고 재개 시 60px) */
    --mobile-ad-height: var(--ad-h);
    --line-1: #0052a4; --line-2: #00a84d; --line-3: #ef7c1c; --line-4: #00a5de;
    --line-5: #996cac; --line-6: #cd7c2f; --line-7: #747f00; --line-8: #e6186c;
    --line-9: #a49476; --line-gyeonguijungang: #77c4a3; --line-airport: #0090d2;
    --line-gyeongchun: #178c72; --line-suin-bundang: #fabe00; --line-sinbundang: #d4003b;
    --line-uisinseol: #b0ce18; --line-seohae: #8fc31f; --line-etc: #718096;
    --line-gtxa: #9a2f86; --line-sillim: #6789ca; --line-gyeonggang: #0d4ea6;
    --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
html[data-app-theme="dark"] {
    --bg: #0b1019; --surface: #141b28; --surface-2: #1b2434; --surface-3: #263146;
    --ink: #f2f5fa; --ink-2: #d3dae6; --muted: #98a3b8; --subtle: #6c778c; --line: rgba(255, 255, 255, .085);
    --primary: #6d9cff; --primary-strong: #93b5ff; --primary-soft: rgba(109, 156, 255, .16);
    --danger: #ff6b70; --danger-soft: rgba(255, 107, 112, .14); --warn: #ffb020; --success: #3ddc97; --success-soft: rgba(61, 220, 151, .13);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .25);
    --shadow-2: 0 12px 36px rgba(0, 0, 0, .45);
    --ring: #f2f5fa; --tray: #182131;
}

/* 밝은 노선색(경의중앙·수인분당·우이신설·서해) 위에서는 어두운 글자를 쓴다 */
[data-line="경의중앙선"], [data-line="수인분당선"], [data-line="우이신설선"], [data-line="서해선"] { color: #141821 !important; }

/* ---- 2. 기본 ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -.012em; -webkit-font-smoothing: antialiased; }
body.app-info-open, body.favorite-settings-open, body.info-visibility-open { overflow: hidden; }
body.sponsor-apply-open { overflow: hidden; }
button, input { font: inherit; letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { flex: none; }

.app { width: 100%; max-width: 640px; min-height: 100vh; margin: 0 auto; padding: 0 0 calc(var(--ad-h) + env(safe-area-inset-bottom) + 10px); }

/* PC 프레임은 독립 모바일 뷰포트 iframe을 사용해 실제 폰 조건을 그대로 적용한다. */
.metro-pc-device-preview { display: none; }
/* 모바일에서는 별도 iframe 프레임을 숨기고, 바로 아래의 원본 앱 DOM만 표시한다. */
@media (max-width: 767px) {
    .metro-pc-device-preview { display: none !important; }
}
@media (min-width: 768px) {
    /* PC 기기 프리뷰 밖의 브라우저 캔버스까지 같은 다크톤으로 채운다. */
    html:has(body.metro-pc-preview-host), body.metro-pc-preview-host { min-height: 100vh; background: #0e1319; }
    body.metro-pc-preview-host { overflow: hidden; }
    /* 호스트의 원본 앱은 모바일에서만 보이고, PC에서는 iframe 원본만 보인다. */
    body.metro-pc-preview-host > :not(.metro-pc-device-preview) { display: none !important; }
    .metro-pc-device-preview { display: block; }
    .metro-pc-device-stage { position: fixed; z-index: 0; top: 28px; left: 50%; width: 410px; height: 838px; padding: 10px; overflow: hidden; border: 2px solid #36383d; border-radius: 26px; background: linear-gradient(145deg,#313238,#0e0f11); box-shadow: 0 35px 70px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.10); transform: translateX(-50%); }
    .metro-pc-device-stage[data-frame="fold-closed"] { border-radius: 38px; }
    .metro-pc-device-stage[data-frame="fold-open"] { border-radius: 28px; }
    .metro-pc-device-camera { position: absolute; z-index: 2; top: 5px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: #08090a; box-shadow: 0 0 0 2px rgba(80,80,90,.45); transform: translateX(-50%); pointer-events: none; }
    .metro-pc-resize-handle { position: absolute; z-index: 3; top: 50%; right: -18px; width: 30px; height: 72px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: ew-resize; transform: translateY(-50%); }
    .metro-pc-resize-handle:focus-visible { outline-color: #7db4ff; }
    .metro-pc-device-label { position: fixed; z-index: 5; top: 28px; left: max(20px, calc(50% - var(--metro-preview-half, 195px) - 250px)); width: 224px; padding: 13px 14px; border-radius: 12px; background: #111827; color: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.35); font-size: 12px; pointer-events: none; }
    .metro-pc-device-label::after { position: absolute; top: 20px; right: -5px; width: 10px; height: 10px; background: #111827; content: ''; transform: rotate(45deg); }
    .metro-pc-device-label strong { display: block; font-size: 13.5px; }
    .metro-pc-device-label small { display: block; margin-top: 3px; opacity: .7; }
    .metro-pc-device-label span { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.14); }
    .metro-pc-device-label span:first-of-type { margin-top: 9px; border-top: 0; }
    .metro-pc-device-label em { opacity: .65; font-style: normal; }
    /* iframe의 레이아웃 뷰포트가 선택 기기 폭과 동일하므로 미디어쿼리·JS 폭도 모바일과 같다. */
    .metro-pc-preview-frame { display: block; width: 390px; height: 100%; border: 0; border-radius: 18px; background: var(--bg); }
}

/* ---- 3. 앱 바 --------------------------------------------------------------- */
.app-header { position: sticky; top: 0; z-index: 20; width: 100%; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: color-mix(in srgb, var(--bg) 84%, transparent); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px); }
.service-notice-bar { display: flex; gap: 9px; align-items: flex-start; margin: 8px 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--card) 94%, var(--primary)); color: var(--ink); font-size: 12px; line-height: 1.4; }
.service-notice-bar.emergency { border-color: #ef4444; background: color-mix(in srgb, #ef4444 12%, var(--card)); }
.service-notice-bar strong { display: block; font-size: 12.5px; }
.service-notice-bar span { display: block; margin-top: 2px; color: var(--muted); }
.service-notice-bar { cursor: pointer; }
.notice-board-modal { position: fixed; z-index: 120; inset: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
.notice-board-header { display: grid; grid-template-columns:42px minmax(0,1fr) 42px; align-items:center; gap:8px; min-height:64px; padding:calc(8px + env(safe-area-inset-top)) 14px 8px; border-bottom:1px solid var(--line); background:var(--surface); }
.notice-board-header button { width:38px; height:38px; padding:0; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); color:var(--ink); font-size:27px; line-height:1; cursor:pointer; }
.notice-board-header button:last-child { font-size:22px; }
.notice-board-header span { display:block; color:var(--primary); font-size:10px; font-weight:800; letter-spacing:.09em; }
.notice-board-header h2 { margin:2px 0 0; font-size:17px; line-height:1.2; }
.notice-board-content { flex:1; overflow-y:auto; padding:16px 14px calc(26px + env(safe-area-inset-bottom)); }
.notice-board-intro { margin:0 2px 14px; color:var(--muted); font-size:12px; }
.notice-board-list { display:flex; flex-direction:column; gap:9px; }
.notice-board-item { width:100%; padding:15px; border:1px solid var(--line); border-radius:15px; background:var(--surface); color:var(--ink); text-align:left; cursor:pointer; box-shadow:var(--shadow-1); }
.notice-board-item.emergency { border-color:color-mix(in srgb, var(--danger) 55%, var(--line)); background:color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.notice-board-item-top { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
.notice-board-badge { display:inline-flex; padding:3px 8px; border-radius:999px; background:var(--primary-soft); color:var(--primary); font-size:10px; font-weight:800; }
.notice-board-item.emergency .notice-board-badge { background:var(--danger-soft); color:var(--danger); }
.notice-board-target { color:var(--subtle); font-size:10.5px; }
.notice-board-item strong { display:block; font-size:14px; }
.notice-board-item p { display:-webkit-box; margin:5px 0 0; overflow:hidden; color:var(--muted); font-size:12px; line-height:1.45; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.notice-board-meta { display:block; margin-top:9px; color:var(--subtle); font-size:10.5px; }
.notice-board-detail { padding:4px 2px; }
.notice-board-detail-back { margin:0 0 15px; padding:8px 0; border:0; background:transparent; color:var(--primary); font-weight:800; cursor:pointer; }
.notice-board-detail h3 { margin:9px 0 12px; font-size:21px; line-height:1.35; }
.notice-board-detail-meta { display:flex; gap:7px; flex-wrap:wrap; color:var(--muted); font-size:11px; }
.notice-board-detail-body { margin-top:24px; padding-top:20px; border-top:1px solid var(--line); white-space:pre-wrap; font-size:14px; line-height:1.75; }
body.notice-board-open { overflow:hidden; }
.app-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; }
.app-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.app-home-button { padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.app-home-button:active { transform: scale(.985); }
.app-logo { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(140deg, #3d7bff 0%, #5b4bff 100%); box-shadow: 0 4px 12px rgba(63, 90, 255, .35); }
.app-logo svg { width: 23px; height: 23px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-logo circle { fill: #fff; stroke: none; }
.app-brand-text { min-width: 0; }
.app-title { margin: 0; overflow: hidden; font-size: 16px; font-weight: 800; letter-spacing: -.04em; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
/* 세로·가로 모드에서 동일한 헤더 밀도를 유지한다. */
.app-tagline { display: none; }
.live-dot { position: relative; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.live-dot::after { position: absolute; inset: -3px; border-radius: 50%; background: var(--success); content: ''; opacity: .35; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(1.5); opacity: 0; } }
.header-action-buttons { display: flex; align-items: center; gap: 8px; }
.search-toggle-btn, .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); cursor: pointer; transition: transform .12s ease, background .15s ease; }
.search-toggle-btn:active, .menu-btn:active { transform: scale(.94); }
.search-toggle-btn[aria-expanded="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-toggle-icon, .menu-btn-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn { padding: 12px 18px; border: 0; border-radius: var(--r-md); font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: transform .12s ease, background .15s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }

/* ---- 4. 검색 · 노선/역 선택 ----------------------------------------------------- */
.line-selection-area { padding: 8px 0 6px; background: var(--bg); }
.search-row { display: flex; gap: 8px; padding: 4px 16px 8px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field-icon { position: absolute; top: 50%; left: 15px; width: 19px; height: 19px; fill: none; stroke: var(--subtle); stroke-width: 2; stroke-linecap: round; transform: translateY(-50%); pointer-events: none; }
.search-input { width: 100%; height: 48px; padding: 0 44px 0 43px; border: 1.5px solid var(--line); border-radius: 15px; outline: none; background: var(--surface); color: var(--ink); font-size: 16px; box-shadow: var(--shadow-1); }
.search-input::placeholder { color: var(--subtle); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-clear { position: absolute; top: 50%; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 19px; line-height: 1; transform: translateY(-50%); cursor: pointer; }
.search-btn { min-width: 64px; height: 48px; padding: 0 16px; }
.search-suggest { margin: 0 16px 8px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); }
.suggest-title { padding: 12px 16px 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.suggest-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.suggest-title + .suggest-item { border-top: 0; }
.suggest-item:first-child { border-top: 0; }
.suggest-item:active, .suggest-item:hover { background: var(--surface-2); }
.suggest-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.suggest-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.suggest-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; }
.suggest-name em { margin-left: 2px; color: var(--muted); font-size: 13px; font-style: normal; font-weight: 500; }
.suggest-lines { display: flex; gap: 4px; }
.suggest-empty { padding: 22px 16px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* 노선 배지(원형) */
.line-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.line-badge.xs { min-width: 20px; height: 20px; padding: 0 5px; font-size: 10.5px; }
.line-badge.sm { min-width: 24px; height: 24px; padding: 0 6px; font-size: 12px; }
.line-badge.lg { min-width: 46px; height: 46px; padding: 0 8px; font-size: 19px; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }

/* 노선 칩 */
.line-chip-row, .main-lines-list { display: flex; gap: 8px; padding: 6px 16px 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.line-chip-row::-webkit-scrollbar, .main-lines-list::-webkit-scrollbar { display: none; }
.line-chip { flex: 0 0 auto; height: 36px; padding: 0 15px; border: 0; border-radius: 999px; color: #fff; font-size: 13.5px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; cursor: pointer; scroll-snap-align: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 1px 3px rgba(0, 0, 0, .12); transition: opacity .2s ease, transform .15s ease, box-shadow .2s ease; }
.line-chip:active { transform: scale(.95); }
.has-active .line-chip:not(.active) { opacity: .55; }
.line-chip.active { font-weight: 800; transform: translateY(-1px); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring), 0 4px 12px rgba(0, 0, 0, .2); }
/* 호선 선택 시 트레이 전체를 어둡게 하여 선택한 호선만 뚜렷하게 보이도록 한다. */
.sel-tray.has-active { background: color-mix(in srgb, var(--tray) 50%, #000); }
.sel-tray.has-active .line-chip.active { filter: brightness(1.15); }
.main-lines-list.has-active { background: color-mix(in srgb, var(--surface) 50%, #000); border-radius: 16px; }
.main-lines-list.has-active .line-chip.active { filter: brightness(1.15); }
.main-line-chip { box-shadow: none; }
/* 제목 옆 삭제 모드에서만 역 항목을 누르면 삭제되도록 시각 상태를 분리한다. */
.favorite-delete-toggle { height: 30px; padding: 0 12px; border: 1px solid var(--danger); border-radius: 999px; background: var(--surface); color: var(--danger); font-size: 12px; font-weight: 800; cursor: pointer; }
.favorite-delete-toggle[aria-pressed="true"] { background: var(--danger); color: #fff; }
.favorite-station-chip.delete-mode { outline: 3px solid var(--danger); outline-offset: -3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 0 0 2px var(--surface); }

/* 역 선택 스트립 */
.line-station-picker { margin: 4px 0 0; padding: 4px 0 6px; }
.line-station-list { display: flex; gap: 7px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
.line-station-list::-webkit-scrollbar { display: none; }
.line-station-btn { flex: 0 0 auto; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s ease, color .15s ease; }
.line-station-btn:active { transform: scale(.96); }
.line-station-btn.active { border-color: transparent; background: var(--line-accent, var(--primary)); color: #fff; font-weight: 800; }
.vertical-line-picker, .vertical-line-context { display: none; }
.station-name-break { display: none; }

/* 저장한 항목 바로가기 */
.saved-shortcuts { display: flex; gap: 8px; margin: 0; padding: 4px 16px 8px; overflow-x: auto; scrollbar-width: none; }
.saved-shortcuts::-webkit-scrollbar, .saved-preferences-list::-webkit-scrollbar { display: none; }
.saved-shortcut-btn { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 8px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.saved-shortcut-btn strong { color: var(--ink); font-size: 13px; }
.saved-shortcut-btn:active { background: var(--surface-2); }
.saved-preferences { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.saved-preferences-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--ink); font-size: 13px; }
.saved-preferences-reset { padding: 6px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--danger); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.saved-preferences-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.saved-preferences .saved-shortcut-btn { background: var(--surface-2); }

/* ---- 5. 하단 탭 · 광고 · 토스트 · 시트 --------------------------------------------- */

.mobile-ad-slot { position: fixed; right: 0; bottom: 0; left: 0; z-index: 25; display: flex; align-items: center; justify-content: center; height: calc(var(--ad-h) + env(safe-area-inset-bottom)); padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.mobile-ad-placeholder { display: flex; align-items: center; justify-content: center; gap: 8px; width: min(100%, 640px); height: 100%; border-radius: 10px; background: var(--surface-2); color: var(--subtle); font-size: 11px; }
.mobile-ad-placeholder span { padding: 2px 5px; border-radius: 4px; background: var(--surface-3); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.mobile-ad-placeholder strong { font-weight: 600; }

.toast { position: fixed; right: 16px; bottom: calc(var(--ad-h) + env(safe-area-inset-bottom) + 14px); left: 16px; z-index: 80; width: fit-content; max-width: min(92vw, 420px); margin: 0 auto; padding: 12px 18px; border-radius: 999px; background: #1f2937; color: #fff; font-size: 13.5px; font-weight: 600; text-align: center; box-shadow: var(--shadow-2); opacity: 0; transform: translateY(8px); transition: opacity .22s ease, transform .22s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(8, 13, 24, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet { position: fixed; right: 0; bottom: 0; left: 0; z-index: 71; display: flex; flex-direction: column; width: 100%; max-width: 640px; max-height: 76dvh; margin: 0 auto; padding-bottom: calc(env(safe-area-inset-bottom) + 12px); border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: 0 -12px 40px rgba(0, 0, 0, .25); transform: translateY(102%); transition: transform .26s cubic-bezier(.2, .8, .25, 1); }
.sheet.open { transform: none; }
.sheet-grip { width: 40px; height: 4px; margin: 10px auto 2px; border-radius: 4px; background: var(--surface-3); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 4px; }
.sheet-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.04em; }
.sheet-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.sheet-body { flex: 1; padding: 6px 20px 8px; overflow-y: auto; }

/* ---- 6. 도착정보 ------------------------------------------------------------- */
.arrivals-panel { margin: 6px 16px 16px; padding: 0; border: 0; background: none; box-shadow: none; }
.arrivals-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 2px 6px; }
.arrivals-station-name { font-size: 30px; font-weight: 800; letter-spacing: -.05em; line-height: 1.15; }
.station-suffix { margin-left: 3px; color: var(--muted); font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.arrivals-lines { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.star-btn, .close-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--subtle); font-size: 21px; line-height: 1; cursor: pointer; box-shadow: var(--shadow-1); }
.star-btn.active { border-color: transparent; background: #fff4d6; color: #f5a623; }
html[data-app-theme="dark"] .star-btn.active { background: rgba(245, 166, 35, .18); }
.live-chip { display: inline-flex; align-items: center; gap: 7px; margin: 6px 0 4px; padding: 6px 12px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 12px; font-weight: 700; }
.live-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* 서울시 주요 장소 지원 역에만 보이는 '역 주변 권역' 공식 혼잡도 카드다. */
.city-crowd-card { margin: 10px 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.city-crowd-card[hidden] { display: none; }
.city-crowd-loading { color: var(--muted); font-size: 13px; text-align: center; }
.city-crowd-head, .city-crowd-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.city-crowd-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.city-crowd-head span { color: var(--muted); font-size: 11px; font-weight: 700; }
.city-crowd-head strong { color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.city-crowd-level { flex: none; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.city-crowd-level.relaxed { background: var(--success-soft); color: var(--success); }
.city-crowd-level.normal { background: var(--primary-soft); color: var(--primary); }
.city-crowd-level.busy { background: var(--warn-soft); color: var(--warn); }
.city-crowd-level.crowded { background: var(--danger-soft); color: var(--danger); }
/* 현재 혼잡 단계를 색과 텍스트로 함께 읽는 4단계 게이지다. */
.city-crowd-gauge { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.city-crowd-gauge-step { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--subtle); text-align: center; }
.city-crowd-gauge-step i { display: block; height: 7px; border-radius: 999px; background: currentColor; opacity: .2; transition: height .16s ease, opacity .16s ease, box-shadow .16s ease; }
.city-crowd-gauge-step b { overflow: hidden; font-size: 9.5px; font-weight: 700; letter-spacing: -.06em; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.city-crowd-gauge-step.relaxed { color: #159b72; }
.city-crowd-gauge-step.normal { color: #3478de; }
.city-crowd-gauge-step.busy { color: #dd8a00; }
.city-crowd-gauge-step.crowded { color: #df4d4d; }
.city-crowd-gauge-step.active i { height: 10px; opacity: 1; box-shadow: 0 2px 6px color-mix(in srgb, currentColor 42%, transparent); }
.city-crowd-gauge-step.active b { color: currentColor; font-weight: 800; }
/* 공식 시설 데이터의 엘리베이터 위치·운행 상태는 혼잡도 아래에서 짧게 확인한다. */
.city-elevator { margin-top: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.city-elevator-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.city-elevator-card .city-elevator { margin-top: 0; }
.city-elevator-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.city-elevator-head > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.city-elevator-head span { color: var(--muted); font-size: 11px; font-weight: 700; }
.city-elevator-head strong { color: var(--ink); font-size: 13px; font-weight: 800; }
.city-elevator-summary, .city-elevator-status { flex: none; padding: 3px 6px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 10px; font-weight: 800; line-height: 1.2; }
.city-elevator-summary.stopped, .city-elevator-status.stopped { background: var(--danger-soft); color: var(--danger); }
.city-elevator ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.city-elevator li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.city-elevator li > div { min-width: 0; }
.city-elevator li strong, .city-elevator li span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-elevator li strong { color: var(--ink-2); font-size: 11px; font-weight: 750; }
.city-elevator li span, .city-elevator small { color: var(--subtle); font-size: 10px; line-height: 1.35; }
.city-elevator > small { display: block; margin-top: 7px; }
.city-elevator-empty { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.city-elevator-empty > div { display: flex; flex-direction: column; gap: 1px; }
.city-elevator-empty strong { color: var(--ink-2); font-size: 12px; }
.city-elevator-empty small { max-width: 130px; text-align: right; }
.city-crowd-count { margin-top: 12px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); }
.city-crowd-count span { color: var(--muted); font-size: 12px; font-weight: 700; }
.city-crowd-count strong { color: var(--ink); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.city-crowd-count em { margin-left: 2px; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 700; }
.city-crowd-card p { margin: 10px 0 4px; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.city-crowd-card small { color: var(--subtle); font-size: 10.5px; line-height: 1.4; }
.city-crowd-unavailable { background: var(--surface-2); box-shadow: none; }
.city-crowd-unavailable p { margin-bottom: 5px; }
.city-crowd-unavailable small b { color: var(--primary); }
/* 전체 역 목록에서 실제 공식 혼잡도 제공 역만 작게 구별한다. */
.city-crowd-station-mark { display: inline-flex; align-items: center; height: 16px; margin-left: 4px; padding: 0 4px; border-radius: 5px; background: var(--success-soft); color: var(--success); font-size: 9px; font-weight: 800; line-height: 1; letter-spacing: -.04em; vertical-align: 1px; }
.line-station-btn.active .city-crowd-station-mark { background: rgba(255,255,255,.22); color: #fff; }
/* 가로·세로 LIVE 화면 아래에 공통으로 두어 역 선택 직후 찾기 쉽게 한다. */
.line-city-crowd-card { margin: 0 16px 16px; }
.line-elevator-card { margin: 0 16px 16px; }

/* 사용자 표시 설정은 새로 렌더링되는 카드에도 같은 방식으로 적용한다. */
.info-visibility-hidden { display: none !important; }

.arr-group { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.arr-group-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.arr-group-head strong { font-size: 15.5px; font-weight: 800; letter-spacing: -.03em; }
.arr-dir { padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 800; }
.arr-list { margin: 0; padding: 0; list-style: none; }
.arr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px 16px; border-top: 1px solid var(--line); }
.arr-row:first-child { border-top: 0; }
.arr-dest-line { display: flex; align-items: center; gap: 7px; }
.arr-dest { font-size: 18px; font-weight: 800; letter-spacing: -.04em; }
.arr-kind { padding: 2px 7px; border-radius: 6px; background: var(--danger-soft); color: var(--danger); font-size: 11px; font-weight: 800; }
.arr-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.arr-eta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.arr-eta-main { font-size: 21px; font-weight: 800; letter-spacing: -.04em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.arr-eta-sub { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.arrival-age { color: var(--subtle); font-size: 11px; font-weight: 500; white-space: nowrap; }
.arrival-age.stale { color: var(--danger); font-weight: 700; }
.tone-now .arr-eta-main { color: var(--danger); }
.tone-soon .arr-eta-main { color: var(--warn); }
.tone-gone .arr-eta-main { color: var(--subtle); }
.tone-now { background: linear-gradient(90deg, transparent, var(--danger-soft)); }
.data-notice { display: flex; align-items: flex-start; gap: 8px; margin: 14px 4px 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.data-notice svg { width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.status-msg { padding: 32px 14px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---- 7. 노선 현황 ------------------------------------------------------------ */
.line-panel { margin: 4px 0 16px; padding: 0; border: 0; background: none; box-shadow: none; }
.line-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px 10px; }
.line-title { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.app.tray-collapsed:not(.vertical-layout) .line-title { cursor: pointer; }
.line-title-text strong { display: block; overflow: hidden; font-size: 21px; font-weight: 800; letter-spacing: -.045em; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.line-title-text small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.line-panel-controls { flex: none; }
.line-controls { display: flex; align-items: center; gap: 8px; }
.line-view-mode-switch, .display-mode-switch { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.line-view-mode-btn, .display-mode-btn { flex: 1; padding: 7px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.line-view-mode-btn.active, .display-mode-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(16, 24, 40, .14); }
html[data-app-theme="dark"] .line-view-mode-btn.active, html[data-app-theme="dark"] .display-mode-btn.active { background: var(--surface-3); }
.theme-toggle-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2); font-size: 16px; line-height: 1; cursor: pointer; box-shadow: var(--shadow-1); }

.line-panel.horizontal-mode { margin: 0 0 16px; }
.line-panel.horizontal-mode .line-header { position: sticky; top: var(--app-header-height, 60px); z-index: 15; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

.refresh-hint { display: flex; align-items: flex-start; gap: 8px; margin: 0 16px 10px; padding: 9px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.refresh-hint::before { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--success); content: ''; animation: blink 1.6s ease-in-out infinite; }
.refresh-hint.stale { border-color: var(--danger); color: var(--danger); }
.refresh-hint.stale::before { background: var(--danger); }
/* 비로그인 저장 안내는 짧게 노출되므로 작은 보조문구보다 한 단계 크게 읽히게 한다. */
.guest-selection-hint { margin: -4px 16px 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; font-weight: 700; line-height: 1.55; text-align: center; }
.guest-selection-hint::before { content: 'ⓘ '; color: var(--primary); }
.saved-shortcuts + .line-header { padding-top: 2px; }
.line-panel > .saved-shortcuts { padding-top: 2px; }

/* 가로 보드 — 색은 변수로 한 번만 정의하고 다크/라이트에서 바꾼다 */
.horizontal-line-view { padding: 0 16px; }
.horizontal-board { --bd-bg: var(--surface); --bd-fg: var(--ink); --bd-mute: var(--muted); --bd-line: var(--line); --bd-node: var(--surface); overflow: hidden; border: 1px solid var(--bd-line); border-radius: var(--r-lg); background: var(--bd-bg); color: var(--bd-fg); box-shadow: var(--shadow-1); }
.horizontal-board[data-board-theme="dark"] { --bd-bg: #0f1729; --bd-fg: #eef3fc; --bd-mute: #8d9bb5; --bd-line: rgba(255, 255, 255, .08); --bd-node: #0f1729; box-shadow: var(--shadow-2); }
.horizontal-board[data-board-theme="light"] { --bd-bg: #ffffff; --bd-fg: #111827; --bd-mute: #667085; --bd-line: #e4e8ef; --bd-node: #ffffff; }
.display-board-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; }
.display-live { display: inline-flex; align-items: center; gap: 8px; color: var(--bd-mute); font-size: 12.5px; font-weight: 600; }
.display-live i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #34d399; }
.display-live i::after { position: absolute; inset: -4px; border-radius: 50%; background: #34d399; content: ''; opacity: .35; animation: pulse 1.8s ease-out infinite; }
.display-route-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--bd-line) transparent; -webkit-overflow-scrolling: touch; }
.display-route-lane { position: relative; display: flex; align-items: flex-start; min-width: max-content; border-top: 1px solid var(--bd-line); }
.display-route-lane > strong { position: sticky; left: 0; z-index: 6; display: flex; align-items: center; justify-content: center; flex: none; width: 54px; height: 100px; background: linear-gradient(90deg, var(--bd-bg) 78%, transparent); color: var(--bd-mute); font-size: 12px; font-weight: 800; letter-spacing: -.02em; }
.display-route-content { min-width: max-content; }
.display-route-line { position: relative; display: flex; align-items: flex-start; min-width: max-content; padding: 46px 20px 16px 0; }
.display-route-line::before { position: absolute; top: 53px; right: 20px; left: 0; height: 4px; border-radius: 2px; background: var(--display-line); content: ''; }
.display-track-station { position: relative; z-index: 1; display: flex; flex: 0 0 78px; width: 78px; flex-direction: column; align-items: center; color: var(--bd-fg); font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; white-space: nowrap; }
.display-track-station i { display: block; width: 14px; height: 14px; margin: 0; border: 3.5px solid var(--display-line); border-radius: 50%; background: var(--bd-node); }
.display-track-station b { display: block; margin-top: 7px; padding: 2px 6px; border-radius: 999px; font-weight: inherit; }
.display-track-station.is-selected i { transform: scale(1.35); background: var(--display-line); box-shadow: 0 0 0 3px var(--bd-bg), 0 0 0 5px var(--display-line); }
.display-track-station.is-selected b { background: var(--bd-fg); color: var(--bd-bg); font-weight: 800; }
.display-train-marker { position: absolute; z-index: 3; display: flex; align-items: center; justify-content: center; width: 68px; height: 30px; color: #fff; cursor: pointer; transform: translateX(-50%); transition: left 1.2s ease-out; }
.display-train-marker:focus-visible { outline-offset: -2px; border-radius: 15px; }
.display-train-icon { position: relative; display: block; width: 48px; height: 25px; border: 2.5px solid var(--bd-bg); border-radius: 13px; background: var(--display-line); box-shadow: 0 0 0 1.5px var(--display-line), 0 3px 10px rgba(0, 0, 0, .3); }
/* 노선 배열은 좌→우로 하행 종점(예: 경의중앙선 용문)을 향하므로, 하행 열차 앞은 오른쪽이다. */
.display-train-icon-up { animation: nudge-l 1.4s ease-in-out infinite; }
.display-train-icon-down { animation: nudge-r 1.4s ease-in-out infinite; }
@keyframes nudge-r { 50% { transform: translateX(3px); } }
@keyframes nudge-l { 50% { transform: translateX(-3px); } }
.display-train-icon::after { position: absolute; top: 50%; width: 0; height: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; content: ''; }
.display-train-icon-up::after { left: -11px; border-right: 7px solid var(--bd-fg); }
.display-train-icon-down::after { right: -11px; border-left: 7px solid var(--bd-fg); }
.display-train-window { position: absolute; top: 4px; width: 15px; height: 8px; border-radius: 3px; background: rgba(255, 255, 255, .85); }
.display-train-icon-up .display-train-window { left: 6px; }
.display-train-icon-down .display-train-window { right: 6px; }
.display-train-headlight, .display-train-wheel { display: none; }
.display-train-accordion { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 16px; border: 0; border-top: 1px solid var(--bd-line); background: transparent; color: var(--bd-fg); font-size: 13.5px; font-weight: 700; text-align: left; cursor: pointer; }
.display-train-accordion-label { display: inline-flex; align-items: center; gap: 9px; }
.display-train-chevron { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bd-line); color: var(--bd-mute); font-size: 15px; line-height: 1; transition: transform .2s ease; }
.display-train-accordion[aria-expanded="true"] .display-train-chevron { transform: rotate(180deg); }
.display-train-count { padding: 3px 10px; border-radius: 999px; background: var(--bd-line); color: var(--bd-mute); font-size: 12px; font-weight: 700; }
.display-refresh-message { display: none; } /* 위 LIVE 표시와 아래 안내 문구가 같은 내용이라 숨긴다 */
.display-refresh-message i { width: 5px; height: 5px; border-radius: 50%; background: #34d399; }
.display-train-list { padding: 2px 16px 12px; overflow-x: auto; border-top: 1px solid var(--bd-line); }
.display-train-list[hidden] { display: none !important; }
.display-train-row { display: grid; grid-template-columns: 24px minmax(0, 1.15fr) 38px minmax(0, 1fr) 56px; align-items: center; gap: 8px; min-height: 52px; border-bottom: 1px solid var(--bd-line); }
.display-train-row:last-child { border-bottom: 0; }
.display-train-number { color: var(--bd-mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.display-train-station { overflow: hidden; color: var(--bd-fg); font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.display-train-direction { overflow: hidden; color: var(--bd-mute); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.display-train-destination { overflow: hidden; color: var(--bd-fg); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.display-train-no { color: var(--bd-mute); font-size: 11px; text-align: right; }
.display-empty { padding: 30px 8px; color: var(--bd-mute); font-size: 13.5px; text-align: center; }
.display-train-marker.is-held, .line-diagram-train.is-held { opacity: .4; filter: grayscale(.7); }

/* 세로 노선도 · 지도 · 열차 목록 */
.line-diagram-wrap { max-height: 64vh; margin: 0 16px 12px; padding: 14px 4px; overflow-x: hidden; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.line-diagram { position: relative; width: 100%; }
.line-diagram-track { position: absolute; top: 0; width: 6px; border-radius: 3px; opacity: .92; transform: translateX(-50%); }
.line-diagram-station { position: absolute; left: 0; z-index: 1; width: 16px; height: 16px; border: 4px solid var(--subtle); border-radius: 50%; background: var(--surface); cursor: pointer; transform: translate(-50%, -50%); }
.line-diagram-station.selected-station-marker { z-index: 5; width: 22px; height: 22px; border-color: var(--surface) !important; background: var(--station-highlight, var(--primary)); box-shadow: 0 0 0 3px var(--station-highlight, var(--primary)), 0 3px 9px rgba(0, 0, 0, .3); }
.line-diagram-label { position: absolute; top: 0; left: 0; color: var(--ink); font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; cursor: pointer; transform: translate(-50%, -50%); }
.line-diagram-label.my-station { z-index: 3; padding: 4px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 800; box-shadow: 0 3px 10px rgba(47, 107, 255, .35); }
.line-diagram-label.selected-station { z-index: 4; padding: 5px 11px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 800; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.line-diagram-label.my-station.selected-station { background: var(--primary); color: #fff; }
.line-diagram-train { position: absolute; top: 0; left: 0; z-index: 2; cursor: pointer; transform: translate(-50%, -50%); }
.line-diagram-train-car { position: relative; width: 26px; height: 38px; border: 2.5px solid var(--surface); border-radius: 11px; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.line-diagram-train-car-up { animation: nudge-u 1.4s ease-in-out infinite; }
.line-diagram-train-car-down { animation: nudge-d 1.4s ease-in-out infinite; }
@keyframes nudge-u { 50% { transform: translateY(-3px); } }
@keyframes nudge-d { 50% { transform: translateY(3px); } }
.line-diagram-train-car::after { position: absolute; left: 50%; width: 0; height: 0; border-right: 6px solid transparent; border-left: 6px solid transparent; content: ''; transform: translateX(-50%); }
.line-diagram-train-car-up::after { top: -9px; border-bottom: 8px solid var(--ink); }
.line-diagram-train-car-down::after { bottom: -9px; border-top: 8px solid var(--ink); }
.line-diagram-train-car .display-train-window { top: 7px; left: 50%; width: 12px; height: 17px; border-radius: 4px; transform: translateX(-50%); }
.show-all-btn { display: block; width: calc(100% - 32px); margin: 0 16px 8px; }
#linePanelBody { margin: 0 16px; padding: 4px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.train-row { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.train-row:last-child { border-bottom: 0; }
.train-row.is-held { opacity: .6; }
.train-station { flex: 1; font-weight: 700; }
.train-no { color: var(--subtle); font-size: 12px; }
.train-held-tag { margin-left: 6px; color: var(--muted); font-size: 11.5px; font-style: normal; font-weight: 500; }

/* ---- 8. 홈 섹션(저장한 노선·즐겨찾기·빈 상태) --------------------------------------- */
.section { padding: 8px 16px 16px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.section-title > span { flex: 1; }
.main-lines-section { margin: 8px 16px 0; padding: 14px 0 6px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.main-lines-section .section-title { padding: 0 16px; }
.station-card { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); cursor: pointer; transition: transform .12s ease; }
.station-card:active { transform: scale(.985); }
.station-name { font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.station-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.empty-state { padding: 64px 24px; color: var(--muted); font-size: 14px; line-height: 1.7; text-align: center; }
.empty-state::before { display: block; margin-bottom: 12px; font-size: 44px; line-height: 1; content: '🚇'; }

/* ---- 9. 사이드 메뉴 --------------------------------------------------------- */
.side-menu-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(8, 13, 24, .52); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.side-menu { position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; display: flex; flex-direction: column; width: min(88vw, 372px); overflow-y: auto; background: var(--bg); visibility: hidden; transform: translateX(102%); transition: transform .26s cubic-bezier(.2, .8, .25, 1), visibility 0s .26s; overscroll-behavior: contain; }
.side-menu.open { visibility: visible; box-shadow: -18px 0 48px rgba(0, 0, 0, .28); transform: none; transition-delay: 0s; }
.side-menu-header { padding: calc(14px + env(safe-area-inset-top)) 18px 18px; background: linear-gradient(155deg, #1d3a99 0%, #3563e9 55%, #5b6dff 100%); color: #fff; }
html[data-app-theme="dark"] .side-menu-header { background: linear-gradient(155deg, #16265f 0%, #234199 60%, #3a4fc9 100%); }
.side-menu-header-row { display: flex; align-items: center; gap: 10px; }
.side-menu-profile { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.avatar svg { width: 27px; height: 27px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.profile-text { display: flex; flex-direction: column; min-width: 0; }
.profile-text strong { overflow: hidden; font-size: 17px; font-weight: 800; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.profile-text span { margin-top: 2px; color: rgba(255, 255, 255, .78); font-size: 12px; line-height: 1.4; }
.side-menu-header .theme-toggle-btn, .side-menu-header .close-btn { width: 38px; height: 38px; margin: 0; border: 0; background: rgba(255, 255, 255, .18); color: #fff; box-shadow: none; }
.side-menu-header .close-btn { font-size: 24px; }
.side-menu-login { margin-top: 16px; }
.login-btn { width: 100%; padding: 13px 18px; border: 0; border-radius: var(--r-md); background: #fff; color: #1d3a99; font-size: 15px; font-weight: 800; cursor: pointer; }
.login-btn.is-logout { background: rgba(255, 255, 255, .18); color: #fff; }
.login-form { margin-top: 10px; padding: 12px; border-radius: var(--r-md); background: rgba(255, 255, 255, .16); }
.login-input { width: 100%; margin-bottom: 8px; padding: 13px 14px; border: 0; border-radius: 12px; outline: none; background: rgba(255, 255, 255, .96); color: #111827; font-size: 15px; }
.login-input:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.login-submit { width: 100%; background: #111d4a; color: #fff; }
.login-register-toggle { display:flex; align-items:center; justify-content:center; width:100%; min-height:38px; margin-top:8px; padding:9px 12px; appearance:none; -webkit-appearance:none; border:1px solid color-mix(in srgb, var(--primary) 38%, var(--line)); border-radius:10px; background:var(--primary-soft); color:var(--primary-strong); cursor:pointer; font:inherit; font-size:12.5px; font-weight:800; line-height:1.2; text-decoration:none; transition:transform .12s ease, background-color .15s ease; }
.login-register-toggle:hover { background:color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 10%); }
.login-register-toggle:active { transform:scale(.98); }
.login-register-toggle:focus-visible { outline:3px solid color-mix(in srgb, var(--primary) 30%, transparent); outline-offset:2px; }
#registerFields { margin-top:10px; }
.register-fields-title { margin:2px 0 3px; color:#172033; font-size:14px; font-weight:850; }.register-fields-help { margin:0 0 10px; color:#64748b; font-size:11.5px; line-height:1.5; }
.register-id-hint { min-height:16px; margin:-4px 2px 8px; color:#64748b; font-size:11.5px; line-height:1.4; }.register-id-hint.is-available { color:#16875a; }.register-id-hint.is-unavailable { color:var(--danger, #df3f48); }
.register-id-row { display:flex; gap:7px; align-items:stretch; }.register-id-row .login-input { min-width:0; flex:1; }.register-id-row button { flex:none; min-width:72px; margin:0 0 8px; padding:0 9px; border:1px solid color-mix(in srgb, var(--primary) 38%, var(--line)); border-radius:10px; background:var(--primary-soft); color:var(--primary-strong); font:inherit; font-size:11.5px; font-weight:800; cursor:pointer; }.register-id-row button:disabled { opacity:.55; cursor:wait; }
.login-sns-divider { display:flex; align-items:center; gap:9px; margin:14px 0 9px; color:var(--muted); font-size:11px; }
.login-sns-divider::before,.login-sns-divider::after { content:''; flex:1; height:1px; background:var(--line); }
.login-sns-buttons { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:8px; }
.login-sns-btn { display:flex; align-items:center; justify-content:center; aspect-ratio:1; min-height:38px; border:1px solid var(--line); border-radius:50%; background:var(--surface); color:var(--ink); text-decoration:none; transition:transform .12s ease, box-shadow .15s ease; }
.login-sns-btn:hover { box-shadow:0 3px 9px rgba(15,23,42,.14); }.login-sns-btn:active { transform:scale(.94); }.login-sns-btn:focus-visible { outline:3px solid color-mix(in srgb, var(--primary) 30%, transparent); outline-offset:2px; }.login-sns-btn svg { width:18px; height:18px; fill:currentColor; }
.login-sns-btn.kakao { background:#fee500; border-color:#fee500; color:#191600; }.login-sns-btn.naver { background:#03c75a; border-color:#03c75a; color:#fff; }.login-sns-btn.google { color:#4285f4; }.login-sns-btn.facebook { background:#1877f2; border-color:#1877f2; color:#fff; }
.metro-auth-modal { position:fixed; inset:0; z-index:200; display:grid; place-items:center; padding:20px; overflow-y:auto; background:rgba(8,15,35,.58); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); }
.metro-auth-modal[hidden] { display:none; }
.metro-auth-card { position:relative; width:min(100%,400px); padding:30px; border:1px solid color-mix(in srgb, #fff 55%, transparent); border-radius:24px; background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(245,248,255,.98)); color:#172033; box-shadow:0 28px 80px rgba(5,12,30,.34); animation:metroAuthIn .2s ease-out; }
.metro-auth-brand { margin-bottom:22px; text-align:center; }.metro-auth-brand span { color:var(--primary); font-size:10px; font-weight:900; letter-spacing:.14em; }.metro-auth-brand h2 { margin:6px 0 5px; font-size:24px; letter-spacing:-.05em; }.metro-auth-brand p { margin:0; color:#64748b; font-size:12.5px; line-height:1.55; }.metro-auth-close { position:absolute; top:14px; right:14px; width:34px; height:34px; border:0; border-radius:50%; background:#eef2f8; color:#64748b; font-size:23px; line-height:1; cursor:pointer; }.metro-auth-close:hover { background:#e2e8f0; color:#172033; }
.metro-auth-card .login-input { border:1px solid #dbe2ed; background:#fff; color:#172033; }.metro-auth-card .login-input:focus { border-color:var(--primary); box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }.metro-auth-card .login-submit { min-height:44px; }.metro-auth-card .login-error { color:var(--danger, #df3f48); }.metro-auth-card .login-sns-divider { color:#94a3b8; }.metro-auth-card .login-sns-divider::before,.metro-auth-card .login-sns-divider::after { background:#e2e8f0; }
body.metro-auth-open { overflow:hidden; }
@keyframes metroAuthIn { from { opacity:0; transform:translateY(10px) scale(.98); } to { opacity:1; transform:none; } }
@media (max-width:420px) { .metro-auth-modal { padding:14px; align-items:end; }.metro-auth-card { padding:27px 20px 22px; border-radius:22px 22px 16px 16px; } }
.login-error { min-height: 18px; margin: 0 0 6px; color: #ffd0d3; font-size: 12.5px; }
.side-menu-body { display: flex; flex: 1; flex-direction: column; padding: 8px 14px calc(18px + env(safe-area-inset-bottom)); }
.side-menu-section-title { margin: 20px 6px 6px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.side-menu-info-title { margin-top: 24px; }
.side-menu-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px 8px; border: 0; border-radius: var(--r-md); background: none; color: var(--ink); font-size: 15.5px; font-weight: 600; text-align: left; cursor: pointer; }
.side-menu-item:active, .side-menu-item:hover { background: var(--surface-2); }
.mi-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.mi-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mi-label { flex: 1; }
.mi-chevron { color: var(--subtle); font-size: 22px; font-weight: 400; }
.main-line-settings, .layout-settings, .my-station-settings { margin: 4px 0 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.settings-hint { margin-bottom: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.layout-settings .display-mode-switch { display: flex; width: 100%; }
.layout-settings .display-mode-btn { flex: 1; padding: 9px 4px; font-size: 12px; }
.settings-save-btn { width: 100%; margin: 4px 0 8px; padding: 13px 12px; border: 0; border-radius: var(--r-md); background: var(--primary); color: #fff; font-size: 14.5px; font-weight: 800; cursor: pointer; }
.settings-save-btn:active { transform: scale(.98); }
/* 메인 노선 설정만 동일 폭의 그리드로 배치해 메뉴 너비를 고르게 채운다. */
#mainLineSettingsList { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
#mainLineSettingsList .line-setting-row { min-width: 0; min-height: 44px; padding: 5px; border: 1px solid var(--line); border-radius: var(--r-md); }
#mainLineSettingsList .line-setting-label { display: flex; flex: 1; align-items: center; justify-content: center; min-width: 0; padding: 7px 6px; text-align: center; }
#mainLineSettingsList .line-setting-check { flex: none; margin-left: 4px; }
.line-setting-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 46px; padding: 5px 2px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.line-setting-label { display: inline-block; padding: 7px 14px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 800; }
.line-setting-row[data-line="경의중앙선"] .line-setting-label, .line-setting-row[data-line="수인분당선"] .line-setting-label, .line-setting-row[data-line="우이신설선"] .line-setting-label, .line-setting-row[data-line="서해선"] .line-setting-label { color: #141821; }
.line-setting-check { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1.5px solid var(--surface-3); border-radius: 50%; color: transparent; font-size: 13px; font-weight: 800; }
.line-setting-row.selected .line-setting-check { border-color: var(--primary); background: var(--primary); color: #fff; }
.station-line-picker { display: flex; gap: 6px; margin-bottom: 12px; padding-bottom: 3px; overflow-x: auto; scrollbar-width: none; }
.station-line-picker::-webkit-scrollbar { display: none; }
.station-line-choice { flex: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.station-line-choice.active { border-color: var(--station-line-color); background: var(--station-line-color); color: #fff; }
.station-line-choice.active[style*="fabe00"], .station-line-choice.active[style*="suin-bundang"] { color: #141821; }
.station-list-title { margin: 3px 0 8px; color: var(--ink); font-size: 13.5px; font-weight: 800; }
.station-picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 280px; margin-bottom: 12px; overflow-y: auto; }
.station-picker-item { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 13px; text-align: left; cursor: pointer; }
.station-picker-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-picker-item.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.station-picker-check { color: transparent; font-size: 13px; font-weight: 900; }
.station-picker-item.selected .station-picker-check { color: var(--primary); }
.station-picker-empty { grid-column: 1 / -1; padding: 22px 8px; color: var(--muted); font-size: 12.5px; text-align: center; }
.my-station-modal { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); color: var(--ink); }
.my-station-modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(12px + env(safe-area-inset-top)) 18px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.my-station-modal-header > div > span { color: var(--primary); font-size: 10.5px; font-weight: 800; letter-spacing: .12em; }
.my-station-modal-header h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.045em; }
.my-station-modal-content { max-width: 760px; margin: 0 auto; padding: 20px 16px calc(30px + env(safe-area-inset-bottom)); }
.my-station-modal .station-picker-list { max-height: none; min-height: 220px; }
.my-station-selected { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; margin: 0 0 16px; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); font-size: 12.5px; }
.my-station-selected strong { margin-right: 4px; color: var(--ink); font-size: 12.5px; }
.my-station-selected button { padding: 6px 9px; border: 0; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 800; cursor: pointer; }
.my-station-selected button span { margin-left: 3px; font-size: 14px; line-height: 0; }
/* 노선과 역을 한 흐름으로 고를 수 있는 전체 화면 즐겨찾기 설정이다. */
.favorite-settings-intro { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; font-weight: 600; line-height: 1.6; }
.favorite-settings-card { margin: 0 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.favorite-settings-card-head { margin-bottom: 14px; }
.favorite-settings-card-head > div { display: flex; align-items: center; gap: 8px; }
.favorite-settings-card-head span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 900; }
.favorite-settings-card h3 { margin: 0; font-size: 16px; letter-spacing: -.035em; }
.favorite-settings-card p { margin: 6px 0 0 32px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.favorite-settings-card #mainLineSettingsList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.favorite-settings-card #mainLineSettingsList .line-setting-row { min-width: 0; min-height: 44px; padding: 5px; border: 1px solid var(--line); border-radius: var(--r-md); }
.favorite-settings-card #mainLineSettingsList .line-setting-label { display: flex; flex: 1; align-items: center; justify-content: center; min-width: 0; padding: 7px 6px; text-align: center; }
/* 혼잡도·승강기 각각의 노출 상태를 한 줄에서 읽고 즉시 바꿀 수 있게 한다. */
.info-visibility-card { padding: 0; overflow: hidden; }
.info-visibility-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; padding: 16px; cursor: pointer; }
.info-visibility-row + .info-visibility-row { border-top: 1px solid var(--line); }
.info-visibility-row > span { min-width: 0; }
.info-visibility-row strong, .info-visibility-row small { display: block; }
.info-visibility-row strong { color: var(--ink); font-size: 15px; letter-spacing: -.025em; }
.info-visibility-row small { margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.info-visibility-row input { position: relative; flex: 0 0 auto; width: 46px; height: 27px; margin: 0; appearance: none; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background .18s ease; }
.info-visibility-row input::after { position: absolute; top: 4px; left: 4px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ''; transition: transform .18s ease; }
.info-visibility-row input:checked { background: var(--primary); }
.info-visibility-row input:checked::after { transform: translateX(19px); }
.info-visibility-row input:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent); outline-offset: 3px; }
.favorite-settings-save { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 8px); margin: 0; box-shadow: 0 8px 20px rgba(47, 107, 255, .28); }
.my-station-quick { display: flex; align-items: center; gap: 6px; padding: 0 16px 5px; overflow-x: auto; scrollbar-width: none; }
.my-station-quick::-webkit-scrollbar { display: none; }
.my-station-manage-btn, .my-station-quick-btn { flex: 0 0 auto; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 750; cursor: pointer; }
.my-station-manage-btn { border-color: var(--primary); background: var(--primary); color: #fff; }
.my-station-quick-btn:active, .my-station-manage-btn:active { transform: scale(.96); }
/* 사이드 메뉴 통계는 한 화면 안에서 빠르게 읽을 수 있도록 compact iframe만 사용한다. */
.visitor-stats-view { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.visitor-stats-view iframe { display: block; width: 100%; height: 218px; border: 0; background: transparent; }
.side-menu-app-info { margin-top: auto; margin-bottom: 0; padding-top: 14px; }
.side-menu-dev { margin-top: auto; }
.side-menu-dev ~ .side-menu-app-info { margin-top: 0; padding-top: 11px; }

/* ---- 10. 앱 소개 ------------------------------------------------------------ */
.app-info-overlay { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); color: var(--ink); }
.app-info-header { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.app-info-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 760px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 18px 12px; }
.app-info-eyebrow { color: var(--primary); font-size: 10.5px; font-weight: 800; letter-spacing: .12em; }
.app-info-header h2 { margin: 3px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.045em; }
.app-info-close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.app-info-content { max-width: 760px; margin: 0 auto; padding: 20px 16px 56px; }
.app-info-hero { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: 24px; background: linear-gradient(135deg, #2a5bff, #6a4cff); color: #fff; box-shadow: 0 12px 30px rgba(63, 90, 255, .32); }
.app-info-hero-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; border-radius: 17px; background: rgba(255, 255, 255, .2); color: #fff; font-size: 28px; }
.app-info-hero strong { font-size: 18px; letter-spacing: -.04em; }
.app-info-hero p { margin: 6px 0 0; color: rgba(255, 255, 255, .85); font-size: 13.5px; line-height: 1.6; }
.app-info-section { margin-top: 32px; }
.app-info-section-label { color: var(--primary); font-size: 10.5px; font-weight: 800; letter-spacing: .14em; }
.app-info-section h3 { margin: 5px 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -.05em; }
.app-info-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.app-info-feature { padding: 17px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.app-info-feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 19px; font-weight: 800; }
.app-info-feature h4 { margin: 0; font-size: 15px; font-weight: 800; }
.app-info-feature p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.app-info-steps ol { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; counter-reset: app-step; }
.app-info-steps li { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.app-info-steps li::before { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; content: counter(app-step); counter-increment: app-step; font-size: 13px; font-weight: 800; grid-row: span 2; }
.app-info-steps li b { font-size: 14px; }
.app-info-steps li span { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.app-info-footer-note { margin-top: 28px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.65; }

/* 헤더 아래 전용 화면에서 공식 전체 노선도를 한 화면에 맞춰 표시한다. */
.full-subway-map-view { position: fixed; inset: var(--app-header-height, 60px) 0 0; z-index: 19; overflow-y: auto; background: var(--bg); color: var(--ink); }
/* 역 선택 모달은 부모 쌓임 맥락까지 올려 공용 헤더에 가려지지 않게 한다. */
.full-subway-map-view.station-modal-open { z-index: 61; }
.full-subway-map-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.full-subway-map-header > div > span { color: var(--primary); font-size: 10.5px; font-weight: 800; letter-spacing: .12em; }
.full-subway-map-header h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.045em; }
.full-subway-map-content { max-width: 1080px; margin: 0 auto; padding: 14px 12px calc(24px + env(safe-area-inset-bottom)); }
.full-subway-map-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-bottom: 10px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.full-subway-map-meta strong { color: var(--ink); font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* 전체 노선도는 정적 이미지가 아닌 현재 역·노선 데이터로 그린다. */
.metro-route-planner { margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.metro-map-search { width: 100%; height: 40px; margin-bottom: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; }
.metro-route-selection { display: flex; flex-wrap: wrap; gap: 7px; }
.metro-route-chip { display: inline-flex; align-items: center; gap: 5px; min-width: 0; padding: 7px 9px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.metro-route-chip b { overflow: hidden; max-width: 105px; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.metro-station-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.metro-station-name { flex: 1 0 100%; color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.035em; }
.metro-action-btn { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 800; cursor: pointer; }
.metro-action-btn.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.metro-route-result { margin-top: 10px; }
.metro-route-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.metro-route-option { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; }
.metro-route-option.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.metro-route-option span, .metro-route-option b { display: block; }
.metro-route-option span { color: var(--muted); font-size: 11px; font-weight: 700; }
.metro-route-option b { margin-top: 2px; font-size: 14px; }
.metro-route-detail { margin: 9px 1px 0; color: var(--ink-2); font-size: 12.5px; font-weight: 600; line-height: 1.55; }
.metro-route-builder { padding: 5px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.metro-route-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.metro-route-column { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.metro-route-column h3 { margin: 0; padding: 11px 9px 3px; color: var(--primary); font-size: 15px; }
.metro-route-column.end h3 { color: var(--danger); }
.metro-route-column > p { min-height: 38px; margin: 0; padding: 0 9px 9px; color: var(--ink); font-size: 12.5px; font-weight: 800; line-height: 1.35; }
/* 출발·도착이 정해지면 긴 호선 목록 대신 선택한 역 버튼만 남긴다. */
.metro-route-column.selected-only h3 { display: none; }
.metro-route-column.selected-only > p { min-height: 0; padding: 5px; }
.metro-builder-selected { display: flex; align-items: center; width: 100%; min-height: 44px; gap: 7px; padding: 7px 8px; border: 1.5px solid var(--metro-builder-line); border-radius: 9px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.metro-builder-selected span { flex: none; padding: 3px 5px; border-radius: 6px; background: var(--metro-builder-line); color: #fff; font-size: 10px; font-weight: 900; }
.metro-builder-selected strong { overflow: hidden; font-size: 14px; font-weight: 900; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.metro-builder-lines { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; max-height: 330px; padding: 7px; overflow-y: auto; border-top: 1px solid var(--line); }
.metro-builder-line { width: 100%; min-width: 0; height: 38px; padding: 0 8px; border: 1.5px solid var(--metro-builder-line); border-radius: 9px; background: var(--surface); color: var(--metro-builder-line); font-size: 13px; font-weight: 800; cursor: pointer; overflow: visible; text-overflow: clip; white-space: nowrap; }
.metro-builder-line.active { background: var(--metro-builder-line); color: #fff; }
.metro-builder-stations { display: flex; flex-direction: column; gap: 5px; max-height: 280px; padding: 8px; overflow-y: auto; border-top: 1px solid var(--line); }
.metro-builder-station { width: 100%; min-height: 35px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }
.metro-builder-station.active { border-color: var(--metro-builder-line); background: color-mix(in srgb, var(--metro-builder-line) 14%, var(--surface)); color: var(--metro-builder-line); font-weight: 900; }
.metro-builder-empty { margin: auto; padding: 24px 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; text-align: center; }
.metro-simple-result { margin-top: 12px; }
/* 경로 선택 뒤에는 출발·도착과 환승 흐름을 한 장의 여정 카드로 읽을 수 있게 한다. */
.metro-simple-result .metro-route-options { gap: 6px; padding: 5px; border-radius: 16px; background: var(--surface-2); }
.metro-simple-result .metro-route-option { min-height: 68px; padding: 10px 11px; border-color: transparent; border-radius: 12px; background: transparent; }
.metro-simple-result .metro-route-option.active { border-color: color-mix(in srgb, var(--primary) 36%, var(--line)); background: var(--surface); box-shadow: var(--shadow-1); }
.metro-simple-result .metro-route-option span { font-size: 11px; }
.metro-simple-result .metro-route-option b { font-size: 16px; letter-spacing: -.03em; }
.metro-simple-result .metro-route-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.metro-journey-card { margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1); }
.metro-journey-scroll { overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.metro-journey-track { display: flex; align-items: center; width: max-content; min-width: 100%; padding: 31px 15px 20px; }
/* 출발·도착·환승을 실제 역 표식처럼 둥근 이름표로 표시한다. */
.metro-journey-node { display: grid; place-content: center; flex: 0 0 76px; width: 76px; height: 76px; padding: 7px; border: 4px solid var(--metro-journey-node-line, var(--ink)); border-radius: 50%; background: var(--surface); color: var(--metro-journey-node-line, var(--ink)); text-align: center; box-shadow: 0 2px 7px color-mix(in srgb, var(--ink) 12%, transparent); }
.metro-journey-node span { margin-bottom: 3px; font-size: 10px; font-weight: 900; line-height: 1; }
.metro-journey-node strong { overflow: hidden; max-width: 62px; color: var(--ink); font-size: 13px; font-weight: 900; letter-spacing: -.055em; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.metro-journey-node.transfer { --metro-journey-node-line: var(--ink); border-style: double; }
.metro-journey-node.transfer span { color: var(--muted); }
.metro-journey-segment { position: relative; flex: 0 0 82px; width: 82px; height: 6px; background: var(--metro-journey-line); }
.metro-journey-segment b { position: absolute; top: -22px; left: 50%; padding: 3px 6px; border-radius: 999px; background: var(--metro-journey-line); color: #fff; font-size: 10px; line-height: 1; transform: translateX(-50%); white-space: nowrap; }
.metro-journey-segment i { display: none; }
.metro-journey-summary { display: flex; flex-wrap: wrap; gap: 5px 12px; align-items: center; padding: 11px 15px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.metro-journey-summary b { color: var(--primary); font-size: 17px; letter-spacing: -.035em; }
.metro-station-modal { position: fixed; inset: 0; z-index: 60; display: flex; height: 100dvh; flex-direction: column; padding: 0; overflow: hidden; background: var(--surface); }
.metro-station-modal[hidden] { display: none !important; }
.metro-station-modal-head, .metro-station-modal-list { width: 100%; margin: 0; background: var(--surface); }
/* 전체 화면 모달에서는 헤더까지 덮고, 역 목록만 내부에서 스크롤한다. */
.metro-station-modal-head { display: flex; flex: none; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid var(--line); }
.metro-station-modal-head span { color: var(--primary); font-size: 11px; font-weight: 800; }
.metro-station-modal-head h3 { margin: 3px 0 0; color: var(--ink); font-size: 19px; }
.metro-station-modal-actions { display: flex; align-items: center; gap: 8px; }
.metro-station-modal-head button { height: 36px; border: 0; cursor: pointer; }
.metro-station-modal-head #metroStationModalSort { padding: 0 11px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 800; }
.metro-station-modal-head #metroStationModalClose { width: 36px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 24px; }
.metro-station-modal-list { display: grid; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 7px; min-height: 0; max-height: none; padding: 12px 12px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.metro-modal-station { min-height: 44px; padding: 7px; border: 1.5px solid var(--metro-builder-line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 800; cursor: pointer; }
.metro-route-diagram { display: grid; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.metro-route-segment { min-width: 0; }
.metro-route-segment > strong { display: inline-flex; margin-bottom: 6px; padding: 3px 7px; border-radius: 999px; background: var(--metro-route-line); color: #fff; font-size: 11px; }
.metro-route-segment > div { position: relative; display: flex; gap: 0; padding: 13px 4px 2px; overflow-x: auto; scrollbar-width: thin; }
.metro-route-segment > div::before { position: absolute; top: 19px; right: 16px; left: 16px; height: 4px; border-radius: 4px; background: var(--metro-route-line); content: ''; }
.metro-route-segment span { position: relative; z-index: 1; display: flex; flex: 0 0 66px; flex-direction: column; align-items: center; color: var(--ink); font-size: 10.5px; font-weight: 700; line-height: 1.25; text-align: center; }
.metro-route-segment span::before { width: 12px; height: 12px; margin-bottom: 6px; border: 3px solid var(--metro-route-line); border-radius: 50%; background: var(--surface-2); box-sizing: border-box; content: ''; }
.metro-route-transfer { justify-self: center; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 10.5px; font-weight: 800; }
.metro-interactive-map { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.metro-map-lines { display: flex; gap: 7px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.metro-map-lines::-webkit-scrollbar { display: none; }
.metro-map-line-btn { flex: 0 0 auto; min-height: 34px; padding: 0 11px; border: 2px solid var(--metro-picker-line); border-radius: 999px; background: var(--surface); color: var(--metro-picker-line); font-size: 12px; font-weight: 800; cursor: pointer; }
.metro-map-line-btn.active { background: var(--metro-picker-line); color: #fff; }
.metro-map-stage { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.metro-map-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.metro-map-stage-head strong { color: var(--ink); font-size: 15px; }
.metro-map-stage-head span { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.metro-map-stations { position: relative; display: flex; min-height: 112px; padding: 42px 12px 14px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.metro-map-stations::before { position: absolute; top: 54px; right: 28px; left: 28px; height: 5px; border-radius: 5px; background: var(--metro-picker-line, var(--primary)); content: ''; }
.metro-map-station-btn { position: relative; z-index: 1; display: flex; flex: 0 0 76px; width: 76px; flex-direction: column; align-items: center; gap: 8px; padding: 0 4px; border: 0; background: transparent; color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.25; text-align: center; cursor: pointer; }
.metro-map-station-btn::before { width: 17px; height: 17px; border: 4px solid var(--metro-picker-line); border-radius: 50%; background: var(--surface-2); box-sizing: border-box; content: ''; }
.metro-map-station-btn.active::before { background: var(--metro-picker-line); box-shadow: 0 0 0 4px color-mix(in srgb, var(--metro-picker-line) 23%, transparent); }
.metro-map-station-btn.active { color: var(--metro-picker-line); font-weight: 900; }
.metro-network-map { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-1); }
.metro-network-canvas { min-width: 0; min-height: 0; }
/* 모바일 iframe 빈 화면을 피하고, 공식 원본 지도와 공식 탐색 링크를 분리한다. */
.official-route-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; margin: 0 0 12px; padding: 13px 14px; border: 1px solid var(--primary); border-radius: var(--r-lg); background: var(--primary-soft); color: var(--ink); text-decoration: none; }
.official-route-link strong { font-size: 14px; }
.official-route-link span { grid-column: 1; color: var(--ink-2); font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.official-route-link b { grid-column: 2; grid-row: 1 / span 2; color: var(--primary); font-size: 28px; font-weight: 400; }
.official-subway-map-image { display: block; width: 100%; height: auto; background: #fff; }
.metro-network-svg { display: block; width: 100%; min-width: 760px; height: auto; background: radial-gradient(circle at 50% 50%, #fff 0, #f2f5fb 78%); }
.metro-line-path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 4.5; opacity: .78; }
.metro-station-node { cursor: pointer; }
.metro-station-node circle { fill: #fff; stroke: var(--metro-line, #6b7280); stroke-width: 3; transition: r .15s ease, fill .15s ease; }
.metro-station-node:hover circle, .metro-station-node:focus circle, .metro-station-node.is-active circle { fill: var(--metro-line, #6b7280); r: 7; outline: none; }
.metro-station-node.is-route circle { fill: #172033; stroke: #172033; }
.metro-station-node:focus { outline: none; }
.metro-station-node text { fill: #30394a; font-size: 11px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.metro-station-node.is-route text { fill: #111827; }
.full-subway-map-source { margin: 9px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

/* ---- 11. 세로 2열 배치(좌/우) — 화면 전체를 쓰는 앱 레이아웃 ------------------------------ */
/* 선택 역·도착 상세를 읽기 좋게 선택 패널 폭을 넓히고, 방향 선택 뒤의 노선도는 보조 폭으로 둔다. */
.app.vertical-layout { display: grid; grid-template-columns: minmax(180px, 52vw) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; height: calc(100dvh - var(--ad-h) - env(safe-area-inset-bottom)); min-height: 300px; max-width: none; padding-bottom: 0; }
.app.vertical-layout-right { grid-template-columns: minmax(0, 1fr) minmax(180px, 52vw); }
.vertical-layout .app-header { grid-column: 1 / -1; grid-row: 1; padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
.vertical-layout .app-tagline { display: none; }
.vertical-layout .app-logo { width: 34px; height: 34px; border-radius: 11px; }
.vertical-layout .app-title { font-size: 16px; }
.vertical-layout .line-selection-area { position: relative; display: grid; grid-column: 1; grid-row: 2; grid-template-rows: auto minmax(0, 1fr); min-height: 0; padding: 0; border-right: 1px solid var(--line); background: var(--surface); }
.vertical-layout-right .line-selection-area { grid-column: 2; border-right: 0; border-left: 1px solid var(--line); }
.vertical-layout .search-row { position: absolute; top: 6px; right: 6px; left: 6px; z-index: 13; margin: 0; padding: 0; }
.vertical-layout .search-suggest { position: absolute; top: 58px; right: 6px; left: 6px; z-index: 14; margin: 0; }
.vertical-layout .search-input { height: 42px; font-size: 14px; }
.vertical-layout .search-btn { display: none; }
.vertical-layout .line-chip-row { display: none; }
.vertical-layout .vertical-line-picker { position: relative; display: flex; grid-column: 1; grid-row: 1; align-items: center; gap: 6px; width: calc(100% - 12px); height: 42px; margin: 6px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--selected-line-color); color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; }
.vertical-layout .vertical-line-picker strong { min-width: 0; flex: 1; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.vertical-layout .vertical-line-picker i { font-style: normal; }
.vertical-layout .vertical-line-picker[data-line], .vertical-layout .vertical-line-picker { text-shadow: none; }
/* 세로 화면 첫 진입 시: 현재 호선 버튼을 눌러 다른 호선으로 바꿀 수 있음을 강하게 흔들어 알린다. */
.vertical-layout .vertical-line-picker.is-load-hint { animation: vertical-line-picker-shake 1.2s ease-out 1; }
@keyframes vertical-line-picker-shake { 0%, 100% { box-shadow: none; transform: translateX(0); } 10%, 30%, 50% { box-shadow: 0 0 0 3px rgba(255,255,255,.62), 0 5px 13px rgba(15,23,42,.24); transform: translateX(-9px) rotate(-1deg); } 20%, 40%, 60% { transform: translateX(9px) rotate(1deg); } 75% { transform: translateX(-3px); } 88% { transform: translateX(2px); } }
.vertical-layout .vertical-line-context { position: absolute; top: 54px; right: 6px; left: 6px; z-index: 12; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-height: calc(100dvh - 200px); padding: 8px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-2); }
.vertical-layout .vertical-line-option { min-width: 0; min-height: 40px; padding: 7px 10px; border: 2px solid transparent; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; }
.vertical-layout .vertical-line-option.active { border-color: var(--ring); }
.vertical-layout .line-station-picker { display: block; grid-column: 1; grid-row: 2; min-width: 0; margin: 0; padding: 6px; overflow-y: auto; }
.vertical-layout .line-station-picker { display: flex; flex-direction: column; }
/* 역 선택 완료 시에는 선택 역·도착 상세만 남기고, 기존 전체 역 목록을 가린다. */
.vertical-layout .line-station-picker.has-selected-station > .sel-bar,
.vertical-layout .line-station-picker.has-selected-station > .line-station-list,
.vertical-layout .line-station-picker.has-selected-station > .my-station-quick { display: none !important; }
.vertical-layout .my-station-quick { order: -1; flex-wrap: wrap; padding: 0 0 6px; overflow: visible; }
.vertical-layout .my-station-quick-btn, .vertical-layout .my-station-manage-btn { height: 30px; padding: 0 8px; border-radius: 9px; font-size: 11.5px; }
.vertical-layout .line-station-list { display: flex; flex-direction: column; gap: 6px; padding: 0; overflow: visible; }
.vertical-layout .line-station-btn { width: 100%; height: auto; min-height: 38px; padding: 8px 6px; border-radius: 10px; font-size: 12.5px; line-height: 1.3; white-space: normal; word-break: keep-all; }
.vertical-layout .station-name-break { display: block; }
.vertical-layout .app-content { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; overflow-y: auto; background: var(--bg); }
.vertical-layout-right .app-content { grid-column: 1; }
.vertical-layout .main-lines-section, .vertical-layout #favoritesSection, .vertical-layout #emptySection { display: none !important; }
.vertical-layout .line-panel { min-height: 100%; margin: 0; padding: 8px 6px; }
.vertical-layout .line-header { padding: 4px 4px 8px; }
.vertical-layout .line-title-text small { display: none; }
.vertical-layout .line-title-text strong { font-size: 14px; }
.vertical-layout .line-badge.lg { min-width: 34px; height: 34px; font-size: 15px; }
.vertical-layout .line-panel-controls { display: none; }
.vertical-layout .line-diagram-wrap { max-height: calc(100dvh - var(--ad-h) - 190px); margin: 0 0 8px; padding-right: 0; }
.vertical-layout .line-diagram-train-car { width: 22px; height: 32px; border-width: 2px; }
.vertical-layout .line-diagram-train-car .display-train-window { top: 6px; width: 10px; height: 14px; }
.vertical-layout .line-diagram-label { max-width: 78px; font-size: 11.5px; line-height: 1.15; white-space: normal; }
.vertical-layout .refresh-hint { margin: 0 0 8px; padding: 7px 9px; font-size: 10.5px; }
.vertical-layout .show-all-btn, .vertical-layout #linePanelBody { margin-right: 0; margin-left: 0; }
.vertical-layout .show-all-btn { width: 100%; }

/* ---- 12. 데스크톱 ------------------------------------------------------------ */
@media (min-width: 768px) {
    body { background: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--primary) 10%, var(--bg)) 0, var(--bg) 42%); }
    .app { max-width: 1080px; padding-bottom: 56px; }
    .app.vertical-layout { height: calc(100dvh - var(--ad-h)); }
    .app-header { padding-right: 32px; padding-left: 32px; }
    .search-row, .search-suggest { max-width: 640px; margin-right: auto; margin-left: auto; }
    .line-selection-area, .line-chip-row, .line-station-list { padding-right: 24px; padding-left: 24px; }
    .search-row { padding-right: 24px; padding-left: 24px; }
    .arrivals-panel, .main-lines-section, .section { max-width: 760px; margin-right: auto; margin-left: auto; }
    .line-panel { max-width: 920px; margin-right: auto; margin-left: auto; }
    .line-header, .refresh-hint, .line-diagram-wrap { margin-right: 16px; margin-left: 16px; }
    .line-chip-row { flex-wrap: wrap; overflow: visible; }
    .mobile-ad-slot { position: static; width: min(100% - 48px, 1080px); height: var(--ad-h); margin: 28px auto 0; border: 1px solid var(--line); border-radius: 14px; }
    .toast { bottom: 28px; }
    .side-menu { right: 0; width: min(400px, calc(100vw - 32px)); border-radius: 24px 0 0 24px; }
    .sheet { bottom: 24px; border-radius: 26px; }
}
@media (max-width: 380px) {
    .app-tagline { display: none; }
    .arrivals-station-name { font-size: 26px; }
    .arr-eta-main { font-size: 19px; }
    .line-chip { padding: 0 13px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.app-info-hero-icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.app-info-feature-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

#lineDiagramStatus { padding: 0 16px 10px !important; font-size: 12.5px; text-align: left; }
.vertical-layout #lineDiagramStatus { padding: 0 2px 8px !important; font-size: 11.5px; }

/* ---- 열차 번호판 (아이콘 안 작은 칩 — 목록의 열차번호와 같은 값) ---- */
.train-num { position: absolute; top: 50%; left: 50%; padding: 1px 5px; border-radius: 7px; background: rgba(0, 0, 0, .3); color: inherit; font: 800 10px/1.25 var(--font); letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; transform: translate(-50%, -50%); pointer-events: none; }
.train-num.long { padding: 1px 4px; font-size: 8.5px; letter-spacing: -.04em; }
[data-line="경의중앙선"] .train-num, [data-line="수인분당선"] .train-num, [data-line="우이신설선"] .train-num, [data-line="서해선"] .train-num { background: rgba(255, 255, 255, .55); }
.line-diagram-train { color: #fff; }
.line-diagram-train-car { width: 36px; height: 43px; }
.line-diagram-train-car .display-train-window { display: none; }
.vertical-layout .line-diagram-train-car { width: 31px; height: 41px; }
.vertical-layout .train-num { padding: 1px 3px; font-size: 9px; }
.vertical-layout .train-num.long { font-size: 7.5px; }
.display-train-marker:hover .display-train-icon, .line-diagram-train:hover .line-diagram-train-car { filter: brightness(1.08); }

/* 목록의 번호도 같은 번호판 톤으로 통일 + 아이콘을 눌렀을 때 해당 행 강조 */
.display-train-no, .train-no { justify-self: end; padding: 2px 8px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.display-train-list .display-train-no { background: var(--bd-line); color: var(--bd-fg); }
.display-train-row, .train-row { scroll-margin: 80px; }
.is-flash { animation: row-flash 1.8s ease; border-radius: 10px; }
@keyframes row-flash { 0%, 55% { background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); } 100% { background: transparent; box-shadow: 0 0 0 3px transparent; } }

/* ==========================================================================
   12b. 메인 가로보기 구역 분리 (2026-09-24)
   ① 호선 → ② 역 = 색이 다른 "선택 트레이" / 그 아래 = 흰 "실시간 카드"(헤더·선택한 역·LIVE 보드·안내)
   ========================================================================== */
.app:not(.vertical-layout) .line-selection-area { padding: 4px 0 0; background: transparent; }
.app:not(.vertical-layout) .sel-tray { --ring-gap: var(--tray); margin: 6px 12px 4px; padding: 9px 0 7px; border: 1px solid var(--line); border-radius: 24px; background: var(--tray); }
.sel-label { display: flex; align-items: baseline; gap: 8px; padding: 0 16px 3px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: -.01em; }
.sel-label em { margin-left: auto; color: var(--subtle); font-size: 11.5px; font-style: normal; font-weight: 600; }
.app:not(.vertical-layout) .sel-tray .line-chip-row { padding-top: 7px; padding-bottom: 6px; }
.app:not(.vertical-layout) .sel-tray .line-station-picker { margin: 2px 0 0; padding: 8px 0 0; border-top: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent); }
.app:not(.vertical-layout) .sel-tray .line-station-list { padding-bottom: 2px; }
.app:not(.vertical-layout) .sel-tray .line-chip.active { box-shadow: 0 0 0 2px var(--ring-gap), 0 0 0 4px var(--ring), 0 4px 12px rgba(0, 0, 0, .2); }
.app:not(.vertical-layout) .sel-tray .line-station-btn { border-color: transparent; background: var(--surface); box-shadow: var(--shadow-1); }
.app:not(.vertical-layout) .sel-tray .line-station-btn.active { background: var(--line-accent, var(--primary)); box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }

/* 실시간 카드 */
.line-panel.horizontal-mode { margin: 12px 12px 18px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-2); overflow: clip; }
.line-panel.horizontal-mode > .saved-shortcuts { padding: 12px 12px 0; }
.line-panel.horizontal-mode .line-header { position: sticky; top: var(--app-header-height, 60px); z-index: 15; margin: 0; padding: 14px 14px 10px 16px; background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.line-panel.horizontal-mode .line-title-text strong { font-size: 19px; }
.line-panel.horizontal-mode .line-badge.lg { min-width: 42px; height: 42px; font-size: 18px; }
.line-controls .theme-toggle-btn { display: none; } /* 앱 전체 테마와 통합됨(더보기 메뉴에서 변경) — 화면 복잡도 줄이기 */
.line-panel.horizontal-mode .horizontal-line-view { padding: 0 12px 4px; }
.line-panel.horizontal-mode .horizontal-board { box-shadow: none; }
/* LIVE 운행판은 앱 테마와 분리한 밝은 화면으로 고정해, 노선·열차·목록의 대비를 일정하게 유지한다. */
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] {
    --bd-bg: #f6f8fc;
    --bd-fg: #172033;
    --bd-mute: #526078;
    --bd-line: #dbe2ec;
    --bd-node: #fff;
    border-color: #dbe2ec;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] .display-route-lane { background: #fff; }
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] .display-train-accordion,
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] .display-train-list { background: #fbfcfe; }
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] .display-train-chevron,
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] .display-train-count { background: #e9eef5; color: #40516c; }
.line-panel.horizontal-mode .horizontal-board[data-board-theme="dark"] { border-color: transparent; }
/* LIVE 갱신 안내도 비로그인 저장 안내와 같은 읽기 크기·대비를 유지한다. */
.line-panel.horizontal-mode .refresh-hint { margin: 2px 16px 14px; padding: 9px 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; font-weight: 700; line-height: 1.55; }
.line-panel.horizontal-mode .guest-selection-hint { margin-top: -8px; }

/* 선택한 역 표시줄 — 위 선택 영역과 아래 보드를 이어 주는 한 줄 */
.selected-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 12px 10px; padding: 9px 10px 9px 12px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 12.5px; }
.selected-strip-main, .selected-strip-actions { display: contents; }
.selected-strip[hidden] { display: none; }
.selected-hint { line-height: 1.45; }
.selected-strip.has-station { border: 1px solid transparent; background: var(--primary-soft); color: var(--primary); }
.selected-pin { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--primary); color: #fff; }
.selected-pin svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.selected-text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.2; }
.selected-text small { color: var(--muted); font-size: 11px; font-weight: 600; }
.selected-text b { overflow: hidden; color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.selected-arr { flex: none; padding: 8px 12px; border: 0; border-radius: 11px; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 800; cursor: pointer; }
/* 상행선/하행선 방향 선택 버튼 */
.selected-dir-btns { display: flex; gap: 6px; flex: none; }
.selected-dir-btn { flex: none; padding: 8px 12px; border: 1.5px solid var(--primary); border-radius: 11px; background-color: transparent; background-image: none; color: var(--primary); font-size: 12.5px; font-weight: 800; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
/* 상행·하행 선택 버튼은 모든 보기에서 단색만 사용한다. */
.selected-dir-btn.active { background-color: var(--primary); background-image: none; color: #fff; }
.selected-clear { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
/* 선택 표시줄 안에서 도착정보를 펼쳐도 표시줄·LIVE 보드는 그대로 유지한다. */
.selected-arrivals { flex: 0 0 100%; width: 100%; min-width: 0; padding-top: 4px; }
.selected-arrivals .live-chip { margin: 4px 0 8px; }
.selected-arrivals .arr-group { margin: 8px 0; }
.selected-strip-host .selected-strip { margin: 8px 0; }

/* 가로 LIVE 보드의 도착정보: 노선도 바로 위에 두고 역사 전광판처럼 목적지·도착 상태를 크게 보여준다. */
.line-panel.horizontal-mode .selected-strip-host { margin: 0 10px 10px; }
.line-panel.horizontal-mode .selected-strip-host .selected-strip { margin: 0; padding: 12px; border: 1px solid #303846; border-radius: 16px; background: #0a0d13; color: #dbe7ff; box-shadow: none; }
.line-panel.horizontal-mode .selected-strip-host .selected-text b { color: #fff; }
/* 도착정보가 열린 상태에서는 선택 역명을 전광판 제목처럼 먼저 읽히게 한다. */
.selected-strip.arrivals-open .selected-text b { overflow: visible; font-size: clamp(23px, 6vw, 30px); font-weight: 900; letter-spacing: -.06em; line-height: 1.05; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
/* 실제 역명판처럼 호선색 테두리·원형 호선 번호·밝은 역명 바를 사용한다. */
.selected-strip.arrivals-open .selected-strip-main.station-sign { display: flex; align-items: center; min-width: 0; min-height: 72px; padding: 7px 18px 7px 9px; border: 4px solid var(--station-sign-color, var(--primary)); border-radius: 999px; background: #f8fafc; color: #171a20; box-shadow: inset 0 0 0 2px rgba(255,255,255,.92), 0 2px 8px rgba(0,0,0,.18); }
.selected-strip.arrivals-open .station-sign .selected-pin { width: 48px; height: 48px; border: 3px solid #fff; border-radius: 50%; background: var(--station-sign-color, var(--primary)); color: #fff; font-size: 23px; font-weight: 900; line-height: 1; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.selected-strip.arrivals-open .station-sign .selected-text { padding: 0 12px; }
.selected-strip.arrivals-open .station-sign .selected-text b { color: #171a20; }
.selected-strip.arrivals-open .station-sign .station-name-break { display: block; }
.selected-strip.arrivals-open .station-sign .selected-clear { width: 32px; height: 32px; border-radius: 50%; background: #e8edf4; color: #566174; }
.line-panel.horizontal-mode .selected-strip-host .selected-text small, .line-panel.horizontal-mode .selected-strip-host .selected-clear { color: #aebbd0; }
.line-panel.horizontal-mode .selected-strip-host .selected-arr { background: #d7e843; color: #10140c; }
.line-panel.horizontal-mode .selected-strip-host .selected-dir-btn { border-color: #8290a6; color: #e7efff; }
.line-panel.horizontal-mode .selected-strip-host .selected-dir-btn.active { border-color: #d7e843; background: #d7e843; color: #10140c; }
.line-panel.horizontal-mode .selected-strip-host .selected-strip-actions { display: flex; align-items: center; justify-content: flex-start; width: 100%; gap: 6px; }
.line-panel.horizontal-mode .selected-strip-host .live-chip { background: rgba(215,232,67,.14); color: #d7e843; }
.line-panel.horizontal-mode .selected-strip-host .live-chip i { background: #d7e843; }
.line-panel.horizontal-mode .selected-arrivals { display: grid; gap: 8px; }
.arrival-led-line-tabs { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; padding: 2px 0 0; }
.arrival-led-line-tab { flex: 0 1 auto; min-width: 0; padding: 7px 10px; border: 1px solid #66748c; border-radius: 8px; background: #10151e; color: #dce6f7; font-size: 11.5px; font-weight: 800; cursor: pointer; }
.arrival-led-line-tab.active { border-color: #d7e843; background: #d7e843; color: #10140c; }
.arrival-led-board { overflow: hidden; border: 1px solid #323c4e; border-radius: 12px; background: #070a10; color: #e9f0ff; box-shadow: none; }
.arrival-led-board.multi-line { border-top-color: #3a4557; }
.arrival-led-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #293342; color: #9db1d2; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.arrival-led-head b { color: #d7e843; font-size: 12px; }
.arrival-led-list { margin: 0; padding: 0; list-style: none; }
.arrival-led-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: end; padding: 14px 14px 12px; border-top: 1px solid rgba(155,174,210,.12); background-color: #070a10; background-image: none; }
.arrival-led-row:first-child { border-top: 0; }
.arrival-led-dest { min-width: 0; overflow: hidden; color: #d7e843; font-size: clamp(22px, 6vw, 38px); font-weight: 900; letter-spacing: -.07em; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.arrival-led-eta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; color: #eaf1ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.arrival-led-eta strong { font-size: clamp(19px, 5.5vw, 32px); font-weight: 800; letter-spacing: -.05em; line-height: 1; }
/* 시간 바로 아래에 현재 위치를 배치해 도착 상태와 열차 위치를 한눈에 읽게 한다. */
.arrival-led-position { max-width: 150px; overflow: hidden; padding: 4px 7px; border: 1px solid #56647b; border-radius: 6px; background: #101722; color: #d7e843; font-size: 11px; font-weight: 800; line-height: 1.2; text-align: right; text-overflow: ellipsis; }
.arrival-led-row.tone-now .arrival-led-eta strong { color: #ffdf55; }
.arrival-led-row.tone-soon .arrival-led-eta strong { color: #9ee8ff; }
.arrival-led-source { color: #8d9bb0; font-size: 10.5px; font-weight: 600; text-align: right; }

/* 라이트 LIVE 보드에서는 도착정보·환승 탭·목록까지 모두 밝은 표면과 짙은 글자로 통일한다. */
.horizontal-board[data-board-theme="light"] .selected-strip-host .selected-strip { border-color: #dbe2ec; background: #f6f8fc; color: #40516c; }
.horizontal-board[data-board-theme="light"] .selected-strip-host .selected-text b { color: #172033; }
.horizontal-board[data-board-theme="light"] .selected-strip-host .selected-text small,
.horizontal-board[data-board-theme="light"] .selected-strip-host .selected-clear { color: #60708a; }
.horizontal-board[data-board-theme="light"] .selected-strip-host .selected-arr { background: var(--primary); color: #fff; }
.horizontal-board[data-board-theme="light"] .selected-strip-host .selected-dir-btn { border-color: #aeb9c9; color: #40516c; }
.horizontal-board[data-board-theme="light"] .selected-strip-host .selected-dir-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.horizontal-board[data-board-theme="light"] .arrival-led-line-tab { border-color: #cbd5e1; background: #fff; color: #40516c; }
.horizontal-board[data-board-theme="light"] .arrival-led-line-tab.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.horizontal-board[data-board-theme="light"] .arrival-led-board { border-color: #dbe2ec; background: #fff; color: #172033; }
.horizontal-board[data-board-theme="light"] .arrival-led-board.multi-line { border-top-color: #dbe2ec; }
.horizontal-board[data-board-theme="light"] .arrival-led-head { border-bottom-color: #e5eaf1; color: #60708a; }
.horizontal-board[data-board-theme="light"] .arrival-led-head b { color: var(--primary); }
.horizontal-board[data-board-theme="light"] .arrival-led-row { border-top-color: #e5eaf1; background-color: #fff; }
.horizontal-board[data-board-theme="light"] .arrival-led-dest,
.horizontal-board[data-board-theme="light"] .arrival-led-eta { color: #172033; }
.horizontal-board[data-board-theme="light"] .arrival-led-row.tone-now .arrival-led-eta strong { color: #c2410c; }
.horizontal-board[data-board-theme="light"] .arrival-led-row.tone-soon .arrival-led-eta strong { color: #0369a1; }
.horizontal-board[data-board-theme="light"] .arrival-led-position { border-color: #cbd5e1; background: #f1f5f9; color: #40516c; }
.horizontal-board[data-board-theme="light"] .arrival-led-source { color: #60708a; }

/* 세로 보기(단일 열)도 같은 카드 구조로 통일 */
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) { margin: 12px 12px 18px; padding-bottom: 4px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-2); overflow: clip; }
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) .line-header { padding: 14px 14px 10px 16px; }
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) .line-title-text strong { font-size: 19px; }
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) .line-badge.lg { min-width: 42px; height: 42px; font-size: 18px; }
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) .refresh-hint { margin: 2px 16px 12px; padding: 0; border: 0; background: transparent; font-size: 11.5px; }
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) .line-diagram-wrap { margin: 0 12px 12px; border-color: transparent; background: var(--surface-2); box-shadow: none; }
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) .show-all-btn { width: calc(100% - 24px); margin: 0 12px 10px; }
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) #linePanelBody { margin: 0 12px 10px; }
.app:not(.vertical-layout) .line-panel:not(.horizontal-mode) > .saved-shortcuts { padding: 12px 12px 0; }
/* 세로 2열 배치에서는 기존 좌측 패널 구성을 그대로 유지 */
.vertical-layout .sel-tray { display: contents; }
.vertical-layout .sel-lines, .vertical-layout .sel-label { display: none !important; }

@media (min-width: 768px) {
    .app:not(.vertical-layout) .sel-tray, .app:not(.vertical-layout) .line-panel { width: min(920px, calc(100% - 24px)); max-width: 920px; margin-right: auto; margin-left: auto; }
    .line-panel.horizontal-mode .line-header, .line-panel.horizontal-mode .refresh-hint { margin-right: 0; margin-left: 0; }
    .line-panel.horizontal-mode .refresh-hint { margin: 2px 16px 14px; }
}

/* 선택 트레이 컴팩트화: 칩·역 버튼 높이와 줄 간격 축소 */
.app:not(.vertical-layout) .sel-tray .line-chip { height: 32px; padding: 0 13px; font-size: 13px; }
.app:not(.vertical-layout) .sel-tray .line-station-btn { height: 32px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.app:not(.vertical-layout) .sel-tray .line-station-list { padding-bottom: 0; gap: 6px; }
.app:not(.vertical-layout) .sel-tray .line-chip-row { gap: 7px; }

/* ==========================================================================
   12c. 선택 트레이: 라벨 줄을 없애고 각 줄 왼쪽 세로 바 안에 "호선"/"역" 표시 (2026-09-24)
   ========================================================================== */
.app:not(.vertical-layout) .sel-tray { padding: 6px 0 6px; }
.app:not(.vertical-layout) .sel-lines, .app:not(.vertical-layout) .sel-tray .line-station-picker { display: flex; align-items: flex-start; gap: 6px; padding-left: 10px; }
.app:not(.vertical-layout) .sel-tray .line-station-picker { margin: 0; padding-top: 7px; }
.sel-bar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 34px; border-radius: 10px; background: var(--ink-2); color: var(--bg); font-size: 10.5px; font-weight: 800; line-height: 1; letter-spacing: 0; writing-mode: vertical-rl; text-orientation: upright; }
.app:not(.vertical-layout) .sel-lines .sel-bar { margin-top: 7px; }
.app:not(.vertical-layout) .sel-tray .line-chip-row { flex: 1; min-width: 0; padding: 7px 16px 6px 10px; }
.app:not(.vertical-layout) .sel-tray .line-station-list { flex: 1; min-width: 0; padding: 0 16px 0 10px; }
.app:not(.vertical-layout) .sel-tray .line-station-btn { height: 34px; }
.app:not(.vertical-layout) .sel-tray .line-chip { height: 34px; }
.vertical-layout .sel-bar { display: none !important; }
@media (min-width: 768px) {
    .app:not(.vertical-layout) .sel-tray .line-chip-row { padding-right: 20px; }
}

/* 스크롤되는 칩이 바 경계·오른쪽 끝에서 뚝 잘려 보이지 않도록 양 끝을 부드럽게 */
.app:not(.vertical-layout) .sel-tray .line-chip-row, .app:not(.vertical-layout) .sel-tray .line-station-list { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%); }

/* ==========================================================================
   12d. 호선/역 컨텍스트 시트 (세로 바 누르면 열림)
   ========================================================================== */
button.sel-bar { padding: 0; border: 0; font-family: inherit; cursor: pointer; transition: transform .12s ease, filter .15s ease; }
button.sel-bar:active { transform: scale(.93); }
button.sel-bar:hover { filter: brightness(1.12); }
.pick-sheet { max-height: 86dvh; }
.pick-sheet .sheet-head { padding-bottom: 8px; }
.pick-title { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.04em; }
.pick-title small { margin-left: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.pick-filter { padding: 0 20px 8px; }
.pick-filter input { width: 100%; height: 42px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 13px; outline: none; background: var(--surface-2); color: var(--ink); font-size: 15px; }
.pick-filter input:focus { border-color: var(--primary); background: var(--surface); }
.pick-body { padding-top: 2px; padding-bottom: 6px; }
.pick-group-label { margin: 6px 2px 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.pick-group-label:not(:first-child) { margin-top: 18px; }
.pick-lines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pick-line { height: 52px; padding: 0 6px; border: 0; border-radius: 15px; color: #fff; font-size: 14.5px; font-weight: 800; letter-spacing: -.03em; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); transition: transform .12s ease; }
.pick-line:active { transform: scale(.96); }
.pick-line.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring); }
.pick-stations { display: grid; gap: 6px; padding: 2px 0 6px; }
.pick-stations.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pick-stations.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pick-stations.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pick-station { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 5px 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.2; text-align: center; word-break: keep-all; cursor: pointer; }
.pick-station[hidden] { display: none; }
.pick-station:active { transform: scale(.96); }
.cols-5 .pick-station { min-height: 38px; padding: 4px 1px; font-size: 11.5px; letter-spacing: -.04em; }
.pick-station.selected { border-color: transparent; background: var(--pick-accent, var(--primary)); color: #fff; font-weight: 800; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
.pick-empty { padding: 26px 8px; color: var(--muted); font-size: 13.5px; text-align: center; }
@media (min-width: 768px) {
    .pick-sheet { max-width: 760px; }
    .pick-lines { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .pick-stations.cols-4, .pick-stations.cols-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ==========================================================================
   12e. 호선/역 패널은 아래에서 올라오는 시트가 아니라 화면 맨 위(헤더 위)에서 내려오는 패널
   (즐겨찾기 시트는 기존처럼 아래에서 올라옴)
   ========================================================================== */
.sheet.pick-sheet { top: 0; bottom: auto; max-height: 92dvh; padding: env(safe-area-inset-top) 0 0; border-radius: 0 0 26px 26px; box-shadow: 0 16px 48px rgba(0, 0, 0, .3); transform: translateY(-104%); transition: transform .28s cubic-bezier(.2, .8, .25, 1); }
.sheet.pick-sheet.open { transform: none; }
.pick-sheet .sheet-head { padding-top: 14px; }
.pick-sheet .sheet-grip { flex: none; margin: 8px auto 10px; }
.pick-sheet .pick-body { padding-bottom: 4px; }
@media (min-width: 768px) {
    .sheet.pick-sheet { top: 12px; bottom: auto; border-radius: 26px; }
}

/* 위에서 내려오는 패널: 1호선(80개 역)도 폰 높이(약 844px)에서 한 화면에 들어오도록 여백·버튼 높이 조정 */
.sheet.pick-sheet { max-height: 95dvh; }
.pick-sheet .sheet-head { padding-top: 8px; padding-bottom: 4px; }
.pick-filter { padding-bottom: 6px; }
.pick-filter input { height: 38px; font-size: 14.5px; }
.pick-stations.cols-5 { gap: 5px; }
.cols-5 .pick-station { min-height: 34px; }
.pick-stations.cols-4 .pick-station { min-height: 38px; }
.pick-sheet .sheet-body { padding-top: 0; padding-bottom: 0; }
.pick-sheet .sheet-grip { margin: 6px auto 8px; }

.pick-sheet .pick-body { padding-bottom: 8px; } /* 마지막 줄 선택 링이 잘리지 않도록 */
.pick-sheet .pick-lines { padding-bottom: 4px; }

/* ==========================================================================
   12f. 호선·역 선택 트레이 접기 (2026-09-24)
   호선/역을 고르면 트레이가 위로 접히고, 실시간 카드 헤더의 ▲ 버튼으로 다시 펼친다.
   ========================================================================== */
.app:not(.vertical-layout) .sel-tray { overflow: hidden; transition: max-height .32s cubic-bezier(.4, 0, .2, 1), opacity .24s ease, margin .32s ease, padding .32s ease, border-width .32s ease, visibility 0s 0s; }
.app:not(.vertical-layout) .sel-tray.is-collapsed { margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: max-height .32s cubic-bezier(.4, 0, .2, 1), opacity .2s ease, margin .32s ease, padding .32s ease, border-width .32s ease, visibility 0s .32s; }
.app.tray-collapsed .vm-more { display: none; } /* 접힌 상태에서는 "가로보기/세로보기" → "가로/세로" */
.app.tray-collapsed .line-view-mode-btn { padding: 7px 12px; }
@media (prefers-reduced-motion: reduce) { .app:not(.vertical-layout) .sel-tray, .app:not(.vertical-layout) .sel-tray.is-collapsed { transition: none; } }

/* ==========================================================================
   12g. 가로 보드 넓게 (2026-09-24)
   - "상행선/하행선" 라벨을 노선 선의 왼쪽 "위"로 옮겨 선이 왼쪽 끝까지 붙게 한다(가로 스크롤 시에도 왼쪽에 고정).
   - 선택 트레이·실시간 카드·보드의 좌우 여백을 줄여 가로 폭을 넓힌다.
   ========================================================================== */
.display-route-lane > .display-lane-label { position: sticky; left: 0; z-index: 6; flex: none; width: 0; height: 0; padding: 0; background: none; overflow: visible; }
.display-lane-label > span { position: absolute; top: 28px; left: 8px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--bd-fg) 9%, var(--bd-bg)); color: var(--bd-mute); font-size: 11.5px; font-weight: 800; line-height: 1.35; letter-spacing: -.02em; white-space: nowrap; }
.display-route-line::before { left: 0; }
.display-route-line { padding-left: 0; }

/* 좌우 여백 최소화 */
.app:not(.vertical-layout) .sel-tray { margin-right: 6px; margin-left: 6px; }
.line-panel.horizontal-mode { margin: 10px 6px 18px; }
.line-panel.horizontal-mode > .saved-shortcuts { padding: 12px 6px 0; }
.line-panel.horizontal-mode .line-header { padding: 14px 10px 10px 12px; }
.line-panel.horizontal-mode .selected-strip { margin-right: 6px; margin-left: 6px; }
.line-panel.horizontal-mode .horizontal-line-view { padding: 0 6px 4px; }
.line-panel.horizontal-mode .refresh-hint { margin: 2px 12px 12px; }
.line-panel.horizontal-mode .display-board-top { padding: 12px 12px 10px; }
.line-panel.horizontal-mode .display-train-accordion { padding: 14px 12px; }
.line-panel.horizontal-mode .display-train-list { padding-right: 12px; padding-left: 12px; }
@media (min-width: 768px) {
    .app:not(.vertical-layout) .sel-tray, .app:not(.vertical-layout) .line-panel.horizontal-mode { width: min(920px, calc(100% - 12px)); }
}

@media (max-width: 400px) { .line-view-mode-btn .vm-more { display: none; } } /* 좁은 폰에서는 펼친 상태에서도 "가로/세로" */

/* ==========================================================================
   12i. 세로보기(우/좌) 화면에서도 패널 헤더 오른쪽에 "가로 | 세로" 전환 버튼 표시
   가로 화면과 같은 자리·같은 컨트롤이라 어디 있는지 예측하기 쉽고, 세로 화면에서 한 번에 가로로 돌아갈 수 있다.
   ========================================================================== */
.vertical-layout .line-panel-controls { display: block; flex: none; }
.vertical-layout .line-controls .theme-toggle-btn { display: none; }
.vertical-layout .line-view-mode-switch { margin: 0; padding: 2px; border-radius: 10px; }
.vertical-layout .line-view-mode-btn { padding: 6px 9px; font-size: 11.5px; }
.vertical-layout .line-view-mode-btn .vm-more { display: none; }
.vertical-layout .line-header { gap: 6px; }
.vertical-layout .line-title { gap: 7px; }

/* ==========================================================================
   12j. 세로 화면 정리 + 메뉴 방향(좌/우) 토글 (2026-09-24)
   - 호선 아래 설명글(수신 상태·노선도 표시 안내)은 앱 소개 화면으로 이동 → 세로 화면에서는 숨김
   - "가로|세로" 아래에 "메뉴 좌|우" 토글 (기본 우)
   ========================================================================== */
.vertical-layout .refresh-hint, .vertical-layout #lineDiagramStatus { display: none !important; }
.menu-side-switch { display: none; }
.vertical-layout .line-controls { flex-direction: column; align-items: stretch; gap: 6px; }
.vertical-layout .line-view-mode-switch { display: flex; padding: 3px; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line)); border-radius: 12px; background: var(--surface-2); box-shadow: var(--shadow-1); }
.vertical-layout .line-controls.vertical-view-selected .menu-side-switch { display: flex; align-items: center; gap: 3px; padding: 5px; border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--line)); border-radius: 12px; background: linear-gradient(145deg, var(--surface), var(--surface-2)); box-shadow: var(--shadow-1); }
.menu-side-label { flex: none; padding: 0 4px 0 3px; color: var(--muted); font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.menu-side-btn { flex: 1; min-width: 30px; padding: 5px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 800; cursor: pointer; transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease; }
.menu-side-btn:active { transform: scale(.94); }
.menu-side-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 38%, transparent); }
html[data-app-theme="dark"] .menu-side-btn.active { background: var(--primary); color: #fff; }
.vertical-layout .line-diagram-wrap { max-height: calc(100dvh - var(--ad-h) - 205px); }
/* 세로 좌·우 배치: 선택 역과 도착 상세를 호선 선택 버튼 아래의 패널 폭에 고정한다. */
.vertical-layout .line-station-picker > .selected-strip { order: -2; width: 100%; flex: none; }
/* 역 선택 뒤에는 보기·메뉴 위치 컨트롤도 도착정보 영역의 맨 위 폭을 그대로 사용한다. */
.vertical-layout .line-station-picker > .line-panel-controls { order: -3; width: 100%; flex: none; margin: 0 0 6px; }
.vertical-layout .line-station-picker.has-selected-station { min-height: 0; overflow-y: auto; }
/* 세로 2열의 역·도착정보 칸에서는 혼잡도 핵심값과 단계 게이지를 한 화면에 압축한다. */
.vertical-layout .line-station-picker > .line-city-crowd-card,
.vertical-layout .line-station-picker > .line-elevator-card { flex: none; width: 100%; margin: 0 0 7px; }
.vertical-layout .line-station-picker > .line-city-crowd-card { order: 1; padding: 8px; border-radius: 11px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-head { gap: 6px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-head span { font-size: 9px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-head strong { font-size: 12px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-level { padding: 4px 6px; font-size: 9px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-count { margin-top: 7px; padding: 7px 8px; border-radius: 9px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-count span { font-size: 10px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-count strong { font-size: 14px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-count em { font-size: 10px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-gauge { gap: 3px; margin-top: 7px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-gauge-step { gap: 2px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-gauge-step i { height: 5px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-gauge-step.active i { height: 7px; }
.vertical-layout .line-station-picker > .line-city-crowd-card .city-crowd-gauge-step b { font-size: 8px; }
.vertical-layout .line-station-picker > .line-city-crowd-card > p,
.vertical-layout .line-station-picker > .line-city-crowd-card > small { display: none; }
.vertical-layout .line-station-picker > .line-elevator-card { order: 2; }
.vertical-layout .selected-strip { display: flex; flex-direction: column; align-items: stretch; gap: 5px; margin: 0 0 7px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1); }
.vertical-layout .selected-strip[hidden], .vertical-layout .selected-strip:not(.has-station) { display: none !important; }
.vertical-layout .selected-strip.has-station.arrivals-open { border-color: #323c4e; background: #0a0d13; color: #dbe7ff; box-shadow: none; }
.vertical-layout .selected-strip-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vertical-layout .selected-pin { width: 26px; height: 26px; border-radius: 8px; }
.vertical-layout .selected-pin svg { width: 15px; height: 15px; }
.vertical-layout .selected-text b { font-size: 14px; }
.vertical-layout .selected-clear { width: 26px; height: 26px; margin-left: auto; }
.vertical-layout .selected-strip.has-station.arrivals-open .selected-text b { color: #fff; font-size: clamp(20px, 7vw, 28px); }
.vertical-layout .selected-strip.has-station.arrivals-open .selected-clear { color: #aebbd0; }
.vertical-layout .selected-strip.arrivals-open .selected-strip-main.station-sign { display: grid; grid-template-columns: 38px minmax(0, 1fr) 26px; align-items: center; column-gap: 6px; min-height: 64px; padding: 6px 8px 6px 5px; border-width: 3px; }
.vertical-layout .selected-strip.arrivals-open .station-sign .selected-pin { width: 38px; height: 38px; border-width: 2px; font-size: 18px; }
.vertical-layout .selected-strip.arrivals-open .station-sign .selected-text { min-width: 0; padding: 0 2px; }
/* 좁은 세로 폭에서도 긴 역명과 괄호 부역명을 우선 표시하고, 해제 버튼은 별도 열에 고정한다. */
.vertical-layout .selected-strip.has-station.arrivals-open .station-sign .selected-text b { color: #171a20; font-size: clamp(18px, 6vw, 24px); line-height: 1.14; overflow-wrap: anywhere; word-break: keep-all; }
.vertical-layout .selected-strip.arrivals-open .station-sign .selected-clear { width: 26px; height: 26px; color: #566174; }
.vertical-layout .selected-strip.has-station.arrivals-open .selected-arr { background: #d7e843; color: #10140c; }
.vertical-layout .selected-strip.has-station.arrivals-open .selected-dir-btn { border-color: #8290a6; color: #e7efff; }
.vertical-layout .selected-strip.has-station.arrivals-open .selected-dir-btn.active { border-color: #d7e843; background: #d7e843; color: #10140c; }
.vertical-layout .selected-strip.has-station.arrivals-open .live-chip { background: rgba(215,232,67,.14); color: #d7e843; }
.vertical-layout .selected-strip.has-station.arrivals-open .live-chip i { background: #d7e843; }
.vertical-layout .selected-strip-actions { display: flex; flex-wrap: wrap; width: 100%; gap: 4px; }
/* 좁은 좌·우 패널에서도 버튼 문구가 잘리지 않도록 도착정보와 방향 선택을 두 줄로 배치한다. */
.vertical-layout .selected-arr { flex: 0 0 100%; min-width: 0; padding: 7px 3px; border-radius: 9px; font-size: 11px; }
.vertical-layout .selected-dir-btns { flex: 0 0 100%; min-width: 0; gap: 4px; }
.vertical-layout .selected-dir-btn { flex: 1; min-width: 0; min-height: 34px; padding: 6px 2px; border-radius: 9px; font-size: 11px; line-height: 1.2; white-space: normal; word-break: keep-all; }
.vertical-layout .selected-arrivals { flex: none; max-height: 35dvh; padding: 5px 2px 0; overflow-y: auto; overscroll-behavior: contain; }
.vertical-layout .selected-arrivals .arr-group { margin: 6px 0; }
.vertical-layout .selected-arrivals .arr-group-head { flex-wrap: wrap; gap: 5px; font-size: 11px; }
/* 좁은 세로 패널에서는 도착 행을 한 열로 쌓아 모든 안내 문장을 온전히 읽을 수 있게 한다. */
.vertical-layout .selected-arrivals .arr-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 7px 5px; }
.vertical-layout .selected-arrivals .arr-dest-line { flex-wrap: wrap; }
.vertical-layout .selected-arrivals .arr-dest { font-size: 11.5px; }
.vertical-layout .selected-arrivals .arr-sub, .vertical-layout .selected-arrivals .arr-eta-sub { white-space: normal; overflow-wrap: anywhere; word-break: keep-all; }
.vertical-layout .selected-arrivals .arr-eta { align-items: flex-start; text-align: left; }
.vertical-layout .selected-arrivals .arr-eta-main { font-size: 12px; }
/* 목적지·상태 문장은 말줄임 없이 패널 안에서 줄바꿈한다. */
.vertical-layout .selected-arrivals .arr-dest-line { min-width: 0; }
.vertical-layout .selected-arrivals .arr-dest { overflow-wrap: anywhere; word-break: keep-all; white-space: normal; }
/* 세로 선택 패널도 역사 천정 전광판과 같은 검은 바탕·형광 목적지·큰 도착 시각으로 표시한다. */
.vertical-layout .selected-arrivals .arrival-led-line-tabs { gap: 4px; padding: 2px 0; }
.vertical-layout .selected-arrivals .arrival-led-line-tab { flex: 1 1 auto; padding: 6px 5px; font-size: 10.5px; overflow-wrap: anywhere; }
.vertical-layout .selected-arrivals .arrival-led-board { border-radius: 9px; }
.vertical-layout .selected-arrivals .arrival-led-head { padding: 7px 8px; font-size: 10px; }
.vertical-layout .selected-arrivals .arrival-led-head b { font-size: 10.5px; }
.vertical-layout .selected-arrivals .arrival-led-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 9px; }
.vertical-layout .selected-arrivals .arrival-led-dest { overflow: visible; font-size: clamp(18px, 6vw, 27px); white-space: normal; overflow-wrap: anywhere; word-break: keep-all; }
.vertical-layout .selected-arrivals .arrival-led-eta { align-items: flex-start; }
.vertical-layout .selected-arrivals .arrival-led-eta strong { font-size: clamp(17px, 5.5vw, 25px); }
.vertical-layout .selected-arrivals .arrival-led-position { max-width: 100%; font-size: 10.5px; white-space: normal; overflow-wrap: anywhere; word-break: keep-all; text-align: left; }
.vertical-layout .selected-arrivals .arrival-led-source { font-size: 9.5px; }
.vertical-layout .line-diagram-train { transition: opacity .18s ease, filter .18s ease; }
/* 방향을 고르면 반대편 열차 아이콘은 숨겨 좁아진 노선도 영역을 한 방향에 집중시킨다. */
.vertical-layout .line-diagram-wrap.direction-up .line-diagram-train-down,
.vertical-layout .line-diagram-wrap.direction-up .line-diagram-track-down,
.vertical-layout .line-diagram-wrap.direction-up .line-diagram-station-down,
.vertical-layout .line-diagram-wrap.direction-down .line-diagram-train-up,
.vertical-layout .line-diagram-wrap.direction-down .line-diagram-track-up,
.vertical-layout .line-diagram-wrap.direction-down .line-diagram-station-up { display: none; }
.vertical-layout .line-diagram-wrap.direction-up .line-diagram-train-up,
.vertical-layout .line-diagram-wrap.direction-down .line-diagram-train-down { opacity: 1; filter: none; }
.vertical-layout .line-diagram-wrap .line-diagram-train.is-held { opacity: .4; filter: grayscale(.7); }

/* 앱 소개: 실시간 정보 안내 */
.app-info-note { margin-bottom: 9px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.app-info-note b { font-size: 14px; }
.app-info-note p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.app-info-live { border-color: transparent; background: var(--primary-soft); }
.app-info-live b { color: var(--primary); }
.app-info-live p { color: var(--ink-2); }

/* 모바일 가로 보기: 선택 역은 상단에 실제 역명판처럼 한 개만 보이고, 보기 전환도 같은 행에 둔다. */
@media (max-width: 767px) {
    /* 전체 호선 목록에서는 모든 칩을 선명하게 두고, 선택 칩만 외곽 강조로 돋보이게 한다. */
    .app:not(.vertical-layout) .sel-tray.line-chips-expanded { background: var(--tray); }
    .app:not(.vertical-layout) .sel-tray.line-chips-expanded .line-chip-row.has-active .line-chip:not(.active) { opacity: 1; }
    .app:not(.vertical-layout) .line-station-picker.has-selected-station { align-items: center; }
    .app:not(.vertical-layout) .line-station-list.has-selected-station {
        /* 선택 역명판은 역명 길이만큼만 차지하고, 긴 이름도 화면 안에서 온전히 보이게 한다. */
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        padding: 0;
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .app:not(.vertical-layout) .sel-tray .line-station-btn.station-sign.active {
        display: flex;
        align-items: center;
        gap: 8px;
        width: fit-content;
        max-width: calc(100vw - 86px);
        height: 58px;
        min-width: 0;
        padding: 6px 13px 6px 6px;
        border: 4px solid var(--line-accent, var(--primary));
        border-radius: 999px;
        background: #f8fafc;
        color: #171a20;
        box-shadow: inset 0 0 0 2px rgba(255,255,255,.92), 0 2px 8px rgba(0,0,0,.18);
    }
    .app:not(.vertical-layout) .line-station-btn.station-sign .station-sign-pin {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 38px;
        height: 38px;
        box-sizing: border-box;
        border: 0;
        border-radius: 50%;
        background: var(--line-accent, var(--primary));
        color: #fff;
        font-size: 18px;
        font-weight: 900;
        line-height: 1;
        box-shadow: none;
    }
    /* 광역·지선처럼 영문 또는 4자리 외부번호도 원형 표지 안에서 또렷하게 읽히게 한다. */
    .app:not(.vertical-layout) .line-station-btn.station-sign .station-sign-pin.station-code-long { font-size: 12px; letter-spacing: -.06em; }
    .app:not(.vertical-layout) .line-station-btn.station-sign .station-sign-name {
        min-width: 0;
        overflow: visible;
        color: #171a20;
        font-size: clamp(15.5px, 4.5vw, 19px);
        font-weight: 900;
        letter-spacing: -.05em;
        line-height: 1.15;
        text-overflow: clip;
        white-space: nowrap;
    }
    .app:not(.vertical-layout) .sel-lines.line-chips-collapsed > .line-panel-controls { flex: none; margin-left: auto; }
    /* 초기 로드(저장된 호선 복원 포함)에는 보기 전환을 숨긴다. 직접 선택한 호선 행에서만 보인다. */
    .app:not(.vertical-layout) .line-panel.horizontal-mode:not(.compact-line-selected) .line-view-mode-switch { display: none; }
    /* LIVE 바로 위의 중복 노선 헤더는 선택 상태에서 항상 숨긴다. */
    .app:not(.vertical-layout) .line-panel.horizontal-mode.compact-line-header-hidden .line-header { display: none; }
}

/* 모바일 메인 호선도 선택 시트와 같은 큰 3열 버튼으로 바로 고를 수 있게 한다. */
@media (max-width: 767px) {
    .app:not(.vertical-layout) .sel-tray .line-chip-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        padding-right: 10px;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .app:not(.vertical-layout) .sel-tray .line-chip {
        width: 100%;
        min-width: 0;
        height: 52px;
        padding: 0 6px;
        border-radius: 15px;
        font-size: clamp(12px, 4vw, 14.5px);
        white-space: nowrap;
    }
}

/* 호선 선택 뒤에는 선택 칩만 남기고, 같은 칩을 다시 누르면 전체 목록을 다시 연다. */
@media (max-width: 767px) {
    .app:not(.vertical-layout) .sel-lines.line-chips-collapsed { align-items: center; }
    /* 호선·역 세로 뱃지를 선택 칩과 같은 글자·외곽 형태로 통일한다. */
    .app:not(.vertical-layout) .sel-lines.line-chips-collapsed .sel-bar,
    .app:not(.vertical-layout) .sel-tray .line-station-picker > .sel-bar {
        width: 36px;
        height: 52px;
        margin: 0 8px 0 0;
        border: 0;
        border-radius: 12px;
        font-size: clamp(12px, 4vw, 14.5px);
        box-shadow: 0 0 0 2px var(--ring-gap), 0 0 0 4px var(--ring), 0 4px 12px rgba(0, 0, 0, .2);
    }
    /* 한 글자인 ‘역’ 뱃지는 폭과 높이를 같게 해 정사각형으로 보이게 한다. */
    .app:not(.vertical-layout) .sel-tray .line-station-picker > .sel-bar { height: 36px; }
    /* 위 호선 칩의 2중 외곽선과 붙어 보이지 않도록 역 선택 행의 상단 여백을 확보한다. */
    .app:not(.vertical-layout) .sel-tray .line-station-picker { padding-top: 16px; }
    .app:not(.vertical-layout) .sel-lines.line-chips-collapsed .line-chip-row {
        display: flex;
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
        padding: 0;
    }
    .app:not(.vertical-layout) .sel-lines.line-chips-collapsed .line-chip:not(.active) { display: none; }
    .app:not(.vertical-layout) .sel-lines.line-chips-collapsed .line-chip.active {
        width: auto;
        flex: 0 0 auto;
        padding: 0 16px;
        border-radius: 12px;
    }
}

/* LIVE는 운행판의 외곽선 하나만 남기고, 내부는 여백과 밝은 톤 차이로 구획한다. */
.line-panel.horizontal-mode { margin: 8px 2px 16px; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.line-panel.horizontal-mode .horizontal-line-view { padding: 0; }
.line-panel.horizontal-mode .horizontal-board { border: 1px solid var(--bd-line); border-radius: 20px; }
.line-panel.horizontal-mode .selected-strip-host { margin: 0; padding: 8px 8px 0; }
.line-panel.horizontal-mode .selected-strip-host .selected-strip { border: 0; box-shadow: none; }
.line-panel.horizontal-mode .display-route-lane,
.line-panel.horizontal-mode .display-train-accordion,
.line-panel.horizontal-mode .display-train-list { border-top: 0; }
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] .arrival-led-board { border: 0; }
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] .arrival-led-list { display: grid; gap: 6px; padding: 8px; }
.line-panel.horizontal-mode .horizontal-board[data-board-theme="light"] .arrival-led-row { border: 0; border-radius: 10px; background: #f6f8fc; }

/* 모바일 가로 보기: 호선 선택 뒤 로고·제목 자리에 선택 호선을, 돋보기 왼쪽에 가로/세로 버튼을 둔다. */
@media (max-width: 767px) {
    .app-header.header-line-mode .app-brand, .app-header.header-line-mode .search-toggle-btn { display: none; }
    .app-header.header-line-mode { --ring-gap: var(--bg); overflow: visible; padding-top: calc(14px + env(safe-area-inset-top)); } /* 호선 버튼 윗링 위 여백. 좌우 버튼이 함께 내려가 윗변 정렬은 유지 */
    /* 헤더 높이·우측 버튼 위치는 그대로 두고, 좌측 칸의 호선 버튼만 높이 제한 없이 아래로 넘쳐 보이게 한다. */
    .app-header.header-line-mode .app-header-top { align-items: flex-start; }
    .app-header.header-line-mode .sel-lines { flex: 1; min-width: 0; height: 42px; align-items: flex-start; gap: 0; padding: 0 0 0 4px; overflow: visible; }
    .app-header.header-line-mode .header-action-buttons { height: 42px; align-items: flex-start; }
    .app-header.header-line-mode .sel-lines .line-chip-row { align-items: flex-start; height: 42px; overflow: visible; }
    .app-header.header-line-mode .sel-lines .sel-bar { display: none; }
    .app-header.header-line-mode .sel-lines .line-chip-row { padding: 0; }
    /* 선택 칩은 트레이 안에 있을 때와 같은 크기·외곽 링 모양을 유지한다. */
    .app-header.header-line-mode .sel-lines .line-chip.active { height: 42px; padding: 0 16px; border-radius: 12px; font-size: clamp(12px, 4vw, 14.5px); filter: brightness(1.15); box-shadow: 0 0 0 2px var(--ring-gap), 0 0 0 4px var(--ring), 0 4px 12px rgba(0, 0, 0, .2); }
    .app-header.header-line-mode .header-action-buttons { gap: 6px; }
    /* 메뉴 아이콘(42px)과 같은 높이·테두리·모서리로 맞춘다. */
    .app-header.header-line-mode .line-view-mode-switch { display: inline-flex; align-items: stretch; box-sizing: border-box; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1); }
    .app-header.header-line-mode .line-view-mode-btn { padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
    .app-header.header-line-mode .line-view-mode-btn .vm-more { display: none; }
}

/* 호선이 헤더로 올라간 뒤 역 영역: 위쪽 점선 구분선과 어두운 혼합 배경을 없애고 깔끔한 단색 트레이로 보이게 한다. */
@media (max-width: 767px) {
    .app.header-line-active:not(.vertical-layout) .sel-tray.has-active { background: var(--tray); }
    .app.header-line-active:not(.vertical-layout) .sel-tray .line-station-picker { margin-top: 0; padding-top: 0; border-top: 0; }
    .app.header-line-active:not(.vertical-layout) .sel-tray .line-station-picker:not(.station-all-mode) > .sel-bar { display: none; }
    /* 펼친 역 목록 좌측의 All 버튼: 가로 글자의 버튼으로 전체 역 화면을 연다. */
    .app.header-line-active:not(.vertical-layout) .sel-tray .line-station-picker.station-all-mode > .sel-bar { width: 44px; height: 34px; margin: 0; border: 1.5px solid var(--line-accent, var(--primary)); border-radius: 11px; background: var(--surface); color: var(--line-accent, var(--primary)); font-size: 13px; font-weight: 800; box-shadow: var(--shadow-1); filter: none; writing-mode: horizontal-tb; text-orientation: mixed; }
    /* All 버튼과 첫 역 버튼 사이 간격을 역 버튼끼리의 간격(6px)과 같게 한다. */
    .app.header-line-active:not(.vertical-layout) .sel-tray .line-station-picker.station-all-mode { gap: 6px; }
    .app.header-line-active:not(.vertical-layout) .sel-tray .line-station-picker.station-all-mode .line-station-list { padding-left: 0; }
    /* 좌측 12px 페이드 마스크가 첫 역 버튼을 흐리게 하므로, All 모드에서는 우측 끝만 페이드한다. */
    .app.header-line-active:not(.vertical-layout) .sel-tray .line-station-picker.station-all-mode .line-station-list { -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%); }
}

/* 도착정보·상행선·하행선·환승 노선 버튼: 완성도 높은 앱 UI(세그먼트 컨트롤 + 알약 탭). 가로 LIVE 보드 안에서만 적용한다. */
.line-panel.horizontal-mode .selected-strip-host { --ab-accent: #d7e843; --ab-ink: #10140c; --ab-text: #e7efff; --ab-track: rgba(255,255,255,.08); --ab-edge: rgba(255,255,255,.14); --ab-glow: rgba(215,232,67,.32); }
.horizontal-board[data-board-theme="light"] .selected-strip-host { --ab-accent: var(--primary); --ab-ink: #fff; --ab-text: #40516c; --ab-track: #e9eef6; --ab-edge: #d3dbe8; --ab-glow: color-mix(in srgb, var(--primary) 32%, transparent); }
.line-panel.horizontal-mode .selected-strip-host .selected-strip-actions { display: flex; align-items: stretch; gap: 8px; padding-top: 2px; }
.line-panel.horizontal-mode .selected-strip-host .selected-strip-actions .selected-arr { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; height: 42px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--ab-accent); color: var(--ab-ink); font-size: 14px; font-weight: 800; letter-spacing: -.02em; box-shadow: 0 4px 12px var(--ab-glow), inset 0 1px 0 rgba(255,255,255,.28); transition: transform .12s ease, filter .15s ease; }
.line-panel.horizontal-mode .selected-strip-host .selected-strip-actions .selected-arr::after { content: ''; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease, margin .2s ease; }
.line-panel.horizontal-mode .selected-strip-host .selected-strip-actions .selected-arr[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }
.line-panel.horizontal-mode .selected-strip-host .selected-strip-actions .selected-arr:active { transform: scale(.96); filter: brightness(.95); }
.line-panel.horizontal-mode .selected-strip-host .selected-dir-btns { display: flex; flex: 1; min-width: 0; gap: 2px; padding: 3px; border: 1px solid var(--ab-edge); border-radius: 14px; background: var(--ab-track); }
.line-panel.horizontal-mode .selected-strip-host .selected-dir-btns .selected-dir-btn { flex: 1; min-width: 0; height: 34px; padding: 0 6px; border: 0; border-radius: 11px; background: transparent; color: var(--ab-text); font-size: 13.5px; font-weight: 700; letter-spacing: -.02em; transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease; }
.line-panel.horizontal-mode .selected-strip-host .selected-dir-btns .selected-dir-btn:active { transform: scale(.96); }
.line-panel.horizontal-mode .selected-strip-host .selected-dir-btns .selected-dir-btn.active { background: var(--ab-accent); color: var(--ab-ink); font-weight: 800; box-shadow: 0 2px 8px var(--ab-glow); }
/* 환승역 노선 탭: 부드러운 알약 모양, 선택 시 강조색 채움. */
.line-panel.horizontal-mode .selected-strip-host .arrival-led-line-tabs { gap: 6px; padding: 4px 0 2px; }
.line-panel.horizontal-mode .selected-strip-host .arrival-led-line-tab { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 15px; border: 1px solid var(--ab-edge); border-radius: 999px; background: var(--ab-track); color: var(--ab-text); font-size: 13px; font-weight: 700; letter-spacing: -.02em; transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease; }
.line-panel.horizontal-mode .selected-strip-host .arrival-led-line-tab:active { transform: scale(.96); }
.line-panel.horizontal-mode .selected-strip-host .arrival-led-line-tab.active { border-color: transparent; background: var(--ab-accent); color: var(--ab-ink); font-weight: 800; box-shadow: 0 2px 8px var(--ab-glow); }

/* 전체 역명 시트 헤더 우측의 정렬 전환 버튼(가나다순 ↔ 노선순서) */
.pick-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pick-sort-btn { height: 32px; padding: 0 13px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line)); border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-family: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; cursor: pointer; transition: transform .12s ease, background-color .15s ease; }
.pick-sort-btn[hidden] { display: none; }
.pick-sort-btn:active { transform: scale(.95); }

/* 사이드 메뉴 헤더: 좌측 로그인 버튼만, 우측에 다크모드 토글·닫기. 안내글과 로그인 폼은 헤더 아래 영역으로 분리. */
.side-menu-header { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.side-menu-header-row { gap: 8px; }
.side-menu-header .login-btn { width: auto; margin-right: auto; padding: 0 20px; height: 38px; border-radius: 12px; font-size: 14px; }
.side-menu-account { padding: 14px 20px 4px; }
.side-menu-account .profile-text strong { color: var(--ink); font-size: 16px; }
.side-menu-account .profile-text span { color: var(--muted); }
.side-menu-account .login-form { margin-top: 12px; background: var(--surface-2); }
.side-menu-account .login-input { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.side-menu-account .login-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.side-menu-account .login-submit { background: var(--primary); }
.side-menu-account .login-register-toggle { border-color:color-mix(in srgb, var(--primary) 36%, var(--line)); background:var(--primary-soft); color:var(--primary-strong); }
.side-menu-account .login-error { color: var(--danger, #e5484d); }

/* 사이드 메뉴 검색창 */
.side-menu-search { padding: 10px 20px 4px; }
.side-menu-search .search-input { height: 46px; font-size: 15.5px; }
.side-search-suggest { margin: 8px 0 0; max-height: 46dvh; overflow-y: auto; }
.side-search-suggest[hidden] { display: none; }

/* 방향별(상행/하행) 도착정보는 LIVE 노선 보드 바로 아래 전용 영역에 보여 준다. */
.horizontal-board .selected-arrivals-host { padding: 0 8px; }
.horizontal-board .selected-arrivals-host .selected-arrivals { padding: 8px 0 4px; }
.horizontal-board .selected-arrivals-host .selected-arrivals[hidden] { display: none; }
.selected-line-tabs { flex: 0 0 100%; width: 100%; min-width: 0; }
.selected-line-tabs:empty { display: none; }
.line-panel.horizontal-mode .selected-strip-host .selected-line-tabs .arrival-led-line-tabs { padding: 8px 0 2px; }

/* ===== 모바일 세로(분할) 보기: 왼쪽 세로 노선 LIVE · 오른쪽 도착정보 패널 ===== */
@media (max-width: 767px) {
    .line-panel.split-mode:not([style*="display: none"]) { display: grid !important; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); gap: 0 8px; align-items: start; }
    .line-panel.split-mode > * { grid-column: 1 / -1; }
    .line-panel.split-mode > #lineDiagramWrap { grid-column: 1; grid-row: 2; margin: 0 0 8px; padding: 10px 0; max-height: calc(100dvh - var(--app-header-height, 60px) - 150px); }
    .line-panel.split-mode > #horizontalLineView { grid-column: 2; grid-row: 2; min-width: 0; }
    /* 오른쪽 칸에서는 노선 보드(가로 레인)·열차 목록은 숨기고 선택 역 컨트롤과 도착정보만 보여 준다. */
    .line-panel.split-mode .horizontal-board .display-board-top,
    .line-panel.split-mode .horizontal-board .display-route-scroll,
    .line-panel.split-mode .horizontal-board .display-train-accordion,
    .line-panel.split-mode .horizontal-board .display-refresh-message,
    .line-panel.split-mode .horizontal-board .display-train-list { display: none; }
    .line-panel.split-mode .selected-strip-host { padding: 8px 8px 6px; }
    .line-panel.horizontal-mode.split-mode .selected-strip-host .selected-strip-actions { flex-wrap: wrap; gap: 6px; }
    .line-panel.horizontal-mode.split-mode .selected-strip-host .selected-strip-actions .selected-arr { flex: 1 0 100%; height: 38px; }
    .line-panel.horizontal-mode.split-mode .selected-strip-host .selected-dir-btns { flex: 1 0 100%; }
    .line-panel.horizontal-mode.split-mode .selected-strip-host .selected-dir-btns .selected-dir-btn { font-size: 12.5px; padding: 0 2px; }
    .line-panel.horizontal-mode.split-mode .selected-strip-host .arrival-led-line-tabs { gap: 4px; }
    .line-panel.horizontal-mode.split-mode .selected-strip-host .arrival-led-line-tab { flex: 1 1 auto; min-height: 32px; padding: 0 8px; font-size: 12px; }
    .line-panel.split-mode .line-diagram-label { max-width: 70px; font-size: 11.5px; line-height: 1.15; white-space: normal; }
    .line-panel.split-mode .line-diagram-train-car { width: 28px; height: 36px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals { flex: none; max-height: 35dvh; padding: 5px 2px 0; overflow-y: auto; overscroll-behavior: contain; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-group { margin: 6px 0; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-group-head { flex-wrap: wrap; gap: 5px; font-size: 11px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 7px 5px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-dest-line { flex-wrap: wrap; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-dest { font-size: 11.5px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-sub, .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-eta-sub { white-space: normal; overflow-wrap: anywhere; word-break: keep-all; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-eta { align-items: flex-start; text-align: left; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-eta-main { font-size: 12px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-dest-line { min-width: 0; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arr-dest { overflow-wrap: anywhere; word-break: keep-all; white-space: normal; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-line-tabs { gap: 4px; padding: 2px 0; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-line-tab { flex: 1 1 auto; padding: 6px 5px; font-size: 10.5px; overflow-wrap: anywhere; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-board { border-radius: 9px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-head { padding: 7px 8px; font-size: 10px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-head b { font-size: 10.5px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 9px; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-dest { overflow: visible; font-size: clamp(18px, 6vw, 27px); white-space: normal; overflow-wrap: anywhere; word-break: keep-all; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-eta { align-items: flex-start; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-eta strong { font-size: clamp(17px, 5.5vw, 25px); }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-position { max-width: 100%; font-size: 10.5px; white-space: normal; overflow-wrap: anywhere; word-break: keep-all; text-align: left; }
    .line-panel.horizontal-mode.split-mode .horizontal-board .selected-arrivals .arrival-led-source { font-size: 9.5px; }
}
@media (max-width: 767px) {
    .line-panel.split-mode > #lineDiagramWrap { scrollbar-width: none; background: var(--surface-2); border-color: transparent; }
    .line-panel.split-mode > #lineDiagramWrap::-webkit-scrollbar { display: none; }
}
@media (max-width: 767px) {
    /* 분할(세로) 보기: '10초마다 자동 갱신…' 안내는 본문(좌우 칸) 아래, 스크롤 최하단에 둔다. */
    .line-panel.split-mode > #lineRefreshHint { grid-row: 20; margin: 6px 12px 14px; padding: 8px 11px; font-size: 11.5px; font-weight: 600; line-height: 1.5; }
    .line-panel.split-mode > #lineRefreshHint[hidden] { display: none; }
}
/* 분할(세로) 보기: 상행선/하행선을 고르면 왼쪽 LIVE에는 그 방향 선로·열차만 남긴다. */
.line-panel.split-mode .line-diagram-train { transition: opacity .18s ease, filter .18s ease; }
.line-panel.split-mode .line-diagram-wrap.direction-up .line-diagram-train-down,
.line-panel.split-mode .line-diagram-wrap.direction-up .line-diagram-track-down,
.line-panel.split-mode .line-diagram-wrap.direction-up .line-diagram-station-down,
.line-panel.split-mode .line-diagram-wrap.direction-down .line-diagram-train-up,
.line-panel.split-mode .line-diagram-wrap.direction-down .line-diagram-track-up,
.line-panel.split-mode .line-diagram-wrap.direction-down .line-diagram-station-up { display: none; }
.line-panel.split-mode .line-diagram-wrap.direction-up .line-diagram-train-up,
.line-panel.split-mode .line-diagram-wrap.direction-down .line-diagram-train-down { opacity: 1; filter: none; }
.app-info-note p.stale { color: var(--danger); }

/* 하단 고정 푸터 배너(광고 자리)는 숨기고, 본문이 화면 맨 아래까지 보이게 한다. */
.mobile-ad-slot { display: none !important; }

/* 선택 역명판 우측의 이름 신청 안내: 남는 폭이 120px 이상이면 역명판 오른쪽 두 줄로, 아주 긴 역명이면 역명판 아래로 내려가 항상 온전히 보인다. */
.station-promo { display: none; }
@media (max-width: 767px) {
    .app:not(.vertical-layout) .line-station-picker.has-selected-station:not(.station-all-mode) { flex-wrap: wrap; row-gap: 8px; }
    .app:not(.vertical-layout) .line-station-picker.has-selected-station:not(.station-all-mode) .station-promo {
        display: flex; flex: 1 1 128px; flex-direction: column; justify-content: center; min-width: 128px; padding: 6px 12px;
        border: 1px dashed color-mix(in srgb, var(--line-accent, var(--primary)) 55%, transparent); border-radius: 14px;
        background: color-mix(in srgb, var(--line-accent, var(--primary)) 12%, transparent); color: var(--ink-2);
        font-size: 12px; font-weight: 600; line-height: 1.35; letter-spacing: -.03em; white-space: nowrap;
    }
.app:not(.vertical-layout) .line-station-picker.has-selected-station .station-promo b { color: var(--line-accent, var(--primary)); font-size: 13px; font-weight: 800; }
}

/* 관리자 공통 신청 문구의 아이콘은 텍스트와 같은 안내 카드 안에서만 배치한다. */
.station-promo-content { display: flex; align-items: center; min-width: 0; width: 100%; }
.station-promo-content.icon-top { flex-direction: column; align-items: flex-start; }
.station-promo-content.icon-right .station-promo-icon { order: 2; margin: 0 0 0 7px; }
.station-promo-icon { flex: 0 0 auto; align-self: center; margin-right: 7px; font-size: 22px; line-height: 1; }
.station-promo-content.icon-top .station-promo-icon { align-self: flex-start; margin: 1px 0 4px; }
.station-promo-icon img { display: block; width: 28px; height: 28px; border-radius: 7px; object-fit: cover; }
.station-promo-copy { min-width: 0; width: 100%; }
.station-promo-copy span, .station-promo-copy b { display: block; }
.station-promo:not(.is-sponsor) { cursor: pointer; }
.station-promo:not(.is-sponsor):active { transform: scale(.985); }
/* 공통 신청 문구는 관리자가 저장한 효과로 첫째·둘째 줄을 순서대로 노출한다. */
.station-promo-copy:not(.promo-animation-none) span, .station-promo-copy:not(.promo-animation-none) b { animation-fill-mode: both; }
.promo-animation-typing span, .promo-animation-typing b { overflow: hidden; white-space: nowrap; width: 0; }
.promo-animation-typing span { animation: metro-promo-type .72s steps(var(--promo-steps-one, 12), end) .10s forwards; }
.promo-animation-typing b { animation: metro-promo-type .72s steps(var(--promo-steps-two, 8), end) .95s forwards; }
.promo-animation-fade-up span { animation: metro-promo-fade-up .45s ease-out .10s both; }
.promo-animation-fade-up b { animation: metro-promo-fade-up .45s ease-out .55s both; }
.promo-animation-slide-left span { animation: metro-promo-slide-left .46s ease-out .10s both; }
.promo-animation-slide-left b { animation: metro-promo-slide-left .46s ease-out .56s both; }
.promo-animation-pop span { animation: metro-promo-pop .38s cubic-bezier(.2,1.45,.45,1) .10s both; }
.promo-animation-pop b { animation: metro-promo-pop .38s cubic-bezier(.2,1.45,.45,1) .54s both; }
.promo-animation-shimmer span { animation: metro-promo-shimmer .85s ease-out .10s both; }
.promo-animation-shimmer b { animation: metro-promo-shimmer .85s ease-out .62s both; }
@keyframes metro-promo-type { to { width: 100%; } }
@keyframes metro-promo-fade-up { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes metro-promo-slide-left { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes metro-promo-pop { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
@keyframes metro-promo-shimmer { from { opacity: .15; filter: brightness(1.8); } to { opacity: 1; filter: brightness(1); } }
@media (prefers-reduced-motion: reduce) { .station-promo-copy span, .station-promo-copy b { animation: none !important; width: auto !important; } }

/* 광고주가 없는 공통 배너의 신청 안내 모달 */
.sponsor-apply-modal { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: rgba(8, 13, 24, .62); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.sponsor-apply-modal[hidden] { display: none !important; }
.sponsor-apply-dialog { position: relative; width: min(100%, 430px); margin: auto; padding: 25px 20px 20px; overflow: hidden; border: 1px solid #dfe6f0; border-radius: 24px; background: #fff; color: #172033; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.sponsor-apply-dialog::before { position: absolute; top: -74px; right: -58px; width: 190px; height: 190px; border-radius: 50%; background: #eaf2ff; content: ''; filter: blur(2px); }
.sponsor-apply-close { position: absolute; z-index: 1; top: 14px; right: 14px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #d9e1ed; border-radius: 50%; background: #f7f9fc; color: #344054; font-size: 23px; cursor: pointer; }
.sponsor-apply-kicker { position: relative; display: block; margin-bottom: 13px; color: #356fda; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.sponsor-apply-hero { position: relative; display: flex; align-items: flex-start; gap: 12px; }
.sponsor-apply-hero > i { display: grid; width: 45px; height: 45px; flex: none; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #4786ff, #6e55ff); font-size: 23px; font-style: normal; box-shadow: 0 7px 18px rgba(76, 117, 255, .35); }
.sponsor-apply-hero h2 { margin: 0; color: #172033; font-size: 23px; line-height: 1.18; letter-spacing: -.055em; }
.sponsor-apply-hero p { margin: 8px 0 0; color: #5e6b80; font-size: 13px; line-height: 1.55; }
.sponsor-apply-benefits { position: relative; display: grid; gap: 8px; margin: 21px 0 14px; }
.sponsor-apply-benefits > div { display: grid; grid-template-columns: 25px 1fr; column-gap: 8px; padding: 10px; border: 1px solid #e4ebf5; border-radius: 13px; background: #f8fbff; }
.sponsor-apply-benefits i { grid-row: span 2; display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: #e9f1ff; color: #356fda; font-size: 14px; font-style: normal; }
.sponsor-apply-benefits strong { font-size: 13px; }
.sponsor-apply-benefits span { margin-top: 2px; color: #637087; font-size: 11.5px; line-height: 1.35; }
.sponsor-apply-steps { position: relative; padding: 13px 14px 12px; border-radius: 14px; background: #f1f6ff; }
.sponsor-apply-steps b { font-size: 12.5px; }
.sponsor-apply-steps ol { display: grid; gap: 5px; margin: 8px 0 0; padding-left: 19px; color: #58677d; font-size: 12px; line-height: 1.4; }
.sponsor-apply-note { position: relative; margin: 13px 2px; color: #6d7c91; font-size: 11.5px; line-height: 1.5; }
.sponsor-apply-confirm { position: relative; width: 100%; padding: 13px; border: 0; border-radius: 13px; background: linear-gradient(100deg, #4b88ff, #6d61ff); color: #fff; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(69, 103, 255, .28); }
@media (min-width: 768px) { .sponsor-apply-modal { padding-left: 270px; } }

/* 배너 신청 정보 입력은 앱 전체를 덮어 집중해서 작성한다. (DB 저장은 별도 연결 전까지 하지 않음) */
.sponsor-form-modal { position: fixed; z-index: 92; inset: 0; overflow-y: auto; background: var(--bg); color: var(--ink); }
.sponsor-form-modal[hidden] { display: none !important; }
.sponsor-form-header { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sponsor-form-header button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 25px; cursor: pointer; }
.sponsor-form-header span { display: block; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .11em; }
.sponsor-form-header h2 { margin: 2px 0 0; font-size: 18px; letter-spacing: -.04em; }
.sponsor-form-content { display: grid; gap: 18px; width: min(100%, 620px); margin: 0 auto; padding: 20px 16px calc(30px + env(safe-area-inset-bottom)); }
.sponsor-form-intro { display: flex; gap: 11px; padding: 15px; border: 1px solid #dce9ff; border-radius: 16px; background: #f3f8ff; }
.sponsor-form-intro i { display: grid; width: 37px; height: 37px; flex: none; place-items: center; border-radius: 12px; background: linear-gradient(145deg,#4786ff,#6e55ff); font-size: 19px; font-style: normal; }
.sponsor-form-intro strong { font-size: 14px; }.sponsor-form-intro p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.sponsor-form-section { display: grid; gap: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-1); }
.sponsor-form-section h3 { margin: 0 0 2px; font-size: 15px; }.sponsor-form-section h3 em { margin-left: 4px; color: var(--danger); font-size: 10px; font-style: normal; }
.sponsor-form-section label { display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 700; }.sponsor-form-section input, .sponsor-form-section textarea, .sponsor-form-section select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; outline: none; }.sponsor-form-section input:focus, .sponsor-form-section textarea:focus, .sponsor-form-section select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }.sponsor-form-section textarea { min-height: 88px; resize: vertical; }
.sponsor-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.sponsor-station-choice { display: grid; gap: 10px; padding: 13px; border: 1px solid #dce9ff; border-radius: 14px; background: #f6f9ff; }.sponsor-choice-title { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--ink); font-size:12px; }.sponsor-choice-title span { padding:4px 8px; border-radius:999px; background:#e6efff; color:var(--primary); font-size:10.5px; font-weight:800; }.sponsor-line-choice-list, .sponsor-station-choice-list { display:flex; flex-wrap:wrap; gap:7px; }.sponsor-line-choice-list button, .sponsor-station-choice-list button { min-height:36px; padding:7px 11px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink-2); font:inherit; font-size:12px; font-weight:800; cursor:pointer; }.sponsor-line-choice-list button.active { border-color:var(--primary); background:var(--primary); color:#fff; }.sponsor-station-choice-wrap { display:grid; gap:10px; padding-top:11px; border-top:1px solid #dce5f2; }.sponsor-station-choice-list { max-height:194px; padding:1px; overflow-y:auto; }.sponsor-station-choice-list button.active { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-strong); box-shadow:0 0 0 2px rgba(47,107,255,.12); }
.sponsor-banner-setting { display: grid; gap: 10px; padding: 13px; border: 1px solid #dce9ff; border-radius: 14px; background: #f6f9ff; }.sponsor-banner-setting strong { font-size: 13px; }.sponsor-banner-setting p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }.sponsor-banner-size { color: var(--muted); font-size: 10.5px; font-weight: 500; line-height: 1.4; }
.sponsor-form-consent { display: flex; align-items: flex-start; gap: 8px; padding: 2px; color: var(--ink-2); font-size: 12px; line-height: 1.45; }.sponsor-form-consent input { margin: 2px 0 0; accent-color: var(--primary); }
.sponsor-form-notice { margin: -8px 2px 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }.sponsor-form-submit { width: 100%; padding: 14px; border: 0; border-radius: 14px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; }.sponsor-form-error { min-height: 18px; margin: -9px 2px 0; color: var(--danger); font-size: 12px; }
@media (max-width: 360px) { .sponsor-form-grid { grid-template-columns: 1fr; } }

/* 역명 광고주: 광고주 이름이 들어가면 영역 전체가 의뢰 URL 링크가 된다(이름은 길면 2줄까지). */
.station-promo.is-sponsor { padding: 0 !important; border-style: solid !important; }
.station-promo-link { display: flex; flex-direction: column; justify-content: center; width: 100%; min-width: 0; padding: 6px 12px; color: inherit; text-decoration: none; white-space: normal; }
.station-promo-link span { color: var(--muted); font-size: 10.5px; font-weight: 600; line-height: 1.3; }
.station-promo-link b { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.25; word-break: keep-all; }
.station-promo-link:active { opacity: .7; }

/* 배너 이미지형 광고: 안내 영역 전체를 이미지가 채우고(자르기 맞춤), 우측 위에 작은 '광고' 표시를 둔다. */
.station-promo.has-image { position: relative; overflow: hidden; background: var(--surface-2) !important; }
.station-promo.has-image .station-promo-link { position: relative; padding: 0; height: 100%; min-height: 58px; }
.station-promo.has-image .station-promo-link img { display: block; width: 100%; height: 100%; min-height: 58px; object-fit: cover; }
.station-promo-ad { position: absolute; top: 3px; right: 4px; padding: 1px 5px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 9px; font-style: normal; font-weight: 700; line-height: 1.4; }

/* ---- 역별 광고주 모집: 초기 화면 하단 배너 + 사이드 메뉴 항목 ------------------------------ */
#emptySection .empty-state { min-height: calc(100dvh - 440px); padding-top: 28px; padding-bottom: 24px; }
.ad-recruit-banner { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 14px); z-index: 5; display: block; width: min(calc(100% - 24px), 360px); margin: 0 auto 14px; overflow: hidden; border-radius: 14px; box-shadow: var(--shadow-2); line-height: 0; -webkit-tap-highlight-color: transparent; }
.ad-recruit-banner img { display: block; width: 100%; height: auto; aspect-ratio: 320 / 100; }
.ad-recruit-banner:active { transform: scale(.985); }
a.side-menu-item { text-decoration: none; }
.mi-badge { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 11px; font-weight: 800; letter-spacing: -.01em; }

/* ---- 공통 안내 배너 아코디언: 선택 역·배너 아래로 안내 화면을 펼친다 ---------------------------- */
.station-promo[aria-expanded] { cursor: pointer; }
.promo-accordion { width: 100%; margin: 6px 0 0; overflow: hidden; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); box-shadow: none; max-height: 0; opacity: 0; transition: max-height .32s ease, opacity .25s ease; }
.promo-accordion[hidden] { display: none !important; }
.promo-accordion.open { max-height: min(78dvh, 640px); opacity: 1; }
.promo-accordion-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; }
.promo-accordion-bar strong { flex: 1; min-width: 0; font-size: 13px; }
.promo-accordion-bar a { color: var(--primary); font-weight: 700; text-decoration: none; white-space: nowrap; }
.promo-accordion-bar button { height: 32px; padding: 0 13px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.promo-accordion-bar button:active { transform: scale(.96); }
.promo-accordion-body iframe { display: block; width: 100%; height: min(64dvh, 520px); border: 0; background: #fff; }
.promo-accordion-note { margin: 0; padding: 6px 14px 8px; color: var(--subtle); font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .promo-accordion { transition: none; } }

/* ---- 역 선택 목록: 광고주가 등록된 역 표시 -------------------------------------------------- */
.pick-station { position: relative; }
.pick-station.has-sponsor:not(.selected) { border-color: #f5a200; background: color-mix(in srgb, #f5a200 13%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, #f5a200 45%, transparent); }
.pick-station.has-sponsor::after { position: absolute; top: -6px; right: -3px; padding: 1px 5px; border-radius: 7px; background: #f5a200; color: #3a2800; content: '광고'; font-size: 9px; font-weight: 800; line-height: 1.35; letter-spacing: -.02em; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.pick-sponsor-legend { display: flex; align-items: center; gap: 7px; margin: 2px 0 10px; padding: 8px 12px; border: 1px solid color-mix(in srgb, #f5a200 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, #f5a200 10%, var(--surface)); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.pick-sponsor-legend[hidden] { display: none; }
.pick-sponsor-legend i { padding: 1px 6px; border-radius: 7px; background: #f5a200; color: #3a2800; font-size: 10px; font-style: normal; font-weight: 800; }
.pick-sponsor-legend b { color: var(--ink); }

/* 아코디언 안내 화면 상단: '나도 배너광고 신청하기' 버튼 */
.promo-accordion-cta { padding: 10px 12px 0; background: var(--surface); }
.promo-accordion-cta[hidden] { display: none; }
.promo-accordion-cta button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 42px; border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); border-radius: 12px; background: var(--primary-soft); color: var(--primary-strong); font-size: 14px; font-weight: 800; cursor: pointer; }
.promo-accordion-cta button:active { transform: scale(.98); }

/* 배너 확장 화면을 접은 직후: 역명판·배너 아래의 All 버튼 + 같은 노선 역명 목록 */
.station-strip { flex: 0 0 100%; display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.station-strip[hidden] { display: none !important; }
.station-strip .sel-bar { width: 44px; height: 34px; margin: 0; border: 1.5px solid var(--line-accent, var(--primary)); border-radius: 11px; background: var(--surface); color: var(--line-accent, var(--primary)); font-size: 13px; font-weight: 800; box-shadow: var(--shadow-1); filter: none; writing-mode: horizontal-tb; text-orientation: mixed; }
.station-strip .line-station-list { flex: 1; min-width: 0; padding: 0 12px 0 0; -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%); }

/* 이미지 배너 위 문구(광고주 이름): 6곳(상·하 × 좌·중·우), 글자 크기·색은 관리자 지정값(--cap-size, --cap-color).
   글자색이 밝으면(.cap-light) 어두운 띠와 어두운 윤곽선, 어두우면(.cap-dark) 밝은 띠와 밝은 윤곽선으로 어떤 사진 위에서도 또렷하게 보이게 한다. */
.station-promo-caption { position: absolute; right: 0; left: 0; display: flex; align-items: center; justify-content: flex-start; box-sizing: border-box; height: var(--cap-h, 28px); padding: 0 10px; overflow: hidden; color: var(--cap-color, #fff); font-size: var(--cap-size, 13px); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; text-align: left; pointer-events: none; }
.station-promo-caption > span { display: -webkit-box; max-width: 100%; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; word-break: keep-all; }
.station-promo-caption.cap-light { text-shadow: 0 0 3px rgba(0, 0, 0, .95), 0 1px 2px rgba(0, 0, 0, .9), 1px 0 0 rgba(0, 0, 0, .8), -1px 0 0 rgba(0, 0, 0, .8), 0 1px 0 rgba(0, 0, 0, .8), 0 -1px 0 rgba(0, 0, 0, .8); }
.station-promo-caption.cap-dark { text-shadow: 0 0 3px rgba(255, 255, 255, .95), 0 1px 2px rgba(255, 255, 255, .9), 1px 0 0 rgba(255, 255, 255, .85), -1px 0 0 rgba(255, 255, 255, .85), 0 1px 0 rgba(255, 255, 255, .85), 0 -1px 0 rgba(255, 255, 255, .85); }
.station-promo-caption.pos-tl, .station-promo-caption.pos-tc, .station-promo-caption.pos-tr { top: 0; }
.station-promo-caption.pos-bl, .station-promo-caption.pos-bc, .station-promo-caption.pos-br { bottom: 0; }
.station-promo-caption.cap-light.pos-tl, .station-promo-caption.cap-light.pos-tc, .station-promo-caption.cap-light.pos-tr { background: linear-gradient(180deg, rgba(0, 0, 0, .8), rgba(0, 0, 0, .62) 65%, rgba(0, 0, 0, 0)); }
.station-promo-caption.cap-light.pos-bl, .station-promo-caption.cap-light.pos-bc, .station-promo-caption.cap-light.pos-br { background: linear-gradient(0deg, rgba(0, 0, 0, .8), rgba(0, 0, 0, .62) 65%, rgba(0, 0, 0, 0)); }
.station-promo-caption.cap-dark.pos-tl, .station-promo-caption.cap-dark.pos-tc, .station-promo-caption.cap-dark.pos-tr { background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .66) 65%, rgba(255, 255, 255, 0)); }
.station-promo-caption.cap-dark.pos-bl, .station-promo-caption.cap-dark.pos-bc, .station-promo-caption.cap-dark.pos-br { background: linear-gradient(0deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .66) 65%, rgba(255, 255, 255, 0)); }
.station-promo-caption.pos-tc, .station-promo-caption.pos-bc { justify-content: center; text-align: center; }
.station-promo-caption.pos-tr, .station-promo-caption.pos-br { justify-content: flex-end; text-align: right; }
/* 광고주 링크 안의 일반 span 규칙(.station-promo-link span: 작은 회색 글씨)이 캡션에 덮어쓰이지 않도록 한 단계 더 구체적으로 지정한다. */
.station-promo-link .station-promo-caption { color: var(--cap-color, #fff); font-size: var(--cap-size, 13px); font-weight: 800; line-height: 1.2; }
.station-promo-link .station-promo-caption > span { color: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; }

/* 메뉴에서 여는 전체 화면 모달(사용방법·개발자의 다른 앱) */
.fs-modal { position: fixed; inset: 0; z-index: 130; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
.fs-modal[hidden] { display: none !important; }
.fs-modal-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.fs-modal-head strong { text-align: center; font-size: 16px; font-weight: 800; }
.fs-modal-close, .fs-modal-x { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.fs-modal-frame { display: block; flex: 1; width: 100%; border: 0; background: #fff; }
.fs-modal-body { flex: 1; overflow-y: auto; }
.dev-apps-body { display: grid; place-items: center; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); }
.dev-apps-card { display: grid; gap: 12px; justify-items: center; width: min(100%, 420px); padding: 32px 22px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-2); text-align: center; }
.dev-apps-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--primary-soft); font-size: 36px; }
.dev-apps-card h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.dev-apps-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.dev-apps-go { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border-radius: 16px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 800; text-decoration: none; box-shadow: 0 10px 24px rgba(47, 107, 255, .3); }
.dev-apps-go:active { transform: scale(.98); }
.dev-apps-card small { color: var(--subtle); font-size: 12px; line-height: 1.55; }

/* 한 역의 배너가 랜덤으로 바뀔 때 부드럽게 나타나게 한다. */
.station-promo.is-sponsor .station-promo-link { animation: promoSwapIn .4s ease both; }
@keyframes promoSwapIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .station-promo.is-sponsor .station-promo-link { animation: none; } }

/* 텍스트 배너: 이미지 없이 글자·배경색으로 배너 칸(약 230×58px) 전체를 채운다. */
.station-promo.is-text-banner { overflow: hidden; border: 0 !important; background: transparent !important; }
.station-promo.is-text-banner .station-promo-link { height: 100%; min-height: 58px; padding: 0; }
.promo-textbanner { display: flex; align-items: center; justify-content: flex-start; box-sizing: border-box; width: 100%; height: 100%; min-height: 58px; padding: 6px 12px; background: var(--tb-bg, #2f6bff); color: var(--tb-color, #fff); font-size: var(--tb-size, 13px); font-weight: 800; line-height: 1.25; letter-spacing: -.02em; text-align: left; }
.promo-textbanner > span { display: -webkit-box; max-width: 100%; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: keep-all; }
.station-promo-link .promo-textbanner { color: var(--tb-color, #fff); font-size: var(--tb-size, 13px); font-weight: 800; line-height: 1.25; }
.station-promo-link .promo-textbanner > span { color: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; }
.promo-textbanner.tb-tl, .promo-textbanner.tb-tc, .promo-textbanner.tb-tr { align-items: flex-start; }
.promo-textbanner.tb-bl, .promo-textbanner.tb-bc, .promo-textbanner.tb-br { align-items: flex-end; }
.promo-textbanner.tb-tc, .promo-textbanner.tb-bc { justify-content: center; text-align: center; }
.promo-textbanner.tb-tr, .promo-textbanner.tb-br { justify-content: flex-end; text-align: right; }

/* 버스라이브 앱 전환 아이콘(버스라이브 헤더의 앱 마크와 같은 모양). 호선 선택 가로 보기에서는 공간을 위해 숨긴다. */
.bus-switch-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(140deg, #2f7bff 0%, #0f3d8f 100%); box-shadow: 0 4px 12px rgba(27, 108, 255, .38); text-decoration: none; transition: transform .15s; }
.bus-switch-btn:active { transform: scale(.94); }
.bus-switch-btn svg { width: 28px; height: 28px; }
@media (max-width: 767px) { .app-header.header-line-mode .bus-switch-btn { display: none; } }
