/* bus.grepboard.com — www 와 같은 색 토큰 · 화이트 기본 · 다크 선택. 외부 글꼴·이미지 없음 */
:root, :root[data-theme="light"] {
  --bg: #f7f6f2; --paper: #ffffff; --ink: #1b1d21; --muted: #5f646d; --faint: #8a8f97;
  --line: #e4e1d9; --rule: #cdc8bb; --accent: #0a5fb8; --accent-2: #b4530a;
  --chip: #eef1f5; --mark: #fff3c4; --ad: #efede7;
  --land: #e9e6dc; --land-line: #c9c4b4; --dot: #0a5fb8; --sel: #d6291f;
}
:root[data-theme="dark"] {
  --bg: #0d1015; --paper: #12161d; --ink: #e2e7ed; --muted: #9aa4b0; --faint: #6f7a86;
  --line: #222a34; --rule: #2f3a47; --accent: #6cb2ff; --accent-2: #f0a35e;
  --chip: #1a212b; --mark: #3a3214; --ad: #171d26;
  --land: #1a212b; --land-line: #2f3a47; --dot: #6cb2ff; --sel: #ff6b5e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.68 system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, time, .mono, .num, .crumbs, .meta, .n, .sec, .kind { font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "D2Coding", monospace; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 16px; min-height: 52px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; color: var(--ink); font-weight: 750; font-size: 20px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .b1 { color: var(--accent); }
.brand .slash { color: var(--rule); margin: 0 8px; font-weight: 400; }
.brand .tg { font: 500 14px/1 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); letter-spacing: 0; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.nav > a { color: var(--ink); }
.theme { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 6px; width: 32px; height: 28px; cursor: pointer; font-size: 14px; }
:root[data-theme="light"] .theme .sun, :root[data-theme="dark"] .theme .moon { display: none; }

.layout { padding-top: 24px; padding-bottom: 48px; }
.layout.has-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.layout main { min-width: 0; }
h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.02em; margin: 0 0 10px; }
.sec { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin: 28px 0 10px; }
.n { color: var(--faint); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.lede { font-size: 17px; border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; margin: 0 0 22px; }
.meta { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--accent-2); }

/* 찾기 */
.hero { margin-bottom: 18px; }
.finder { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pick { position: relative; flex: 1 1 220px; min-width: 0; }
.pick label { display: block; font: 700 12px/1 ui-monospace, Menlo, monospace; letter-spacing: .08em; color: var(--muted); margin-bottom: 5px; }
.pick input { width: 100%; height: 44px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 0 12px; font: 16px system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; outline: none; }
.pick input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--chip); }
.arrow { color: var(--faint); font-size: 20px; line-height: 44px; }
.opts { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); max-height: 300px; overflow: auto; }
.opts button { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--ink); text-align: left; padding: 9px 12px; font: 15px system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; cursor: pointer; }
.opts button:hover, .opts button.on { background: var(--chip); }
.opts .r { color: var(--faint); font: 12px ui-monospace, Menlo, monospace; align-self: center; }
.go { height: 44px; line-height: 44px; padding: 0 18px; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 650; white-space: nowrap; }
.go:hover { text-decoration: none; filter: brightness(1.1); }
.go[hidden], .opts[hidden] { display: none; }
.msg { min-height: 1.6em; margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* 지도 */
.mapbox { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 0 0 22px; }
.mapbox .cap { margin: 4px 6px 2px; color: var(--faint); font-size: 12.5px; }
.mapbox.small { max-width: 640px; }
.map { display: block; width: 100%; height: auto; max-height: 78vh; margin: 0 auto; }
#map { max-width: 560px; }
.land { fill: var(--land); stroke: var(--land-line); stroke-width: .8; vector-effect: non-scaling-stroke; }
.dot { fill: var(--dot); stroke: var(--paper); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.dot:hover { fill: var(--accent-2); }
.dot.dest { fill: var(--accent-2); }
.dot.sel { fill: var(--sel); stroke: var(--paper); stroke-width: 1.5; }
.halo { fill: var(--sel); opacity: .5; transform-box: fill-box; transform-origin: center; animation: pulse 1.1s ease-out infinite; pointer-events: none; }
.link { stroke: var(--sel); stroke-width: 2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; animation: dash 1s linear infinite; pointer-events: none; }
@keyframes pulse { 0% { transform: scale(.35); opacity: .75; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes dash { to { stroke-dashoffset: -11; } }
@media (prefers-reduced-motion: reduce) { .halo, .link { animation: none; } }

/* 표 */
.tablewrap { overflow-x: auto; border-top: 2px solid var(--ink); }
.tbl { border-collapse: collapse; width: 100%; font-size: 15px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px dotted var(--rule); }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover { background: var(--chip); }
.tbl tr.past { color: var(--faint); }
.tbl tr.nx { background: var(--mark); font-weight: 650; }
.kind { font-size: 11px; color: var(--accent-2); border: 1px dashed var(--accent-2); border-radius: 4px; padding: 0 5px; margin-left: 8px; }

/* 다음 차 */
.nextbox { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--sel); border-radius: 0 8px 8px 0; padding: 4px 16px 12px; margin: 0 0 20px; }
.nextbox .sec { margin-top: 10px; }
.next { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.next li { background: var(--chip); border-radius: 8px; padding: 8px 14px; font-size: 14px; line-height: 1.4; }
.next li b { display: block; font: 700 20px/1.2 ui-monospace, Menlo, Consolas, monospace; }
.next li.n { background: transparent; padding: 0; }
.facts ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.facts li { margin: 4px 0; }

.cols { list-style: none; margin: 0; padding: 0; columns: 3 220px; column-gap: 24px; }
.cols li { break-inside: avoid; padding: 5px 0; border-bottom: 1px dotted var(--rule); display: flex; justify-content: space-between; gap: 8px; }
.regions { display: flex; gap: 6px; flex-wrap: wrap; font-size: 14px; margin: 0 0 18px; }
.regions a, .regions .cur { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.regions .cur { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* 광고 자리(--preview-ads) */
.ad { background: var(--ad); border: 1px dashed var(--rule); color: var(--faint); display: flex; align-items: center; justify-content: center; font: 12px ui-monospace, Menlo, monospace; margin: 16px 0; }
.ad-wide { height: 90px; }
.ad-rail { height: 600px; position: sticky; top: 16px; margin: 0; }
.rail { display: none; }

.foot { border-top: 1px solid var(--line); background: var(--paper); padding: 18px 0 28px; color: var(--muted); font-size: 13px; }
.foot .notice { margin: 0 0 10px; max-width: 820px; line-height: 1.6; }
.foot .fl { display: flex; gap: 16px; flex-wrap: wrap; margin: 0; }

@media (min-width: 1000px) { .rail { display: block; } }
@media (max-width: 999px) { .layout.has-rail { display: block; } }
@media (max-width: 600px) {
  h1 { font-size: 23px; }
  .arrow { display: none; }
  .tbl { font-size: 14px; }
  .tbl th, .tbl td { padding: 7px 6px; }
  .nav > a:nth-child(2) { display: none; }
}
.tbl tr.tbd { color: var(--faint); }
/* 데이터 점검 안내(오래된 시간표 · 확인 중) */
.note { color: var(--muted); font-size: 15px; }
.note.warn { background: var(--mark); color: var(--ink); border-left: 3px solid var(--sel); border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 0 0 18px; }
.nextbox .base { display: block; margin: -4px 0 8px; color: var(--accent-2); font-size: 12.5px; }
/* 공식 예매처 안내 — 요약 줄 바로 아래 · 기준일 줄과 같은 결(상자 없음) */
.meta.book { font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; margin: -12px 0 6px; line-height: 1.55; }
.meta.book b { font-weight: 600; color: var(--ink); }
.meta.book .bk-short { display: none; }
.meta.book .bk-n { white-space: nowrap; }   /* 앱 이름이 「티머니 / GO」처럼 끊기지 않게 */
.foot .notice.book { margin-top: -4px; }
@media (max-width: 600px) {
  .meta.book { font-size: 12px; letter-spacing: -.01em; }
  .meta.book .bk-long { display: none; }
  .meta.book .bk-short { display: inline; }
  .meta.book .bk-x { display: none; }   /* 「고속버스:」→「고속:」 — 두 줄 안에 */
  .meta.book.both { font-size: 11.5px; word-spacing: -.08em; }   /* 고속·시외 함께인 노선만 — 두 줄 안에 */
}

/* train 덧붙임 — 요일 묶음(펼침) · 정차역 칸. bus/src/style.css 뒤에 붙는다 */
details.dow { border-top: 1px solid var(--line); margin: 0; }
details.dow:last-of-type { border-bottom: 1px solid var(--line); }
details.dow > summary { cursor: pointer; padding: 10px 2px; list-style: none; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
details.dow > summary::-webkit-details-marker { display: none; }
details.dow > summary::before { content: "▸"; color: var(--faint); width: 1em; }
details.dow[open] > summary::before { content: "▾"; }
details.dow > summary b { font-size: 15px; }
details.dow[data-today] > summary b::after { content: " 오늘"; color: var(--sel); font-size: 12px; font-weight: 600; }
details.dow .tablewrap { margin-bottom: 14px; }
.dow-none { margin: 8px 0; }
.tbl td.stops { color: var(--muted); font-size: 13px; }
.meta.recent { color: var(--ink); }
.meta.recent b { color: var(--sel); }
@media (max-width: 600px) { .tbl td.stops { font-size: 12px; min-width: 7.5em; } }
