.chat-drawer-shell {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
}

.chat-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.chat-drawer-panel {
    position: relative;
    width: min(420px, 100vw);
    height: 100%;
    background: #ffffff;
    box-shadow: -18px 0 45px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;
}

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

.chat-drawer-title-group {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.chat-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.chat-drawer-meta {
    margin-bottom: 1rem;
}

.chat-meta-line {
    margin-top: 0.4rem;
}

.chat-intro {
    font-size: 0.95rem;
    color: #475569;
    margin-top: 0.75rem;
}

.chat-history {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.25rem 0.15rem 0.75rem;
}

.chat-message-row {
    display: flex;
}

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

.chat-message-row.assistant,
.chat-message-row.system {
    justify-content: flex-start;
}

.chat-message-bubble {
    max-width: 88%;
    border-radius: 14px;
    padding: 0.8rem 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.chat-message-row.member .chat-message-bubble {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.chat-message-row.system .chat-message-bubble {
    background: #fff7ed;
    border-color: #fed7aa;
}

.chat-message-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-message-text {
    white-space: pre-wrap;
    word-break: break-word;
    color: #0f172a;
}

.chat-media-row .chat-message-bubble {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-media-preview {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: #0f172a;
    cursor: zoom-in;
    max-width: 100%;
}

.chat-media-preview img,
.chat-media-preview video {
    display: block;
    width: 100%;
    max-height: min(36vh, 260px);
    object-fit: cover;
}

.chat-media-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 5;
}

.chat-media-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.chat-media-copy {
    color: #334155;
}

.lightbox-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1300;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.lightbox-backdrop.active {
    display: flex;
}

.lightbox-img {
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 2.2rem;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1301;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-align: center;
    max-width: 86%;
    font-size: 0.95rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    white-space: pre-wrap;
}

.chat-empty-state {
    padding: 1.25rem;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    text-align: center;
    color: #64748b;
}

.chat-drawer-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}

.chat-clear-form {
    display: flex;
}

.chat-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.chat-quick-media-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
}

.chat-quick-media-button {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
}

.chat-quick-media-price {
    font-weight: 600;
    color: #334155;
}

.chat-form-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    color: #475569;
    font-size: 0.9rem;
}

.chat-form-status[hidden] {
    display: none !important;
}

[data-chat-submit-button][disabled] {
    cursor: not-allowed;
    opacity: 0.65;
}

body.chat-drawer-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .chat-drawer-panel {
        width: 100vw;
        max-width: 100vw;
    }
}

.capitalize_txt {
    text-transform: capitalize;
}
