* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: #eef5fb;
    color: #10233a;
}

button,
input,
textarea {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.chat-card {
    width: 100%;
    max-width: 560px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dbe6f0;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(16, 35, 58, 0.12);
}

.chat-head {
    padding: 26px;
    background: #0e2942;
    color: #ffffff;
}

.eyebrow {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    opacity: 0.78;
}

.chat-head h1 {
    margin: 0;
    font-size: 28px;
}

.chat-head p {
    margin: 8px 0 0;
    color: #c2d2df;
    line-height: 1.5;
}

.chat-body {
    padding: 26px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #38516a;
}

.input,
.message-box {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #ccd9e5;
    border-radius: 10px;
    outline: none;
    background: #ffffff;
    color: #10233a;
}

.input:focus,
.message-box:focus {
    border-color: #1676bd;
    box-shadow: 0 0 0 3px rgba(22, 118, 189, 0.10);
}

.message-box {
    resize: vertical;
}

.primary-button {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 13px 16px;
    cursor: pointer;
    background: #0879c9;
    color: #ffffff;
    font-weight: 700;
}

.primary-button:hover {
    background: #0669af;
}

.primary-button:disabled {
    cursor: default;
    opacity: 0.62;
}

.primary-button.compact {
    width: auto;
    min-width: 100px;
}

.message {
    margin-bottom: 16px;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.message.success {
    border: 1px solid #b9e3c8;
    background: #ecf9f1;
    color: #206638;
}

.message.error {
    margin-top: 18px;
    border: 1px solid #f1c3c3;
    background: #fff0f0;
    color: #922b2b;
}

.conversation-meta {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.78;
}

.conversation-messages {
    min-height: 220px;
    max-height: 420px;
    overflow-y: auto;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #dbe6f0;
    border-radius: 12px;
    background: #f8fbfd;
}

.message-row {
    display: flex;
    margin-bottom: 12px;
}

.message-row.customer {
    justify-content: flex-end;
}

.message-row.agent {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 12px;
}

.chat-bubble.customer {
    background: #0879c9;
    color: #ffffff;
}

.chat-bubble.agent {
    background: #e8f0f7;
    color: #10233a;
}

.chat-message-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message-meta {
    margin-top: 5px;
    font-size: 11px;
    opacity: 0.72;
}

.empty-messages {
    padding: 18px 0;
    text-align: center;
    opacity: 0.65;
}

.reply-area {
    margin-top: 16px;
}

.reply-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.small-status {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.68;
}

@media (max-width: 600px) {
    .page-shell {
        align-items: stretch;
        padding: 0;
    }

    .chat-card {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .chat-head,
    .chat-body {
        padding-left: 20px;
        padding-right: 20px;
    }
}
