:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --surface: #fff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --r-md: 14px;
  --r-sm: 8px;
  --shadow: 0 2px 16px rgba(15, 23, 42, .08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ── */
.header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  padding: 20px 16px;
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.header-icon { width: 28px; height: 28px; flex-shrink: 0; }
.header h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.header-home-link { color: inherit; text-decoration: none; cursor: pointer; }
.header-sub {
  max-width: 720px;
  margin: 6px auto 0;
  text-align: center;
  font-size: .85rem;
  font-weight: 400;
  color: rgba(255, 255, 255, .85);
  letter-spacing: -.01em;
}

/* ── Main wrapper ── */
main { max-width: 720px; margin: 0 auto; padding: 24px 16px 56px; }

/* ── 공통 페이지 요소 ── */
.page-nav { margin-bottom: 20px; }

.btn-back-page {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-size: .85rem; font-weight: 600; color: var(--primary);
  padding: 0;
}
.btn-back-page svg { width: 16px; height: 16px; }
.btn-back-page:hover { opacity: .7; }

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ── 1단계: 지역 선택 ── */
.regions-section { margin-top: 4px; }

.regions-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 24px;
}

.regions-header { margin-bottom: 20px; }

.regions-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

.regions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.region-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  gap: 8px;
}
.region-link:hover { background: #eff6ff; border-color: var(--primary); }
.region-link-name { font-size: .88rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.region-link-move { font-size: .75rem; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
.region-link:hover .region-link-name { color: var(--primary); }
.region-link:hover .region-link-move { color: var(--primary); }

/* ── 2·3단계: 터미널 목록 ── */
.terminal-list-page {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal-page-item {
  display: block; width: 100%;
  padding: 16px 20px;
  background: none; border: none; border-bottom: 1px solid var(--border);
  font-size: .95rem; font-weight: 500; color: var(--text);
  cursor: pointer; text-align: left;
  transition: background .1s, color .1s;
}
.terminal-page-item:last-child { border-bottom: none; }
.terminal-page-item:hover { background: #eff6ff; color: var(--primary); font-weight: 600; }

/* ── 4단계: 시간표 조회 ── */
#route-sec-info,
#route-sec-schedule {
  margin-top: 28px;
}
.route-service-info {
  background: #ffffff;
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}
.route-reverse-box {
  margin-top: 24px;
}

.svc-route-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.svc-terminal-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.svc-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}
.svc-pill:hover { border-color: var(--primary); }
.svc-pill-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--bg);
  border-radius: 999px;
  padding: 1px 6px;
}
.svc-booking-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  width: 130px;
  box-sizing: border-box;
  cursor: pointer;
  transition: opacity 0.15s;
}
.svc-booking-btn:hover { opacity: 0.85; }
.svc-summary {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.svc-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--text-sub);
}
.svc-stats li {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.svc-stat-label {
  font-size: 0.78rem;
  color: var(--text-sub);
}
.svc-stats b { color: var(--text); font-weight: 600; }
.route-updated {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-sub);
  opacity: 0.65;
  margin-bottom: 0.5rem;
}
.route-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 0.65rem 16px;
  font-size: 0.82rem;
  color: #92400e;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}
.route-notice-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: #f59e0b;
}
.route-notice-text {
  flex: 1;
}
.route-notice-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  width: 130px;
  box-sizing: border-box;
  transition: background 0.15s;
}
.route-notice-btn:hover {
  background: #fef3c7;
}

.route-search-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin: 16px 0 24px;
}
#page-full-timetable .route-search-row { justify-content: flex-end; }

.date-field { display: flex; flex-direction: column; gap: 6px; }
.date-field label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.date-field input[type="date"] {
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .93rem;
  color: var(--text);
  outline: none;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s;
}
.date-field input[type="date"]:focus { border-color: var(--primary); }

.btn-search {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 18px;
  background: var(--primary); color: #fff;
  border: none; border-radius: var(--r-sm);
  font-size: .93rem; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn-search svg { width: 16px; height: 16px; }
.btn-search:hover { background: var(--primary-dark); }
.btn-search:disabled { opacity: .55; cursor: not-allowed; }

/* ── Results ── */
.results-summary { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.sum-route { font-size: .98rem; font-weight: 700; }
.sum-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.results-list { display: flex; flex-direction: column; gap: 10px; }
.no-result { text-align: center; padding: 60px 0; color: var(--muted); font-size: .93rem; }

/* ── Bus card ── */
.bus-card { background: var(--surface); border-radius: var(--r-md); border: 1.5px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.card-times { display: flex; align-items: center; padding: 20px 22px 16px; gap: 10px; }
.t-dep, .t-arr { font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; min-width: 56px; white-space: nowrap; }
.t-arr { color: var(--muted); }
.t-mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.t-dur { font-size: .7rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.t-rule { width: 100%; display: flex; align-items: center; }
.t-rule::before { content: ''; flex: 1; height: 1.5px; background: linear-gradient(to right, var(--primary), #93c5fd); border-radius: 2px; }
.t-arrowhead { font-size: .7rem; color: #93c5fd; margin-left: 1px; line-height: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding: 11px 22px; border-top: 1px solid var(--border); background: #fafafa; }
.grade { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.g-express { background: #dbeafe; color: #1e40af; }
.g-normal  { background: #dcfce7; color: #166534; }
.g-premium { background: #ede9fe; color: #6d28d9; }
.g-night   { background: #1e293b; color: #e2e8f0; }
.fare { font-size: .98rem; font-weight: 700; color: var(--text); }

/* ── Loading ── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 0;
  color: var(--muted);
  font-size: .88rem;
}
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ── */
.error-msg {
  margin-top: 14px;
  padding: 13px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r-sm);
  color: #dc2626;
  font-size: .88rem;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .t-dep, .t-arr { font-size: 1.25rem; min-width: 46px; }
  .card-times { padding: 16px 16px 12px; }
  .card-footer { padding: 10px 16px; }
  .route-notice { flex-wrap: wrap; }
  .route-notice-btn { width: 100%; }
}

/* ── 메인 검색 바 ── */
#main-sec-express,
#main-sec-intercity {
  scroll-margin-top: 58px;
  margin-top: 28px;
}

.bus-type-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 16px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.bus-type-divider::before,
.bus-type-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.search-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  margin-top: 4px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-pair {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.search-divider {
  font-size: 1.1rem;
  color: var(--muted);
  flex-shrink: 0;
}

.search-hint {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.6;
}

/* Custom select */
.custom-select {
  position: relative;
  flex: 1;
  min-width: 0;
}

.sel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: .85rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color .15s;
}
.sel-btn:hover:not(:disabled) { border-color: var(--primary); }
.sel-btn:disabled { opacity: .5; cursor: not-allowed; background: #f8fafc; }
.custom-select.open .sel-btn { border-color: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }

.sel-label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.sel-label.muted { color: var(--muted); font-weight: 400; }

.sel-chevron {
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .2s;
}
.custom-select.open .sel-chevron { transform: rotate(180deg); }

.sel-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 140px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  max-height: 260px;
  overflow-y: auto;
  z-index: 200;
  list-style: none;
  padding: 4px 0;
}
.custom-select.open .sel-list { display: block; }

.sel-item {
  padding: 9px 14px;
  font-size: .88rem;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  transition: background .1s;
}
.sel-item:hover { background: #eff6ff; color: var(--primary); }

.btn-main-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
  width: 130px;
  box-sizing: border-box;
}
.btn-main-search:hover:not(:disabled) { background: var(--primary-dark); }
.btn-main-search:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 620px) {
  .search-row { flex-wrap: wrap; }
  .search-pair { width: 100%; flex: none; }
  .search-divider { display: none; }
  .btn-main-search { width: 100%; height: 48px; font-size: 1rem; }
}

/* ── 터미널 정보 카드 ── */
.terminal-info-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ti-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}
.ti-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.ti-label {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  margin-right: 4px;
}
.ti-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ti-item {
  display: flex;
  gap: 6px;
}
.ti-dist {
  color: var(--primary);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ── 전국 터미널 디렉토리 ── */
.terminal-directory {
  margin-top: 28px;
}
.dir-region {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dir-region-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}
.dir-all-btn {
  width: 100%;
  padding: 9px 0;
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dir-all-btn:hover {
  background: #eff6ff;
}
.dir-region-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: #eff6ff;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.dir-region-body {
  divide: 1px solid var(--border);
}
.dir-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.dir-row:last-child {
  border-bottom: none;
}
.dir-name {
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dir-arrival-only {
  font-size: 0.7rem;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
}
.dir-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.dir-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.dir-btn-info {
  color: var(--primary);
  border-color: var(--primary);
  background: #fff;
}
.dir-btn-info:hover {
  background: #eff6ff;
}
.dir-btn-timetable {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.dir-btn-timetable:hover {
  background: var(--primary-dark);
}
.dir-btn-timetable:disabled {
  background: #cbd5e1;
  border-color: #cbd5e1;
  cursor: not-allowed;
}
@media (max-width: 480px) {
  .dir-row { flex-wrap: wrap; gap: 8px; }
  .dir-btns { width: 100%; }
  .dir-btn { flex: 1; text-align: center; }

  .svc-route-row {
    flex-direction: column;
  }
  .svc-terminal-pills {
    flex-direction: column;
    width: 100%;
  }
  .svc-pill {
    width: 100%;
    border-radius: 8px;
    justify-content: flex-start;
  }
  .svc-booking-btn {
    width: 100%;
    height: 48px;
    border-radius: 8px;
  }
}

/* ── 터미널 정보 페이지 ── */
.ti-loading, .ti-no-info {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 12px 0;
}
.tinfo-routes-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 12px;
}

/* ── 터미널 안내 섹션 제목 ── */
.tinfo-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}


/* ── 전체 시간표 nav: 스크롤바 표시 ── */
#ft-nav { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
#ft-nav::-webkit-scrollbar { display: block; height: 3px; }
#ft-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── 터미널 안내 네비게이션 ── */
.tinfo-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  display: flex;
  justify-content: safe center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.tinfo-nav::-webkit-scrollbar { display: none; }

@media (max-width: 768px) {
  .tinfo-nav {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .tinfo-nav::-webkit-scrollbar {
    display: block;
    height: 3px;
  }
  .tinfo-nav::-webkit-scrollbar-track { background: transparent; }
  .tinfo-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
  }
}
.tinfo-nav-btn {
  flex-shrink: 0;
  padding: 14px 18px;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tinfo-nav-btn:hover {
  color: var(--primary);
}
.tinfo-nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ── 터미널 안내 섹션 ── */
.tinfo-section {
  margin-top: 28px;
  scroll-margin-top: 68px;
}

/* ── 예매 바로가기 ── */
.tinfo-booking-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tinfo-booking-btn {
  display: block;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.tinfo-booking-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}


/* ── 전체 시간표 페이지 ── */
.ft-region {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 170px;
}
.ft-region-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: #eff6ff;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.ft-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.ft-row:last-child { border-bottom: none; }
.ft-dest {
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
}
.ft-row-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.ft-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.ft-btn-info {
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: #fff;
}
.ft-btn-info:hover { border-color: var(--primary); color: var(--primary); }
.ft-btn-schedule {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: #fff;
}
.ft-btn-schedule:hover { background: var(--primary); color: #fff; }

/* ── 터미널 지도 이미지 ── */
.ti-map {
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}
.ti-map img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.kakao-map-link {
  display: block;
  text-align: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  background: var(--bg);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
}
.kakao-map-link:hover { background: var(--primary); color: #fff; }

/* ── 전국 시외버스 터미널 페이지 ── */
.ic-all-region-nav {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
@media (max-width: 600px) {
  .ic-all-region-nav { grid-template-columns: repeat(4, 1fr); }
}
.ic-all-region-tag {
  padding: 5px 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  background: #fff;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.ic-all-region-tag:hover {
  background: var(--primary);
  color: #fff;
}
.ic-all-section {
  margin-bottom: 24px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 8px;
}
.ic-all-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  background: #f8fafc;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ic-all-count {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

/* ── FAQ 섹션 ── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.faq-q {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::before {
  content: 'Q';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.faq-q::after {
  content: '﹀';
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.2s;
}
.faq-item[open] .faq-q::after {
  transform: rotate(180deg);
}
.faq-a {
  padding: 0 16px 14px 48px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

/* 애드센스 광고 슬롯 */
.ad-slot {
  display: block;
  margin: 20px auto;
  text-align: center;
  overflow: hidden;
}

/* 홈페이지 서비스 소개 · 이용방법 (GEO/SEO 정적 콘텐츠) */
.home-about {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.home-about .tinfo-section-title { margin-top: 28px; }
.home-about .tinfo-section-title:first-child { margin-top: 0; }
.home-about-lead {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 8px;
}
.home-about-lead strong { color: var(--text); font-weight: 600; }
.home-howto {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}
.home-howto strong { color: var(--text); font-weight: 600; }

/* 프리렌더 요약 블록 (JS 로드 전 노출 → 하이드레이션 시 main.js가 제거) */
#prerender-summary h1 { font-size: 1.35rem; line-height: 1.4; margin: 0 0 12px; color: var(--text); }
#prerender-summary h2 { font-size: 1.1rem; margin: 28px 0 12px; color: var(--text); }
#prerender-summary .pr-lead { font-size: 1rem; line-height: 1.7; color: var(--text); }
#prerender-summary .pr-lead b { color: var(--primary-dark); }
#prerender-summary .pr-updated { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
#prerender-summary .pr-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-sm); overflow: hidden; box-shadow: var(--shadow); font-size: 0.95rem; }
#prerender-summary .pr-table th, #prerender-summary .pr-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
#prerender-summary .pr-table th { background: var(--bg); color: var(--muted); font-weight: 600; }
#prerender-summary .pr-table tr:last-child td { border-bottom: none; }
#prerender-summary details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 8px; }
#prerender-summary summary { font-weight: 600; cursor: pointer; color: var(--text); }
#prerender-summary details p { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }

/* 시간표 미제공(전 버스 23:59 센티넬) 노선 안내 */
#prerender-summary .pr-noschedule { margin-top: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--muted); font-size: 1rem; text-align: center; }

/* ── Footer ── */
.site-footer { margin-top: 40px; padding: 28px 16px; background: #0f172a; color: #cbd5e1; }
.site-footer-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0; margin-bottom: 14px; }
.footer-links a { color: #e2e8f0; text-decoration: none; font-size: 0.9rem; font-weight: 600; padding: 0 14px; position: relative; }
.footer-links a:not(:first-child)::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 12px; background: #475569; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-source { font-size: 0.8rem; color: #94a3b8; margin-bottom: 6px; }
.footer-copy { font-size: 0.78rem; color: #64748b; line-height: 1.6; }

/* ── Legal pages (개인정보처리방침·이용약관) ── */
.legal-page { max-width: 720px; margin: 0 auto; padding: 28px 16px 40px; }
.legal-page .page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.legal-page .legal-updated { font-size: 0.85rem; color: var(--muted); margin-bottom: 24px; }
.legal-page h2 { font-size: 1.1rem; font-weight: 700; margin: 28px 0 10px; color: var(--text); }
.legal-page h3 { font-size: 0.98rem; font-weight: 600; margin: 18px 0 8px; color: var(--text); }
.legal-page p { font-size: 0.95rem; line-height: 1.75; color: #334155; margin-bottom: 10px; }
.legal-page ul { margin: 0 0 12px; padding-left: 20px; }
.legal-page li { font-size: 0.95rem; line-height: 1.75; color: #334155; margin-bottom: 4px; }
.legal-page a { color: var(--primary-dark); }
.legal-page .legal-back { display: inline-block; margin-bottom: 18px; color: var(--primary-dark); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.legal-page .legal-back:hover { text-decoration: underline; }
