/* The reference's card is shared with transfer, but red packets retain its 250px size. */
.chat-view .conversation-message-row .conversation-bubble.is-red-packet {
    width: 250px; max-width: 100%; padding: 0; border: 0; border-radius: 20px; background: transparent; box-shadow: none;
}
.chat-view .conversation-red-packet-column { width: 250px; max-width: calc(100% - 46px); flex: 0 0 auto; }
.chat-view .is-outgoing .conversation-red-packet-column { margin-left: auto; text-align: right; }
.chat-view .is-incoming .conversation-red-packet-column { text-align: left; }
.chat-red-packet-card.editorial-card { zoom: 1; max-width: 100%; }
.chat-red-packet-card .content-value, .chat-red-packet-card .content-title { overflow-wrap: anywhere; }

/* Original red-packet modal declarations, scoped to the native dialog. */
.chat-red-packet-dialog, .chat-red-packet-dialog * {
    box-sizing: border-box; margin: 0; padding: 0; font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.chat-red-packet-dialog {
    position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
    background: transparent; border: 0; color: #000; font: 400 16px/normal 'Inter', 'Noto Serif SC', sans-serif;
    justify-content: center; align-items: center;
}
.chat-red-packet-dialog[open] { display: flex; }
.chat-red-packet-dialog::backdrop { background-color: rgba(0, 0, 0, 0.45); }
.chat-red-packet-dialog .modal-content {
    background-color: #FFFFFF; border-radius: 20px; width: 290px;
    max-height: 90vh; overflow-y: auto; padding: 32px 24px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15); border: 1px solid #EAEAEA;
    text-align: center; transform: translateY(0) scale(1);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-red-packet-dialog .modal-content::-webkit-scrollbar { display: none; }
.chat-red-packet-dialog .modal-title { font-family: 'Noto Serif SC', serif; font-size: 16px; font-weight: 600; margin-bottom: 8px; color: #000; }
.chat-red-packet-dialog .modal-desc { font-size: 12px; color: #666; }
.chat-red-packet-dialog .btn {
    flex: 1; padding: 12px 0; border-radius: 10px; font-size: 13px; font-weight: 600;
    cursor: pointer; border: none; outline: none; font-family: 'Noto Serif SC', serif;
}
.chat-red-packet-dialog .btn-reject { background-color: #FFF; border: 1px solid #000; color: #000; }
.chat-red-packet-dialog .content-value { font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 600; letter-spacing: -1px; line-height: 1.1; color: #000; margin-bottom: 12px; }
.chat-red-packet-dialog .open-btn-wrapper { margin: 24px auto; width: 64px; height: 64px; border-radius: 50%; background-color: #000; color: #FFF; display: flex; justify-content: center; align-items: center; font-family: 'Noto Serif SC', serif; font-size: 18px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 16px rgba(0,0,0,0.2); }
.chat-red-packet-dialog .animating-flip { pointer-events: none; animation: packetFlipSpin 0.8s cubic-bezier(0.45, 0, 0.55, 1) forwards; }
@keyframes packetFlipSpin { 0% { transform: rotateY(0deg); } 50% { transform: rotateY(180deg) scale(1.1); } 100% { transform: rotateY(360deg) scale(0); opacity: 0; } }
.chat-red-packet-dialog .fade-in-up { animation: packetFadeInUp 0.5s ease forwards; }
@keyframes packetFadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chat-red-packet-dialog .packet-result { display: flex; flex-direction: column; align-items: center; }
.chat-red-packet-dialog .record-section { width: 100%; margin-top: 20px; text-align: left; }
.chat-red-packet-dialog .record-header { font-size: 11px; color: #666; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #000; }
.chat-red-packet-dialog .record-list { display: flex; flex-direction: column; }
.chat-red-packet-dialog .record-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 0.5px solid #F0F0F0; }
.chat-red-packet-dialog .record-item:last-child { border-bottom: none; }
.chat-red-packet-dialog .record-user { display: flex; align-items: center; gap: 12px; }
.chat-red-packet-dialog .avatar-box { width: 32px; height: 32px; border: 1px solid #000; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; }
.chat-red-packet-dialog .user-details { display: flex; flex-direction: column; gap: 2px; }
.chat-red-packet-dialog .user-name { font-family: 'Noto Serif SC', serif; font-size: 12px; font-weight: 500; color: #000; display: flex; align-items: center; }
.chat-red-packet-dialog .user-time { font-family: 'Inter', sans-serif; font-size: 10px; color: #999; }
.chat-red-packet-dialog .record-amount { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 600; color: #000; }
.chat-red-packet-dialog .best-luck-tag { font-family: 'Noto Serif SC', serif; font-size: 9px; background-color: #000; color: #FFF; padding: 2px 6px; border-radius: 4px; margin-left: 6px; font-weight: 400; letter-spacing: 0.5px; }
.chat-red-packet-dialog [role="button"]:focus-visible, .chat-red-packet-dialog button:focus-visible { outline: 2px solid #777; outline-offset: 3px; }
.chat-red-packet-dialog .modal-title, .chat-red-packet-dialog .user-name { overflow-wrap: anywhere; }
