:root {
    --bg: #f3f7fb;
    --surface: #ffffff;
    --surface-soft: #eef7fc;
    --text: #1b3551;
    --muted: #6b7d92;
    --line: #d8e6f1;
    --brand: #57b3dd;
    --brand-dark: #2993c8;
    --brand-soft: #dff3fb;
    --accent: #86cbe9;
    --shadow: 0 18px 50px rgba(34, 94, 142, 0.10);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at top left, rgba(87, 179, 221, 0.14), transparent 24%),
        linear-gradient(180deg, #f8fbfe 0%, var(--bg) 100%);
    color: var(--text);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 40px;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 6px 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    box-shadow: 0 8px 26px rgba(87, 179, 221, 0.18);
}

.brand-name {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.brand-tag {
    margin-top: 6px;
    color: var(--muted);
    font-size: 15px;
}

.header-badge {
    white-space: nowrap;
    background: var(--brand-soft);
    color: var(--brand-dark);
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(41, 147, 200, 0.12);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 22px;
    margin-bottom: 24px;
}

.hero-card,
.chat-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(216, 230, 241, 0.9);
    box-shadow: var(--shadow);
}

.hero-card {
    border-radius: var(--radius-xl);
    padding: 30px;
}

.eyebrow {
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.intro-card h1 {
    margin: 0;
    font-size: clamp(32px, 4.6vw, 52px);
    line-height: 1.04;
    letter-spacing: -0.04em;
    max-width: 760px;
}

.lead {
    margin: 18px 0 0;
    font-size: 17px;
    line-height: 1.75;
    color: #44627e;
    max-width: 760px;
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.quick-tags span {
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--brand-dark);
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(87, 179, 221, 0.16);
}

.side-card {
    background: linear-gradient(180deg, #fafdff 0%, #eef8fd 100%);
}

.side-card-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 18px;
}

.prompt-list {
    margin: 0;
    padding-left: 20px;
    color: #44627e;
    line-height: 1.7;
}

.prompt-list li + li {
    margin-top: 12px;
}

.chat-card {
    border-radius: 32px;
    padding: 24px;
}

.chat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.chat-title {
    font-size: 24px;
    font-weight: 800;
}

.chat-subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.chat-state {
    white-space: nowrap;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border: 1px solid rgba(41, 147, 200, 0.12);
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 420px;
    max-height: 620px;
    overflow-y: auto;
    padding: 24px 4px 20px;
}

.message {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.message.user {
    justify-content: flex-end;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
    box-shadow: 0 8px 20px rgba(41, 147, 200, 0.22);
}

.message.user .avatar {
    background: linear-gradient(180deg, #87d0eb, #50abd7);
}

.bubble-wrap {
    max-width: min(78%, 760px);
}

.message.user .bubble-wrap {
    text-align: right;
}

.message-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin: 0 6px 6px;
}

.bubble {
    padding: 16px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.65;
    word-break: break-word;
    white-space: pre-wrap;
}

.message.assistant .bubble {
    background: #f2f9fd;
    color: var(--text);
    border: 1px solid rgba(87, 179, 221, 0.18);
    border-top-left-radius: 8px;
}

.message.user .bubble {
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
    color: #fff;
    border-top-right-radius: 8px;
}

.composer {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.composer-label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

#message-input {
    width: 100%;
    resize: vertical;
    min-height: 96px;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px 18px;
    font: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

#message-input:focus {
    border-color: rgba(41, 147, 200, 0.42);
    box-shadow: 0 0 0 5px rgba(87, 179, 221, 0.12);
}

#message-input::placeholder {
    color: #97a7ba;
}

.composer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 14px;
}

.status-line {
    color: var(--muted);
    font-size: 14px;
}

#send-button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 14px 24px;
    min-width: 154px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
    box-shadow: 0 10px 26px rgba(41, 147, 200, 0.25);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

#send-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(41, 147, 200, 0.30);
}

#send-button:active {
    transform: translateY(0);
}

#send-button:disabled,
#message-input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 960px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .site-header,
    .chat-head,
    .composer-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-badge,
    .chat-state {
        white-space: normal;
    }

    .bubble-wrap {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 18px, 100%);
    }

    .header-logo {
        width: 64px;
        height: 64px;
    }

    .brand-name {
        font-size: 26px;
    }

    .hero-card,
    .chat-card {
        padding: 18px;
        border-radius: 22px;
    }

    .intro-card h1 {
        font-size: 28px;
    }

    .lead {
        font-size: 15px;
        line-height: 1.6;
    }

    .messages {
        min-height: 340px;
        max-height: 500px;
        padding-top: 18px;
    }

    .message {
        gap: 8px;
    }

    .avatar {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

    .bubble {
        font-size: 14px;
        padding: 14px 15px;
    }

    #send-button {
        width: 100%;
    }
}
