/* MateAI — Korea travel companion. Vanilla CSS, light/dark via [data-theme].
   토큰 정본·근거: design/DESIGN.md (2026-09-16 대비 수정: accent/jade/warn WCAG AA 4.5:1 충족). */
:root{
  --bg:#faf8f5; --surface:#ffffff; --surface-2:#f2eee8; --ink:#1c2230; --muted:#5d6574;
  --line:#e6e0d7; --accent:#c4372e; --accent-ink:#ffffff; --accent-soft:#fbe9e7;
  --jade:#0b7566; --jade-soft:#e2f4f1; --warn:#8f5f00; --warn-soft:#fff4d6; --danger:#b3261e;
  --shadow:0 1px 2px rgba(28,34,48,.06),0 8px 24px rgba(28,34,48,.06);
  --radius:18px; --max:1080px;
  --font:"Plus Jakarta Sans","Noto Sans KR",system-ui,-apple-system,"Segoe UI",sans-serif;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#12151c; --surface:#1a1f29; --surface-2:#232a36; --ink:#eef1f6; --muted:#a3acbb;
    --line:#2d3544; --accent:#ff6b5e; --accent-ink:#1a0f0e; --accent-soft:#3a2220;
    --jade:#4fd1bd; --jade-soft:#17332f; --warn:#f5c451; --warn-soft:#352c14; --danger:#ff8a80;
    --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"]{
  --bg:#12151c; --surface:#1a1f29; --surface-2:#232a36; --ink:#eef1f6; --muted:#a3acbb;
  --line:#2d3544; --accent:#ff6b5e; --accent-ink:#1a0f0e; --accent-soft:#3a2220;
  --jade:#4fd1bd; --jade-soft:#17332f; --warn:#f5c451; --warn-soft:#352c14; --danger:#ff8a80;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);
}

*{box-sizing:border-box}
/* display를 지정한 요소도 hidden 속성이 이기게 한다 (.trip-inline이 열린 채로 뜨던 버그) */
[hidden]{display:none !important}
html{scroll-behavior:smooth}
body{margin:0; background:var(--bg); color:var(--ink); font:16px/1.6 var(--font);
  -webkit-font-smoothing:antialiased; transition:background .25s,color .25s}
a{color:inherit}
img{max-width:100%}
.wrap{max-width:var(--max); margin:0 auto; padding-inline:20px}

/* ── nav ─────────────────────────────────────────── */
.nav{position:sticky; top:0; z-index:10; background:color-mix(in srgb,var(--bg) 85%,transparent);
  backdrop-filter:blur(10px); border-bottom:1px solid var(--line)}
.nav .wrap{display:flex; align-items:center; gap:16px; height:64px}
.brand{display:flex; align-items:center; gap:8px; font-weight:800; font-size:19px; text-decoration:none}
.brand .dot{width:28px; height:28px; border-radius:9px; background:var(--accent); color:var(--accent-ink);
  display:grid; place-items:center; font-size:15px}
.links{display:flex; gap:4px; margin-left:auto}
.links a{padding:8px 12px; border-radius:10px; text-decoration:none; color:var(--muted); font-weight:600; font-size:14.5px;
  transition:background .15s,color .15s}
.links a:hover{background:var(--surface-2); color:var(--ink)}
.links a[aria-current="page"]{color:var(--ink); background:var(--surface-2)}
.theme-btn{border:1px solid var(--line); background:var(--surface); color:var(--ink); width:38px; height:38px;
  border-radius:10px; cursor:pointer; font-size:17px; transition:transform .2s}
.theme-btn:active{transform:rotate(25deg) scale(.92)}
@media (max-width:640px){
  .nav .wrap{height:auto; flex-wrap:wrap; padding-block:10px; gap:8px}
  .links{order:3; width:100%; margin:0; overflow-x:auto}
  .links a{white-space:nowrap}
  .theme-btn{margin-left:auto}
}

/* ── common ──────────────────────────────────────── */
.eyebrow{display:inline-block; font-size:13px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--accent); background:var(--accent-soft); padding:4px 10px; border-radius:99px}
h1{font-size:clamp(34px,6vw,58px); line-height:1.08; letter-spacing:-.02em; margin:14px 0 16px}
h2{font-size:clamp(24px,3.4vw,34px); letter-spacing:-.01em; margin:0 0 10px}
.lead{font-size:clamp(17px,2vw,19px); color:var(--muted); max-width:620px}
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow)}
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; border:0; cursor:pointer;
  font:600 15.5px var(--font); padding:13px 20px; border-radius:12px; text-decoration:none;
  background:var(--accent); color:var(--accent-ink); transition:transform .12s,filter .15s,opacity .15s}
.btn:hover{filter:brightness(1.06)}
.btn:active{transform:scale(.97)}
.btn:disabled{opacity:.55; cursor:not-allowed; transform:none}
.btn.ghost{background:var(--surface-2); color:var(--ink)}
.hint{color:var(--muted); font-size:14px}
.err{color:var(--accent); background:var(--accent-soft); padding:10px 14px; border-radius:12px; font-size:14.5px; margin:10px 0 0}
footer{border-top:1px solid var(--line); margin-top:72px; padding-block:28px; color:var(--muted); font-size:14px}
.fade-in{animation:fade .35s ease both}
@keyframes fade{from{opacity:0; transform:translateY(6px)}to{opacity:1; transform:none}}
@media (prefers-reduced-motion:reduce){*{animation:none!important; transition:none!important}}

/* ── home ────────────────────────────────────────── */
.hero{display:grid; grid-template-columns:1.1fr .9fr; gap:40px; align-items:center; padding-block:64px 40px}
.hero .ctas{display:flex; gap:12px; flex-wrap:wrap; margin-top:26px}
.hero-chat{padding:18px; display:flex; flex-direction:column; gap:10px}
.hero-chat .bubble{max-width:88%}
.features{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; padding-block:24px}
.feature{padding:22px}
.feature .icon{font-size:26px}
.feature h3{margin:10px 0 6px; font-size:18px}
.feature p{margin:0; color:var(--muted); font-size:15px}
.steps{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; counter-reset:s; padding-block:12px}
.step{padding:20px; border-left:3px solid var(--jade)}
.step::before{counter-increment:s; content:"Step " counter(s); font-size:12.5px; font-weight:700; color:var(--jade)}
.step h3{margin:4px 0 4px; font-size:17px}
.step p{margin:0; color:var(--muted); font-size:14.5px}
.section{padding-block:40px}
@media (max-width:860px){
  .hero{grid-template-columns:1fr; padding-block:40px 20px}
  .features,.steps{grid-template-columns:1fr}
}

/* ── chat ────────────────────────────────────────── */
.chat-page{display:grid; grid-template-columns:1fr 300px; gap:20px; padding-block:24px}
.chat-box{display:flex; flex-direction:column; height:calc(100vh - 140px); min-height:520px; overflow:hidden}
.chat-head{display:flex; align-items:center; gap:12px; padding:14px 18px; border-bottom:1px solid var(--line); flex-wrap:wrap}
.chat-head>div{min-width:0; flex:1 1 160px}
.chat-head strong, .chat-head .status{word-break:keep-all}
.avatar{width:40px; height:40px; border-radius:50%; background:var(--jade-soft); display:grid; place-items:center; font-size:20px; flex:none}
.avatar img{width:100%; height:100%; object-fit:cover; border-radius:50%; display:block}
.chat-head .avatar{width:56px; height:56px; font-size:28px}   /* 캐릭터 이미지가 오면 더 크게 보이도록(09-22) */
.chat-head strong{display:block}
.ai-badge{display:inline-block; white-space:nowrap; margin-left:6px; font-size:12px; font-weight:600; color:var(--muted); background:var(--surface-2); border:1px solid var(--line); border-radius:99px; padding:1px 8px; vertical-align:middle} /* D-018 정직: AI임을 상시 표시 */
.chat-head .status{font-size:13px; color:var(--jade)}
.chat-head .btn{margin-left:auto; padding:8px 12px; font-size:13.5px}
/* scroll-behavior:smooth를 주면 feed.scrollTop 대입이 먹히지 않는다 (브라우저에서 확인). */
.feed{flex:1; min-height:0; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:12px}
.feed .ai-notice{margin:0; padding:0 2px; font-size:12.5px; line-height:1.55; max-width:92%}   /* 첫 줄에만 있고 대화가 쌓이면 위로 밀려 사라진다 (09-22) */
.bubble{padding:11px 15px; border-radius:18px; max-width:78%; white-space:pre-wrap; word-wrap:break-word;
  animation:pop .22s ease both}
@keyframes pop{from{opacity:0; transform:translateY(6px) scale(.98)}to{opacity:1; transform:none}}
.bubble.user{align-self:flex-end; background:var(--accent); color:var(--accent-ink); border-bottom-right-radius:6px}
.bubble.mate{align-self:flex-start; background:var(--surface-2); border-bottom-left-radius:6px}
.bubble.system{align-self:center; background:transparent; color:var(--muted); font-size:13.5px; text-align:center}
.bubble.report{white-space:normal; max-width:92%}
.bubble .meta{display:block; font-size:11.5px; opacity:.65; margin-top:4px}
.bubble.fallback{border:1px dashed var(--warn); background:var(--warn-soft)}
.bubble.unverified{border-left:3px solid var(--warn)} /* 사실형 질문: 출처 미확인 표시 */
.chat-head #lang{margin-left:auto; padding:8px 12px; font-size:13.5px; font-weight:700}
.chat-head #lang + .btn{margin-left:8px}
.typing{display:inline-flex; gap:4px; padding:14px 16px}
.typing i{width:7px; height:7px; border-radius:50%; background:var(--muted); animation:blink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.25}40%{opacity:1}}
.chips{display:flex; gap:8px; padding:0 18px 10px; overflow-x:auto}
.chip{flex:none; border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:99px;
  padding:7px 13px; font:500 13.5px var(--font); cursor:pointer; transition:background .15s,transform .12s}
.chip:hover{background:var(--surface-2)}
.chip:active{transform:scale(.96)}
.chip.accent{border-color:var(--jade); color:var(--jade)}
.composer{display:flex; gap:8px; padding:12px 14px; border-top:1px solid var(--line)}
.composer textarea{flex:1; resize:none; border:1px solid var(--line); background:var(--bg); color:var(--ink);
  border-radius:14px; padding:12px 14px; font:15.5px/1.4 var(--font); max-height:120px}
.composer textarea:focus,input:focus,select:focus{outline:2px solid var(--accent); outline-offset:1px}
.trip-inline{display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:10px 18px; border-top:1px solid var(--line); background:var(--surface-2)}
.trip-inline input,.trip-inline select{padding:9px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink); font:14.5px var(--font)}
.trip-inline .btn{padding:9px 14px}
.side{padding:18px; align-self:start; position:sticky; top:84px}
.side h3{margin:0 0 8px; font-size:16px}
.side ul{margin:0; padding-left:18px; color:var(--muted); font-size:14.5px}
.switch{display:flex; align-items:center; gap:10px; margin-top:14px; font-size:14.5px; cursor:pointer}
.switch input{width:18px; height:18px; accent-color:var(--accent)}
.options{display:grid; gap:8px; margin-top:8px}
.option{background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:8px 12px; font-size:14px; white-space:normal}
@media (max-width:860px){
  .chat-page{grid-template-columns:1fr; padding-block:12px}
  .chat-box{height:calc(100vh - 150px); min-height:460px}
  .side{position:static}
  .bubble{max-width:88%}
}

/* ── trip planner ────────────────────────────────── */
.planner{display:grid; grid-template-columns:340px 1fr; gap:20px; padding-block:24px; align-items:start}
.form{padding:22px; position:sticky; top:84px}
.form label{display:block; font-weight:600; font-size:14.5px; margin:14px 0 6px}
.form input,.form select{width:100%; padding:12px; border-radius:12px; border:1px solid var(--line);
  background:var(--bg); color:var(--ink); font:15.5px var(--font)}
.form .btn{width:100%; margin-top:18px}
.result{padding:26px; min-height:320px}
.result.empty{display:grid; place-items:center; text-align:center; color:var(--muted)}
.report h2{font-size:22px; margin:22px 0 8px; padding-bottom:6px; border-bottom:1px solid var(--line)}
.report h3{font-size:17px; margin:14px 0 6px}
.report h2:first-child{margin-top:0}
.report ul{padding-left:20px; margin:6px 0}
.report li{margin:4px 0}
.badge{display:inline-block; font-size:12.5px; font-weight:700; padding:3px 10px; border-radius:99px; margin-right:8px}
.badge.ok{background:var(--jade-soft); color:var(--jade)}
.badge.bad{background:var(--accent-soft); color:var(--accent)}
.badge.warn{background:var(--warn-soft); color:var(--warn)}
.flag{font-size:12px; color:var(--accent); font-weight:600}
.checks{margin-top:22px; padding:16px; border-radius:14px; background:var(--surface-2); font-size:14.5px}
.checks details{margin-top:8px}
.result-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:18px}
.skeleton{height:14px; border-radius:7px; background:linear-gradient(90deg,var(--surface-2),var(--line),var(--surface-2));
  background-size:200% 100%; animation:shimmer 1.3s infinite; margin:10px 0}
@keyframes shimmer{to{background-position:-200% 0}}
@media (max-width:860px){
  .planner{grid-template-columns:1fr}
  .form{position:static}
}

/* ── about ───────────────────────────────────────── */
.about-grid{display:grid; grid-template-columns:1fr 1fr; gap:16px}
.about-grid .card{padding:22px}
.about-grid h3{margin:0 0 8px}
.about-grid p,.about-grid li{color:var(--muted); font-size:15px}
.flow{font-family:ui-monospace,Menlo,monospace; font-size:13.5px; background:var(--surface-2); padding:16px; border-radius:14px; overflow-x:auto; white-space:pre}
@media (max-width:760px){.about-grid{grid-template-columns:1fr}}

/* ── 여행 선호 입력 (planner) ── */
.prefs{display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; font-size:13.5px; color:var(--muted); width:100%}
.prefs label{display:inline-flex; align-items:center; gap:4px; cursor:pointer}
.prefs select{font:inherit; padding:4px 8px; border-radius:8px; border:1px solid var(--line); background:var(--surface); color:var(--ink)}

/* ── 동행 고르기 (characters.html, UX 카드 C1·C8) ── */
.char-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; padding-block:12px}
.char-card{cursor:pointer; overflow:hidden; transition:transform .15s, box-shadow .15s; outline:none}
.char-card:hover,.char-card:focus-visible{transform:translateY(-2px); box-shadow:0 1px 2px rgba(28,34,48,.08),0 12px 32px rgba(28,34,48,.12)}
.char-card:focus-visible{outline:2px solid var(--ink); outline-offset:2px}
.char-card.soon{opacity:.72}
.char-hero{position:relative; aspect-ratio:1/1; display:grid; place-items:center; background:var(--surface-2)}
.char-hero img{width:100%; height:100%; object-fit:cover; object-position:center top}
.char-emoji{font-size:84px; line-height:1}
.char-emoji.big{font-size:120px}
.char-soon{position:absolute; top:12px; left:12px; font-size:12.5px; font-weight:700; color:var(--warn); background:var(--warn-soft); padding:4px 10px; border-radius:99px}
.char-body{padding:16px 18px 18px}
.char-name{font-size:18px}
.char-hook{margin:6px 0 10px; color:var(--muted); font-size:15px; line-height:1.55}
.calls{list-style:none; padding:0; margin:0}
.calls li{padding:5px 0 5px 14px; position:relative; font-size:14.5px; line-height:1.45}
.calls li::before{content:""; position:absolute; left:0; top:13px; width:6px; height:6px; border-radius:50%; background:var(--accent)}
.char-meta{margin-top:10px; display:flex; gap:6px}
/* 스킨: 캐릭터마다 색만 바뀌고 레이아웃은 같다 */
.skin-indigo{--surface-2:#1a1f3a; --ink:#eef1f6; --muted:#a3acbb; color:var(--ink); background:#12163a}
.skin-indigo .char-hero{background:linear-gradient(180deg,#1a1f3a,#0a0d3a)}
.skin-indigo .hint{color:#a3acbb}
.skin-indigo .ai-badge{background:#232a4a; border-color:#2d3560; color:#c9cfe6}
.skin-indigo .calls li::before{background:#8b9bff}
.skin-warm{}
/* 상세 시트 (dialog) */
.char-sheet{border:0; border-radius:20px; padding:0; width:min(560px,94vw); background:var(--surface); color:var(--ink); box-shadow:var(--shadow); overflow:hidden}
.char-sheet::backdrop{background:rgba(28,34,48,.45)}
.sheet-hero{aspect-ratio:1/1; max-height:min(58vh,520px); display:grid; place-items:center; background:var(--surface-2)}
.sheet-hero img{width:100%; height:100%; object-fit:cover; object-position:center top}
.sheet-body{padding:18px 22px 22px}
.sheet-title{font-size:20px}
.sheet-actions{display:flex; gap:10px; margin-top:18px; justify-content:flex-end}
.sheet-actions .btn.disabled{opacity:.5; pointer-events:none}
@media (max-width:640px){.sheet-actions .btn{flex:1}}

/* ── 기억 카드 + 동의 시트 (C6) ────────────────── */
.memory{margin-top:16px; padding-top:14px; border-top:1px solid var(--line)}
.mem-list{list-style:none; padding:0 !important; margin:0 0 8px; display:grid; gap:6px}
.mem-list li{display:flex; align-items:center; gap:8px; font-size:14px; color:var(--ink)}
.mem-list .mem-key{font-size:12px; color:var(--muted); min-width:64px}
.mem-list .mem-del{margin-left:auto; border:0; background:transparent; color:var(--muted); cursor:pointer; font-size:16px; line-height:1; padding:2px 6px; border-radius:6px}
.mem-list .mem-del:hover{background:var(--surface-2); color:var(--ink)}
.btn.small{padding:6px 10px; font-size:13px}
.consent{position:fixed; inset:auto 16px 16px auto; margin:0; width:min(380px, calc(100vw - 32px)); border:0; border-radius:16px;
  padding:16px 18px 14px; background:var(--surface); color:var(--ink); box-shadow:var(--shadow); z-index:30}
.consent:not([open]){display:none}
.consent-q{margin:0 0 8px; font-weight:700; font-size:16px}
.consent-text{margin:0 0 8px; padding:10px 12px; border-radius:10px; background:var(--surface-2); font-size:15px}
.consent .sheet-actions{margin-top:12px}
@media (max-width:640px){.consent{inset:auto 16px 16px 16px; width:auto}}

/* ── 큰 글씨 모드 (DESIGN §타이포 `big` = 모든 값 ×1.25, 어르신·저시력 C9) ── */
html[data-text="big"] body{zoom:1.25}
@supports not (zoom:1){ html[data-text="big"] body{font-size:20px} html[data-text="big"] .bubble{font-size:1.2em} }
html[data-text="big"] #bigtext{background:var(--accent-soft); color:var(--accent)}
.theme-btn#bigtext{font-weight:800; font-size:15px; letter-spacing:.02em}
@media (max-width:640px){.chat-head #lang{margin-left:0} .chat-head .btn{flex:1 1 auto}}

/* ── 13_ 상태창 카드 (월드 상태는 규칙이 정한다) ── */
.world{margin-top:16px; padding-top:14px; border-top:1px solid var(--line)}
.world-grid{display:grid; grid-template-columns:auto 1fr; gap:4px 10px; margin:0 0 10px; font-size:14px}
.world-grid dt{color:var(--muted); font-size:12.5px} .world-grid dd{margin:0}
.world-grid .bar{display:inline-block; width:90px; height:8px; border-radius:99px; background:var(--surface-2); vertical-align:middle; overflow:hidden; margin-left:6px}
.world-grid .bar i{display:block; height:100%; background:var(--accent)}
.world-actions{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px}
.world-actions .chip{font-size:13px; padding:6px 10px}
.world-name input{width:100%; margin-top:4px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); font:inherit; font-size:14px}
.world .off{color:var(--muted)}
.world .crisis{color:var(--accent); font-weight:700}


/* ── 페이지 스킨: indigo (13_ 대시). 선택창 카드의 .skin-indigo와 짝. 대비: #3a46c9 on white 7.0:1 ── */
html[data-skin="indigo"]{--bg:#f5f6fb; --surface-2:#eceef7; --line:#dde1f0; --accent:#3a46c9; --accent-soft:#e8eafc; --jade:#4653c4; --jade-soft:#e8eafc}
html[data-skin="indigo"][data-theme="dark"]{--accent:#8b9bff; --accent-ink:#0b0e2a; --accent-soft:#232a4a; --jade:#a9b4ff; --jade-soft:#232a4a}
html[data-skin="indigo"] .avatar{background:#e8eafc}

/* 공공데이터 FACT 카드 — 공식 사진(공공누리 출처 표시) */
.facts.photos{display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:8px; margin-top:10px}
.facts.photos figure{margin:0; background:var(--surface); border:1px solid var(--line); border-radius:12px; overflow:hidden}
.facts.photos img{display:block; width:100%; aspect-ratio:4/3; object-fit:cover}
.facts.photos figcaption{font-size:11px; padding:6px 8px; color:var(--muted, #666); line-height:1.3}
.facts.photos .hint{grid-column:1/-1; font-size:11px}

/* 공공데이터 FACT 카드 — 열차·항공·장소 (말풍선 글자가 아니라 카드) */
.fact-card{margin-top:10px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:10px 12px; font-size:14px; line-height:1.45}
.fact-card .fc-title{font-weight:600; margin-bottom:6px}
.fact-card .fc-row{padding:2px 0}
.fact-card .fc-src{margin-top:6px; font-size:11px; color:var(--muted, #666)}


/* 답변 아래 행동(M1, 2026-09-21): '이 답이 좋아'·'다른 답 듣기'. 신호는 파일럿 참여자만 서버로 보낸다 */
.bubble .actions{display:flex; flex-wrap:wrap; gap:6px; margin-top:8px}
.bubble .actions .chip{font-size:12.5px; padding:5px 10px}
.bubble .actions .hint{font-size:12.5px; align-self:center}
.pilot{margin-top:14px; padding-top:12px; border-top:1px solid var(--line)}
.pilot .btn{margin-top:6px}

/* ── 긴급 배너 (DESIGN §4 emergency-banner, 안전 1순위) ──────────────────
   모든 테마에서 같은 모습: 고정 진홍(#b3261e = 라이트 --danger) 위 흰 글자, 56px 전화 버튼.
   흰 글자 대비 6.3:1(§7 danger-on-white와 같은 쌍). 색만으로 전달하지 않게 📞 아이콘·문구 동반. */
.emergency-banner{position:sticky; top:0; z-index:40; background:#b3261e; color:#fff}
.emergency-banner .eb-inner{display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding-block:12px}
.eb-text{margin:0; flex:1 1 200px; font-weight:700; font-size:15.5px; color:#fff}
.eb-calls{display:flex; gap:10px; flex-wrap:wrap}
.eb-call{display:inline-flex; align-items:center; justify-content:center; min-height:56px; padding:0 18px;
  border-radius:12px; background:#fff; color:#b3261e; font-weight:800; font-size:17px; text-decoration:none;
  border:2px solid #fff}
.eb-call:hover{filter:brightness(.94)}
.eb-call.eb-1330{background:transparent; color:#fff; border-color:#fff; font-size:15px; font-weight:700}
.eb-close{margin-left:auto; width:44px; height:44px; flex:none; border:2px solid #fff; background:transparent;
  color:#fff; border-radius:10px; font-size:22px; line-height:1; cursor:pointer}
.eb-close:hover{background:rgba(255,255,255,.15)}
.emergency-banner :focus-visible{outline:3px solid #fff; outline-offset:2px}
@media (max-width:640px){.emergency-banner .eb-inner{gap:8px} .eb-call{flex:1 1 auto}}

/* ── 모드 힌트 (DESIGN §4 mode-hint): 말풍선 위 작은 회색 라벨. 말풍선 색은 바꾸지 않는다. ── */
.mode-hint{align-self:flex-start; margin:0 0 -6px 4px; font-size:12px; font-weight:600; letter-spacing:.02em; color:var(--muted)}

/* ── 장소 카드 한영 병기 (DESIGN §3-2 place-ko/place-en) ── */
.place-ko{font-weight:700}
.place-en{color:var(--muted); font-size:13.5px}

/* AI 산출물 표시(N6, AI 기본법 제31조② — tiers v1.1): 생성형 AI가 만든 답변에 작은 'AI' 표식 */
.bubble .ai-mark{display:inline-block; margin:6px 0 0 4px; padding:1px 6px; border-radius:6px; font-size:10.5px; font-weight:700; letter-spacing:.04em; background:var(--surface); color:var(--muted); border:1px solid var(--line)}

/* N8(사용자 검수 1-2): 아바타는 정원형 40px, 이미지가 오면 꽉 채움, 배경은 중립 */
.chat-head .avatar{width:40px; height:40px; border-radius:50%; overflow:hidden; background:var(--surface-2); flex:none}
.chat-head .avatar img{width:100%; height:100%; object-fit:cover; display:block}
