/* web_templates/sdui/site_chat.css — the site_chat embed (registry 0.127-0.129). The site's theme tokens only.
   Operator 2026-11-24: smaller type, no vertical padding, looks right on a phone; the lead panel beside the chat
   (desktop ~60 / 40), a slim progress strip on phones. */
.sdui-chat { font: inherit; font-size: 14px; line-height: 1.45; color: var(--sdui-c-onSurface, inherit); }
.sdui-chat[hidden], .sdui-chat [hidden] { display: none !important; }   /* the panel and buttons are shown and hidden by [hidden] */
.sdui-chat-off { display: contents; }
.sdui-chat, .sdui-chat *, .sdui-chat *::before, .sdui-chat *::after { box-sizing: border-box; }   /* width 100% includes padding and border (no sideways scroll on phones) */

.sdui-chat__panel { background: var(--sdui-c-surface, #fff); border: 1px solid var(--sdui-c-border, rgba(0,0,0,.12)); border-radius: 14px;
  padding: 0 12px; display: flex; flex-direction: column; gap: 0; box-shadow: 0 4px 18px rgba(0,0,0,.08); overflow: hidden; }
.sdui-chat--inline .sdui-chat__panel { max-width: 640px; width: 100%; margin: 0 auto; }
.sdui-chat--inline .sdui-chat__panel--split { max-width: 980px; }
.sdui-chat__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 4px; }
.sdui-chat__title, .sdui-chat__enquiry-title { margin: 0; padding: 0; border: 0; outline: 0; background: none; box-shadow: none;
  text-transform: none; letter-spacing: normal; font-family: inherit; font-weight: 600; color: inherit; }   /* the site's own h2/h3 rules stay out */
.sdui-chat__title { font-size: 15px; }
.sdui-chat__enquiry-title { font-size: 14px; }
.sdui-chat__intro { margin: 0 0 6px; font-size: 13px; color: var(--sdui-c-textMuted, #666); }
.sdui-chat__panel--talking .sdui-chat__intro { display: none; }   /* once the conversation has started (design_system's look note) */

/* The chat and the lead panel side by side at desktop width; stacked (panel as a strip on top of the box) on phones. */
.sdui-chat__main { display: flex; flex-direction: column; min-height: 0; }
.sdui-chat__talk { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.sdui-chat__log { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; padding: 0; }
.sdui-chat__log:empty { display: none; }
.sdui-chat__msg { margin: 0; padding: 5px 10px; border-radius: 12px; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.sdui-chat__msg--me { align-self: flex-end; background: var(--sdui-c-accent, var(--sdui-c-primary, #333)); color: var(--sdui-c-onAccent, #fff); border-end-end-radius: 4px; }
.sdui-chat__msg--bot { align-self: flex-start; background: color-mix(in srgb, var(--sdui-c-onSurface, #000) 8%, transparent); border-end-start-radius: 4px; }
.sdui-chat__msg--wait { opacity: .6; }
.sdui-chat__msg--error { align-self: stretch; max-width: none; color: var(--sdui-c-danger, #b00020); background: transparent; padding: 0; }

.sdui-chat__form { display: flex; gap: 6px; align-items: flex-end; padding: 8px 0; }
.sdui-chat__input, .sdui-chat__field input, .sdui-chat__field textarea { flex: 1; font: inherit; font-size: 14px; color: inherit; background: var(--sdui-c-background, transparent);
  border: 1px solid var(--sdui-c-border, rgba(0,0,0,.2)); border-radius: 10px; padding: 6px 10px; resize: none; min-width: 0; }
.sdui-chat__input { min-height: 34px; max-height: 120px; }
.sdui-chat__send, .sdui-chat__open, .sdui-chat__close { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px; padding: 7px 14px;
  background: var(--sdui-c-accent, var(--sdui-c-primary, #333)); color: var(--sdui-c-onAccent, #fff); white-space: nowrap; }
.sdui-chat__send:disabled { opacity: .6; cursor: default; }
.sdui-chat__close { background: transparent; color: inherit; padding: 2px 6px; }

/* The lead panel (0.129). */
.sdui-chat__lead { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--sdui-c-border, rgba(0,0,0,.12)); }
.sdui-chat__strip { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font: inherit; font-size: 13px; font-weight: 600;
  color: inherit; background: none; border: 0; padding: 7px 0 4px; cursor: pointer; text-align: start; }
.sdui-chat__count { font-weight: 500; color: var(--sdui-c-textMuted, #666); white-space: nowrap; }
.sdui-chat__track { display: block; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--sdui-c-onSurface, #000) 12%, transparent); overflow: hidden; margin-bottom: 6px; }
.sdui-chat__bar { display: block; height: 100%; width: 0; background: var(--sdui-c-accent, var(--sdui-c-primary, #333)); transition: width .35s ease; }
.sdui-chat__lead--complete .sdui-chat__count { color: var(--sdui-c-success, #1a7f37); }
.sdui-chat__lead-body { display: none; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.sdui-chat__lead--open .sdui-chat__lead-body { display: flex; }
.sdui-chat__field { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--sdui-c-textMuted, #666); }
.sdui-chat__field input, .sdui-chat__field textarea { color: var(--sdui-c-onSurface, inherit); }
.sdui-chat__consent { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; }
.sdui-chat__lead-send { align-self: stretch; }
.sdui-chat__lead-done { margin: 0; padding: 8px 0; font-size: 13px; }
.sdui-chat__note { margin: 0; font-size: 12px; color: var(--sdui-c-danger, #b00020); }
.sdui-chat__note:empty { display: none; }
.sdui-chat__enquiry { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--sdui-c-border, rgba(0,0,0,.12)); padding: 8px 0; }

@media (min-width: 760px) {
  .sdui-chat__panel--split .sdui-chat__main { flex-direction: row; gap: 14px; align-items: stretch; }
  .sdui-chat__panel--split .sdui-chat__talk { flex: 3 1 0; }
  /* both columns end level: the messages fill the chat column's height and scroll, the input sits at its foot */
  .sdui-chat__panel--split .sdui-chat__log { flex: 1 1 auto; min-height: 0; }
  .sdui-chat__panel--split .sdui-chat__form { margin-top: auto; }
  .sdui-chat__panel--split .sdui-chat__lead { flex: 2 1 0; border-top: 0; border-inline-start: 1px solid var(--sdui-c-border, rgba(0,0,0,.12)); padding-inline-start: 14px; }
  .sdui-chat__panel--split .sdui-chat__lead-body { display: flex; }   /* desktop: the fields always show beside the chat */
  .sdui-chat__panel--split .sdui-chat__strip { cursor: default; pointer-events: none; }
  .sdui-chat__panel--split .sdui-chat__log { max-height: none; }
  .sdui-chat__panel--split .sdui-chat__main { max-height: 460px; }
}
@media (max-width: 759px) {
  .sdui-chat { font-size: 15px; }   /* phones: 15-16 px inputs, so iOS doesn't zoom in on focus */
  .sdui-chat__input, .sdui-chat__field input, .sdui-chat__field textarea { font-size: 16px; }
  .sdui-chat__panel { border-radius: 12px; padding: 0 10px; }
  .sdui-chat__main { flex-direction: column-reverse; }   /* the progress strip sits above the conversation */
  .sdui-chat__lead { border-top: 0; border-bottom: 1px solid var(--sdui-c-border, rgba(0,0,0,.12)); }
  .sdui-chat__log { max-height: 46vh; }
}

.sdui-chat--bubble { position: fixed; inset-inline-end: 16px; inset-block-end: 16px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sdui-chat--bubble .sdui-chat__panel { width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 96px)); overflow-y: auto; }
/* Phones: the bubble's panel scrolls as one, so its main part takes its own height instead of shrinking under the head
   (the log drew over the title and covered the close button; the lead fields could not be reached). ITShop_2, measured at 390. */
@media (max-width: 759px) { .sdui-chat--bubble .sdui-chat__main { flex: 0 0 auto; } }
.sdui-chat__open { border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
