/* Isolated assistant styles: white, pale blue, navy, and cobalt. */
.sg-assistant {
  --sg-paper: #fbfdff;
  --sg-white: #ffffff;
  --sg-ink: #20324c;
  --sg-body: #3f5068;
  --sg-muted: #52657d;
  --sg-line: #d7e2ed;
  --sg-soft: #edf4fb;
  --sg-accent: #2758a5;
  color: var(--sg-body);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}
.sg-assistant *, .sg-assistant *::before, .sg-assistant *::after { box-sizing: border-box; }
.sg-assistant [hidden] { display: none !important; }
.sg-assistant button, .sg-assistant input, .sg-assistant textarea, .sg-assistant select { font: inherit; }
.sg-assistant button, .sg-assistant a { -webkit-tap-highlight-color: transparent; }
.sg-assistant button { cursor: pointer; }
.sg-assistant button:disabled { cursor: default; }
.sg-assistant :is(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--sg-accent);
  outline-offset: 3px;
}
.sg-assistant__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sg-assistant__launcher {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  max-width: calc(100vw - 32px);
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid #b9cde1;
  border-radius: 30px;
  color: var(--sg-ink);
  background: var(--sg-white);
  box-shadow: 0 5px 22px rgb(32 50 76 / 16%);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}
.sg-assistant__launcher:hover { background: var(--sg-soft); border-color: var(--sg-accent); }
.sg-assistant__launcher svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sg-assistant__panel {
  position: fixed;
  inset: auto max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) auto;
  z-index: 110;
  display: flex;
  flex-direction: column;
  width: min(440px, calc(100vw - 48px));
  height: min(720px, calc(100vh - 48px));
  height: min(720px, calc(100dvh - 48px));
  min-width: 0;
  max-width: none;
  max-height: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #c3d4e6;
  border-radius: 6px;
  color: var(--sg-body);
  background: var(--sg-paper);
  box-shadow: 0 18px 70px rgb(32 50 76 / 22%);
  text-align: left;
}
.sg-assistant__panel:not([open]) { display: none; }
.sg-assistant__panel::backdrop { background: rgb(32 50 76 / 12%); }
.sg-assistant__backdrop { position: fixed; inset: 0; z-index: 100; background: rgb(32 50 76 / 12%); }
.sg-assistant__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 20px 20px 14px;
  border-top: 3px solid var(--sg-accent);
  background: var(--sg-white);
}
.sg-assistant__heading-wrap { min-width: 0; }
.sg-assistant__mode { margin: 0 0 5px; color: var(--sg-accent); font-size: .8rem; font-weight: 600; line-height: 1.4; letter-spacing: .065em; }
.sg-assistant__title { margin: 0; color: var(--sg-ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; font-weight: 400; line-height: 1.2; letter-spacing: -.035em; }
.sg-assistant__title:focus { outline: none; }
.sg-assistant__close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: -4px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  color: var(--sg-ink);
  background: transparent;
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1;
}
.sg-assistant__close:hover { background: var(--sg-soft); }
.sg-assistant__disclosure { flex: 0 0 auto; padding: 0 20px 15px; border-bottom: 1px solid var(--sg-line); background: var(--sg-white); font-size: .875rem; line-height: 1.5; }
.sg-assistant__disclosure p { margin: 0; color: var(--sg-muted); }
.sg-assistant__disclosure a { display: inline-block; margin-top: 5px; color: var(--sg-ink); text-decoration: underline; text-underline-offset: 3px; }
.sg-assistant__chat { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.sg-assistant__toolbar { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 12px; padding: 3px 20px; border-bottom: 1px solid var(--sg-line); }
.sg-assistant__text-button { display: inline-flex; align-items: center; justify-content: flex-start; min-height: 44px; padding: 9px 0; border: 0; border-radius: 0; color: var(--sg-ink); background: none; font-size: .875rem; font-weight: 500; line-height: 1.4; text-decoration: underline; text-underline-offset: 4px; }
.sg-assistant__text-button:hover { color: var(--sg-accent); }
.sg-assistant__text-button:disabled { color: var(--sg-muted); text-decoration: none; }
.sg-assistant__log { flex: 1 1 auto; min-height: 0; padding: 23px 20px; overflow: auto; overscroll-behavior: contain; scroll-behavior: auto; scrollbar-gutter: stable; }
.sg-assistant__log:focus { outline-offset: -4px; }
.sg-assistant__introduction h3, .sg-assistant__unavailable h3 { margin: 0 0 10px; color: var(--sg-ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; font-weight: 400; line-height: 1.25; letter-spacing: -.025em; }
.sg-assistant__introduction p, .sg-assistant__unavailable p { margin: 0; color: var(--sg-muted); font-size: .95rem; line-height: 1.6; }
.sg-assistant__prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 19px; }
.sg-assistant__prompt { min-height: 42px; padding: 9px 12px; border: 1px solid #bdcfe3; border-radius: 3px; color: var(--sg-ink); background: var(--sg-white); font-size: .875rem; line-height: 1.4; }
.sg-assistant__prompt:hover:not(:disabled) { border-color: var(--sg-ink); background: var(--sg-soft); }
.sg-assistant__prompt:disabled { color: var(--sg-muted); background: #f3f7fc; }
.sg-assistant__message { margin: 0 0 23px; min-width: 0; }
.sg-assistant__message--user { margin-left: 24px; padding: 13px 15px; border-radius: 4px 4px 0 4px; background: #e8f0f9; }
.sg-assistant__message--assistant { padding: 0; }
.sg-assistant__message-label { margin: 0 0 6px; color: var(--sg-muted); font-size: .8rem; font-weight: 600; line-height: 1.4; }
.sg-assistant__message--assistant .sg-assistant__message-label { color: var(--sg-accent); }
.sg-assistant__message-text { margin: 0; color: var(--sg-ink); font-size: 1rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.sg-assistant__sources { display: flex; flex-wrap: wrap; gap: 7px 15px; padding: 0; margin: 12px 0 0; list-style: none; }
.sg-assistant__sources a { color: var(--sg-ink); font-size: .875rem; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.sg-assistant__sources a:hover { color: var(--sg-accent); }
.sg-assistant__waiting { margin: 0; color: var(--sg-muted); font-size: .9rem; }
.sg-assistant__failure { margin: 0 0 22px; padding: 13px 0 13px 14px; border-left: 2px solid var(--sg-accent); }
.sg-assistant__failure p { margin: 0; color: var(--sg-body); font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
.sg-assistant__failure .sg-assistant__text-button { margin-top: 4px; }
.sg-assistant__composer { flex: 0 0 auto; padding: 13px 20px 16px; border-top: 1px solid var(--sg-line); background: var(--sg-white); }
.sg-assistant__intent-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.sg-assistant__intent-row label { color: var(--sg-muted); font-size: .875rem; }
.sg-assistant__intent-row select { width: auto; max-width: calc(100% - 50px); min-height: 36px; padding: 5px 30px 5px 9px; border: 1px solid var(--sg-line); border-radius: 3px; color: var(--sg-ink); background-color: var(--sg-paper); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2320324c' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; font-size: .875rem; line-height: 1.5; }
.sg-assistant__input-row { display: flex; align-items: stretch; gap: 9px; }
.sg-assistant .sg-assistant__question { flex: 1 1 auto; min-width: 0; width: 100%; min-height: 74px; max-height: 150px; padding: 10px 12px; resize: vertical; border: 1px solid #afc5dd; border-radius: 3px; color: var(--sg-ink); background: var(--sg-paper); font-size: 1rem; line-height: 1.5; }
.sg-assistant__question::placeholder { color: var(--sg-muted); opacity: 1; }
.sg-assistant__send { align-self: flex-end; flex: 0 0 auto; min-width: 66px; min-height: 46px; padding: 11px 12px; border: 1px solid var(--sg-ink); border-radius: 3px; color: white; background: var(--sg-accent); font-size: .9rem; font-weight: 500; line-height: 1.4; }
.sg-assistant__send:hover:not(:disabled) { background: #204b91; }
.sg-assistant__send:disabled { border-color: #d3dfed; color: #53677e; background: #e8f0f9; }
.sg-assistant__input-note { margin: 8px 0 0; color: var(--sg-muted); font-size: .8rem; line-height: 1.4; }
.sg-assistant__status { margin: 9px 0 0; color: var(--sg-ink); font-size: .875rem; line-height: 1.5; }
.sg-assistant__status:empty, .sg-assistant__review-status:empty { display: none; }
.sg-assistant__unavailable { padding-bottom: 10px; }
.sg-assistant__live-link { display: block; margin: 19px 0; color: var(--sg-ink); font-size: .95rem; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; line-height: 1.6; }
.sg-assistant__unavailable .sg-assistant__email-label { margin-top: 22px; color: var(--sg-muted); font-size: .875rem; }
.sg-assistant__direct-email { display: inline-block; margin: 5px 0 24px; color: var(--sg-ink); font-size: .95rem; text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.sg-assistant__unavailable .sg-assistant__secondary { display: block; }
.sg-assistant__handoff { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.sg-assistant__handoff-heading { flex: 0 0 auto; padding: 0 20px 14px; border-bottom: 1px solid var(--sg-line); }
.sg-assistant__handoff-heading h3 { margin: 0; color: var(--sg-ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; font-weight: 400; line-height: 1.3; letter-spacing: -.025em; }
.sg-assistant__handoff-heading h3:focus, .sg-assistant__review h4:focus { outline: none; }
.sg-assistant__handoff-scroll { flex: 1 1 auto; min-height: 0; padding: 20px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.sg-assistant__draft-form { margin: 0; }
.sg-assistant__draft-note { margin: 0 0 22px; color: var(--sg-muted); font-size: .9rem; line-height: 1.6; }
.sg-assistant__field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin-bottom: 18px; }
.sg-assistant__field label { color: var(--sg-ink); font-size: .875rem; font-weight: 500; line-height: 1.5; }
.sg-assistant__field input, .sg-assistant__field textarea { display: block; width: 100%; min-width: 0; min-height: 45px; padding: 10px 11px; border: 1px solid #afc5dd; border-radius: 3px; color: var(--sg-ink); background: var(--sg-white); font-size: 1rem; line-height: 1.5; }
.sg-assistant__field textarea { resize: vertical; }
.sg-assistant__field-pair { display: grid; grid-template-columns: 1fr; gap: 0; }
.sg-assistant__consent { display: flex; align-items: flex-start; gap: 10px; padding-block: 7px; color: var(--sg-body); font-size: .875rem; font-weight: 400; line-height: 1.5; cursor: pointer; }
.sg-assistant__consent input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; padding: 0; margin: 2px 0 0; border-radius: 2px; accent-color: var(--sg-ink); }
.sg-assistant__consent:has(input:disabled) { color: var(--sg-muted); cursor: default; }
.sg-assistant__consent-note { margin: 7px 0 22px; color: var(--sg-muted); font-size: .8rem; line-height: 1.5; }
.sg-assistant__primary, .sg-assistant__secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 15px; border: 1px solid var(--sg-ink); border-radius: 3px; color: white; background: var(--sg-accent); font-size: .9rem; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; }
.sg-assistant__primary:hover { background: #204b91; }
.sg-assistant__secondary { border-color: #bdd0e5; color: var(--sg-ink); background: transparent; }
.sg-assistant__secondary:hover:not(:disabled) { border-color: var(--sg-ink); background: var(--sg-soft); }
.sg-assistant__secondary:disabled { color: var(--sg-muted); }
.sg-assistant__review h4 { margin: 0 0 10px; color: var(--sg-ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; font-weight: 400; line-height: 1.25; }
.sg-assistant__recipient { margin: 0 0 12px; color: var(--sg-ink); font-size: .875rem; overflow-wrap: anywhere; }
.sg-assistant__review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sg-assistant__review-status { margin: 17px 0 9px; color: var(--sg-body); font-size: .875rem; line-height: 1.6; }
@media (max-width: 520px) {
  .sg-assistant__launcher { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); min-height: 50px; padding: 11px 15px; font-size: .875rem; }
  .sg-assistant__panel { inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px; width: auto; height: min(740px, calc(100vh - 24px - env(safe-area-inset-bottom))); height: min(740px, calc(100dvh - 24px - env(safe-area-inset-bottom))); }
  .sg-assistant__header { padding: 17px 17px 12px; }
  .sg-assistant__title { font-size: 1.5rem; }
  .sg-assistant__disclosure { padding-inline: 17px; }
  .sg-assistant__toolbar { padding-inline: 17px; }
  .sg-assistant__log { padding: 20px 17px; }
  .sg-assistant__composer { padding: 12px 17px 15px; }
  .sg-assistant__handoff-heading { padding-inline: 17px; }
  .sg-assistant__handoff-scroll { padding: 20px 17px; }
  .sg-assistant__message--user { margin-left: 15px; }
  .sg-assistant__send { min-width: 61px; padding-inline: 10px; }
}
@media (max-height: 580px) {
  .sg-assistant__panel { height: calc(100vh - 16px); height: calc(100dvh - 16px); bottom: 8px; }
  .sg-assistant__header { padding-block: 10px 8px; }
  .sg-assistant__mode { margin-bottom: 2px; }
  .sg-assistant__title { font-size: 1.35rem; }
  .sg-assistant__disclosure { padding-bottom: 10px; }
  .sg-assistant__composer { padding-block: 9px 10px; }
  .sg-assistant__intent-row { margin-bottom: 6px; }
  .sg-assistant .sg-assistant__question { min-height: 56px; max-height: 90px; }
  .sg-assistant__input-note { display: none; }
}
@media (max-height: 480px) {
  .sg-assistant__panel { overflow-y: auto; overscroll-behavior: contain; }
  .sg-assistant__chat, .sg-assistant__handoff { flex: 0 0 auto; min-height: auto; overflow: visible; }
  .sg-assistant__log { flex: 0 0 auto; min-height: 120px; max-height: 36vh; max-height: 36dvh; }
  .sg-assistant__handoff-scroll { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .sg-assistant *, .sg-assistant *::before, .sg-assistant *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .sg-assistant { display: none !important; } }
