/* =================================================================
   CovaiCare — website chat assistant (floating, every page)
   ================================================================= */
.cb-launch {
    position: fixed; right: clamp(14px, 2vw, 28px); bottom: clamp(14px, 2.5vw, 28px); z-index: 120;
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .55rem 1.1rem .55rem .55rem; border: 0; border-radius: 999px;
    background: var(--sage, #526C57); color: #fff; cursor: pointer;
    font: 700 1rem/1 var(--font-body, Poppins, sans-serif);
    box-shadow: 0 14px 34px rgba(48, 53, 47, .35);
    transition: transform .3s ease, box-shadow .3s ease, opacity .3s ease;
}
.cb-launch:hover, .cb-launch:focus-visible { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(48, 53, 47, .42); outline: none; }
.cb-launch-ic { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--yellow, #E2B64A); }
.cb-launch-ic svg { width: 24px; height: 24px; fill: none; stroke: var(--ink, #30352F); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cb-launch-ic::after { content: ""; position: absolute; top: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: #3ccf6e; border: 2px solid var(--sage, #526C57); }
.cb-open .cb-launch { opacity: 0; pointer-events: none; transform: scale(.9); }
.cb-nudge {
    position: fixed; right: clamp(14px, 2vw, 28px); bottom: calc(clamp(14px, 2.5vw, 28px) + 72px); z-index: 119;
    max-width: 260px; padding: .8rem 1rem; border-radius: 16px 16px 4px 16px;
    background: #fff; color: var(--ink, #30352F); font: 600 .98rem/1.45 var(--font-body, Poppins, sans-serif);
    box-shadow: 0 14px 34px rgba(48, 53, 47, .2); cursor: pointer;
    animation: cbIn .5s cubic-bezier(.22, 1, .36, 1);
}
.cb-nudge[hidden] { display: none; }

.cb-panel {
    position: fixed; right: clamp(14px, 2vw, 28px); bottom: clamp(14px, 2.5vw, 28px); z-index: 121;
    width: min(390px, calc(100vw - 28px)); height: min(600px, calc(100svh - 120px));
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--ivory, #F8F5ED); border-radius: 22px;
    box-shadow: 0 30px 70px rgba(30, 34, 30, .35);
    animation: cbIn .4s cubic-bezier(.22, 1, .36, 1);
}
.cb-panel[hidden] { display: none; }
@keyframes cbIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.cb-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; background: var(--sage, #526C57); color: #fff; }
.cb-ava { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--yellow, #E2B64A); color: var(--ink, #30352F); font: 700 1.1rem/1 var(--font-heading, serif); }
.cb-head-t { flex: 1; min-width: 0; }
.cb-head-t strong { display: block; font: 700 1.08rem/1.2 var(--font-heading, serif); }
.cb-head-t span { font-size: .85rem; opacity: .9; display: inline-flex; align-items: center; gap: .35rem; }
.cb-head-t span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ccf6e; }
.cb-x { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: grid; place-items: center; }
.cb-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.cb-x:hover { background: var(--yellow, #E2B64A); color: var(--ink, #30352F); }

.cb-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; scrollbar-width: thin; }
.cb-msg { max-width: 86%; padding: .7rem .9rem; border-radius: 16px; font: 500 .98rem/1.5 var(--font-body, Poppins, sans-serif); color: var(--ink, #30352F); animation: cbIn .35s ease; word-wrap: break-word; }
.cb-msg.is-bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 4px 12px rgba(48, 53, 47, .06); }
.cb-msg.is-me { align-self: flex-end; background: var(--sage, #526C57); color: #fff; border-bottom-right-radius: 4px; }
.cb-msg a { color: var(--sage, #526C57); font-weight: 700; text-decoration: underline; text-decoration-color: var(--yellow, #E2B64A); text-underline-offset: 3px; }
.cb-msg ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.cb-msg li { margin: .15rem 0; }
.cb-typing { display: inline-flex; gap: 4px; padding: .8rem .9rem; }
.cb-typing i { width: 7px; height: 7px; border-radius: 50%; background: rgba(48, 53, 47, .35); animation: cbDot 1s infinite; }
.cb-typing i:nth-child(2) { animation-delay: .15s; } .cb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cbDot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
.cb-opts { display: flex; flex-wrap: wrap; gap: .45rem; padding-left: .1rem; animation: cbIn .35s ease; }
.cb-opt { padding: .55rem .9rem; border: 1.5px solid var(--sage, #526C57); border-radius: 999px; background: #fff; color: var(--sage, #526C57); font: 700 .92rem/1.2 var(--font-body, Poppins, sans-serif); cursor: pointer; transition: background-color .2s ease, color .2s ease; text-decoration: none; }
.cb-opt:hover, .cb-opt:focus-visible { background: var(--sage, #526C57); color: #fff; outline: none; }
.cb-opt.is-wa { border-color: #25D366; color: #128C4A; }
.cb-opt.is-wa:hover { background: #25D366; color: #fff; }

.cb-form { display: grid; gap: .5rem; padding: .8rem; background: #fff; border-radius: 16px; box-shadow: 0 4px 12px rgba(48, 53, 47, .06); animation: cbIn .35s ease; }
.cb-form input, .cb-form select { width: 100%; padding: .7rem .8rem; border: 1.5px solid rgba(82, 108, 87, .3); border-radius: 10px; background: #fff; font: 500 .98rem/1.2 var(--font-body, Poppins, sans-serif); color: var(--ink, #30352F); }
.cb-form input:focus, .cb-form select:focus { outline: none; border-color: var(--sage, #526C57); }
.cb-form button { padding: .75rem; border: 0; border-radius: 999px; background: var(--yellow, #E2B64A); color: var(--ink, #30352F); font: 700 1rem/1 var(--font-body, Poppins, sans-serif); cursor: pointer; }
.cb-form button:hover { background: #d4a73c; }
.cb-err { margin: 0; color: #b3261e; font-size: .88rem; font-weight: 600; }

.cb-input { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid rgba(82, 108, 87, .15); background: #fff; }
.cb-input input { flex: 1; min-width: 0; padding: .7rem .9rem; border: 1.5px solid rgba(82, 108, 87, .25); border-radius: 999px; font: 500 .98rem/1.2 var(--font-body, Poppins, sans-serif); color: var(--ink, #30352F); }
.cb-input input:focus { outline: none; border-color: var(--sage, #526C57); }
.cb-send { flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--sage, #526C57); color: #fff; cursor: pointer; display: grid; place-items: center; }
.cb-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cb-send:hover { background: var(--yellow, #E2B64A); color: var(--ink, #30352F); }

@media (max-width: 767px) {
    .cb-launch { padding: .5rem; }
    .cb-launch-t { display: none; }
    .has-mbar .cb-launch, .has-mbar .cb-nudge { bottom: 80px; }
    .has-mbar .cb-nudge { bottom: 146px; }
    .cb-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 100svh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .cb-panel, .cb-msg, .cb-opts, .cb-nudge { animation: none; } }
