/* Quiet, conversation-first UI. Scoped tokens leave the website unchanged. */
.assistant-launcher { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); z-index: 110; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 18px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue); color: white; font-size: 13px; box-shadow: 0 6px 24px #1c305f20; transition: background-color .2s; }
.assistant-launcher:hover { background: var(--blue-dark); }
.assistant-launcher[aria-expanded="true"] { visibility: hidden; }
.assistant-launcher svg, .assistant-header button svg, .assistant-input-row button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.assistant-dialog { --chat-ink: #24282f; --chat-muted: #68707d; --chat-line: #e9ebef; position: fixed; inset: auto max(24px, env(safe-area-inset-right)) calc(24px + var(--assistant-keyboard-offset, 0px) + env(safe-area-inset-bottom)) auto; margin: 0; padding: 0; width: 400px; max-width: calc(100vw - 32px); height: 580px; max-height: calc(var(--assistant-viewport-height, 100dvh) - 48px - env(safe-area-inset-bottom)); border: 1px solid #e2e5eb; border-radius: 16px; color: var(--chat-ink); background: #fff; box-shadow: 0 12px 56px #18243924, 0 2px 8px #18243908; overflow: hidden; }
.assistant-dialog[open] { display: flex; flex-direction: column; animation: assistant-enter .2s var(--ease) both; }
.assistant-dialog::backdrop { background: #202b390a; }
.assistant-dialog :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.assistant-dialog p { text-wrap: wrap; }
.assistant-header { display: flex; align-items: center; gap: 4px; padding: 14px 12px 14px 20px; flex: 0 0 auto; border-bottom: 1px solid var(--chat-line); background: #fff; }
.assistant-header > div { min-width: 0; margin-right: auto; }
.assistant-header h2 { margin: 0; font-size: 16px; letter-spacing: 0; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.assistant-disclosure { font-size: 11px; color: var(--chat-muted); margin-top: 3px; line-height: 1.5; }
.assistant-header button { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--chat-muted); }
.assistant-header button:hover { color: var(--chat-ink); background: #f2f4f7; }
.assistant-messages { flex: 1 1 auto; min-height: 48px; overflow-y: auto; overscroll-behavior: contain; padding: 22px 20px; scrollbar-width: thin; scrollbar-color: #cfd4dd transparent; }
.assistant-messages:focus-visible { outline: none; }
.assistant-dialog.is-keyboard .assistant-messages:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.assistant-message { position: relative; max-width: 92%; margin-bottom: 22px; overflow-wrap: anywhere; }
.assistant-message:last-child { margin-bottom: 0; }
.assistant-message__speaker { font-size: 11px; color: var(--chat-muted); margin-bottom: 6px; }
.assistant-message__body { font-size: 14px; line-height: 1.8; white-space: pre-wrap; padding: 12px 14px; border-radius: 3px 12px 12px 12px; background: #f4f5f7; color: var(--chat-ink); }
.assistant-message--user { margin-left: auto; width: fit-content; }
.assistant-message--user .assistant-message__body { background: #edf2ff; color: #263c71; border-radius: 12px 3px 12px 12px; }
.assistant-message--welcome { max-width: 100%; }
.assistant-message--welcome .assistant-message__body { background: #f4f5f7; }
.assistant-message__state { padding-top: 6px; font-size: 12px; line-height: 1.6; color: var(--chat-muted); }
.assistant-message__state.is-error { color: #a5332b; }
.assistant-composer { position: relative; flex: 0 0 auto; margin: 0; padding: 14px 16px 12px; border-top: 1px solid var(--chat-line); background: #fff; }
.assistant-input-row { display: flex; align-items: flex-end; gap: 10px; border: 1px solid #dce0e7; border-radius: 10px; padding: 10px; background: #fafbfc; transition: border-color .15s, box-shadow .15s; }
.assistant-input-row:focus-within { border-color: #879fe4; box-shadow: 0 0 0 2px #244cd910; background: #fff; }
.assistant-input-row textarea { display: block; min-width: 0; flex: 1; min-height: 44px; max-height: 104px; resize: none; overflow-y: auto; color: var(--chat-ink); background: transparent; padding: 0; border: 0; border-radius: 0; font-size: 14px; line-height: 22px; scrollbar-width: thin; }
.assistant-input-row textarea:focus-visible { outline: 0; }
.assistant-input-row textarea::placeholder { color: #777f8b; opacity: 1; }
.assistant-input-row:has([aria-invalid="true"]) { border-color: #aa3f35; }
.assistant-send, .assistant-stop { flex-shrink: 0; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; display: grid; place-items: center; color: white; background: var(--blue); }
.assistant-send:hover, .assistant-stop:hover { background: var(--blue-dark); }
.assistant-send:disabled { color: #8a929f; background: #e9edf3; cursor: not-allowed; }
.assistant-stop svg { fill: currentColor !important; stroke: none !important; }
.assistant-input-meta { display: flex; align-items: center; gap: 8px; color: var(--chat-muted); min-height: 24px; font-size: 10px; line-height: 1.5; margin-top: 4px; }
.assistant-input-meta [data-chat-count] { margin-left: auto; white-space: nowrap; font: 10px/1.5 Arial, sans-serif; font-variant-numeric: tabular-nums; }
.assistant-retry { margin-left: auto; padding: 3px 0 3px 8px; min-height: 28px; color: var(--blue); font-size: 11px; background: none; border: 0; white-space: nowrap; }
.assistant-retry:hover { text-decoration: underline; text-underline-offset: 3px; }
.assistant-retry:disabled { color: var(--chat-muted); cursor: not-allowed; }
.assistant-message .assistant-retry { display: block; margin: 4px 0 0; padding: 4px 0; min-height: 32px; }
.assistant-status.is-visible { position: static; width: auto; height: auto; margin: 6px 0 0; padding: 0; overflow: visible; clip-path: none; white-space: normal; font-size: 12px; line-height: 1.5; color: var(--chat-muted); }
.assistant-status.is-visible.is-error { color: #a5332b; }
.assistant-confirm { flex: 0 0 auto; padding: 12px 20px; background: #f7f8fa; border-top: 1px solid var(--chat-line); }
.assistant-confirm > p { font-size: 13px; }
.assistant-confirm > div { display: flex; gap: 8px; margin-top: 8px; }
.assistant-confirm button { min-height: 36px; padding: 6px 14px; font-size: 12px; border: 1px solid #dce0e7; border-radius: 6px; background: white; }
.assistant-confirm button:last-child { background: var(--chat-ink); color: white; border-color: var(--chat-ink); }
.assistant-confirm button:hover { border-color: var(--blue); }
.assistant-sr-only, .assistant-status:not(.is-visible), .assistant-message--welcome .assistant-message__speaker, .assistant-message--user .assistant-message__speaker { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes assistant-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .assistant-launcher { right: max(16px,env(safe-area-inset-right)); bottom: max(16px,env(safe-area-inset-bottom)); min-height: 48px; padding: 10px 14px; font-size: 12px; }
  .assistant-dialog { inset: auto max(12px,env(safe-area-inset-right)) calc(12px + var(--assistant-keyboard-offset,0px) + env(safe-area-inset-bottom)) auto; width: calc(100% - 24px); max-width: none; height: 620px; max-height: calc(var(--assistant-viewport-height,100dvh) - 24px - env(safe-area-inset-bottom)); border-radius: 14px; }
  .assistant-header { padding: 12px 8px 12px 16px; }
  .assistant-header button { flex-basis: 44px; width: 44px; height: 44px; }
  .assistant-header h2 { font-size: 15px; }
  .assistant-messages { padding: 18px 16px; }
  .assistant-composer { padding: 12px; }
  .assistant-input-row textarea { font-size: 16px; line-height: 24px; min-height: 48px; }
  .assistant-input-row textarea::placeholder { font-size: 14px; }
  .assistant-send, .assistant-stop { width: 44px; height: 44px; }
  .assistant-keyboard-help { display: none; }
  .assistant-input-meta { min-height: 0; margin-top: 0; }
  .assistant-retry { min-height: 34px; }
}
.assistant-dialog.is-compact { bottom: calc(8px + var(--assistant-keyboard-offset,0px) + env(safe-area-inset-bottom)); max-height: calc(var(--assistant-viewport-height,100dvh) - 16px - env(safe-area-inset-bottom)); animation: none; }
.assistant-dialog.is-compact .assistant-header { padding-block: 5px; }
.assistant-dialog.is-compact .assistant-disclosure { margin-top: 1px; font-size: 10px; }
.assistant-dialog.is-compact .assistant-messages { min-height: 36px; padding-block: 10px; }
.assistant-dialog.is-compact .assistant-composer { padding-block: 8px; }
.assistant-dialog.is-compact .assistant-input-row { padding: 6px 8px; }
.assistant-dialog.is-compact .assistant-input-row textarea { min-height: 44px; max-height: 44px; }
.assistant-dialog.is-compact .assistant-keyboard-help { display: none; }
.assistant-dialog.is-compact .assistant-input-meta { min-height: 0; margin-top: 0; }
.assistant-dialog.is-compact .assistant-confirm { padding-block: 8px; }
.assistant-dialog.is-compact .assistant-confirm ~ .assistant-composer[inert] { display: none; }
@media (prefers-reduced-motion: reduce) { .assistant-dialog[open] { animation: none; } .assistant-launcher, .assistant-input-row { transition: none; } }
@media print { .assistant-launcher, .assistant-dialog { display: none !important; } }
