/* Remi follows the AI Hypo chat hierarchy; every rule is scoped to this widget. */
#sa24a-root {
    --sa24a-accent: #008f98; --sa24a-ink: #101744; --sa24a-muted: #687795;
    --sa24a-line: #dfe7ef; --sa24a-canvas: #f3f7fa;
    position: fixed; z-index: 2147483000; right: 22px; bottom: 20px;
    color: var(--sa24a-ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    text-align: left; letter-spacing: normal; color-scheme: light;
}
#sa24a-root, #sa24a-root * { box-sizing: border-box; }
#sa24a-root [hidden] { display: none !important; }
#sa24a-root button, #sa24a-root textarea, #sa24a-root a { font: inherit; letter-spacing: normal; text-transform: none; }
#sa24a-root button { appearance: none; -webkit-appearance: none; cursor: pointer; margin: 0; min-width: 0; min-height: 0; text-decoration: none; background-image: none; }
#sa24a-root button::before, #sa24a-root button::after { content: none; display: none; }
#sa24a-root button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
#sa24a-root button:focus-visible, #sa24a-root textarea:focus-visible, #sa24a-root a:focus-visible, #sa24a-root [tabindex]:focus-visible { outline: 3px solid var(--sa24a-accent); outline-offset: 3px; }
#sa24a-root svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
#sa24a-root.sa24a-left { right: auto; left: 22px; }
#sa24a-root .sa24a-launcher, #sa24a-root .sa24a-launcher:hover, #sa24a-root .sa24a-launcher:focus { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: var(--sa24a-ink); box-shadow: none; border-radius: 18px; transition: transform .18s ease; }
#sa24a-root .sa24a-launcher:hover { transform: translateY(-3px); }
#sa24a-root .sa24a-launcher-avatar { display: grid; place-items: center; width: 72px; height: 72px; border: 4px solid white; border-radius: 50%; overflow: hidden; background: var(--sa24a-accent); color: white; font-size: 28px; box-shadow: 0 8px 28px #10174430, 0 0 0 1px #1017440b; }
#sa24a-root .sa24a-launcher-avatar img, #sa24a-root .sa24a-head-avatar img { width: 100%; height: 100%; max-width: none; display: block; object-fit: cover; object-position: 50% 31%; border-radius: inherit; }
#sa24a-root .sa24a-launcher-name { padding: 4px 13px; border: 1px solid #1017440b; border-radius: 999px; background: white; color: var(--sa24a-ink); font-size: 12px; font-weight: 700; box-shadow: 0 4px 16px #10174418; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sa24a-root .sa24a-window { display: flex; flex-direction: column; width: 410px; height: 650px; max-width: calc(100vw - 30px); max-height: calc(100dvh - 40px); background: white; border: 1px solid #10174416; border-radius: 20px; box-shadow: 0 24px 80px #10174430, 0 3px 12px #1017440d; overflow: hidden; transform-origin: bottom right; }
#sa24a-root .sa24a-window.sa24a-expanded { width: 80vw; height: 80dvh; max-width: 1280px; max-height: calc(100dvh - 40px); }
#sa24a-root .sa24a-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 11px 12px 15px; border-top: 4px solid var(--sa24a-accent); border-bottom: 1px solid var(--sa24a-line); background: white; flex: 0 0 auto; }
#sa24a-root .sa24a-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
#sa24a-root .sa24a-head-avatar { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border: 2px solid white; border-radius: 50%; overflow: hidden; background: var(--sa24a-accent); color: white; box-shadow: 0 2px 9px #10174425; }
#sa24a-root .sa24a-identity > div { min-width: 0; }
#sa24a-root .sa24a-identity strong { display: block; font-size: 16px; line-height: 1.25; font-weight: 750; color: var(--sa24a-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sa24a-root .sa24a-identity small { display: block; color: var(--sa24a-muted); font-size: 11px; line-height: 1.5; margin-top: 2px; max-width: 165px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sa24a-root .sa24a-controls { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
#sa24a-root .sa24a-icon-button { display: inline-grid; place-items: center; width: 31px; height: 33px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: #f1f5f8; color: #53647c; box-shadow: none; transition: background .15s ease, color .15s ease; }
#sa24a-root .sa24a-icon-button:hover { border-color: #cddbe6; background: white; color: var(--sa24a-accent); }
#sa24a-root .sa24a-icon-button svg { width: 17px; height: 17px; }
#sa24a-root .sa24a-messages { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 18px 15px; background: linear-gradient(180deg, #f6f9fc, #f0f5f8); scrollbar-width: thin; scrollbar-color: #c7d4df transparent; overscroll-behavior: contain; }
#sa24a-root .sa24a-message { display: flex; margin: 0 0 13px; animation: sa24a-in .18s ease-out; }
#sa24a-root .sa24a-message-user { justify-content: flex-end; }
#sa24a-root .sa24a-message-content { max-width: 87%; min-width: 0; }
#sa24a-root .sa24a-message-user .sa24a-message-content { max-width: 84%; }
#sa24a-root .sa24a-bubble { padding: 11px 13px; border: 1px solid var(--sa24a-line); border-radius: 15px; border-top-left-radius: 5px; background: white; color: var(--sa24a-ink); box-shadow: 0 2px 6px #10174404; overflow-wrap: anywhere; word-break: normal; font-size: 14px; line-height: 1.55; }
#sa24a-root .sa24a-message-user .sa24a-bubble { border: 0; border-radius: 15px; border-top-right-radius: 5px; background: var(--sa24a-accent); color: white; white-space: pre-wrap; box-shadow: 0 4px 12px #008f981a; }
#sa24a-root .sa24a-bubble p { margin: 0 0 9px; font: inherit; color: inherit; line-height: inherit; }
#sa24a-root .sa24a-bubble > :last-child { margin-bottom: 0; }
#sa24a-root .sa24a-bubble .sa24a-message-heading { font-weight: 700; margin-top: 12px; }
#sa24a-root .sa24a-bubble > .sa24a-message-heading:first-child { margin-top: 0; }
#sa24a-root .sa24a-bubble ul, #sa24a-root .sa24a-bubble ol { margin: 8px 0 10px; padding-left: 21px; }
#sa24a-root .sa24a-bubble li { margin: 4px 0; }
#sa24a-root .sa24a-bubble a { color: #007a84; text-decoration: underline; text-underline-offset: 2px; }
#sa24a-root .sa24a-bubble code { padding: 1px 4px; border-radius: 4px; background: #eef3f7; color: #344661; font-size: .93em; white-space: pre-wrap; }
#sa24a-root .sa24a-table-scroll { max-width: 100%; overflow-x: auto; margin: 10px 0; border: 1px solid var(--sa24a-line); border-radius: 8px; scrollbar-width: thin; overscroll-behavior-x: contain; }
#sa24a-root .sa24a-table-scroll table { width: 100%; margin: 0; border: 0; border-collapse: collapse; font: inherit; font-size: 12px; line-height: 1.45; color: inherit; }
#sa24a-root .sa24a-table-scroll th, #sa24a-root .sa24a-table-scroll td { min-width: 95px; padding: 8px 10px; border: 0; border-right: 1px solid var(--sa24a-line); border-bottom: 1px solid var(--sa24a-line); text-align: left; vertical-align: top; }
#sa24a-root .sa24a-table-scroll th { background: #edf3f7; color: #344661; font-weight: 700; }
#sa24a-root .sa24a-table-scroll tr:nth-child(even) td { background: #f7fafc; }
#sa24a-root .sa24a-table-scroll tr:last-child td { border-bottom: 0; }
#sa24a-root .sa24a-table-scroll th:last-child, #sa24a-root .sa24a-table-scroll td:last-child { border-right: 0; }
#sa24a-root .sa24a-copy { display: grid; place-items: center; width: 25px; height: 25px; padding: 0; margin-top: 3px; border: 0; border-radius: 5px; background: transparent; color: #7e8da2; box-shadow: none; }
#sa24a-root .sa24a-copy svg { width: 13px; height: 13px; }
#sa24a-root .sa24a-copy:hover { background: #e3edf3; color: var(--sa24a-accent); }
#sa24a-root .sa24a-action-list { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
#sa24a-root .sa24a-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid #b9d7dc; border-radius: 10px; background: white; color: #007a84; box-shadow: 0 2px 6px #10174404; text-align: left; text-decoration: none; font-size: 13px; font-weight: 650; line-height: 1.4; }
#sa24a-root .sa24a-action:hover { background: #e9f6f6; border-color: var(--sa24a-accent); color: #006e77; }
#sa24a-root .sa24a-action svg { width: 16px; height: 16px; }
#sa24a-root .sa24a-typing { flex: 0 0 auto; padding: 9px 15px; border-top: 1px solid var(--sa24a-line); background: white; font-size: 12px; color: var(--sa24a-muted); }
#sa24a-root .sa24a-typing::after { content: '•••'; display: inline-block; margin-left: 7px; letter-spacing: 3px; color: var(--sa24a-accent); animation: sa24a-pulse 1.1s ease-in-out infinite; }
#sa24a-root .sa24a-status { flex: 0 0 auto; padding: 9px 13px; border-top: 1px solid #d5e8e8; background: #edf8f7; color: #336f73; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
#sa24a-root .sa24a-status.sa24a-error { border-color: #f0d8ce; background: #fff4ee; color: #91482d; }
#sa24a-root .sa24a-reconnect { display: block; align-self: flex-start; flex: 0 0 auto; margin: 9px 13px; padding: 8px 12px; border: 1px solid var(--sa24a-accent); border-radius: 8px; background: white; color: #007a84; box-shadow: none; font-size: 12px; font-weight: 650; }
#sa24a-root .sa24a-compose { display: flex; align-items: flex-end; gap: 7px; margin: 0; padding: 11px 12px 10px; border-top: 1px solid var(--sa24a-line); background: white; flex: 0 0 auto; }
#sa24a-root .sa24a-input { display: block; width: 100%; flex: 1 1 auto; min-width: 0; min-height: 44px; max-height: 130px; padding: 11px 12px; margin: 0; border: 1px solid #d4dfe8; border-radius: 12px; background: #f8fafc; color: var(--sa24a-ink); box-shadow: none; font: inherit; font-size: 13px; line-height: 1.5; resize: none; transition: border-color .15s, background .15s; }
#sa24a-root .sa24a-input::placeholder { color: #8b98ac; opacity: 1; }
#sa24a-root .sa24a-input:focus { border-color: var(--sa24a-accent); background: white; outline: 2px solid #008f9825; outline-offset: 0; }
#sa24a-root .sa24a-input:disabled { opacity: .65; }
#sa24a-root .sa24a-mic, #sa24a-root .sa24a-send { display: grid; place-items: center; width: 42px; height: 44px; flex: 0 0 42px; padding: 0; border: 0; border-radius: 11px; background: var(--sa24a-accent); color: white; box-shadow: 0 4px 12px #008f981a; }
#sa24a-root .sa24a-mic { background: #edf4f7; color: #48647b; box-shadow: none; }
#sa24a-root .sa24a-send:hover { filter: brightness(.94); }
#sa24a-root .sa24a-mic:hover { background: #dceef0; color: #007a84; }
#sa24a-root .sa24a-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 13px 10px; background: white; color: #8995a8; font-size: 10px; line-height: 1.4; flex: 0 0 auto; }
#sa24a-root .sa24a-counter { white-space: nowrap; }
#sa24a-root .sa24a-recording { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-top: 1px solid #eccfc7; background: #fff5f1; color: #a34732; font-size: 12px; flex: 0 0 auto; }
#sa24a-root .sa24a-recording > span { flex: 1; }
#sa24a-root .sa24a-recording > span::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #c7533d; animation: sa24a-pulse .9s infinite; }
#sa24a-root .sa24a-recording b { font-variant-numeric: tabular-nums; font-size: 12px; }
#sa24a-root .sa24a-recording .sa24a-icon-button { color: #a34732; background: #ffe8dd; }
@keyframes sa24a-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes sa24a-pulse { 50% { opacity: .35; } }
@media (max-width: 640px) {
    #sa24a-root { right: 0; bottom: 0; }
    #sa24a-root.sa24a-left { left: 0; }
    #sa24a-root .sa24a-launcher { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
    #sa24a-root.sa24a-left .sa24a-launcher { right: auto; left: 14px; }
    #sa24a-root .sa24a-launcher-avatar { width: 66px; height: 66px; }
    #sa24a-root .sa24a-window, #sa24a-root .sa24a-window.sa24a-expanded { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; border: 0; }
    #sa24a-root .sa24a-header { padding-top: max(12px, env(safe-area-inset-top)); padding-left: 12px; }
    #sa24a-root .sa24a-identity small { max-width: 140px; }
    #sa24a-root .sa24a-controls { gap: 2px; }
    #sa24a-root .sa24a-icon-button { width: 30px; height: 34px; }
    #sa24a-root .sa24a-message-content { max-width: 91%; }
    #sa24a-root .sa24a-footer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    #sa24a-root .sa24a-input { font-size: 16px; }
}
@media (max-width: 360px) {
    #sa24a-root .sa24a-head-avatar { width: 36px; height: 36px; flex-basis: 36px; }
    #sa24a-root .sa24a-identity { gap: 7px; }
    #sa24a-root .sa24a-identity small { max-width: 115px; font-size: 10px; }
    #sa24a-root .sa24a-icon-button { width: 27px; }
    #sa24a-root .sa24a-compose { gap: 5px; padding-inline: 9px; }
    #sa24a-root .sa24a-mic, #sa24a-root .sa24a-send { width: 38px; flex-basis: 38px; }
}
@media (prefers-reduced-motion: reduce) {
    #sa24a-root *, #sa24a-root *::after, #sa24a-root *::before { animation: none !important; transition: none !important; }
}
