.chat-menu {
    grid-area: chat-menu;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-area {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: 1rem 1rem 0;
}

.chat-empty {
    display: grid;
    place-items: center;
    gap: 0.75rem;
    margin: 1rem;
    padding: 2rem;
    border: 1px dashed rgba(180, 83, 9, 0.25);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.chat-empty h3,
.chat-empty p {
    margin: 0;
}

.messages {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: 100%;
    overflow: auto;
    padding: 0.2rem 0.3rem 0.4rem;
}

.message {
    align-self: flex-start;
    max-width: min(72ch, 80%);
    padding: 0.95rem 1rem;
    border-radius: 20px 20px 20px 8px;
    background: white;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.message.sent {
    align-self: flex-end;
    color: white;
    background: linear-gradient(135deg, #d97706, #9a3412);
    border-radius: 20px 20px 8px 20px;
}

.message-author,
.message-text,
.message-date {
    margin: 0;
}

.message-author {
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.message-text {
    line-height: 1.5;
}

.message-date {
    display: block;
    margin-top: 0.45rem;
    color: rgba(15, 23, 42, 0.55);
    font-size: 0.8rem;
}

.message.sent .message-date,
.message.sent .message-author {
    color: rgba(255, 237, 213, 0.82);
}

.chat-footer {
    position: relative;
    z-index: 4;
    padding: 1rem;
    background: rgba(250, 245, 240, 0.96);
    border-top: 1px solid var(--line);
}

.composer-dialog {
    padding: 0;
    border: none;
    background: transparent;
}

.composer-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
}

.composer-card {
    width: min(92vw, 520px);
    padding: 1.25rem;
    border-radius: 24px;
    background: #fff7ed;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.composer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.composer-head h3 {
    margin: 0.15rem 0 0;
}

.composer-close {
    border: none;
    background: transparent;
    color: var(--accent-2);
    font-size: 2rem;
    line-height: 1;
}

.composer-label {
    display: block;
    margin: 0.85rem 0 0.35rem;
    font-weight: 700;
}

.composer-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(180, 83, 9, 0.18);
    border-radius: 16px;
    background: white;
}

.composer-textarea {
    resize: vertical;
    min-height: 110px;
}

.composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.chat-input {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.8rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.08);
}

#msgInput {
    width: 100%;
    min-height: 52px;
    max-height: 120px;
    resize: none;
    padding: 0.85rem 0.95rem;
    border: none;
    outline: none;
    border-radius: 16px;
    background: rgba(255, 250, 245, 0.95);
}

.send-btn {
    flex: 0 0 auto;
    padding: 0.95rem 1.15rem;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, #d97706, var(--accent-2));
}

@media (max-width: 720px) {
    .message {
        max-width: 90%;
    }

    .chat-footer {
        padding-top: 0.5rem;
    }

    .chat-input {
        flex-direction: column;
        align-items: stretch;
    }

    .send-btn {
        width: 100%;
    }
}
