.yagpt-chat {
   
    --chat-panel: #171c28;
    --chat-panel-soft: #1d2330;
    --chat-ink: #f7f8ff;
    --chat-muted: #99a1b5;
    --chat-line: rgba(255, 255, 255, 0.1);
    --chat-accent: #4737ff;
    --chat-accent-2: #27d7ff;
    --chat-user: #4737ff;
    --chat-bot: #1d2330;

    width: min(920px, calc(100vw - 48px));
    min-height: min(680px, calc(100vh - 96px));
    margin: clamp(32px, 8vh, 86px) auto;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--chat-line);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(71, 55, 255, 0.16), transparent 34%),
        linear-gradient(180deg, var(--chat-panel), var(--chat-bg));
    color: var(--chat-ink);
    font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}

.yagpt-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--chat-line);
    background: rgba(7, 9, 14, 0.42);
}

.yagpt-chat__title {
    position: relative;
    padding-left: 18px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
}

.yagpt-chat__title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 5px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--chat-accent-2), var(--chat-accent));
    transform: translateY(-50%);
}

.yagpt-chat__counter {
    padding: 7px 11px;
    border: 1px solid var(--chat-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--chat-muted);
    font-size: 14px;
    white-space: nowrap;
}

.yagpt-chat__messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 14px;
    min-height: 360px;
    max-height: none;
    overflow-y: auto;
    padding: 22px;
    scrollbar-color: var(--chat-accent) rgba(255, 255, 255, 0.06);
}

.yagpt-chat__message {
    max-width: min(82%, 680px);
    padding: 14px 16px;
    border: 1px solid var(--chat-line);
    border-radius: 14px;
    color: var(--chat-ink);
    white-space: pre-wrap;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.yagpt-chat__message--bot {
    align-self: flex-start;
    background: var(--chat-bot);
    border-left: 3px solid var(--chat-accent-2);
}

.yagpt-chat__message--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4737ff, #5b4bff);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.yagpt-chat__form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 18px 22px 22px;
    border-top: 1px solid var(--chat-line);
    background: rgba(7, 9, 14, 0.58);
}

.yagpt-chat__input {
    min-width: 0;
    min-height: 54px;
    border: 1px solid var(--chat-line);
    border-radius: 12px;
    padding: 0 16px;
    color: var(--chat-ink);
    background: #0d111b;
    font: inherit;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.yagpt-chat__input::placeholder {
    color: #7f879a;
}

.yagpt-chat__input:focus {
    border-color: rgba(39, 215, 255, 0.68);
    box-shadow: 0 0 0 4px rgba(39, 215, 255, 0.12);
    background: #101522;
}

.yagpt-chat__button {
    min-height: 54px;
    border: 0;
    border-radius: 12px;
    padding: 0 24px;
    background: var(--chat-accent);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(71, 55, 255, 0.32);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.yagpt-chat__button:hover:not(:disabled) {
    background: #5748ff;
    box-shadow: 0 18px 34px rgba(71, 55, 255, 0.42);
    transform: translateY(-1px);
}

.yagpt-chat__button:disabled,
.yagpt-chat__input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

@media (max-width: 760px) {
    .yagpt-chat {
        width: min(100% - 24px, 920px);
        min-height: calc(100vh - 32px);
        margin: 16px auto;
        border-radius: 14px;
    }

    .yagpt-chat__header {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .yagpt-chat__messages {
        min-height: 320px;
        padding: 16px;
    }

    .yagpt-chat__message {
        max-width: 100%;
    }

    .yagpt-chat__form {
        display: flex;
        flex-direction: column;
        padding: 14px 16px 16px;
    }
}
