.jc-chat {
    --jc-chat-accent: var(--primary-color, #245b68);
    position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 99990;
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #20343c;
    text-align: left; letter-spacing: normal; box-sizing: border-box;
}
.jc-chat *, .jc-chat *::before, .jc-chat *::after { box-sizing: border-box; }
.jc-chat [hidden] { display: none !important; }
.jc-chat button { font: inherit; text-transform: none; letter-spacing: normal; cursor: pointer; min-height: 0; margin: 0; }
.jc-chat button:focus-visible, .jc-chat textarea:focus-visible { outline: 3px solid #71bec9; outline-offset: 3px; }
.jc-chat .jc-chat__launcher {
    display: flex; align-items: center; justify-content: center; width: 62px; height: 62px; padding: 17px;
    border: 1px solid #ffffff60; border-radius: 50%; background: var(--jc-chat-accent); color: #fff;
    box-shadow: 0 8px 30px #173d4940; transition: transform .18s ease, box-shadow .18s ease;
}
.jc-chat .jc-chat__launcher:hover { transform: translateY(-3px); box-shadow: 0 12px 32px #173d4955; }
.jc-chat svg { display: block; width: 100%; height: 100%; }
.jc-chat__hint { position: absolute; right: 76px; white-space: nowrap; background: #20343c; color: #fff; padding: 9px 13px; border-radius: 12px; font-size: 13px; opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none; }
.jc-chat__launcher:hover .jc-chat__hint, .jc-chat__launcher:focus-visible .jc-chat__hint { opacity: 1; visibility: visible; }
.jc-chat__launcher[aria-expanded="true"] .jc-chat__hint { display: none; }
.jc-chat__unread { position: absolute; top: -4px; right: -4px; min-width: 23px; padding: 2px 6px; border-radius: 12px; background: #bc3434; color: #fff; font-size: 12px; font-weight: 700; }
.jc-chat__panel { position: absolute; right: 0; bottom: 78px; width: 390px; height: 580px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 130px); display: flex; flex-direction: column; background: #fff; color: #20343c; border: 1px solid #dfe8eb; border-radius: 22px; box-shadow: 0 16px 70px #122d4430; overflow: hidden; }
.jc-chat__contact { display: grid; gap: 8px; }
.jc-chat__contact .jc-chat__pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.jc-chat__contact label { display: grid; gap: 3px; min-width: 0; font-size: 12px; }
.jc-chat__contact input, .jc-chat__contact select { box-sizing: border-box; width: 100%; min-width: 0; padding: 6px 8px; margin: 0; font: inherit; color: #20343c; background: #fff; border: 1px solid #d4e1e5; border-radius: 7px; }
.jc-chat__contact .jc-chat__phone { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 7px; }
.jc-chat__handoff:has(.jc-chat__contact) { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.jc-chat__header { display: flex; gap: 11px; align-items: center; flex: none; padding: 20px; background: var(--jc-chat-accent); color: #fff; }
.jc-chat__header strong { display: block; font-size: 16px; line-height: 1.4; color: #fff; }
.jc-chat__subtitle { display: block; font-size: 12px; color: #fff; opacity: .8; padding-top: 2px; }
.jc-chat__avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 13px; background: #ffffff22; font-size: 23px; }
.jc-chat .jc-chat__close { width: 36px; height: 36px; padding: 0; margin-left: auto; border: 0; border-radius: 10px; background: #ffffff12; color: #fff; font-size: 27px; line-height: 1; }
.jc-chat__messages { flex: 1; min-height: 80px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 13px; padding: 22px 18px; background: #f7f9fa; }
.jc-chat__message { max-width: 91%; flex: none; padding: 12px 15px; border-radius: 15px 15px 15px 4px; background: #fff; color: #20343c; border: 1px solid #e6edef; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.jc-chat__message--user { align-self: flex-end; border: 0; border-radius: 15px 15px 4px 15px; background: var(--jc-chat-accent); color: #fff; }
.jc-chat__message--error { background: #fff6ed; border-color: #f0d8c0; color: #6b4829; }
.jc-chat__message details { margin-top: 10px; padding-top: 8px; border-top: 1px solid #e6edef; font-size: 12px; white-space: normal; }
.jc-chat__message summary { cursor: pointer; color: #486b77; }
.jc-chat__message ul { margin: 7px 0 0; padding-left: 16px; }
.jc-chat .jc-chat__status { min-height: 22px; padding: 2px 19px; margin: 0; font-size: 12px; background: #f7f9fa; color: #5c727c; }
.jc-chat .jc-chat__staff { flex: none; padding: 8px 16px; border: 0; background: #f7f9fa; color: #245b68; font-size: 12px; text-decoration: underline; }
.jc-chat__handoff { flex: 0 1 auto; min-height: 0; max-height: 60%; overflow-y: auto; padding: 12px 18px; background: #fff; color: #20343c; }
.jc-chat__handoff form { margin: 0; }
.jc-chat__handoff p { margin: 0 0 10px; }
.jc-chat__handoff label { display: block; margin: 8px 0; font-size: 13px; color: #20343c; }
.jc-chat__handoff input { display: block; width: 100%; padding: 8px; margin-top: 3px; border: 1px solid #d4e1e5; border-radius: 8px; background: #fff; color: #20343c; font: inherit; }
.jc-chat__handoff .jc-chat__contact label { display: grid; gap: 3px; margin: 0; font-size: 12px; }
.jc-chat__handoff .jc-chat__contact input { padding: 6px 8px; margin: 0; }
.jc-chat__address-open .jc-chat__messages, .jc-chat__address-open .jc-chat__upload { display: none; }
.jc-chat__address-open .jc-chat__handoff { max-height: none; flex: 1 1 auto; }
.jc-chat__handoff button { padding: 8px 12px; border: 0; border-radius: 8px; background: var(--jc-chat-accent); color: #fff; }
.jc-chat .jc-chat__contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.jc-chat .jc-chat__contact-actions button { flex: 1 1 170px; margin: 0; }
.jc-chat input:focus-visible { outline: 3px solid #71bec9; outline-offset: 2px; }
.jc-chat__form { flex: none; padding: 15px 16px 13px; margin: 0; background: #fff; border-top: 1px solid #e6edef; }
.jc-chat__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.jc-chat__composer { display: flex; align-items: flex-end; gap: 9px; padding: 8px 8px 8px 12px; border: 1px solid #d4e1e5; border-radius: 15px; background: #fff; }
.jc-chat .jc-chat__composer textarea { flex: 1; width: 0; min-width: 0; height: 48px; min-height: 48px; max-height: 120px; resize: vertical; margin: 0; padding: 3px 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; color: #20343c; font: inherit; line-height: 1.5; }
.jc-chat .jc-chat__send { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 0; border-radius: 11px; padding: 9px; background: var(--jc-chat-accent); color: #fff; }
.jc-chat .jc-chat__send:disabled { opacity: .5; cursor: wait; }
.jc-chat__footer { display: flex; align-items: flex-start; gap: 12px; padding-top: 10px; }
.jc-chat__footer small { flex: 1; color: #687c85; font-size: 11px; line-height: 1.5; }
.jc-chat .jc-chat__end { flex: none; align-self: flex-end; margin: 0 16px 12px; padding: 7px 12px; border: 1px solid #d4e1e5; border-radius: 9px; background: #fff; color: #486b77; font-size: 12px; line-height: 1.4; text-decoration: none; }
.jc-chat .jc-chat__end:disabled { opacity: .5; cursor: wait; }
.jc-chat__confirm { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 16px; border-radius: inherit; background: #122d4470; }
.jc-chat__confirm-card { display: flex; flex-direction: column; width: 100%; min-width: 0; max-height: 100%; margin: 0; padding: 0; border: 1px solid #dfe8eb; border-radius: 16px; background: #fff; color: #20343c; box-shadow: 0 14px 40px #122d4430; overflow: hidden; }
.jc-chat .jc-chat__confirm-card h3 { flex: none; margin: 0; padding: 20px 20px 12px; color: #20343c; font: inherit; font-size: 18px; font-weight: 650; line-height: 1.35; text-transform: none; }
.jc-chat .jc-chat__confirm-card p { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0 20px 20px; color: #5c727c; font-size: 13px; line-height: 1.6; }
.jc-chat__confirm-actions { display: flex; flex: none; gap: 8px; padding: 14px 16px; border-top: 1px solid #e6edef; background: #f7f9fa; }
.jc-chat .jc-chat__confirm-actions button { display: block; flex: 1 1 0; min-width: 0; padding: 10px 8px; border: 1px solid #d4e1e5; border-radius: 9px; font-size: 13px; font-weight: 600; line-height: 1.4; white-space: normal; }
.jc-chat .jc-chat__confirm-cancel { background: #fff; color: #486b77; }
.jc-chat .jc-chat__confirm-accept { background: var(--jc-chat-accent); border-color: var(--jc-chat-accent); color: #fff; }
.jc-chat .jc-chat__upload { flex: none; padding: 7px 16px; border: 0; background: #f7f9fa; color: #245b68; text-decoration: underline; font-size: 12px; }
.jc-chat .jc-chat__attachment { display: block; margin-top: 8px; max-width: 100%; overflow-wrap: anywhere; }
.jc-chat .jc-chat__attachment-image { display: block; max-width: 100%; max-height: 180px; margin-top: 8px; object-fit: contain; }
@media (max-width: 480px) {
    .jc-chat { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .jc-chat__panel { width: calc(100vw - 32px); max-height: calc(100dvh - 116px); bottom: 74px; border-radius: 18px; }
    .jc-chat__hint { display: none; }
    .jc-chat .jc-chat__composer textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .jc-chat .jc-chat__launcher, .jc-chat__hint { transition: none; } }
