/* The Support Agent chat bubble on the public home page.
   Everything is scoped under #sa-root so the page's own styles never leak
   in, and the widget never leaks out. Always light, like the site. */
#sa-root, #sa-root * { box-sizing: border-box; }
#sa-root {
  --sa-ink: #10231f; --sa-muted: #566a65; --sa-line: #dce5e2; --sa-bot: #eef4f2;
  --sa-me: #0f5f57; --sa-teal: #0d9488; --sa-deep: #0f766e; --sa-deeper: #134e4a;
  --sa-note-bg: #fcf1df; --sa-note-line: #efd9b3; --sa-note-ink: #6b4310;
  --sa-src-bg: #e6f6fa; --sa-src-ink: #0a6e82; --sa-red: #a8332a;
  font: 400 14.5px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--sa-ink);
}
#sa-bubble {
  position: fixed; right: 22px; bottom: 22px; z-index: 2147483000;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(150deg, var(--sa-teal), var(--sa-deep)); color: #fff;
  box-shadow: 0 10px 30px rgba(15, 35, 31, .28); display: grid; place-items: center;
}
#sa-bubble:hover { filter: brightness(1.08); }
#sa-bubble:focus-visible, #sa-root button:focus-visible, #sa-root input:focus-visible, #sa-root a:focus-visible { outline: 3px solid var(--sa-teal); outline-offset: 2px; }
#sa-panel {
  position: fixed; right: 22px; bottom: 94px; z-index: 2147483000;
  width: 372px; max-width: calc(100vw - 32px); height: 580px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: #fff; color: var(--sa-ink); border: 1px solid var(--sa-line);
  box-shadow: 0 28px 70px rgba(15, 35, 31, .32);
}
#sa-panel[hidden], #sa-root [hidden] { display: none !important; }
.sa-head { background: linear-gradient(160deg, var(--sa-deep), var(--sa-deeper)); color: #fff; padding: 18px 18px 16px; display: grid; gap: 8px; position: relative; }
.sa-head.compact { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sa-logo { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--sa-deep); display: grid; place-items: center; }
.sa-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.15; }
.sa-sub { margin: 0; font-size: 14px; color: #d4ece8; }
.sa-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sa-id strong { display: block; font-size: 14px; line-height: 1.15; }
/* Only the caption under the title is pale; the logo is a span too and keeps its own colour. */
.sa-id div span { display: block; font-size: 12px; color: #d4ece8; }
.sa-tools { display: flex; align-items: center; gap: 4px; }
.sa-icon { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.sa-icon:hover, .sa-icon[aria-pressed="true"] { background: rgba(255, 255, 255, .18); }
.sa-menu { font: 700 12.5px/1 inherit; font-family: inherit; padding: 7px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .45); background: transparent; color: #fff; cursor: pointer; }
.sa-close { position: absolute; top: 10px; right: 10px; }
.sa-home { flex: 1; overflow-y: auto; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.sa-choice { font: 700 14.5px/1.2 inherit; font-family: inherit; padding: 12px 14px; border-radius: 999px; border: 1px solid #c9e2dd; background: #e6f4f1; color: var(--sa-me); cursor: pointer; text-align: center; }
.sa-choice:hover { background: #d7ede8; }
.sa-choice.primary { background: var(--sa-teal); border-color: var(--sa-teal); color: #fff; font-size: 15px; padding: 13px 14px; }
.sa-choice.primary:hover { background: var(--sa-deep); }
.sa-divider { margin: 4px 0 0; font: 500 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; color: #8fa29e; text-align: center; }
.sa-notice { margin: auto 0 0; font-size: 12px; line-height: 1.5; color: var(--sa-muted); }
.sa-date { display: flex; gap: 8px; width: 100%; align-items: center; }
.sa-date input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--sa-line); border-radius: 10px; font: inherit; background: #fff; color: var(--sa-ink); }
.sa-secure { align-self: stretch; border: 1px solid #c9e0da; background: #f2f9f7; border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.sa-secure-title { margin: 0; font-weight: 700; font-size: 14px; }
.sa-secure-note { margin: 0; font-size: 12.5px; color: var(--sa-muted); }
.sa-secure input { width: 100%; padding: 10px 12px; border: 1px solid var(--sa-line); border-radius: 9px; font: inherit; background: #fff; color: var(--sa-ink); }
.sa-secure-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sa-secure-err { margin: 0; font-size: 12.5px; color: var(--sa-red); font-weight: 700; min-height: 1em; }
.sa-summary { align-self: stretch; border: 1px solid var(--sa-line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.sa-summary dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; }
.sa-summary dt { color: var(--sa-muted); }
.sa-summary dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.sa-thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.sa-m { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; margin: 0; }
.sa-m.bot { background: var(--sa-bot); color: var(--sa-ink); align-self: flex-start; border-bottom-left-radius: 5px; }
.sa-m.me { background: var(--sa-me); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.sa-m.note { align-self: stretch; max-width: none; background: var(--sa-note-bg); border: 1px solid var(--sa-note-line); color: var(--sa-note-ink); font-size: 13px; }
.sa-m.src { align-self: flex-start; background: var(--sa-src-bg); color: var(--sa-src-ink); font: 500 12px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; border-radius: 8px; padding: 7px 10px; }
.sa-dots { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--sa-bot); border-radius: 14px; }
.sa-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9fb3af; animation: saBlink 1.3s infinite; }
.sa-dots i:nth-child(2) { animation-delay: .18s; } .sa-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes saBlink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.sa-controls { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 12px 4px; border-top: 1px solid var(--sa-line); }
.sa-controls:empty { display: none; }
.sa-chip { font: 700 13.5px/1.2 inherit; font-family: inherit; padding: 9px 13px; border-radius: 999px; border: 1.5px solid var(--sa-teal); background: #fff; color: var(--sa-me); cursor: pointer; text-decoration: none; }
.sa-chip:hover { background: #e6f4f1; }
.sa-chip.quiet { border-color: var(--sa-line); color: var(--sa-muted); }
.sa-form { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; }
.sa-form input { flex: 1; min-width: 0; border: 1px solid var(--sa-line); border-radius: 999px; padding: 11px 15px; font: inherit; font-size: 14.5px; background: #fff; color: var(--sa-ink); }
.sa-form input:disabled { background: #f2f5f4; }
.sa-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--sa-teal); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sa-hint { margin: 0; padding: 0 14px 6px; font-size: 12.5px; color: var(--sa-red); font-weight: 700; min-height: 1em; }
@media (max-width: 480px) {
  #sa-panel { right: 12px; bottom: 84px; height: 72vh; }
  #sa-bubble { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .sa-dots i { animation: none; } }
