.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-display-name-form-initial {
    margin-bottom: 0.85rem;
}

.chat-member-profile-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(7.5rem, auto) auto;
    align-items: stretch;
    gap: 0;
}

.chat-member-profile-controls input,
.chat-member-profile-controls select,
.chat-member-profile-controls .button {
    min-width: 0;
    min-height: 2.6rem;
    border-radius: 0;
}

.chat-member-profile-controls input,
.chat-member-profile-controls select {
    border: 1px solid rgba(34, 36, 38, 0.15);
    color: rgba(0, 0, 0, 0.87);
    font: inherit;
    padding: 0.65rem 0.75rem;
}

.chat-member-profile-controls input {
    border-top-left-radius: 0.28571429rem;
    border-bottom-left-radius: 0.28571429rem;
}

.chat-member-profile-controls select {
    border-left: 0;
    background: #ffffff;
}

.chat-member-profile-controls .button {
    border-top-right-radius: 0.28571429rem;
    border-bottom-right-radius: 0.28571429rem;
}

.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-clear-group {
    position: relative;
    display: flex;
}

.chat-clear-popover {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.55rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    z-index: 4;
}

.chat-clear-popover[hidden] {
    display: none !important;
}

.chat-clear-popover-text {
    font-size: 0.82rem;
    color: #334155;
    margin-bottom: 0.45rem;
}

.chat-clear-popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.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-media-request-modal.ui.modal {
    width: min(360px, calc(100% - 1.25rem)) !important;
    max-width: 360px;
}

.chat-media-request-modal.ui.modal > .header {
    padding: 0.85rem 1rem;
    font-size: 1.15rem;
}

.chat-media-request-modal.ui.modal > .content {
    padding: 0.85rem 1rem 1rem !important;
}

.chat-request-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
}

.chat-media-request-modal[data-chat-request-mode="pic"] .chat-request-option:not([data-chat-request-option="pic"]),
.chat-media-request-modal[data-chat-request-mode="video"] .chat-request-option:not([data-chat-request-option="video"]),
.chat-media-request-modal[data-chat-request-mode="topup"] .chat-request-option:not([data-chat-request-option="topup"]),
.chat-media-request-modal:not([data-chat-request-mode]) .chat-request-option:not([data-chat-request-option="pic"]) {
    display: none !important;
}

.chat-media-request-modal .chat-request-option[hidden] {
    display: none !important;
}

.chat-media-request-modal .chat-request-summary.ui.message {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.75rem;
    line-height: 1.32;
}

.chat-media-request-modal .ui.segment {
    padding: 0.85rem;
}

.chat-media-request-modal .chat-request-option-card {
    margin: 0;
    border-radius: 8px;
    box-shadow: none;
}

.chat-media-request-modal .ui.header {
    font-size: 0.98rem;
    line-height: 1.18;
    margin: 0 0 0.65rem;
}

.chat-media-request-modal .ui.button {
    font-size: 0.86rem;
    line-height: 1.1;
    white-space: normal;
    min-height: 2.45rem;
}

.chat-media-request-modal .chat-admin-checkout-form .ui.button {
    min-height: 2.15rem;
}

.chat-admin-checkout-form {
    margin-top: 0.65rem;
}

.chat-topup-row {
    margin: -0.25rem 0 0.65rem;
}

.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;
}
