/* 지하철·버스 통합 사이트 (시험판 /next/) — 시안: 연한 회색 바탕 + 검은 글씨, 남은 시간 숫자를 크게 */
:root {
  --bg: #F3F4F0; --card: #FFFFFF; --ink: #15181C; --sub: #5B6169; --line: #E2E4DE; --chip-line: #D3D6CE;
  --accent: #1F4FD8; --accent-soft: #EEF1FB; --live: #17753F; --plan-ink: #7A5000; --plan-bg: #FFF1D2;
  --seg: #E4E6E0; --seg-on: #FFFFFF; --hl: #F6F8FE; --shadow: 0 1px 2px rgba(0, 0, 0, .12);
  --f: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111315; --card: #1B1E21; --ink: #ECEEF0; --sub: #A4AAB2; --line: #2B2F33; --chip-line: #3A3F44;
    --accent: #8AA8FF; --accent-soft: #1E2742; --live: #5BCB86; --plan-ink: #F2C66D; --plan-bg: #3A2E12;
    --seg: #24282C; --seg-on: #34393E; --hl: #1C2333; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111315; --card: #1B1E21; --ink: #ECEEF0; --sub: #A4AAB2; --line: #2B2F33; --chip-line: #3A3F44;
  --accent: #8AA8FF; --accent-soft: #1E2742; --live: #5BCB86; --plan-ink: #F2C66D; --plan-bg: #3A2E12;
  --seg: #24282C; --seg-on: #34393E; --hl: #1C2333; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
a { color: inherit; }
button { font: inherit; color: inherit; }
#app { max-width: 560px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.num { font-variant-numeric: tabular-nums; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 머리 */
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 8px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; }
.brand { min-width: 0; }
.brand b { font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.brand small { white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--plan-ink); background: var(--plan-bg); border-radius: 6px; padding: 1px 6px; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--seg); }
.top-r { display: flex; align-items: center; gap: 4px; }
.way-btn { height: 40px; padding: 0 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; flex: none; }

/* 검색 칸 */
.search { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.search label { font-size: 13px; font-weight: 600; color: var(--sub); padding-left: 4px; }
.sbox { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 6px 0 16px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; }
.sbox:focus-within { border-color: var(--accent); }
.sbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 17px var(--f); }
.sbox input::-webkit-search-cancel-button { display: none; }
.loc-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.loc-btn.busy { opacity: .5; }

/* 덩어리 */
.sec { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; }
.sec-h h2 { margin: 0; font-size: 15px; font-weight: 700; }
.sec-h span, .sec-h .lk { font-size: 13px; color: var(--sub); }
.sec-h .lk { background: none; border: 0; padding: 6px 4px; cursor: pointer; text-decoration: underline; }
.list { display: flex; flex-direction: column; background: var(--card); border-radius: 14px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer; }
.list > .row:first-child { border-top: 0; }
.row:hover { background: var(--hl); }
.row .ic { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.row .ic.st { background: color-mix(in srgb, var(--c, #0052A4) 16%, transparent); color: var(--c, #0052A4); }
.row .ic.bs { background: color-mix(in srgb, var(--live) 16%, transparent); color: var(--live); }
.row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .tx b { font-size: 15px; }
.row .tx .s { font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rt { font-size: 13px; color: var(--sub); flex: none; }
.row .pv { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; margin-top: 1px; }
.row .pv span { display: inline-flex; gap: 3px; align-items: baseline; white-space: nowrap; }
.row .pv i { font-style: normal; font-weight: 700; }
.row .pv em { font-style: normal; color: var(--sub); font-variant-numeric: tabular-nums; }
.row .pv em.soon { color: #D6332B; font-weight: 600; }
.hl { color: var(--accent); }
.msg { margin: 0; padding: 16px; font-size: 14px; color: var(--sub); line-height: 1.6; white-space: pre-line; }
.note { margin: 10px 4px 0; font-size: 12px; color: var(--sub); line-height: 1.5; }
.more { align-self: center; padding: 10px 14px; font-size: 14px; color: var(--accent); background: none; border: 0; cursor: pointer; }

/* 노선 표시 */
.lb { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; white-space: nowrap; }
.bn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 22px; padding: 0 7px; border-radius: 7px; font-size: 13px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.lines { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* 고르는 칩 · 묶는 방식 */
.ctl { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--chip-line); background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.seg { display: flex; padding: 3px; gap: 2px; background: var(--seg); border-radius: 10px; }
.seg button { height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--sub); font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* 역 결과 */
.st-head { display: flex; align-items: center; gap: 4px; padding: 12px 0 0; margin-left: -8px; }
.st-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.st-head .star { margin-left: auto; color: #C98A00; }
.st-meta { margin: 2px 4px 0; font-size: 13px; color: var(--sub); }
.grp { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.grp-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; }
.grp-h h2 { margin: 0; font-size: 15px; font-weight: 700; }
.grp-h span { font-size: 12px; color: var(--sub); flex: none; }
.arr { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 10px 16px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.list > .arr:first-child { border-top: 0; }
a.arr:hover { background: var(--hl); }
.arr .eta { width: 56px; flex: none; display: flex; align-items: baseline; justify-content: flex-end; gap: 1px; white-space: nowrap; }
.arr .eta b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.arr .eta b.w { font-size: 17px; }
.arr .eta span { font-size: 13px; font-weight: 600; }
.arr .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.arr .ln { display: flex; align-items: center; gap: 6px; min-width: 0; }
.arr .ln b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr .s { font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr .side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tag-live { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--live); }
.tag-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag-plan, .tag-miss { font-size: 12px; font-weight: 600; color: var(--plan-ink); background: var(--plan-bg); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.walk { font-size: 12px; color: var(--sub); white-space: nowrap; }
.xtag { font-size: 11px; font-weight: 700; border-radius: 5px; padding: 0 5px; flex: none; }
.xtag.exp { color: #fff; background: #D6332B; }
.xtag.last { color: var(--plan-ink); background: var(--plan-bg); }
.btns { margin-top: 14px; display: flex; gap: 8px; }
.btns a { flex: 1; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--card); font-size: 14px; font-weight: 600; text-decoration: none; }

/* 아래 */
.foot { margin-top: 32px; padding: 16px 4px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--sub); line-height: 1.6; }
.foot a { color: var(--sub); }
.foot p { margin: 0 0 6px; }
