.assistant-theme {
  --aa-ink: #172033;
  --aa-muted: #667085;
  --aa-violet: #6657d9;
  --aa-violet-dark: #4f43b5;
  --aa-line: #e5e7ef;
  --aa-paper: #ffffff;
  --aa-wash: #f7f8fc;
  background: var(--aa-wash);
  color: var(--aa-ink);
}

.aa-workspace { min-height: 100vh; background: radial-gradient(circle at 50% -180px,#eeeaff 0,transparent 42%),var(--aa-wash); color: var(--aa-ink); font-family: Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.aa-header { position: sticky; top: 0; z-index: 20; min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px clamp(16px,3vw,34px); border-bottom: 1px solid rgba(224,226,236,.9); background: rgba(255,255,255,.9); backdrop-filter: blur(18px); box-sizing: border-box; }
.aa-brand { display: flex; gap: 11px; align-items: center; font-size: 17px; font-weight: 850; letter-spacing: -.02em; white-space: nowrap; }
.aa-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(213,0,82,.18); }
.aa-brand-mark img,.aa-welcome-mark img,.aa-message-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aa-header-status { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.aa-status-control { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 5px 7px 5px 10px; border: 1px solid var(--aa-line); border-radius: 10px; background: #fff; color: #344054; cursor: pointer; }
.aa-status-control:hover { border-color: #c9c5ef; background: #fbfaff; }
.aa-status-name { font-size: 12px; font-weight: 800; }
.aa-connection-status { display: inline-flex; align-items: center; justify-content: center; gap: 5px; max-width: 170px; padding: 5px 8px; border: 1px solid #e2e5ec; border-radius: 7px; background: #f8fafc; color: #667085; font-size: 10px; font-weight: 800; line-height: 1.2; text-align: center; }
.aa-connection-status.connected { border-color: #86efac; background: #ecfdf5; color: #047857; box-shadow: 0 0 0 2px rgba(52,211,153,.09); }
.aa-connection-status.connected i { flex: 0 0 auto; font-size: 10px; }
.aa-icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--aa-line); border-radius: 10px; background: #fff; color: #667085; cursor: pointer; }
.aa-icon-button:hover { color: #b42318; border-color: #fecdca; background: #fffbfa; }

.aa-conversation { width: min(900px,calc(100% - 28px)); min-height: calc(100vh - 70px); margin: 0 auto; padding: clamp(34px,7vh,76px) 0 36px; box-sizing: border-box; display: flex; flex-direction: column; }
.aa-welcome { max-width: 650px; margin: auto auto 34px; padding-top: 5vh; text-align: center; transition: margin .2s ease,padding .2s ease,opacity .2s ease; }
.aa-welcome.compact { margin: 0 auto 30px; padding-top: 0; }
.aa-welcome-mark { width: 66px; height: 66px; display: inline-block; overflow: hidden; border-radius: 21px; box-shadow: 0 15px 40px rgba(213,0,82,.2); }
.aa-welcome h1 { margin: 20px 0 12px; color: #1d2435; font-size: clamp(29px,4.5vw,46px); line-height: 1.08; letter-spacing: -.045em; }
.aa-welcome p { max-width: 610px; margin: 0 auto; color: var(--aa-muted); font-size: clamp(14px,1.8vw,17px); line-height: 1.65; }
.aa-welcome.compact .aa-welcome-mark { width: 48px; height: 48px; border-radius: 15px; }
.aa-welcome.compact h1 { margin: 12px 0 0; font-size: 23px; }
.aa-welcome.compact p { display: none; }

.aa-thread { display: grid; gap: 22px; width: 100%; margin-bottom: 26px; }
.aa-message { display: flex; align-items: flex-start; gap: 11px; width: min(820px,100%); }
.aa-message.user { justify-self: end; flex-direction: row-reverse; }
.aa-message-avatar { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #eceafd; color: var(--aa-violet-dark); font-size: 13px; }
.aa-message.assistant .aa-message-avatar { box-shadow: 0 6px 18px rgba(213,0,82,.14); }
.aa-message-body { min-width: 0; max-width: min(710px,calc(100% - 44px)); padding: 14px 16px; border: 1px solid var(--aa-line); border-radius: 5px 17px 17px 17px; background: var(--aa-paper); box-shadow: 0 8px 26px rgba(39,44,71,.05); color: #293147; }
.aa-message.user .aa-message-body { border: 0; border-radius: 17px 5px 17px 17px; background: #6657d9; color: #fff; box-shadow: 0 9px 26px rgba(102,87,217,.2); }
.aa-message-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.62; }
.aa-message-body strong + p { margin-top: 8px; }
.aa-message-body pre { margin: 14px -3px 0; padding: 15px; max-height: 540px; overflow: auto; border: 1px solid #e7e8ef; border-radius: 11px; background: #fafafe; color: #222a3d; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace; }
.aa-message.failed .aa-message-body { border-color: #fecaca; background: #fffafa; }
.aa-message.failed strong { color: #b42318; }
.aa-done { display: inline-flex; align-items: center; gap: 7px; color: #067647; }
.aa-done i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: #dcfae6; font-size: 11px; }
.aa-result-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 13px; color: #667085; font-size: 12px; }
.aa-result-footer > span,.aa-result-footer button,.aa-result-footer a { display: inline-flex; align-items: center; gap: 6px; }
.aa-result-footer button,.aa-result-footer a { padding: 6px 9px; border: 1px solid #d9dce6; border-radius: 8px; background: #fff; color: #475467; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.aa-result-footer button:hover,.aa-result-footer a:hover { border-color: #bbb5ed; color: var(--aa-violet-dark); }
.aa-message.working .aa-message-body { display: flex; align-items: center; gap: 5px; color: #667085; }
.aa-working-dot { width: 6px; height: 6px; border-radius: 999px; background: #8b80df; animation: aa-pulse 1.1s infinite ease-in-out; }
.aa-working-dot:nth-child(2) { animation-delay: .12s; }
.aa-working-dot:nth-child(3) { animation-delay: .24s; }
.aa-working-label { margin-left: 5px; font-size: 13px; }
@keyframes aa-pulse { 0%,70%,100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

.aa-composer-shell { position: sticky; bottom: 14px; width: 100%; margin-top: auto; padding: 6px; border: 1px solid rgba(218,220,232,.95); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 18px 55px rgba(30,34,56,.13); backdrop-filter: blur(18px); box-sizing: border-box; }
.aa-composer-shell form { padding: 5px 7px 0; }
.aa-composer-shell textarea { display: block; width: 100%; min-height: 54px; max-height: 220px; resize: none; overflow-y: auto; box-sizing: border-box; border: 0; outline: 0; padding: 13px 12px 8px; background: transparent; color: var(--aa-ink); font: inherit; font-size: 15px; line-height: 1.55; }
.aa-composer-shell textarea::placeholder { color: #98a2b3; }
.aa-context-summary { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 8px; }
.aa-context-chip { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; padding: 6px 7px 6px 9px; border: 1px solid #d9d6f5; border-radius: 999px; background: #f7f5ff; color: #5146a5; font-size: 11px; font-weight: 750; }
.aa-context-chip > span { max-width: 310px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aa-context-chip button { width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.aa-context-chip button:hover { background: #e9e5ff; }
.aa-composer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px; }
.aa-composer-tools { display: flex; align-items: center; gap: 5px; }
.aa-composer-tools button { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 0; border-radius: 9px; background: transparent; color: #667085; font-size: 12px; font-weight: 750; cursor: pointer; }
.aa-composer-tools button:hover { background: #f2f1fb; color: var(--aa-violet-dark); }
.aa-send { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 0; border-radius: 11px; background: linear-gradient(135deg,var(--aa-violet),var(--aa-violet-dark)); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(102,87,217,.22); }
.aa-send:disabled { opacity: .52; cursor: wait; box-shadow: none; }
.aa-notice { min-height: 18px; padding: 0 11px 3px; color: #667085; font-size: 11px; line-height: 1.4; }
.aa-notice.error { color: #b42318; }
.aa-session-note { margin: 5px 10px 0; color: #98a2b3; font-size: 10px; text-align: center; }

.aa-sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.aa-helper { color: var(--aa-muted); font-size: 13px; line-height: 1.55; margin: 0 0 18px; }
.aa-field { display: grid; gap: 7px; margin-top: 14px; }
.aa-field span { color: #39415a; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.aa-field input { width: 100%; box-sizing: border-box; border: 1px solid #cfd4e2; border-radius: 10px; padding: 11px 12px; font: inherit; background: #fff; color: var(--aa-ink); }
.aa-field input:focus { outline: 3px solid rgba(102,87,217,.13); border-color: var(--aa-violet); }
.aa-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.aa-primary { border: 0; background: linear-gradient(135deg,var(--aa-violet),var(--aa-violet-dark)); color: white; border-radius: 10px; padding: 11px 16px; font-weight: 800; cursor: pointer; box-shadow: 0 9px 22px rgba(102,87,217,.2); }
.aa-secondary { border: 1px solid #cfd4e2; background: #fff; color: #39415a; border-radius: 9px; padding: 10px 13px; font-weight: 700; cursor: pointer; }
.aa-modal { position: fixed; inset: 0; z-index: 12000; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(15,19,39,.7); }
.aa-modal.open { display: flex; }
.aa-modal-card { width: min(520px,100%); box-sizing: border-box; background: #fff; border-radius: 18px; padding: 25px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.aa-modal-card h2 { margin: 0 0 8px; font-size: 21px; }

@media (max-width: 760px) {
  .aa-header { align-items: flex-start; }
  .aa-header-status { gap: 5px; }
  .aa-status-name { display: none; }
  .aa-status-control { padding: 4px; }
  .aa-connection-status { max-width: 118px; }
  .aa-conversation { width: min(100% - 18px,900px); padding-top: 34px; }
  .aa-welcome { padding-top: 2vh; }
}

@media (max-width: 520px) {
  .aa-header { min-height: 62px; padding: 9px 11px; }
  .aa-brand > span:last-child { display: none; }
  .aa-brand-mark { width: 36px; height: 36px; }
  .aa-connection-status { max-width: 92px; padding: 5px 6px; }
  .aa-header-status .aa-icon-button { width: 34px; height: 34px; }
  .aa-conversation { min-height: calc(100vh - 62px); padding: 28px 0 18px; }
  .aa-welcome h1 { font-size: 28px; }
  .aa-welcome p { font-size: 14px; }
  .aa-message-avatar { width: 28px; height: 28px; border-radius: 9px; }
  .aa-message-body { max-width: calc(100% - 39px); padding: 12px 13px; }
  .aa-composer-tools button span { display: none; }
  .aa-composer-tools button { width: 36px; justify-content: center; padding: 7px; }
  .aa-send span { display: none; }
  .aa-send { width: 38px; justify-content: center; padding: 9px; }
  .aa-session-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .aa-working-dot { animation: none; }
  .aa-welcome { transition: none; }
}
