/* "Stormy" chat helper. Uses the site's colour variables, with fallbacks. */
.sdc {
  --sdc-accent: var(--accent, #E8720C);
  --sdc-bg: var(--bg, #FAF8F5);
  --sdc-surface: var(--surface, #FFFFFF);
  --sdc-ink: var(--ink, #1A1A1A);
  --sdc-soft: var(--ink-soft, #4A4A48);
  --sdc-mute: var(--ink-mute, #8A8784);
  --sdc-line: var(--hairline, #E8E2D8);
  font-family: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* The WhatsApp button moves up to sit above the chat button. */
body.has-sdc .wa-fab { bottom: 96px; }

.sdc-launch {
  position: fixed; right: 24px; bottom: 24px; z-index: 210;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--sdc-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(232,114,12,0.35), 0 4px 12px rgba(0,0,0,0.18);
  transition: transform 0.2s ease;
}
.sdc-launch:hover { transform: scale(1.06); }
.sdc-launch:focus-visible { outline: 3px solid var(--sdc-ink); outline-offset: 3px; }
.sdc-launch svg { width: 30px; height: 30px; display: block; }
/* Same gentle pulse as the WhatsApp button, in orange, so the two look like a pair. */
@keyframes sdcPulse {
  0% { box-shadow: 0 0 0 0 rgba(232,114,12,0.5), 0 8px 24px rgba(232,114,12,0.35); }
  70% { box-shadow: 0 0 0 18px rgba(232,114,12,0), 0 8px 24px rgba(232,114,12,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(232,114,12,0), 0 8px 24px rgba(232,114,12,0.35); }
}
.sdc-launch { animation: sdcPulse 2.6s ease-out 1.3s infinite; }
.sdc-open .sdc-launch { animation: none; }
.sdc-launch-close { display: none; }
.sdc-open .sdc-launch-open { display: none; }
.sdc-open .sdc-launch-close { display: block; }
.sdc-tip {
  position: absolute; right: 72px; top: 50%; transform: translateY(-50%);
  background: #1A1A1A; color: #fff; font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: 4px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.sdc-launch:hover .sdc-tip, .sdc-launch:focus-visible .sdc-tip { opacity: 1; }
.sdc-open .sdc-tip { display: none; }

.sdc-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 220;
  width: 380px; height: min(600px, calc(100vh - 128px));
  display: flex; flex-direction: column;
  background: var(--sdc-bg); color: var(--sdc-ink);
  border: 1px solid var(--sdc-line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px -16px rgba(0,0,0,0.30), 0 6px 16px rgba(0,0,0,0.10);
  animation: sdcIn 0.22s ease-out;
}
.sdc-panel[hidden] { display: none; }
@keyframes sdcIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.sdc-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: #1A1A1A; color: #fff;
}
.sdc-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--sdc-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.sdc-avatar svg { width: 26px; height: 14px; }
.sdc-title { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.sdc-title strong { font-family: "Cormorant Garamond", Georgia, serif; font-size: 22px; font-weight: 600; }
.sdc-title span { font-size: 12px; opacity: 0.7; letter-spacing: 0.04em; }
.sdc-close {
  background: none; border: 0; color: #fff; opacity: 0.8; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.sdc-close:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.sdc-close svg { width: 20px; height: 20px; }

.sdc-log { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.sdc-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; word-wrap: break-word; }
.sdc-msg p { margin: 0 0 8px; }
.sdc-msg p:last-child, .sdc-msg ul:last-child { margin-bottom: 0; }
.sdc-msg ul { margin: 0 0 8px; padding-left: 18px; }
.sdc-msg li { margin-bottom: 6px; }
.sdc-msg strong { font-weight: 600; }
.sdc-bot {
  align-self: flex-start; background: var(--sdc-surface); color: var(--sdc-ink);
  border: 1px solid var(--sdc-line); border-bottom-left-radius: 4px;
}
.sdc-bot a:not(.sdc-action) { color: var(--sdc-accent); text-decoration: underline; text-underline-offset: 2px; }
.sdc-you {
  align-self: flex-end; background: var(--sdc-accent); color: #fff; border-bottom-right-radius: 4px;
}
.sdc-action {
  display: inline-block; margin: 2px 0 10px; padding: 8px 14px; border-radius: 999px;
  background: var(--sdc-accent); color: #fff !important; font-weight: 500; font-size: 14px; text-decoration: none;
}
.sdc-action:hover { filter: brightness(1.08); }
.sdc-action::after { content: " →"; }

.sdc-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.sdc-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--sdc-mute); animation: sdcDot 1s infinite ease-in-out; }
.sdc-dots i:nth-child(2) { animation-delay: 0.15s; }
.sdc-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes sdcDot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.sdc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.sdc-chips:empty { display: none; }
.sdc-chip {
  font: inherit; font-size: 13.5px; cursor: pointer;
  padding: 7px 13px; border-radius: 999px;
  background: var(--sdc-surface); color: var(--sdc-ink);
  border: 1px solid var(--sdc-accent);
  transition: background 0.15s ease, color 0.15s ease;
}
.sdc-chip:hover, .sdc-chip:focus-visible { background: var(--sdc-accent); color: #fff; }
.sdc-chip-ghost { border-color: var(--sdc-line); color: var(--sdc-soft); }

.sdc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--sdc-line); background: var(--sdc-surface); }
.sdc-input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--sdc-ink);
  background: var(--sdc-bg); border: 1px solid var(--sdc-line); border-radius: 999px; padding: 9px 16px;
}
.sdc-input:focus { outline: 2px solid var(--sdc-accent); outline-offset: 0; border-color: transparent; }
.sdc-send {
  width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--sdc-accent); color: #fff; display: flex; align-items: center; justify-content: center;
}
.sdc-send svg { width: 20px; height: 20px; }
.sdc-note { margin: 0; padding: 0 16px 10px; background: var(--sdc-surface); font-size: 11.5px; color: var(--sdc-mute); text-align: center; }
.sdc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 600px) {
  /* Smaller, tighter buttons on phones so they cover less of the page. */
  body.has-sdc .wa-fab { bottom: 70px; }
  .sdc-launch { width: 46px; height: 46px; right: 14px; bottom: 14px; }
  .sdc-launch svg { width: 26px; height: 26px; }
  .sdc-tip { display: none; }
  .sdc-panel {
    right: 0; left: 0; bottom: 0; width: auto;
    height: min(85vh, calc(100dvh - 24px)); border-radius: 16px 16px 0 0; border-bottom: 0;
  }
  .sdc-open .sdc-launch { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sdc-panel, .sdc-dots i, .sdc-launch { animation: none; }
}
