/* =====================================================
   Nexa Assistant — Chat Widget v4.0
   Modern floating chat UI
   ===================================================== */

/* ── Floating Button ── */
.semai-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, #15a5dd 0%, #0ea5e9 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow:
        0 4px 24px rgba(21, 165, 221, 0.3),
        0 1px 4px rgba(21, 165, 221, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.2s cubic-bezier(.4,0,.2,1),
        box-shadow 0.2s,
        background-color 0.3s,
        color 0.3s;
}
.semai-floating-btn:hover {
    transform: scale(1.06);
    box-shadow:
        0 8px 32px rgba(21, 165, 221, 0.35),
        0 2px 8px rgba(21, 165, 221, 0.2);
}
.semai-floating-btn:active {
    transform: scale(0.93);
}

/* Notification badge */
.semai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* ── Modal ── */
.semai-chat-modal {
    position: fixed;
    bottom: 96px;
    right: 20px;
    z-index: 99999;
    width: 500px;
    height: 680px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 24px;
    box-shadow:
        0 24px 64px rgba(15, 23, 42, 0.14),
        0 8px 24px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        sans-serif;
    animation: semaiModalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    transition:
        background-color 0.3s,
        color 0.3s,
        border-color 0.3s,
        box-shadow 0.3s;
}
@keyframes semaiModalIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header ── */
.semai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    transition:
        background-color 0.3s,
        border-color 0.3s;
}
.semai-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.semai-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #15a5dd 0%, #0ea5e9 50%, #0284c7 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(21,165,221,.3);
}
.semai-chat-title-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.semai-chat-title-label {
    font-size: 14px;
    font-weight: 700;
    color: #15a5dd;
    line-height: 1.2;
}
.semai-chat-title-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #10b981;
    font-weight: 600;
}
.semai-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: semaiPulse 2s ease-in-out infinite;
}
@keyframes semaiPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}
.semai-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.semai-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.semai-btn-icon:hover {
    background: #f0f9fd;
    color: #15a5dd;
}
.semai-btn-clear:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* ── Mode Bar ── */
.semai-mode-bar {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    overflow-x: auto;
    flex-shrink: 0;
    transition:
        background-color 0.3s,
        border-color 0.3s;
    scrollbar-width: none;
}
.semai-mode-bar::-webkit-scrollbar {
    display: none;
}
.semai-mode-btn {
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition:
        all 0.2s cubic-bezier(.4,0,.2,1),
        background-color 0.3s,
        color 0.3s,
        border-color 0.3s;
    line-height: 1;
}
.semai-mode-btn:hover {
    border-color: #7dd3fc;
    background: #f0f9ff;
    color: #0ea5e9;
}
.semai-mode-btn.active {
    background: linear-gradient(135deg, #15a5dd 0%, #0ea5e9 100%);
    color: #fff;
    border-color: #15a5dd;
    box-shadow: 0 2px 8px rgba(21,165,221,.2);
}

/* ── Messages Area ── */
.semai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fafbfc;
    scrollbar-width: thin;
    position: relative; /* anchor for history overlay */
    transition: background-color 0.3s;
}
.semai-chat-messages::-webkit-scrollbar {
    width: 4px;
}
.semai-chat-messages::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

/* ── Welcome Screen ── */
.semai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px 20px;
    animation: semaiFadeIn 0.4s ease-out;
}
.semai-welcome-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #0f172a;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.semai-welcome h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
}
.semai-welcome p {
    margin: 0 0 18px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}
.semai-suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}
.semai-suggestion-btn {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s;
    line-height: 1.4;
    font-family: inherit;
}
.semai-suggestion-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0f172a;
    transform: translateY(-1px);
}
.semai-sugg-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
.semai-sugg-label {
    font-weight: 500;
}

/* ── History Panel — Full overlay on top of messages ── */
/* ═══════════════════════════════════════════════════════════
   HISTORY — Collapsible sidebar panel
   ═══════════════════════════════════════════════════════════ */

/* Content row wraps sidebar + messages */
.nexa-content-row {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Sidebar */
.nexa-hist-sidebar {
    width: 0;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid transparent;
    background: #f8fafc;
}
.nexa-hist-sidebar.nhist-open {
    width: 252px;
    border-right-color: #e8ecf0;
}

/* Inner container */
.nhist-inner {
    width: 252px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.nhist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    border-bottom: 1px solid #e8ecf0;
    flex-shrink: 0;
    background: #f8fafc;
}
.nhist-head-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nhist-close {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.nhist-close:hover {
    background: #e2e8f0;
    color: #dc2626;
}

/* New chat */
.nhist-new-wrap {
    padding: 10px 10px 6px;
    flex-shrink: 0;
}
.nhist-new-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 8px 12px;
    border: 1.5px dashed #d1d5db;
    border-radius: 9px;
    background: #fff;
    color: #15a5dd;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.nhist-new-btn:hover {
    border-color: #15a5dd;
    background: #f0f9ff;
}

/* List */
.nhist-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px 14px;
}
.nhist-list::-webkit-scrollbar {
    width: 3px;
}
.nhist-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

/* Group labels */
.nhist-group-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 10px 8px 4px;
}

/* Items */
.nhist-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 1px;
}
.nhist-item:hover {
    background: #f1f5f9;
}
.nhist-item:active {
    background: #e8edf5;
}
.nhist-item-active {
    background: #eff6ff !important;
}
.nhist-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nhist-item-body {
    flex: 1;
    min-width: 0;
}
.nhist-item-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.nhist-item-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: #94a3b8;
    flex-wrap: wrap;
}
.nhist-mode-pill {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
}
.nhist-item-arrow {
    color: #d1d5db;
    flex-shrink: 0;
}
.nhist-item:hover .nhist-item-arrow {
    color: #94a3b8;
}

/* Loading & empty */
.nhist-loading {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 20px 10px;
    font-size: 12.5px;
    color: #94a3b8;
}
.nhist-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #e2e8f0;
    border-top-color: #15a5dd;
    border-radius: 50%;
    animation: nhist-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes nhist-spin {
    to {
        transform: rotate(360deg);
    }
}
.nhist-empty {
    text-align: center;
    padding: 28px 12px;
    color: #94a3b8;
    font-size: 12.5px;
    line-height: 1.7;
}
.nhist-empty svg {
    display: block;
    margin: 0 auto 10px;
}
.nhist-empty p {
    margin: 0;
}

/* ── Legacy floating widget history (semai-*) ── */
.semai-history-panel {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: #fff;
    padding: 14px 16px;
    overflow-y: auto;
    animation: semaiFadeIn 0.2s ease;
    border-radius: 0 0 18px 18px;
}
.semai-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 4px 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 8px;
}
.semai-history-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}
.semai-history-close:hover {
    color: #dc2626;
}
.semai-history-new {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-bottom: 6px;
    border: 1.5px dashed #e2e8f0;
    border-radius: 9px;
    background: #fafbfc;
    color: #15a5dd;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.semai-history-new:hover {
    border-color: #15a5dd;
    background: #f0f9ff;
}
.semai-history-item {
    padding: 9px 10px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.semai-history-item:hover {
    background: #f1f5f9;
}
.semai-history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 2px;
}
.semai-history-item-meta {
    font-size: 11px;
    color: #94a3b8;
}
.semai-history-loading,
.semai-history-empty {
    text-align: center;
    padding: 24px 16px;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
}
.semai-btn-history:hover {
    background: #f0f9fd;
    color: #15a5dd;
}

/* ── Messages ── */
.semai-message {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: semaiFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes semaiFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.semai-message-user {
    flex-direction: row-reverse;
}
.semai-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.semai-avatar-bot {
    background: #15a5dd;
    color: #fff;
}
.semai-avatar-user {
    background: #e2e8f0;
    color: #475569;
}
.semai-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.65;
    max-width: 82%;
    word-wrap: break-word;
}
.semai-message-user .semai-bubble {
    background: #0f172a;
    color: #fff;
    border-bottom-right-radius: 5px;
    transition:
        background-color 0.3s,
        color 0.3s;
}
.semai-message-assistant .semai-bubble {
    background: #fff;
    border: 1px solid #e8ecf0;
    color: #1e293b;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    transition:
        background-color 0.3s,
        color 0.3s,
        border-color 0.3s,
        box-shadow 0.3s;
}
.semai-bubble a {
    color: #3b82f6;
    text-decoration: underline;
}
.semai-bubble strong {
    font-weight: 600;
}
.semai-bubble em {
    font-style: italic;
}
.semai-bubble code {
    background: rgba(0, 0, 0, 0.07);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: "SF Mono", "Monaco", "Courier New", monospace;
}

/* ── Typing Indicator ── */
.semai-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    margin: 0 2px;
    animation: semaiBounce 1.4s infinite ease-in-out both;
}
.semai-dot:nth-child(1) {
    animation-delay: -0.32s;
}
.semai-dot:nth-child(2) {
    animation-delay: -0.16s;
}
@keyframes semaiBounce {
    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Input Area ── */
.semai-chat-input-area {
    padding: 12px 14px 10px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    transition:
        background-color 0.3s,
        border-color 0.3s;
}
.semai-input-box {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 8px 34px 8px 14px;
    position: relative;
    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        background 0.2s,
        background-color 0.3s;
}
.semai-input-box:focus-within {
    border-color: #7dd3fc;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(21, 165, 221, 0.08), 0 2px 8px rgba(21,165,221,.06);
}
/* Legacy support for old .semai-input-row references */
.semai-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.semai-btn-upload {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.semai-btn-upload:hover {
    background: #e2e8f0;
    color: #475569;
}
.semai-chat-input-area textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 4px 0;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
    color: #0f172a;
    transition: color 0.3s;
}
.semai-chat-input-area textarea::placeholder {
    color: #94a3b8;
}
.semai-btn-send {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: none;
    background: linear-gradient(135deg, #15a5dd 0%, #0ea5e9 100%);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(21,165,221,.25);
    transition:
        opacity 0.2s,
        transform 0.15s,
        background-color 0.3s,
        box-shadow 0.2s;
}
.semai-btn-send:hover {
    box-shadow: 0 3px 10px rgba(21,165,221,.35);
    transform: translateY(-50%) scale(1.08);
}
.semai-btn-send:active {
    transform: scale(0.94);
}
.semai-btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}
.semai-input-footer {
    text-align: center;
    padding-top: 8px;
}
.semai-powered {
    font-size: 10px;
    color: #cbd5e1;
    letter-spacing: 0.3px;
}

/* ── Upload Preview Chip ── */
.semai-upload-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 12px;
    font-size: 12px;
    color: #15803d;
}
.semai-upload-icon {
    flex-shrink: 0;
    opacity: 0.8;
}
.semai-upload-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-weight: 500;
}
.semai-upload-remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.semai-upload-remove:hover {
    color: #dc2626;
}

/* ── Tablet ── */
@media (max-width: 768px) {
    .semai-chat-modal {
        width: 440px;
        height: 620px;
        max-height: calc(100vh - 100px);
        bottom: 90px;
        right: 16px;
    }
}

/* ── Mobile ── */
@media (max-width: 520px) {
    .semai-chat-modal {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    .semai-floating-btn {
        bottom: 20px;
        right: 16px;
        width: 52px;
        height: 52px;
        border-radius: 16px;
        z-index: 99999;
    }
    .semai-bubble {
        max-width: 88%;
    }
    .semai-chat-messages {
        padding: 12px 10px;
    }
    .semai-suggestions {
        grid-template-columns: 1fr;
    }

    /* ── Mobile Header ── */
    .semai-chat-header {
        padding: 10px 12px;
        flex-shrink: 0;
    }
    .semai-logo {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 13px;
    }
    .semai-chat-title-label {
        font-size: 13px;
    }
    .semai-chat-title-status {
        font-size: 10px;
    }

    /* ── Mobile Mode Bar ── */
    .semai-mode-bar {
        padding: 8px 10px;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
    }
    .semai-mode-btn {
        padding: 5px 12px;
        font-size: 11px;
        flex-shrink: 0;
    }

    /* ── Mobile Input Area ── */
    .semai-chat-input-area {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -1px 8px rgba(15,23,42,.06);
        flex-shrink: 0;
        background: #fff;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .semai-input-box {
        display: flex;
        flex: 1;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        padding: 4px 38px 4px 12px;
        border-radius: 24px;
        border: 1px solid #d8dde3;
        background: #fff;
        gap: 5px;
        box-sizing: border-box;
        position: relative;
    }
    .semai-input-box:focus-within {
        border-color: #7dd3fc;
        box-shadow: 0 0 0 3px rgba(21,165,221,.08);
    }
    .semai-chat-input-area textarea {
        font-size: 15px;
        padding: 5px 0;
        min-height: 24px;
        flex: 1 1 auto;
        min-width: 0;
        width: 0;
    }
    .semai-btn-send {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
        border-radius: 50%;
        flex-shrink: 0;
        background: linear-gradient(135deg, #15a5dd 0%, #0ea5e9 100%);
        box-shadow: 0 2px 8px rgba(21,165,221,.28), 0 1px 2px rgba(21,165,221,.12);
        z-index: 2;
    }
    .semai-btn-send:hover { transform: translateY(-50%) scale(1.08); }
    .semai-btn-upload {
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    .semai-input-footer {
        padding-top: 4px;
    }
    .semai-powered {
        font-size: 9px;
    }

    /* ── Mobile Welcome ── */
    .semai-welcome {
        padding: 20px 12px 16px;
    }
    .semai-welcome-avatar {
        width: 44px;
        height: 44px;
    }
    .semai-welcome h3 {
        font-size: 16px;
    }
    .semai-welcome p {
        font-size: 12px;
    }

    /* ── Mobile Copy / Regen Buttons ── */
    .semai-copy-btn {
        opacity: 1;
        top: 3px;
        right: 3px;
        font-size: 11px;
        padding: 2px 5px;
    }
    .semai-regen-btn {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* ── Mobile Upload Preview ── */
    .semai-upload-preview {
        margin-bottom: 6px;
        padding: 6px 10px;
        border-radius: 10px;
        font-size: 11px;
    }
}

/* ═══════════════════════════════════════════════════════
   Nexa Job Cards  (.njc-*)
   Professional label:value info-table layout.
   - Left accent bar
   - Staggered cascade animation
   - Structured info rows (Company:, Location:, Posted:, Type:)
   - Clean description area
   - Divider between info and action buttons
   - Icons on every label
═══════════════════════════════════════════════════════ */

/* Wrapper: 2-column grid after the assistant bubble */
.njc-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 10px 0 8px 38px;
    width: 100%;
}

/* ── Card ─────────────────────────────────────────────── */
.njc-card {
    position: relative;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition:
        box-shadow 0.25s,
        border-color 0.25s,
        transform 0.25s,
        background-color 0.3s,
        color 0.3s;
    animation: njcCardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes njcCardIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Left accent bar */
.njc-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #15a5dd;
    border-radius: 0 3px 3px 0;
    transition:
        background 0.25s,
        width 0.25s;
}
.njc-card:hover::before {
    background: #149ace;
    width: 5px;
}
.njc-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

/* Inner wrapper */
.njc-card-inner {
    padding: 20px 22px 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Head: title + New badge ───────────────────────────── */
.njc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.njc-title {
    font-size: 15px;
    font-weight: 800;
    color: #15a5dd;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

/* New badge */
.njc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.5;
    flex-shrink: 0;
}

/* ── Info rows: label : value ──────────────────────────── */
.njc-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

/* Each info row: icon + label + value */
.njc-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    line-height: 1.6;
}

/* Label (left side): icon + text + colon, muted */
.njc-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #94a3b8;
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
    font-size: 12.5px;
}
.njc-label svg {
    flex-shrink: 0;
    opacity: 0.55;
}

/* Value (right side): semi-bold, dark */
.njc-value {
    color: #15a5dd;
    font-weight: 600;
    font-size: 13px;
}
.njc-value-date {
    color: #64748b;
    font-weight: 500;
}

/* ── Description ───────────────────────────────────────── */
.njc-desc {
    font-size: 13px;
    color: #475569;
    line-height: 1.65;
    margin: 0 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Divider ───────────────────────────────────────────── */
.njc-divider {
    height: 1px;
    background: #e0f0f8;
    margin: 12px 0 14px 0;
}

/* ── Actions ───────────────────────────────────────────── */
.njc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Button base */
.njc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s;
    line-height: 1.3;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.njc-btn svg {
    flex-shrink: 0;
}

/* Apply Now — solid */
.njc-btn-solid {
    background: #15a5dd;
    border: 1.5px solid #15a5dd;
    color: #ffffff;
    font-weight: 700;
}
.njc-btn-solid:hover {
    background: #149ace;
    border-color: #149ace;
    box-shadow: 0 3px 10px rgba(21, 165, 221, 0.25);
    transform: translateY(-1px);
}

/* More Jobs — outline */
.njc-btn-outline {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #475569;
}
.njc-btn-outline:hover {
    background: #f0f9fd;
    border-color: #15a5dd;
    color: #15a5dd;
    transform: translateY(-1px);
}

/* ── Full-page chat alignment ──────────────────────────── */
.nexa-messages .njc-wrapper {
    max-width: 70%;
    margin-left: 40px;
    padding-left: 0;
}

/* ── Floating widget alignment ─────────────────────────── */
.semai-chat-messages .njc-wrapper {
    padding-left: 38px;
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 520px) {
    .njc-wrapper {
        padding-left: 0;
        gap: 12px;
        grid-template-columns: 1fr;
    }
    .njc-card {
        border-radius: 14px;
    }
    .njc-card::before {
        width: 3px;
    }
    .njc-card-inner {
        padding: 14px 14px 12px 16px;
    }
    .njc-head {
        margin-bottom: 10px;
    }
    .njc-title {
        font-size: 13.5px;
    }
    .njc-label {
        min-width: 72px;
        font-size: 11.5px;
    }
    .njc-value {
        font-size: 12px;
    }
    .njc-row {
        font-size: 12px;
    }
    .njc-desc {
        font-size: 12.5px;
        line-height: 1.6;
    }
    .njc-divider {
        margin: 10px 0 12px 0;
    }
    .njc-btn {
        padding: 8px 16px;
        font-size: 12.5px;
        flex: 1;
        justify-content: center;
    }
    .njc-actions {
        flex-direction: column;
        gap: 7px;
    }
    .nexa-messages .njc-wrapper {
        max-width: 100%;
        margin-left: 0;
    }
    .semai-chat-messages .njc-wrapper {
        padding-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════
   Nexa Button Links — Semasocial internal link buttons
   Converts **[Label](https://semasocial.com/*)** markdown
   into styled action buttons inside assistant bubbles.
   • .nexa-btn-links-group  — flex wrapper when multiple buttons appear together
   • .nexa-btn-link         — primary filled button (Semasocial internal)
   • .nexa-inline-link      — plain underline link (external URLs)
═══════════════════════════════════════════════════════ */

/* Group wrapper — lets multiple buttons sit side by side and wrap on mobile */
.nexa-btn-links-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 4px;
}

/* Primary action button — Semasocial internal links */
.nexa-btn-link {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    margin: 4px 4px 4px 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700 !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #15a5dd 0%, #1490c4 100%);
    color: #fff !important;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(21, 165, 221, 0.25);
    white-space: nowrap;
    line-height: 1.3;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    vertical-align: middle;
}
.nexa-btn-link:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(21, 165, 221, 0.38);
    background: linear-gradient(135deg, #149ace 0%, #1280b0 100%);
    color: #fff !important;
    text-decoration: none !important;
}
.nexa-btn-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(21, 165, 221, 0.2);
}
.nexa-btn-link svg {
    flex-shrink: 0;
    opacity: 0.9;
}
/* Tighten spacing when two buttons sit next to each other */
.nexa-btn-link + .nexa-btn-link {
    margin-left: 0;
}

/* Plain underline link — external URLs */
.nexa-inline-link {
    color: #15a5dd;
    text-decoration: underline;
    word-break: break-all;
}
.nexa-inline-link:hover {
    color: #1490c4;
}

/* Mobile — full-width stack */
@media (max-width: 520px) {
    .nexa-btn-link {
        padding: 9px 16px;
        font-size: 12.5px;
    }
    .nexa-btn-links-group {
        flex-direction: column;
        gap: 6px;
    }
    .nexa-btn-links-group .nexa-btn-link {
        width: 100%;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════
   Floating Button — Pulse Ring Animation
   Adds a subtle expanding ring around the floating button
   to draw attention.
   Apply class .semai-floating-btn--pulse to activate.
═══════════════════════════════════════════════════════ */

@keyframes semaiRingPulse {
    0% {
        box-shadow:
            0 4px 20px rgba(21, 165, 221, 0.28),
            0 1px 4px rgba(21, 165, 221, 0.15),
            0 0 0 0 rgba(21, 165, 221, 0.35);
    }
    70% {
        box-shadow:
            0 4px 20px rgba(21, 165, 221, 0.28),
            0 1px 4px rgba(21, 165, 221, 0.15),
            0 0 0 14px rgba(21, 165, 221, 0);
    }
    100% {
        box-shadow:
            0 4px 20px rgba(21, 165, 221, 0.28),
            0 1px 4px rgba(21, 165, 221, 0.15),
            0 0 0 14px rgba(21, 165, 221, 0);
    }
}

.semai-floating-btn--pulse {
    animation: semaiRingPulse 2.4s ease-out infinite;
}

/* ═══════════════════════════════════════════════════════
   DARK MODE
   @media (prefers-color-scheme: dark)
   Overrides all backgrounds, text, borders, and shadows
   with a dark palette while preserving structure.
═══════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    /* ── Floating Button ── */
    .semai-floating-btn {
        background: #38bdf8;
        box-shadow:
            0 4px 20px rgba(56, 189, 248, 0.28),
            0 1px 4px rgba(56, 189, 248, 0.15);
    }
    .semai-floating-btn:hover {
        box-shadow:
            0 8px 28px rgba(56, 189, 248, 0.32),
            0 2px 6px rgba(56, 189, 248, 0.18);
    }

    /* ── Modal ── */
    .semai-chat-modal {
        background: #1a1a2e;
        box-shadow:
            0 24px 64px rgba(0, 0, 0, 0.35),
            0 8px 24px rgba(0, 0, 0, 0.18),
            0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    /* ── Header ── */
    .semai-chat-header {
        background: #1a1a2e;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .semai-logo {
        background: #38bdf8;
    }
    .semai-chat-title-label {
        color: #38bdf8;
    }
    .semai-btn-icon {
        color: #94a3b8;
    }
    .semai-btn-icon:hover {
        background: rgba(56, 189, 248, 0.12);
        color: #38bdf8;
    }
    .semai-btn-clear:hover {
        background: rgba(220, 38, 38, 0.12) !important;
        color: #ef4444 !important;
    }

    /* ── Mode Bar ── */
    .semai-mode-bar {
        background: #16213e;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .semai-mode-btn {
        background: #1e1e3a;
        border-color: rgba(255, 255, 255, 0.06);
        color: #94a3b8;
    }
    .semai-mode-btn:hover {
        border-color: #38bdf8;
        background: rgba(56, 189, 248, 0.1);
        color: #38bdf8;
    }
    .semai-mode-btn.active {
        background: #38bdf8;
        color: #fff;
        border-color: #38bdf8;
    }

    /* ── Messages Area ── */
    .semai-chat-messages {
        background: #1a1a2e;
    }
    .semai-chat-messages::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.12);
    }

    /* ── Welcome Screen ── */
    .semai-welcome-avatar {
        background: #38bdf8;
    }
    .semai-welcome h3 {
        color: #e2e8f0;
    }
    .semai-welcome p {
        color: #94a3b8;
    }
    .semai-suggestion-btn {
        background: #1e1e3a;
        border-color: rgba(255, 255, 255, 0.06);
        color: #cbd5e1;
    }
    .semai-suggestion-btn:hover {
        background: #252547;
        border-color: #94a3b8;
        color: #e2e8f0;
    }

    /* ── History Sidebar (nexa-*) ── */
    .nexa-hist-sidebar {
        background: #16213e;
        border-right-color: rgba(255, 255, 255, 0.06);
    }
    .nexa-hist-sidebar.nhist-open {
        border-right-color: rgba(255, 255, 255, 0.06);
    }
    .nhist-head {
        background: #16213e;
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
    .nhist-head-title {
        color: #e2e8f0;
    }
    .nhist-close {
        color: #94a3b8;
    }
    .nhist-close:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #ef4444;
    }
    .nhist-new-btn {
        background: #1e1e3a;
        border-color: rgba(255, 255, 255, 0.1);
        color: #38bdf8;
    }
    .nhist-new-btn:hover {
        border-color: #38bdf8;
        background: rgba(56, 189, 248, 0.08);
    }
    .nhist-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.12);
    }
    .nhist-group-label {
        color: #94a3b8;
    }
    .nhist-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    .nhist-item:active {
        background: rgba(255, 255, 255, 0.08);
    }
    .nhist-item-active {
        background: rgba(56, 189, 248, 0.1) !important;
    }
    .nhist-item-title {
        color: #e2e8f0;
    }
    .nhist-item-meta {
        color: #94a3b8;
    }
    .nhist-item-arrow {
        color: #64748b;
    }
    .nhist-item:hover .nhist-item-arrow {
        color: #94a3b8;
    }
    .nhist-loading {
        color: #94a3b8;
    }
    .nhist-spinner {
        border-color: rgba(255, 255, 255, 0.1);
        border-top-color: #38bdf8;
    }
    .nhist-empty {
        color: #94a3b8;
    }

    /* ── Legacy History Panel ── */
    .semai-history-panel {
        background: #1a1a2e;
    }
    .semai-history-header {
        color: #94a3b8;
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
    .semai-history-close {
        color: #94a3b8;
    }
    .semai-history-close:hover {
        color: #ef4444;
    }
    .semai-history-new {
        background: #1e1e3a;
        border-color: rgba(255, 255, 255, 0.1);
        color: #38bdf8;
    }
    .semai-history-new:hover {
        border-color: #38bdf8;
        background: rgba(56, 189, 248, 0.08);
    }
    .semai-history-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    .semai-history-item-title {
        color: #e2e8f0;
    }
    .semai-history-item-meta {
        color: #94a3b8;
    }
    .semai-history-loading,
    .semai-history-empty {
        color: #94a3b8;
    }
    .semai-btn-history:hover {
        background: rgba(56, 189, 248, 0.1);
        color: #38bdf8;
    }

    /* ── Messages ── */
    .semai-avatar-bot {
        background: #38bdf8;
    }
    .semai-avatar-user {
        background: #334155;
        color: #cbd5e1;
    }
    .semai-message-user .semai-bubble {
        background: #1a56db;
    }
    .semai-message-assistant .semai-bubble {
        background: #1e1e3a;
        border-color: rgba(255, 255, 255, 0.06);
        color: #e2e8f0;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    }
    .semai-bubble a {
        color: #60a5fa;
    }
    .semai-bubble code {
        background: rgba(255, 255, 255, 0.08);
    }

    /* ── Typing Indicator ── */
    .semai-dot {
        background: #64748b;
    }

    /* ── Input Area ── */
    .semai-chat-input-area {
        background: #1a1a2e;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    .semai-input-box {
        background: #252547;
        border-color: rgba(255, 255, 255, 0.06);
    }
    .semai-input-box:focus-within {
        background: #1e1e3a;
        border-color: #38bdf8;
        box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
    }
    .semai-chat-input-area textarea {
        color: #e2e8f0;
    }
    .semai-chat-input-area textarea::placeholder {
        color: #64748b;
    }
    .semai-btn-send {
        background: #38bdf8;
    }
    .semai-btn-upload {
        color: #64748b;
    }
    .semai-btn-upload:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #cbd5e1;
    }
    .semai-powered {
        color: #64748b;
    }

    /* ── Upload Preview ── */
    .semai-upload-preview {
        background: rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.25);
        color: #4ade80;
    }
    .semai-upload-remove {
        color: #94a3b8;
    }
    .semai-upload-remove:hover {
        color: #ef4444;
    }

    /* ── NJC Job Cards ── */
    .njc-card {
        background: #1e1e3a;
        border-color: rgba(255, 255, 255, 0.06);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    .njc-card:hover {
        border-color: rgba(255, 255, 255, 0.12);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    }
    .njc-card::before {
        background: #38bdf8;
    }
    .njc-card:hover::before {
        background: #38bdf8;
    }
    .njc-title {
        color: #38bdf8;
    }
    .njc-badge {
        background: rgba(34, 197, 94, 0.15);
        color: #4ade80;
    }
    .njc-label {
        color: #94a3b8;
    }
    .njc-label svg {
        opacity: 0.55;
    }
    .njc-value {
        color: #38bdf8;
    }
    .njc-value-date {
        color: #94a3b8;
    }
    .njc-desc {
        color: #94a3b8;
    }
    .njc-divider {
        background: rgba(255, 255, 255, 0.06);
    }
    .njc-btn-solid {
        background: #38bdf8;
        border-color: #38bdf8;
        color: #0f172a;
    }
    .njc-btn-solid:hover {
        background: #7dd3fc;
        border-color: #7dd3fc;
        box-shadow: 0 3px 10px rgba(56, 189, 248, 0.3);
    }
    .njc-btn-outline {
        background: transparent;
        border-color: rgba(255, 255, 255, 0.1);
        color: #cbd5e1;
    }
    .njc-btn-outline:hover {
        background: rgba(56, 189, 248, 0.1);
        border-color: #38bdf8;
        color: #38bdf8;
    }

    /* ── Nexa Button Links ── */
    .nexa-btn-link {
        background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
        color: #fff !important;
        box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
    }
    .nexa-btn-link:hover {
        background: linear-gradient(135deg, #7dd3fc 0%, #3b82f6 100%);
        box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
        color: #fff !important;
    }
    .nexa-btn-link:active {
        box-shadow: 0 1px 4px rgba(56, 189, 248, 0.2);
    }
    .nexa-inline-link {
        color: #38bdf8;
    }
    .nexa-inline-link:hover {
        color: #7dd3fc;
    }

    /* ── Floating Button Pulse (dark ring color) ── */
    .semai-floating-btn--pulse {
        animation-name: semaiRingPulseDark;
    }
}

@keyframes semaiRingPulseDark {
    0% {
        box-shadow:
            0 4px 20px rgba(56, 189, 248, 0.28),
            0 1px 4px rgba(56, 189, 248, 0.15),
            0 0 0 0 rgba(56, 189, 248, 0.35);
    }
    70% {
        box-shadow:
            0 4px 20px rgba(56, 189, 248, 0.28),
            0 1px 4px rgba(56, 189, 248, 0.15),
            0 0 0 14px rgba(56, 189, 248, 0);
    }
    100% {
        box-shadow:
            0 4px 20px rgba(56, 189, 248, 0.28),
            0 1px 4px rgba(56, 189, 248, 0.15),
            0 0 0 14px rgba(56, 189, 248, 0);
    }
}


/* =====================================================
   Nexa Features: Prepared Chat, Setup & Secure Chat Auth
   ===================================================== */

/* ── Feature 1: Prepared Notification Actions ── */
.nexa-prepared-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(226, 232, 240, 0.8);
}
.nexa-btn-prepared-primary {
    background: linear-gradient(135deg, #15a5dd 0%, #0284c7 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.nexa-btn-prepared-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}
.nexa-btn-prepared-dismiss {
    background: transparent;
    color: #64748b !important;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.nexa-btn-prepared-dismiss:hover {
    background: #f1f5f9;
    color: #334155 !important;
    border-color: #94a3b8;
}

/* ── Feature 2: Conversational Setup ── */
.nexa-onboarding-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.nexa-understood-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.nexa-understood-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0284c7;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nexa-understood-item {
    font-size: 12px;
    color: #334155;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.nexa-understood-label {
    font-weight: 600;
    color: #64748b;
}
.nexa-btn-edit-inline {
    background: none;
    border: none;
    color: #0284c7;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 4px;
    text-decoration: underline;
}
.nexa-btn-edit-inline:hover {
    color: #0369a1;
}

.nexa-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.nexa-chip-btn {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.nexa-chip-btn:hover {
    border-color: #0284c7;
    background: #f0f9ff;
    color: #0369a1;
    transform: translateY(-1px);
}
.nexa-chip-btn.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}
.nexa-chip-skip {
    border-style: dashed;
    color: #64748b;
    border-color: #cbd5e1;
}

/* Suggestions & Draft Cards */
.nexa-draft-card {
    background: #ffffff;
    border: 1.5px solid #0284c7;
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}
.nexa-draft-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
}
.nexa-draft-content {
    font-size: 13px;
    line-height: 1.5;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 6px 0 10px;
    outline: none;
}
.nexa-draft-actions {
    display: flex;
    gap: 8px;
}

/* ── Feature 3: Safe Chat Sign-Up & Sign-In ── */
.nexa-secure-password-box {
    background: #ffffff;
    border: 1.5px solid #0284c7;
    border-radius: 14px;
    padding: 14px;
    margin: 10px 0;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12);
}
.nexa-secure-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 10px;
}
.nexa-secure-input-wrap {
    position: relative;
    margin-bottom: 10px;
}
.nexa-secure-input {
    width: 100%;
    padding: 10px 38px 10px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #f8fafc;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s;
}
.nexa-secure-input:focus {
    border-color: #0284c7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.nexa-secure-toggle-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
}
.nexa-secure-reqs {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.4;
}
.nexa-secure-terms {
    font-size: 12px;
    color: #475569;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
    line-height: 1.4;
}
.nexa-secure-terms input {
    margin-top: 2px;
}
.nexa-secure-terms a {
    color: #0284c7;
    text-decoration: underline;
}
.nexa-secure-error {
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.nexa-btn-secure-submit {
    width: 100%;
    background: linear-gradient(135deg, #15a5dd 0%, #0284c7 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.nexa-btn-secure-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* User Notification Settings Pill */
.nexa-user-pref-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}
.nexa-user-pref-btn:hover {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
}
