/* 채팅 문의방 (고객) — 기존 사이트 색상·폰트 사용 (베이지 톤) */
:root {
  --ivory: #F6F1E9;
  --ivory-2: #EFE7DA;
  --line: #DCD1C1;
  --ink: #2A2621;
  --ink-soft: #7A7166;
  --paper: #FBF8F3;
  --accent: #9B765D;
  --charcoal: #2A2621;
  --ok: #6E8B6B;
  --warn: #C9963F;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--ivory);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.ch-app {
  display: flex; flex-direction: column;
  width: min(720px, 100%); height: 100dvh; margin: 0 auto;
  background: var(--paper); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}

/* ---------- 상단 ---------- */
.ch-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--paper);
}
.ch-back { font-size: 26px; line-height: 1; color: var(--ink); text-decoration: none; padding: 0 4px; }
.ch-who { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ch-who strong { font-size: 15px; font-weight: 600; }
.ch-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); }
.ch-status i { width: 7px; height: 7px; border-radius: 50%; background: #B5AB9E; flex: none; }
.ch-status[data-state="viewing"] i, .ch-status[data-state="available"] i { background: var(--ok); }
.ch-status[data-state="busy"] i, .ch-status[data-state="soon"] i { background: var(--warn); }
.ch-reserve {
  flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 12.5px; text-decoration: none;
}

/* ---------- 메시지 ---------- */
.ch-messages {
  flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ch-intro, .ch-system {
  align-self: center; max-width: 90%; padding: 10px 14px; border-radius: 12px;
  background: var(--ivory-2); color: var(--ink-soft); font-size: 13px; line-height: 1.6; text-align: center;
}
.ch-msg { display: flex; flex-direction: column; max-width: 78%; gap: 3px; }
.ch-msg p {
  margin: 0; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.ch-msg time, .ch-msg .ch-read { font-size: 11px; color: var(--ink-soft); }
.ch-me { align-self: flex-end; align-items: flex-end; }
.ch-me p { background: var(--charcoal); color: #fff; border-bottom-right-radius: 4px; }
.ch-them { align-self: flex-start; }
.ch-them p { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ch-read { color: var(--accent) !important; }

/* ---------- 입력 ---------- */
.ch-form {
  display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--paper);
}
.ch-form input {
  flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 15px;
}
.ch-form input:focus { outline: none; border-color: var(--accent); }
.ch-form button {
  width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 18px;
}
.ch-form button:disabled { opacity: .45; cursor: default; }

/* 사진 보내기 버튼 + 말풍선 사진 (photo-view.js) */
.ch-form .ch-photo-btn { background: #fff; color: var(--ink); border: 1px solid var(--line); display: grid; place-items: center; }
.ch-photo-btn.is-sending { animation: chPhotoPulse 1s ease-in-out infinite; }
@keyframes chPhotoPulse { 50% { opacity: .4; } }
.chat-photo { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--ivory-2); line-height: 0; }
.chat-photo img { display: block; width: auto; height: auto; max-width: 240px; max-height: 320px; }
.chat-photo.is-loading { width: 160px; height: 160px; }
.chat-photo.is-broken { padding: 10px 13px; font-size: 12.5px; line-height: 1.4; color: var(--ink-soft); }
