.chat-room-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 18px 60px;
}

.chat-room-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
}

.chat-room-title {
    margin: 0;
    font-size: 34px;
    font-weight: 900;
    color: #70482c;
    letter-spacing: -0.7px;
}

.chat-room-subtitle {
    margin: 10px 0 0;
    color: #8b6a55;
    line-height: 1.7;
    font-size: 15px;
}

.chat-room-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-room-menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #f0d7c1;
    color: #70482c;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow:
            0 6px 14px rgba(181, 132, 86, 0.09),
            inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.chat-room-menu-link:hover {
    background: #fff7ef;
    transform: translateY(-1px);
}

.chat-room-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-room-wide-card {
    width: 100%;
    max-width: 860px;
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 249, 243, 0.97) 100%);
    border: 1px solid #f1dfcf;
    box-shadow:
            8px 10px 22px rgba(186, 130, 77, 0.12),
            -2px -2px 10px rgba(255, 255, 255, 0.72),
            inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.chat-room-products {
    display: grid;
    grid-template-columns: 1fr 44px 1fr;
    gap: 12px;
    align-items: center;
}

.chat-room-product-box {
    min-width: 0;
    padding: 12px;
    border-radius: 24px;
    background: #fff8f1;
    border: 1px solid #f2ddc8;
}

.chat-room-product-label {
    margin-bottom: 8px;
    color: #8b603f;
    font-size: 12px;
    font-weight: 900;
}

.chat-room-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    overflow: hidden;
    background: #fff1e4;
    border: 1px solid #f2ddc8;
}

.chat-room-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-room-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a47b60;
    font-size: 13px;
    font-weight: 800;
}

.chat-room-product-name {
    margin-top: 9px;
    color: #70482c;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-room-swap-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    font-weight: 900;
    background: linear-gradient(180deg, #ffbd73 0%, #ff9f3f 100%);
    box-shadow:
            0 8px 18px rgba(255, 150, 58, 0.20),
            inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.chat-room-summary {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 4px 4px;
}

.chat-room-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.chat-room-card-title {
    margin: 0;
    color: #70482c;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.4px;
}

.chat-room-card-desc {
    margin: 7px 0 0;
    color: #8b6a55;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.chat-room-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff3e7;
    border: 1px solid #f0d7c1;
    color: #8b603f;
    font-size: 12px;
    font-weight: 900;
}

.chat-room-info-row-wide {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 16px;
    background: #fff7ef;
    border: 1px solid #f4dfcb;
}

.chat-room-info-row-wide span {
    color: #8b603f;
    font-size: 13px;
    font-weight: 900;
}

.chat-room-info-row-wide strong {
    color: #6d5140;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
}

.chat-room-enter-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffb25f 0%, #ff9638 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    box-shadow:
            0 8px 18px rgba(255, 150, 58, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.chat-room-enter-button:hover {
    transform: translateY(-1px);
}

.chat-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    height: calc(100vh - 86px);
}

.chat-surface {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 249, 243, 0.96) 100%);
    border: 1px solid #f1dfcf;
    box-shadow:
            8px 10px 24px rgba(209, 167, 124, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #fff4e8 0%, #ffe7d1 100%);
    border-bottom: 1px solid #f2dcc7;
}

.chat-header h1 {
    margin: 0;
    font-size: 26px;
    color: #71482d;
}

.chat-partner {
    margin-top: 6px;
    color: #8b6b55;
    font-size: 14px;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    background: linear-gradient(180deg, #fff8f3 0%, #fff2e6 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message-row {
    display: flex;
    flex-direction: column;
    max-width: 72%;
}

.message-row.my-row {
    align-self: flex-end;
    align-items: flex-end;
}

.message-row.other-row {
    align-self: flex-start;
    align-items: flex-start;
}

.sender-name {
    margin-bottom: 6px;
    color: #916f59;
    font-size: 13px;
    font-weight: 700;
}

.message-bubble {
    padding: 14px 16px;
    border-radius: 22px;
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: 5px 7px 14px rgba(186, 145, 103, 0.1);
}

.my-bubble {
    background: linear-gradient(135deg, #ffcb95, #ffb977);
    color: #6c3f1f;
    border-bottom-right-radius: 8px;
}

.other-bubble {
    background: #ffffff;
    color: #5d493d;
    border-bottom-left-radius: 8px;
    border: 1px solid #f0dfd0;
}

.message-time {
    margin-top: 6px;
    color: #a07e67;
    font-size: 12px;
}

.send-box {
    display: flex;
    gap: 12px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #f0dfd0;
}

.send-box input {
    flex: 1;
    min-height: 50px;
}

.send-box button {
    min-width: 100px;
}

@media (max-width: 768px) {
    .chat-room-page {
        padding: 22px 14px 50px;
    }

    .chat-room-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-room-title {
        font-size: 29px;
    }

    .chat-room-subtitle {
        font-size: 14px;
    }

    .chat-room-header-actions {
        width: 100%;
    }

    .chat-room-menu-link {
        flex: 1;
    }

    .chat-room-wide-card {
        max-width: 100%;
        grid-template-columns: 1fr;
    }

    .chat-room-products {
        grid-template-columns: 1fr 38px 1fr;
    }

    .chat-room-swap-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .chat-page {
        padding-left: 16px;
        padding-right: 16px;
    }
}