/* StackGuide AI chat widget — v10.2.
   Deliberately NOT a generic chat-widget look. Every value below is taken
   from the site's own v10.1 system in styles.css:
   - type: var(--font) Outfit for body, var(--display) Paytone One, uppercase,
     for labels and the panel header, exactly like .fs-display / .fs-btn-yellow
   - colour: var(--yellow) #ffc700 button and header, var(--ink) #1c1400 text
     on yellow, var(--blue) accents, var(--card) #1e1e1e panel body
   - shape: 28px radius and thick outlines, like .fs-card (28px) and
     .fs-btn-yellow (pill + 0 10px 0 shadow); the button is a 64px yellow
     circle with a 3px ink outline and the same drop shadow
   - the panel body uses the same fixed colours as .fs-card (#fff6df text on
     #1e1e1e, #d8d2bd muted), because .fs-card is dark in BOTH site themes
     (light theme only changes --bg/--text, not --card). That is why the
     panel is readable in light and in dark mode without a second theme.
   The header icon is an original inline SVG robot drawn in chat-widget.js
   (yellow/blue, 3px ink strokes). No third-party logos are used. */
.sg-chat-btn{
  position:fixed;right:20px;bottom:20px;z-index:100;
  width:64px;height:64px;border-radius:50%;
  background:var(--yellow);color:var(--ink);
  border:3px solid var(--ink);
  box-shadow:0 10px 0 rgba(0,0,0,.35);
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  padding:0;line-height:1;
}
.sg-chat-btn:hover{background:var(--yellow-hi)}
.sg-chat-btn:active{transform:translateY(4px);box-shadow:0 6px 0 rgba(0,0,0,.35)}
.sg-chat-btn svg{width:36px;height:36px;display:block}
.sg-chat-btn .sg-chat-close-ic{display:none}
.sg-chat-btn[aria-expanded="true"] .sg-chat-open-ic{display:none}
.sg-chat-btn[aria-expanded="true"] .sg-chat-close-ic{display:block;font-family:var(--font);font-size:30px;font-weight:800;line-height:1}
.sg-chat-panel{
  position:fixed;right:20px;bottom:96px;z-index:100;
  width:min(400px,calc(100vw - 32px));
  height:min(560px,calc(100dvh - 120px));
  background:var(--card);color:#fff6df;
  border:3px solid var(--yellow);border-radius:28px;
  box-shadow:0 24px 60px rgba(0,0,0,.5);
  display:flex;flex-direction:column;overflow:hidden;
  font-family:var(--font);font-size:16px;line-height:1.5;
}
.sg-chat-panel[hidden]{display:none}
.sg-chat-head{
  background:var(--yellow);color:var(--ink);
  display:flex;align-items:center;gap:10px;
  padding:14px 16px;flex:none;
}
.sg-chat-head svg{width:38px;height:38px;flex:none}
.sg-chat-head h2{
  font-family:var(--display);font-weight:400;text-transform:uppercase;
  letter-spacing:.04em;font-size:19px;line-height:1.1;margin:0;flex:1;
}
.sg-chat-head h2 small{display:block;font-family:var(--font);font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;opacity:.75}
.sg-chat-x{
  background:transparent;border:2px solid var(--ink);color:var(--ink);
  border-radius:50%;width:36px;height:36px;flex:none;
  font-size:20px;font-weight:800;cursor:pointer;line-height:1;
}
.sg-chat-note{
  background:var(--card2);color:#d8d2bd;font-size:13.5px;line-height:1.45;
  padding:10px 16px;flex:none;border-bottom:1px solid rgba(255,255,255,.12);
}
.sg-chat-note a{color:var(--yellow);font-weight:700}
.sg-chat-log{flex:1;min-height:0;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:12px}
.sg-chat-msg{max-width:88%;padding:11px 14px;border-radius:18px;white-space:pre-wrap;overflow-wrap:anywhere}
.sg-chat-msg.sg-user{align-self:flex-end;background:var(--yellow);color:var(--ink);font-weight:600;border-bottom-right-radius:6px}
.sg-chat-msg.sg-bot{align-self:flex-start;background:var(--card2);color:#fff6df;border-bottom-left-radius:6px}
.sg-chat-msg.sg-bot a{color:var(--yellow)}
.sg-chat-msg.sg-err{align-self:stretch;background:transparent;color:#ffd83d;border:2px solid var(--yellow);font-size:14.5px}
.sg-chat-quick{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 12px;flex:none}
.sg-chat-quick button{
  font-family:var(--font);font-size:13px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
  background:transparent;color:var(--yellow);border:2px solid var(--yellow);
  border-radius:999px;padding:7px 13px;cursor:pointer;
}
.sg-chat-quick button:hover{background:var(--yellow);color:var(--ink)}
.sg-chat-form{display:flex;gap:10px;padding:12px 14px 14px;flex:none;border-top:1px solid rgba(255,255,255,.12);align-items:center}
.sg-chat-input{
  flex:1;min-width:0;font-family:var(--font);font-size:16px;
  background:#0d0d0d;color:#fff6df;border:1px solid rgba(255,255,255,.2);
  border-radius:999px;padding:11px 16px;
}
.sg-chat-send{
  font-family:var(--font);font-size:14px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
  background:var(--yellow);color:var(--ink);border:3px solid var(--ink);
  border-radius:999px;padding:11px 18px;cursor:pointer;flex:none;
  box-shadow:0 6px 0 rgba(0,0,0,.35);
}
.sg-chat-send:disabled{opacity:.55;cursor:default}
.sg-chat-foot{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:0 18px 12px;flex:none;color:#a39d88;font-size:13px}
.sg-chat-foot button{background:none;border:0;color:var(--yellow);font:inherit;font-weight:700;cursor:pointer;padding:0;text-decoration:underline;text-underline-offset:3px}
.sg-chat-mail{padding:0 16px 16px;flex:none}
.sg-chat-mail[hidden]{display:none}
.sg-chat-mail label{display:block;font-size:13px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#d8d2bd;margin:8px 0 4px}
.sg-chat-mail input{
  width:100%;font-family:var(--font);font-size:15px;box-sizing:border-box;
  background:#0d0d0d;color:#fff6df;border:1px solid rgba(255,255,255,.2);
  border-radius:12px;padding:10px 12px;
}
.sg-chat-mail p{color:#d8d2bd;font-size:13.5px;margin:10px 0 0}
.sg-chat-mail p a{color:var(--yellow)}
@media(max-width:560px){
  .sg-chat-btn{right:16px;bottom:16px;width:56px;height:56px}
  .sg-chat-btn svg{width:32px;height:32px}
  .sg-chat-panel{right:16px;bottom:84px;height:min(560px,calc(100dvh - 104px))}
  .sg-chat-head h2{font-size:17px}
}
@media(prefers-reduced-motion:reduce){
  .sg-chat-btn,.sg-chat-send{transition:none}
}
