:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1f1d1a;
  --ink-soft: #6b6660;
  --line: #e3ded6;
  --accent: #8a6b3d;
  --bubble-guest: #2f2b26;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
    "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
}

.header {
  flex: none;
  padding: 12px 16px calc(12px);
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg--bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.msg--guest {
  align-self: flex-end;
  background: var(--bubble-guest);
  color: #fbf9f5;
  border-bottom-right-radius: 4px;
}

.msg--error {
  align-self: center;
  max-width: 100%;
  background: #fdf3f0;
  border: 1px solid #e8c9be;
  color: #8b3a22;
  font-size: 14px;
}

.msg--pending::after {
  content: "\2026";
  color: var(--ink-soft);
}

.composer {
  flex: none;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.chip:active { background: #ece7de; }

.chip--staff {
  border-color: var(--accent);
  color: var(--accent);
}

.form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.form__input {
  flex: 1 1 auto;
  resize: none;
  max-height: 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  font-size: 16px; /* iOS の自動ズーム回避 */
  background: var(--bg);
  color: inherit;
}

.form__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.form__send {
  flex: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.form__send:disabled {
  background: #cfc7ba;
  cursor: default;
}

.disclaimer {
  margin: 8px 2px 0;
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.5;
}
