/* 스텝프리 — 모바일 우선 스타일 (토스 제품 원칙: One Thing, Clear Action, Easy to Answer)
 *
 * ── 공용 체계 (UX-2, 다른 화면·result.css도 이것만 씀) ─────────────────────────────
 *  여백      --sp-4 --sp-8 --sp-12 --sp-16 --sp-24 --sp-32           (이 여섯 값만)
 *  글자 크기 --fs-xs 13 · --fs-sm 15 · --fs-md 17 · --fs-lg 20 · --fs-xl 24 · --fs-2xl 32 px (rem, 이용자 글자 설정을 따름)
 *  모서리    --r-tag 8(태그) · --r-input 12(입력칸·작은 단추) · --r-card 16(카드·주 단추) · --r-pill 999(칩)
 *  높이      --h-primary 56 · --h-secondary 48 · --h-text 44 (누르는 곳은 어디서나 44px 이상)
 *  너비      --content 720px (물어보기·제보·급해요 화면·결과 한 단의 본문 너비)
 *  단추      .cta = .btn-primary   보라 채움 56px, 화면당 1개
 *            .secondary = .btn-secondary   연보라 채움 48px
 *            .btn-text   보라 글자 + 밑줄(글자 단추는 늘 밑줄), 높이 44px. 문장 속에서도 44px (위아래 여백을 겹침)
 *  안내 상자 .notice.info(연보라) / .notice.warn(주황) / .notice.danger(빨강)
 *            모양: <p class="notice warn"><svg class="i"><use href="#i-sos"/></svg><span>한 문장 <button class="btn-text">행동</button></span></p>
 *            (app.js noticeHtml(kind, html, act) / setNotice(el, kind, html, act)). 아이콘: info=#i-info, warn·danger=#i-sos
 *  꼬리표    .tag (회색) .tag.in(초록: 개찰구 안 등 '좋은 사실') .tag.warn(주황)
 *  위급도 색은 정보(연보라)·주의(주황)·위험(빨강) 3단계만. 초록 ✓는 '엘리베이터만으로 계단 없이 갈 수 있음'에만.
 *  떠 있는 요소 금지: 내용을 가리는 고정·떠 있는 것은 위 막대(.appbar)·아래 메뉴(.tabbar)·물어보기 입력 막대(.chat-form)뿐.
 */
:root {
  /* 키 컬러 '스텝프리 퍼플': 장애 포용(Purple Light Up)의 보라, 노선 색과 ΔE≥28, 흰 글자 대비 5.0:1 */
  /* 어두운 화면 --blue #9898ff도 노선 색과 ΔE≥28 (5호선과 28.4). tests/palette.test.js가 확인 */
  --blue: #5b5bf0; --blue-press: #4646d8; --blue-weak: #eeeeff;
  --ink: #191f28; --sub: #4e5968; --mute: #6b7684; --line: #e5e8eb;
  /* 재설계 A(노선도): 흰 바탕 · 회색 채움 덩어리(--fill) · 입력 테두리 --line-input */
  --bg: #ffffff; --card: #ffffff; --fill: #f2f4f6; --fill-press: #e5e8eb; --green: #067046; --green-weak: #e5f6ee;
  /* 입력 안내 글자(흰 바탕 4.6:1)·칸 테두리(누르는 칸은 3:1 이상이어야 해서 바꾸기 원·라디오는 --line-strong) */
  --hold: #6b7684; --line-input: #d1d6db; --line-strong: #8b95a1; --walk: #b0b8c1;
  --orange: #8f4700; --orange-weak: #fff4e6; --red: #c41a29; --red-weak: #ffeeee;
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-24: 24px; --sp-32: 32px;
  --fs-xs: .765rem; --fs-sm: .882rem; --fs-md: 1rem; --fs-lg: 1.176rem; --fs-xl: 1.412rem; --fs-2xl: 1.882rem;
  --r-tag: 8px; --r-input: 12px; --r-card: 16px; --r-pill: 999px;
  --h-primary: 56px; --h-secondary: 48px; --h-text: 44px;
  --content: 720px;
  --radius: var(--r-card);   /* 예전 이름 (결과 카드) */
  --tab-h: 65px;             /* 아래 메뉴 높이 (낮은 화면 57px, 넓은 화면은 위로 올라가 0) */
  font-size: 106.25%;        /* 17px, 휴대폰·브라우저 글자 크기 설정을 따름 */
  --col: 480px; --gut: 16px; /* 본문 폭·좌우 여백 (넓은 화면에서 넓어짐) */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f4f6; --sub: #b0b8c1; --mute: #8b95a1; --line: #2c333d;
    --bg: #101317; --card: #101317; --fill: #1d2229; --fill-press: #2a313a; --line-input: #4e5968; --walk: #6b7684; --blue: #9898ff; --blue-press: #b4b4ff; --blue-weak: #24244a; --green: #3fd08f; --green-weak: #12291f;
    --orange: #ffb35c; --orange-weak: #2c2214; --red: #ff6b6b; --red-weak: #2d1618;
    --hold: #8b95a1; --line-strong: #6b7684;   /* 카드 바탕에서 글자 5.4:1, 테두리 3.6:1 */
  }
  :root:not([data-theme="light"]) .key .door-big { color: #10102e; }   /* 밝은 남색 바탕 + 흰 글씨는 대비 2.4:1 → 어두운 글씨 */
  /* 밝은 보라 바탕(--blue)에 흰 글씨를 쓰는 단추·말풍선은 어두운 글씨 (7.3:1) */
  :root:not([data-theme="light"]) .cta, :root:not([data-theme="light"]) .msg.user, :root:not([data-theme="light"]) .send, :root:not([data-theme="light"]) .badge { color: #10102e; }
  :root:not([data-theme="light"]) .cta:disabled { color: var(--blue-press); }   /* 불러오는 중: 연보라 바탕 + 밝은 보라 글씨 */
}

/* ───── 바탕 ───── */
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 64px; scroll-padding-bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.5; letter-spacing: -0.01em; word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + var(--sp-12) + env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }   /* display를 지정한 요소도 hidden이면 숨김 */
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; color: var(--blue-press); background: var(--card); padding: 8px; z-index: 9; }
/* 화면에는 안 보이고 화면낭독기만 읽는 글 (.sr 은 예전 이름) */
.sr-only, .sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1[tabindex="-1"]:focus, .state[tabindex="-1"]:focus { outline: none; }   /* 화면 전환 때 옮긴 포커스는 테두리 없이 */
button { font: inherit; color: inherit; }
.i { width: 1.4em; height: 1.4em; flex: none; }   /* 글자 크기를 따라 커짐 */
.nowrap { white-space: nowrap; }
/* 영어 화면: 옮기지 못한 한국어 원문은 접어 둠 (Original (Korean)) */
.orig-ko { display: inline-block; vertical-align: top; }
.orig-ko > summary { display: inline-flex; align-items: center; min-height: var(--h-text); cursor: pointer; color: var(--blue-press); font-size: var(--fs-sm); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.orig-ko[open] { display: block; }
.orig-ko > span { display: block; color: var(--sub); font-size: var(--fs-sm); }

main { max-width: var(--col); margin: 0 auto; padding: var(--sp-4) var(--gut) var(--sp-24); }
.title { font-size: var(--fs-xl); line-height: 1.3; font-weight: 800; margin: var(--sp-16) 0 var(--sp-4); letter-spacing: -0.03em; }
.sub { color: var(--sub); margin: 0 0 var(--sp-16); font-size: var(--fs-md); }
.section { font-size: var(--fs-md); font-weight: 700; margin: var(--sp-32) 0 var(--sp-8); }
.caption { color: var(--mute); font-size: var(--fs-sm); margin: 0 0 var(--sp-8); font-weight: 600; }
.caption small { font-weight: 500; }
h2.caption, h2.key-title { font-size: var(--fs-sm); line-height: 1.5; }
h2.h3 { font-size: var(--fs-md); }
.foot-note { color: var(--mute); font-size: var(--fs-sm); margin: var(--sp-16) var(--sp-4) 0; line-height: 1.55; }

/* ───── 단추 ───── */
.cta, .btn-primary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--h-primary); padding: 0 var(--sp-16); border: 0; border-radius: var(--r-card); background: var(--blue); color: #fff; font-weight: 700; font-size: var(--fs-md); text-align: center; cursor: pointer; margin-top: var(--sp-16); transition: transform .08s, background .15s; }
.cta:active, .btn-primary:active { transform: scale(.98); background: var(--blue-press); }
.cta:disabled { background: var(--blue-weak); color: var(--blue-press); cursor: default; }
.secondary, .btn-secondary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--h-secondary); padding: 0 var(--sp-16); border: 0; border-radius: var(--r-input); background: var(--blue-weak); color: var(--blue-press); font-weight: 700; font-size: var(--fs-md); text-align: center; cursor: pointer; }
.btn-text, .inline-link { display: inline-flex; align-items: center; min-height: var(--h-text); padding: 0; border: 0; background: none; color: var(--blue-press); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
/* 문장 속 글자 단추: 누르는 곳은 44px, 줄 간격은 그대로 (위아래 여백을 겹침) */
.notice .btn-text, .foot-note .inline-link, p > .inline-link, .s > .inline-link { min-height: var(--h-text); margin: -12px 0; vertical-align: middle; }
.as-label { position: relative; }
.as-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }   /* 키보드·화면낭독기로도 고를 수 있게 숨기지 않고 투명하게 */
.as-label:focus-within { outline: 3px solid var(--blue-press); outline-offset: 3px; }
.actions-col { display: grid; gap: var(--sp-8); }
.actions-col .cta { margin-top: 0; }
/* 결과 화면의 예전 글자 단추 (구현자 B 영역, 모양 그대로) */
.link { border: 0; background: none; color: var(--blue); font-weight: 600; cursor: pointer; padding: 8px 4px; min-height: 40px; }
.link.inline { padding: 0; min-height: 0; font-size: inherit; }

/* ───── 안내 상자 1종: 아이콘 + 한 문장 + 행동 링크 ───── */
.notice { display: flex; gap: var(--sp-8); align-items: flex-start; background: var(--blue-weak); color: var(--ink); border-radius: var(--r-input); padding: var(--sp-12) var(--sp-16); margin: 0 0 var(--sp-12); font-size: var(--fs-sm); line-height: 1.5; }
.notice > .i { width: 1.25em; height: 1.25em; margin-top: .1em; color: var(--blue-press); }
.notice.warn { background: var(--orange-weak); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 35%, transparent); }
.notice.warn > .i { color: var(--orange); }
.notice.danger { background: var(--red-weak); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent); }
.notice.danger > .i { color: var(--red); }
.notice .when { display: block; color: var(--mute); font-size: var(--fs-xs); }

/* ───── 칩·꼬리표 ───── */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.chips button { display: inline-flex; align-items: center; gap: var(--sp-8); border: 1.5px solid var(--line-strong); background: var(--card); border-radius: var(--r-pill); padding: 0 var(--sp-16); min-height: var(--h-text); cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--sub); }
.tag { display: inline-block; font-size: var(--fs-xs); font-weight: 700; border-radius: var(--r-tag); padding: 1px var(--sp-8); margin: var(--sp-4) var(--sp-4) 0 0; background: var(--fill-press); color: var(--sub); }
.tag.in { background: var(--green-weak); color: var(--green); }
.tag.warn { background: var(--orange-weak); color: var(--orange); }
.chips .tag { margin: 0; background: var(--bg); }
.chips .tag.ex { background: var(--blue-weak); color: var(--blue-press); }
.badge { display: inline-block; margin: 0 var(--sp-8) var(--sp-4) 0; padding: 1px var(--sp-8); border-radius: var(--r-tag); background: var(--blue); color: #fff; font-size: var(--fs-xs); font-weight: 700; vertical-align: 1px; }

/* ───── 위 막대 ───── */
.appbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--sp-8); height: 48px; padding: 0 max(var(--sp-16), calc((100% - var(--col)) / 2 + var(--gut))); background: var(--card); border-bottom: 1px solid var(--line); }
.logo { width: 26px; height: 26px; border-radius: var(--r-tag); background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='9' y='7' width='14' height='18' rx='3' fill='none' stroke='white' stroke-width='2.4'/%3E%3Cpath d='M13 14l3-3 3 3M13 18l3 3 3-3' stroke='white' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.brand { font-weight: 800; font-size: var(--fs-md); }
.back { border: 0; background: none; font-size: 1.4rem; width: 44px; height: 44px; margin-left: -12px; cursor: pointer; }
.back:not([hidden]) ~ .logo, .back:not([hidden]) ~ .brand { display: none; }
/* 언어 바꾸기(EN / 한국어): 누르는 곳 44px */
.lang-btn { margin-left: auto; min-height: 44px; min-width: 44px; padding: 0 var(--sp-16); border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: var(--card); color: var(--sub); font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0; cursor: pointer; }
.lang-btn:active { background: var(--blue-weak); color: var(--blue); }

/* ───── 아래 메뉴 ───── */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { border: 0; background: none; min-width: 0; min-height: 64px; padding: 0 2px; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: min(var(--fs-sm), 20px); line-height: 1.15; text-align: center; font-weight: 600; color: var(--mute); cursor: pointer; }   /* 글자 상한 20px, 두 줄까지 */
.tabbar button .i { width: min(1.6em, 30px); height: min(1.6em, 30px); }
.tabbar button[aria-current="page"] { color: var(--blue); }
.tabbar .urgent-tab { color: var(--red); font-weight: 800; }
.tabbar .urgent-tab .i { background: var(--red-weak); border-radius: var(--r-tag); padding: 2px; }
.tabbar .urgent-tab[aria-current="page"] { color: var(--red); box-shadow: inset 0 3px 0 var(--red); }

/* ───── 입력칸·자동완성 (홈·급해요·제보 공용) ───── */
.field-card { position: relative; background: var(--card); border-radius: var(--r-card); padding: var(--sp-16); }
.field { position: relative; display: grid; grid-template-columns: minmax(3.2em, max-content) minmax(0, 1fr); column-gap: var(--sp-8); align-items: start; }
.field > label { grid-column: 1; grid-row: 1; line-height: 48px; color: var(--sub); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.field > :not(label) { grid-column: 2; }
.combo { position: relative; min-width: 0; }
.combo input { width: 100%; min-height: 48px; border: 1.5px solid var(--line-input); border-radius: var(--r-input); padding: 0 var(--sp-12); background: var(--card); font: inherit; font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.combo input::placeholder, .exit-box input::placeholder { color: var(--hold); opacity: 1; font-weight: 400; }
.combo input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1.5px var(--blue); }
.field-links { display: flex; flex-wrap: wrap; gap: 0 var(--sp-16); }
.field-links .btn-text { font-size: var(--fs-sm); }
.loc-note { color: var(--sub); font-size: var(--fs-sm); margin: 0 0 var(--sp-8); }
.full-name { margin: var(--sp-4) 0 0; font-size: var(--fs-sm); font-weight: 700; color: var(--sub); overflow-wrap: anywhere; }
/* 자동완성: 아래 내용을 밀어내는 목록(버튼을 가리지 않게), 칸 왼쪽 라벨 아래까지 넓게 */
.sug { position: static; margin: var(--sp-4) 0 0 calc(-3.2em - var(--sp-8)); list-style: none; padding: var(--sp-4); background: var(--fill); border-radius: var(--r-input); max-height: 50vh; overflow-y: auto; }
.sug li { display: flex; align-items: center; gap: var(--sp-8); min-height: 56px; padding: var(--sp-8) var(--sp-12); border-radius: var(--r-input); cursor: pointer; }
.sug li[aria-selected="true"], .sug li:hover { background: var(--card); }
.sug .nm { flex: 1; min-width: 0; font-weight: 700; font-size: var(--fs-md); }
.sug .nm mark { background: none; color: var(--blue-press); }
.sug .ln { display: flex; gap: var(--sp-4); flex-wrap: wrap; justify-content: flex-end; }
.sug .sub { display: block; margin: 0; color: var(--sub); font-size: var(--fs-sm); font-weight: 500; }
.sug li.place .pin { width: 1.3em; height: 1.3em; color: var(--sub); }
.sug li.place .tag { margin: 0; flex: none; }
.sug .none { color: var(--mute); cursor: default; }
.pill { display: inline-block; color: var(--ink); background: var(--card); border: 2px solid var(--lc, var(--line)); border-radius: var(--r-pill); padding: 0 7px; font-size: var(--fs-xs); font-weight: 700; margin-right: var(--sp-4); vertical-align: 1px; }
/* 자동완성 목록이 열려 있으면 출발·도착 바꾸기 단추는 숨김 (목록을 가리지 않게) */
.field-card:has(.sug:not([hidden])) .swap, #routeForm:has(.sug:not([hidden])) .swap { display: none; }

/* ───── 홈: 재설계 A는 web/css/a.css ───── */
/* 출구 칸: '출발 출구 [ 2 | 번 출구 | ✕ 지우기 ]' */
.exit-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-8); margin: 0 0 var(--sp-8); }
.exit-row > label { font-size: var(--fs-sm); font-weight: 600; color: var(--sub); }
.exit-box { display: inline-flex; align-items: center; gap: var(--sp-4); min-height: 48px; padding-left: var(--sp-12); border: 1.5px solid var(--line-strong); border-radius: var(--r-input); background: var(--card); }
.exit-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1.5px var(--blue); }
.exit-box input { width: 3.6em; min-height: 44px; border: 0; padding: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); }
.exit-box input:focus { outline: none; }
.exit-suf { color: var(--sub); font-size: var(--fs-sm); }
.exit-suf:empty { display: none; }
.exit-box .exit-clear { padding: 0 var(--sp-12); font-size: var(--fs-sm); color: var(--sub); text-decoration: none; }
/* 데이터·AI 안내: 누를 수 있는 줄 + 오른쪽 화살표 */
details.about { margin-top: var(--sp-24); }
details.about > summary { list-style: none; background: var(--fill); border-radius: var(--r-card); padding: var(--sp-12) 44px var(--sp-12) var(--sp-16); min-height: 56px; display: flex; align-items: center; cursor: pointer; position: relative; font-weight: 700; color: var(--ink); }
details.about > summary::-webkit-details-marker { display: none; }
details.about > summary small { display: block; color: var(--mute); font-weight: 500; font-size: var(--fs-xs); }
details.about > summary::after { content: "›" / ""; position: absolute; right: var(--sp-16); top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--mute); transition: transform .15s; }
details.about[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
details.about[open] > summary { border-radius: var(--r-card) var(--r-card) 0 0; }
#dataPanel { background: var(--fill); border-radius: 0 0 var(--r-card) var(--r-card); padding: var(--sp-16); font-size: var(--fs-sm); color: var(--sub); }
#dataPanel h3, #dataPanel h2.h3 { color: var(--ink); font-size: var(--fs-md); margin: var(--sp-16) 0 var(--sp-8); }
#dataPanel h2.h3:first-child { margin-top: 0; }
#dataPanel ul { margin: var(--sp-8) 0 0; padding-left: 1.1em; }
#dataPanel .secondary { margin-top: var(--sp-8); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
.stat { background: var(--card); border-radius: var(--r-input); padding: var(--sp-8) var(--sp-12); }
.stat b { display: block; font-size: var(--fs-lg); color: var(--ink); }
.stat span { font-size: var(--fs-xs); }
.meta-line { color: var(--mute); font-size: var(--fs-xs); margin: var(--sp-8) var(--sp-4) 0; }
details.sub-more { margin-top: var(--sp-16); }
details.sub-more > summary { cursor: pointer; font-weight: 700; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
.gaps { list-style: none; padding: 0 !important; display: grid; gap: var(--sp-8); }
.gaps li { background: var(--card); border-radius: var(--r-input); padding: var(--sp-8) var(--sp-12); display: grid; gap: 2px; }
.gaps b { color: var(--ink); }
.gaps small { color: var(--mute); }

/* ───── 아래에서 올라오는 창 (급해요·고장 목록·빈칸 채우기) ───── */
.sheet { border: 0; padding: var(--sp-16) var(--sp-16) calc(var(--sp-16) + env(safe-area-inset-bottom)); margin: auto auto 0; width: 100%; max-width: 480px; max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; border-radius: var(--r-card) var(--r-card) 0 0; background: var(--bg); color: var(--ink); }
.sheet::backdrop { background: rgba(0, 0, 0, .45); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); margin-bottom: var(--sp-12); }
.sheet-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 800; }
.sheet-close { flex: none; border: 0; background: var(--card); width: 44px; height: 44px; border-radius: 50%; font-size: var(--fs-md); cursor: pointer; color: var(--sub); }
.sheet-body .list { margin: var(--sp-8) 0 0; }
.sheet-body .answer { background: var(--fill); }
.sheet-body .s { color: var(--sub); font-size: var(--fs-sm); margin: 0; }
/* 급해요 창: ① 도움(빨강, 단독) ② 가까운 곳 찾기 타일 3칸 ③ 길 바꾸기 목록 */
.ni { width: 36px; height: 36px; flex: none; border-radius: var(--r-input); background: var(--blue-weak); color: var(--blue-press); display: grid; place-items: center; }
.need-sos { display: flex; align-items: center; gap: var(--sp-12); width: 100%; min-height: 56px; padding: var(--sp-8) var(--sp-16); border: 1.5px solid var(--red); border-radius: var(--r-card); background: var(--card); color: var(--ink); font-weight: 800; font-size: var(--fs-md); text-align: left; cursor: pointer; }
.need-sos .ni { background: var(--red-weak); color: var(--red); }
.sheet-cap { margin: var(--sp-16) 0 var(--sp-8); color: var(--sub); font-size: var(--fs-sm); font-weight: 700; }
.need-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 5.2em), 1fr)); gap: var(--sp-8); }
.need-tiles button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-8); min-height: 88px; padding: var(--sp-12) var(--sp-4); border: 0; border-radius: var(--r-card); background: var(--fill); color: var(--ink); font-weight: 700; font-size: var(--fs-sm); line-height: 1.25; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.need-list { display: grid; gap: var(--sp-8); }
.need-list button { display: flex; align-items: center; gap: var(--sp-12); width: 100%; min-height: 56px; padding: var(--sp-8) var(--sp-16); border: 0; border-radius: var(--r-card); background: var(--fill); color: var(--ink); font-weight: 700; font-size: var(--fs-md); text-align: left; cursor: pointer; }
.need-list small { display: block; color: var(--mute); font-weight: 500; font-size: var(--fs-xs); }

/* ───── 카드·목록 (급해요 답·결과 공용) ───── */
.answer { background: var(--fill); border-radius: var(--r-card); padding: var(--sp-16); margin-top: var(--sp-12); }
.answer .big { font-size: var(--fs-lg); font-weight: 800; margin: 0 0 var(--sp-4); line-height: 1.35; }
.answer .row { display: flex; gap: var(--sp-12); align-items: flex-start; padding: var(--sp-12) 0; border-top: 1px solid var(--line); }
.answer .row:first-of-type { border-top: 0; padding-top: var(--sp-4); }
.answer .row .i { color: var(--blue-press); margin-top: 2px; }
.answer .s { color: var(--mute); font-size: var(--fs-sm); }
.answer.best { border: 2px solid var(--blue); }
.answer .time-s { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 var(--sp-4); color: var(--blue-press); }
.answer .vs { margin: var(--sp-12) 0 0; padding-top: var(--sp-8); border-top: 1px dashed var(--line); color: var(--sub); font-size: var(--fs-sm); }
.answer.alt-opt { padding: var(--sp-12) var(--sp-16); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-8); }
.list li { background: var(--fill); border-radius: var(--r-input); padding: var(--sp-12) var(--sp-16); display: flex; justify-content: space-between; align-items: center; gap: var(--sp-12); font-size: var(--fs-sm); }
.list li .src { color: var(--mute); font-size: var(--fs-xs); display: block; }
.list li button { flex: none; }
.list.compact li { padding: var(--sp-8) var(--sp-12); }
.list .chip-bad { white-space: nowrap; flex: none; }
.empty { color: var(--mute); background: transparent !important; padding: var(--sp-4) !important; }
.ask-card { background: var(--fill); border-radius: var(--r-card); padding: var(--sp-16); margin-top: var(--sp-4); display: grid; gap: var(--sp-8); }
.ask-card .cta, .ask-card .secondary { margin-top: var(--sp-8); }
.ask-card .loc-note { margin: 0; }

/* ───── 급해요 화면 (화장실·아기·충전·열차 안·도움) ───── */
.page-narrow { max-width: var(--content); }
.page-narrow .caption { margin: var(--sp-24) 0 var(--sp-8); }
.page-narrow .s { color: var(--sub); font-size: var(--fs-sm); margin: var(--sp-4) 0 0; }
.page-narrow .answer .btn-text { font-size: var(--fs-sm); }
.need-page .dir-hint { margin: 0 0 var(--sp-8); }
.need-page .option small { font-weight: 500; }
.now-line { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); margin: var(--sp-4) 0 0; padding: 0 var(--sp-16); min-height: 56px; background: var(--fill); border-radius: var(--r-card); font-size: var(--fs-md); }
.now-line b { font-weight: 800; }
#needAnswer { scroll-margin-top: 64px; }
.help-page .help-note { margin: 0 var(--sp-4) var(--sp-8); }
.help-page .notice { margin-top: var(--sp-8); }
.help-page .ask-card { margin-top: var(--sp-16); }
/* 전화 칸: › 대신 전화 아이콘 + '전화' */
.option.call-opt::after { content: none; }
.option > .call-tag, .call-tag { flex: none; display: inline-flex; align-items: center; gap: var(--sp-4); margin-left: var(--sp-12); padding: 0 var(--sp-12); min-height: 36px; border-radius: var(--r-pill); background: var(--blue-weak); color: var(--blue-press); font-size: var(--fs-sm); font-weight: 700; }
.call-tag .i { width: 1.1em; height: 1.1em; }
.option.danger .call-tag { background: var(--red-weak); color: var(--red); }
.help-page .option { padding: var(--sp-12) var(--sp-16); }

/* ───── 물어보기 ───── */
.chat-log { display: grid; gap: var(--sp-8); margin: var(--sp-16) 0 var(--sp-12); }
.msg { max-width: 88%; border-radius: var(--r-card); padding: var(--sp-12) var(--sp-16); font-size: var(--fs-md); }
.msg p { margin: 0; white-space: pre-wrap; }
.msg.user { justify-self: end; background: var(--blue); color: #fff; border-bottom-right-radius: var(--sp-4); }
.msg.ai { background: var(--fill); border-bottom-left-radius: var(--sp-4); }
.msg .heard { color: var(--mute); font-size: var(--fs-sm); margin: 0 0 var(--sp-4); }
.msg .meta { color: var(--mute); font-size: var(--fs-xs); margin-top: var(--sp-8); }
.msg .ai-tag { display: inline-block; background: var(--blue-weak); color: var(--blue-press); font-size: var(--fs-xs); font-weight: 700; border-radius: var(--r-tag); padding: 1px 6px; margin-bottom: 6px; }
.msg .more { margin-top: var(--sp-8); border-top: 1px solid var(--line); padding-top: var(--sp-8); }
.msg-acts { display: flex; flex-wrap: wrap; gap: 0 var(--sp-16); margin-top: var(--sp-4); }
.msg .btn-text { font-size: var(--fs-sm); }
.msg .tag { margin-top: 0; }
.typing { color: var(--mute); }
ul.ai-lines { margin: 6px 0 0; padding-left: 18px; }
ul.ai-lines li { margin: 4px 0; }
/* 입력 막대: 아래 메뉴 바로 위에 늘 같은 자리 (막대로 붙어 있고 내용 위에 떠 있지 않음) */
.chat-form { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 5; background: var(--card); border-top: 1px solid var(--line); padding: var(--sp-8) var(--gut); }
.chat-inner { max-width: var(--content); margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) 52px; gap: var(--sp-8); }
.chat-form input { min-height: 52px; border: 1.5px solid var(--line-strong); border-radius: var(--r-card); background: var(--card); padding: 0 var(--sp-16); font: inherit; color: var(--ink); min-width: 0; }
.chat-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1.5px var(--blue); }
.mic { width: 52px; border: 0; border-radius: var(--r-card); background: var(--blue-weak); color: var(--blue-press); cursor: pointer; display: grid; place-items: center; }
.mic.on { background: var(--red-weak); color: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.send { border: 0; border-radius: var(--r-card); background: var(--blue); color: #fff; font-size: 1.3rem; font-weight: 800; cursor: pointer; }
body:has(#view-chat:not([hidden])) { padding-bottom: calc(var(--tab-h) + 68px + var(--sp-12) + env(safe-area-inset-bottom)); }
html:has(#view-chat:not([hidden])) { scroll-padding-bottom: calc(var(--tab-h) + 84px + env(safe-area-inset-bottom)); }
#askChips { margin-bottom: var(--sp-8); }
#view-chat .en-note { margin-top: calc(-1 * var(--sp-8)); }

/* ───── 제보 ───── */
canvas { width: 100%; height: auto; border-radius: var(--r-card); margin-top: var(--sp-12); background: #fff; }
.confirm { background: var(--fill); border-radius: var(--r-card); padding: var(--sp-16); margin-top: var(--sp-12); }
.confirm h3, .confirm h2.h3 { margin: 0 0 var(--sp-4); font-size: var(--fs-lg); }
.confirm .read { color: var(--mute); font-size: var(--fs-sm); margin: 0 0 var(--sp-12); }
.confirm .secondary { margin-bottom: var(--sp-12); }
.confirm dl { display: grid; grid-template-columns: minmax(4.5em, max-content) minmax(0, 1fr); gap: var(--sp-8); margin: 0; align-items: center; }
.confirm dt { color: var(--sub); font-size: var(--fs-sm); }
.confirm dd { margin: 0; min-width: 0; }
.confirm dd .s { margin: var(--sp-4) 0 0; font-size: var(--fs-xs); color: var(--mute); }
.confirm input, .confirm select { width: 100%; min-height: 48px; border: 1.5px solid var(--line-strong); border-radius: var(--r-input); background: var(--card); padding: 0 var(--sp-12); font: inherit; color: var(--ink); min-width: 0; }
/* 빈칸 채우기: 구분선 + 소제목으로 위 제보와 나눔 */
.fill-card { margin-top: var(--sp-32); padding-top: var(--sp-8); border-top: 1px solid var(--line-strong); scroll-margin-top: 64px; }
.fill-card .section { margin-top: var(--sp-16); }
.fill-card .field-card { display: grid; gap: var(--sp-8); }
.fill-h { margin: var(--sp-16) 0 0; color: var(--ink); }
.mine { margin-top: var(--sp-32); }
#view-report .combo input { font-weight: 600; }
.answer.gap .q { font-weight: 700; margin: 0 0 var(--sp-8); word-break: keep-all; }
.choices { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.choices:has(input) { flex-wrap: nowrap; }
.choices button { border: 0; background: var(--blue-weak); color: var(--blue-press); font-weight: 700; border-radius: var(--r-input); padding: 0 var(--sp-16); min-height: 44px; cursor: pointer; font-size: var(--fs-sm); }
.choices input { flex: 1 1 0; min-width: 0; width: 100%; min-height: 44px; border: 1.5px solid var(--line-strong); border-radius: var(--r-input); padding: 0 var(--sp-12); font: inherit; background: var(--card); color: var(--ink); }
.choices input[aria-invalid="true"] { border-color: var(--red); }
.thanks { color: var(--blue-press); font-weight: 700; margin: 0; }

/* ───────────────────────────────────────────────────────────────
   결과 화면 (구현자 B 영역: 아래 규칙은 UX-1 모양 그대로 옮겨 둠. 새 결과 모양은 web/css/result.css)
   ─────────────────────────────────────────────────────────────── */


.tips { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.tips li { background: var(--orange-weak); color: var(--ink); border-radius: 14px; padding: 12px 14px; font-size: .94rem; display: flex; gap: 8px; align-items: flex-start; }
.tips li .i { width: 1.25em; height: 1.25em; color: var(--orange); margin-top: 1px; }

.steps-card { background: var(--card); border-radius: var(--radius); padding: 6px 4px; margin-top: 12px; }
.step { border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step > summary { list-style: none; display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; gap: 10px; align-items: center; padding: 14px 12px; cursor: pointer; min-height: 64px; }
.step > summary::-webkit-details-marker { display: none; }
.step > summary::after { content: "›" / ""; color: var(--mute); font-size: 1.3rem; transition: transform .15s; justify-self: end; }
.step[open] > summary::after { transform: rotate(90deg); }
.step > summary > span, .step .t, .step .s { min-width: 0; overflow-wrap: anywhere; }
.ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-weak); color: var(--blue); }
.step .t { font-weight: 700; display: block; }
.step .s { color: var(--mute); font-size: .88rem; display: block; margin-top: 1px; }
.step .body { padding: 0 16px 16px 62px; }
.step ol { margin: 0; padding-left: 1.1em; color: var(--sub); font-size: .93rem; }
.step ol li { margin: 4px 0; }
.step .call { display: inline-block; min-height: 44px; padding: 10px 12px; line-height: 1.5; border-radius: 12px; background: var(--blue-weak); }
.door-line { display: inline-block; margin-top: 6px; background: var(--blue-weak); color: var(--blue-press); border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: .9rem; }
.chip-ok, .chip-bad, .chip-unk, .chip-warn { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
.chip-ok { background: var(--green-weak); color: var(--green); }
.chip-unk { background: var(--fill); color: var(--sub); border: 1px solid var(--line-input); }
.chip-bad { background: var(--red-weak); color: var(--red); }
.chip-warn { background: var(--orange-weak); color: var(--orange); }
ol.sum { margin: 4px 0 6px; padding-left: 20px; font-weight: 600; }
ol.sum li { margin: 4px 0; }
details.more { margin-top: 6px; border-top: 1px solid var(--line); }
details.more > summary { color: var(--blue); font-weight: 600; font-size: .9rem; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details.more ol { font-size: .92rem; color: var(--sub); }
/* 공식 동선 그림·역 안내도 */
.step:has(+ .step-media) { border-bottom: 0; }
.step-media { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 16px 14px 62px; border-bottom: 1px solid var(--line); }
.step-media:last-child { border-bottom: 0; }
.step-media.in-fold { padding: 4px 0 0; border: 0; }
.pic-slot { width: 100%; max-width: 320px; }
.pic-slot[hidden], .pic-fail[hidden] { display: none; }
.thumb { position: relative; display: block; width: 100%; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; cursor: pointer; text-align: left; }
.thumb img { display: block; width: 100%; height: 120px; object-fit: contain; background: #fff; }
.thumb-wait { position: absolute; top: 0; left: 0; right: 0; height: 120px; display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: .88rem; background: var(--bg); }
.thumb.loaded .thumb-wait { display: none; }
.thumb:not(.loaded) .thumb-img { height: 1px; opacity: 0; }
.thumb:not(.loaded) .thumb-wait { position: static; height: auto; min-height: 44px; justify-content: flex-start; padding: 0 12px; }
.thumb-cap { display: block; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--blue); font-weight: 700; font-size: .88rem; }
.thumb:active { background: var(--blue-weak); }
.pic-guide { margin: 6px 2px 0; color: var(--sub); font-size: .84rem; line-height: 1.45; }
.pic-fail { margin: 0; color: var(--mute); font-size: .86rem; }
.map-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--blue-weak); color: var(--blue-press); font-weight: 700; font-size: .9rem; cursor: pointer; }
.map-btn small { color: var(--sub); font-weight: 500; font-size: .82rem; }
/* 크게 보기 창: 화면 전체, 두 손가락으로 벌리기·끌기 (touch-action: none) */
.viewer { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0c0d10; color: #fff; overscroll-behavior: contain; }
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: #000; }
.viewer :focus-visible { outline-color: #b4b4ff; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px; }
.viewer-title { flex: 1; min-width: 0; margin: 0; font-size: 1rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-close { min-height: 44px; min-width: 64px; padding: 0 18px; border: 0; border-radius: 999px; background: #fff; color: #111; font-weight: 800; font-size: 1rem; cursor: pointer; }
.viewer-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; background: #fff; cursor: grab; user-select: none; -webkit-user-select: none; }
.viewer-stage[hidden] { display: none; }
.viewer-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.viewer-fail { flex: 1; margin: 16px; color: #fff; }
.viewer-fail[hidden] { display: none; }
.viewer-note { margin: 0; padding: 6px 16px 0; color: #c9cdd3; font-size: .84rem; }
.viewer-note[hidden] { display: none; }
.viewer-foot { display: flex; align-items: center; gap: 8px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) 16px; }
.viewer-hint { flex: 1; margin: 0; color: #c9cdd3; font-size: .84rem; }
.viewer-zoom { width: 52px; height: 44px; border: 0; border-radius: 12px; background: #2a2d33; color: #fff; font-size: 1.4rem; font-weight: 700; cursor: pointer; }
html.viewer-open { overflow: hidden; }
.result-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 16px; }
.result-actions #explainBox { grid-column: 1 / -1; }
.result-actions #explainBox:empty { display: none; }
.share-url { grid-column: 1 / -1; width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; font: inherit; background: var(--card); color: var(--ink); }
/* 막혔을 때 */
.blocked .why { background: var(--fill); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; }
.blocked .why p { margin: 0 0 6px; color: var(--sub); font-size: .93rem; }
.blocked .why ul { margin: 0; padding-left: 1.1em; font-size: .93rem; }
.blocked .why-line { margin: 6px 0 0; color: var(--ink); font-size: 1rem; }
.option { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; border: 0; background: var(--fill); border-radius: 16px; padding: 16px; min-height: 60px; cursor: pointer; margin-bottom: 8px; font-weight: 700; color: var(--ink); }
.option small { display: block; color: var(--mute); font-weight: 500; font-size: .86rem; margin-top: 2px; }
.option > span { flex: 1; min-width: 0; }
.option::after { content: "›" / ""; color: var(--mute); font-size: 1.3rem; }
.option.best { border: 2px solid var(--blue); }
.option.danger { border: 2px solid var(--red); }
.option.danger small { color: var(--red); }
a.option { text-decoration: none; color: inherit; }
.amen { display: flex; gap: 6px; align-items: center; color: var(--sub); font-size: .9rem; margin: 0 0 8px; }
.amen .i { width: 18px; height: 18px; color: var(--blue); }
.answer.fill-cta { border: 1px dashed var(--blue); }
.answer.fill-cta .choices { margin-top: 10px; }
.call { color: var(--blue-press); font-weight: 700; text-decoration: none; }
.calls { margin: 12px 0 0; font-size: .9rem; color: var(--sub); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; background: var(--fill); border-radius: 14px; padding: 6px 14px; }
.calls-h { font-weight: 600; }
.calls .call { display: inline-block; white-space: normal; min-height: 44px; padding: 10px 12px; line-height: 1.5; border-radius: 12px; background: var(--blue-weak); }
.cmp-line { margin: 16px 0 0; color: var(--sub); font-size: .9rem; line-height: 1.6; background: var(--fill); border-radius: 14px; padding: 8px 14px; }
/* 막차 */
.answer.lt { border: 2px solid var(--blue); }
.answer.lt.warn { border-color: var(--orange); background: var(--orange-weak); }
.answer.lt.now { border-color: var(--red); background: var(--red-weak); }
.answer.lt.now .time-s { color: var(--red); }
.lt-legs { margin: 8px 0 4px; padding-left: 18px; font-size: .92rem; }
.lt-legs li { margin: 4px 0; }
.lt-line { margin: 10px 2px 0; font-size: .92rem; color: var(--sub); }
.lt-line summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.lt-live { margin: 8px 2px 0; font-size: .9rem; }
#lastTrainTop:empty, #lastTrain:empty { display: none; }
#lastTrainTop .answer { margin-top: 0; margin-bottom: 12px; }
#lastTrain .lt-line { margin: 12px 0 0; background: var(--fill); border-radius: 14px; padding: 8px 14px; }
#lastTrain .lt-live { background: var(--fill); border-radius: 14px; padding: 8px 14px; margin: 8px 0 0; }
#lastTrain > .s { background: var(--fill); border-radius: 14px; padding: 10px 14px; margin: 12px 0 0; }
/* 기준 비교·대안 */
.nudge { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; border: 2px solid var(--blue); background: var(--blue-weak); color: var(--ink); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; font: inherit; cursor: pointer; }
.nudge b { color: var(--blue-press); }
.nudge small { display: block; color: var(--sub); font-size: .86rem; margin-top: 2px; }
.nudge::after { content: "›" / ""; color: var(--blue-press); font-size: 1.3rem; }
.compare .option.cur { cursor: default; border: 2px solid var(--line); gap: 10px; }
.compare .option.cur::after { content: none; }
.compare .option em { font-style: normal; font-size: .82rem; color: var(--sub); white-space: nowrap; }
.compare .option b { font-weight: 700; color: var(--sub); }
.compare .option b.faster { color: var(--green); }
.alt-route { background: var(--fill); border-radius: 16px; padding: 14px 16px; margin: 0 0 10px; }
.alt-route .alt-h { margin: 0 0 8px; font-weight: 700; }
.alt-route .alt-h b { color: var(--blue-press); margin-left: 4px; white-space: nowrap; }
.alt-steps { margin: 0 0 10px; padding-left: 1.3em; color: var(--sub); font-size: .92rem; }
.alt-steps li { margin: 2px 0; }
.alt-warn { margin: 0 0 10px; color: var(--orange); font-size: .88rem; font-weight: 600; }
.alt-route .secondary { min-height: 48px; }
/* 받은 길 안내 */
.notice.shared-note { margin: 12px 0 0; padding: 8px 12px; font-size: .86rem; align-items: center; }
.notice.shared-note .i { width: 1.1em; height: 1.1em; margin-top: 0; }

/* ───── 반응형 ───── */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* 낮은 화면(휴대폰 가로·인스타 앱 안 등): 막대·제목 여백을 줄이고 아래 메뉴 56px (기준 설명은 숨기지 않음) */
@media (max-height: 700px) {
  :root { --tab-h: 57px; }
  /* 급해요 창이 낮은 화면(320×568 영어 등)에서도 스크롤 없이 다 보이게 (PO-ux-3 11) */
  .sheet { padding-top: var(--sp-12); }
  .sheet-head { margin-bottom: var(--sp-8); }
  .sheet-cap { margin: var(--sp-12) 0 var(--sp-4); }
  .need-tiles button { min-height: 72px; padding: var(--sp-8) var(--sp-4); gap: var(--sp-4); }
  .view > .title, .page-narrow > .title { margin-top: var(--sp-8); }
  .tabbar button { min-height: 56px; }
}
/* 큰 글씨(글자 200% 등): em 기준이라 이용자 글자 설정을 따라 줄어듦 */
@media (max-width: 18em) { .stats { grid-template-columns: 1fr; } .tabbar button { font-size: .72rem; } }
/* ≤359px: 제목 작게, 라벨은 칸 위로, 아래 메뉴 글자 한 줄 */
@media (max-width: 359px) {
  .title { font-size: var(--fs-lg); }
  .sheet-head h2 { font-size: var(--fs-md); }
  .tabbar button { white-space: nowrap; font-size: var(--fs-xs); }
  .field { grid-template-columns: minmax(0, 1fr); }
  .field > label { line-height: 1.5; padding: 0 0 var(--sp-4); }
  .field > :not(label) { grid-column: 1; }
  .field > .combo { grid-row: 2; }
  .sug { margin-left: 0; }
  .call-tag { padding: 0 var(--sp-8); margin-left: var(--sp-8); }
}
/* 600–1023px: 본문·아래 메뉴 720px, 좌우 32px, 예시 칩은 줄바꿈 */
@media (min-width: 600px) {
  :root { --col: 720px; --gut: 32px; }
  .tabbar { max-width: 720px; }
  .sheet { max-width: 560px; }
}
/* ≥1024px: 본문 1120px · 메뉴는 위 막대 가운데 가로로 · 홈·결과 두 단 · 아래에서 올라오던 창은 가운데 창 */
@media (min-width: 1024px) {
  :root { --col: 1120px; --gut: 32px; --tab-h: 0px; }
  body { padding-bottom: var(--sp-32); }
  html, html:has(#view-chat:not([hidden])) { scroll-padding-bottom: var(--sp-24); }
  .tabbar { top: 0; bottom: auto; left: 50%; transform: translateX(-50%); width: auto; max-width: none; height: 48px; display: flex; align-items: center; gap: var(--sp-4); padding: 0; background: none; border: 0; z-index: 6; }
  .tabbar button { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 var(--sp-12); border-radius: var(--r-input); font-size: var(--fs-sm); white-space: nowrap; }
  .tabbar button .i { width: 20px; height: 20px; }
  .tabbar button[aria-current="page"] { background: var(--blue-weak); color: var(--blue-press); }
  .tabbar .urgent-tab[aria-current="page"] { background: var(--red-weak); color: var(--red); box-shadow: none; }
  .tabbar .urgent-tab .i { padding: 1px; }
  /* 결과: 왼쪽 440px(창 높이에 들어오면 따라옴) / 오른쪽 단계 */
  .r-grid { display: grid; grid-template-columns: 440px minmax(0, 1fr); column-gap: 40px; align-items: start; padding-top: 16px; }
  .r-side.stick { position: sticky; top: 64px; }
  #routeResult > .blocked, #routeResult > .answer, #routeResult > .notice { max-width: var(--content); }
  /* 급해요·고장 목록 창: 가운데 560px */
  .sheet { margin: auto; max-width: 560px; border-radius: var(--r-card); padding-bottom: var(--sp-16); }
  #view-chat, #view-report, .page-narrow { max-width: var(--content); margin: 0 auto; }
}
