/* 디자인 시스템 (design-system/bus-commute/MASTER.md): ui-ux-pro-max 스킬이 낸 색·글꼴(검정 + 금색, 명조 제목)을 모든 화면이 같이 쓴다.
   색은 화면마다 hex 를 쓰지 말고 아래 이름(토큰)으로만 쓴다. 글자 대비 4.5:1 이상(밝은·어두운 화면 둘 다 확인) */
:root {
  /* 색: ui-ux-pro-max 스킬 값 그대로 (design-system/bus-commute/MASTER.md, "premium transit" · Minimalism & Swiss Style · 검정 + 금색) */
  --bg: #fafaf9;              /* Background */
  --surface: #ffffff;         /* Card */
  --surface-2: #f5f5f4;       /* 옅은 판 (Muted 계열, 따뜻한 돌색) */
  --text: #0c0a09;            /* Foreground */
  --muted: #57534e;           /* Muted Foreground (돌색 계열, 7:1) */
  --line: #d6d3d1;            /* Border */
  --ring: #1c1917;            /* Primary / Ring: 키보드 초점·선택 표시 */
  --accent: #a16207;          /* Accent: 금색 링크·강조 (바탕과 4.7:1) */
  --secondary: #44403c;       /* Secondary */
  --accent-fill: #a16207;     /* Accent/CTA: 주 버튼 바탕 */
  --on-accent: #ffffff;       /* On Accent (4.9:1) */
  --destructive: #dc2626;
  /* 혼잡 상태 (버스 캐릭터·차내 막대·쾌적도 칩): 여유 청록 → 보통 회청 → 혼잡 주황 → 만차 빨강 */
  --relaxed: #0b7a70;
  --normal: #64748b;
  --crowded: #f5a524;
  --full: #ef5350;
  --radius: 6px;              /* Swiss: 각진 모서리 */
  --radius-lg: 10px;
  /* 판은 그림자 없이 1px 테두리로만 나눈다 */
  --shadow: 0 0 0 1px var(--line);
  /* 한 줄 답 판: 흰 판 + 상태 색 글자 (흰 바탕에서 4.5:1 이상) */
  --board: var(--surface); --board-dim: var(--muted);
  --led-green: #15803d; --led-amber: #b45309; --led-red: #b91c1c; --led-white: var(--text);
  /* 글꼴: 스킬 추천은 Cormorant(제목) · Montserrat(본문). 둘 다 한글이 없어 스킬 google-fonts 의 한국어 글꼴을 쓴다.
     제목 = Hahmlet 명조 (Cormorant 숫자는 아래로 처지는 옛 숫자꼴이라 한글과 줄이 안 맞아 제목 숫자도 Hahmlet), 본문 = Montserrat + Noto Sans KR */
  --font-body: "Montserrat", "Noto Sans KR", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-display: "Hahmlet", "Noto Serif KR", "AppleMyungjo", serif;
  /* 간격(스킬 밀도 5/10)·아이콘 크기·누르는 곳 최소 크기 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px;
  --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px;
  --tap: 44px;
  /* 움직임 (emil-design-eng): 누름 160ms · 작은 변화 200ms · 시트 250ms, 기본 곡선보다 힘 있는 곡선. ease-in 은 쓰지 않는다 */
  --dur-press: 160ms; --dur-fast: 200ms; --dur-base: 250ms;
  --ease-out: cubic-bezier(.23, 1, .32, 1);        /* 나타나기·누름: 바로 반응하고 부드럽게 멈춘다 */
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);    /* 화면 안에서 자리 옮기기 */
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);     /* 아래에서 올라오는 시트 (iOS 시트 곡선) */
  /* 떠 있는 것(시트·안내 창·도움말 버튼)의 그림자와 뒤를 덮는 막. 따뜻한 검정(돌색) 계열로 맞춘다 */
  --scrim: rgba(12, 10, 9, .72);
  --shadow-float: 0 8px 30px rgba(12, 10, 9, .22);
  --shadow-sheet: 0 -8px 30px rgba(12, 10, 9, .18);
  /* 색 판 위 글자 (hallmark 대비 점검: 4.5:1 이상). 혼잡 주황 판은 흰 글자가 2:1 이라 검은 글자 */
  --on-fill: #ffffff; --on-fill-dark: #1c1917;
  --on-relaxed: var(--on-fill); --on-crowded: var(--on-fill-dark);
  --full-strong: #c62828;     /* 작은 글자가 얹히는 만차 빨강 판 (흰 글자 5.6:1). 막대·점은 --full 그대로 */
  --toast-bg: var(--text); --toast-fg: var(--bg);
  /* 서울버스 노선 유형 색 (번호판·카드 띠). 노랑·연두 번호판은 글자를 어둡게 */
  --rt-간선: #0068b7; --rt-지선: #2e8b22; --rt-광역: #d3121c; --rt-순환: #f2b70a;
  --rt-마을: #8dbb2e; --rt-심야: #1f3a6b; --rt-기타: #5b6372;
  color-scheme: light dark;   /* 스크롤바·입력칸·선택 상자도 화면 밝기를 따른다 (web-design-guidelines) */
}
@media (prefers-color-scheme: dark) {
  /* 스킬은 밝은 화면 값만 내므로, 같은 돌색(stone) 계열 + 밝은 금색으로 어두운 화면을 맞추고 대비를 따로 확인했다 */
  :root:not([data-theme="light"]) {
    --bg: #0c0a09; --surface: #1c1917; --surface-2: #292524; --text: #fafaf9; --muted: #a8a29e; --line: #44403c;
    --ring: #fafaf9; --accent: #d4a72c; --accent-fill: #d4a72c; --on-accent: #0c0a09; --secondary: #d6d3d1; --relaxed: #2bb3a4;
    --led-green: #4ade80; --led-amber: #fbbf24; --led-red: #f87171;
    --on-relaxed: var(--on-fill-dark);  /* 밝은 청록 판 위 흰 글자는 2.6:1 이라 검은 글자 */
    --scrim: rgba(0, 0, 0, .72);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.notice { background: var(--surface-2); color: var(--muted); text-align: center; font-size: 13px; padding: 6px 16px; }
.notice:empty { display: none; }
.notice summary { cursor: pointer; list-style: none; }
.notice summary::-webkit-details-marker { display: none; }
.notice__more { text-decoration: underline; margin-left: 4px; }
.notice details p { margin: 6px auto 2px; max-width: 720px; text-align: left; line-height: 1.5; }

/* ---------- 검색 ---------- */
.hero { max-width: 560px; margin: 0 auto; padding: 56px 16px; text-align: center; }
.hero h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.25; margin: 12px 0; }
.search { display: flex; gap: 8px; margin-top: 24px; }
.search input {
  flex: 1; min-width: 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 16px;
}
.search button { padding: 0 20px; border: 0; border-radius: 12px; background: var(--accent-fill); color: var(--on-accent); font-weight: 700; }
.search-results { list-style: none; padding: 0; margin: 8px 0 0; text-align: left; }
.search-results button {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 6px;
}
.search-results .empty { padding: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 20px; font-size: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; }

/* ---------- 결과 레이아웃 ---------- */
.layout { max-width: 1180px; margin: 0 auto; padding: 16px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .layout { max-width: 820px; }
  body.detail-open .layout { max-width: 1180px; grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
  .col-detail { position: sticky; top: 48px; }
}
.result-head { display: flex; gap: 12px; align-items: center; }
.result-head h2 { margin: 0; font-size: 22px; }
.result-head p { margin: 0; font-size: 14px; }
.back, .close { border: 0; background: var(--surface); border-radius: 50%; width: 36px; height: 36px; box-shadow: var(--shadow); flex: none; }

.headline {
  margin-top: 16px; padding: 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  display: flex; gap: 16px; align-items: center; border-left: 6px solid var(--normal);
}
.headline[data-state="relaxed"] { border-left-color: var(--relaxed); }
.headline[data-state="crowded"] { border-left-color: var(--crowded); }
.headline[data-state="full"] { border-left-color: var(--full); }
.headline__bus { flex: none; }
.headline[data-state="full"] .bus { animation: shake .4s var(--ease-in-out) 2; }
.headline__text { margin: 0; font-size: clamp(17px, 2.6vw, 21px); font-weight: 700; word-break: keep-all; }
@media (max-width: 520px) {
  .headline { flex-direction: column; text-align: center; }
}

.controls { margin-top: 16px; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tabs { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; }
.tab { border: 0; background: transparent; padding: 6px 18px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.slider { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.slider input { flex: 1; accent-color: var(--accent); }
.slider-value { text-align: center; font-weight: 700; margin-top: 4px; }

.map-card { margin-top: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
#osm-map { height: 300px; border-radius: inherit; z-index: 0; }
.tabs--day { margin-left: 8px; }
#mini-map { display: block; width: 100%; height: auto; max-height: 300px;
  background: repeating-linear-gradient(0deg, transparent 0 79px, var(--line) 79px 80px),
              repeating-linear-gradient(90deg, transparent 0 79px, var(--line) 79px 80px); }
#mini-map .ring { fill: none; stroke: var(--accent); stroke-dasharray: 8 10; opacity: .35; stroke-width: 3; }
#mini-map .ring-label { fill: var(--muted); font-size: 24px; }
#mini-map .walk-line { stroke: var(--muted); stroke-dasharray: 6 8; stroke-width: 3; opacity: .5; }
#mini-map .home rect { fill: var(--text); }
#mini-map .home text, #mini-map .pin__emoji { text-anchor: middle; font-size: 30px; }
#mini-map .pin__dot { fill: var(--normal); stroke: var(--surface); stroke-width: 6; }
#mini-map .pin--relaxed .pin__dot { fill: var(--relaxed); }
#mini-map .pin--crowded .pin__dot { fill: var(--crowded); }
#mini-map .pin--full .pin__dot { fill: var(--full); }
#mini-map .pin__label { text-anchor: middle; font-size: 26px; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 8px; }
#mini-map .pin__routes { text-anchor: middle; font-size: 22px; fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 8px; }

.list-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.list-head h3 { margin: 0; }
.sort button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.sort button.is-active { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---------- 노선 카드 ---------- */
.cards { display: grid; gap: 10px; margin-top: 10px; }
.card {
  display: flex; gap: 12px; text-align: left; width: 100%; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--rt-c, var(--line));
}
.card__bus { flex: none; align-self: center; }
.card__body { flex: 1; min-width: 0; }
.card__title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.card__title .plate { font-size: 18px; }

/* ---------- 노선 번호판 ---------- */
[data-rt] { --rt-c: var(--rt-기타); }
[data-rt="간선"] { --rt-c: var(--rt-간선); }
[data-rt="지선"] { --rt-c: var(--rt-지선); }
[data-rt="광역"] { --rt-c: var(--rt-광역); }
[data-rt="순환"] { --rt-c: var(--rt-순환); }
[data-rt="마을"] { --rt-c: var(--rt-마을); }
[data-rt="심야"] { --rt-c: var(--rt-심야); }
.rt { display: inline-flex; align-items: baseline; gap: 5px; flex: none; }
.rt small { font-size: 12px; font-weight: 600; color: var(--muted); }
.plate {
  display: inline-block; min-width: 2.6em; padding: .12em .45em; border-radius: 4px; text-align: center;
  background: var(--rt-c); color: var(--on-fill); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.3;
}
.plate[data-rt="순환"], .plate[data-rt="마을"] { color: var(--on-fill-dark); }
.plate[data-rt=""] { background: var(--muted); }
/* 지하철 구간 번호판: 서울 지하철 노선색 (목록에 없는 노선은 기타 회색) */
[data-rt="1호선"] { --rt-c: #0052a4; } [data-rt="2호선"] { --rt-c: #00a84d; } [data-rt="3호선"] { --rt-c: #ef7c1c; }
[data-rt="4호선"] { --rt-c: #00a5de; } [data-rt="5호선"] { --rt-c: #996cac; } [data-rt="6호선"] { --rt-c: #cd7c2f; }
[data-rt="7호선"] { --rt-c: #747f00; } [data-rt="8호선"] { --rt-c: #e6186c; } [data-rt="9호선"] { --rt-c: #bdb092; }
[data-rt="신분당선"] { --rt-c: #d4003b; } [data-rt="공항철도"] { --rt-c: #0090d2; } [data-rt="수인분당선"] { --rt-c: #f5a200; }
[data-rt="경의중앙선"] { --rt-c: #77c4a3; }
/* 흰 글자 대비가 4.5:1 이 안 되는 밝은 노선색은 검은 글자 (2·3·4·6호선 2.8~3.2:1, 공항철도 3.6:1) */
.plate[data-rt="9호선"], .plate[data-rt="수인분당선"], .plate[data-rt="경의중앙선"],
.plate[data-rt="2호선"], .plate[data-rt="3호선"], .plate[data-rt="4호선"], .plate[data-rt="6호선"], .plate[data-rt="공항철도"] { color: var(--on-fill-dark); }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.card__main { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.prob b { font-size: 20px; }
.comfort { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: var(--on-fill); background: var(--normal); }
.comfort--여유 { background: var(--relaxed); color: var(--on-relaxed); }
.comfort--혼잡 { background: var(--crowded); color: var(--on-crowded); }
.comfort--매우혼잡 { background: var(--full-strong); }
.card__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2px 12px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.card__grid b { color: var(--text); }
.loadbar { position: relative; height: 6px; background: var(--bg); border-radius: 3px; margin-top: 8px; }
.loadbar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--normal); }
.card--relaxed .loadbar i { background: var(--relaxed); }
.card--crowded .loadbar i { background: var(--crowded); }
.card--full .loadbar i { background: var(--full); }
.loadbar em { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--muted); }
@media (max-width: 520px) { .card__bus .bus { width: 56px; height: 42px; } }

.mockup-link { display: block; text-align: center; margin: 24px 0 40px; padding: 14px; border-radius: var(--radius);
  border: 2px dashed var(--line); color: var(--accent); text-decoration: none; font-weight: 700; }

/* ---------- 상세 ---------- */
.col-detail { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; position: relative; }
.col-detail h3 { margin: 0 40px 0 0; }
.col-detail h4 { margin: 24px 0 4px; }
.col-detail .close { position: absolute; top: 14px; right: 14px; font-size: 20px; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
@media (max-width: 959px) {
  .col-detail { position: fixed; inset: 0; z-index: 30; border-radius: 0; overflow-y: auto; padding-top: 48px; }
  .col-detail .close { top: 44px; }
  body.detail-open { overflow: hidden; }
}

.along__plot { position: relative; height: 170px; display: flex; gap: 4px; align-items: flex-end; border-bottom: 1px solid var(--line); margin-top: 22px; }
.bar { flex: 1; height: 100%; position: relative; display: flex; align-items: flex-end; }
.bar i { display: block; width: 100%; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--muted) 35%, var(--surface)); }
.bar.is-over i { background: color-mix(in srgb, var(--full) 45%, var(--surface)); }
.bar.is-target i { background: var(--accent); }
.bar.is-target.is-over i { background: var(--full); }
.bar__val { position: absolute; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.bar.is-target .bar__val { color: var(--text); font-weight: 700; }
.cap-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--full); z-index: 2; pointer-events: none; }
.cap-line span { position: absolute; right: 0; top: -20px; font-size: 11px; color: var(--full); font-weight: 700; background: var(--surface); padding: 0 4px; }
.along__names { display: flex; gap: 4px; margin-top: 4px; }
.along__names span { flex: 1; font-size: 10px; color: var(--muted); text-align: center; word-break: keep-all; line-height: 1.2; }
.along__names .is-target { color: var(--accent); font-weight: 700; }

.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; font-size: 13px; }
.day { display: flex; flex-direction: column; align-items: center; background: var(--bg); border-radius: 12px; padding: 8px 2px; }
.day .bus { width: 46px; height: 35px; }

.method { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin: 8px 0; }
.method dt { color: var(--muted); }
.method dd { margin: 0; }
.disclaimer { font-size: 12px; color: var(--muted); background: var(--bg); padding: 8px 10px; border-radius: 8px; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .bus { animation: none !important; } }

.more-cards { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

/* 그날 그 시각 (past) */
.past-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 12px; align-items: end; }
.past-controls label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.past-controls select { font: inherit; color: var(--text); padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.past-controls .wide { grid-column: 1 / -1; }
.step { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 13px; color: var(--text); }
.past .headline { margin-top: 16px; }
.card.is-boarded { outline: 2px solid var(--accent); }
.card.is-skipped { opacity: .9; }
.badge--ok { background: var(--accent-fill); color: var(--on-accent); }
.badge--no { background: var(--full-strong); color: var(--on-fill); }
.profile-card { margin: 16px 0 40px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.profile-card h4 { margin: 0 0 4px; }
.past .along__names span { font-size: 9px; }
a.back { display: grid; place-items: center; text-decoration: none; color: inherit; }
.along__names .flow { font-style: normal; color: var(--muted); }
.along__names span, .along__plot .bar { min-width: 0; overflow-wrap: anywhere; }

.vstats { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; }

/* 검색 모드·지도 고르기 */
.mode-tabs { margin-top: 20px; }
.search-results .small { font-size: 12px; }
.search-results button { display: grid; gap: 2px; }
.search-map-card { margin-top: 20px; text-align: left; }
#search-map, .pick-map { height: 340px; border-radius: var(--radius); box-shadow: var(--shadow); z-index: 0; }
.popup-btn { margin-top: 6px; border: 0; border-radius: 8px; background: var(--accent-fill); color: var(--on-accent); padding: 4px 10px; font-weight: 600; }
.no-map-note { margin-top: 16px; background: var(--surface); padding: 12px 14px; border-radius: var(--radius); }

/* 노선 화면 */
.layout--single { display: block; max-width: 860px; }
#route-map { height: 380px; border-radius: inherit; z-index: 0; }
.map-note { padding: 8px 12px; margin: 0; }
.step-hint { margin: 14px 0 0; font-weight: 700; }
.trip-card { margin-top: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border-left: 6px solid var(--normal); }
.trip-card.card--relaxed { border-left-color: var(--relaxed); }
.trip-card.card--crowded { border-left-color: var(--crowded); }
.trip-card.card--full { border-left-color: var(--full); }
.trip-head { display: flex; gap: 12px; align-items: center; }
.trip-title { font-size: 17px; word-break: keep-all; }
.trip-card h4 { margin: 16px 0 0; }
.route-stops-title { margin: 24px 0 8px; }
.route-stops { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 4px; }
.route-stops button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; }
.route-stops .ord { color: var(--muted); font-size: 12px; min-width: 2.2em; }
.route-stops em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--on-fill); border-radius: 999px; padding: 1px 8px; }
.route-stops .is-from { border-color: var(--accent); }
.route-stops .is-from em { background: var(--accent-fill); color: var(--on-accent); }
.route-stops .is-to { border-color: var(--full); }
.route-stops .is-to em { background: var(--full-strong); }
.route-stops .is-between { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }

/* '그날 그 시각' 진입 강조 */
.past-cta { display: flex; gap: 14px; align-items: center; margin: 28px 0 8px; padding: 18px 18px; border-radius: var(--radius);
  text-decoration: none; text-align: left; color: var(--text); background: var(--surface); }
.past-cta__icon { font-size: 34px; flex: none; }
.past-cta__body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.past-cta__body b { font-size: 18px; word-break: keep-all; }
.past-cta__body span { font-size: 13px; opacity: .92; word-break: keep-all; }
.past-cta__body em { font-style: normal; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.past-cta__go { flex: none; font-weight: 700; background: var(--surface-2); padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.past-cta--inline { margin: 16px 0 0; padding: 12px 14px; box-shadow: none; }
.past-cta--inline .past-cta__icon { font-size: 24px; }
.past-cta--inline .past-cta__body b { font-size: 15px; }

/* 그날 그 시각: 검색 */
.past-search { margin-top: 16px; }
.past-search .mode-tabs { margin-top: 0; }
.past-search .search { margin-top: 12px; }
.stop-hit { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 6px; display: grid; gap: 2px; }
.stop-hit__note { font-size: 14px; font-weight: 700; color: var(--accent); word-break: keep-all; }
.route-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.search-results .route-chips .chip { width: auto; display: inline-block; margin: 0; padding: 4px 12px; border-radius: 999px; font-weight: 600; }

/* 주소·장소로 지도 찾기 */
.search-results .geo-item { border-style: dashed; border-color: var(--accent); }
.search-results .geo-item.is-strong { border-style: solid; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.search-results .geo-place b { color: var(--accent); }
.geo-credit { padding: 4px 2px; }
.past-search .search-map-card { margin-top: 12px; }

/* 위치 출퇴근 점수 */
.score-card { margin-top: 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: left; }
.score-card h3 { margin: 0 0 8px; font-size: 17px; word-break: keep-all; }
.score-card h4 { margin: 16px 0 6px; }
.score-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.score-head { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg); }
.score-head p { margin: 0; font-size: 14px; word-break: keep-all; }
.score-num { font-size: 40px; font-weight: 800; line-height: 1; }
.score-num small { font-size: 14px; font-weight: 600; color: var(--muted); }
.score-grade { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--on-fill); background: var(--normal); }
.grade-A .score-grade { background: var(--relaxed); color: var(--on-relaxed); }
.grade-C .score-grade { background: var(--crowded); color: var(--on-crowded); }
.grade-D .score-grade, .grade-E .score-grade { background: var(--full); }
.score-rows { display: grid; gap: 8px; margin-top: 8px; }
.score-row { display: grid; grid-template-columns: 9em 1fr auto; gap: 2px 8px; align-items: center; font-size: 13px; }
.score-row__bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.score-row__bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.score-row b small { color: var(--muted); font-weight: 500; }
.score-row__detail { grid-column: 1 / -1; font-size: 12px; }
.score-routes button { display: grid; gap: 0; }
.score-route__nums { font-size: 12px; color: var(--muted); }

/* 출퇴근 라인 커뮤니티 */
.community .controls { margin-top: 16px; }
.rules { margin-top: 16px; background: var(--surface-2); border-radius: var(--radius); padding: 12px 16px; font-size: 14px; }
.rules summary { font-weight: 700; cursor: pointer; }
.rules ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.c-title { margin: 4px 0 8px; font-size: 16px; }
.c-groups { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.c-groups button, .od-pick .search-results button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.c-groups .empty { padding: 8px 2px; font-size: 13px; }
.c-find .mode-tabs { margin: 0 0 8px; }
.c-when { margin-top: 12px; }
.od-pick { display: grid; gap: 4px; }
.od-pick label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.od-pick input, .write input, .write select, .write textarea { font: inherit; color: var(--text); padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.od-picked { margin: 0; font-weight: 700; color: var(--accent); font-size: 14px; }
.primary-btn { margin-top: 12px; width: 100%; border: 0; border-radius: 12px; padding: 12px; background: var(--accent-fill); color: var(--on-accent); font-weight: 700; }
.primary-btn:disabled { opacity: .55; cursor: not-allowed; }
.primary-btn.is-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.link-btn { border: 0; background: none; color: var(--accent); padding: 4px 0; font-weight: 600; }
.link-btn:disabled { color: var(--muted); }
.group-head h3 { margin: 6px 0 2px; word-break: keep-all; }
.group-head p { margin: 2px 0; font-size: 14px; }
.g-stats { color: var(--accent); font-weight: 600; }
.write { display: grid; gap: 8px; }
.write .primary-btn { margin: 0; width: auto; padding: 8px 18px; }
.write-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.write-row input { flex: 1; min-width: 0; }
.w-error { margin: 0; color: var(--full); font-size: 13px; font-weight: 600; }
.c-cats { justify-content: flex-start; margin-top: 16px; }
.chip.is-active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.posts { list-style: none; padding: 0; margin: 10px 0 40px; display: grid; gap: 8px; }
.post { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.post__head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.post__body { margin: 6px 0 2px; white-space: pre-wrap; word-break: break-word; }
.post__actions { text-align: right; font-size: 13px; }
.posts .empty { padding: 12px 2px; }
.small { font-size: 12px; }
.community-cta { display: flex; gap: 12px; align-items: center; margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius);
  text-decoration: none; color: var(--text); background: var(--surface); border: 2px solid var(--relaxed); text-align: left; }
.community-cta b { display: block; }
.community-cta span { font-size: 13px; color: var(--muted); }
.community-cta em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--relaxed); white-space: nowrap; }
.write-row select { flex: 0 1 auto; min-width: 0; max-width: 48%; }
.write textarea { width: 100%; resize: vertical; }



/* 공통: 출퇴근 시각, 최근 본 항목, 지도 안내, 토스트 */
.commute-ctl { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: center; margin-top: 12px; font-size: 14px; }
.commute-ctl label { display: inline-flex; gap: 4px; align-items: center; }
.commute-ctl input { font: inherit; color: var(--text); padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.past-controls .commute-ctl { justify-content: flex-start; margin-top: 0; align-self: end; }
.recent-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); padding: 4px 2px; }
.search-results .recent-item { border-style: dashed; }
.map-badge { background: var(--toast-bg); color: var(--toast-fg); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px; margin: 8px 8px 0 0 !important; }
.more-features { margin-top: 28px; display: grid; gap: 4px; }
.more-features .past-cta { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--toast-bg); color: var(--toast-fg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); text-align: center; }

/* 그날 그 시각: 직접 고르기 접기, 선택 상자 넘침 */
.past-controls label, .past-controls select { min-width: 0; max-width: 100%; }
.manual { display: grid; gap: 8px; }
/* 지도에서 지금 고른 정류장 강조 (geo.js highlight): 빨간 점 + 바깥으로 번지는 고리 */
.stop-mark { border-radius: 50%; border: 4px solid var(--full); background: radial-gradient(circle, var(--full) 0 7px, var(--on-fill) 7px 10px, color-mix(in srgb, var(--full) 18%, transparent) 10px); box-shadow: 0 0 0 0 color-mix(in srgb, var(--full) 55%, transparent); animation: stop-mark-pulse 1.6s var(--ease-out) 3; }
@keyframes stop-mark-pulse { to { box-shadow: 0 0 0 22px color-mix(in srgb, var(--full) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .stop-mark { animation: none; box-shadow: 0 0 0 8px color-mix(in srgb, var(--full) 25%, transparent); } }
/* 가는 방향 화살표: 다음 정류장 자리에 놓고 진행 방향으로 돌린다 */
.stop-arrow i { display: block; width: 30px; height: 30px; padding: 3px; }
.stop-arrow svg { display: block; width: 100%; height: 100%; fill: var(--full); stroke: var(--on-fill); stroke-width: 2; stroke-linejoin: round; paint-order: stroke; }
/* 노선 선 위에 일정 간격으로 놓는 작은 방향 화살표: 흰 화살표에 노선 유형 색(--rc) 테두리 */
.route-arrow i { display: block; width: 18px; height: 18px; padding: 2px; }
.route-arrow svg { display: block; width: 100%; height: 100%; fill: var(--on-fill); stroke: var(--rc); stroke-width: 3; stroke-linejoin: round; paint-order: stroke; }
.leaflet-tooltip.stop-mark__label { font-weight: 700; color: var(--full-strong); border-color: var(--full); }
.manual__title { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.manual label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* 노선 화면: 출근/퇴근, 다시 고르기, 목록 좁히기 */
#route-dir-tabs { margin-right: 6px; }
.step-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dir-note { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-size: 14px; }
.stop-filter { width: 100%; font: inherit; color: var(--text); padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }

/* 하단 탭 메뉴 */
body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 10px; font-size: 12px; color: var(--muted); text-decoration: none; }
.tabbar a span { font-size: 20px; line-height: 1; }
.tabbar a.is-active { color: var(--accent); font-weight: 700; }
.has-tabbar .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
.has-tabbar .col-detail { bottom: calc(64px + env(safe-area-inset-bottom)); }

/* 출퇴근 점수: 화면 아래에서 올라오는 시트 (접힘 = 점수 요약, 펼침 = 근거·노선) */
.score-card { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; margin: 0 auto; max-width: 560px; max-height: 45vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow-sheet); padding: 6px 16px 16px; animation: sheet-up var(--dur-base) var(--ease-drawer); overscroll-behavior: contain; }
.has-tabbar .score-card { bottom: calc(64px + env(safe-area-inset-bottom)); }
.score-card.is-expanded { max-height: 78vh; }
.score-card:not(.is-expanded) .sheet-detail { display: none; }
.sheet-bar { position: sticky; top: -6px; display: flex; justify-content: center; align-items: center; padding: 6px 0 8px; background: var(--surface); z-index: 1; }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line); cursor: pointer; }
.sheet-close { position: absolute; right: 0; top: 2px; border: 0; background: var(--bg); width: 30px; height: 30px; border-radius: 50%; font-size: 18px; line-height: 1; }
.sheet-more { display: block; margin: 8px auto 0; }
@media (prefers-reduced-motion: reduce) { .score-card { animation: none; } }

/* 노선 화면 정류장 목록 (B10): 상자 안 스크롤, 고른 곳 요약, 탈 곳 앞 정류장 흐리게 */
.route-stops-box { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--bg); margin-bottom: 40px; }
.route-stops-box .route-stops { margin: 0; }
.route-stops .is-before { opacity: .45; }
.pick-summary { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.pick-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-weight: 600; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-chip.is-from:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pick-chip.is-to:not(:disabled) { border-color: var(--full); color: var(--full); }
.pick-chip:disabled { color: var(--muted); cursor: not-allowed; }
/* 갈아타는 길: 넣은 구간 목록 */
.legs { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; counter-reset: leg; }
.legs li { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); counter-increment: leg; }
.legs li::before { content: counter(leg); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.legs li span { flex: 1; min-width: 0; word-break: keep-all; font-size: 14px; }
.legs .empty { border-style: dashed; color: var(--muted); }
.legs .empty::before { display: none; }
.leg-add { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--bg); }
.leg-add .chips { justify-content: flex-start; }
.leg-add .primary-btn { margin-top: 0; }
.leg-add input { font: inherit; color: var(--text); padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
#leg-route-results button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.leg-add .search { margin-top: 0; }
.leg-add .search input { flex: 1; min-width: 0; width: auto; }
.c-find .mode-tabs .tab { padding: 6px 10px; white-space: nowrap; }
.leg-add { grid-template-columns: minmax(0, 1fr); }
/* 도착지 기준 점수 */
.dest-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 4px 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg); font-size: 14px; }
.dest-bar span { min-width: 0; word-break: keep-all; }
.dest-bar .link-btn { flex: none; }
.dest-mode { margin: 0 0 8px; }
.dest-search { margin-top: 4px; }
.dest-search input { flex: 1; min-width: 0; }
.dest-results button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.score-routes button .score-route__nums + .score-route__nums { margin-top: 0; }

/* ---------- 오른쪽 위 '?' (사용법 다시 보기) ---------- */
.help-btn { position: fixed; top: 8px; right: 10px; z-index: 60; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--accent); font: inherit; font-size: 17px; font-weight: 800; box-shadow: var(--shadow-float); cursor: pointer; }
body:has(.help-btn) .notice { padding-right: 52px; min-height: 40px; display: flex; align-items: center; justify-content: center; }
body:has(.help-btn) .notice:empty { display: block; background: none; }
/* 두 번째 방문부터 안내 줄은 작고 흐리게 */
.notice.is-quiet { background: none; color: var(--muted); font-size: 12px; }

/* ---------- 처음 방문 안내 (코치마크): 화면을 어둡게, 설명할 곳만 밝게 ---------- */
.tour { position: fixed; inset: 0; z-index: 1000; cursor: pointer; }
.tour__hole { position: fixed; top: 0; left: 0; border-radius: 14px; box-shadow: 0 0 0 9999px var(--scrim); outline: 2px solid var(--surface);
  transition: transform var(--dur-base) var(--ease-in-out); will-change: transform; pointer-events: none; }
.tour__tip { position: fixed; left: 50%; transform: translateX(-50%); width: min(340px, calc(100vw - 32px)); padding: 14px 16px 10px;
  border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); cursor: default; }
.tour__text { margin: 0 0 10px; font-size: 16px; line-height: 1.5; word-break: keep-all; }
.tour__btns { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour__count { color: var(--muted); font-size: 13px; }
.tour__next { border: 0; border-radius: 10px; padding: 9px 18px; background: var(--accent-fill); color: var(--on-accent); font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- 접는 칸 (자세히 보기) ---------- */
.fold { margin-top: 10px; border-top: 1px solid var(--line); }
.fold > summary { cursor: pointer; padding: 10px 2px; font-size: 14px; font-weight: 700; color: var(--accent); list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after, .c-find > summary::after { content: "▾"; display: inline-block; margin-left: .3em; transition: transform var(--dur-fast) var(--ease-out); }
.fold[open] > summary::after, .c-find[open] > summary::after { transform: rotate(180deg); }
.fold--info > summary { color: var(--muted); font-weight: 600; font-size: 13px; text-align: center; }
.fold--more { border: 0; margin-top: 12px; }
.fold--more > summary { padding: 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.fold__facts { margin: 0 0 8px; font-size: 14px; word-break: keep-all; }
.sv-board { margin: 0 0 4px; font-size: 15px; word-break: keep-all; }
.sv-explore { display: block; margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

/* 직접 찾기 화면 */
.explore .mode-tabs { margin: 4px 0 8px; }
/* 직접 찾기: 무엇으로 찾을지 고르는 카드 세 장 (고른 것은 테두리·배경으로 표시) + 그 아래 한 줄 안내 */
.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-cards .tab { display: grid; gap: 2px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); text-align: left; color: var(--text); }
.mode-cards .tab b { font-size: 16px; }
.mode-cards .tab span { font-size: 13px; font-weight: 500; color: var(--muted); word-break: keep-all; }
.mode-cards .tab.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: none; }
.mode-help { margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; word-break: keep-all; }
@media (max-width: 480px) { .mode-cards { grid-template-columns: 1fr; } }
.explore .search input { flex: 1; min-width: 0; }

/* 그날 기록: 지금 보는 것 + 바꾸기 */
.past-change { margin: 8px 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.past-change__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.past-now { flex: 1; min-width: 0; display: grid; }
.past-change .controls { box-shadow: none; margin: 0; }
/* 항상 펼쳐 두므로 검색 결과·최근 본 목록이 길면 이 칸 안에서 넘긴다 (아래 목록·지도·결과가 밀려 내려가지 않게) */
.past-search .search-results { max-height: 300px; overflow-y: auto; }

/* 커뮤니티: 내 출근 라인 */
.my-line { width: 100%; display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; padding: 14px 16px; border: 0; border-radius: var(--radius);
  background: var(--accent-fill); color: var(--on-accent); font: inherit; text-align: left; box-shadow: var(--shadow); cursor: pointer; }
.my-line > span:first-child { font-size: 26px; }
.my-line > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.my-line small { opacity: .9; }
.my-line em { font-style: normal; font-weight: 700; }
.c-find > summary { cursor: pointer; list-style: none; }
.c-find > summary::-webkit-details-marker { display: none; }
.c-find > summary::after { color: var(--muted); }

/* ---------- 간편 모드 메인 ---------- */
/* 디자인: 답 하나를 크게 보여 주고 나머지는 조용하게 (design-system/bus-commute/MASTER.md) */
.simple { max-width: 520px; margin: 0 auto; padding: 12px 16px 24px; }
.simple-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 18px; }
.simple-hero__bus { order: 2; flex: none; }
.simple-hero__bus svg { display: block; width: 72px; height: auto; }
.simple-hero h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 10vw, 44px); line-height: 1.12; letter-spacing: -.01em; word-break: keep-all; }

/* 집 → 회사: 노선도처럼 점과 선으로 잇는다 (집 = 빈 점, 회사 = 찬 점) */
.sv-setup { display: grid; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 4px 0; }
.sv-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 58px; }
.sv-row__icon { flex: none; width: 22px; text-align: center; font-size: 18px; }
.sv-row:not(.sv-row--time) .sv-row__icon { font-size: 0; height: 22px; position: relative; }
.sv-row:not(.sv-row--time) .sv-row__icon::before {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 4px solid var(--accent); background: var(--surface); z-index: 1; }
.sv-row:nth-child(2) .sv-row__icon::before { background: var(--accent); }
.sv-row:first-child .sv-row__icon::after {
  content: ""; position: absolute; left: 9px; top: 11px; width: 4px; height: 58px; background: var(--accent); }
.sv-row.is-empty .sv-row__icon::before { border-color: var(--line); background: var(--surface); }
.sv-row:first-child.is-empty .sv-row__icon::after { background: var(--line); }
.sv-row__body { flex: 1; min-width: 0; display: grid; }
.sv-row__body small { color: var(--muted); font-size: 12px; }
.sv-row__body b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-row.is-empty b { color: var(--muted); font-weight: 600; }
.sv-row .link-btn { flex: none; padding: 8px 4px; }
.sv-find { display: flex; align-items: center; gap: 8px; margin: 6px 14px 10px; padding: 12px 14px; min-height: var(--tap); border: 1px solid var(--accent); border-radius: var(--radius); color: var(--accent); font-weight: 700; text-decoration: none; }
.sv-find .ic { width: 20px; height: 20px; margin: 0; }
.sv-find span { margin-left: auto; font-size: 20px; line-height: 1; }
.sv-row--time { border-top: 1px solid var(--line); margin-top: 4px; min-height: 50px; font-size: 14px; }
.sv-row--time .commute-ctl { flex: 1; margin: 0; justify-content: space-between; }
.sv-picker { margin-top: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.sv-picker__title { margin: 0 0 8px; font-weight: 700; word-break: keep-all; }
.sv-picker .search { margin-top: 0; }
.sv-picker .search input { flex: 1; min-width: 0; }
.sv-results button .ic { width: 16px; height: 16px; margin-right: 6px; vertical-align: -2px; color: var(--accent); }
.sv-map-wrap { margin-top: 12px; }
.sv-map { height: 260px; border-radius: var(--radius); box-shadow: var(--shadow); z-index: 0; }
.sv-map-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); word-break: keep-all; }
.sv-pin { color: var(--accent); filter: drop-shadow(0 1px 1px rgba(12, 10, 9, .35)); }
.sv-pin .ic { width: 36px; height: 36px; fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.sv-confirm { margin-top: 12px; display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
.sv-confirm__body { display: grid; gap: 2px; }
.sv-confirm__body b { word-break: keep-all; }
.sv-confirm .sv-more { margin-top: 0; }
.sv-results button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
#sv-result { margin-top: 14px; }
.sv-card { border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 14px; }
.sv-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); margin-bottom: 12px; }
.sv-seg button { border: 0; background: none; padding: 9px 4px; border-radius: 9px; font: inherit; font-weight: 700; color: var(--muted); }
.sv-seg button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* 한 줄 답 판: 납작한 흰 판 + 1px 테두리 + 위쪽 노선 색 띠, 답 글자 색은 상태(여유 초록 · 보통 기본 · 혼잡 주황 · 만차 빨강) */
.sv-verdict {
  --led: var(--led-white);
  position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 16px; border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow);
  border-top: 5px solid var(--rt-c, var(--board-dim)); color: var(--text);
}
.state-relaxed .sv-verdict { --led: var(--led-green); }
.state-crowded .sv-verdict { --led: var(--led-amber); }
.state-full .sv-verdict { --led: var(--led-red); }
.state-sleep .sv-verdict { --led: var(--board-dim); }
.sv-verdict__bus { order: 2; flex: none; margin-left: auto; }
.sv-verdict__bus svg { display: block; width: 64px; height: auto; }
.sv-verdict p { margin: 0; display: grid; gap: 6px; min-width: 0; }
.sv-verdict p span { color: var(--board-dim); font-size: 13px; }
.sv-verdict .plate { font-size: 14px; }
.sv-verdict p strong {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 7.4vw, 32px); line-height: 1.15; word-break: keep-all;
  color: var(--led);
  animation: led-in .7s steps(14, end) both;
}
/* 답 글자가 오른쪽에서 흘러 들어오듯 한 번 (답이 새로 나올 때만) */
@keyframes led-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .sv-verdict p strong { animation: none; } }

/* 숫자 세 개: 상자 없이 가는 세로줄로만 나눈다 */
.sv-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 12px; }
.sv-facts div { display: grid; gap: 2px; padding: 0 10px; border-left: 1px solid var(--line); }
.sv-facts div:first-child { border-left: 0; padding-left: 2px; }
.sv-facts b { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.05; }
.sv-facts small { color: var(--muted); font-size: 12px; word-break: keep-all; }
.sv-facts.is-two { grid-template-columns: repeat(2, 1fr); }
/* 갈아타는 길: 앉아서 갈 확률을 버스마다 한 줄씩 */
.sv-seats { margin: -2px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.sv-seats small { color: var(--muted); font-size: 12px; }
.sv-seats ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.sv-seats li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.sv-seats b { font-size: 16px; }
.sv-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sv-steps li { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; word-break: keep-all; }
.sv-more { margin-top: 12px; width: 100%; border: 0; border-radius: 10px; padding: 12px; background: var(--accent-fill); color: var(--on-accent); font: inherit; font-weight: 700; }
.sv-cta { margin-top: 12px; width: 100%; border: 1px dashed var(--accent); border-radius: 12px; padding: 12px; background: none; color: var(--accent); font: inherit; font-weight: 700; word-break: keep-all; }
.sv-foot { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.sv-h { margin: 22px 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.sv-others { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sv-others button { width: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; color: var(--text); }
.sv-others .plate { font-size: 16px; }
.sv-others span { text-align: right; font-size: 14px; }
.sv-others small { grid-column: 1 / -1; }
.sv-subway span { text-align: left; }
.sv-subway li > div { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.subway-route { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 6px; font-size: 14px; }
.sv-note { margin: 12px 0 0; color: var(--muted); font-size: 14px; word-break: keep-all; }
/* 간편 모드 노선 화면: 구간 결과를 지도보다 위로 (스크롤 없이 답부터) */
.mode-simple #view-route .layout { display: flex; flex-direction: column; }
.mode-simple #view-route .layout > * { order: 5; }
.mode-simple #view-route .result-head { order: 0; }
.mode-simple #view-route .controls { order: 1; }
.mode-simple #view-route #trip-result { order: 2; }
.mode-simple #view-route .step-row, .mode-simple #view-route .dir-note { order: 3; }
.sv-foot .link-btn { font-size: 12px; padding: 4px 0 0; }
/* 그날 기록: 앞뒤 버스 */
.bus-sep { margin: 14px 2px 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.bus-sep.is-now { color: var(--accent); border-top: 2px dashed var(--accent); padding-top: 8px; }
.card--mini { padding: 8px 12px; opacity: .85; }
.card--mini .card__title { gap: 6px; }
.card--mini .mini-load { display: grid; gap: 4px; font-size: 13px; }
.card--mini .loadbar { margin-top: 0; }

/* 키보드로 고를 때 초점 표시 */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* 커뮤니티 글쓰기 칸이 휴대폰 화면 밖으로 넘치지 않게 */
.write { grid-template-columns: minmax(0, 1fr); }
.write textarea { box-sizing: border-box; }
/* 최근 본 항목 제목 줄의 '지우기'는 목록 버튼 모양을 쓰지 않는다 */
.search-results .recent-head { border: 0; background: none; box-shadow: none; padding: 4px 2px; }
.search-results .recent-head .link-btn { width: auto; border: 0; background: none; box-shadow: none; padding: 4px; }

/* 경로 고르기 (출발·도착 → 실제로 다닌 길, /pick) */
.pick-date { display: block; margin: 8px 0; font-size: 14px; }
.pick-ends { position: relative; display: grid; gap: 8px; margin: 12px 0; }
/* 출발·도착 맞바꾸기: 두 칸 사이에 걸친 동그란 버튼 */
.pick-swap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(90deg); z-index: 1;
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; }
.pick-swap:disabled { opacity: .55; cursor: not-allowed; }
.pick-end { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.pick-end b { flex: 1; min-width: 0; }
.pick-end > .muted { flex: 1; }
.pick-end__label { font-size: 13px; color: var(--muted); width: 2.5em; }
.pick-search { margin: 8px 0 16px; }
.pick-chat { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.pick-msg { padding: 12px 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.pick-msg p { margin: 0 0 8px; }
.pick-msg--me { justify-self: end; max-width: 90%; border: 1px solid var(--accent); }
.pick-msg--me .rt { margin-right: 6px; }
.pick-opts { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); }
.pick-opt { width: 100%; text-align: left; display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
/* ① 노선 요약 + 걸린 시간 */
.pick-opt__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.pick-opt__lines .plate { font-size: 16px; }
.pick-opt__time { flex: none; white-space: nowrap; font-size: 14px; }
.pick-opt__time b { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
/* ② 다닌 사람·갈아타기 */
.pick-opt__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pick-tag { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--secondary); }
.pick-tag--top { color: var(--accent); font-weight: 700; }
/* ③ 걷기·탄 곳·내린 곳 단계: 왼쪽 세로 줄로 잇는다 */
.pick-steps { list-style: none; margin: 0; padding: var(--sp-3) 0 0; border-top: 1px solid var(--line); display: grid; gap: var(--sp-3); }
.pick-step { position: relative; display: grid; grid-template-columns: 76px 1fr; align-items: start; gap: var(--sp-3); }
.pick-step > .plate, .pick-step > .ic { justify-self: center; }
/* 네 자리 버스 번호(3426)가 좁은 칸에서 "342 / 6" 으로 꺾여 잘리지 않게 한 줄로 */
.pick-step > .plate { max-width: 100%; white-space: nowrap; font-size: 14px; }
.pick-step > .ic { width: 18px; height: 18px; color: var(--muted); }
.pick-step + .pick-step::before { content: ""; position: absolute; left: 37px; top: -12px; height: 12px; border-left: 2px dotted var(--line); }
.pick-step__where { display: grid; gap: 2px; min-width: 0; font-size: 15px; line-height: 1.35; word-break: keep-all; }
.pick-step__where small { font-size: 13px; }
.pick-step--walk small { font-size: 13px; }
.pick-opt__lines { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-badge { font-style: normal; font-size: 12px; font-weight: 700; color: var(--on-accent); background: var(--accent-fill); border-radius: 999px; padding: 1px 8px; justify-self: start; }
.pick-tools { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 0 !important; }
.pick-links { display: grid; gap: 8px; }
.pick-go { display: block; padding: 12px 14px; border-radius: 12px; background: var(--accent-fill); color: var(--on-accent); font-weight: 700; text-decoration: none; }
.pick-link { display: inline-block; margin: 4px 0 8px; }
.pick-opt.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pick-opt__lines .muted { align-self: center; }
.pick-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.pick-quick:empty { display: none; }
#pick-done .pick-msg { margin-top: 12px; }
/* 간편 모드: 점수 2가지 (기본 출퇴근 점수 + 출근지 기준 점수, 내 길마다) */
.sv-score-base, .sv-score-mine { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.sv-score-base { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sv-score-base > span { display: grid; gap: 2px; word-break: keep-all; }
.sv-score-mine > p { margin: 0 0 8px; word-break: keep-all; }
.sv-grade { flex: none; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display, inherit); font-size: 26px; font-weight: 600; white-space: nowrap; }
.sv-grade small { font-size: 13px; color: var(--muted); }
.sv-grade .score-grade { width: 30px; height: 30px; font-size: 16px; }
.sv-myroutes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sv-myroute { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.sv-myroute__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sv-myroute .link-btn { justify-self: start; padding: 4px 0 0; }
.sv-why { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.sv-why li { display: grid; }
.sv-scores .sv-cta { display: block; text-align: center; text-decoration: none; }
.pick-save { display: grid; gap: 8px; margin: 0 0 8px; }
.pick-save .pick-go { width: 100%; border: 0; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }

/* 하루 사용 횟수 다 썼을 때 광고 안내·보상형 광고 자리 (common.js useQuota) */
.quota { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: var(--scrim); overscroll-behavior: contain; }
.quota__box { width: min(340px, 100%); padding: 18px 18px 12px; border-radius: 14px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-float); }
.quota__title { margin: 0 0 6px; font-size: 17px; font-weight: 700; word-break: keep-all; }
.quota__text { margin: 0 0 14px; color: var(--muted); line-height: 1.5; word-break: keep-all; }
.quota__btns { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quota__ad { text-align: center; min-height: 240px; display: flex; flex-direction: column; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 10px, var(--bg) 10px, var(--bg) 20px); }
.quota__count { font-size: 28px; font-weight: 700; margin: 6px 0 14px; }

/* 점수 공유하기 카드 (share.js) */
.sv-share { display: block; margin: 8px 0 2px; font-weight: 700; }
.share-box { width: min(380px, 100%); padding: 12px; }
.share-card > svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.share-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; }
.share-btns .tour__next { flex: 1 0 100%; padding: 12px; }
.share-msg { margin: 6px 0 0; word-break: break-all; }

/* ==========================================================================
   전체 화면 공통 다듬기 (UI UX Pro Max 점검표 기준, design-system/bus-commute/MASTER.md)
   - 모든 화면이 첫 화면과 같은 색·글꼴을 쓴다 (위 :root 토큰)
   - 이모지 아이콘 → 한 벌의 선 아이콘 (common.js ic)
   - 누르는 곳은 44px 이상, 누르면 바로 반응, 키보드 초점 보임, 움직임 줄이기 설정 존중
   ========================================================================== */

/* 제목은 모든 화면에서 명조(Hahmlet) */
h1, h2, .c-title { font-family: var(--font-display); font-weight: 600; letter-spacing: -.005em; word-break: keep-all; }
.result-head h2 { font-size: 26px; line-height: 1.2; }

/* 아이콘: 글자 크기를 따라가고, 글자 색을 그대로 쓴다 */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; margin-right: .3em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic--on { fill: var(--crowded); stroke: var(--crowded); }
.sv-steps li > span:first-child .ic { width: var(--icon-md); height: var(--icon-md); margin: 1px 0 0; color: var(--muted); }
.sv-row--time .sv-row__icon .ic { width: var(--icon-md); height: var(--icon-md); margin: 0; color: var(--muted); }

/* 하단 탭: 아이콘 + 글자, 지금 화면은 파랑 + 위쪽 막대로 (색만으로 구분하지 않게) */
.tabbar a { position: relative; min-height: 56px; align-content: center; font-size: 12px; }
.tabbar a .ic { width: var(--icon-lg); height: var(--icon-lg); margin: 0; }
.tabbar a.is-active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }

/* 누르는 곳: 44px 이상. 글자 링크 모양 버튼은 겉모양은 그대로 두고 눌리는 범위만 넓힌다 */
.back, .close, .help-btn { width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; text-decoration: none; color: var(--text); font-size: 20px; }
.help-btn { color: var(--accent); top: 6px; }
.link-btn { position: relative; }
.link-btn::after { content: ""; position: absolute; inset: -10px -6px; }
.chip, .tab, .sv-seg button { min-height: 40px; }
.search input, .search button, select, .pick-opt, .sv-more, .sv-cta, .pick-go, .primary-btn, .tour__next { min-height: var(--tap); }
button, a, select, input[type="range"], summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a, summary, select, [role="tab"] { cursor: pointer; }

/* 누르면 바로(0.15초) 반응: 크기만 살짝 줄여 주변 배치는 그대로 */
button, .pick-go, .sv-cta, .past-cta, .my-line, .sv-explore, .sv-find { transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
button:not(:disabled):active, .pick-go:active, .sv-cta:active, .past-cta:active, .my-line:active, .sv-find:active, .sv-explore:active { transform: scale(.97); }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }

/* 숫자는 자리 폭이 같은 글꼴로 (시각·인원이 바뀌어도 줄이 흔들리지 않게) */
.sv-facts b, .sv-grade, .slider-value, .bus-sep, .commute-ctl b, .card__title, .card__main, .quota__count, .tour__count, .sv-seats b, .sv-score-base b, .sv-myroute { font-variant-numeric: tabular-nums; }

/* 너무 작은 글자(11px)를 12px 로 */
.badge, .bar__val, .cap-line span { font-size: 12px; }

/* 위 안내 띠: 노란 띠 대신 차분한 돌색 띠 + 금색 링크 */
.notice { background: var(--surface-2); color: var(--muted); border-bottom: 1px solid var(--line); }
.notice__more { color: var(--accent); }

/* '그날 기록' 들어가는 큰 버튼: 보라 그라데이션 대신 납작한 흰 판 + 위쪽 파랑 띠 */
.past-cta { color: var(--text); background: var(--surface); box-shadow: var(--shadow); border-top: 4px solid var(--accent); }
.past-cta__icon { color: var(--accent); }
.past-cta__icon .ic { width: 32px; height: 32px; margin: 0; }
.past-cta--inline .past-cta__icon .ic { width: 24px; height: 24px; }
.past-cta__body b { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--accent); }
.past-cta--inline .past-cta__body b { font-size: 17px; }
.past-cta__body span { color: var(--muted); opacity: 1; }
.past-cta__go { background: var(--surface-2); color: var(--text); }

/* 커뮤니티 '내 라인' 버튼 아이콘 */
.my-line__ic .ic { width: 28px; height: 28px; margin: 0; }

/* 직접 찾기 세 칸: 아이콘은 파랑 */
.mode-cards .tab b .ic { color: var(--accent); }
.pick-go .ic, .sv-cta .ic { margin-right: .4em; }

/* 움직임 줄이기 설정이면 모든 움직임을 멈춘다 (만차 버스 흔들림 포함) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 결과 화면·그날 기록의 한 줄 답도 첫 화면과 같은 납작한 흰 판 (상태 색 글자 + 위쪽 띠, 색만으로 알리지 않게 버스 표정도 같이) */
.headline { --led: var(--text); border-left: 0; border-top: 5px solid var(--board-dim); color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.headline[data-state="relaxed"] { --led: var(--led-green); border-top-color: var(--led-green); }
.headline[data-state="crowded"] { --led: var(--led-amber); border-top-color: var(--led-amber); }
.headline[data-state="full"] { --led: var(--led-red); border-top-color: var(--led-red); }
.headline[data-state="sleep"] { --led: var(--muted); }
.headline__text { color: var(--led); font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 5.4vw, 24px); line-height: 1.35; }
.pick .result-head { padding-right: 48px; }

/* 채운 버튼: 마우스를 올리면 살짝 옅게 (스킬: 색·투명도만 바꾸는 단순한 hover) */
.sv-cta { border-radius: var(--radius); }

/* 고급스럽게 (스킬: Minimalism & Swiss Style, 검정 + 금색) */
h1, h2 { letter-spacing: -.01em; }
.simple-hero h1 { font-size: clamp(38px, 11vw, 50px); line-height: 1.08; }
.sv-facts b, .sv-grade, .quota__count { font-variant-numeric: lining-nums tabular-nums; }
.sv-facts b { font-size: 34px; }
.tab.is-active, .sv-seg button.is-active { color: var(--text); }
.tabbar { border-top: 1px solid var(--line); }

/* 배너 광고 자리 (common.js mountAds). 화면 속 3곳은 휴대폰 배너 320×100, 양옆은 넓은 화면에서만 160×600 */
.ad-slot, .ad-rail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface-2); border: 1px dashed var(--line); color: var(--muted); font-size: 12px; overflow: hidden; }
.ad-slot { width: 100%; max-width: 320px; min-height: 100px; margin: 16px auto; border-radius: 8px; }
.ad-label { font-weight: 700; }
/* 답·점수가 아직 없으면 그 아래 광고 자리도 숨긴다 */
#sv-result:empty + .ad-slot, #sv-scores:empty + .ad-slot { display: none; }
.ad-rail { display: none; position: fixed; top: 96px; width: 160px; height: 600px; z-index: 5; border-radius: 8px; }
.ad-rail--left { left: 24px; }
.ad-rail--right { right: 24px; }
@media (min-width: 1280px) and (min-height: 720px) {
  .ad-rail { display: flex; }
  /* 결과 화면에서 상세 칸을 열면 본문이 1180px 까지 넓어져 겹치므로 양옆 광고를 잠시 숨긴다 */
  body.detail-open .ad-rail { display: none; }
}
/* 실제 애드센스 광고가 들어간 자리: 점선 틀을 빼고 '광고' 글자 + 광고 크기만큼 (common.js adsenseBanner) */
.ad-slot.ad-live, .ad-rail.ad-live { background: none; border: 0; height: auto; min-height: 0; }
.ad-live .ad-label { font-size: 11px; font-weight: 400; }
@media print { .ad-slot, .ad-rail { display: none !important; } }
/* 로컬 테스트(pilot/run_local.py)에서는 광고 자리를 보이지 않는다 (common.js clientConfig) */
html.no-ads .ad-slot, html.no-ads .ad-rail { display: none !important; }

/* 탑승 확률 조건별로 자세히 (cond.js): 아래에서 올라오는 시트 + 요일·날씨·학기 탭 + 점 그림 */
.cond-sheet { margin: auto auto 0; width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; border: 0; padding: 6px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sheet); overscroll-behavior: contain; }
.cond-sheet[open] { animation: sheet-up var(--dur-base) var(--ease-drawer); }
.cond-sheet::backdrop { background: var(--scrim); }
.cond-sheet .sheet-close { width: var(--tap); height: var(--tap); top: 0; color: var(--text); }
.cond-route { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 14px; }
.cond-title { margin: 6px 0 12px; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.cond-sum { display: flex; align-items: center; gap: 12px; padding: 12px 0 14px; border-top: 1px solid var(--line); }
.cond-sum b { font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.cond-sum span { display: grid; font-size: 14px; }
.cond-sum small { font-size: 12px; }
.cond-tabs { grid-template-columns: repeat(3, 1fr); }
.cond-scope { margin: 0 0 6px; display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.cond-answer { margin: 4px 0 12px; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.35; word-break: keep-all; }
.cond-dots { list-style: none; margin: 0; padding: 0; display: grid; }
.cond-dots li { display: grid; grid-template-columns: 52px 1fr 76px; align-items: center; gap: 10px; min-height: var(--tap); border-bottom: 1px solid var(--line); }
.cond-dots__label { display: grid; font-weight: 600; font-size: 15px; line-height: 1.2; }
.cond-low { color: var(--accent); font-size: 12px; font-weight: 700; }
.cond-dots__track { position: relative; height: 2px; background: var(--line); }
.cond-dots__avg { position: absolute; top: -9px; width: 0; height: 20px; border-left: 2px dashed var(--muted); transform: translateX(-1px); }
.cond-dots__dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 2px solid var(--text); transform: translate(-50%, -50%); }
.cond-dots li.is-thin .cond-dots__dot { background: var(--surface); }
.cond-dots li.is-none .cond-dots__track { background: none; border-top: 2px dotted var(--line); height: 0; }
.cond-dots__val { display: grid; text-align: right; line-height: 1.2; }
.cond-dots__val b { font-size: 16px; font-variant-numeric: lining-nums tabular-nums; }
.cond-dots__val small { color: var(--muted); font-size: 12px; }
.cond-dots li.is-none .cond-dots__val b { color: var(--muted); font-weight: 500; font-size: 13px; }
.cond-axis { display: flex; justify-content: space-between; margin: 4px 86px 0 62px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cond-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.cond-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--text); border: 2px solid var(--text); }
.cond-key--thin { background: var(--surface); }
.cond-key--avg { width: 0; height: 12px; border-radius: 0; border: 0; border-left: 2px dashed var(--muted); background: none; }
.cond-tag { display: inline-block; padding: 0 6px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent); font-size: 12px; font-weight: 700; }
.cond-empty { display: flex; gap: 10px; align-items: flex-start; padding: 14px; margin-top: 4px; border: 1px dashed var(--line); border-radius: var(--radius-lg); background: var(--surface-2); }
.cond-empty .ic { flex: none; width: var(--icon-md); height: var(--icon-md); color: var(--muted); }
.cond-empty p { margin: 0; display: grid; gap: 4px; font-size: 14px; word-break: keep-all; }
.cond-empty span { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .cond-sheet[open] { animation: none; } }

/* 오늘·내일 출퇴근 예상 (simple.js loadForecast): 메인 맨 위 두 칸 */
.fc:empty { display: none; }
.fc-title { margin-top: 4px; }
.fc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.fc-card { display: grid; align-content: start; gap: 6px; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); font: inherit; min-height: var(--tap); transition: transform var(--dur-fast) var(--ease-out); }
button.fc-card:active { transform: scale(.97); }
.fc-when { font-size: 14px; color: var(--muted); }
.fc-when b { color: var(--text); font-variant-numeric: lining-nums tabular-nums; }
.fc-sky { display: block; font-size: 13px; line-height: 1.45; word-break: keep-all; }
.fc-sky .ic { width: var(--icon-md); height: var(--icon-md); margin-right: 4px; vertical-align: -.3em; color: var(--accent); }
.fc-prob { display: grid; }
.fc-prob b { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.fc-prob small { font-size: 12px; color: var(--muted); }
.fc-plates { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; font-size: 13px; }
.fc-plates .plate { font-size: 13px; }
.fc-basis { font-size: 12px; color: var(--muted); word-break: keep-all; }
.fc-card .sv-note { margin: 0; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .fc-card { transition: none; } }

/* 맨 아래 풋터: 문의 메일·특허 출원 안내·데이터 출처 */
.site-footer { max-width: 860px; margin: 32px auto 0; padding: 20px 16px 28px; border-top: 1px solid var(--line);
  text-align: center; font-size: 12px; line-height: 1.6; color: var(--muted); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.site-footer .site-footer__src { margin-top: 10px; font-size: 11px; word-break: keep-all; }
.site-footer .site-footer__src + .site-footer__src { margin-top: 2px; }

/* ==========================================================================
   다섯 디자인 스킬 적용 (2026-10-17): frontend-design · ui-ux-pro-max · hallmark · emil-design-eng · web-design-guidelines
   색·글꼴·화면 구성은 그대로(design-system/bus-commute/MASTER.md). 바꾼 것은 마무리 품질뿐이다
   - 움직임: 기본 곡선 대신 힘 있는 곡선, 누르면 0.97, 나타날 때 '없던 데서 튀어나오지' 않게 살짝 작게 + 흐리게에서 시작
   - 마우스 올림 효과는 마우스가 있는 기기에서만 (휴대폰에서 누른 뒤 색이 남지 않게)
   - 제목 줄바꿈 고르게, 가로 스크롤 막기, 시트·창 안 스크롤이 뒤 화면으로 번지지 않게
   ========================================================================== */
html, body { overflow-x: clip; }   /* 가로로 밀리는 화면 막기 (hidden 과 달리 sticky·fixed 를 망가뜨리지 않는다) */
h1, h2, h3, .c-title, .sv-h, .cond-title, .result-head h2 { text-wrap: balance; overflow-wrap: anywhere; min-width: 0; }
p, li, small { text-wrap: pretty; }
select { background-color: var(--surface); color: var(--text); }   /* 윈도 어두운 화면에서 선택 상자가 하얗게 남지 않게 */
.col-detail, .route-stops-box, .past-search .search-results { overscroll-behavior: contain; }
[id] { scroll-margin-top: 56px; }

/* 마우스가 있는 기기에서만 올림 효과 (한 번에 하나만 바뀐다: 테두리 또는 바탕 또는 진하기) */
@media (hover: hover) and (pointer: fine) {
  .card:hover { border-color: var(--muted); border-left-color: var(--rt-c, var(--muted)); }
  .sv-find:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
  .pick-swap:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .pick-opt:hover, .sv-others button:hover, .search-results button:hover, .c-groups button:hover, .route-stops button:hover { border-color: var(--accent); }
  .past-cta:hover { background: var(--surface-2); }
  .sv-more:hover, .primary-btn:hover:not(:disabled), .search button:hover, .pick-go:hover, .tour__next:hover, .my-line:hover { opacity: .9; }
  .link-btn:hover:not(:disabled), .sv-explore:hover { text-decoration: underline; text-underline-offset: 3px; }
  .chip:hover, .tab:not(.is-active):hover, .sv-seg button:not(.is-active):hover { color: var(--text); }
}
.search-results button, .sv-others button, .c-groups button, .route-stops button, .card, .pick-opt, .chip, .tab {
  transition: transform var(--dur-press) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }

/* 나타나는 것: 시트·안내 창·광고 안내 창·토스트. 아래 6px, 0.97 크기, 흐림에서 시작 (scale(0) 이나 먼 거리에서 날아오지 않게) */
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.tour__tip { animation: pop-in var(--dur-fast) var(--ease-out); }
.quota__box { animation: pop-in var(--dur-base) var(--ease-out); }
.toast { animation: toast-in var(--dur-fast) var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: translate(var(--pop-x, 0), 6px) scale(.97); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.tour__tip { --pop-x: -50%; }
.quota { animation: fade-in var(--dur-fast) var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } }
/* 키보드 초점 표시는 바로 나타난다 (움직이지 않음) */
:focus-visible { transition: none; }
.search input:focus-visible, .stop-filter:focus-visible, .od-pick input:focus-visible, .write input:focus-visible,
.write textarea:focus-visible, .leg-add input:focus-visible, select:focus-visible { outline-offset: 1px; border-color: var(--ring); }

/* 한 줄 답이 흘러 들어오는 것은 화면에서 단 하나의 '연출' (frontend-design: 힘은 한 곳에만). 0.7초 → 0.5초 */
.sv-verdict p strong { animation-duration: .5s; }

/* 움직임 줄이기: 자리 이동은 없애고, 흐림만 짧게 남긴다 (emil: 줄이기 ≠ 전부 없애기) */
@media (prefers-reduced-motion: reduce) {
  .tour__tip, .quota__box, .toast, .quota { animation: fade-in .15s linear !important; animation-duration: .15s !important; }
  .tour__hole { transition: none; }
  .fold > summary::after, .c-find > summary::after { transition: none; }
}

/* 이어지는 곳 표시: 글자 끝 '→' 대신 한 벌의 꺾쇠 아이콘 (frontend-design: 버튼 글자 뒤 화살표는 흔한 틀) */
.past-cta__go, .community-cta em, .my-line em, .sv-find span { display: inline-grid; place-items: center; }
.past-cta__go { width: 36px; height: 36px; padding: 0; }
.past-cta__go .ic, .community-cta em .ic, .my-line em .ic, .sv-find span .ic { width: var(--icon-md); height: var(--icon-md); margin: 0; }
/* 커뮤니티로 가는 판도 '그날 기록' 판과 같은 모양 (청록 굵은 테두리 대신 금색 위 띠) */
.community-cta { border: 0; box-shadow: var(--shadow); border-top: 4px solid var(--accent); }
.community-cta em { color: var(--accent); }
.community-cta .past-cta__icon { color: var(--accent); }
.community-cta .past-cta__icon .ic { width: 24px; height: 24px; margin: 0; }
/* 커뮤니티 '꼭 지켜 주세요'도 다른 접는 칸과 같은 꺾쇠 (브라우저 기본 ▶ 대신) */
.rules summary { list-style: none; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: "▾"; display: inline-block; margin-left: .3em; color: var(--muted); transition: transform var(--dur-fast) var(--ease-out); }
.rules[open] summary::after { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .rules summary::after { transition: none; } }

/* 노선 카드: 왼쪽 굵은 색 띠 빼기 (hallmark: 굵은 옆 띠는 흔한 틀. 노선 색은 번호판이 이미 보여 준다)
   운행 구간 카드는 한 줄 답 판과 같이 위쪽 띠로 상태를 알린다 */
.card { border-left-width: 1px; border-left-color: var(--line); }
@media (hover: hover) and (pointer: fine) { .card:hover { border-left-color: var(--accent); border-color: var(--accent); } }
.trip-card { border-left: 0; border-top: 5px solid var(--normal); }
.trip-card.card--relaxed { border-top-color: var(--relaxed); }
.trip-card.card--crowded { border-top-color: var(--crowded); }
.trip-card.card--full { border-top-color: var(--full); }

/* ==========================================================================
   직접 써 보며 찾은 것 고치기 (2026-10-17)
   ========================================================================== */
/* '?' 버튼: 화면에 붙어 따라오면 아래로 내려도 '바꾸기'·'정하기'·닫기 버튼을 덮어서, 맨 위 안내 줄 자리에만 둔다 */
.help-btn { position: absolute; }
/* 안내 줄 글자가 '?'와 겹치지 않게 양쪽을 같은 폭으로 비운다 (가운데 맞춤 유지) */
body:has(.help-btn) .notice { padding-left: 56px; padding-right: 56px; }
/* 휴대폰에서 노선 자세히 보기가 화면을 덮으면 '?'가 닫기(×) 위에 겹치므로 그동안 숨긴다 */
@media (max-width: 959px) { body.detail-open .help-btn { display: none; } }
/* 한국어 큰 글자·버튼 글자가 낱말 가운데서 끊기지 않게 (320px 화면에서 '거의 항 / 상') */
.fc-prob b, .sv-find, .sv-facts b, .tab, .chip, .link-btn, .primary-btn, .sv-more, .sv-cta { word-break: keep-all; }
/* 누르는 글자는 두 줄로 나뉘지 않게 */
.step-row .link-btn, .past-search .mode-tabs .tab { white-space: nowrap; }
.past-search .mode-tabs .tab { padding-inline: 12px; }
.no-map-note a { color: var(--accent); font-weight: 700; }
@media (max-width: 360px) { .sv-find { font-size: 15px; padding-inline: 12px; } }
