.chat-body {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 2rem;
}

.chat-shell {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
}

.hero-card,
.chat-card {
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 75vh;
}

.hero-card h1 {
    margin: 0.5rem 0 1rem;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1.05;
}

.hero-card p {
    line-height: 1.9;
    color: var(--muted);
}

.admin-link {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(12, 124, 89, 0.12);
    color: var(--primary-dark);
}

.chat-card {
    display: flex;
    flex-direction: column;
    min-height: 75vh;
}

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

.chat-header h2 {
    margin: 0 0 0.35rem;
}

.chat-header p {
    margin: 0;
    color: var(--muted);
}

.messages {
    flex: 1;
    padding: 1.5rem;
    overflow: auto;
    display: grid;
    gap: 1rem;
}

.message {
    display: flex;
}

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

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

.bubble {
    max-width: min(78%, 720px);
    padding: 1rem 1.1rem;
    border-radius: 18px;
    line-height: 1.85;
    white-space: pre-wrap;
}

.message.user .bubble {
    background: rgba(12, 124, 89, 0.12);
    border-bottom-right-radius: 6px;
}

.message.assistant .bubble {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(70, 49, 31, 0.08);
    border-bottom-left-radius: 6px;
}

.message-meta {
    margin-top: 0.65rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.message-meta button,
.source-chip,
.suggestion-chip {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.88rem;
}

.suggestions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    padding: 0 1.5rem 1rem;
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.9rem;
    padding: 0 1.5rem 1rem;
}

.chat-form textarea {
    min-height: 62px;
    max-height: 180px;
}

.helper-text {
    padding: 0 1.5rem 1.5rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.typing {
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 960px) {
    .chat-body {
        padding: 1rem;
    }

    .chat-shell {
        grid-template-columns: 1fr;
    }

    .hero-card {
        min-height: auto;
        gap: 1.5rem;
    }

    .chat-card {
        min-height: 72vh;
    }

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