.site-chat {
    position: fixed;
    left: 24px;
    top: 156px;
    bottom: 28px;
    z-index: 7;
    display: flex;
    align-items: stretch;
    pointer-events: none;
}

.site-chat-panel,
.site-chat-dock {
    pointer-events: auto;
}

.site-chat-panel {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
    width: clamp(500px, calc(50vw - 276px), 668px);
    height: 100%;
    padding: 18px;
    border: 1px solid rgba(255, 206, 113, .16);
    border-radius: 28px;
    background:
        radial-gradient(circle at top left, rgba(246, 207, 31, .16), rgba(246, 207, 31, 0) 28%),
        radial-gradient(circle at 100% 0, rgba(239, 106, 34, .12), rgba(239, 106, 34, 0) 24%),
        linear-gradient(180deg, rgba(255, 245, 222, .09), rgba(255, 255, 255, .03) 14%, rgba(255, 255, 255, .012) 100%),
        rgba(18, 11, 8, .92);
    box-shadow: 0 28px 72px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .06);
    backdrop-filter: blur(22px) saturate(1.04);
    transition: transform .24s ease, opacity .24s ease;
    overflow: hidden;
}

.site-chat-panel::before,
.site-chat-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.site-chat-panel::before {
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, .05), transparent 24%, transparent 74%, rgba(255, 255, 255, .03));
}

.site-chat-panel::after {
    left: 18px;
    right: 18px;
    top: 76px;
    height: 1px;
    background: linear-gradient(90deg, rgba(246, 207, 31, .42), rgba(239, 106, 34, .16), transparent);
}

.site-chat-header,
.site-chat-feed,
.site-chat-form,
.site-chat-dock {
    position: relative;
    z-index: 1;
}

.site-chat-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.site-chat-copy {
    display: grid;
    gap: 4px;
}

.site-chat-eyebrow,
.site-chat-online,
.site-chat-label,
.site-chat-message-name {
    font-family: "Teko", sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.site-chat-eyebrow {
    color: var(--accent);
    font-size: 1rem;
}

.site-chat-title {
    margin: 0;
    font-family: "Teko", sans-serif;
    font-size: 2.15rem;
    line-height: .9;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.site-chat-status,
.site-chat-note,
.site-chat-typing,
.site-chat-message-time {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
}

.site-chat-side {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.site-chat-online {
    padding: 7px 11px 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 206, 113, .16);
    background: rgba(20, 12, 9, .62);
    color: var(--text);
    font-size: 1rem;
}

.site-chat-toggle,
.site-chat-dock {
    min-height: 42px;
    padding: 10px 14px 8px;
    white-space: nowrap;
}

.site-chat-feed {
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    padding-right: 4px;
}

.site-chat-feed::-webkit-scrollbar {
    width: 10px;
}

.site-chat-feed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .04);
    border-radius: 999px;
}

.site-chat-feed::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(246, 207, 31, .74), rgba(239, 106, 34, .58));
    border: 2px solid rgba(18, 11, 8, .9);
}

.site-chat-message {
    display: grid;
    gap: 6px;
    padding: 12px 12px 10px;
    border: 1px solid rgba(255, 206, 113, .1);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .014)), rgba(14, 9, 7, .8);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
}

.site-chat-message.is-own {
    border-color: rgba(246, 207, 31, .2);
    background: linear-gradient(180deg, rgba(246, 207, 31, .08), rgba(239, 106, 34, .03)), rgba(16, 10, 7, .84);
}

.site-chat-message.is-system {
    border-style: dashed;
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .035);
}

.site-chat-message-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.site-chat-message-name {
    font-size: 1.18rem;
    color: var(--text);
}

.site-chat-message-text,
.site-chat-system {
    margin: 0;
    color: rgba(255, 244, 217, .9);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.site-chat-typing {
    min-height: 20px;
    padding: 0 2px;
    color: rgba(255, 224, 168, .82);
}

.site-chat-form {
    display: grid;
    gap: 12px;
}

.site-chat-field {
    display: grid;
    gap: 6px;
}

.site-chat-label {
    color: rgba(255, 224, 168, .88);
    font-size: 1rem;
}

.site-chat-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 206, 113, .14);
    border-radius: 16px;
    background: rgba(15, 10, 7, .76);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
    -webkit-user-select: text;
    user-select: text;
}

.site-chat-input:focus {
    border-color: rgba(246, 207, 31, .34);
    box-shadow: 0 0 0 3px rgba(246, 207, 31, .1);
    background: rgba(16, 10, 7, .92);
}

.site-chat-textarea {
    resize: none;
    min-height: 92px;
}

.site-chat-row {
    display: grid;
    gap: 10px;
}

.site-chat-send {
    width: 100%;
    justify-content: center;
}

.site-chat-note {
    color: rgba(255, 244, 217, .68);
    font-size: .84rem;
}

.site-chat-dock {
    display: none;
}

.site-chat.is-minimized .site-chat-panel {
    opacity: 0;
    transform: translateY(16px) scale(.98);
    pointer-events: none;
}

.site-chat.is-minimized .site-chat-dock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-chat textarea,
.site-chat input,
.site-chat-feed,
.site-chat-message-text {
    -webkit-user-select: text;
    user-select: text;
}

@media (max-width: 1699px) {
    .site-chat {
        left: 24px;
        top: auto;
        bottom: 24px;
    }

    .site-chat-panel {
        width: min(360px, calc(100vw - 48px));
        height: min(560px, calc(100svh - 120px));
    }
}

@media (max-width: 760px) {
    .site-chat {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .site-chat-panel {
        width: 100%;
        height: min(72svh, 560px);
        padding: 16px;
    }
}



.site-chat-message.is-admin {
    border-style: solid;
    border-color: rgba(255, 88, 88, .34);
    background: linear-gradient(180deg, rgba(255, 88, 88, .12), rgba(120, 8, 8, .1)), rgba(28, 8, 8, .86);
    box-shadow: 0 14px 30px rgba(70, 0, 0, .22);
}

.site-chat-message.is-admin .site-chat-system {
    color: rgba(255, 190, 190, .96);
}

