/* Zyra's compact right-hand panel, incoming/outgoing bubbles and safe-area spacing
   adapted for the site's own typography and controls. */
.sc-chat {
  --chat-right: max(24px, env(safe-area-inset-right, 0px));
  --chat-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  --chat-ink: #17263b;
  --chat-muted: #526277;
  --chat-border: #dce3ec;
  --chat-orange: #ff6200;
  --chat-peach: #fff1e9;
  color: var(--chat-ink);
  font: 14px/1.5 system-ui, -apple-system, sans-serif;
  text-align: left;
}
.sc-chat [hidden], .sc-chat[hidden], .sc-chat-panel:not([open]) { display: none !important; }
.sc-chat *, .sc-chat *::before, .sc-chat *::after { box-sizing: border-box; }
.sc-chat button { font: inherit; cursor: pointer; }
.sc-chat button:disabled { opacity: .58; cursor: default; }
.sc-chat :is(button,input,textarea):focus-visible, .sc-chat h2:focus-visible {
  outline: 3px solid #126ba4; outline-offset: 2px;
}
.sc-chat-launcher {
  position: fixed; right: var(--chat-right); bottom: var(--chat-bottom); z-index: 1020;
  width: 64px; height: 64px; display: grid; place-items: center;
  border: 1px solid #cc5209; border-radius: 50%; padding: 0;
  background: var(--chat-orange); color: #fff; box-shadow: 0 6px 24px #17263b36;
}
.sc-chat-launcher:hover { background: #e85a00; }
.sc-chat-panel[open] {
  position: fixed; inset: auto var(--chat-right) calc(var(--chat-bottom) + 76px) auto; z-index: 1021;
  width: min(370px, calc(100vw - 24px)); height: min(600px, calc(100vh - var(--chat-bottom) - 92px));
  height: min(600px, calc(100dvh - var(--chat-bottom) - 92px));
  max-width: none; max-height: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  overflow: hidden; border: 1px solid var(--chat-border); border-radius: 20px;
  color: var(--chat-ink); background: white; box-shadow: 0 14px 52px #17263b30;
}
.sc-chat-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 16px 20px; background: var(--chat-ink); color: white;
}
.sc-chat-head h2, .sc-chat p { margin: 0; }
.sc-chat-head h2 { font-family: inherit; font-size: 22px; font-weight: 700; line-height: 1.2; color: white; letter-spacing: -.025em; }
.sc-chat .sc-chat-brand { margin: 0 0 3px; color: #f7c19a; font-size: 12px; font-weight: 600; }
.sc-chat .sc-chat-close {
  width: 44px; height: 44px; border: 1px solid #8290a0; border-radius: 50%; padding: 0;
  display: grid; place-items: center; color: white; background: transparent;
}
.sc-chat-scroll {
  flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; padding: 16px;
}
.sc-chat .sc-chat-greeting, .sc-chat-bubble {
  max-width: 90%; width: fit-content; margin: 0; padding: 9px 13px;
  font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap;
  background: #f1f3f6; color: var(--chat-ink); border-radius: 18px 18px 18px 4px;
}
.sc-chat-topics { margin-top: 8px; }
.sc-chat-topics summary { width: fit-content; min-height: 44px; padding: 11px 1px; color: var(--chat-muted); cursor: pointer; font-size: 13px; font-weight: 600; }
.sc-chat-topics summary:focus-visible { outline: 3px solid #126ba4; outline-offset: 2px; }
.sc-chat-questions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.sc-chat-questions button, .sc-chat-secondary {
  padding: 6px 11px; min-height: 44px; border-radius: 12px; border: 1px solid var(--chat-border);
  background: white; color: #7d370c; overflow-wrap: anywhere; text-align: left; font-weight: 600;
}
.sc-chat-questions button:hover, .sc-chat-secondary:hover { background: var(--chat-peach); border-color: #eeb18d; }
.sc-chat-log { display: flex; flex-direction: column; gap: 12px; }
.sc-chat-log:not(:empty) { margin-top: 16px; }
.sc-chat-message { display: flex; flex-direction: column; align-items: flex-start; }
.sc-chat-message[data-role="visitor"] { align-items: flex-end; }
.sc-chat-message[data-role="visitor"] .sc-chat-bubble { background: var(--chat-peach); border-radius: 18px 18px 4px 18px; }
.sc-chat-message[data-role="system"] .sc-chat-bubble { max-width: 100%; padding: 3px 0; background: transparent; color: var(--chat-muted); font-size: 13px; }
.sc-chat-author { margin: 0 4px 2px; color: var(--chat-muted); font: 600 12px/1.4 system-ui, sans-serif; }
.sc-chat-controls { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 7px 14px 14px; border-top: 1px solid var(--chat-border); background: white; }
.sc-chat-service { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; }
.sc-chat-service p { color: var(--chat-muted); font-size: 13px; }
.sc-chat .sc-chat-secondary { flex: none; border-color: transparent; padding: 4px 6px; font-size: 13px; }
.sc-chat .sc-chat-error { margin: 4px 0; color: #a33116; font-size: 13px; }
.sc-chat form { margin: 0; }
.sc-chat-consent { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 8px; color: var(--chat-muted); cursor: pointer; font-size: 12px; line-height: 1.45; }
.sc-chat-consent input { flex: none; width: 17px; height: 17px; accent-color: #a84108; margin: 0; appearance: auto; }
.sc-chat-compose { display: flex; align-items: flex-end; gap: 6px; padding: 5px; background: #f4f6f9; border: 1px solid #cbd5e1; border-radius: 13px; }
.sc-chat-compose textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 90px; border: 0; border-radius: 8px; padding: 4px 6px; resize: none; color: var(--chat-ink); background: transparent; font: inherit; }
.sc-chat .sc-chat-send { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; flex: none; border: 1px solid #be500f; border-radius: 12px; color: white; background: #b64509; }
.sc-chat-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 600px), (max-height: 520px) {
  .sc-chat { --chat-right: max(12px, env(safe-area-inset-right, 0px)); --chat-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .sc-chat-launcher { width: 54px; height: 54px; }
  .sc-chat-panel[open] {
    bottom: max(8px, env(safe-area-inset-bottom, 0px)); width: min(370px, calc(100vw - 24px));
    height: min(600px, calc(100vh - 24px)); height: min(600px, calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)));
  }
  .sc-chat-launcher[aria-expanded="true"] { visibility: hidden; }
  .sc-chat-compose textarea { font-size: 16px; }
}
@media (max-height: 440px) {
  .sc-chat-head { padding: 4px 12px; }
  .sc-chat .sc-chat-brand { display: none; }
  .sc-chat-controls { max-height: 63%; padding-bottom: 5px; }
}
@media (forced-colors: active) {
  .sc-chat-bubble, .sc-chat .sc-chat-greeting, .sc-chat-launcher, .sc-chat .sc-chat-send { border: 1px solid ButtonText; }
}
