.chat-widget {
    --chat-green: #267d1b;
    --chat-green-dark: #07552f;
    --chat-ink: #163526;
    --chat-muted: #66776d;
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 80;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

.chat-widget *, .chat-widget *::before, .chat-widget *::after { box-sizing: border-box; }
.chat-widget [hidden] { display: none !important; }

.chat-widget__launcher {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    margin-left: auto;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(145deg, #3e9c28, var(--chat-green-dark));
    box-shadow: 0 12px 28px rgba(7, 85, 47, .27), 0 3px 8px rgba(7, 85, 47, .16);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.chat-widget__launcher:hover { transform: translateY(-2px); box-shadow: 0 15px 32px rgba(7, 85, 47, .32), 0 4px 10px rgba(7, 85, 47, .18); }
.chat-widget__launcher:focus-visible, .chat-widget button:focus-visible { outline: 3px solid rgba(88, 169, 30, .3); outline-offset: 3px; }
.chat-widget__launcher svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.chat-widget__launcher .chat-icon-dots, .chat-widget__avatar .chat-icon-dots { stroke-width: 2.8; }
.chat-widget__launcher-close { display: none; }
.chat-widget--open .chat-widget__launcher-open { display: none; }
.chat-widget--open .chat-widget__launcher-close { display: block; }
.chat-widget__badge { position: absolute; top: -5px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: #dc3434; font-size: 10px; font-weight: 800; line-height: 16px; }

.chat-widget__toast { position: absolute; right: 0; bottom: 69px; display: flex; width: min(342px, calc(100vw - 32px)); align-items: center; overflow: hidden; border: 1px solid rgba(20,69,40,.14); border-radius: 16px; background: #fff; box-shadow: 0 14px 38px rgba(22,53,38,.18), 0 4px 12px rgba(22,53,38,.07); animation: chat-toast-in .24s ease-out; }
.chat-widget__toast--welcome { border-color: rgba(38,125,27,.2); }
.chat-widget__toast-open { display: flex; min-width: 0; flex: 1; align-items: center; gap: 11px; border: 0; padding: 12px 8px 12px 12px; color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.chat-widget__toast-open:hover { background: #f7fbf4; }
.chat-widget__toast-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #58a91e, #267d1b); font-size: 13px; font-weight: 900; }
.chat-widget__toast-copy { display: block; min-width: 0; }
.chat-widget__toast-copy strong, .chat-widget__toast-copy > span { display: block; }
.chat-widget__toast-copy strong { color: var(--chat-ink); font-size: 13.5px; font-weight: 800; line-height: 1.3; }
.chat-widget__toast-copy > span { display: -webkit-box; overflow: hidden; margin-top: 3px; color: var(--chat-muted); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.chat-widget__toast-dismiss { display: grid; width: 34px; height: 34px; flex: 0 0 auto; margin-right: 7px; place-items: center; border: 0; border-radius: 9px; color: #809087; background: transparent; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.chat-widget__toast-dismiss:hover { color: #405348; background: #eef4eb; }
.chat-widget--has-unread .chat-widget__launcher { animation: chat-launcher-attention 1.8s ease-in-out infinite; }

@keyframes chat-toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes chat-launcher-attention { 0%, 100% { box-shadow: 0 12px 28px rgba(7,85,47,.27), 0 0 0 0 rgba(220,52,52,0); } 50% { box-shadow: 0 12px 28px rgba(7,85,47,.27), 0 0 0 7px rgba(220,52,52,.14); } }

.chat-widget__panel { position: absolute; right: 0; bottom: 72px; display: flex; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 116px)); min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid #d8e4d3; border-radius: 18px; background: #fff; box-shadow: 0 20px 64px rgb(15 53 30 / .18), 0 3px 12px rgb(15 53 30 / .06); animation: chat-panel-in .22s ease-out; }

@keyframes chat-panel-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.chat-widget__header { display: flex; min-height: 78px; flex: 0 0 auto; align-items: center; gap: 11px; padding: 16px; color: #fff; background: #07552f; }
.chat-widget__avatar { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 13px; background: rgba(255,255,255,.13); }
.chat-widget__avatar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.chat-widget__brand-logo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-widget__avatar, .chat-widget__toast-avatar, .chat-widget .chat-widget__guide-avatar { overflow: hidden; border: 0; border-radius: 50%; background: #fff; padding: 0; }
.chat-widget__heading { min-width: 0; flex: 1; }
.chat-widget__heading h2 { margin: 0; color: #fff; font-size: 17px; font-weight: 650; line-height: 1.3; letter-spacing: -.025em; }
.chat-widget__heading p { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; color: rgba(255,255,255,.84); font-size: 12.5px; }
.chat-widget__online-dot { width: 7px; height: 7px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: #bade72; box-shadow: 0 0 0 3px rgba(186,222,114,.16); }
.chat-widget__close { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 1px solid rgb(255 255 255 / .16); border-radius: 10px; color: #fff; background: rgb(255 255 255 / .06); cursor: pointer; }
.chat-widget__close:hover { background: rgba(255,255,255,.12); }
.chat-widget__close svg { width: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.chat-widget__messages { min-height: 0; flex: 1; overflow-x: hidden; overflow-y: auto; padding: 18px 16px; background: #f5f8f2; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9d8c3 transparent; }
.chat-widget__welcome { padding: 0 0 14px; }
.chat-widget__guide-message { display: flex; align-items: flex-start; gap: 8px; }
.chat-widget__guide-avatar { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid #d5e4cb; border-radius: 9px; color: #326b2b; background: #eaf2e4; font-size: 11px; font-weight: 700; }
.chat-widget__guide-bubble { min-width: 0; padding: 13px 14px; border: 1px solid #e0e8dc; border-radius: 4px 14px 14px; color: #425247; background: #fff; font-size: 13px; line-height: 1.65; text-wrap: pretty; }
.chat-widget__guide-bubble strong { display: block; margin-bottom: 5px; color: var(--chat-ink); font-size: 14px; font-weight: 650; }
.chat-widget__guide-bubble p { margin: 0; }
.chat-widget__guide-bubble b { color: var(--chat-green-dark); font-weight: 600; }

.chat-widget__program-choices { display: grid; gap: 8px; margin: 18px 0 0 36px; }
.chat-widget__program-choices-title { margin: 0 0 2px; color: #6b7b70; font-size: 11px; font-weight: 600; line-height: 1.4; }
.chat-widget__program-choice { display: grid; min-width: 0; grid-template-columns: 36px minmax(0, 1fr) 22px; align-items: center; gap: 10px; border: 1px solid #dfe8d9; border-radius: 10px; padding: 10px; color: var(--chat-ink); background: #fff; text-decoration: none; transition: border-color .18s ease, background .18s ease; }
.chat-widget__program-mark { display: grid; width: 36px; height: 36px; place-items: center; overflow: hidden; border: 1px solid #e0e8db; border-radius: 9px; color: var(--chat-green-dark); background: #f3f7ef; font-size: 12px; font-weight: 650; }
.chat-widget__program-mark img { width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.chat-widget__program-copy { display: block; min-width: 0; }
.chat-widget__program-copy strong,
.chat-widget__program-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-widget__program-copy strong { color: var(--chat-ink); font-size: 12px; font-weight: 650; line-height: 1.45; }
.chat-widget__program-copy small { margin-top: 3px; color: #718078; font-size: 11.5px; line-height: 1.35; }
.chat-widget__program-arrow { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: var(--chat-green-dark); background: #eef6eb; }
.chat-widget__program-arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.chat-widget__program-choice:hover { border-color: #94bb85; background: #f9fcf6; }
.chat-widget__program-choice:focus-visible { outline: 3px solid rgba(88,169,30,.22); outline-offset: 2px; }
.chat-widget__no-program { margin: 0; border: 1px dashed #ccd9c7; border-radius: 10px; padding: 10px; color: var(--chat-muted); background: #fff; font-size: 12px; line-height: 1.45; }

.chat-widget__response-note { flex: 0 0 auto; margin: 0; border-top: 1px solid #e4ebdf; padding: 11px 16px 0; color: #66776b; background: #fff; font-size: 11px; line-height: 1.5; text-align: left; }
.chat-widget__response-note strong { color: rgba(15,23,42,.63); font-weight: 700; }

.chat-widget__identity { margin: 0 0 18px; border-bottom: 1px solid #e0e8db; padding-bottom: 16px; }
.chat-widget__identity label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: #48604c; font-size: 12px; font-weight: 600; text-align: left; }
.chat-widget__identity label small { color: #7f8d85; font-size: 11px; font-weight: 500; }
.chat-widget__identity input { width: 100%; height: 42px; border: 1px solid #dce5d6; border-radius: 9px; padding: 0 12px; color: var(--chat-ink); background: #fff; font: inherit; font-size: 13px; outline: 0; transition: border-color .18s ease, box-shadow .18s ease; }
.chat-widget__identity input:focus { border-color: #64a952; box-shadow: 0 0 0 3px rgba(88,169,30,.1); }

.chat-message { display: flex; margin: 0 0 18px; flex-direction: column; align-items: flex-start; }
.chat-message--visitor { align-items: flex-end; }
.chat-message__bubble { max-width: 88%; padding: 10px 13px; border: 1px solid #e0e8dc; border-radius: 4px 14px 14px; color: #24382c; background: #fff; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-message--visitor .chat-message__bubble { border-color: transparent; border-radius: 16px 16px 6px; color: #fff; background: var(--chat-green); }
.chat-message__meta { margin-top: 5px; padding: 0 3px; color: #738178; font-size: 10px; font-variant-numeric: tabular-nums; }
.chat-message--visitor .chat-message__meta { text-align: right; }

.chat-widget__notice { margin: 0 16px 8px; border-radius: 8px; padding: 7px 10px; color: #9a4d09; background: #fff5e8; font-size: 11px; line-height: 1.35; }
.chat-widget__composer { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 8px; margin: 10px 12px 8px; border: 1px solid #d7e3d0; border-radius: 12px; padding: 5px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.chat-widget__composer textarea { display: block; min-width: 0; width: 100%; max-height: 104px; min-height: 42px; resize: none; border: 0; border-radius: 8px; padding: 11px 8px; color: var(--chat-ink); background: transparent; font: inherit; font-size: 14px; line-height: 20px; outline: 0; }
.chat-widget__composer textarea:focus { background: transparent; box-shadow: none; }
.chat-widget__composer button { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 8px; color: #fff; background: #267d1b; cursor: pointer; }
.chat-widget__composer button:hover { background: var(--chat-green-dark); }
.chat-widget__composer button:disabled { cursor: wait; opacity: .55; }
.chat-widget__composer svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.chat-widget__privacy { flex: 0 0 auto; margin: 0; padding: 0 16px 12px; color: #78867c; background: #fff; font-size: 10px; line-height: 1.5; text-align: left; }


.chat-widget__composer:focus-within { border-color: #6ca45a; box-shadow: 0 0 0 3px rgb(88 169 30 / .1); }
.bayer-theme .chat-widget__composer textarea:focus { box-shadow: none !important; }
.chat-widget__notice { flex: 0 0 auto; }
.chat-widget button { transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.chat-widget button:active:not(:disabled) { transform: scale(.97); }
.chat-widget__context { display: flex; min-width: 0; flex: 0 0 auto; align-items: center; gap: 8px; border-bottom: 1px solid #e0e8d9; padding: 10px 16px; color: #526a55; background: #edf4e7; font-size: 11px; }
.chat-widget__context svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-widget__context span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
    .chat-widget { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
    .chat-widget__launcher { width: 54px; height: 54px; }
    .chat-widget__panel { position: fixed; inset: auto 10px max(80px, calc(env(safe-area-inset-bottom) + 72px)); width: auto; height: min(660px, calc(100dvh - 98px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); min-height: 0; border-radius: 16px; }
    .chat-widget__toast { width: min(330px, calc(100vw - 28px)); }
    .chat-widget__identity input, .chat-widget__composer textarea { font-size: 16px; }
    .chat-widget__header { min-height: 72px; padding: 12px 14px; }
}
@media (max-height: 520px) {
    .chat-widget__panel { bottom: 0; height: calc(100dvh - 28px); }
    .chat-widget--open .chat-widget__launcher { visibility: hidden; }
    .chat-widget__header { min-height: 58px; padding-block: 8px; }
    .chat-widget__response-note, .chat-widget__privacy { display: none; }
}
@media (max-height: 520px) and (max-width: 520px) {
    .chat-widget__panel { bottom: max(8px, env(safe-area-inset-bottom)); height: calc(100dvh - 18px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .chat-widget *, .chat-widget *::before, .chat-widget *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


.chat-widget__launcher .chat-widget__launcher-open { width: 28px; height: 28px; }
