.supportchat-widget-root {
    --supportchat-widget-height: 520px;
    --supportchat-front-primary: #d98e32 !important;
    --supportchat-front-accent: #d98e32 !important;
    --supportchat-front-background: #1a1a1a !important;
    --supportchat-front-panel: #1a1a1a !important;
    --supportchat-front-soft: #282828 !important;
    --supportchat-front-input: #282828 !important;
    --supportchat-front-text: #f6f1e8 !important;
    --supportchat-front-muted: #d8d0c4 !important;
    --supportchat-front-subtle: #9b9389 !important;
    --supportchat-front-border: rgba(217, 142, 50, 0.34) !important;
    --supportchat-front-border-soft: rgba(255, 255, 255, 0.08) !important;
    --supportchat-front-operator-bg: #282828 !important;
    --supportchat-front-visitor-bg: rgba(217, 142, 50, 0.18) !important;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147483000;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--supportchat-front-text);
}

.supportchat-widget-root[data-supportchat-theme="dark"] {
    --supportchat-front-background: #1a1a1a;
    --supportchat-front-panel: #1a1a1a;
    --supportchat-front-soft: #282828;
    --supportchat-front-input: #282828;
    --supportchat-front-text: #f6f1e8;
    --supportchat-front-muted: #d8d0c4;
    --supportchat-front-subtle: #9b9389;
    --supportchat-front-border: rgba(217, 142, 50, 0.34);
    --supportchat-front-border-soft: rgba(255, 255, 255, 0.08);
    --supportchat-front-operator-bg: #282828;
    --supportchat-front-visitor-bg: rgba(217, 142, 50, 0.18);
}

@media (prefers-color-scheme: dark) {
    .supportchat-widget-root[data-supportchat-theme="auto"] {
        --supportchat-front-background: #1a1a1a;
        --supportchat-front-panel: #1a1a1a;
        --supportchat-front-soft: #282828;
        --supportchat-front-input: #282828;
        --supportchat-front-text: #f6f1e8;
        --supportchat-front-muted: #d8d0c4;
        --supportchat-front-subtle: #9b9389;
        --supportchat-front-border: rgba(217, 142, 50, 0.34);
        --supportchat-front-border-soft: rgba(255, 255, 255, 0.08);
        --supportchat-front-operator-bg: #282828;
        --supportchat-front-visitor-bg: rgba(217, 142, 50, 0.18);
    }
}

.supportchat-widget-inline-root {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: auto;
    width: 100%;
    max-width: 680px;
    margin: 0 0 24px;
}

.supportchat-bubble {
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #d98e32;
    box-shadow: 0 14px 34px rgba(217, 142, 50, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
}

.supportchat-bubble svg {
    display: block;
    width: 30px;
    height: 30px;
    color: #fff;
    flex: 0 0 auto;
    pointer-events: none;
}

.supportchat-bubble:hover {
    background: #e69a3f;
    transform: translateY(-1px);
}

.supportchat-bubble:focus-visible {
    outline: 2px solid rgba(217, 142, 50, 0.55);
    outline-offset: 4px;
}

.supportchat-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    display: none;
    width: min(360px, calc(100vw - 28px));
    height: var(--supportchat-widget-height);
    max-height: calc(100vh - 112px);
    border: 1px solid var(--supportchat-front-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--supportchat-front-background);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.supportchat-panel.open {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.supportchat-widget-inline-root .supportchat-panel,
.supportchat-panel.inline {
    position: static;
    right: auto;
    bottom: auto;
    display: grid;
    width: 100%;
    height: var(--supportchat-widget-height);
    max-height: var(--supportchat-widget-height);
    box-shadow: none;
}

.supportchat-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 14px;
    color: #d98e32;
    background: #000;
    border-bottom: 1px solid rgba(217, 142, 50, 0.22);
}

.supportchat-panel header strong {
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
}

.supportchat-panel header button {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    min-height: 32px;
    max-height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    border: 1px solid rgba(217, 142, 50, 0.35);
    border-radius: 50%;
    color: transparent;
    background: #282828;
    font-size: 0;
    line-height: 1;
    cursor: pointer;
}

.supportchat-panel header button::before,
.supportchat-panel header button::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 15px;
    width: 12px;
    height: 2px;
    border-radius: 2px;
    background: #d98e32;
}

.supportchat-panel header button::before {
    transform: rotate(45deg);
}

.supportchat-panel header button::after {
    transform: rotate(-45deg);
}

.supportchat-panel header button:hover {
    background: #333;
    border-color: #d98e32;
}

.supportchat-panel header button:focus-visible {
    outline: 2px solid rgba(217, 142, 50, 0.55);
    outline-offset: 2px;
}

.supportchat-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.supportchat-panel.start .supportchat-body {
    overflow: auto;
}

.supportchat-note {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 14px;
    color: var(--supportchat-front-muted);
    background: var(--supportchat-front-soft);
    border-bottom: 1px solid var(--supportchat-front-border-soft);
    line-height: 1.4;
}

.supportchat-start-form,
.supportchat-send-form {
    flex: 0 0 auto;
    display: grid;
    gap: 10px;
    padding: 14px;
}

.supportchat-start-form input,
.supportchat-start-form textarea,
.supportchat-send-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--supportchat-front-border);
    border-radius: 6px;
    padding: 9px 10px;
    color: var(--supportchat-front-text);
    background: var(--supportchat-front-input);
    font: inherit;
}

.supportchat-start-form input::placeholder,
.supportchat-start-form textarea::placeholder,
.supportchat-send-form textarea::placeholder {
    color: #8d867d;
}

.supportchat-start-form input:focus,
.supportchat-start-form textarea:focus,
.supportchat-send-form textarea:focus {
    border-color: #d98e32;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(217, 142, 50, 0.18);
}

.supportchat-start-form textarea,
.supportchat-send-form textarea {
    min-height: 78px;
    max-height: 140px;
    resize: vertical;
}

.supportchat-start-form button,
.supportchat-send-row button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: #d98e32;
    font-weight: 600;
    cursor: pointer;
}

.supportchat-start-form button:hover,
.supportchat-send-row button:hover {
    background: #e69a3f;
}

.supportchat-start-form button:disabled,
.supportchat-send-row button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.supportchat-message-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px;
    overflow: auto;
    background: var(--supportchat-front-panel);
}

.supportchat-message {
    max-width: 82%;
    margin-bottom: 10px;
    padding: 9px 10px;
    border: 1px solid var(--supportchat-front-border-soft);
    border-radius: 8px;
    background: var(--supportchat-front-operator-bg);
    word-break: break-word;
    line-height: 1.4;
}

.supportchat-message.visitor {
    margin-left: auto;
    border-color: var(--supportchat-front-border);
    color: #f6f1e8;
    background: var(--supportchat-front-visitor-bg);
}

.supportchat-message.visitor .supportchat-message-name {
    color: #d98e32;
}

.supportchat-message.system {
    max-width: 100%;
    text-align: center;
    color: var(--supportchat-front-subtle);
    background: transparent;
    border-color: transparent;
}

.supportchat-message-name {
    margin-bottom: 4px;
    color: var(--supportchat-front-subtle);
    font-size: 12px;
}

.supportchat-message a {
    display: inline-block;
    margin-top: 6px;
    color: var(--supportchat-front-primary);
}

.supportchat-send-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
    align-items: center;
}

.supportchat-file-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 10px;
    border: 1px solid var(--supportchat-front-border);
    border-radius: 6px;
    color: var(--supportchat-front-text);
    background: var(--supportchat-front-input);
    font-size: 13px;
    cursor: pointer;
}

.supportchat-file-button.selected {
    border-color: var(--supportchat-front-accent);
    color: var(--supportchat-front-accent);
    background: rgba(217, 142, 50, 0.14);
}

.supportchat-file-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.supportchat-file-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.supportchat-selected-file {
    min-height: 18px;
    margin-top: -4px;
    color: var(--supportchat-front-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.supportchat-selected-file.sending {
    color: var(--supportchat-front-primary);
}

.supportchat-selected-file.error {
    color: #b91c1c;
}

@media (max-width: 520px) {
    .supportchat-widget-root {
        right: 14px;
        bottom: 14px;
    }

    .supportchat-widget-inline-root {
        right: auto;
        bottom: auto;
    }

    .supportchat-panel {
        right: -4px;
        bottom: 70px;
    }

    .supportchat-widget-inline-root .supportchat-panel,
    .supportchat-panel.inline {
        right: auto;
        bottom: auto;
    }
}
