/* 광주 버스 개편 길잡이 — 유니버설 디자인: 큰 글자, 넉넉한 터치 영역, 색 + 글자로 구분 */
:root {
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --ink: #15171A;
  --sub: #374151;
  --mute: #4B5563;
  --line: #E5E7EB;
  --soft: #F1F3F6;
  --brand: #1B3A8C;
  --brand-soft: #EEF2FB;
  --ok-bg: #E6F4EC;
  --ok-ink: #0B4F33;
  --warn-bg: #FFF8D6;
  --warn-tag: #FFE45C;
  --k-express: #C8102E;
  --k-trunk: #C2560B;
  --k-branch: #0F7B4F;
  --k-village: #6B3FA0;
  --k-direct: #A3122A;
  --k-regional: #475569;
  --r: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --card: #1B1E24; --ink: #F2F3F5; --sub: #D1D5DB; --mute: #C1C7D0;
    --line: #2C313A; --soft: #252932; --brand: #8FB0FF; --brand-soft: #1E2740;
    --ok-bg: #12352A; --ok-ink: #B8EBCF; --warn-bg: #3A3210; color-scheme: dark;
  }
}
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
html.big { font-size: 131.25%; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
main { max-width: 640px; margin: 0 auto; padding: 0 1rem 2rem; display: flex; flex-direction: column; gap: 1rem; }
a { color: var(--brand); }
h1, h2, p { margin: 0; }
h2 { font-size: 1.05rem; }
button, input { font: inherit; color: inherit; }
svg { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.leaflet-container svg { width: auto; height: auto; flex-shrink: initial; }
.leaflet-control .btn-solid { min-height: 44px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* 머리 */
.hd { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); padding: .3rem .6rem .6rem; }
.hd-row { max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.hd-back { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.hd-name { font-weight: 800; font-size: .9rem; color: var(--ink); text-decoration: none; }
.hd-big { min-height: 44px; padding: 0 .6rem; border: 0; background: none; color: var(--brand); font-weight: 800; font-size: .85rem; cursor: pointer; }
.hd-search { max-width: 640px; margin: .2rem auto 0; display: flex; align-items: center; gap: .5rem; background: var(--soft); border-radius: 12px; padding: 0 .8rem; height: 52px; color: var(--mute); }
.hd-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 1rem; color: var(--ink); }

/* 꼬리 */
.ft { max-width: 640px; margin: 1.5rem auto 0; padding: 1.2rem 1rem 2.5rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--mute); text-align: center; line-height: 1.8; }
.ft b { color: var(--ink); }

/* 공통 블록 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.btn-line, .btn-solid, .btn-pill { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: 0 1rem; border-radius: 14px; font-weight: 800; font-size: .95rem; cursor: pointer; text-decoration: none; }
.btn-line { border: 1.5px solid var(--brand); background: var(--card); color: var(--brand); }
.btn-solid { border: 0; background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-solid { color: #10162A; } }
.wide { width: 100%; }
.link { font-weight: 800; }
.hint { font-size: .9rem; color: var(--mute); }
.lead { font-size: 1rem; color: var(--sub); }
.tag-warn { display: inline-block; padding: .1rem .5rem; border-radius: 6px; background: var(--warn-tag); color: #15171A; font-size: .8rem; font-weight: 900; }
.warn { background: var(--warn-bg); border: 2px solid var(--ink); border-radius: 16px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.warn p { font-size: 1rem; line-height: 1.6; }
.warn a { font-weight: 800; }

/* 배지: 색 + 번호. 종류 글자는 화면 문장으로 따로 쓴다 */
.badge { display: inline-flex; align-items: center; justify-content: center; flex-direction: column; min-width: 3.3rem; height: 2.9rem; padding: 0 .4rem; border-radius: 12px; color: #fff; font-weight: 900; font-size: 1.4rem; letter-spacing: -.5px; line-height: 1; flex-shrink: 0; }
.badge.b-long { font-size: 1rem; }
.b-region { font-size: .7rem; font-weight: 800; margin-bottom: .15rem; }
.k-express { background: var(--k-express); } .k-trunk { background: var(--k-trunk); } .k-branch { background: var(--k-branch); }
.k-village { background: var(--k-village); } .k-direct { background: var(--k-direct); } .k-regional { background: var(--k-regional); }
.badge-lg { min-width: 4rem; height: 4rem; font-size: 1.8rem; border-radius: 16px; }
.badge-xl { min-width: 6rem; height: 6rem; font-size: 3rem; border-radius: 22px; }
.badge-old { background: var(--line); color: var(--mute); text-decoration: line-through; text-decoration-thickness: 3px; min-width: 4.4rem; height: 4.4rem; font-size: 1.9rem; border-radius: 18px; }
.ends { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1rem; }
.ends > span:first-child, .ends > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42%; }
.ends-line { flex: 1; display: flex; align-items: center; min-width: 1.5rem; }
.ends-line i { width: 12px; height: 12px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.ends-line b { flex: 1; height: 4px; background: currentColor; }

/* 홈 */
.pg-home main { padding-top: 0; }
.home-hero { margin: 0 -1rem; background: #1B3A8C; color: #fff; padding: 1.4rem 1.2rem 1.6rem; display: flex; flex-direction: column; gap: .8rem; }
.home-hero h1 { font-size: 1.75rem; line-height: 1.3; font-weight: 900; letter-spacing: -.5px; }
.home-hero p { color: #DCE4F7; font-size: .95rem; }
.big-search { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.big-search label { font-weight: 800; }
.big-input { display: flex; align-items: center; gap: .6rem; background: #fff; color: #4B5563; border-radius: 16px; padding: 0 1rem; height: 62px; }
.big-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 1.1rem; color: #15171A; }
.big-search .hint { color: #DCE4F7; }
.results, .saved { display: flex; flex-direction: column; gap: .6rem; }
.results h2 { margin-top: .4rem; }
.trap-card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.trap-hd { display: flex; align-items: center; gap: .5rem; }
.trap-hd h2 { font-size: 1.15rem; font-weight: 900; }
.trows { display: flex; flex-direction: column; gap: .5rem; }
.trow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; border-radius: 12px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 1rem; }
.trow .badge { height: 2.4rem; font-size: 1.2rem; min-width: 3rem; }
.tarrow { margin-left: auto; font-weight: 900; }
.more { font-size: .9rem; color: var(--sub); }
.menu { display: flex; flex-direction: column; gap: .6rem; }
.mrow { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); text-decoration: none; cursor: pointer; }
.mrow svg { color: var(--brand); width: 1.6em; height: 1.6em; stroke-width: 2; }
.mrow span { display: flex; flex-direction: column; }
.mrow small { color: var(--mute); font-size: .85rem; }

/* 검색 결과·카드 */
.rcards { display: flex; flex-direction: column; gap: .6rem; }
.rcard { display: flex; gap: .9rem; align-items: center; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.rcard > span:last-child { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.rcard small, .rcard > span > span { color: var(--sub); font-size: .9rem; }
.rcard.choice { border: 2px solid var(--line); flex-direction: column; align-items: flex-start; }
.choice-q { font-weight: 800; font-size: 1.05rem; }
.choice-row { display: flex; align-items: center; gap: .7rem; }
.sres { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.sres a { display: flex; justify-content: space-between; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sres a:last-child { border-bottom: 0; }
.sres small { color: var(--mute); }

/* 옛 번호 결과 */
.result { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1.4rem 1rem 1.2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; margin-top: 1rem; }
.result h1 { font-size: 1.55rem; line-height: 1.35; font-weight: 900; letter-spacing: -.5px; }
.result h1 em { font-style: normal; color: var(--k-branch); }
@media (prefers-color-scheme: dark) { .result h1 em { color: #7FD8A8; } }
.kicker { color: var(--mute); }
.swap { display: flex; align-items: center; gap: .8rem; }
.swap .arrow { width: 2.2rem; height: 2.2rem; }
.src { font-size: .9rem; }
.quote { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.quote span { font-size: .85rem; color: var(--mute); }
.quote p { font-size: 1.05rem; margin-top: .3rem; }
.acts-wide { display: grid; }
.check label { font-weight: 800; font-size: 1.05rem; }
.check input { height: 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); padding: 0 .9rem; font-size: 1.05rem; width: 100%; }
.check-out { display: flex; flex-direction: column; gap: .4rem; }
.ok, .no { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 12px; font-size: 1rem; }
.ok { background: var(--ok-bg); color: var(--ok-ink); }
.no { background: var(--soft); color: var(--sub); }
.ok a { color: inherit; font-weight: 800; }
.notice { display: flex; flex-direction: column; gap: .7rem; }
.notice figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.notice img { width: 100%; height: auto; display: block; }
.notice figcaption { padding: .6rem .9rem; font-size: .9rem; color: #374151; }
.links { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.links a { display: block; padding: .5rem 0; font-weight: 700; }

/* 노선 */
.pg-route main { padding-top: 0; }
.hero { margin: 0 -1rem; color: #fff; padding: 1.2rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.hero-top { display: flex; align-items: flex-end; gap: .8rem; flex-wrap: wrap; }
.hero-num { font-size: 4rem; font-weight: 900; line-height: .9; letter-spacing: -2px; }
.hero-chip { margin-bottom: .3rem; padding: .3rem .7rem; border-radius: 999px; background: #fff; color: #15171A; font-weight: 800; font-size: .9rem; }
.hero-kind { font-size: .9rem; opacity: .95; }
.acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-pill { min-height: 44px; border-radius: 22px; padding: 0 .9rem; border: 1.5px solid rgba(255,255,255,.85); background: transparent; color: inherit; }
.btn-pill[aria-pressed="true"] { background: #fff; color: #15171A; }
.from { border: 2px solid var(--brand); }
.from .when { font-size: 1.7rem; font-weight: 900; letter-spacing: -.5px; }
.from .when small { font-size: 1.1rem; font-weight: 700; color: var(--sub); }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--line); border-radius: 14px; padding: 4px; }
.tabs button { min-height: 48px; border: 0; border-radius: 11px; background: transparent; color: var(--sub); font-weight: 600; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 800; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dep { display: flex; flex-direction: column; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.dep b { font-size: 1.45rem; font-weight: 900; }
.sum { font-size: 1rem; }
.tt summary { cursor: pointer; font-weight: 800; color: var(--brand); padding: .4rem 0; min-height: 44px; display: flex; align-items: center; }
.tt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem 1rem; font-variant-numeric: tabular-nums; }
.tt-grid h3 { font-size: .9rem; margin: .4rem 0 .2rem; color: var(--sub); }
.tt-grid div { display: flex; flex-wrap: wrap; gap: .2rem .6rem; }
.tt-grid span.past { color: var(--mute); opacity: .6; }
.stops { display: flex; flex-direction: column; gap: .7rem; }
.stops-hd { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.line { margin: 0; padding: .4rem 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.line > li > a, .line > li > div { display: flex; gap: .8rem; padding: .7rem 1rem; color: var(--ink); text-decoration: none; position: relative; }
.st-dot { width: 22px; flex-shrink: 0; position: relative; }
.st-dot::before { content: ""; position: absolute; left: 9px; top: 0; bottom: -1.4rem; width: 4px; background: var(--k-color, var(--k-branch)); }
.st-dot::after { content: ""; position: absolute; left: 4px; top: .45rem; width: 9px; height: 9px; border-radius: 50%; border: 3px solid var(--k-color, var(--k-branch)); background: var(--card); }
.line > li:last-child .st-dot::before { display: none; }
.line > li:first-child .st-dot::after, .st-end .st-dot::after { background: var(--k-color, var(--k-branch)); }
.st-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.st-name { font-size: 1.02rem; }
.st-name small { color: var(--mute); font-size: .8rem; }
.st-tr { font-size: .82rem; color: var(--mute); }
.st-bus { align-self: flex-start; padding: .1rem .5rem; border-radius: 6px; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 800; }
.line li.here > a { background: var(--brand-soft); }
.line li.here .st-name { font-weight: 900; }
.line li.fold button { display: flex; gap: .8rem; width: 100%; padding: .55rem 1rem; border: 0; background: none; color: var(--brand); font-weight: 800; font-size: .95rem; text-align: left; cursor: pointer; min-height: 48px; align-items: center; }
.line li.fold .st-dot { align-self: stretch; }
.line li.fold .st-dot::before { top: -1.2rem; bottom: -1.2rem; background: repeating-linear-gradient(var(--k-color, var(--k-branch)) 0 6px, transparent 6px 11px); }
.line li.fold .st-dot::after { display: none; }
.line li.fold small { color: var(--sub); font-weight: 600; }
.notice > details > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; font-weight: 800; }
.notice > details > summary::after { content: "펼치기"; color: var(--brand); font-size: .9rem; }
.notice > details[open] > summary::after { content: "접기"; }
.notice > details > div { display: flex; flex-direction: column; gap: .7rem; margin-top: .7rem; }
.live-note { font-size: .85rem; color: var(--mute); }
.routemap { display: flex; flex-direction: column; gap: .6rem; }
.routemap figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.routemap img { width: 100%; height: auto; display: block; }
.routemap figcaption { padding: .5rem .9rem; font-size: .85rem; color: #374151; }
.map-acts { display: flex; flex-wrap: wrap; gap: .5rem; }
.map-acts > * { flex: 1 1 12rem; }
.notice h2 small { font-weight: 600; font-size: .8rem; color: var(--mute); margin-left: .3rem; }
.btn-pill.kakao, .btn-solid.kakao, .btn-line.kakao { background: #FEE500; color: rgba(0,0,0,.85); border-color: #FEE500; }
.btn-other.dark { color: var(--brand); align-self: center; }
.btn-other {min-height: 44px; padding: 0 .6rem; border: 0; background: none; color: inherit; font-size: .85rem; font-weight: 700; text-decoration: underline; cursor: pointer; opacity: .9; }
.map { height: 360px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.mapbox { display: flex; flex-direction: column; gap: .6rem; }

/* 정류장 */
.stop-hd { margin: 0 -1rem; background: var(--card); border-bottom: 1px solid var(--line); padding: 1rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .8rem; }
.stop-title { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; flex-wrap: wrap; }
.stop-title h1 { font-size: 1.8rem; font-weight: 900; letter-spacing: -.5px; }
.stop-title p { color: var(--sub); font-size: .92rem; }
.stop-title .btn-pill { border-color: var(--brand); color: var(--brand); }
.stop-title .btn-pill[aria-pressed="true"] { background: var(--brand); color: #fff; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem; }
.summary div { background: var(--soft); border-radius: 12px; padding: .6rem .3rem; display: flex; flex-direction: column; align-items: center; }
.summary b { font-size: 1.4rem; }
.summary span { font-size: .85rem; }
.pair { font-size: .9rem; color: var(--sub); }
.pair a { font-weight: 700; }
.stop-list { display: flex; flex-direction: column; gap: .5rem; }
.live-status { font-size: .85rem; color: var(--mute); }
.live-status.on { color: var(--ok-ink); font-weight: 700; }
.rows { margin: 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rows li { border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows li.trap { background: var(--warn-bg); }
.rows a { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; color: var(--ink); text-decoration: none; }
.row-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.row-old { font-size: .82rem; color: var(--sub); }
.row-dest { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-mid .tag-warn { align-self: flex-start; margin-top: .2rem; }
.row-time { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex-shrink: 0; }
.row-time b { font-size: 1.1rem; font-weight: 900; }
.row-time span { font-size: .8rem; color: var(--sub); }
.row-time .live { color: var(--brand); }
.row-time .soon { color: #B42318; }
@media (prefers-color-scheme: dark) { .row-time .soon { color: #FF9B8F; } }

/* 전체 목록 */
.clist { margin: 0; padding: 0; list-style: none; }
.clist li { border-bottom: 1px solid var(--line); }
.clist li:last-child { border-bottom: 0; }
.clist a { display: flex; gap: .5rem; align-items: baseline; padding: .7rem 0; color: var(--ink); text-decoration: none; }
.clist a b { margin-left: auto; text-align: right; }
.clist .cw { color: var(--mute); font-size: .85rem; }
.clist p { font-size: .85rem; color: var(--sub); padding-bottom: .6rem; }
.nearby { display: flex; flex-direction: column; gap: .4rem; }

#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: #15171A; color: #fff; padding: .7rem 1rem; border-radius: 12px; font-size: .95rem; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 2rem); }
#toast.show { opacity: 1; }

@media print {
  .hd, .ft, .acts, .tabs, .mapbox, .check, #toast { display: none !important; }
  body { background: #fff; }
}
