.companion-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: flex; align-items: center; gap: 9px; padding: 12px 16px; border: 1px solid #c7c3bb; background: #fafaf8; color: #292927; font: 13px/1.4 Arial, Helvetica, sans-serif; text-decoration: none; }
.companion-launcher span { font-size: 21px; line-height: 1; }
.emi-companion { box-sizing: border-box; width: min(640px, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; margin: 0 0 0 auto; inset: 0; border: 0; border-left: 1px solid #deded8; padding: 0; background: #fafaf8; color: #292927; font: 15px/1.7 Arial, Helvetica, sans-serif; }
.emi-companion *, .emi-companion *::before, .emi-companion *::after { box-sizing: border-box; }
.emi-companion[open], .emi-companion--page { display: flex; flex-direction: column; }
.emi-companion::backdrop { background: #25242166; backdrop-filter: blur(3px); }
.emi-companion svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.companion-header { display: flex; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid #deded8; flex-shrink: 0; }
.companion-header h1, .companion-header h2 { margin: 0; font: 400 13px/1.5 Arial, Helvetica, sans-serif; letter-spacing: 0; color: #797875; }
.emi-companion:has(.companion-welcome) .companion-header :is(h1, h2, [data-companion-new]),
.emi-companion--page:has(.companion-welcome) .companion-header { display: none; }
.companion-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.companion-actions button, .companion-actions a { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 36px; min-height: 36px; padding: 6px; border: 0; background: transparent; color: #797875; font: 11px/1.5 Arial, sans-serif; text-decoration: none; cursor: pointer; }
.companion-actions svg { width: 16px; height: 16px; }
.companion-actions button:hover, .companion-actions a:hover { color: #292927; }
dialog.emi-companion .companion-actions span { display: none; }
.companion-messages { flex: 1; min-height: 0; overflow: auto; padding: 28px 24px; overscroll-behavior: contain; }
.companion-messages:has(.companion-welcome) { display: flex; align-items: center; padding-top: 24px; padding-bottom: 64px; }
.companion-welcome { width: 100%; max-width: 660px; margin: auto; text-align: center; }
.companion-welcome h2 { margin: 0 0 17px; color: #292927; font: 400 32px/1.2 Arial, Helvetica, sans-serif; letter-spacing: -1px; }
.companion-welcome > p { margin: 0 auto 27px; color: #797875; font: 14px/1.7 Arial, Helvetica, sans-serif; }
.companion-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 22px; }
.companion-suggestions button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 0; border: 0; background: transparent; color: #797875; font: 11px/1.5 Arial, sans-serif; cursor: pointer; }
.companion-suggestions button:hover { color: #292927; text-decoration: underline; text-underline-offset: 4px; }
.companion-suggestions span { color: #9b9a96; }
.companion-message { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; margin: 0 0 24px; }
.companion-message--user { width: fit-content; max-width: 86%; margin-left: auto; padding: 10px 16px; background: #efeee9; }
.companion-message--assistant { padding: 0 4px; }
.companion-message a { color: #514c45; text-decoration: underline; text-underline-offset: 3px; }
.companion-thinking { color: #797875; font-size: 12px; animation: companion-pulse 1.5s ease-in-out infinite; }
.companion-form { padding: 10px 24px 20px; flex-shrink: 0; }
.companion-welcome .companion-form { padding: 0; }
.companion-input-wrap { display: flex; align-items: flex-end; gap: 12px; min-height: 58px; padding: 9px 10px 9px 17px; border: 1px solid #d4d2cb; background: #fff; }
.companion-input-wrap:focus-within { border-color: #7c705c; }
.companion-input-wrap textarea { display: block; width: 100%; min-height: 38px; max-height: 160px; margin: 0; padding: 8px 0; resize: none; border: 0; border-radius: 0; outline: 0; background: transparent; box-shadow: none; color: #292927; font: 16px/1.4 Arial, Helvetica, sans-serif; }
:root .companion-input-wrap textarea:focus { outline: 0; border: 0; box-shadow: none; }
.companion-input-wrap textarea::placeholder { color: #878683; }
.companion-send { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; background: transparent; color: #797875; flex-shrink: 0; cursor: pointer; }
.companion-send:hover { background: #efeee9; color: #292927; }
.companion-send:disabled { opacity: .4; cursor: wait; }
.companion-note { margin: 10px 0 0; color: #8e8d8a; text-align: center; font: 10px/1.6 Arial, sans-serif; }
.companion-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.companion-browse { display: none; margin: 12px 0 0; color: #797875; text-align: center; font: 11px/1.7 Arial, sans-serif; }
.companion-browse a { text-decoration: underline; text-underline-offset: 3px; }
.emi-companion:has(.companion-error:not([hidden])) .companion-browse { display: block; }
.companion-error { margin: 0 0 12px; color: #98462f; font: 13px/1.6 Arial, sans-serif; text-align: left; }
.companion-page { height: 100dvh; overflow: hidden; }
.companion-page main { height: calc(100dvh - var(--emi-header-height, 91px)); }
.emi-companion--page { width: 100%; max-width: 800px; height: 100%; margin: auto; border: 0; }
.emi-companion--page .companion-header { border: 0; }
.emi-companion--page .companion-welcome h2 { font-size: 36px; }
.emi-companion button:focus-visible, .emi-companion a:focus-visible, .companion-launcher:focus-visible { outline: 1px solid #7c705c; outline-offset: 4px; }
@keyframes companion-pulse { 50% { opacity: .5; } }
@media (max-width: 680px) {
  .companion-launcher { right: 16px; bottom: 16px; }
  .companion-header { padding: 14px 20px; }
  .companion-actions [data-companion-new] span { display: none; }
  .companion-messages { padding: 24px 20px; }
  .companion-messages:has(.companion-welcome) { padding-bottom: 42px; }
  .companion-form { padding: 10px 20px 18px; }
  .companion-welcome h2, .emi-companion--page .companion-welcome h2 { font-size: 28px; letter-spacing: -.7px; }
  .companion-welcome > p { max-width: 360px; font-size: 13px; margin-bottom: 24px; }
  .companion-desktop-break { display: none; }
  .companion-suggestions { gap: 4px 16px; margin-top: 17px; }
  .companion-suggestions button { font-size: 10px; }
  .companion-note { font-size: 9px; }
}
@media (max-height: 550px) { .companion-messages:has(.companion-welcome) { align-items: flex-start; padding-bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .companion-thinking { animation: none; } }
