#dks-chat-root {
    --dksc-accent: #fe453d;
    --dksc-accent-dark: #e33a32;
    --dksc-ink: #1c1c21;
    --dksc-muted: #8b8b93;
    --dksc-panel-bg: #eef0f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, Helvetica, sans-serif;
}

/* Кнопка запуска чата */
.dksc-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--dksc-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.dksc-launcher:hover {
    transform: translateY(-2px);
}

.dksc-launcher.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.dksc-launcher.is-unread::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 10px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px var(--dksc-accent);
}

/* Панель */
.dksc-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    width: 368px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 150px);
    border-radius: 18px;
    overflow: hidden;
    background: var(--dksc-panel-bg);
    box-shadow: 0 20px 50px rgba(15, 15, 20, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.99);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.dksc-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Шапка */
.dksc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--dksc-accent);
    color: #fff;
}

.dksc-header-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.dksc-header-sub {
    margin-top: 3px;
    font-size: 12px;
    opacity: 0.85;
}

.dksc-header-sub::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: #b6f3c2;
    vertical-align: middle;
}

.dksc-close {
    flex: none;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.dksc-close:hover {
    background: rgba(255, 255, 255, 0.26);
}

/* Лента сообщений */
.dksc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 10px;
    scrollbar-width: thin;
}

.dksc-empty {
    padding: 22px 10px;
    text-align: center;
    color: var(--dksc-muted);
}

.dksc-empty.is-hidden {
    display: none;
}

.dksc-empty-title {
    margin: 0 0 14px;
    font-size: 14px;
    color: #5f5f68;
}

.dksc-name {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid #e2e4ea;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
}

.dksc-name:focus {
    outline: none;
    border-color: var(--dksc-accent);
}

.dksc-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.dksc-chip {
    padding: 9px 14px;
    border: 1px solid #e2e4ea;
    border-radius: 999px;
    background: #fff;
    color: #40404a;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.14s ease, color 0.14s ease;
}

.dksc-chip:hover {
    border-color: var(--dksc-accent);
    color: var(--dksc-accent);
}

.dksc-empty-hint {
    margin: 18px 0 0;
    font-size: 12.5px;
    color: #9a9aa3;
}

.dksc-row {
    display: flex;
    margin-bottom: 8px;
}

.dksc-row-visitor {
    justify-content: flex-end;
}

.dksc-row-system {
    justify-content: center;
    margin: 12px 0;
}

.dksc-bubble {
    position: relative;
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 16px;
    background: #fff;
    color: var(--dksc-ink);
    font-size: 14px;
    line-height: 1.42;
    box-shadow: 0 1px 2px rgba(20, 20, 30, 0.07);
}

.dksc-bubble.is-media {
    padding: 5px;
}

.dksc-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.dksc-time {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1;
    color: var(--dksc-muted);
    text-align: right;
}

.dksc-bubble.is-media .dksc-time {
    padding: 2px 6px 1px 0;
}

.dksc-row-visitor .dksc-bubble {
    background: var(--dksc-accent);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.dksc-row-visitor .dksc-time {
    color: rgba(255, 255, 255, 0.82);
}

.dksc-row-operator .dksc-bubble {
    border-bottom-left-radius: 5px;
}

.dksc-row-system .dksc-bubble {
    max-width: 92%;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: none;
    color: #75757f;
    font-size: 12.5px;
    text-align: center;
}

/* Вложения */
.dksc-media {
    overflow: hidden;
    border-radius: 12px;
}

.dksc-media-audio {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 8px;
}

.dksc-image-link {
    display: block;
    line-height: 0;
}

.dksc-image {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
}

.dksc-bubble audio {
    width: 230px;
    max-width: 100%;
    height: 34px;
    margin: 0;
}

.dksc-file-link {
    display: block;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
    color: inherit;
    font-size: 13px;
    text-decoration: none;
    word-break: break-all;
}

.dksc-file-link:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Поле ввода */
.dksc-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 12px;
    background: #fff;
    box-shadow: 0 -1px 0 rgba(20, 20, 30, 0.06);
}

.dksc-attach,
.dksc-send {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.14s ease, transform 0.14s ease;
}

.dksc-attach svg,
.dksc-send svg {
    width: 20px;
    height: 20px;
}

.dksc-attach {
    border: 1px solid #e2e4ea;
    background: #fff;
    color: #6c6c76;
}

.dksc-attach:hover {
    background: #f3f4f8;
}

.dksc-send {
    border: 0;
    background: var(--dksc-accent);
    color: #fff;
}

.dksc-send:hover {
    background: var(--dksc-accent-dark);
}

.dksc-send:disabled,
.dksc-attach:disabled {
    opacity: 0.55;
    cursor: default;
}

.dksc-file,
.dksc-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.dksc-input {
    flex: 1;
    box-sizing: border-box;
    min-height: 42px;
    max-height: 110px;
    padding: 11px 14px;
    border: 1px solid #e2e4ea;
    border-radius: 21px;
    background: #f6f7fb;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
    resize: none;
    overflow-y: auto;
}

.dksc-input:focus {
    outline: none;
    border-color: var(--dksc-accent);
    background: #fff;
}

@media (max-width: 600px) {
    .dksc-launcher {
        right: 16px;
        bottom: 16px;
        padding: 12px 18px;
        font-size: 14px;
    }

    #dks-chat-root.dksc-cookie-open .dksc-launcher {
        bottom: 112px;
    }

    .dksc-panel {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 18px 18px 0 0;
    }

    .dksc-image {
        max-height: 340px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    #dks-chat-root.dksc-cookie-open .dksc-launcher {
        bottom: 104px;
    }
}
