/* «대화» 페이지 — 밤의 한양분식. 논리 속성만 써서 RTL 에서도 그대로 뒤집힌다. */
.talk-band { padding-block: clamp(28px, 5vw, 64px) clamp(56px, 8vw, 104px); }
.talk-wrap { width: min(100% - 2 * var(--gutter), 860px); margin-inline: auto; }

/* 항상 보이는 안내 */
.talk-notice {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 22px; padding: 12px 16px;
  border: 1px solid rgba(233, 194, 122, .38); border-radius: var(--radius); background: rgba(233, 194, 122, .08);
  color: var(--night-ink); font-size: .95rem; line-height: 1.55; overflow-wrap: anywhere;
}
.talk-notice strong { color: var(--gold); font-weight: 800; }
.talk-notice::before { content: "ⓘ"; color: var(--gold); font-weight: 800; flex: none; }
.talk-notice-mini { margin: 10px 0 0; padding: 8px 12px; font-size: .82rem; }

/* 자바스크립트가 없을 때 */
.talk-nojs { display: none; margin: 0 0 22px; padding: 16px 18px; border-radius: var(--radius); background: rgba(255, 255, 255, .06); color: var(--night-ink); }
.no-js .talk-nojs { display: block; }
.no-js .talk-app { display: none; }

/* 인물 고르기 */
.talk-pick { display: grid; gap: clamp(12px, 2vw, 20px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); list-style: none; padding: 0; margin: 0; }
.talk-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 22px 16px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); text-align: center; cursor: pointer;
  background: linear-gradient(170deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); color: var(--night-ink); font: inherit;
  transition: transform .3s var(--ease-out), border-color .25s, box-shadow .3s, background-color .25s;
}
.talk-card:hover, .talk-card:focus-visible { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 16px 40px rgba(233, 194, 122, .16); outline: none; }
.talk-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.talk-card .avatar { width: min(100%, 120px); }
.talk-card-name { font-size: 1.25rem; font-weight: 800; color: var(--gold); overflow-wrap: anywhere; }
.talk-card-role { font-size: .88rem; color: var(--night-ink-2); overflow-wrap: anywhere; }
.talk-card-line { font-size: .95rem; line-height: 1.55; overflow-wrap: anywhere; }
.talk-card-go { margin-top: 4px; font-size: .9rem; font-weight: 700; color: var(--gold); }

/* 대화창 */
.talk-chat { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: rgba(8, 6, 4, .55); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.talk-chat[hidden], .talk-pick[hidden] { display: none; }
.talk-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-block-end: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.talk-head .avatar { width: 52px; border-width: 2px; }
.talk-head-text { min-width: 0; flex: 1; }
.talk-head-name { display: block; font-weight: 800; color: var(--gold); overflow-wrap: anywhere; }
.talk-head-sub { display: block; font-size: .8rem; color: var(--night-ink-2); overflow-wrap: anywhere; }
.talk-back { flex: none; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--night-ink); font: inherit; font-size: .88rem; cursor: pointer; }
.talk-back:hover, .talk-back:focus-visible { border-color: var(--gold); color: var(--gold); }

.talk-log {
  list-style: none; margin: 0; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px;
  height: min(58vh, 520px); min-height: 260px; overflow-y: auto; overscroll-behavior: contain;
}
.talk-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; }
.talk-msg.is-bot { align-self: flex-start; background: rgba(255, 255, 255, .08); color: var(--night-ink); border-start-start-radius: 4px; }
.talk-msg.is-me { align-self: flex-end; background: linear-gradient(180deg, #f2d496, #d9a55a); color: #1d1408; border-start-end-radius: 4px; }
.talk-msg.is-sys { align-self: center; max-width: 100%; background: transparent; color: var(--night-ink-2); font-size: .9rem; text-align: center; padding: 4px 8px; }
.talk-msg.is-err { align-self: center; max-width: 100%; background: rgba(168, 37, 27, .22); color: #ffd6cf; font-size: .92rem; }
.talk-dots { display: inline-flex; gap: 5px; align-items: center; min-height: 1.4em; }
.talk-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); opacity: .35; animation: talk-dot 1.1s infinite ease-in-out; }
.talk-dots i:nth-child(2) { animation-delay: .18s; }
.talk-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes talk-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .talk-dots i { animation: none; opacity: .7; } .talk-card { transition: none; } }

.talk-hints { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 10px; list-style: none; margin: 0; }
.talk-hints button { min-height: 38px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .04); color: var(--night-ink); font: inherit; font-size: .88rem; cursor: pointer; text-align: start; overflow-wrap: anywhere; }
.talk-hints button:hover, .talk-hints button:focus-visible { border-color: var(--gold); color: var(--gold); }

.talk-form { padding: 10px 14px 14px; border-block-start: 1px solid var(--line); }
.talk-row { display: flex; gap: 10px; align-items: flex-end; }
.talk-input {
  flex: 1; min-width: 0; min-height: 48px; max-height: 140px; padding: 12px 14px; resize: none; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--night-ink); font: inherit; font-size: 1rem; line-height: 1.5;
}
.talk-input::placeholder { color: var(--night-ink-2); opacity: .8; }
.talk-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.talk-send { flex: none; min-height: 48px; }
.talk-send[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.talk-count { display: block; margin-block-start: 6px; font-size: .78rem; color: var(--night-ink-2); text-align: end; }

/* 설정 안내자 카드 · 지난 대화 · 손님 알아보기 · 도구 줄 */
.talk-card.is-guide .avatar { display: grid; place-items: center; border-style: dashed; }
.talk-card.is-guide .avatar-initial { font-size: 1.6rem; font-weight: 800; letter-spacing: .06em; }
.talk-msg.is-old { opacity: .72; }

.talk-me { margin: 12px 14px 0; padding: 14px 16px; border: 1px solid rgba(233, 194, 122, .38); border-radius: var(--radius); background: rgba(233, 194, 122, .07); }
.talk-me[hidden], .talk-fb[hidden], [data-fb-idea-row][hidden] { display: none; }
.talk-me-ask { margin: 0 0 10px; font-weight: 700; color: var(--night-ink); overflow-wrap: anywhere; }
.talk-me-note { margin: 8px 0 12px; font-size: .84rem; line-height: 1.55; color: var(--night-ink-2); overflow-wrap: anywhere; }

.talk-tools { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 0 14px 14px; align-items: center; }
.talk-tool {
  min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--night-ink-2); font: inherit; font-size: .82rem; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center;
  transition: color .2s, border-color .2s;
}
.talk-tool:hover, .talk-tool:focus-visible { border-color: var(--gold); color: var(--gold); }
.talk-tool:focus-visible, .fb-input:focus-visible, .fb-check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 의견·응원 남기기 */
.talk-fb { margin: 0 14px 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .04); }
.talk-fb-title { margin: 0 0 10px; font-size: 1.05rem; color: var(--gold); }
.fb-field { display: grid; gap: 6px; margin: 0 0 12px; font-size: .9rem; color: var(--night-ink); }
.fb-field small { font-size: .78rem; color: var(--night-ink-2); overflow-wrap: anywhere; }
.fb-input {
  width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255, 255, 255, .06); color: var(--night-ink); font: inherit; font-size: 1rem; line-height: 1.5;
}
select.fb-input { min-height: 44px; }
textarea.fb-input { resize: vertical; min-height: 96px; }
.fb-input option { color: #1d1408; }
.fb-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; font-size: .88rem; line-height: 1.55; color: var(--night-ink); overflow-wrap: anywhere; }
.fb-check input { flex: none; width: 20px; height: 20px; margin-block-start: 2px; accent-color: #d9a55a; }
.fb-msg { min-height: 1.4em; margin: 0 0 10px; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.fb-msg.is-ok { color: #cfeab5; }
.fb-msg.is-bad { color: #ffd6cf; }
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

/* 방명록 — 가게 벽에 붙은 쪽지 */
.gb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(12px, 2vw, 18px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.gb-note { padding: 18px 18px 14px; border-radius: 6px; background: #f4ead2; color: #2a1d0e; box-shadow: 0 10px 26px rgba(0, 0, 0, .32); overflow-wrap: anywhere; }
.gb-text { margin: 0 0 12px; white-space: pre-wrap; line-height: 1.7; font-size: 1rem; }
.gb-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: .8rem; color: #5c4630; }
.gb-nick { font-weight: 700; }
.gb-state { margin: 18px 0 0; color: var(--night-ink-2); min-height: 1.4em; }
.gb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.gb-actions [hidden] { display: none; }

/* 개인정보 안내 */
.privacy-draft { margin-block-end: 18px; }
.privacy-lede { margin: 0 0 24px; color: var(--night-ink); line-height: 1.7; }
.privacy-sec { margin: 0 0 26px; padding-block-end: 22px; border-block-end: 1px solid var(--line); color: var(--night-ink); line-height: 1.75; overflow-wrap: anywhere; }
.privacy-sec:last-child { border-block-end: 0; }
.privacy-sec h2 { margin: 0 0 10px; font-size: 1.2rem; color: var(--gold); }
.privacy-sec p { margin: 0 0 10px; }
.privacy-sec ul { margin: 0 0 10px; padding-inline-start: 1.3em; }
.privacy-sec li { margin-block-end: 6px; }

@media (max-width: 520px) {
  .talk-msg { max-width: 92%; }
  .talk-log { height: min(52vh, 460px); }
  .talk-head { flex-wrap: wrap; }
}

/* ── 휴대폰: 대화창이 화면 전체 (사용자 12-05) ── */
html.talk-full, html.talk-full body { overflow: hidden; }
html.talk-full .talk-chat { position: fixed; z-index: 200; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); border: 0; border-radius: 0; background: #0e0c0a; padding-top: env(safe-area-inset-top, 0px); box-sizing: border-box; }
html.talk-full .talk-head { flex: none; padding: 7px 10px; gap: 9px; }
html.talk-full .talk-head .avatar { width: 36px; }
html.talk-full .talk-head-sub { font-size: .72rem; }
html.talk-full .talk-back { min-height: 34px; padding: 4px 11px; font-size: .8rem; }
html.talk-full .talk-me { flex: none; max-height: 48%; overflow-y: auto; }
html.talk-full .talk-log { flex: 1 1 0; height: auto; min-height: 0; padding: 12px 10px; gap: 10px; }
html.talk-full .talk-msg { max-width: 90%; }
html.talk-full .talk-hints { flex: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0; padding: 4px 10px; }
html.talk-full .talk-hints > * { flex: none; }
html.talk-full .talk-hints button { white-space: nowrap; }
html.talk-full .talk-form { flex: none; margin: 0; padding: 6px 8px; }
html.talk-full .talk-input { font-size: 16px; }
html.talk-full .talk-count { display: none; }
html.talk-full .talk-notice-mini { margin: 5px 0 0; padding: 0 2px; border: 0; background: none; font-size: .68rem; line-height: 1.35; }
html.talk-full .talk-tools { flex: none; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; margin: 0; padding: 4px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
html.talk-full .talk-tools > * { flex: none; white-space: nowrap; font-size: .75rem; }
html.talk-full .talk-fb:not([hidden]) { position: absolute; inset: 0; z-index: 5; margin: 0; overflow-y: auto; background: #0e0c0a; padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 20px; }
html.talk-full .talk-fb .fb-input { font-size: 16px; }
html.talk-kb .talk-tools, html.talk-kb .talk-hints, html.talk-kb .talk-form .talk-notice-mini, html.talk-kb .talk-head-sub { display: none; }

/* 휴대폰 대화: 입력칸 아래는 비운다 — 도구는 «⋯» 안으로, AI 안내는 위 한 줄 (사용자 12-05 «입력 하단에 다른 거 있어서 불편») */
.talk-more, .talk-ai-line { display: none; }
html.talk-full .talk-more { display: block; flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--night-ink); font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }
html.talk-full .talk-ai-line { display: block; flex: none; margin: 0; padding: 4px 10px; font-size: .68rem; line-height: 1.35; text-align: center; color: var(--night-ink-2); background: rgba(233, 194, 122, .08); }
html.talk-full .talk-ai-line strong { color: var(--gold); }
html.talk-full .talk-form .talk-notice-mini { display: none; }
html.talk-full .talk-form { padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
html.talk-full .talk-tools { display: none; }
html.talk-full .talk-chat.is-menu .talk-tools { display: flex; flex-direction: column; align-items: stretch; position: absolute; z-index: 6; top: calc(52px + env(safe-area-inset-top, 0px)); right: 8px; width: max-content; max-width: calc(100% - 16px); overflow: visible; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #1b1612; box-shadow: 0 18px 40px rgba(0, 0, 0, .6); }
html.talk-full .talk-chat.is-menu .talk-tools > * { font-size: .9rem; text-align: start; justify-content: flex-start; }
html.talk-kb .talk-ai-line { display: none; }
