.fscw-launcher,
.fscw-panel,
.fscw-panel * {
    box-sizing: border-box;
}

.fscw-launcher,
.fscw-panel {
    font-family: Manrope, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fscw-root {
    --fscw-panel: rgba(18, 20, 27, .97);
    --fscw-panel-soft: #151820;
    --fscw-panel-strong: rgba(18, 20, 27, .92);
    --fscw-card: #171a23;
    --fscw-input: #1a1d27;
    --fscw-input-focus: #172235;
    --fscw-line: #242936;
    --fscw-text: #f5f7fb;
    --fscw-muted: #90a1bd;
    --fscw-support: #10213d;
    --fscw-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.fscw-root[data-theme="light"] {
    --fscw-panel: rgba(255, 255, 255, .98);
    --fscw-panel-soft: #f4f7fb;
    --fscw-panel-strong: rgba(255, 255, 255, .94);
    --fscw-card: #ffffff;
    --fscw-input: #f8fbff;
    --fscw-input-focus: #ffffff;
    --fscw-line: #dbe5f4;
    --fscw-text: #101828;
    --fscw-muted: #53657f;
    --fscw-support: #eaf2ff;
    --fscw-shadow: 0 24px 70px rgba(30, 64, 175, .15);
}

.fscw-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147483000;
    min-width: 118px;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 999px;
    background: #0877ff;
    color: #fff;
    padding: 0 21px;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 18px 45px rgba(8, 119, 255, .34);
    transition: transform .2s, background .2s, opacity .2s;
}

.fscw-launcher:hover {
    background: #0f6fff;
    transform: translateY(-2px);
}

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

.fscw-launcher-count {
    min-width: 23px;
    min-height: 23px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ff5360;
    color: #fff;
    font-size: 12px;
}

.fscw-launcher-count:not(:empty) {
    display: inline-flex;
}

.fscw-panel {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147483001;
    width: min(420px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 44px));
    min-height: 520px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--fscw-line);
    border-radius: 24px;
    background: var(--fscw-panel);
    color: var(--fscw-text);
    box-shadow: var(--fscw-shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(.98);
    transition: opacity .2s, transform .2s;
}

.fscw-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.fscw-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--fscw-line);
    background: var(--fscw-panel-strong);
}

.fscw-brand {
    min-width: 0;
}

.fscw-logo {
    display: inline-flex;
    align-items: baseline;
    margin-bottom: 7px;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.fscw-logo b {
    color: #0877ff;
    font-size: 1.34em;
}

.fscw-logo strong,
.fscw-logo small {
    color: var(--fscw-text);
}

.fscw-logo small {
    margin-left: 2px;
    font-size: .56em;
}

.fscw-title {
    margin: 0;
    color: var(--fscw-text);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.15;
}

.fscw-subtitle {
    margin: 4px 0 0;
    color: var(--fscw-muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.fscw-actions {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
}

.fscw-status,
.fscw-close {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.fscw-status {
    border: 1px solid rgba(32, 201, 151, .4);
    background: rgba(32, 201, 151, .12);
    color: #75f0c4;
}

.fscw-close {
    border: 1px solid var(--fscw-line);
    background: var(--fscw-card);
    color: var(--fscw-text);
    cursor: pointer;
}

.fscw-messages {
    min-height: 0;
    overflow: auto;
    padding: 18px;
}

.fscw-welcome {
    display: grid;
    gap: 8px;
    margin: 22px 0;
    border: 1px solid var(--fscw-line);
    border-radius: 18px;
    background: var(--fscw-panel-soft);
    padding: 18px;
}

.fscw-welcome strong {
    color: var(--fscw-text);
    font-size: 18px;
    font-weight: 900;
}

.fscw-welcome span {
    color: var(--fscw-muted);
    line-height: 1.5;
    font-weight: 650;
}

.fscw-message {
    max-width: 86%;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--fscw-line);
    border-radius: 18px;
    background: var(--fscw-card);
    color: var(--fscw-text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}

.fscw-message.is-support {
    margin-left: auto;
    border-color: rgba(8, 119, 255, .42);
    background: var(--fscw-support);
}

.fscw-message.is-system {
    max-width: 88%;
    margin-left: auto;
    margin-right: auto;
    color: var(--fscw-muted);
    text-align: center;
}

.fscw-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--fscw-text);
    font-size: 14px;
    line-height: 1.48;
}

.fscw-meta {
    margin-top: 6px;
    color: var(--fscw-muted);
    font-size: 11px;
    font-weight: 800;
}

.fscw-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--fscw-line);
    background: var(--fscw-panel-strong);
}

.fscw-input {
    width: 100%;
    min-height: 54px;
    max-height: 138px;
    resize: none;
    border: 1px solid var(--fscw-line);
    border-radius: 16px;
    background: var(--fscw-input);
    color: var(--fscw-text);
    padding: 14px;
    outline: none;
    font: inherit;
    line-height: 1.4;
}

.fscw-input:focus {
    border-color: #0877ff;
    background: var(--fscw-input-focus);
    color: var(--fscw-text);
    box-shadow: 0 0 0 2px rgba(8, 119, 255, .16) inset;
}

.fscw-send,
.fscw-attach {
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    background: #0877ff;
    color: #fff;
    padding: 0 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(8, 119, 255, .22);
}

.fscw-attach {
    width: 54px;
    padding: 0;
    font-size: 19px;
}

.fscw-send:hover,
.fscw-attach:hover {
    background: #0f6fff;
}

.fscw-send:disabled,
.fscw-attach:disabled,
.fscw-input:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.fscw-file-preview {
    grid-column: 1 / -1;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
}

.fscw-file-chip,
.fscw-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    border: 1px solid var(--fscw-line);
    border-radius: 999px;
    background: var(--fscw-card);
    color: var(--fscw-text);
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.fscw-file-chip button {
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 83, 96, .14);
    color: #ff5360;
    cursor: pointer;
}

.fscw-attachments {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.fscw-attachment-image img,
.fscw-attachment-video {
    max-width: 210px;
    max-height: 210px;
    display: block;
    border: 1px solid var(--fscw-line);
    border-radius: 14px;
    object-fit: cover;
}

@media (max-width: 700px) {
    .fscw-panel {
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        border-radius: 0;
    }

    .fscw-launcher {
        right: 16px;
        bottom: 16px;
    }

    .fscw-header {
        align-items: flex-start;
    }

    .fscw-message {
        max-width: 90%;
    }

    .fscw-composer {
        grid-template-columns: 1fr auto auto;
    }

    .fscw-send {
        min-height: 50px;
    }
}
