/* nexus-messenger.css
 * Styles for the Messages and Support panels inside the Nexus Terminal.
 * Dark-theme default matching chatbot-styles.css; light-theme overrides at bottom.
 */

/* ══════════════════════════════════════════════════════════════
   SIDEBAR — left panel (conversation / ticket list)
══════════════════════════════════════════════════════════════ */

.nxm-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px 7px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    user-select: none;
}

.nxm-section-header .material-symbols-outlined {
    font-size: 15px;
    opacity: 0.6;
}

/* Support header — flex between title and + button */
.nxm-support-hdr {
    justify-content: space-between;
}

.nxm-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(102, 255, 190, 0.1);
    border: 1px solid rgba(102, 255, 190, 0.25);
    border-radius: 6px;
    color: #66ffbe;
    cursor: pointer;
    transition: background 0.15s ease;
}

.nxm-icon-btn:hover {
    background: rgba(102, 255, 190, 0.2);
}

.nxm-icon-btn .material-symbols-outlined { font-size: 14px; }

/* Scrollable list container */
.nxm-scroll-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* ── List item (DMs + tickets) ───────────────────────────────── */
.nxm-list-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.nxm-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.nxm-list-item.is-active {
    background: rgba(102, 255, 190, 0.07);
    border-left: 2px solid #66ffbe;
}

.nxm-list-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.nxm-list-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nxm-list-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Support sidebar + ticket header: reference code (0 · id / 1 · id) — color by kind + active/inactive lifecycle */
.nxm-ticket-ref-copy {
    display: inline-flex;
    align-items: center;
    max-width: min(100%, 14rem);
    margin: 0;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.nxm-ticket-ref-copy:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}
.nxm-ticket-ref-copy:focus {
    outline: none;
}
.nxm-ticket-ref-copy:focus-visible {
    outline: 2px solid rgba(102, 255, 190, 0.45);
    outline-offset: 2px;
}

.nxm-list-name.nxm-ticket-ref-title--kind0-active,
.nxm-ticket-ref-copy.nxm-ticket-ref-title--kind0-active {
    color: rgba(255, 255, 255, 0.88);
}
.nxm-list-name.nxm-ticket-ref-title--kind1-active,
.nxm-ticket-ref-copy.nxm-ticket-ref-title--kind1-active {
    color: #66ffbe;
}
.nxm-list-name.nxm-ticket-ref-title--inactive,
.nxm-ticket-ref-copy.nxm-ticket-ref-title--inactive {
    color: rgba(255, 255, 255, 0.38);
}

.nxm-list-preview {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.38);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nxm-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.nxm-list-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

/* Red unread count badge */
.nxm-unread-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
}

/* ── Official channel items ───────────────────────────────────── */
.nxm-official-item {
    gap: 10px;
}

.nxm-ch-icon {
    font-size: 20px;
    color: rgba(102, 255, 190, 0.65);
    flex-shrink: 0;
}

/* ── Ticket items ─────────────────────────────────────────────── */
.nxm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nxm-type-label {
    text-transform: capitalize;
}

/* Empty / loading states in sidebar */
.nxm-empty-list {
    padding: 18px 14px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.28);
    text-align: center;
    line-height: 1.6;
}

.nxm-list-loading {
    padding: 12px 14px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   RIGHT PANEL — chat / ticket view
══════════════════════════════════════════════════════════════ */

/* ── Chat header ─────────────────────────────────────────────── */
.nxm-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.nxm-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

.nxm-chat-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nxm-ch-icon-lg {
    font-size: 22px;
    color: #66ffbe;
    flex-shrink: 0;
}

.nxm-readonly-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ticket header extras */
.nxm-ticket-hdr {
    flex-wrap: wrap;
    gap: 6px;
}

.nxm-ticket-hdr-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.nxm-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: capitalize;
    width: fit-content;
}

.nxm-status-sel {
    padding: 5px 8px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

/* Dark terminal: status/priority selects match panel + readable option list */
html:not(.theme-earth-sky) .nxm-staff-controls .nxm-status-sel,
html:not(.theme-earth-sky) .nxm-ticket-hdr .nxm-status-sel {
    color-scheme: dark;
    background-color: rgba(18, 20, 26, 0.95);
    color: rgba(255, 255, 255, 0.88);
}
html:not(.theme-earth-sky) .nxm-status-sel:focus {
    outline: none;
    border-color: rgba(102, 255, 190, 0.35);
    box-shadow: 0 0 0 1px rgba(102, 255, 190, 0.15);
}
.nxm-status-sel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
html:not(.theme-earth-sky) .nxm-status-sel option,
html:not(.theme-earth-sky) .nxm-priority-sel option {
    background-color: #16181d;
    color: rgba(255, 255, 255, 0.92);
}
html.theme-earth-sky .nxm-status-sel:focus {
    outline: none;
    border-color: rgba(74, 144, 226, 0.45);
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.12);
}

.nxm-reactivation-meta {
    margin: 10px 12px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(102, 255, 190, 0.05);
    border: 1px solid rgba(102, 255, 190, 0.16);
}

.nxm-reactivation-meta-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nxm-reactivation-meta-head .material-symbols-outlined {
    font-size: 14px;
    color: #66ffbe;
}

.nxm-reactivation-ref {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(102, 255, 190, 0.28);
    background: rgba(102, 255, 190, 0.08);
    color: #84ffcf;
    font-size: 0.66rem;
    font-weight: 700;
}

.nxm-reactivation-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.nxm-reactivation-meta-item {
    padding: 8px 9px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nxm-reactivation-meta-label {
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.48);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nxm-reactivation-meta-value {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* ── Message scroll area ─────────────────────────────────────── */
.nxm-msgs-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.nxm-msgs-wrap::-webkit-scrollbar       { width: 4px; }
.nxm-msgs-wrap::-webkit-scrollbar-track { background: transparent; }
.nxm-msgs-wrap::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }

.nxm-no-msgs,
.nxm-msg-loading {
    margin: auto;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.25);
}

/* ── Message bubbles ─────────────────────────────────────────── */
.nxm-msg {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    max-width: 85%;
    position: relative; /* anchor for .nxm-unsend-btn */
}

.nxm-in  { align-self: flex-start; }
.nxm-out { align-self: flex-end; flex-direction: row-reverse; }

.nxm-avatar-slot {
    width: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex-shrink: 0;
}

.nxm-msg-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 100%;
}

.nxm-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.nxm-bubble {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.83rem;
    line-height: 1.5;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nxm-in  .nxm-bubble {
    background: rgba(255, 255, 255, 0.07);
    border-bottom-left-radius: 4px;
    color: rgba(255, 255, 255, 0.82);
}

/* Own bubbles — shape + smooth color transition; color is set by state class below */
.nxm-out .nxm-bubble {
    border-bottom-right-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    transition: background-color 0.5s ease, border-color 0.5s ease, opacity 0.3s ease;
}

/* ── Bubble delivery/read state — bubble color IS the receipt indicator ── */

/* Pending: muted grey — message is still leaving the device */
.nxm-bbl-pending {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0.72;
}

/* Sent / Delivered: silver-white — confirmed on server, not yet read */
.nxm-bbl-sent {
    background: rgba(210, 220, 240, 0.14);
    border: 1px solid rgba(210, 220, 240, 0.28);
}

/* Read: blue — partner has opened the conversation */
.nxm-bbl-read {
    background: rgba(74, 144, 226, 0.25);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

/* Failed: red tint — could not send */
.nxm-bbl-failed {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

.nxm-bubble p { margin: 0; white-space: pre-wrap; }

/* Staff bubble */
.nxm-staff-bubble {
    background: rgba(102, 255, 190, 0.07);
    border: 1px solid rgba(102, 255, 190, 0.15);
}

/* Support ticket: your public reply (no DM delivery class) — match incoming bubble weight */
.nxm-out .nxm-bubble.nxm-ticket-own-public {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.88);
}

.nxm-staff-label {
    font-size: 0.65rem;
    color: #66ffbe;
    font-weight: 600;
    opacity: 0.8;
}

/* System message */
.nxm-sys-msg {
    align-self: center;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nxm-sys-msg .material-symbols-outlined { font-size: 13px; }

.nxm-sys-msg-reactivation {
    background: rgba(102, 255, 190, 0.09);
    border-color: rgba(102, 255, 190, 0.22);
    color: rgba(198, 255, 228, 0.92);
}

/* ── Official channel cards ───────────────────────────────────── */
.nxm-official-card {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nxm-official-card.nxm-pinned {
    border-color: rgba(102, 255, 190, 0.2);
    background: rgba(102, 255, 190, 0.04);
}

.nxm-pin-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.67rem;
    color: #66ffbe;
    font-weight: 600;
    opacity: 0.75;
}

.nxm-pin-label .material-symbols-outlined { font-size: 13px; }

.nxm-official-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.nxm-official-img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    max-height: 160px;
}

.nxm-official-body {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Input row (DMs + ticket replies) ────────────────────────── */
.nxm-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.nxm-input {
    flex: 1;
    resize: none;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.88);
    font-family: inherit;
    font-size: 0.84rem;
    line-height: 1.45;
    min-height: 36px;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.15s ease;
    scrollbar-width: none;
}

.nxm-input:focus {
    outline: none;
    border-color: rgba(102, 255, 190, 0.3);
}

.nxm-input::placeholder { color: rgba(255, 255, 255, 0.25); }

.nxm-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #4a90e2;
    border: none;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.nxm-send-btn:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.nxm-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.nxm-send-btn .material-symbols-outlined { font-size: 18px; }

/* Closed ticket bar */
.nxm-closed-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.12);
    font-size: 0.77rem;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.nxm-closed-bar .material-symbols-outlined { font-size: 14px; }

.nxm-closed-bar--staff {
    background: rgba(74, 144, 226, 0.08);
    color: rgba(255, 255, 255, 0.55);
}

/* Support claim bar (staff) */
.nxm-claim-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px 12px;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.nxm-claim-bar--action {
    justify-content: space-between;
    background: rgba(245, 158, 11, 0.08);
    color: rgba(255, 255, 255, 0.75);
}
.nxm-claim-bar--yours {
    background: rgba(34, 197, 94, 0.1);
    color: rgba(255, 255, 255, 0.85);
    gap: 10px;
}
.nxm-claim-bar--readonly {
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.5);
}
.nxm-claim-btn,
.nxm-claim-release-btn {
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    background: rgba(74, 144, 226, 0.35);
    color: #fff;
}
.nxm-claim-release-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
}

/* Staff two-column transcript / internal */
.nxm-msgs-wrap--staff {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.nxm-support-split {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    gap: 0;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}
@media (max-width: 720px) {
    .nxm-support-split {
        grid-template-columns: 1fr;
    }
}
.nxm-support-split-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.nxm-support-split-col--internal {
    background: rgba(0, 0, 0, 0.12);
}
.nxm-support-split-col--internal .nxm-support-split-body {
    padding: 8px 7px;
}
.nxm-support-split-col--internal .nxm-msg {
    max-width: 100%;
    gap: 5px;
}
.nxm-support-split-col--internal .nxm-msg-avatar {
    display: none;
}
.nxm-support-split-col--internal .nxm-bubble {
    font-size: 0.78rem;
    padding: 6px 9px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.nxm-support-split-col--internal .nxm-internal-tag {
    font-size: 0.58rem;
    margin-bottom: 2px;
}
.nxm-support-split-col--internal .nxm-msg-time {
    font-size: 0.65rem;
}
.nxm-support-split-col:last-child {
    border-right: none;
}
.nxm-support-split-hdr {
    padding: 6px 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.nxm-support-split-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 8px 10px;
}
.nxm-no-msgs--inline {
    padding: 12px 8px;
    font-size: 0.8rem;
}
.nxm-internal-tag {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(251, 191, 36, 0.95);
    margin-bottom: 4px;
}
.nxm-bubble-internal {
    border: 1px solid rgba(251, 191, 36, 0.28);
    background: rgba(251, 191, 36, 0.04);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.12);
}

.nxm-ticket-input-block {
    flex-direction: column;
    align-items: stretch;
}
.nxm-input-row-inner {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.nxm-internal-flag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    user-select: none;
    margin-bottom: 4px;
}
.nxm-internal-flag input {
    accent-color: #fbbf24;
}

/* ══════════════════════════════════════════════════════════════
   NEW TICKET FORM
══════════════════════════════════════════════════════════════ */

.nxm-form-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nxm-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.02em;
}

.nxm-label small { font-weight: 400; opacity: 0.7; }

.nxm-select,
.nxm-field {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.85);
    font-family: inherit;
    font-size: 0.84rem;
    transition: border-color 0.15s ease;
}

.nxm-select:focus,
.nxm-field:focus {
    outline: none;
    border-color: rgba(102, 255, 190, 0.3);
}

.nxm-field-textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
    line-height: 1.5;
}

.nxm-select option {
    background: #181a23;
    color: rgba(255, 255, 255, 0.85);
}

.nxm-submit-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: #4a90e2;
    color: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
    align-self: flex-start;
}

.nxm-submit-btn:hover:not(:disabled) {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.nxm-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.nxm-hint {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.28);
    margin: 0;
    line-height: 1.5;
}
.nxm-hint.is-success { color: #66ffbe; }
.nxm-hint.is-error { color: #ff7d7d; }

/* ══════════════════════════════════════════════════════════════
   RIGHT PANEL EMPTY STATE
══════════════════════════════════════════════════════════════ */

.nxm-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.22);
    font-size: 0.8rem;
    text-align: center;
    padding: 24px;
    user-select: none;
}

.nxm-empty-state .material-symbols-outlined {
    font-size: 38px;
    opacity: 0.3;
}

.nxm-empty-state p { margin: 0; }

/* ══════════════════════════════════════════════════════════════
   LEFT PANEL SCROLLBARS
══════════════════════════════════════════════════════════════ */

.nxm-scroll-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.nxm-scroll-list::-webkit-scrollbar       { width: 3px; }
.nxm-scroll-list::-webkit-scrollbar-track { background: transparent; }
.nxm-scroll-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }

/* ══════════════════════════════════════════════════════════════
   SEARCH & FILTER
══════════════════════════════════════════════════════════════ */

.nxm-ticket-filters {
    padding: 8px 10px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.nxm-ticket-search {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.nxm-ticket-search:focus { border-color: rgba(102, 255, 190, 0.4); }
.nxm-ticket-search::placeholder { color: rgba(255, 255, 255, 0.25); }

.nxm-filter-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.nxm-chip {
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.65rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.nxm-chip:hover { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.65); }
.nxm-chip.is-active {
    background: rgba(102, 255, 190, 0.12);
    border-color: rgba(102, 255, 190, 0.3);
    color: #66ffbe;
}

.nxm-filter-chips--staff-buckets {
    flex-wrap: nowrap;
}
.nxm-filter-chips--staff-buckets .nxm-chip {
    flex: 1;
    justify-content: center;
    text-align: center;
    min-width: 0;
}

.nxm-list-preview-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.nxm-ticket-substatus {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
}
.nxm-ticket-substatus--open {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
}
.nxm-ticket-substatus--in_progress {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
}
.nxm-ticket-substatus--resolved {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.22);
}
.nxm-ticket-substatus--closed {
    color: #9ca3af;
    background: rgba(107, 114, 128, 0.14);
    border-color: rgba(107, 114, 128, 0.28);
}

/* ══════════════════════════════════════════════════════════════
   ANIMATED STATUS DOTS
══════════════════════════════════════════════════════════════ */

.nxm-status-dot--open {
    background: #22c55e;
    animation: nxm-pulse 2s ease-in-out infinite;
}
.nxm-status-dot--in_progress {
    background: transparent;
    border: 2px solid #f59e0b;
    width: 6px;
    height: 6px;
    animation: nxm-spin 1.5s linear infinite;
}
.nxm-status-dot--resolved {
    background: #94a3b8;
    position: relative;
}
.nxm-status-dot--closed {
    background: #6b7280;
}

@keyframes nxm-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}
@keyframes nxm-spin {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════════
   PRIORITY BADGES & CHIPS
══════════════════════════════════════════════════════════════ */

.nxm-priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
}
.nxm-priority-badge .material-symbols-outlined { font-size: 12px; }

.nxm-priority--low { color: #6b7280; background: rgba(107, 114, 128, 0.15); }
.nxm-priority--normal { color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
.nxm-priority--high { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }
.nxm-priority--critical { color: #ef4444; background: rgba(239, 68, 68, 0.15); animation: nxm-pulse 1.5s ease-in-out infinite; }

.nxm-priority-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: capitalize;
    width: fit-content;
}

.nxm-ticket-badges {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.nxm-tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nxm-staff-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.nxm-priority-sel {
    min-width: 90px;
}

/* ══════════════════════════════════════════════════════════════
   FORM LAYOUT
══════════════════════════════════════════════════════════════ */

.nxm-form-row {
    display: flex;
    gap: 10px;
}
.nxm-form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════
   MESSAGE ANIMATIONS
══════════════════════════════════════════════════════════════ */

.nxm-msg-enter {
    animation: nxm-msg-slide 0.25s ease-out;
}
@keyframes nxm-msg-slide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   FILE ATTACHMENTS
══════════════════════════════════════════════════════════════ */

.nxm-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.nxm-attach-btn:hover { color: #66ffbe; background: rgba(102, 255, 190, 0.08); }
.nxm-attach-btn .material-symbols-outlined { font-size: 20px; }

.nxm-attachment-preview {
    display: none;
    padding: 6px 10px;
    gap: 6px;
    flex-wrap: wrap;
}
.nxm-attach-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
}
.nxm-attach-thumb {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
}
.nxm-attach-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nxm-attach-remove {
    display: inline-flex;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0;
}
.nxm-attach-remove:hover { color: #ff7d7d; }
.nxm-attach-remove .material-symbols-outlined { font-size: 14px; }
.nxm-attach-item .material-symbols-outlined { font-size: 16px; opacity: 0.5; }

/* Message attachments (inline) */
.nxm-msg-attachments {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
}
.nxm-msg-attach-img {
    display: inline-block;
    max-width: 220px;
    border-radius: 6px;
    overflow: hidden;
}
.nxm-msg-attach-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}
.nxm-msg-attach-file {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(102, 255, 190, 0.8);
    font-size: 0.72rem;
    text-decoration: none;
    transition: background 0.15s;
}
.nxm-msg-attach-file:hover { background: rgba(255, 255, 255, 0.1); }
.nxm-msg-attach-file .material-symbols-outlined { font-size: 16px; }
.nxm-msg-attach-file small { color: rgba(255, 255, 255, 0.3); margin-left: 3px; }

/* ══════════════════════════════════════════════════════════════
   TYPING INDICATOR
══════════════════════════════════════════════════════════════ */

.nxm-typing-bar {
    padding: 6px 14px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nxm-typing-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.nxm-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(102, 255, 190, 0.5);
    animation: nxm-typing-bounce 1.4s ease-in-out infinite;
}
.nxm-typing-dots span:nth-child(2) { animation-delay: 0.16s; }
.nxm-typing-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes nxm-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* ══════════════════════════════════════════════════════════════
   CSAT RATING
══════════════════════════════════════════════════════════════ */

.nxm-csat-prompt {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(102, 255, 190, 0.03);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.nxm-csat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}
.nxm-csat-header .material-symbols-outlined { font-size: 18px; color: #66ffbe; }

.nxm-csat-stars {
    display: flex;
    gap: 4px;
}

.nxm-csat-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: rgba(255, 255, 255, 0.15);
    transition: color 0.15s, transform 0.1s;
}
.nxm-csat-star:hover,
.nxm-csat-star.is-hover { color: #f59e0b; transform: scale(1.15); }
.nxm-csat-star.is-active { color: #f59e0b; }
.nxm-csat-star .material-symbols-outlined { font-size: 28px; }

.nxm-csat-submit {
    align-self: flex-start;
    padding: 6px 16px;
    font-size: 0.75rem;
}

.nxm-csat-result {
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(102, 255, 190, 0.03);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}
.nxm-csat-result .material-symbols-outlined { color: #22c55e; font-size: 16px; }
.nxm-csat-stars-display { color: #f59e0b; letter-spacing: 2px; }

/* ── Leave / View Feedback button inside rating bar ───────────── */
.nxm-csat-feedback-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.68rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.nxm-csat-feedback-btn .material-symbols-outlined { font-size: 14px; }
.nxm-csat-feedback-btn:hover {
    color: #66ffbe;
    border-color: rgba(102, 255, 190, 0.3);
    background: rgba(102, 255, 190, 0.05);
}

/* ── Full-screen feedback form (takes over right panel) ───────── */
.nxm-feedback-form {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.nxm-feedback-form::-webkit-scrollbar       { width: 4px; }
.nxm-feedback-form::-webkit-scrollbar-track  { background: transparent; }
.nxm-feedback-form::-webkit-scrollbar-thumb  { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
.nxm-feedback-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
}
.nxm-feedback-field-wrap {
    position: relative;
}
.nxm-feedback-subject { font-size: 0.85rem; }
.nxm-feedback-content { font-size: 0.8rem; resize: none; min-height: 160px; }
.nxm-feedback-counter {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
}
.nxm-feedback-submit {
    align-self: flex-start;
    margin-top: 10px;
    padding: 8px 22px;
    font-size: 0.8rem;
}

/* ── Full-screen feedback read view ───────────────────────────── */
.nxm-feedback-read {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.nxm-feedback-read::-webkit-scrollbar       { width: 4px; }
.nxm-feedback-read::-webkit-scrollbar-track  { background: transparent; }
.nxm-feedback-read::-webkit-scrollbar-thumb  { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
.nxm-feedback-read-subject {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}
.nxm-feedback-read-content {
    font-size: 0.85rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    white-space: pre-wrap;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
}
.nxm-feedback-read-meta {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ══════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES (html.theme-earth-sky)
══════════════════════════════════════════════════════════════ */

html.theme-earth-sky .nxm-section-header {
    color: rgba(0, 0, 0, 0.45);
    background: rgba(0, 0, 0, 0.03);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

html.theme-earth-sky .nxm-list-item:hover { background: rgba(0, 0, 0, 0.04); }
html.theme-earth-sky .nxm-list-item.is-active { background: rgba(74, 144, 226, 0.07); border-left-color: #4a90e2; }
html.theme-earth-sky .nxm-list-item { border-bottom-color: rgba(0, 0, 0, 0.05); }
html.theme-earth-sky .nxm-list-name { color: rgba(0, 0, 0, 0.82); }
html.theme-earth-sky .nxm-list-name.nxm-ticket-ref-title--kind0-active,
html.theme-earth-sky .nxm-ticket-ref-copy.nxm-ticket-ref-title--kind0-active { color: rgba(0, 0, 0, 0.82); }
html.theme-earth-sky .nxm-list-name.nxm-ticket-ref-title--kind1-active,
html.theme-earth-sky .nxm-ticket-ref-copy.nxm-ticket-ref-title--kind1-active { color: #15803d; }
html.theme-earth-sky .nxm-list-name.nxm-ticket-ref-title--inactive,
html.theme-earth-sky .nxm-ticket-ref-copy.nxm-ticket-ref-title--inactive { color: rgba(0, 0, 0, 0.38); }

html.theme-earth-sky .nxm-ticket-ref-copy {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
}
html.theme-earth-sky .nxm-ticket-ref-copy:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.14);
}
html.theme-earth-sky .nxm-ticket-ref-copy:focus-visible {
    outline-color: rgba(74, 144, 226, 0.55);
}
html.theme-earth-sky .nxm-list-preview { color: rgba(0, 0, 0, 0.38); }
html.theme-earth-sky .nxm-ticket-substatus--open { color: #15803d; background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.3); }
html.theme-earth-sky .nxm-ticket-substatus--in_progress { color: #b45309; background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.32); }
html.theme-earth-sky .nxm-ticket-substatus--resolved { color: #64748b; background: rgba(148, 163, 184, 0.14); border-color: rgba(148, 163, 184, 0.28); }
html.theme-earth-sky .nxm-ticket-substatus--closed { color: #57534e; background: rgba(120, 113, 108, 0.12); border-color: rgba(120, 113, 108, 0.25); }
html.theme-earth-sky .nxm-list-time { color: rgba(0, 0, 0, 0.3); }
html.theme-earth-sky .nxm-empty-list { color: rgba(0, 0, 0, 0.28); }

html.theme-earth-sky .nxm-chat-header { background: rgba(0, 0, 0, 0.03); border-bottom-color: rgba(0, 0, 0, 0.07); }
html.theme-earth-sky .nxm-chat-name { color: rgba(0, 0, 0, 0.85); }
html.theme-earth-sky .nxm-readonly-badge { background: rgba(0, 0, 0, 0.05); color: rgba(0, 0, 0, 0.4); border-color: rgba(0, 0, 0, 0.1); }

html.theme-earth-sky .nxm-in .nxm-bubble { background: rgba(0, 0, 0, 0.06); color: rgba(0, 0, 0, 0.8); }
/* .nxm-out .nxm-bubble light-theme color handled by .nxm-bbl-* state classes below */
html.theme-earth-sky .nxm-msg-time { color: rgba(0, 0, 0, 0.3); }
html.theme-earth-sky .nxm-sys-msg { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.08); color: rgba(0, 0, 0, 0.4); }
html.theme-earth-sky .nxm-sys-msg-reactivation { background: rgba(74, 144, 226, 0.09); border-color: rgba(74, 144, 226, 0.22); color: rgba(0, 0, 0, 0.58); }
html.theme-earth-sky .nxm-reactivation-meta { background: rgba(74, 144, 226, 0.06); border-color: rgba(74, 144, 226, 0.2); }
html.theme-earth-sky .nxm-reactivation-meta-head { color: rgba(0, 0, 0, 0.62); }
html.theme-earth-sky .nxm-reactivation-meta-head .material-symbols-outlined { color: #4a90e2; }
html.theme-earth-sky .nxm-reactivation-ref { border-color: rgba(74, 144, 226, 0.28); background: rgba(74, 144, 226, 0.12); color: #357abd; }
html.theme-earth-sky .nxm-reactivation-meta-item { background: rgba(255, 255, 255, 0.72); border-color: rgba(0, 0, 0, 0.08); }
html.theme-earth-sky .nxm-reactivation-meta-label { color: rgba(0, 0, 0, 0.45); }
html.theme-earth-sky .nxm-reactivation-meta-value { color: rgba(0, 0, 0, 0.84); }

html.theme-earth-sky .nxm-official-card { background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.08); }
html.theme-earth-sky .nxm-official-card.nxm-pinned { border-color: rgba(74, 144, 226, 0.2); background: rgba(74, 144, 226, 0.04); }
html.theme-earth-sky .nxm-official-title { color: rgba(0, 0, 0, 0.88); }
html.theme-earth-sky .nxm-official-body { color: rgba(0, 0, 0, 0.68); }
html.theme-earth-sky .nxm-pin-label { color: #4a90e2; }

html.theme-earth-sky .nxm-input-row { background: rgba(0, 0, 0, 0.03); border-top-color: rgba(0, 0, 0, 0.07); }
html.theme-earth-sky .nxm-input { background: rgba(0, 0, 0, 0.05); border-color: rgba(0, 0, 0, 0.12); color: rgba(0, 0, 0, 0.85); }
html.theme-earth-sky .nxm-input:focus { border-color: rgba(74, 144, 226, 0.4); }
html.theme-earth-sky .nxm-input::placeholder { color: rgba(0, 0, 0, 0.28); }
html.theme-earth-sky .nxm-closed-bar { background: rgba(0, 0, 0, 0.03); border-top-color: rgba(0, 0, 0, 0.07); color: rgba(0, 0, 0, 0.38); }

html.theme-earth-sky .nxm-form-wrap { background: transparent; }
html.theme-earth-sky .nxm-label { color: rgba(0, 0, 0, 0.55); }
html.theme-earth-sky .nxm-select,
html.theme-earth-sky .nxm-field { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.12); color: rgba(0, 0, 0, 0.82); }
html.theme-earth-sky .nxm-select:focus,
html.theme-earth-sky .nxm-field:focus { border-color: rgba(74, 144, 226, 0.4); }
html.theme-earth-sky .nxm-hint { color: rgba(0, 0, 0, 0.3); }

html.theme-earth-sky .nxm-empty-state { color: rgba(0, 0, 0, 0.22); }
html.theme-earth-sky .nxm-icon-btn { background: rgba(74, 144, 226, 0.1); border-color: rgba(74, 144, 226, 0.25); color: #4a90e2; }
html.theme-earth-sky .nxm-status-sel { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.12); color: rgba(0, 0, 0, 0.75); }
html.theme-earth-sky .nxm-status-sel option { background: #fff; }
html.theme-earth-sky .nxm-no-msgs,
html.theme-earth-sky .nxm-msg-loading { color: rgba(0, 0, 0, 0.28); }
html.theme-earth-sky .nxm-staff-bubble { background: rgba(74, 144, 226, 0.07); border-color: rgba(74, 144, 226, 0.15); }
html.theme-earth-sky .nxm-staff-label { color: #4a90e2; }
html.theme-earth-sky .nxm-out .nxm-bubble.nxm-ticket-own-public {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.85);
}

/* Light theme — new components */
html.theme-earth-sky .nxm-ticket-filters { border-bottom-color: rgba(0, 0, 0, 0.06); }
html.theme-earth-sky .nxm-ticket-search { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.1); color: rgba(0, 0, 0, 0.85); }
html.theme-earth-sky .nxm-ticket-search:focus { border-color: rgba(74, 144, 226, 0.4); }
html.theme-earth-sky .nxm-ticket-search::placeholder { color: rgba(0, 0, 0, 0.3); }
html.theme-earth-sky .nxm-chip { border-color: rgba(0, 0, 0, 0.1); color: rgba(0, 0, 0, 0.4); }
html.theme-earth-sky .nxm-chip:hover { background: rgba(0, 0, 0, 0.04); color: rgba(0, 0, 0, 0.6); }
html.theme-earth-sky .nxm-chip.is-active { background: rgba(74, 144, 226, 0.1); border-color: rgba(74, 144, 226, 0.3); color: #4a90e2; }
html.theme-earth-sky .nxm-tag-chip { background: rgba(0, 0, 0, 0.04); color: rgba(0, 0, 0, 0.45); border-color: rgba(0, 0, 0, 0.08); }
html.theme-earth-sky .nxm-typing-bar { color: rgba(0, 0, 0, 0.4); }
html.theme-earth-sky .nxm-typing-dots span { background: rgba(74, 144, 226, 0.5); }
html.theme-earth-sky .nxm-attach-btn { color: rgba(0, 0, 0, 0.35); }
html.theme-earth-sky .nxm-attach-btn:hover { color: #4a90e2; background: rgba(74, 144, 226, 0.08); }
html.theme-earth-sky .nxm-attach-item { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.08); color: rgba(0, 0, 0, 0.6); }
html.theme-earth-sky .nxm-attach-remove { color: rgba(0, 0, 0, 0.25); }
html.theme-earth-sky .nxm-msg-attach-file { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.08); color: #4a90e2; }
html.theme-earth-sky .nxm-msg-attach-file:hover { background: rgba(0, 0, 0, 0.07); }
html.theme-earth-sky .nxm-msg-attach-file small { color: rgba(0, 0, 0, 0.3); }
html.theme-earth-sky .nxm-csat-prompt { border-top-color: rgba(0, 0, 0, 0.06); background: rgba(74, 144, 226, 0.03); }
html.theme-earth-sky .nxm-csat-header { color: rgba(0, 0, 0, 0.65); }
html.theme-earth-sky .nxm-csat-header .material-symbols-outlined { color: #4a90e2; }
html.theme-earth-sky .nxm-csat-star { color: rgba(0, 0, 0, 0.12); }
html.theme-earth-sky .nxm-csat-result { border-top-color: rgba(0, 0, 0, 0.06); background: rgba(74, 144, 226, 0.03); color: rgba(0, 0, 0, 0.5); }
html.theme-earth-sky .nxm-csat-feedback-btn { border-color: rgba(0, 0, 0, 0.12); color: rgba(0, 0, 0, 0.45); }
html.theme-earth-sky .nxm-csat-feedback-btn:hover { color: #4a90e2; border-color: rgba(74, 144, 226, 0.3); background: rgba(74, 144, 226, 0.05); }
html.theme-earth-sky .nxm-feedback-label { color: rgba(0, 0, 0, 0.4); }
html.theme-earth-sky .nxm-feedback-counter { color: rgba(0, 0, 0, 0.2); }
html.theme-earth-sky .nxm-feedback-read-subject { color: rgba(0, 0, 0, 0.8); }
html.theme-earth-sky .nxm-feedback-read-content { color: rgba(0, 0, 0, 0.6); background: rgba(0, 0, 0, 0.02); border-color: rgba(0, 0, 0, 0.06); }
html.theme-earth-sky .nxm-feedback-read-meta { color: rgba(0, 0, 0, 0.3); }

/* ── Unsend button (floats on hover over pending/sent own messages) ───────── */
.nxm-unsend-btn {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.88);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
    z-index: 6;
}

.nxm-unsend-btn .material-symbols-outlined { font-size: 11px; line-height: 1; }

.nxm-msg:hover .nxm-unsend-btn {
    opacity: 1;
    transform: scale(1);
}

.nxm-unsend-btn:hover { background: rgba(220, 38, 38, 1); }

/* ── Light theme — bubble state classes ───────────────────────────────────── */
html.theme-earth-sky .nxm-out .nxm-bubble { color: rgba(0, 0, 0, 0.85); }
html.theme-earth-sky .nxm-bbl-pending { background: rgba(0, 0, 0, 0.07);        border-color: rgba(0, 0, 0, 0.14); }
html.theme-earth-sky .nxm-bbl-sent    { background: rgba(74, 144, 226, 0.08);   border-color: rgba(74, 144, 226, 0.22); }
html.theme-earth-sky .nxm-bbl-read    { background: rgba(74, 144, 226, 0.16);   border-color: rgba(74, 144, 226, 0.3); }
html.theme-earth-sky .nxm-bbl-failed  { background: rgba(239, 68, 68, 0.08);    border-color: rgba(239, 68, 68, 0.25); color: rgba(0, 0, 0, 0.75); }

/* ── Delete confirmation bar — toggles with .nxm-deleting on input-row ───── */
.nxm-confirm-bar { display: none; }

.nxm-input-row.nxm-deleting .nxm-input,
.nxm-input-row.nxm-deleting .nxm-send-btn { display: none; }

.nxm-input-row.nxm-deleting .nxm-confirm-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    animation: nxm-bar-in 0.22s ease;
}

@keyframes nxm-bar-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}

.nxm-confirm-icon {
    font-size: 20px;
    color: #ef4444;
    flex-shrink: 0;
}

.nxm-confirm-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#nxm-confirm-headline {
    font-size: 0.84rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
}

.nxm-confirm-sub {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}

.nxm-confirm-btn {
    padding: 6px 13px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.nxm-confirm-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }

.nxm-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.nxm-btn-delete {
    background: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nxm-btn-delete .material-symbols-outlined { font-size: 15px; }

/* ── Deleting bubble — pulsing red border ────────────────────────────────── */
.nxm-bbl-deleting {
    background: rgba(239, 68, 68, 0.14) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    animation: nxm-pulse-red 1.4s ease-in-out infinite;
}

@keyframes nxm-pulse-red {
    0%, 100% { border-color: rgba(239, 68, 68, 0.35); }
    50%       { border-color: rgba(239, 68, 68, 0.75); }
}

/* ── Light-theme overrides — confirm bar + deleting bubble ───────────────── */
html.theme-earth-sky #nxm-confirm-headline { color: rgba(0, 0, 0, 0.82); }
html.theme-earth-sky .nxm-confirm-sub      { color: rgba(0, 0, 0, 0.38); }
html.theme-earth-sky .nxm-btn-cancel       { background: rgba(0, 0, 0, 0.07); color: rgba(0, 0, 0, 0.65); }
html.theme-earth-sky .nxm-bbl-deleting     { background: rgba(239, 68, 68, 0.10) !important; }

/* ── Message session divider ─────────────────────────────────────────────── */
.nxm-session-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    user-select: none;
    flex-shrink: 0;
}

.nxm-session-divider::before,
.nxm-session-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.nxm-session-divider span {
    font-size: 0.67rem;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

html.theme-earth-sky .nxm-session-divider::before,
html.theme-earth-sky .nxm-session-divider::after { background: rgba(0, 0, 0, 0.08); }
html.theme-earth-sky .nxm-session-divider span   { color: rgba(0, 0, 0, 0.32); }

/* ══════════════════════════════════════════════════════════════
   MESSAGING STATUS BANNER — lockdown (orange) / suspension (red)
══════════════════════════════════════════════════════════════ */

.nxm-status-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    border-bottom: 1px solid transparent;
}

@keyframes nxm-banner-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nxm-status-banner.nxm-ban-lockdown,
.nxm-status-banner.nxm-ban-suspended {
    display: flex;
    animation: nxm-banner-in 0.25s ease;
}

.nxm-status-banner .material-symbols-outlined {
    font-size: 17px;
    flex-shrink: 0;
}

.nxm-status-banner.nxm-ban-lockdown {
    background: rgba(251, 146, 60, 0.1);
    border-bottom-color: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

.nxm-status-banner.nxm-ban-suspended {
    background: rgba(239, 68, 68, 0.1);
    border-bottom-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.nxm-input-row.nxm-status-locked .nxm-input {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nxm-input-row.nxm-status-locked .nxm-send-btn {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Light-theme overrides */
html.theme-earth-sky .nxm-status-banner.nxm-ban-lockdown {
    background: rgba(251, 146, 60, 0.08);
    border-bottom-color: rgba(251, 146, 60, 0.18);
}

html.theme-earth-sky .nxm-status-banner.nxm-ban-suspended {
    background: rgba(239, 68, 68, 0.07);
    border-bottom-color: rgba(239, 68, 68, 0.16);
}
