.growth-assistant {
  --ga-ink: var(--text-primary, #1e293b);
  --ga-muted: #64748b;
  --ga-accent: var(--primary, #4f46e5);
  --ga-line: #e2e8f0;
  --ga-surface: oklch(97% .005 260);
  --ga-ease: cubic-bezier(.16, 1, .3, 1);
  --ga-radius-sm: 8px;
  --ga-radius-md: 12px;
  --ga-radius-lg: 20px;
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 45;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ga-ink);
}
.growth-assistant [hidden] { display: none !important; }
.growth-assistant *, .growth-assistant *::before, .growth-assistant *::after { box-sizing: border-box; }
.growth-assistant button, .growth-assistant textarea { font: inherit; }
.growth-assistant button, .growth-assistant summary {
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ga-ease), opacity 160ms;
}
.growth-assistant button:active, .growth-assistant summary:active { transform: scale(.96); }
.growth-assistant button:disabled { cursor: not-allowed; }
.growth-assistant :focus-visible { outline: 2px solid var(--ga-accent); outline-offset: 3px; }
.growth-assistant svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.ga-launcher {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--ga-accent);
  box-shadow: 0 4px 12px rgb(30 41 59 / 12%), 0 8px 24px rgb(79 70 229 / 20%);
}
.ga-launcher-symbol { position: relative; display: grid; place-items: center; }
.ga-launcher-symbol svg { width: 24px; height: 24px; }
.ga-launcher-chat { transition: transform 240ms var(--ga-ease), opacity 120ms; }
.growth-assistant .ga-launcher-collapse {
  position: absolute;
  opacity: 0;
  transform: scale(.8) rotate(-45deg);
  transition: transform 240ms var(--ga-ease), opacity 120ms;
}
.growth-assistant[data-open="true"] .ga-launcher-chat { opacity: 0; transform: scale(.8) rotate(45deg); }
.growth-assistant[data-open="true"] .ga-launcher-collapse { opacity: 1; transform: scale(1) rotate(0); }
.ga-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  width: 412px;
  height: min(672px, calc(100dvh - 120px));
  overflow: hidden;
  border-radius: var(--ga-radius-lg);
  background: #fff;
  box-shadow: 0 0 0 1px rgb(30 41 59 / 6%), 0 4px 12px rgb(30 41 59 / 6%), 0 24px 64px -12px rgb(30 41 59 / 25%);
  transform-origin: bottom right;
}
.ga-panel[data-state="open"] { animation: ga-panel-in 280ms var(--ga-ease) both; }
.ga-panel[data-state="closing"] { animation: ga-panel-out 180ms ease-in both; pointer-events: none; }
.ga-header { position: relative; z-index: 2; display: flex; flex-shrink: 0; align-items: center; gap: 12px; min-height: 80px; padding: 16px 20px; border-bottom: 1px solid var(--ga-line); background: #fff; }
.ga-mark { display: grid; place-items: center; width: 32px; height: 40px; flex-shrink: 0; color: var(--ga-accent); }
.ga-mark svg { width: 26px; height: 26px; }
.ga-heading { flex: 1; min-width: 0; }
.ga-heading h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.5; }
.ga-mode { margin: 2px 0 0; color: var(--ga-muted); font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ga-icon-button { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--ga-radius-sm); color: var(--ga-muted); background: transparent; }
.ga-icon-button svg { width: 20px; height: 20px; }
.ga-icon-button:disabled { opacity: .4; }
.ga-tools { position: relative; }
.ga-tools > summary { list-style: none; }
.ga-tools > summary::-webkit-details-marker { display: none; }
.ga-tools[open] > summary { color: var(--ga-ink); background: var(--ga-surface); }
.ga-tool-menu { position: absolute; top: 46px; right: 0; width: 164px; padding: 6px; border-radius: var(--ga-radius-md); background: #fff; box-shadow: 0 0 0 1px rgb(30 41 59 / 6%), 0 8px 24px rgb(30 41 59 / 14%); animation: ga-content-in 160ms var(--ga-ease) both; }
.ga-tool-menu .ga-icon-button { display: flex; justify-content: flex-start; gap: 10px; width: 100%; padding: 0 10px; color: var(--ga-ink); font-size: 13px; white-space: nowrap; }
.ga-tool-menu svg { width: 16px; height: 16px; color: var(--ga-muted); }
.ga-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background: #fff;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.ga-welcome { padding-top: 16px; }
.ga-welcome h3 { margin: 0 0 8px; font-size: 24px; line-height: 1.5; font-weight: 600; letter-spacing: -.012em; text-wrap: balance; }
.ga-welcome > p { margin: 0; color: var(--ga-muted); font-size: 14px; line-height: 1.8; text-wrap: pretty; }
.ga-suggestions { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
.ga-suggestion { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 12px; border: 0; border-radius: var(--ga-radius-sm); background: var(--ga-surface); text-align: left; color: var(--ga-ink); animation: ga-content-in 240ms var(--ga-ease) backwards; }
.ga-suggestion:nth-child(2) { animation-delay: 40ms; }
.ga-suggestion:nth-child(3) { animation-delay: 80ms; }
.ga-suggestion-icon { color: var(--ga-muted); }
.ga-suggestion-icon svg { width: 18px; height: 18px; }
.ga-suggestion-copy { flex: 1; min-width: 0; font-size: 14px; line-height: 1.6; }
.ga-suggestion .ga-suggestion-arrow { width: 16px; height: 16px; color: #94a3b8; transition: transform 160ms var(--ga-ease); }
.ga-message { margin: 0 0 24px; animation: ga-content-in 220ms var(--ga-ease) both; }
.ga-message:last-child { margin-bottom: 0; }
.ga-message-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--ga-muted); font-size: 12px; }
.ga-message-avatar { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; color: var(--ga-accent); }
.ga-message-avatar svg { width: 18px; height: 18px; }
.ga-message-status { color: var(--ga-muted); font-size: 12px; }
.ga-message[data-status="failed"] .ga-message-status { color: #9a5936; }
.ga-message-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.85; }
.ga-message[data-role="assistant"] .ga-message-body { white-space: normal; min-width: 0; }
.ga-message-body p { margin: 0 0 12px; }
.ga-message-body > :last-child, .ga-message-body li > :last-child { margin-bottom: 0; }
.ga-message-body h1, .ga-message-body h2, .ga-message-body h3,
.ga-message-body h4, .ga-message-body h5, .ga-message-body h6 { margin: 18px 0 8px; font-size: 15px; font-weight: 650; line-height: 1.6; }
.ga-message-body > :first-child { margin-top: 0; }
.ga-message-body strong { font-weight: 650; }
.ga-message-body em { font-style: italic; }
.ga-message-body ul, .ga-message-body ol { margin: 8px 0 14px; padding-left: 22px; }
.ga-message-body ul { list-style: disc; }
.ga-message-body ol { list-style: decimal; }
.ga-message-body li { margin: 5px 0; padding-left: 2px; }
.ga-message-body li p { margin-bottom: 6px; }
.ga-message-body blockquote { margin: 12px 0; padding: 4px 12px; border-left: 3px solid #c7d2fe; color: var(--ga-muted); }
.ga-message-body code { padding: 2px 5px; border-radius: 4px; background: #f1f5f9; font: .9em/1.7 Consolas, monospace; white-space: pre-wrap; }
.ga-message-body pre { max-width: 100%; overflow-x: auto; margin: 12px 0; padding: 12px; border: 1px solid var(--ga-line); border-radius: 8px; background: #f8fafc; }
.ga-message-body pre code { padding: 0; background: none; white-space: pre; overflow-wrap: normal; }
.ga-message-body a { color: var(--ga-accent); text-decoration: underline; text-underline-offset: 3px; }
.ga-message-body hr { margin: 16px 0; border: 0; border-top: 1px solid var(--ga-line); }
.ga-table-wrap { max-width: 100%; overflow-x: auto; margin: 12px 0; border: 1px solid var(--ga-line); border-radius: 8px; }
.ga-message-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ga-message-body th, .ga-message-body td { min-width: 80px; padding: 8px 10px; border-bottom: 1px solid var(--ga-line); text-align: left; vertical-align: top; }
.ga-message-body th { background: #f8fafc; font-weight: 600; }
.ga-message-body tbody tr:last-child td { border-bottom: 0; }
.ga-message[data-role="user"] { display: flex; flex-direction: column; align-items: flex-end; margin-left: 32px; }
.ga-message[data-role="user"] .ga-message-label { margin-bottom: 6px; }
.ga-message[data-role="user"] .ga-message-body { max-width: 100%; padding: 10px 14px; border-radius: var(--ga-radius-md); background: var(--ga-surface); }
.ga-pending { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; animation: ga-content-in 200ms var(--ga-ease) both; }
.ga-typing { display: flex; align-items: center; gap: 4px; height: 24px; }
.ga-typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--ga-muted); animation: ga-dot 1.2s ease-in-out infinite; }
.ga-typing i:nth-child(2) { animation-delay: 150ms; }
.ga-typing i:nth-child(3) { animation-delay: 300ms; }
.ga-pending-label { color: var(--ga-muted); font-size: 12px; }
.ga-error { flex-shrink: 0; max-height: 128px; overflow-y: auto; margin: 0; padding: 12px 20px; border-top: 1px solid #f3e5d6; background: #fff8f0; color: #9a5936; font-size: 13px; overflow-wrap: anywhere; }
.ga-retry { min-width: 40px; min-height: 40px; margin: -8px 0; padding: 4px 8px; border: 0; border-radius: 4px; background: transparent; color: #874426; font-weight: 600 !important; text-decoration: underline; text-underline-offset: 3px; }
.ga-composer { flex-shrink: 0; padding: 12px 20px 16px; background: #fff; }
.ga-context { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; min-height: 40px; color: var(--ga-muted); font-size: 12px; cursor: pointer; }
.ga-context input { width: 14px; height: 14px; margin: 0; accent-color: var(--ga-accent); cursor: pointer; }
.ga-context:has(input:checked) { color: var(--ga-accent); }
.ga-context:has(input:disabled) { opacity: .65; cursor: default; }
.ga-input-wrap { padding: 12px 12px 8px; border: 1px solid #e5e7eb; border-radius: 16px; background: #f6f7f9; transition: background-color 160ms, border-color 160ms, box-shadow 160ms; }
.ga-input-wrap:focus-within { border-color: #b8b5e8; background: #fff; box-shadow: 0 0 0 3px rgb(79 70 229 / 5%); }
.ga-input { display: block; width: 100%; min-height: 28px; max-height: 112px; padding: 0 2px; resize: none; border: 0; border-radius: 0; background: transparent; color: var(--ga-ink); font-size: 14px !important; line-height: 26px; scrollbar-width: thin; }
.ga-input::placeholder { color: #6b7280; }
.ga-input:focus-visible { outline: none; }
.ga-input-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.ga-hint { display: flex; align-items: center; gap: 4px; padding-left: 2px; color: #6b7280; font-size: 11px; white-space: nowrap; }
.ga-hint kbd { font: inherit; }
.ga-hint > span { margin: 0 2px; }
.growth-assistant .ga-send { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--ga-accent); color: #fff; transition: background-color 160ms, color 160ms, transform 160ms var(--ga-ease); }
.ga-send svg { width: 18px; height: 18px; }
.growth-assistant .ga-send:disabled { background: #e7e9ef; color: #8791a3; }
.ga-send-arrow { transition: opacity 120ms, transform 160ms var(--ga-ease); }
.ga-send-stop { position: absolute; width: 12px; height: 12px; border-radius: 2px; background: currentColor; opacity: 0; transform: scale(.8); transition: opacity 120ms, transform 160ms var(--ga-ease); }
.ga-send[data-busy="true"] .ga-send-arrow { opacity: 0; transform: translateY(-3px) scale(.8); }
.ga-send[data-busy="true"] .ga-send-stop { opacity: 1; transform: scale(1); }
.ga-footer { margin: 10px 0 0; text-align: center; color: var(--ga-muted); font-size: 12px; line-height: 1.5; }
@media (hover: hover) {
  .ga-suggestion:hover { background: #edf0f6; }
  .ga-suggestion:hover .ga-suggestion-arrow { color: var(--ga-accent); transform: translateX(2px); }
  .ga-icon-button:not(:disabled):hover { background: var(--ga-surface); color: var(--ga-ink); }
  .ga-launcher:hover { transform: translateY(-2px); background: #4338ca; }
  .growth-assistant .ga-send:not(:disabled):hover { background: #4338ca; }
  .ga-send:not(:disabled):not([data-busy="true"]):hover .ga-send-arrow { transform: translateY(-1px); }
}
@media (max-width: 480px) {
  .growth-assistant { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .ga-panel { width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); height: min(672px, calc(100dvh - 100px - env(safe-area-inset-bottom))); }
  .ga-header { gap: 8px; padding: 14px 16px; min-height: 76px; }
  .ga-messages { padding: 20px; }
  .ga-welcome { padding-top: 8px; }
  .ga-welcome h3 { font-size: 22px; }
  .ga-suggestions { margin-top: 24px; }
  .ga-composer { padding: 8px 16px 12px; }
  .ga-input { font-size: 16px !important; }
  .ga-input-actions { justify-content: flex-end; }
  .ga-hint { display: none; }
}
@media (max-height: 620px) {
  .ga-header { min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
  .ga-welcome { padding-top: 0; }
  .ga-welcome h3 { font-size: 20px; }
  .ga-suggestions { margin-top: 16px; }
  .ga-suggestion { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .ga-footer, .ga-hint { display: none; }
  .ga-composer { padding-top: 0; padding-bottom: 12px; }
}
@keyframes ga-panel-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes ga-panel-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes ga-content-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ga-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .growth-assistant *, .growth-assistant *::before, .growth-assistant *::after { animation: none !important; transition: none !important; }
}
