:root {
    --ai-green: #087f76;
    --ai-green-bright: #20b7a9;
    --ai-chat-bg: #efeae2;
}

.ai-chat-launcher {
    position: fixed;
    z-index: 1082;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, var(--ai-green-bright), var(--ai-green));
    box-shadow: 0 12px 34px rgba(5, 73, 69, .34);
    transition: transform .2s ease, box-shadow .2s ease;
}

.ai-chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(5, 73, 69, .42); }
.ai-chat-launcher i { font-size: 1.55rem; }
.ai-chat-launcher__dismiss { display: none; }
.ai-chat-launcher__pulse { position:absolute; inset:-5px; border:2px solid rgba(32,183,169,.35); border-radius:50%; animation: aiPulse 2.2s infinite; }
.ai-chat-launcher__badge { position:absolute; top:-3px; right:-2px; width:21px; height:21px; display:grid; place-items:center; border:2px solid #fff; border-radius:50%; background:#ef4444; color:#fff; font:700 11px/1 "DM Sans",sans-serif; }
.ai-chat-launcher__label { display:none; }
.ai-chat-launcher.is-open .ai-chat-launcher__open,
.ai-chat-launcher.is-open .ai-chat-launcher__badge,
.ai-chat-launcher.is-open .ai-chat-launcher__pulse { display:none; }
.ai-chat-launcher.is-open .ai-chat-launcher__dismiss { display:block; }

@keyframes aiPulse { 0%{transform:scale(.9);opacity:1} 70%,100%{transform:scale(1.22);opacity:0} }

.ai-chat {
    position: fixed;
    z-index: 1081;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.ai-chat.is-open { visibility:visible; opacity:1; pointer-events:auto; }
.ai-chat__panel {
    position:absolute;
    inset:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    background:var(--ai-chat-bg);
    font-family:"DM Sans",sans-serif;
}
.ai-chat__header {
    min-height:74px;
    padding:calc(11px + env(safe-area-inset-top)) 14px 11px;
    display:flex;
    align-items:center;
    gap:11px;
    color:#fff;
    background:linear-gradient(120deg,#064e49,var(--ai-green));
}
.ai-chat__avatar { width:43px; height:43px; flex:0 0 auto; display:grid; place-items:center; border-radius:50%; background:#fff; color:var(--ai-green); font-weight:800; font-size:.82rem; box-shadow:inset 0 0 0 2px rgba(255,255,255,.25); }
.ai-chat__identity { display:flex; flex-direction:column; min-width:0; }
.ai-chat__identity strong { color:#fff; font-size:1rem; line-height:1.3; }
.ai-chat__identity span { color:rgba(255,255,255,.78); font-size:.72rem; }
.ai-chat__identity span i { display:inline-block; width:7px; height:7px; margin-right:4px; border-radius:50%; background:#6ee7b7; }
.ai-chat__close { margin-left:auto; width:38px; height:38px; border:0; border-radius:50%; color:#fff; background:transparent; font-size:1.05rem; }
.ai-chat__close:hover { background:rgba(255,255,255,.12); }
.ai-chat__body {
    flex:1;
    min-height:0;
    padding:18px 14px 12px;
    overflow-y:auto;
    overscroll-behavior:contain;
    background-color:var(--ai-chat-bg);
    background-image:radial-gradient(rgba(8,127,118,.055) 1px,transparent 1px);
    background-size:15px 15px;
}
.ai-chat__day { width:max-content; margin:0 auto 16px; padding:5px 11px; border-radius:7px; color:#667781; background:#fff; box-shadow:0 1px 1px rgba(0,0,0,.08); font-size:.7rem; text-transform:uppercase; letter-spacing:.04em; }
.ai-message { position:relative; width:fit-content; max-width:88%; margin:0 0 8px; padding:9px 12px 18px; border-radius:4px 12px 12px 12px; color:#17212b; background:#fff; box-shadow:0 1px 2px rgba(15,23,42,.1); font-size:.87rem; line-height:1.48; white-space:pre-line; }
.ai-message--user { margin-left:auto; padding-right:13px; border-radius:12px 4px 12px 12px; background:#d9fdd3; }
.ai-message time { position:absolute; right:7px; bottom:4px; color:#8696a0; font-size:.59rem; }
.ai-message--status { color:#667781; font-style:italic; }
.ai-chat__quick { display:flex; flex-wrap:wrap; gap:7px; margin:10px 0 14px; }
.ai-chat__quick button { padding:8px 11px; border:1px solid rgba(8,127,118,.24); border-radius:999px; color:#06736b; background:rgba(255,255,255,.94); font:600 .74rem/1.2 "DM Sans",sans-serif; }
.ai-chat__quick button:hover { color:#fff; background:var(--ai-green); }
.ai-booking { width:100%; max-width:390px; padding:13px; border-radius:12px; background:#fff; box-shadow:0 2px 9px rgba(15,23,42,.12); }
.ai-booking h3 { margin:0 0 3px; font:700 1rem/1.3 "DM Sans",sans-serif; color:#17212b; }
.ai-booking p { margin:0 0 11px; color:#667781; font-size:.72rem; }
.ai-booking label { display:block; margin:8px 0 3px; color:#334155; font-size:.68rem; font-weight:700; }
.ai-booking input,.ai-booking select,.ai-booking textarea { width:100%; min-height:39px; padding:8px 10px; border:1px solid #d9e0e3; border-radius:8px; outline:0; background:#fff; font:400 .78rem "DM Sans",sans-serif; }
.ai-booking textarea { min-height:62px; resize:vertical; }
.ai-booking input:focus,.ai-booking select:focus,.ai-booking textarea:focus { border-color:var(--ai-green-bright); box-shadow:0 0 0 3px rgba(32,183,169,.12); }
.ai-booking__grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ai-booking button { width:100%; margin-top:11px; padding:10px; border:0; border-radius:9px; color:#fff; background:var(--ai-green); font:700 .8rem "DM Sans",sans-serif; }
.ai-booking button:disabled { opacity:.65; }
.ai-chat__composer { display:flex; align-items:flex-end; gap:8px; padding:9px 10px; background:#f0f2f5; }
.ai-chat__composer textarea { flex:1; max-height:110px; padding:11px 14px; border:0; border-radius:20px; outline:0; resize:none; background:#fff; font:400 .86rem/1.35 "DM Sans",sans-serif; box-shadow:0 1px 2px rgba(0,0,0,.06); }
.ai-chat__composer button { width:42px; height:42px; flex:0 0 auto; border:0; border-radius:50%; display:grid; place-items:center; color:#fff; background:var(--ai-green); font-size:1rem; }
.ai-chat__composer button:disabled { opacity:.6; }
.ai-chat__privacy { padding:3px 10px calc(5px + env(safe-area-inset-bottom)); text-align:center; color:#7a8991; background:#f0f2f5; font-size:.57rem; }

@media (min-width: 576px) {
    .ai-chat { inset:auto; right:22px; bottom:94px; width:390px; height:min(650px,calc(100vh - 120px)); }
    .ai-chat__panel { border-radius:18px; box-shadow:0 22px 65px rgba(15,23,42,.28); transform:translateY(12px) scale(.97); transition:transform .22s ease; }
    .ai-chat.is-open .ai-chat__panel { transform:none; }
    .ai-chat-launcher { right:24px; bottom:24px; }
    .ai-chat-launcher__label { position:absolute; display:block; right:70px; width:max-content; padding:9px 12px; border-radius:9px; color:#334155; background:#fff; box-shadow:0 7px 24px rgba(15,23,42,.16); font:700 .76rem "DM Sans",sans-serif; }
    .ai-chat-launcher.is-open .ai-chat-launcher__label { display:none; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-chat,.ai-chat__panel,.ai-chat-launcher { transition:none; }
    .ai-chat-launcher__pulse { animation:none; }
}
