/* ═══════════════════════════════════════════
   7to6 — app.css  (v3: Bright Travel Theme)
   ═══════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f7fb;
  --surface:   #ffffff;
  --surface2:  #f0f2f8;
  --border:    #e2e6ef;
  --text:      #2d3142;
  --text-light: #555b6e;
  --muted:     #8d93a5;
  --accent:    #4a6cf7;
  --accent2:   #06d6a0;
  --accent-warm: #ff6b6b;
  --sunset:    #e17055;
  --sky:       #74b9ff;
  --gold:      #fdcb6e;
  --danger:    #ff6b6b;
  --warn:      #f39c12;
  --radius:    14px;
  --max-w:     920px;
  --topbar-h:  60px;
  --shadow-sm: 0 2px 8px rgba(45,49,66,.06);
  --shadow-md: 0 4px 20px rgba(45,49,66,.08);
  --shadow-lg: 0 8px 40px rgba(45,49,66,.10);
  --font:      "Outfit", -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", "Noto Sans KR", Roboto, "Hiragino Sans", sans-serif;
}

html[data-theme="dark"] {
  --bg:        #0f131b;
  --surface:   #161c28;
  --surface2:  #1b2231;
  --border:    #2a3346;
  --text:      #e7ecf6;
  --text-light: #c6d0e4;
  --muted:     #97a3bd;
  --accent:    #7aa2ff;
  --accent2:   #34d399;
  --accent-warm: #ff8a7a;
  --sunset:    #ff9466;
  --sky:       #7db2ff;
  --gold:      #ffd37a;
  --danger:    #ff7b7b;
  --warn:      #f7b955;
  --shadow-sm: 0 2px 10px rgba(0,0,0,.22);
  --shadow-md: 0 4px 24px rgba(0,0,0,.32);
  --shadow-lg: 0 10px 48px rgba(0,0,0,.38);
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ═══════════════════════════════════════
   HOME (Language Selection)
   ═══════════════════════════════════════ */
.home {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.home-inner {
  max-width: 540px;
  width: 100%;
  text-align: center;
}

.home-logo {
  margin-bottom: 24px;
}
.logo-text {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.08em;
}

.home-hero-img {
  margin: 0 auto 32px;
  max-width: 340px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(106,166,255,.12);
}
.hero-photo {
  width: 100%;
  height: auto;
  display: block;
}

.home-tagline {
  margin-bottom: 16px;
}

.lang-section { margin-top: 8px; }
.lang-prompt {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.lang-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.lang-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  color: var(--text);
  font-size: 0.9rem;
}
.lang-btn:hover {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(106,166,255,.15);
}
.lang-flag { font-size: 1.8rem; }
.lang-label { font-weight: 600; }

/* ═══════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 clamp(12px, 3vw, 32px);
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo {
  font-size: 1.25rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-title { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.brand-sub   { font-size: 0.62rem; color: var(--muted); }

.stepper { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.step { color: var(--muted); padding: 4px 8px; border-radius: 6px; text-decoration: none; }
.step.active { color: var(--text); background: var(--surface); font-weight: 600; }
.sep { color: var(--muted); font-size: 0.7rem; }

/* ── Theme Toggle ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s, background .2s;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.theme-toggle:active { transform: translateY(0); }

.theme-icon { font-size: 1.05rem; line-height: 1; }
.theme-sun { display: none; }
html[data-theme="dark"] .theme-sun { display: inline; }
html[data-theme="dark"] .theme-moon { display: none; }

.home-theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
}

/* ═══════════════════════════════════════
   PAGE (Input 공통)
   ═══════════════════════════════════════ */
.page {
  max-width: 580px;
  margin: 0 auto;
  padding: clamp(28px, 5vh, 60px) clamp(16px, 4vw, 32px);
}

.page-title {
  font-size: 1.45rem; font-weight: 800;
  margin-bottom: 6px;
}

.page-desc {
  font-size: 0.88rem; color: var(--muted);
  margin-bottom: 28px;
}

/* ── Form ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 0.8rem;
  font-weight: 600; margin-bottom: 5px;
  color: var(--muted);
}
.form-input, .form-select {
  width: 100%; padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-size: 0.92rem;
  outline: none; transition: border-color .2s;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-select { appearance: none; cursor: pointer; }

.form-divider {
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}
.divider-label {
  font-size: 0.78rem; color: var(--muted); font-weight: 500;
}

.form-actions { margin-top: 24px; display: flex; gap: 12px; }
.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text);
}
.toggle-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* ── Quick Mode ── */
.quick-mode {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(106,166,255,.08), rgba(78,205,196,.06));
}
.quick-mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.78rem;
}
.quick-mode-head strong {
  font-size: 0.82rem;
  color: var(--text);
}
.quick-mode-head span {
  color: var(--muted);
}
.quick-mode-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quick-btn {
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.quick-btn:hover {
  background: var(--surface2);
}
.quick-mode-status {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════
   INPUT PAGE — 2-Column Layout (Map + Search)
   ═══════════════════════════════════════ */
.input-main {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: calc(100vh - var(--topbar-h));
  padding-top: var(--topbar-h);
}

.input-panel {
  padding: 24px 22px 32px;
  overflow-y: auto;
  max-height: calc(100vh - var(--topbar-h));
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.input-map-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.input-map-container {
  flex: 1;
  min-height: 450px;
  position: relative;
}

.input-map-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.naver-map-view,
.kakao-map-view {
  width: 100%;
  height: 100%;
  min-height: 450px;
  border-radius: var(--radius);
  background: var(--surface);
}

.input-map-hint {
  padding: 8px 16px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ── Category Filter Tabs ── */
.category-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-filter::-webkit-scrollbar { display: none; }

.cat-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.cat-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.cat-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.cat-icon { font-size: 0.85rem; }

/* ── Search Input Wrap ── */
.search-group { position: relative; }
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 0.9rem; pointer-events: none; z-index: 1;
}
.search-input {
  padding-left: 38px !important;
  padding-right: 34px !important;
}
.input-clear-btn {
  position: absolute;
  right: 8px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px;
  border: none; background: transparent;
  color: var(--muted); font-size: 1.2rem;
  cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.input-clear-btn:hover {
  background: var(--surface2); color: var(--danger);
}

/* ── Autocomplete Dropdown ── */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.autocomplete-list.visible { display: block; }

.field-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 0.74rem;
  color: var(--muted);
  background: rgba(255,255,255,0.01);
}
.field-meta-icon { flex-shrink: 0; }
.field-meta-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-meta-link {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: underline;
  flex-shrink: 0;
}

.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid var(--border);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active {
  background: var(--surface2);
}
.ac-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 24px; text-align: center;
}
.ac-text { flex: 1; min-width: 0; }
.ac-main {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-sub {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.ac-main-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ac-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-cafe    { background: rgba(139,90,43,.2); color: #d4a056; }
.badge-food    { background: rgba(255,107,53,.15); color: #ff8a50; }
.badge-hotel   { background: rgba(106,166,255,.15); color: var(--accent); }
.badge-shop    { background: rgba(255,105,180,.12); color: #ff69b4; }
.badge-leisure { background: rgba(78,205,196,.12); color: var(--accent2); }
.badge-transit { background: rgba(136,136,136,.15); color: var(--muted); }

.ac-empty {
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── Waypoint Toggle ── */
.waypoint-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.waypoint-toggle:hover { opacity: .8; }
.toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  font-size: 0.9rem;
  line-height: 1;
}

/* ── Selected Places Summary ── */
.selected-places {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.selected-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.route-point {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.route-icon { font-size: 0.9rem; flex-shrink: 0; }
.route-info { flex: 1; }
.route-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.route-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}
.route-type {
  font-size: 0.65rem;
  color: var(--muted);
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 6px;
}
.route-address {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.route-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.route-rating {
  font-size: 0.7rem;
  color: #f0c040;
  font-weight: 600;
}
.route-open {
  font-size: 0.65rem;
  color: var(--accent2);
  font-weight: 700;
  background: rgba(78,205,196,.1);
  padding: 1px 6px;
  border-radius: 6px;
}
.route-closed {
  font-size: 0.65rem;
  color: var(--danger);
  font-weight: 700;
  background: rgba(255,106,106,.1);
  padding: 1px 6px;
  border-radius: 6px;
}
.route-line {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 2px 0;
  margin-left: 4px;
}

/* ── Mobile: Stack layout ── */
@media (max-width: 768px) {
  .input-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 300px;
  }
  .input-panel {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .input-map-container {
    min-height: 300px;
  }
  .dir-head { flex-direction: column; }
  .dir-step { grid-template-columns: 18px 1fr; }
  .dir-step-time { grid-column: 2 / 3; }
}

/* ── Buttons ── */
.primary {
  padding: 13px 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000; font-weight: 700; font-size: 0.92rem;
  border: none; border-radius: var(--radius);
  cursor: pointer; transition: transform .15s, box-shadow .2s;
}
.primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(106,166,255,.25); }
.primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.secondary, .btn-link {
  padding: 13px 28px;
  background: transparent;
  border: 1px solid var(--border); color: var(--text);
  font-weight: 600; font-size: 0.92rem;
  border-radius: var(--radius);
  cursor: pointer; transition: border-color .2s;
  text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.secondary:hover, .btn-link:hover { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════
   RESULT PAGE
   ═══════════════════════════════════════ */
.result-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(20px, 4vh, 48px) clamp(12px, 3vw, 32px);
}

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

/* ── Summary ── */
.summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 20px;
  padding: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.summary-item { font-size: 0.85rem; }
.summary-item strong { color: var(--accent); }

/* ── Real Directions Detail Panel ── */
.directions-panel {
  margin-bottom: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.directions-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.directions-list { display: grid; gap: 10px; }
.dir-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.dir-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  margin-bottom: 8px;
  color: var(--muted);
}
.dir-head strong { color: var(--text); font-size: 0.82rem; }
.dir-steps { display: grid; gap: 6px; }
.dir-step {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text);
  align-items: start;
}
.dir-step-time { color: var(--muted); }

/* ── NCP Directions 주요 도로 구간 ── */
.dir-sections {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px;
  background: var(--surface2);
  border-radius: 8px;
}
.dir-section-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text);
  flex-wrap: wrap;
}
.dir-section-name {
  font-weight: 700;
  flex: 1;
  min-width: 100px;
}
.dir-section-dist {
  color: var(--muted);
  font-size: 0.72rem;
}
.dir-section-cong {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.dir-section-cong.cong-low { color: #27ae60; background: rgba(39,174,96,.08); }
.dir-section-cong.cong-mid { color: #f39c12; background: rgba(243,156,18,.08); }
.dir-section-cong.cong-high { color: #e74c3c; background: rgba(231,76,60,.08); }
.dir-section-speed {
  color: var(--muted);
  font-size: 0.7rem;
}

/* ── Map ── */
.map-wrap {
  margin-bottom: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}
.map-container {
  width: 100%;
  height: 450px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.naver-result-map,
.kakao-result-map,
.google-result-map {
  width: 100%;
  height: 450px;
}
.map-actions {
  display: flex;
  align-items: center;
  margin-top: 0;
  border-top: 1px solid var(--border);
}
.map-iframe {
  width: 100%;
  height: 400px;
  border: none;
}
.map-external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 10px;
  background: var(--surface2);
  font-size: 0.82rem;
  color: var(--accent);
  border-right: 1px solid var(--border);
}
.map-external-link:hover { background: var(--surface); }
.map-fullscreen-btn {
  border: 0;
  background: var(--surface2);
  color: var(--fg);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}
.map-fullscreen-btn:hover { background: var(--surface); }
.map-fallback {
  display: flex; align-items: center; justify-content: center;
  height: 200px; background: var(--surface); color: var(--muted);
  font-size: 0.9rem;
}
.map-minimap {
  width: 170px;
  height: 116px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(12, 16, 24, 0.24);
  overflow: hidden;
  background: #dfe5ef;
}
.map-minimap-canvas {
  width: 100%;
  height: 100%;
}
.map-wrap:fullscreen,
.map-wrap.map-wrap-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  margin: 0;
  border-radius: 0;
  z-index: 9999;
}
.map-wrap:fullscreen .map-container,
.map-wrap.map-wrap-pseudo-fullscreen .map-container,
.map-wrap:fullscreen .naver-result-map,
.map-wrap.map-wrap-pseudo-fullscreen .naver-result-map,
.map-wrap:fullscreen .kakao-result-map,
.map-wrap.map-wrap-pseudo-fullscreen .kakao-result-map,
.map-wrap:fullscreen .google-result-map,
.map-wrap.map-wrap-pseudo-fullscreen .google-result-map {
  height: calc(100vh - 48px) !important;
  border-radius: 0;
}
body.map-fullscreen-active {
  overflow: hidden;
}

/* ── Loading ── */
.loading-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--muted);
}
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Route Analysis ── */
.route-analysis {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 24px;
}

.segment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.segment-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.segment-num {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #000; font-weight: 800; font-size: 0.82rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.segment-route { font-weight: 600; font-size: 0.92rem; }

.segment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
}
.segment-cell {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  font-size: 0.84rem;
}
.cell-icon { font-size: 1.1rem; }
.cell-val { color: var(--text); }

/* ── Carrier Info ── */
.segment-carrier {
  padding: 14px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  position: relative;
}
.carrier-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--text);
}
.carrier-stop {
  margin-bottom: 10px;
  padding: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
}
.carrier-stop strong { color: var(--text); }
.carrier-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--text);
}
.carrier-detail span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
}
.carrier-boarding {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.carrier-boarding-zone {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(74,108,247,.16);
  border: 1px solid rgba(74,108,247,.35);
  color: var(--text);
  font-weight: 800;
  font-size: 0.75rem;
}
.carrier-boarding-note {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(6,214,160,.12);
  border: 1px solid rgba(6,214,160,.3);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
}
.carrier-tip {
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.result-actions {
  margin-top: 28px;
  display: flex; gap: 12px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 600px) {
  .lang-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  .lang-btn { padding: 16px 8px; }

  .topbar {
    flex-direction: column;
    height: auto; padding: 8px 12px; gap: 4px;
  }
  .stepper { flex-wrap: wrap; justify-content: center; }

  .quick-mode-actions { grid-template-columns: 1fr; }
  .map-container, .map-iframe, .naver-result-map, .kakao-result-map, .google-result-map { height: 300px; }
  .map-actions { flex-direction: column; }
  .map-external-link { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .map-fullscreen-btn { width: 100%; }
  .map-minimap { width: 128px; height: 88px; }

  .segment-grid { grid-template-columns: 1fr 1fr; }
  .subway-arrival-row { font-size: 0.78rem; gap: 6px; }
  .subway-direction { min-width: 80px; }
  /* 설문 반영(45%): 모바일 폰트 크기 증가 */
  html { font-size: 17px; }
  .course-tabs { grid-template-columns: 1fr; gap: 8px; }
  .course-tab { flex-direction: row; padding: 12px 16px; gap: 10px; }
  .course-tab-icon { font-size: 1.2rem; }
  .compare-header, .compare-row { grid-template-columns: 80px repeat(3, 1fr); }
  .compare-label { padding: 8px; font-size: 0.72rem; }
  .compare-val { font-size: 0.76rem; padding: 8px 4px; }
  .course-proscons { grid-template-columns: 1fr; }
  .luggage-grid { grid-template-columns: 1fr; }
  .acc-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .acc-detail-item { font-size: 0.74rem; }

  .result-actions { flex-direction: column; }
  .primary, .secondary, .btn-link { width: 100%; }
}

/* ═══════════════════════════════════════
   WEATHER PANEL (기상청 실시간)
   ═══════════════════════════════════════ */
.weather-panel {
  margin-bottom: 24px;
}
.weather-title {
  font-size: 0.95rem; font-weight: 700;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.weather-source {
  font-size: 0.7rem; font-weight: 400;
  color: var(--muted); opacity: 0.7;
}
.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.weather-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color .2s;
}
.weather-card:hover { border-color: var(--accent); }
.weather-place {
  font-size: 0.82rem; font-weight: 600;
  color: var(--muted); margin-bottom: 8px;
}
.weather-icon { font-size: 2rem; margin-bottom: 4px; }
.weather-temp {
  font-size: 1.4rem; font-weight: 800;
  color: var(--text); margin-bottom: 2px;
}
.weather-cond {
  font-size: 0.8rem; color: var(--muted);
  margin-bottom: 8px;
}
.weather-details {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  font-size: 0.72rem; color: var(--muted);
}
.weather-rain { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════
   SUBWAY PANEL (서울시 실시간 도착)
   ═══════════════════════════════════════ */
.subway-panel {
  margin-bottom: 24px;
}
.subway-title {
  font-size: 0.95rem; font-weight: 700;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.subway-source {
  font-size: 0.7rem; font-weight: 400;
  color: var(--muted); opacity: 0.7;
}
.subway-station {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.subway-station-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}
.subway-station-name {
  font-weight: 700; font-size: 0.92rem;
}
.subway-congestion {
  font-size: 0.78rem; color: var(--muted);
}
.subway-arrivals {
  display: flex; flex-direction: column;
}
.subway-arrival-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  flex-wrap: wrap;
}
.subway-arrival-row:last-child { border-bottom: none; }
.subway-line-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff; font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.subway-direction {
  flex: 1; min-width: 100px;
  color: var(--text); font-size: 0.82rem;
}
.subway-msg {
  color: var(--muted); font-size: 0.8rem;
  white-space: nowrap;
}
.subway-eta {
  font-weight: 700; color: var(--accent);
  font-size: 0.85rem; white-space: nowrap;
}
.subway-no-service {
  padding: 12px 16px;
  font-size: 0.82rem; color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  text-align: center;
}
.subway-refresh {
  text-align: center;
  margin-top: 8px;
}
.subway-refresh-btn {
  padding: 8px 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.8rem; font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.subway-refresh-btn:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.subway-refresh-btn:disabled {
  opacity: 0.5; cursor: not-allowed;
}

/* ═══════════════════════════════════════
   WEATHER ALERT BANNER (설문 68%)
   ═══════════════════════════════════════ */
.weather-alert-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(240,192,64,.12), rgba(255,106,106,.08));
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  animation: alertPulse 2s ease-in-out 3;
}
@keyframes alertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}
.wa-icon { font-size: 1.4rem; flex-shrink: 0; }
.wa-text { font-size: 0.9rem; font-weight: 600; color: var(--warn); line-height: 1.4; }

/* ═══════════════════════════════════════
   3-COURSE COMPARISON (코스 비교)
   ═══════════════════════════════════════ */
.course-comparison { margin-bottom: 24px; }

/* ── 탭 ── */
.course-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.course-tab {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 16px 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: all .2s;
  color: var(--muted); font-size: 0.85rem;
}
.course-tab:hover {
  border-color: var(--accent); color: var(--text);
  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(106,166,255,.1);
}
.course-tab.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(106,166,255,.08), rgba(78,205,196,.06));
  color: var(--text);
}
.course-tab-icon { font-size: 1.6rem; }
.course-tab-name { font-weight: 700; font-size: 0.82rem; text-align: center; }
.course-tab-tag {
  display: inline-block;
  padding: 2px 8px; border-radius: 6px;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.03em;
}
.tag-cheapest { background: rgba(78,205,196,.15); color: var(--accent2); }
.tag-fastest { background: rgba(106,166,255,.15); color: var(--accent); }
.tag-comfortable { background: rgba(153,108,172,.15); color: #c49cdb; }
.tag-weather_safe { background: rgba(240,192,64,.15); color: var(--warn); }
.tag-recommended { background: linear-gradient(135deg, rgba(106,166,255,.2), rgba(78,205,196,.2)); color: var(--accent); }

/* ── 비교 테이블 ── */
.course-compare-bar {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-grid {
  display: flex; flex-direction: column;
}
.compare-header {
  display: grid; grid-template-columns: 120px repeat(3, 1fr);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.compare-header > span {
  text-align: center; font-size: 0.78rem; font-weight: 700;
  padding: 0 6px;
}
.compare-head-name {
  color: var(--text);
}
.compare-row {
  display: grid; grid-template-columns: 120px repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}
.compare-row:last-child { border-bottom: none; }
.compare-label {
  display: flex; align-items: center;
  padding: 10px 12px; font-size: 0.78rem;
  font-weight: 600; color: var(--muted);
  background: var(--surface);
}
.compare-val {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 6px; font-size: 0.82rem;
  text-align: center; color: var(--text);
}
.compare-best {
  color: var(--accent2); font-weight: 800;
}

/* ── 코스 디테일 ── */
.course-detail { margin-bottom: 16px; }
.course-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(106,166,255,.06), rgba(78,205,196,.04));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.course-detail-name { font-size: 1.05rem; font-weight: 800; }
.course-detail-stats {
  font-size: 0.88rem; font-weight: 600;
  color: var(--accent);
}
.course-weather-tip {
  padding: 10px 14px; margin-bottom: 12px;
  background: rgba(240,192,64,.08);
  border: 1px solid rgba(240,192,64,.2);
  border-radius: 8px;
  font-size: 0.82rem; color: var(--warn);
}

/* ── 추천 ── */
.course-recommendation { margin-bottom: 8px; }
.rec-box {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 16px;
  background: linear-gradient(135deg, rgba(106,166,255,.06), rgba(78,205,196,.04));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.92rem; font-weight: 600;
  line-height: 1.5;
}
.rec-icon { font-size: 1.3rem; flex-shrink: 0; }
.rec-evidence {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.rec-evidence-title {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.rec-evidence-list {
  display: grid;
  gap: 4px;
}
.rec-evidence-item {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
}

/* ── 장단점 (설문 63%) ── */
.course-proscons {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 14px;
}
.proscons-col {
  padding: 12px; border-radius: 8px;
  font-size: 0.82rem;
}
.proscons-col.pros {
  background: rgba(78,205,196,.06);
  border: 1px solid rgba(78,205,196,.2);
}
.proscons-col.cons {
  background: rgba(255,106,106,.05);
  border: 1px solid rgba(255,106,106,.15);
}
.proscons-title {
  font-size: 0.78rem; font-weight: 700;
  margin-bottom: 6px;
}
.proscons-item {
  padding: 3px 0; color: var(--muted);
  font-size: 0.78rem; line-height: 1.4;
}

/* ── Luggage Service Panel ── */
.luggage-services {
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.luggage-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.luggage-title {
  font-size: 0.96rem;
  font-weight: 800;
}
.luggage-sub {
  font-size: 0.76rem;
  color: var(--muted);
}
.luggage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.luggage-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface2);
}
.luggage-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.luggage-type {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
}
.luggage-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}
.luggage-action {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--text);
}
.luggage-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.luggage-link-btn {
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--text);
  background: var(--surface);
}
.luggage-scenario {
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.luggage-scenario strong {
  font-size: 0.82rem;
}
.luggage-scenario p {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}
.luggage-muted {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════
   ACCESSIBILITY PANEL (교통약자 편의시설)
   ═══════════════════════════════════════ */
.accessibility-panel {
  margin-bottom: 24px;
}
.acc-title {
  font-size: 0.95rem; font-weight: 700;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.acc-source {
  font-size: 0.7rem; font-weight: 400;
  color: var(--muted); opacity: 0.7;
}
.acc-station {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.acc-station-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 8px;
}
.acc-station-name { font-weight: 700; font-size: 0.92rem; }
.acc-issue-badge {
  font-size: 0.72rem; font-weight: 600;
  color: var(--warn); background: rgba(240,192,64,.12);
  padding: 2px 8px; border-radius: 6px;
}
.acc-carry-summary {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(74,108,247,.08), rgba(6,214,160,.06));
}
.acc-carry-score {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
}
.acc-carry-score-num {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 900;
  color: var(--accent);
}
.acc-carry-score-unit {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 3px;
  margin-bottom: 2px;
}
.acc-carry-meta {
  display: grid;
  gap: 4px;
}
.acc-carry-label {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text);
}
.acc-carry-desc {
  font-size: 0.76rem;
  color: var(--text-light);
  font-weight: 600;
}
.acc-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.acc-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.acc-action-btn:hover {
  border-color: var(--accent);
  background: var(--surface2);
}
.acc-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px; background: var(--border);
}
.acc-count {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 14px 10px;
  background: var(--surface);
}
.acc-count-icon { font-size: 1.3rem; }
.acc-count-label { font-size: 0.72rem; color: var(--muted); }
.acc-count-val { font-size: 1rem; font-weight: 800; }
.acc-count-ok .acc-count-val { color: var(--accent2); }
.acc-count-warn .acc-count-val { color: var(--warn); }

/* ── details 토글 ── */
.acc-details {
  border-top: 1px solid var(--border);
}
.acc-details-toggle {
  display: block; padding: 10px 16px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--accent); cursor: pointer;
  list-style: none; user-select: none;
}
.acc-details-toggle::-webkit-details-marker { display: none; }
.acc-details-toggle::before {
  content: "▸ "; transition: transform .2s;
}
.acc-details[open] .acc-details-toggle::before {
  content: "▾ ";
}
.acc-detail-list {
  padding: 0 16px 12px;
}
.acc-detail-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.78rem;
}
.acc-detail-item:last-child { border-bottom: none; }
.acc-detail-loc {
  flex: 1; min-width: 120px;
  color: var(--text);
}
.acc-detail-exit { color: var(--muted); }
.acc-detail-floor { color: var(--muted); font-size: 0.72rem; }
.acc-detail-dir { color: var(--muted); font-size: 0.72rem; }
.acc-status-ok {
  font-size: 0.72rem; font-weight: 600;
  color: var(--accent2);
  padding: 1px 6px; border-radius: 4px;
  background: rgba(78,205,196,.1);
}
.acc-status-warn {
  font-size: 0.72rem; font-weight: 600;
  color: var(--warn);
  padding: 1px 6px; border-radius: 4px;
  background: rgba(240,192,64,.1);
}

/* ── 캐리어 출구 칩 ── */
.acc-carrier-tip {
  padding: 12px 16px;
  background: rgba(106,166,255,.04);
  border-top: 1px solid var(--border);
}
.acc-carrier-title {
  font-weight: 700; font-size: 0.85rem;
  color: var(--accent); margin-bottom: 8px;
}
.acc-exit-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.acc-exit-chip {
  padding: 5px 10px; border-radius: 8px;
  font-size: 0.76rem; font-weight: 600;
}
.acc-exit-active {
  background: rgba(78,205,196,.12);
  color: var(--accent2); border: 1px solid rgba(78,205,196,.3);
}
.acc-exit-inactive {
  background: rgba(255,106,106,.08);
  color: var(--danger); border: 1px solid rgba(255,106,106,.2);
}
.acc-update-note {
  text-align: right;
  font-size: 0.68rem; color: var(--muted);
  opacity: 0.6; padding: 4px 0;
}
@media (max-width: 600px) {
  .acc-carry-summary { grid-template-columns: 1fr; }
  .acc-quick-actions { grid-template-columns: 1fr; }
}

/* ── LIVE 뱃지 (구간 카드 내) ── */
.carrier-live-badge {
  display: inline-block;
  padding: 1px 5px; margin-left: 6px;
  background: var(--accent2); color: #000;
  font-size: 0.58rem; font-weight: 800;
  border-radius: 3px; vertical-align: middle;
  letter-spacing: 0.05em;
}
.carrier-issue {
  color: var(--warn); font-weight: 600;
}

/* ═══════════════════════════════════════
   AI ANALYSIS
   ═══════════════════════════════════════ */
.ai-analysis {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 24px;
}

.ai-summary {
  padding: 16px;
  background: linear-gradient(135deg, rgba(106,166,255,.08), rgba(78,205,196,.06));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.95rem; font-weight: 600;
  line-height: 1.5;
}
.ai-badge {
  display: inline-block;
  padding: 2px 8px; margin-right: 8px;
  background: var(--accent); color: #000;
  font-size: 0.7rem; font-weight: 800;
  border-radius: 4px; vertical-align: middle;
  letter-spacing: 0.05em;
}

.ai-totals {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.total-item {
  font-size: 1.1rem; font-weight: 700;
  color: var(--accent);
}

.carrier-warning {
  padding: 14px 16px;
  background: rgba(255,106,106,.08);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--danger);
}

.ai-usage {
  text-align: right;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.6;
  padding: 4px 0;
}

/* ── 역 안내도(구내도) 버튼 ── */
.station-map-buttons {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.station-guide-group {
  background: linear-gradient(135deg, rgba(66,165,245,.08) 0%, rgba(171,71,188,.06) 100%);
  border: 1px solid rgba(66,165,245,.25);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: all 0.2s;
}
.station-guide-group:hover {
  border-color: rgba(66,165,245,.5);
  box-shadow: 0 2px 12px rgba(66,165,245,.15);
}
.station-guide-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.station-guide-icon { font-size: 1.1rem; }
.station-guide-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
}
.station-guide-label {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(66,165,245,.2);
  color: #42a5f5;
}
.station-guide-links {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.station-guide-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.station-guide-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.sg-icon { font-size: 1rem; flex-shrink: 0; }
.sg-text { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
/* 공식(서울교통공사) */
.metro-btn {
  background: rgba(30,136,229,.12);
  color: #42a5f5;
  border-color: rgba(30,136,229,.35);
}
.metro-btn:hover { background: rgba(30,136,229,.22); }
.metro-badge { background: #1e88e5; }
/* 지도 */
.station-guide-btn.naver-btn {
  background: rgba(30,200,0,.08);
  color: #4caf50;
  border-color: rgba(30,200,0,.3);
}
.station-guide-btn.naver-btn:hover { background: rgba(30,200,0,.18); }
.naver-badge { background: #1ec800; }
/* 카카오 */
.station-guide-btn.kakao-btn {
  background: rgba(254,229,0,.08);
  color: #fdd835;
  border-color: rgba(254,229,0,.25);
}
.station-guide-btn.kakao-btn:hover { background: rgba(254,229,0,.16); }
.kakao-badge { background: #fdd835; color: #000; }

@media (max-width: 600px) {
  .station-guide-links { flex-direction: column; }
  .station-guide-btn { justify-content: center; }
}

/* ═══════════════════════════════════════
   MAP AUTH ERROR OVERLAY (NCP 인증 오류)
   ═══════════════════════════════════════ */
.map-auth-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 247, 251, 0.96);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}
.map-auth-box {
  max-width: 420px;
  width: 100%;
  text-align: center;
  color: var(--text);
}
.map-auth-icon { font-size: 2.5rem; margin-bottom: 12px; }
.map-auth-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--warn);
}
.map-auth-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.map-auth-desc code {
  background: rgba(106,166,255,.12);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
}
.map-auth-details {
  text-align: left;
  margin-bottom: 12px;
}
.map-auth-details summary {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  padding: 8px 0;
  user-select: none;
}
.map-auth-steps {
  padding-left: 20px;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.8;
}
.map-auth-steps a {
  color: var(--accent);
  text-decoration: underline;
}
.map-auth-steps code {
  background: rgba(106,166,255,.1);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.78rem;
}
.map-auth-steps ul {
  padding-left: 18px;
  margin: 4px 0;
}
.map-auth-steps li { margin-bottom: 4px; }
.map-auth-meta {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 8px;
}
.map-auth-meta code {
  background: rgba(255,255,255,.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.7rem;
}
.capture-map-placeholder {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    45deg,
    var(--surface2),
    var(--surface2) 12px,
    var(--surface) 12px,
    var(--surface) 24px
  );
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.capture-static-map {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.capture-static-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── 모션 감소 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ═══════════════════════════════════════
   WIZARD INPUT (User-First)
   ═══════════════════════════════════════ */
.wizard-wrap {
  max-width: 680px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.wizard-field-block {
  display: grid;
  gap: 8px;
}
.wizard-inline-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.wizard-input {
  height: 52px;
  font-size: 1rem;
}
.wizard-loc-btn {
  height: 52px;
  white-space: nowrap;
  padding: 0 14px;
}
.wizard-suggest {
  position: static;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 280px;
  display: block;
  box-shadow: none;
}
.wizard-actions {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.wizard-left-actions {
  display: flex;
  gap: 8px;
}
.wizard-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wizard-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  font-size: 0.8rem;
}
.wizard-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}
.wizard-stop-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wizard-submit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wizard-bag-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ═══════════════════════════════════════
   RESULT (Recommendation-First)
   ═══════════════════════════════════════ */
.rec-summary {
  margin-bottom: 14px;
}
.summary-card {
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, rgba(74,108,247,.1), rgba(6,214,160,.08));
  border-radius: var(--radius);
  padding: 14px;
}
.summary-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 6px;
}
.summary-main {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
}
.summary-sub {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 0.84rem;
  font-weight: 600;
}
.summary-reasons {
  margin-top: 8px;
  display: grid;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--text);
}
.mobility-critical {
  margin-bottom: 12px;
}
.mobility-critical-card {
  border: 2px solid #ef4444;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(254,226,226,.96), rgba(255,241,242,.94));
  padding: 12px;
  box-shadow: 0 4px 16px rgba(239,68,68,.2);
}
.mc-title {
  color: #991b1b;
  font-size: 0.84rem;
  font-weight: 900;
  margin-bottom: 4px;
}
.mc-main {
  color: #7f1d1d;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.4;
}
.mc-sub {
  margin-top: 4px;
  color: #991b1b;
  font-size: 0.78rem;
  font-weight: 800;
}
.mc-tip {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #f87171;
  border-radius: 10px;
  background: rgba(255,255,255,.75);
  color: #7f1d1d;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.4;
}
.context-chips {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.context-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-light);
  font-size: 0.74rem;
  font-weight: 700;
}
.key-metrics {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.walk-network-insights {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}
.walk-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}
.walk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.walk-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--surface2);
}
.walk-k {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 800;
}
.walk-v {
  margin-top: 3px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
}
.walk-note {
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--text-light);
  font-weight: 600;
}
.route-quick-picks {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.quick-pick {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
  color: #0f172a;
  background: #ffffff;
}
.quick-pick .qp-badge {
  font-size: 0.68rem;
  font-weight: 900;
  opacity: 0.9;
}
.quick-pick .qp-main {
  font-size: 0.84rem;
  font-weight: 900;
}
.quick-pick .qp-sub {
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.9;
}
.quick-pick.tone-rec {
  background: linear-gradient(145deg, #e8f0ff, #dff8ef);
  border-color: #7aa2ff;
}
.quick-pick.tone-cheap {
  background: linear-gradient(145deg, #e9fdf4, #ddfff1);
  border-color: #5ccf9f;
}
.quick-pick.tone-fast {
  background: linear-gradient(145deg, #fff3e0, #ffe7d0);
  border-color: #ffb057;
}
.quick-pick.tone-mid {
  background: linear-gradient(145deg, #f3f4f6, #eceff4);
  border-color: #cfd7e6;
}
.metric-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface);
}
.metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.metric-value {
  margin-top: 4px;
  font-size: 1.24rem;
  font-weight: 900;
  color: var(--text);
}
.metric-value span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  margin-left: 2px;
}
.metric-sub {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 0.74rem;
  font-weight: 700;
}
.route-cards {
  display: none;
  gap: 10px;
  margin-bottom: 14px;
}
.route-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.route-card.is-recommended {
  border-color: var(--accent);
  background: rgba(74,108,247,.08);
}
.route-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.route-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent);
}
.route-title {
  font-size: 0.92rem;
  font-weight: 800;
}
.route-meta {
  margin-top: 6px;
  font-size: 0.86rem;
  font-weight: 700;
}
.route-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.winning-factors {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}
.winning-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}
.winning-list {
  display: grid;
  gap: 8px;
}
.factor-row {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.factor-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 0.74rem;
  color: var(--text-light);
}
.factor-head strong {
  color: var(--text);
  font-size: 0.78rem;
}
.factor-bar {
  margin-top: 6px;
  width: 100%;
  height: 7px;
  background: rgba(74,108,247,.16);
  border-radius: 999px;
  overflow: hidden;
}
.factor-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.map-toggle-wrap {
  margin-bottom: 10px;
}
.map-error {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  border: 1px solid #ef4444;
  background: rgba(254,242,242,.97);
  color: #991b1b;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.76rem;
  font-weight: 700;
}

/* ── Result V3 (Carrier First) ── */
.result-v3 {
  display: grid;
  gap: 12px;
}
.v3-carrier-tip,
.v3-recommendation,
.v3-route-menu,
.v3-why {
  margin: 0;
}
.v3-tip-card {
  border: 2px solid #ef4444;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(255, 241, 242, 0.94));
  padding: 14px;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.18);
}
.v3-tip-card h2 {
  font-size: 0.95rem;
  font-weight: 900;
  color: #991b1b;
  margin-bottom: 6px;
}
.v3-tip-card p {
  color: #7f1d1d;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}
.v3-tip-main {
  margin-top: 6px;
}
.v3-tip-note {
  margin-top: 4px;
}
.v3-skeleton-line {
  height: 11px;
  border-radius: 999px;
  margin-top: 7px;
  background: linear-gradient(90deg, rgba(148,163,184,.2), rgba(148,163,184,.38), rgba(148,163,184,.2));
  background-size: 200% 100%;
  animation: v3SkeletonPulse 1.15s linear infinite;
}
.v3-skeleton-line.short {
  width: 62%;
}
@keyframes v3SkeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.v3-rec-card {
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(74, 108, 247, 0.12), rgba(6, 214, 160, 0.1));
  padding: 14px;
}
.v3-rec-title {
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--muted);
}
.v3-rec-main {
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
}
.v3-rec-sub {
  margin-top: 4px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-light);
}
.v3-rec-route {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.v3-route-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.v3-route-btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.v3-route-btn span {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--text-light);
}
.v3-route-btn strong {
  font-size: 0.88rem;
  font-weight: 900;
}
.v3-route-btn small {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}
.v3-route-btn.is-active {
  border-color: #ef4444;
  background: rgba(254, 226, 226, 0.85);
}
.v3-why-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}
.v3-why-card h3 {
  font-size: 0.84rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}
.v3-station-overview {
  display: grid;
  gap: 8px;
}
.v3-station-head {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--text-light);
}
.v3-station-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.v3-station-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 11px;
}
.v3-station-card h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 900;
}
.v3-station-card p {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-light);
}
.v3-station-title {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.v3-station-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-light);
  border-top: 1px dashed var(--border);
  padding-top: 5px;
  margin-top: 5px;
}
.v3-station-row strong {
  color: var(--text);
  font-weight: 800;
}
.v3-station-row span {
  text-align: right;
}
.v3-bar-row {
  margin-top: 8px;
}
.v3-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-light);
}
.v3-bar-head strong {
  color: var(--text);
  font-size: 0.8rem;
}
.v3-bar {
  margin-top: 5px;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  overflow: hidden;
}
.v3-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444, #f97316);
}

@media (max-width: 600px) {
  .wizard-inline-row {
    grid-template-columns: 1fr;
  }
  .wizard-loc-btn {
    height: 44px;
    width: 100%;
  }
  .wizard-bag-buttons {
    grid-template-columns: 1fr;
  }
  .key-metrics {
    grid-template-columns: 1fr;
  }
  .walk-grid {
    grid-template-columns: 1fr;
  }
  .route-quick-picks {
    grid-template-columns: 1fr;
  }
  .v3-route-menu {
    grid-template-columns: 1fr;
  }
  .v3-station-grid {
    grid-template-columns: 1fr;
  }
  .factor-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
