:root { --unit-assistant-launch-width: 196px; }
.unit-assistant { --assistant-ink: var(--ink, #102d4b); --assistant-muted: #53687d; --assistant-ease: var(--unit-ease, cubic-bezier(.22,1,.36,1)); position: fixed; right: max(24px,env(safe-area-inset-right)); bottom: max(24px,env(safe-area-inset-bottom)); z-index: 45; color: var(--assistant-ink); font: 14px/1.55 Unit,Arial,sans-serif; }
.unit-assistant [hidden] { display: none !important; }
.assistant-launch { position: relative; display: inline-flex; align-items: center; gap: 10px; width: var(--unit-assistant-launch-width); min-height: 64px; padding: 8px 13px 8px 8px; border: 1px solid #ccd9e7; border-radius: 19px 19px 19px 7px; color: var(--assistant-ink); background: #fff; box-shadow: 0 8px 24px #102d4b1f,0 2px 5px #102d4b0d; text-align: left; transition: background 120ms var(--assistant-ease),border-color 120ms var(--assistant-ease),box-shadow 120ms var(--assistant-ease); }
.assistant-launch::before { content: ""; position: absolute; inset: 4px; border: 1px dashed #dce4ed; border-radius: 14px 14px 14px 3px; pointer-events: none; }
.assistant-launch > span { position: relative; }
.assistant-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px 12px 12px 4px; color: #fff; background: var(--assistant-ink); transition: background 120ms var(--assistant-ease); }
.assistant-mark svg { display: block; width: 38px; height: 38px; }
.assistant-mark-thread { color: #9cbce6; }
.assistant-launch-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.assistant-launch-name { font-size: 15px; line-height: 1.35; font-weight: 600; white-space: nowrap; }
.assistant-launch-name b { font-weight: 800; letter-spacing: -.04em; }
.assistant-launch-caption { color: var(--assistant-muted); font-size: 10px; line-height: 1.5; font-weight: 400; white-space: nowrap; }
.assistant-caption-open { display: none; }
.assistant-launch-action { display: grid; place-items: center; flex: none; width: 17px; height: 20px; color: var(--assistant-muted); }
.assistant-launch-action svg { position: absolute; width: 17px; height: 17px; transition: opacity 120ms var(--assistant-ease); }
.assistant-launch-close { opacity: 0; }
.assistant-launch[aria-expanded="true"] { background: var(--paper, #f7f9fc); border-color: var(--blue, #195dc1); }
.assistant-launch[aria-expanded="true"] .assistant-caption-idle { display: none; }
.assistant-launch[aria-expanded="true"] .assistant-caption-open { display: inline; }
.assistant-launch[aria-expanded="true"] .assistant-launch-arrow { opacity: 0; }
.assistant-launch[aria-expanded="true"] .assistant-launch-close { opacity: 1; }
.assistant-launch:active { background: #eaf1f9; box-shadow: 0 2px 8px #102d4b20; }
.assistant-unread { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border: 3px solid #fff; border-radius: 50%; background: var(--blue, #195dc1); }
.assistant-panel { position: absolute; bottom: 78px; right: 0; display: flex; flex-direction: column; width: 380px; height: min(630px,calc(100dvh - 128px)); min-height: 280px; overflow: hidden; border: 1px solid #dae4ee; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px #102e4b30,0 2px 8px #102e4b0d; }
.assistant-header { display: flex; align-items: center; gap: 10px; flex: none; padding: 16px 12px 16px 18px; background: #f0f5fc; border-bottom: 1px solid #dfe7f1; }
.assistant-avatar { width: 40px; height: 40px; }
.assistant-avatar svg { width: 34px; height: 34px; }
.assistant-header > div { flex: 1; min-width: 0; }
.assistant-header h2 { margin: 0 0 3px; font-size: 17px; font-weight: 700; letter-spacing: -.025em; line-height: 1.3; }
.assistant-header p { margin: 0; color: var(--assistant-muted); font-size: 10px; line-height: 1.45; }
.assistant-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--assistant-muted); }
.assistant-icon:hover { background: #e0eaf7; color: var(--assistant-ink); }
.assistant-icon svg,.assistant-send svg { width: 20px; height: 20px; }
.assistant-messages { display: flex; flex-direction: column; align-items: stretch; gap: 14px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px; scrollbar-width: thin; background: #fff; }
.assistant-message { max-width: 100%; flex: none; }
.assistant-message p { margin: 0; padding: 12px 14px; border-radius: 15px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-speaker { display: block; margin: 0 0 5px 3px; color: var(--assistant-muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.assistant-message-bot > p { background: #f0f4f9; border: 1px solid #e6ecf3; border-top-left-radius: 4px; }
.assistant-message-user { align-self: flex-end; max-width: 88%; }
.assistant-message-user > p { background: var(--assistant-ink); color: #fff; border-bottom-right-radius: 4px; }
.assistant-message-user .assistant-speaker { text-align: right; margin-right: 3px; }
.assistant-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.assistant-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 12px; border: 1px solid #cbd9e9; border-radius: 10px; background: #fff; color: #174f8e; font-size: 12px; font-weight: 700; line-height: 1.4; }
.assistant-links a:hover { background: #edf4fc; }
.assistant-products { display: grid; gap: 9px; margin-top: 10px; }
.assistant-product { min-width: 0; border: 1px solid #dce5ef; border-radius: 12px; overflow: hidden; background: #fff; }
.assistant-product > a { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 12px; padding: 11px; align-items: center; }
.assistant-product img { width: 58px; height: 72px; object-fit: contain; border-radius: 6px; background: #f3f6fa; }
.assistant-product h3 { margin: 0 0 4px; font-size: 12px; line-height: 1.5; letter-spacing: 0; overflow-wrap: anywhere; }
.assistant-product small { color: var(--assistant-muted); font-size: 10px; line-height: 1.5; }
.assistant-product strong { display: block; margin-top: 4px; font-size: 13px; }
.assistant-product > button { display: block; width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-top: 1px solid #e5ecf4; background: #f7faff; color: #174f8e; font-size: 12px; font-weight: 700; }
.assistant-product > button:hover { background: #eaf2fc; }
.assistant-prompts { display: flex; gap: 6px; flex: none; overflow-x: auto; padding: 11px 14px; border-top: 1px solid #edf1f6; scrollbar-width: thin; }
.assistant-prompts button { min-height: 44px; flex: none; padding: 8px 11px; border: 1px solid #d7e2ef; border-radius: 999px; background: #fff; color: #174f8e; font-size: 11px; font-weight: 700; }
.assistant-prompts button:hover { background: #edf4fc; }
.assistant-context { display: flex; align-items: center; gap: 8px; margin: 0 14px 8px; padding-left: 10px; border-radius: 8px; background: #edf4fc; color: #174f8e; font-size: 11px; }
.assistant-context > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-context > button { min-width: 44px; min-height: 44px; padding: 4px 10px; border: 0; border-radius: 8px; background: transparent; color: #174f8e; font-size: 20px; }
.assistant-composer { display: flex; align-items: flex-end; gap: 8px; flex: none; margin: 0 14px; padding: 5px; border: 1px solid #cbd8e7; border-radius: 14px; background: #fff; }
.assistant-composer:focus-within { border-color: #195dc1; box-shadow: 0 0 0 3px #195dc114; }
.assistant-composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 100px; margin: 0; padding: 11px 9px; border: 0; border-radius: 9px; resize: none; background: transparent; color: var(--assistant-ink); font-size: 14px; line-height: 1.5; }
.assistant-composer textarea:focus { outline: none; box-shadow: none; }
.assistant-send { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: var(--assistant-ink); color: #fff; }
.assistant-send:hover { background: #174f8e; }
.assistant-status { flex: none; margin: 0; padding: 0 18px; color: #8b3d35; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.assistant-status:not(:empty) { margin-top: 7px; }
.assistant-footnote { flex: none; margin: 8px 0 11px; color: var(--assistant-muted); font-size: 10px; text-align: center; }
.assistant-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.unit-assistant :is(a,button):focus-visible { outline: 3px solid #195dc1; outline-offset: 2px; }
@media(max-width:600px) {
    :root { --unit-assistant-launch-width: 176px; }
    .unit-assistant { right: max(14px,env(safe-area-inset-right)); bottom: max(16px,env(safe-area-inset-bottom)); }
    .assistant-launch { min-height: 60px; gap: 8px; padding-right: 11px; }
    .assistant-launch > .assistant-mark { width: 40px; height: 40px; }
    .assistant-launch > .assistant-mark svg { width: 35px; height: 35px; }
    .assistant-panel { position: fixed; left: 10px; right: 10px; bottom: calc(max(16px,env(safe-area-inset-bottom)) + 74px); width: auto; height: min(620px,calc(100dvh - 110px)); border-radius: 18px; }
    .assistant-header { padding-left: 14px; gap: 8px; }
    .assistant-header p { font-size: 9px; }
    .assistant-messages { padding: 14px 12px; }
    .assistant-composer textarea { font-size: 16px; }
}
@media(prefers-reduced-motion:no-preference) {
    .assistant-panel:not([hidden]) { animation: assistant-enter 280ms var(--assistant-ease); }
    .unit-assistant.is-introducing .assistant-launch { animation: assistant-enter 280ms var(--assistant-ease) both; }
    .unit-assistant.is-introducing .assistant-launch .assistant-mark-thread { animation: assistant-thread 600ms var(--assistant-ease) 200ms both; }
    .assistant-launch .assistant-mark { transition: transform 120ms var(--assistant-ease),background 120ms var(--assistant-ease); }
    .assistant-launch-action svg { transition: transform 120ms var(--assistant-ease),opacity 120ms var(--assistant-ease); }
    .assistant-launch-close { transform: rotate(-45deg) scale(.8); }
    .assistant-launch[aria-expanded="true"] .assistant-launch-arrow { transform: rotate(45deg) scale(.8); }
    .assistant-launch[aria-expanded="true"] .assistant-launch-close { transform: none; }
    .assistant-unread:not([hidden]) { animation: assistant-notify 600ms var(--assistant-ease) 2; }
    @keyframes assistant-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
    @keyframes assistant-thread { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
    @keyframes assistant-notify { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }
}
@media(hover:hover) and (pointer:fine) {
    .assistant-launch:hover { background: #f5f8fc; border-color: #94b1d1; box-shadow: 0 10px 28px #102d4b29,0 2px 6px #102d4b14; }
    .assistant-launch:hover .assistant-mark { background: var(--blue, #195dc1); }
}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
    .assistant-launch:hover .assistant-mark { transform: translateY(-1px) rotate(-5deg); }
    .assistant-launch:hover .assistant-launch-arrow { transform: translate(1px,-1px); }
    .assistant-launch[aria-expanded="true"]:hover .assistant-launch-arrow { transform: rotate(45deg) scale(.8); }
}
@media(max-height:540px) {
    .assistant-panel { position: fixed; top: 10px; bottom: 10px; right: 12px; left: auto; width: min(380px,calc(100vw - 24px)); height: auto; min-height: 0; }
    .unit-assistant.has-styling-chat .assistant-panel { bottom: max(88px,calc(env(safe-area-inset-bottom) + 78px)); }
    .assistant-prompts,.assistant-footnote,.assistant-header p { display: none; }
    .assistant-header { padding-top: 10px; padding-bottom: 10px; }
}
@media(prefers-reduced-motion:reduce) { .unit-assistant *, .unit-assistant *::before, .unit-assistant *::after { animation: none !important; transition: none !important; } }
@media print { .unit-assistant { display: none !important; } }
