.ssai-root {
  --ssai-orange: #f68712;
  --ssai-orange-dark: #bd5d00;
  --ssai-orange-light: #fdb871;
  --ssai-green: #65b530;
  --ssai-ink: #20272d;
  --ssai-muted: #5d6872;
  --ssai-border: #dfe5e1;
  --ssai-surface: #fff;
  color: var(--ssai-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.ssai-root *, .ssai-root *::before, .ssai-root *::after { box-sizing: border-box; }
.ssai-root button { letter-spacing: normal; text-transform: none; }

.ssai-launcher {
  align-items: center;
  background: var(--ssai-ink);
  border: 0;
  border-radius: 999px;
  bottom: 22px;
  box-shadow: 0 16px 42px rgba(23, 31, 36, .28), 0 0 0 1px rgba(255, 255, 255, .08) inset;
  color: #fff;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-weight: 800;
  gap: 10px;
  min-height: 58px;
  padding: 8px 20px 8px 8px;
  position: fixed;
  right: 22px;
  z-index: 99998;
}

.ssai-launcher:hover, .ssai-launcher:focus-visible { background: #111619; box-shadow: 0 18px 48px rgba(23, 31, 36, .32), 0 0 0 2px var(--ssai-orange) inset; outline: 3px solid rgba(246, 135, 18, .30); outline-offset: 3px; }
.ssai-root.ssai-launcher-delayed .ssai-launcher { opacity: 0; pointer-events: none; transform: translateY(10px); }
.ssai-root.ssai-launcher-delayed.ssai-launcher-ready .ssai-launcher { opacity: 1; pointer-events: auto; transform: translateY(0); transition: opacity .28s ease, transform .28s ease; }
.ssai-root.ssai-open .ssai-launcher,
.ssai-root.ssai-intro-active .ssai-launcher,
.ssai-root.ssai-launcher-delayed.ssai-launcher-ready.ssai-open .ssai-launcher,
.ssai-root.ssai-launcher-delayed.ssai-launcher-ready.ssai-intro-active .ssai-launcher { opacity: 0; pointer-events: none; }
.ssai-launcher-mark, .ssai-brand-mark { align-items: center; background: #fff; border: 1px solid rgba(32, 39, 45, .10); border-radius: 50%; color: var(--ssai-ink); display: inline-flex; font-size: 11px; font-weight: 900; justify-content: center; overflow: hidden; }
.ssai-launcher-mark { height: 42px; width: 42px; }
.ssai-brand-mark { box-shadow: 0 6px 18px rgba(32, 39, 45, .10); flex: 0 0 48px; height: 48px; width: 48px; }
.ssai-launcher-mark img, .ssai-brand-mark img, .ssai-message-mark img { display: block; height: 100%; object-fit: cover; object-position: center top; width: 100%; }

.ssai-character-intro {
  bottom: 14px;
  height: min(560px, calc(100dvh - 28px));
  pointer-events: none;
  position: fixed;
  right: 18px;
  width: min(440px, calc(100vw - 24px));
  z-index: 100000;
}
.ssai-character-intro[hidden] { display: none; }
.ssai-character-figure {
  animation: ssai-character-enter .44s cubic-bezier(.2, .85, .3, 1) both;
  bottom: 0;
  filter: drop-shadow(0 18px 20px rgba(32, 39, 45, .22));
  height: auto;
  max-height: min(535px, 72dvh);
  max-width: 78%;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  position: absolute;
  right: 0;
  width: auto;
}
.ssai-character-speech {
  animation: ssai-speech-enter .36s .12s ease-out both;
  background: #fff;
  border: 1px solid rgba(32, 39, 45, .13);
  border-left: 5px solid var(--ssai-orange);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(32, 39, 45, .20);
  left: 0;
  max-width: 238px;
  padding: 16px 17px 13px;
  pointer-events: auto;
  position: absolute;
  top: 52px;
}
.ssai-character-speech::after {
  background: #fff;
  border-right: 1px solid rgba(32, 39, 45, .13);
  border-top: 1px solid rgba(32, 39, 45, .13);
  content: "";
  height: 15px;
  position: absolute;
  right: -8px;
  top: 45px;
  transform: rotate(45deg);
  width: 15px;
}
.ssai-character-speech strong, .ssai-character-speech span { display: block; }
.ssai-character-speech strong { color: var(--ssai-ink); font-size: 17px; line-height: 1.25; margin-bottom: 6px; }
.ssai-character-speech span { color: var(--ssai-muted); font-size: 13px; line-height: 1.45; }
.ssai-intro-skip {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #8a4500;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  margin: 8px 0 -4px -8px;
  min-height: 44px;
  padding: 8px;
  position: relative;
  z-index: 1;
}
.ssai-intro-skip:hover { text-decoration: underline; text-underline-offset: 3px; }
.ssai-intro-skip:focus-visible { outline: 3px solid rgba(246, 135, 18, .32); outline-offset: 1px; }
.ssai-root.ssai-intro-leaving .ssai-character-intro { opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }

@keyframes ssai-character-enter {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ssai-speech-enter {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.ssai-panel {
  background: var(--ssai-surface);
  border: 1px solid rgba(32, 39, 45, .11);
  border-radius: 24px;
  bottom: 92px;
  box-shadow: 0 28px 80px rgba(25, 34, 39, .25), 0 2px 8px rgba(25, 34, 39, .08);
  display: grid;
  grid-template-rows: auto auto minmax(120px, 1fr) auto auto auto;
  height: min(740px, calc(100vh - 110px));
  max-height: min(740px, calc(100vh - 110px));
  overflow: hidden;
  position: fixed;
  right: 22px;
  width: min(440px, calc(100vw - 28px));
  z-index: 99999;
}

.ssai-panel[hidden] { display: none; }
.ssai-header { align-items: center; background: linear-gradient(135deg, #fffaf5 0%, #fff 72%); border-bottom: 1px solid #f0e0d1; border-top: 4px solid var(--ssai-orange); display: flex; gap: 13px; padding: 15px 18px 16px; }
.ssai-header p { color: #68727a; font-size: 10px; font-weight: 850; letter-spacing: .075em; margin: 0 0 3px; text-transform: uppercase; }
.ssai-header h2 { color: var(--ssai-ink); font-size: 20px; letter-spacing: -.01em; line-height: 1.2; margin: 0; }
.ssai-close { background: transparent; border: 0; border-radius: 8px; color: var(--ssai-muted); cursor: pointer; font: 700 27px/1 sans-serif; margin-left: auto; padding: 7px 9px; }
.ssai-close:focus-visible { outline: 3px solid rgba(246, 135, 18, .35); }
.ssai-privacy-note { background: #f5faf2; border-bottom: 1px solid #dae7d4; color: #435247; font-size: 11px; line-height: 1.45; margin: 0; padding: 10px 18px; }
.ssai-messages { background: linear-gradient(180deg, #fff 0%, #fcfdfc 100%); overflow-anchor: none; overflow-y: auto; padding: 20px 18px 12px; scroll-behavior: smooth; }
.ssai-message { align-items: flex-start; display: flex; gap: 8px; margin: 0 0 16px; }
.ssai-message.ssai-user { justify-content: flex-end; }
.ssai-message-mark { align-items: center; background: #fff; border: 1px solid rgba(32, 39, 45, .10); border-radius: 50%; box-shadow: 0 4px 12px rgba(32, 39, 45, .08); color: var(--ssai-ink); display: inline-flex; flex: 0 0 32px; font-size: 8px; font-weight: 900; height: 32px; justify-content: center; overflow: hidden; width: 32px; }
.ssai-message-body { max-width: 86%; min-width: 0; }
.ssai-bubble { background: #f0f4f1; border: 1px solid rgba(32, 39, 45, .04); border-radius: 5px 17px 17px 17px; color: var(--ssai-ink); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; padding: 12px 14px; white-space: pre-line; }
.ssai-user .ssai-message-body { max-width: 84%; }
.ssai-user .ssai-bubble { background: var(--ssai-ink); border: 0; border-radius: 17px 5px 17px 17px; box-shadow: 0 5px 16px rgba(32, 39, 45, .13); color: #fff; }
.ssai-emergency .ssai-bubble { background: #fff3e7; border: 2px solid var(--ssai-orange); font-weight: 750; }
.ssai-secondary .ssai-bubble { background: #f7f9f7; color: #59636a; font-size: 12.5px; }
.ssai-sources { border-left: 3px solid var(--ssai-green); margin: 8px 2px 0; padding: 2px 0 2px 10px; }
.ssai-sources summary { color: #3e5143; cursor: pointer; font-size: 11px; font-weight: 800; }
.ssai-sources ul { margin: 8px 0 2px; padding-left: 17px; }
.ssai-sources li { margin: 0 0 7px; }
.ssai-sources a { color: #724000; font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
.ssai-sources span { color: var(--ssai-muted); display: block; font-size: 10px; }
.ssai-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ssai-contact-actions a { background: var(--ssai-orange); border-radius: 999px; color: #fff; font-size: 12px; font-weight: 800; padding: 8px 11px; text-decoration: none; }
.ssai-contact-actions a:last-child { background: var(--ssai-green); }
.ssai-quick-actions { background: #fcfdfc; display: flex; flex-wrap: wrap; gap: 7px; overflow: visible; padding: 2px 18px 14px 58px; }
.ssai-quick-actions button { background: #fff; border: 1px solid #d9e0dc; border-radius: 999px; color: var(--ssai-ink); cursor: pointer; flex: 0 0 auto; font-family: inherit; font-size: 12px; font-weight: 750; line-height: 1.2; min-height: 44px; padding: 9px 12px; }
.ssai-quick-actions button:hover { background: #fff8f1; border-color: var(--ssai-orange); color: #8b4500; }
.ssai-quick-actions button:focus-visible { outline: 3px solid rgba(246, 135, 18, .3); }
.ssai-quick-actions button.ssai-action-secondary { background: #f7f9f7; border-color: #cfd8d2; color: #59636a; }
.ssai-quick-actions .ssai-emergency-call { align-items: center; background: #c62828; border: 2px solid #9f1d1d; border-radius: 13px; box-shadow: 0 6px 16px rgba(159, 29, 29, .22); color: #fff; display: inline-flex; flex: 1 1 100%; font-size: 14px; font-weight: 900; justify-content: center; min-height: 48px; padding: 9px 14px; text-decoration: none; }
.ssai-quick-actions .ssai-emergency-call:focus-visible { outline: 3px solid rgba(198, 40, 40, .3); outline-offset: 2px; }
.ssai-assistant-sam .ssai-quick-actions,
.ssai-area-technical .ssai-quick-actions { align-content: flex-start; align-items: flex-start; }
.ssai-assistant-sam .ssai-quick-actions > button,
.ssai-area-technical .ssai-quick-actions > button { align-self: flex-start; border-radius: 13px; flex: 1 1 calc(50% - 4px); max-width: 100%; text-align: left; white-space: normal; }
.ssai-form { align-items: flex-end; background: #fff; border-top: 1px solid var(--ssai-border); display: flex; gap: 9px; padding: 12px 14px; }
.ssai-form textarea { border: 1px solid #bcc8c0; border-radius: 13px; color: var(--ssai-ink); flex: 1; font-family: inherit; font-size: 14px; line-height: 1.4; max-height: 110px; min-height: 48px; overflow-y: hidden; padding: 13px 13px 10px; resize: none; }
.ssai-form textarea:focus { border-color: var(--ssai-orange); box-shadow: 0 0 0 3px rgba(246, 135, 18, .16); outline: 0; }
.ssai-form button { background: var(--ssai-orange); border: 0; border-radius: 13px; box-shadow: 0 6px 16px rgba(246, 135, 18, .22); color: #fff; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 850; min-height: 48px; padding: 0 17px; }
.ssai-form button:hover { background: var(--ssai-orange-dark); }
.ssai-form button:focus-visible { outline: 3px solid rgba(246, 135, 18, .35); outline-offset: 2px; }
.ssai-form button:disabled, .ssai-form textarea:disabled { cursor: wait; opacity: .65; }
.ssai-footer { align-items: center; background: #f7f9f7; border-top: 1px solid #edf0ee; display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px 12px; }
.ssai-footer span { color: #7a3d00; font-size: 11px; font-weight: 850; }
.ssai-footer a { color: #4f5a62; font-size: 11px; font-weight: 750; text-decoration: none; }
.ssai-footer a:hover { color: #8b4500; text-decoration: underline; }
.ssai-sr-only { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }
.ssai-mode-inline .ssai-launcher { display: none; }
.ssai-mode-inline .ssai-panel { bottom: auto; max-height: 720px; position: relative; right: auto; width: 100%; z-index: auto; }
.ssai-mode-inline .ssai-close { display: none; }

@media (max-width: 520px) {
  .ssai-launcher { bottom: 12px; right: 12px; }
  .ssai-assistant-sam .ssai-launcher { border-radius: 50%; min-height: 58px; min-width: 58px; padding: 8px; width: 58px; }
  .ssai-assistant-sam .ssai-launcher > span:last-child { display: none; }
  .ssai-assistant-sam .ssai-launcher-mark { height: 42px; width: 42px; }
  body:has(.ssai-assistant-sam) .sspriv-dock { display: none !important; }
  .ssai-character-intro { bottom: 6px; height: min(460px, calc(100dvh - 12px)); right: 6px; width: calc(100vw - 12px); }
  .ssai-character-figure { max-height: min(410px, 59dvh); max-width: 73%; right: -5px; }
  .ssai-character-speech { left: 0; max-width: min(205px, 63vw); padding: 13px 14px 10px; top: 18px; }
  .ssai-character-speech strong { font-size: 15px; }
  .ssai-character-speech span { font-size: 12px; }
  .ssai-panel { border-radius: 17px; bottom: 78px; height: auto; max-height: calc(100dvh - 90px); right: 4px; width: calc(100vw - 8px); }
  .ssai-assistant-sam .ssai-panel { bottom: max(4px, env(safe-area-inset-bottom)); grid-template-rows: auto auto minmax(60px, 1fr) auto auto auto; max-height: calc(100dvh - 8px - env(safe-area-inset-bottom)); }
  .ssai-privacy-note { padding-left: 14px; padding-right: 14px; }
  .ssai-header { gap: 10px; padding: 10px 12px; }
  .ssai-header .ssai-brand-mark { flex-basis: 42px; height: 42px; width: 42px; }
  .ssai-header p { font-size: 9px; letter-spacing: .055em; margin-bottom: 1px; white-space: nowrap; }
  .ssai-header h2 { font-size: 16px; line-height: 1.15; }
  .ssai-close { font-size: 24px; padding: 6px 7px; }
  .ssai-privacy-note { font-size: 10px; line-height: 1.35; padding: 8px 14px; }
  .ssai-messages { padding: 10px 12px 8px; }
  .ssai-message { margin-bottom: 12px; }
  .ssai-secondary .ssai-bubble { font-size: 11.5px; line-height: 1.35; padding: 9px 11px; }
  .ssai-message-body { max-width: 90%; }
  .ssai-quick-actions { padding-left: 48px; padding-right: 12px; }
  .ssai-assistant-sam .ssai-quick-actions,
  .ssai-area-technical .ssai-quick-actions { max-height: max(84px, min(220px, calc(100dvh - 300px - env(safe-area-inset-bottom)))); overscroll-behavior: contain; overflow-y: auto; padding-left: 14px; }
  .ssai-assistant-sam .ssai-quick-actions > button,
  .ssai-area-technical .ssai-quick-actions > button { flex: 1 1 calc(50% - 4px); min-width: 0; width: auto; }
  .ssai-form { padding: 10px; }
  .ssai-footer { gap: 7px 12px; padding-left: 13px; padding-right: 13px; }
}

@media (max-width: 340px) {
  .ssai-header { padding: 7px 10px; }
  .ssai-header .ssai-brand-mark { flex-basis: 34px; height: 34px; width: 34px; }
  .ssai-privacy-note { font-size: 9px; line-height: 1.25; padding: 5px 10px; }
  .ssai-messages { padding: 7px 10px 5px; }
  .ssai-messages .ssai-message:first-child .ssai-message-mark,
  .ssai-messages .ssai-secondary .ssai-message-mark { display: none; }
  .ssai-messages .ssai-message:first-child .ssai-message-body,
  .ssai-messages .ssai-secondary .ssai-message-body { max-width: 100%; width: 100%; }
  .ssai-messages .ssai-message:first-child .ssai-bubble { font-size: 11.5px; line-height: 1.28; padding: 7px 9px; }
  .ssai-secondary .ssai-bubble { font-size: 10.5px; line-height: 1.25; padding: 6px 8px; }
  .ssai-message { margin-bottom: 7px; }
  .ssai-footer { flex-wrap: nowrap; gap: 7px; padding: 6px 8px; white-space: nowrap; }
  .ssai-footer a { font-size: 9.5px; }
  .ssai-footer a[href^="tel:"] { display: none; }
  .ssai-assistant-sam .ssai-quick-actions > button,
  .ssai-area-technical .ssai-quick-actions > button { font-size: 11px; padding-left: 9px; padding-right: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .ssai-messages { scroll-behavior: auto; }
  .ssai-character-figure, .ssai-character-speech { animation: none; }
}
