* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #17181a;
}
body { min-height: 100vh; }
.shell {
  width: min(760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 14px;
  display: flex;
  align-items: center;
}
.chat-card {
  width: 100%;
  height: min(760px, calc(100vh - 48px));
  min-height: 520px;
  background: #fff;
  border: 1px solid #d9dde3;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header { padding: 18px 20px 14px; border-bottom: 1px solid #e5e8ec; }
.chat-header h1 { margin: 0; font-size: 20px; font-weight: 650; }
.status { margin: 6px 0 0; min-height: 20px; font-size: 13px; color: #656b73; }
.messages { flex: 1; overflow-y: auto; padding: 18px; }
.message-row { display: flex; margin: 8px 0; }
.message-row.customer { justify-content: flex-end; }
.message-row.agent { justify-content: flex-start; }
.message-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef1f4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.message-row.customer .message-bubble { background: #e3eefc; }
.composer { padding: 14px; border-top: 1px solid #e5e8ec; }
textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 180px;
  border: 1px solid #cfd4da;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.4;
}
textarea:focus { outline: 2px solid #8aa7cc; outline-offset: 1px; }
.composer-row {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.counter { font-size: 12px; color: #747a82; }
.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#location-button,
#voice-button {
  background: #4f5966;
}
button {
  border: 0;
  border-radius: 9px;
  padding: 9px 18px;
  font: inherit;
  cursor: pointer;
  background: #20242a;
  color: #fff;
}
button:disabled { cursor: default; opacity: 0.45; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .shell { padding: 0; }
  .chat-card { min-height: 100vh; height: 100vh; border: 0; border-radius: 0; }
  .message-bubble { max-width: 88%; }
}

.message-bubble.media-bubble { padding: 6px; overflow: hidden; }
.staff-media-image,
.staff-media-video { display: block; max-width: min(100%, 560px); max-height: 60vh; border-radius: 9px; object-fit: contain; }
.staff-media-video { background: #000; }

/* === welcome panel (w1) === */
.welcome-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 28px;
  color: #4a5059;
}
.welcome-wave { font-size: 40px; line-height: 1; margin-bottom: 14px; }
.welcome-title { margin: 0 0 10px; font-size: 20px; font-weight: 650; color: #17181a; }
.welcome-text { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.welcome-sub { margin: 0 0 18px; max-width: 26em; font-size: 13px; line-height: 1.6; color: #747a82; }
.welcome-hours { margin: 0; padding: 6px 14px; font-size: 13px; color: #4f5966; background: #f2f4f7; border-radius: 999px; }
.messages:empty { flex: 0 0 0; padding: 0; }
.composer { margin-top: auto; }
.privacy-note { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: #8a9099; }
.chat-card:has(.composer:focus-within) .welcome-panel,
.chat-card:has(#message-input:not(:placeholder-shown)) .welcome-panel,
.chat-card:has(#messages .message-row) .welcome-panel { display: none; }

/* === notice emphasis (w5) === */
.composer-row + .privacy-note,
.privacy-note + .privacy-note {
  background: #fff6e5;
  border: 1px solid #f0cf96;
  color: #6b4300;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  padding-left: 12px;
  padding-right: 12px;
}
.composer-row + .privacy-note {
  margin-top: 12px;
  padding-top: 9px;
  padding-bottom: 4px;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.privacy-note + .privacy-note {
  margin-top: 0;
  padding-top: 4px;
  padding-bottom: 9px;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
