.pssa-root {
  --pssa-ink: #28334a;
  --pssa-paper: #ffffff;
  --pssa-soft: #f2f4f8;
  --pssa-line: #d9dfe8;
  --pssa-muted: #5c6676;
  --pssa-focus: #8e4b00;
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 99990;
  color: var(--pssa-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
}
.pssa-root *, .pssa-root *::before, .pssa-root *::after { box-sizing: border-box; }
.pssa-root [hidden] { display: none !important; }
.pssa-root button, .pssa-root textarea { font-family: inherit; font-size: inherit; line-height: inherit; }
.pssa-root button { cursor: pointer; letter-spacing: normal; text-transform: none; }
.pssa-root button:disabled { cursor: wait; opacity: .6; }
.pssa-root button:focus-visible, .pssa-root a:focus-visible, .pssa-root textarea:focus-visible { outline: 3px solid var(--pssa-focus); outline-offset: 3px; }
.pssa-root p { font-size: inherit; margin: 0; line-height: 1.6; }
.pssa-root a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pssa-launcher {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 30px;
  background: var(--pssa-ink);
  color: #fff;
  box-shadow: 0 5px 24px rgba(18,28,26,.16);
  font-weight: 600;
}
.pssa-launcher:hover { background: #3c4d70; color: #fff; }
.pssa-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: min(396px, calc(100vw - 40px));
  height: min(610px, calc(100dvh - 116px));
  min-height: 290px;
  max-height: calc(100dvh - 116px);
  border: 1px solid var(--pssa-line);
  border-radius: 16px;
  background: var(--pssa-paper);
  box-shadow: 0 12px 56px rgba(18,28,26,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pssa-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px 16px; border-top: 3px solid #f7961d; border-bottom: 1px solid var(--pssa-line); }
.pssa-eyebrow { display: block; font-size: 9px; letter-spacing: .13em; font-weight: 600; color: var(--pssa-muted); }
.pssa-header h2 { margin: 2px 0 0; font-size: 19px; font-weight: 600; color: var(--pssa-ink); line-height: 1.3; letter-spacing: -.015em; }
.pssa-close { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; background: transparent; color: var(--pssa-ink); padding: 0; border: 1px solid transparent; border-radius: 50%; }
.pssa-close:hover { background: var(--pssa-soft); border-color: var(--pssa-line); }
.pssa-messages { flex: 1 1 auto; min-height: 80px; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 6px; scroll-behavior: smooth; }
.pssa-message { max-width: 100%; padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; overflow-wrap: anywhere; }
.pssa-message-assistant { background: var(--pssa-soft); }
.pssa-message-user { background: var(--pssa-ink); color: #fff; margin-left: 30px; border-bottom-right-radius: 3px; }
.pssa-message-assistant p { white-space: pre-line; }
.pssa-sources { display: grid; gap: 8px; margin-top: 13px; border-top: 1px solid var(--pssa-line); padding-top: 12px; }
.pssa-sources a { display: block; font-size: 13px; font-weight: 600; }
.pssa-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.pssa-actions a, .pssa-retry { display: inline-flex; align-items: center; min-height: 40px; border: 1px solid var(--pssa-line); background: #fff; color: var(--pssa-ink); border-radius: 5px; padding: 7px 10px; font-size: 12px; font-weight: 600; text-decoration: none; }
.pssa-actions a:hover, .pssa-retry:hover { background: #e7ebe7; }
.pssa-retry { margin-top: 10px; }
.pssa-starts { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 6px; flex: 0 0 auto; }
.pssa-starts:empty { display: none; }
.pssa-starts button { min-height: 37px; font-size: 12px; border: 1px solid var(--pssa-line); padding: 7px 10px; border-radius: 5px; background: #fff; color: var(--pssa-ink); }
.pssa-starts button:hover { background: var(--pssa-soft); }
.pssa-status { flex: 0 0 auto; padding: 0 18px; font-size: 12px !important; color: var(--pssa-muted); }
.pssa-status:not(:empty) { padding-top: 8px; padding-bottom: 4px; }
.pssa-form { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; margin: 10px 16px 0; padding: 6px; border: 1px solid #bdc7c2; border-radius: 8px; background: #fff; }
.pssa-form textarea { display: block; width: 100%; min-height: 44px; max-height: 110px; resize: none; color: var(--pssa-ink); padding: 7px 5px; border: 0; border-radius: 3px; background: transparent; box-shadow: none; }
.pssa-form textarea::placeholder { color: #68746f; opacity: 1; }
.pssa-send { display: grid; place-items: center; width: 42px; min-width: 42px; height: 42px; border: 0; border-radius: 6px; background: #f7961d; color: #1b2436; padding: 0; }
.pssa-send:hover { background: #ffad47; color: #1b2436; }
.pssa-note { flex: 0 0 auto; padding: 10px 18px 14px; color: var(--pssa-muted); font-size: 10px; line-height: 1.5; }
.pssa-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; padding: 0 !important; }
/* Themes may set this variable while a consent bar is visible. */
.pssa-root { bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--pss-consent-offset, 0px)); }
@media (max-width: 600px) {
  .pssa-root { right: 14px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--pss-consent-offset, 0px)); }
  .pssa-launcher { min-height: 46px; padding: 10px 14px; font-size: 12px; }
  .pssa-panel { position: fixed; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); bottom: max(72px, calc(env(safe-area-inset-bottom) + 62px)); width: auto; height: auto; max-height: none; min-height: 0; border-radius: 12px; }
  .pssa-header { padding: 12px 15px; }
  .pssa-messages { padding: 14px 14px 4px; }
  .pssa-starts { padding-left: 14px; padding-right: 14px; }
  .pssa-starts button { min-height: 42px; }
  .pssa-form textarea { font-size: 16px; }
  .pssa-note { font-size: 10px; padding-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { .pssa-messages { scroll-behavior: auto; } }
@media print { .pssa-root { display: none !important; } }
