/* =========================================================================
   STUDIO HIGH DESIGN — AI receptionist widget styles
   Self-contained; scoped under .shd-chat* so it won't clash with the site.
   ========================================================================= */
.shd-chat, .shd-chat * { box-sizing: border-box; }
.shd-chat {
  --c-ink: #0B0B0C;
  --c-panel: #131316;
  --c-line: rgba(190,157,99,.24);
  --c-gold: #BE9D63;
  --c-gold-2: #E8CD8E;
  --c-cream: #F4EFE4;
  --c-muted: #9a9aa2;
  position: fixed; right: 22px; bottom: 22px; z-index: 2147483000;
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Launcher button */
.shd-chat-btn {
  display: flex; align-items: center; gap: .55rem;
  border: 1px solid var(--c-line); cursor: pointer;
  background: linear-gradient(135deg, #C9A96A, #9A7C42);
  color: #160F03; font-weight: 600; font-size: .92rem; letter-spacing: .01em;
  padding: .8rem 1.15rem; border-radius: 100px;
  box-shadow: 0 12px 34px rgba(0,0,0,.4);
  transition: transform .25s ease, box-shadow .25s ease;
}
.shd-chat-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.shd-chat-btn svg { width: 18px; height: 18px; }
.shd-chat-btn.hide { display: none; }

/* Panel */
.shd-chat-panel {
  position: absolute; right: 0; bottom: 0;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  background: var(--c-panel); color: var(--c-cream);
  border: 1px solid var(--c-line); border-radius: 18px; overflow: hidden;
  display: none; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  overscroll-behavior: contain;
  opacity: 0; transform: translateY(14px) scale(.98);
  transition: opacity .28s ease, transform .28s ease;
}
.shd-chat-panel.open { display: flex; opacity: 1; transform: translateY(0) scale(1); }

/* Header */
.shd-chat-head {
  display: flex; align-items: center; gap: .7rem;
  padding: .95rem 1.05rem; border-bottom: 1px solid var(--c-line);
  background: var(--c-ink);
}
.shd-chat-badge {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  color: #160F03; background: linear-gradient(135deg, #E8CD8E, #BE9D63);
}
.shd-chat-title { font-weight: 600; font-size: .95rem; line-height: 1.1; }
.shd-chat-sub { font-size: .72rem; color: var(--c-muted); margin-top: 2px; }
.shd-chat-sub .dot { color: #57d38a; }
.shd-chat-x {
  margin-left: auto; background: none; border: none; color: var(--c-muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer; padding: .2rem .4rem; border-radius: 8px;
}
.shd-chat-x:hover { color: var(--c-cream); background: rgba(255,255,255,.06); }

/* Messages */
.shd-chat-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.shd-msg { max-width: 84%; padding: .65rem .85rem; border-radius: 14px; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.shd-msg.bot { align-self: flex-start; background: #1e1e22; color: var(--c-cream); border: 1px solid rgba(255,255,255,.05); border-bottom-left-radius: 5px; }
.shd-msg.me  { align-self: flex-end; background: linear-gradient(135deg, #C9A96A, #9A7C42); color: #160F03; border-bottom-right-radius: 5px; }
.shd-typing { align-self: flex-start; display: flex; gap: 4px; padding: .7rem .85rem; }
.shd-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--c-gold); opacity: .5; animation: shd-bounce 1s infinite; }
.shd-typing span:nth-child(2){ animation-delay: .15s; }
.shd-typing span:nth-child(3){ animation-delay: .3s; }
@keyframes shd-bounce { 0%,80%,100%{ transform: translateY(0); opacity:.4 } 40%{ transform: translateY(-4px); opacity:1 } }

/* Lead form */
.shd-lead { border-top: 1px solid var(--c-line); padding: .85rem 1rem; background: var(--c-ink); display: none; }
.shd-lead.show { display: block; }
.shd-lead-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.shd-lead-x { background: none; border: none; color: var(--c-muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .15rem; flex: 0 0 auto; }
.shd-lead-x:hover { color: var(--c-cream); }
.shd-lead p { font-size: .82rem; color: var(--c-cream); margin: 0 0 .6rem; }
.shd-lead input { width: 100%; margin-bottom: .5rem; padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--c-line); background: #17171b; color: var(--c-cream); font-size: .88rem; }
.shd-lead input::placeholder { color: var(--c-muted); }
.shd-lead button { width: 100%; padding: .65rem; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; color: #160F03; background: linear-gradient(135deg, #E8CD8E, #BE9D63); }
.shd-lead .shd-lead-note { color: var(--c-muted); font-size: .72rem; margin: .4rem 0 0; text-align: center; }

/* Composer */
.shd-chat-foot { border-top: 1px solid var(--c-line); padding: .7rem; display: flex; gap: .5rem; align-items: flex-end; }
.shd-chat-input { flex: 1; resize: none; max-height: 110px; min-height: 42px; padding: .6rem .75rem; border-radius: 12px; border: 1px solid var(--c-line); background: #17171b; color: var(--c-cream); font-size: .9rem; font-family: inherit; line-height: 1.4; }
.shd-chat-input:focus { outline: none; border-color: rgba(190,157,99,.55); }
.shd-send { flex: 0 0 auto; width: 42px; height: 42px; border: none; border-radius: 12px; cursor: pointer; color: #160F03; background: linear-gradient(135deg, #E8CD8E, #BE9D63); display: grid; place-items: center; }
.shd-send:disabled { opacity: .5; cursor: default; }
.shd-send svg { width: 18px; height: 18px; }

.shd-chat-disclaimer { text-align: center; font-size: .68rem; color: var(--c-muted); padding: 0 1rem .7rem; }

@media (max-width: 480px) {
  .shd-chat { right: 14px; bottom: 14px; }
  .shd-chat-panel { width: calc(100vw - 24px); height: calc(100vh - 96px); }
}
@media (prefers-reduced-motion: reduce) {
  .shd-chat-btn, .shd-chat-panel { transition: none; }
  .shd-typing span { animation: none; }
}
