.idoki-customer-chat {
    --idoki-chat-primary: #0071e3;
    --idoki-chat-text: #1d1d1f;
    --idoki-chat-muted: #6e6e73;
    --idoki-chat-surface: rgba(255, 255, 255, .92);
    --idoki-chat-border: rgba(255, 255, 255, .75);
    position: fixed;
    z-index: 2147481800;
    bottom: max(18px, env(safe-area-inset-bottom));
    color: var(--idoki-chat-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

.idoki-customer-chat [hidden] { display: none !important; }
.idoki-customer-chat.idoki-chat-right { right: 18px; }
.idoki-customer-chat.idoki-chat-left { left: 18px; }

.idoki-chat-launcher {
    position: relative;
    min-height: 64px;
    padding: 7px 17px 7px 7px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 22px;
    background: rgba(255,255,255,.84);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 16px 48px rgba(18, 39, 67, .18), inset 0 1px 0 rgba(255,255,255,.8);
    color: var(--idoki-chat-text);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.idoki-chat-launcher:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,.95);
    box-shadow: 0 22px 58px rgba(18, 39, 67, .23), inset 0 1px 0 #fff;
}
.idoki-chat-launcher-logo {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 17px;
    background: linear-gradient(145deg, #fff, #eef6ff);
    box-shadow: 0 7px 18px rgba(0,113,227,.14);
}
.idoki-chat-launcher-logo img { width: 100%; height: 100%; object-fit: cover; }
.idoki-chat-launcher-copy { display: grid; gap: 4px; text-align: left; }
.idoki-chat-launcher-copy strong { font-size: 14px; line-height: 1; letter-spacing: -.01em; }
.idoki-chat-launcher-copy small { color: var(--idoki-chat-muted); font-size: 10px; font-weight: 650; }
.idoki-chat-launcher-dot {
    width: 9px;
    height: 9px;
    margin-left: 2px;
    border-radius: 50%;
    background: #30d158;
    box-shadow: 0 0 0 5px rgba(48,209,88,.13);
}
.idoki-chat-unread {
    position: absolute;
    right: -5px;
    top: -7px;
    min-width: 23px;
    height: 23px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    box-shadow: 0 5px 14px rgba(255,59,48,.28);
}

.idoki-chat-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(430px, calc(100vw - 24px));
    height: min(730px, calc(100vh - 40px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    overflow: hidden;
    border: 1px solid var(--idoki-chat-border);
    border-radius: 30px;
    background: var(--idoki-chat-surface);
    -webkit-backdrop-filter: blur(30px) saturate(170%);
    backdrop-filter: blur(30px) saturate(170%);
    box-shadow: 0 34px 110px rgba(15, 31, 52, .28), inset 0 1px 0 rgba(255,255,255,.9);
    animation: idokiChatIn .22s cubic-bezier(.2,.8,.2,1);
}
.idoki-chat-left .idoki-chat-panel { right: auto; left: 0; }
@keyframes idokiChatIn { from { opacity: 0; transform: translateY(16px) scale(.975); } }

.idoki-chat-panel-head {
    min-height: 76px;
    padding: 12px 13px 12px 15px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid rgba(0,0,0,.055);
    background: rgba(255,255,255,.88);
}
.idoki-chat-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    overflow: hidden;
    border-radius: 17px;
    background: linear-gradient(145deg, #fff, #eef6ff);
    box-shadow: 0 7px 20px rgba(0,113,227,.13);
}
.idoki-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.idoki-chat-head-copy { min-width: 0; display: grid; gap: 3px; }
.idoki-chat-head-copy strong { font-size: 16px; line-height: 1.15; letter-spacing: -.025em; }
.idoki-chat-head-copy span { overflow: hidden; color: var(--idoki-chat-muted); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.idoki-chat-new,
.idoki-chat-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f2f2f7;
    color: #4f5055;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.idoki-chat-new { margin-left: auto; font-size: 19px; }
.idoki-chat-close { font-size: 24px; line-height: 1; }
.idoki-chat-new:hover,
.idoki-chat-close:hover { background: #e8e8ed; transform: scale(1.04); }
.idoki-chat-new:disabled { opacity: .45; cursor: wait; }

.idoki-chat-status {
    min-height: 35px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0,0,0,.045);
    background: rgba(247,247,249,.88);
    color: #5c5d62;
    font-size: 10px;
    font-weight: 750;
}
.idoki-chat-status i {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #30d158;
    box-shadow: 0 0 0 4px rgba(48,209,88,.12);
}
.idoki-chat-status.is-ai i { background: var(--idoki-chat-primary); box-shadow: 0 0 0 4px rgba(0,113,227,.12); }
.idoki-chat-status.is-waiting i { background: #ff9f0a; box-shadow: 0 0 0 4px rgba(255,159,10,.13); }
.idoki-chat-status.is-human i { background: #af52de; box-shadow: 0 0 0 4px rgba(175,82,222,.13); }

.idoki-chat-messages {
    min-height: 0;
    padding: 17px 13px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    background:
        radial-gradient(circle at 10% 0%, rgba(0,113,227,.055), transparent 32%),
        linear-gradient(180deg, #f7f8fa 0%, #f4f5f7 55%, #f7f7f9 100%);
    scrollbar-width: thin;
    scrollbar-color: #cfd1d6 transparent;
}
.idoki-chat-loading {
    margin: auto;
    display: grid;
    justify-items: center;
    gap: 10px;
    color: #85868b;
    font-size: 12px;
}
.idoki-chat-loading span {
    width: 30px;
    height: 30px;
    border: 3px solid #d9e9f8;
    border-top-color: var(--idoki-chat-primary);
    border-radius: 50%;
    animation: idokiChatSpin .75s linear infinite;
}
@keyframes idokiChatSpin { to { transform: rotate(360deg); } }

.idoki-chat-message { max-width: 100%; }
.idoki-chat-message-row { display: flex; align-items: flex-end; gap: 7px; }
.idoki-chat-message.visitor .idoki-chat-message-row { justify-content: flex-end; }
.idoki-chat-message-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    color: var(--idoki-chat-primary);
    box-shadow: 0 3px 12px rgba(20,37,58,.09);
    font-size: 10px;
    font-weight: 900;
}
.idoki-chat-message.staff .idoki-chat-message-avatar { background: #eee7ff; color: #7435a4; }
.idoki-chat-message-content { max-width: calc(100% - 35px); display: grid; gap: 7px; }
.idoki-chat-message.visitor .idoki-chat-message-content { max-width: 84%; justify-items: end; }
.idoki-chat-bubble {
    width: fit-content;
    max-width: 100%;
    padding: 11px 13px;
    border: 1px solid rgba(0,0,0,.035);
    border-radius: 18px 18px 18px 6px;
    background: #fff;
    color: #242529;
    box-shadow: 0 5px 18px rgba(20,37,58,.055);
    font-size: 13px;
    line-height: 1.52;
    white-space: pre-wrap;
    word-break: break-word;
}
.idoki-chat-message.visitor .idoki-chat-bubble {
    border: 0;
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(145deg, var(--idoki-chat-primary), #005bb8);
    color: #fff;
    box-shadow: 0 7px 19px rgba(0,113,227,.19);
}
.idoki-chat-message.staff .idoki-chat-bubble {
    border-color: #d9c9ef;
    background: #f4effc;
    color: #43275b;
}
.idoki-chat-message.system .idoki-chat-bubble {
    border-color: #e7e7eb;
    background: #fbfbfc;
    color: #595a60;
}
.idoki-chat-meta { padding: 0 4px; color: #999aa0; font-size: 9px; font-weight: 650; }
.idoki-chat-message.visitor .idoki-chat-meta { text-align: right; }

.idoki-chat-cards { width: min(360px, 100%); display: grid; gap: 8px; }
.idoki-chat-card {
    min-height: 64px;
    padding: 9px 10px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 1px solid #e2e3e7;
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 5px 16px rgba(20,37,58,.045);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.idoki-chat-card:hover { transform: translateY(-2px); border-color: rgba(0,113,227,.28); box-shadow: 0 9px 24px rgba(20,37,58,.08); }
.idoki-chat-card-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #f0f6fc; font-size: 15px; }
.idoki-chat-card strong { display: block; font-size: 11px; line-height: 1.35; }
.idoki-chat-card span:not(.idoki-chat-card-icon) { display: block; margin-top: 3px; color: #77787e; font-size: 9px; line-height: 1.3; }
.idoki-chat-card-side { display: grid; justify-items: end; gap: 3px; }
.idoki-chat-card-side b { color: var(--idoki-chat-primary); font-size: 11px; white-space: nowrap; }
.idoki-chat-card-side i { color: #9b9ca1; font-size: 20px; font-style: normal; line-height: .7; }

.idoki-chat-message-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.idoki-chat-action {
    min-height: 35px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9dbe0;
    border-radius: 999px;
    background: #fff;
    color: #19598f;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}
.idoki-chat-action.primary { border-color: var(--idoki-chat-primary); background: var(--idoki-chat-primary); color: #fff; box-shadow: 0 5px 14px rgba(0,113,227,.17); }

.idoki-chat-suggestions { max-width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.idoki-chat-suggestions button {
    min-height: 31px;
    padding: 6px 10px;
    border: 1px solid #d7e5f3;
    border-radius: 999px;
    background: #f5faff;
    color: #17598f;
    font: 750 9px/1.2 Inter, sans-serif;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.idoki-chat-suggestions button:hover { transform: translateY(-1px); background: #eaf5ff; }

.idoki-chat-feedback { display: flex; align-items: center; gap: 5px; color: #9a9ba0; font-size: 9px; }
.idoki-chat-feedback button {
    min-height: 24px;
    padding: 3px 7px;
    border: 1px solid #dedfe3;
    border-radius: 999px;
    background: transparent;
    color: #77787d;
    font: 700 9px Inter, sans-serif;
    cursor: pointer;
}
.idoki-chat-feedback button.selected { border-color: var(--idoki-chat-primary); background: #edf6ff; color: var(--idoki-chat-primary); }

.idoki-chat-typing { display: flex; align-items: flex-end; gap: 7px; }
.idoki-chat-typing > div { min-width: 48px; padding: 12px 13px; display: flex; gap: 4px; border-radius: 18px 18px 18px 6px; background: #fff; box-shadow: 0 5px 18px rgba(20,37,58,.055); }
.idoki-chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: #8f9095; animation: idokiChatDot 1.1s infinite; }
.idoki-chat-typing i:nth-child(2) { animation-delay: .14s; }
.idoki-chat-typing i:nth-child(3) { animation-delay: .28s; }
@keyframes idokiChatDot { 0%,70%,100% { transform: translateY(0); opacity: .42; } 35% { transform: translateY(-4px); opacity: 1; } }

.idoki-chat-quick {
    padding: 10px 11px;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    border-top: 1px solid rgba(0,0,0,.055);
    background: rgba(255,255,255,.93);
    scrollbar-width: none;
}
.idoki-chat-quick::-webkit-scrollbar { display: none; }
.idoki-chat-quick:empty { display: none; }
.idoki-chat-quick button {
    min-width: max-content;
    min-height: 38px;
    padding: 7px 11px 7px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e0e5eb;
    border-radius: 14px;
    background: #fff;
    color: #3c3d42;
    cursor: pointer;
    box-shadow: 0 3px 11px rgba(20,37,58,.035);
}
.idoki-chat-quick button span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: #eef6ff; font-size: 12px; }
.idoki-chat-quick button strong { font-size: 9px; font-weight: 800; }

.idoki-chat-contact {
    position: relative;
    padding: 13px;
    display: grid;
    gap: 10px;
    border-top: 1px solid rgba(0,113,227,.18);
    background: linear-gradient(145deg, var(--idoki-chat-primary), #0054a8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 -8px 30px rgba(0,76,153,.12);
    overflow: hidden;
}
.idoki-chat-contact.is-visible { animation: idokiContactIn .24s ease-out; }
@keyframes idokiContactIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.idoki-chat-contact::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    right: -55px;
    top: -95px;
    border-radius: 50%;
    background: rgba(255,255,255,.13);
    pointer-events: none;
}
.idoki-chat-contact-head { position: relative; display: grid; gap: 3px; padding-right: 28px; }
.idoki-chat-contact-head::after { content: '↗'; position: absolute; right: 2px; top: 0; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.16); color: #fff; font-size: 13px; font-weight: 900; }
.idoki-chat-contact-head strong { color: #fff; font-size: 12px; font-weight: 850; letter-spacing: -.01em; }
.idoki-chat-contact-head span { color: rgba(255,255,255,.82); font-size: 9.5px; line-height: 1.45; }
.idoki-chat-contact > div:not(.idoki-chat-contact-head) { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.idoki-chat-contact input {
    min-width: 0;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid rgba(255,255,255,.48);
    border-radius: 12px;
    background: rgba(255,255,255,.96);
    color: #172033;
    font: 11px Inter, sans-serif;
    outline: none;
    box-shadow: 0 5px 16px rgba(0,45,98,.12);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.idoki-chat-contact input::placeholder { color: #718096; }
.idoki-chat-contact input:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.24), 0 7px 20px rgba(0,40,90,.18); transform: translateY(-1px); }
.idoki-chat-contact input[name=name] { grid-column: 1 / -1; }
.idoki-chat-contact button {
    position: relative;
    min-height: 41px;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 12px;
    background: #fff;
    color: var(--idoki-chat-primary);
    font: 850 10.5px Inter, sans-serif;
    cursor: pointer;
    box-shadow: 0 7px 20px rgba(0,45,98,.18);
    transition: transform .16s ease, box-shadow .16s ease;
}
.idoki-chat-contact button:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(0,45,98,.24); }
.idoki-chat-contact button:disabled { opacity: .58; cursor: wait; transform: none; }

.idoki-chat-composer {
    padding: 10px 11px 9px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: end;
    gap: 8px;
    border-top: 1px solid rgba(0,0,0,.06);
    background: rgba(255,255,255,.96);
}
.idoki-chat-composer textarea {
    width: 100%;
    min-height: 45px;
    max-height: 112px;
    resize: none;
    padding: 12px 13px;
    border: 1px solid #d8d9de;
    border-radius: 16px;
    background: #f9f9fb;
    color: var(--idoki-chat-text);
    font: 12px/1.42 Inter, sans-serif;
    outline: none;
    box-sizing: border-box;
}
.idoki-chat-composer textarea:focus { border-color: var(--idoki-chat-primary); background: #fff; box-shadow: 0 0 0 3px rgba(0,113,227,.11); }
.idoki-chat-composer button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--idoki-chat-primary), #0059b3);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 7px 17px rgba(0,113,227,.2);
}
.idoki-chat-composer button span { transform: translateX(1px); }
.idoki-chat-composer button:disabled { opacity: .48; cursor: wait; box-shadow: none; }
.idoki-chat-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

.idoki-chat-panel > footer {
    padding: 0 13px 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255,255,255,.96);
    color: #9a9ba0;
    font-size: 8px;
    line-height: 1.3;
}
.idoki-chat-panel > footer span { max-width: 82%; }
.idoki-chat-panel > footer a { color: #77787d; font-weight: 700; text-decoration: none; white-space: nowrap; }
.idoki-chat-error { margin: 0 auto; padding: 10px 12px; border: 1px solid #ffd0cc; border-radius: 13px; background: #fff0ef; color: #a92720; font-size: 11px; }

@media (max-width: 600px) {
    .idoki-customer-chat { left: 9px !important; right: 9px !important; bottom: max(9px, env(safe-area-inset-bottom)); }
    .idoki-chat-launcher { margin-left: auto; min-height: 58px; border-radius: 20px; }
    .idoki-chat-left .idoki-chat-launcher { margin-left: 0; }
    .idoki-chat-launcher-logo { width: 44px; height: 44px; border-radius: 15px; }
    .idoki-chat-panel {
        position: fixed;
        left: 6px !important;
        right: 6px !important;
        bottom: max(6px, env(safe-area-inset-bottom));
        width: auto;
        height: min(760px, calc(100dvh - 12px));
        border-radius: 27px;
    }
    .idoki-chat-panel-head { min-height: 70px; }
    .idoki-chat-messages { padding-inline: 11px; }
    .idoki-chat-contact > div:not(.idoki-chat-contact-head) { grid-template-columns: 1fr; }
    .idoki-chat-contact input[name=name] { grid-column: auto; }
}

@media (max-width: 380px) {
    .idoki-chat-launcher-copy small { display: none; }
    .idoki-chat-panel { left: 3px !important; right: 3px !important; bottom: 3px; height: calc(100dvh - 6px); border-radius: 23px; }
    .idoki-chat-head-copy span { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    .idoki-chat-panel,
    .idoki-chat-launcher,
    .idoki-chat-loading span,
    .idoki-chat-typing i { animation: none !important; transition: none !important; }
}
