.ai-chat-widget {
    --ai-chat-brand: var(--ssd-blue, #0e5cf7);
    --ai-chat-brand-dark: #0646c6;
    --ai-chat-navy: #111c34;
    --ai-chat-text: #25314a;
    --ai-chat-muted: #748096;
    --ai-chat-line: #e6eaf1;
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 89;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
}
.ai-chat-widget[hidden] { display: none !important; }
.ai-chat-widget *, .ai-chat-widget *::before, .ai-chat-widget *::after { box-sizing: border-box; }
.ai-chat-widget button, .ai-chat-widget textarea { font: inherit; }
.ai-chat-widget svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ai-chat-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; }

.ai-chat-launcher { position: relative; display: grid; place-items: center; width: 58px; height: 58px; margin-left: auto; padding: 0; border: 0; border-radius: 19px; color: #fff; background: linear-gradient(145deg, var(--ai-chat-brand), var(--ai-chat-brand-dark)); box-shadow: 0 14px 32px rgba(9, 49, 108, .25), 0 4px 10px rgba(9, 25, 55, .14); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.ai-chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(9, 49, 108, .3); }
.ai-chat-launcher:focus-visible { outline: 3px solid rgba(14, 92, 247, .2); outline-offset: 3px; }
.ai-chat-launcher span { display: grid; place-items: center; transition: opacity .18s ease, transform .18s ease; }
.ai-chat-launcher__close { position: absolute; opacity: 0; transform: rotate(-55deg) scale(.75); }
.ai-chat-widget.is-open .ai-chat-launcher__open { opacity: 0; transform: rotate(55deg) scale(.75); }
.ai-chat-widget.is-open .ai-chat-launcher__close { opacity: 1; transform: rotate(0) scale(1); }
.ai-chat-launcher b { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 2px solid #fff; border-radius: 99px; color: #fff; background: #0d66d7; font-size: 10px; }
.ai-chat-launcher b[hidden] { display: none; }

.ai-chat-panel { position: absolute; right: 0; bottom: 72px; display: flex; flex-direction: column; width: min(390px, calc(100vw - 28px)); height: min(650px, calc(100vh - 115px)); height: min(650px, calc(100dvh - 115px)); overflow: hidden; visibility: hidden; opacity: 0; transform: translateY(18px) scale(.97); transform-origin: bottom right; border: 1px solid rgba(214, 220, 231, .92); border-radius: 22px; background: #fff; box-shadow: 0 28px 75px rgba(9, 25, 55, .22), 0 8px 24px rgba(9, 25, 55, .1); pointer-events: none; transition: visibility .22s, opacity .22s ease, transform .22s ease; }
.ai-chat-widget.is-open .ai-chat-panel { visibility: visible; opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.ai-chat-panel__header { position: relative; display: flex; align-items: center; gap: 11px; min-height: 76px; padding: 13px 14px; color: #fff; background: linear-gradient(125deg, var(--ai-chat-brand-dark), var(--ai-chat-brand)); }
.ai-chat-panel__header::after { content: ''; position: absolute; inset: 0; opacity: .11; background: radial-gradient(circle at 80% 0, #fff 0 2px, transparent 3px) 0 0/20px 20px; pointer-events: none; }
.ai-chat-panel__avatar { position: relative; z-index: 1; display: grid; place-items: center; width: 45px; height: 45px; flex: 0 0 45px; border: 1px solid rgba(255,255,255,.3); border-radius: 15px; background: rgba(255,255,255,.16); box-shadow: inset 0 1px rgba(255,255,255,.18); }
.ai-chat-panel__avatar svg { width: 27px; height: 27px; }
.ai-chat-panel__avatar i { position: absolute; right: -2px; bottom: 1px; width: 11px; height: 11px; border: 2px solid var(--ai-chat-brand-dark); border-radius: 50%; background: #36d98b; }
.ai-chat-panel__header > div:nth-child(2) { position: relative; z-index: 1; display: grid; min-width: 0; flex: 1; gap: 3px; }
.ai-chat-panel__header strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.ai-chat-panel__header span { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.82); font-size: 11px; }
.ai-chat-panel__header span i { width: 7px; height: 7px; border-radius: 50%; background: #42e19a; box-shadow: 0 0 0 3px rgba(66,225,154,.14); }
.ai-chat-panel__header span i.is-offline { background: #f6bd4b; box-shadow: 0 0 0 3px rgba(246,189,75,.15); }
.ai-chat-panel__header em { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.ai-chat-panel__header > button { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 0; border-radius: 10px; color: #fff; background: rgba(255,255,255,.12); cursor: pointer; }
.ai-chat-panel__header > button:hover { background: rgba(255,255,255,.2); }
.ai-chat-panel__header > button svg { width: 19px; height: 19px; }

.ai-chat-messages { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 18px 13px 10px; scroll-behavior: smooth; overscroll-behavior: contain; background: linear-gradient(180deg, #f8f9fc, #fff 30%); scrollbar-width: thin; scrollbar-color: #cfd5df transparent; }
.ai-chat-message-row { display: flex; margin-bottom: 13px; animation: ai-chat-rise .2s ease; }
.ai-chat-message-row.is-visitor { justify-content: flex-end; }
.ai-chat-message { max-width: 86%; }
.ai-chat-message__bubble { padding: 10px 12px; border: 1px solid #e9ecf2; border-radius: 14px 14px 14px 5px; color: var(--ai-chat-text); background: #fff; box-shadow: 0 3px 11px rgba(25, 39, 68, .045); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-chat-message-row.is-visitor .ai-chat-message__bubble { border: 0; border-radius: 14px 14px 5px 14px; color: #fff; background: linear-gradient(145deg, var(--ai-chat-brand), var(--ai-chat-brand-dark)); box-shadow: 0 5px 13px rgba(9, 49, 108, .15); }
.ai-chat-message-row.is-admin .ai-chat-message__bubble { border-color: #d5e9ff; color: #173760; background: #edf7ff; }
.ai-chat-message__meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 0 3px; color: #9aa3b2; font-size: 9px; }
.ai-chat-message-row.is-visitor .ai-chat-message__meta { justify-content: flex-end; }
.ai-chat-feedback { display: inline-flex; gap: 2px; margin-left: auto; }
.ai-chat-feedback button { display: grid; place-items: center; width: 21px; height: 21px; padding: 0; border: 0; border-radius: 6px; color: #8791a3; background: transparent; font-size: 11px; cursor: pointer; }
.ai-chat-feedback button:hover, .ai-chat-feedback button.is-active { color: var(--ai-chat-brand); background: #f3f7ff; }

.ai-chat-products { display: grid; gap: 7px; margin-top: 8px; }
.ai-chat-product { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; padding: 10px; border: 1px solid #e3e8f1; border-radius: 12px; color: inherit; background: #fff; text-decoration: none; transition: border-color .16s ease, transform .16s ease; }
.ai-chat-product:hover { border-color: var(--ai-chat-brand); transform: translateY(-1px); }
.ai-chat-product strong { color: var(--ai-chat-navy); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.ai-chat-product b { align-self: center; grid-row: span 2; color: var(--ai-chat-brand); font-size: 12px; }
.ai-chat-product span { overflow: hidden; color: var(--ai-chat-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ai-chat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-chat-actions a { padding: 7px 10px; border: 1px solid #d9e1ec; border-radius: 8px; color: #153b70; background: #f5f9ff; font-size: 11px; font-weight: 750; text-decoration: none; }
.ai-chat-reservation { margin-top: 8px; padding: 8px 10px; border-radius: 9px; color: #087149; background: #eafaf3; font-size: 11px; font-weight: 700; }
.ai-chat-suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ai-chat-suggestions button { padding: 6px 9px; border: 1px solid #cfd9e8; border-radius: 99px; color: var(--ai-chat-brand-dark); background: #f8faff; font-size: 10px; font-weight: 750; cursor: pointer; }
.ai-chat-suggestions button:hover { color: #fff; border-color: var(--ai-chat-brand); background: var(--ai-chat-brand); }

.ai-chat-typing { align-items: center; gap: 4px; padding: 7px 16px 9px; color: #7f8999; background: #fff; font-size: 10px; }
.ai-chat-typing:not([hidden]) { display: flex; }
.ai-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #a7afbc; animation: ai-chat-dot 1.1s infinite ease-in-out; }
.ai-chat-typing span:nth-child(2) { animation-delay: .13s; }
.ai-chat-typing span:nth-child(3) { animation-delay: .26s; }
.ai-chat-typing em { margin-left: 4px; font-style: normal; }
.ai-chat-quick-replies { display: flex; gap: 6px; overflow-x: auto; padding: 7px 12px 9px; border-top: 1px solid #f0f2f6; background: #fff; scrollbar-width: none; }
.ai-chat-quick-replies:empty { display: none; }
.ai-chat-quick-replies::-webkit-scrollbar { display: none; }
.ai-chat-quick-replies button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #cfd9e8; border-radius: 99px; color: var(--ai-chat-brand-dark); background: #f8faff; font-size: 10px; font-weight: 700; cursor: pointer; }
.ai-chat-quick-replies button:hover { color: #fff; border-color: var(--ai-chat-brand); background: var(--ai-chat-brand); }

.ai-chat-composer { display: grid; grid-template-columns: minmax(0,1fr) 42px; align-items: end; gap: 8px; padding: 10px 11px 8px; border-top: 1px solid var(--ai-chat-line); background: #fff; }
.ai-chat-composer label { display: block; }
.ai-chat-composer textarea { display: block; width: 100%; height: 42px; max-height: 105px; padding: 10px 12px; resize: none; border: 1px solid #dfe4ec; border-radius: 13px; outline: none; color: var(--ai-chat-text); background: #f8f9fb; font-size: 13px; line-height: 20px; transition: border-color .15s, box-shadow .15s; }
.ai-chat-composer textarea:focus { border-color: var(--ai-chat-brand); box-shadow: 0 0 0 3px rgba(14,92,247,.08); background: #fff; }
.ai-chat-composer button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(145deg, var(--ai-chat-brand), var(--ai-chat-brand-dark)); cursor: pointer; }
.ai-chat-composer button:disabled { opacity: .55; cursor: wait; }
.ai-chat-composer button svg { width: 20px; height: 20px; }
.ai-chat-panel > footer { padding: 0 12px 7px; color: #9ca5b3; background: #fff; font-size: 9px; text-align: center; }

.ai-chat-invite { position: absolute; right: 0; bottom: 72px; width: 270px; padding: 13px 32px 13px 14px; border: 1px solid #e6e9ef; border-radius: 14px; color: var(--ai-chat-text); background: #fff; box-shadow: 0 14px 36px rgba(15,30,60,.16); animation: ai-chat-rise .25s ease; cursor: pointer; }
.ai-chat-invite strong, .ai-chat-invite span { display: block; }
.ai-chat-invite strong { margin-bottom: 3px; color: var(--ai-chat-navy); font-size: 13px; }
.ai-chat-invite span { color: var(--ai-chat-muted); font-size: 11px; }
.ai-chat-invite button { position: absolute; top: 5px; right: 6px; border: 0; color: #7d8798; background: transparent; font-size: 18px; cursor: pointer; }

@keyframes ai-chat-rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ai-chat-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

@media (max-width: 640px) {
    .ai-chat-widget { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
    .ai-chat-launcher { width: 52px; height: 52px; border-radius: 17px; }
    .ai-chat-widget.is-open .ai-chat-launcher { visibility: hidden; opacity: 0; transform: translateY(8px) scale(.9); pointer-events: none; }
    .ai-chat-panel { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 10px; width: auto; height: auto; max-height: none; border-radius: 19px; }
    .ai-chat-panel__header { min-height: 68px; padding: 10px 12px; }
    .ai-chat-panel__avatar { width: 41px; height: 41px; flex-basis: 41px; border-radius: 13px; }
    .ai-chat-message { max-width: 89%; }
    .ai-chat-invite { bottom: 64px; width: min(270px, calc(100vw - 28px)); }
    body:has(.ai-chat-widget.is-open) { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-chat-widget *, .ai-chat-widget *::before, .ai-chat-widget *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
