.nd-live-chat,
.nd-live-chat * {
    box-sizing: border-box;
}

.nd-live-chat {
    --nd-live-blue: #2563eb;
    --nd-live-blue-dark: #1d4ed8;
    --nd-live-border: #dbe3ef;
    --nd-live-text: #172033;
    font-family: "Prompt", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    position: relative;
    z-index: 2147482000;
}

.nd-live-launcher {
    align-items: center;
    background: linear-gradient(135deg, var(--nd-live-blue), var(--nd-live-blue-dark));
    border: 0;
    border-radius: 999px;
    bottom: 20px;
    box-shadow: 0 14px 35px rgba(30, 64, 175, .32);
    color: #fff;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    gap: 9px;
    padding: 13px 18px;
    position: fixed;
    right: 20px;
    transition: transform .18s ease, box-shadow .18s ease;
    z-index: 2147482001;
}

.nd-live-launcher:hover {
    box-shadow: 0 16px 40px rgba(30, 64, 175, .4);
    transform: translateY(-2px);
}

.nd-live-launcher-icon {
    font-size: 18px;
    line-height: 1;
}

.nd-live-badge {
    align-items: center;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 999px;
    display: inline-flex;
    font-size: 10px;
    height: 22px;
    justify-content: center;
    min-width: 22px;
    padding: 0 5px;
}

[data-tracking-toast] {
    bottom: 82px !important;
}

.nd-live-panel {
    background: #fff;
    border: 1px solid var(--nd-live-border);
    border-radius: 22px;
    bottom: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
    color: var(--nd-live-text);
    display: flex;
    flex-direction: column;
    height: min(680px, calc(100dvh - 40px));
    overflow: hidden;
    position: fixed;
    right: 20px;
    width: min(390px, calc(100vw - 40px));
    z-index: 2147482002;
}

.nd-live-panel[hidden],
.nd-live-chat [hidden] {
    display: none !important;
}

.nd-live-header {
    align-items: center;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    display: flex;
    flex: 0 0 auto;
    justify-content: space-between;
    min-height: 70px;
    padding: 14px 15px 14px 18px;
}

.nd-live-heading {
    min-width: 0;
}

.nd-live-heading strong,
.nd-live-heading span {
    display: block;
}

.nd-live-heading strong {
    font-size: 16px;
}

.nd-live-heading span {
    color: #dbeafe;
    font-size: 11px;
    margin-top: 3px;
}

.nd-live-header-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
}

.nd-live-presence {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex: 0 0 auto;
    padding: 10px 14px;
}

.nd-live-presence-title {
    align-items: center;
    display: flex;
    gap: 7px;
}

.nd-live-presence-title i {
    background: #94a3b8;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .16);
    flex: 0 0 auto;
    height: 8px;
    width: 8px;
}

.nd-live-presence-title strong {
    color: #475569;
    font-size: 11px;
}

.nd-live-presence p {
    color: #64748b;
    font-size: 10px;
    line-height: 1.5;
    margin: 5px 0 0 15px;
}

.nd-live-presence a {
    background: #16a34a;
    border-radius: 9px;
    color: #fff;
    display: inline-flex;
    font-size: 10px;
    font-weight: 700;
    margin: 8px 0 0 15px;
    padding: 7px 11px;
    text-decoration: none;
}

.nd-live-presence-online {
    background: #f0fdf4;
}

.nd-live-presence-online .nd-live-presence-title i {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
}

.nd-live-presence-online .nd-live-presence-title strong {
    color: #15803d;
}

.nd-live-presence-online p,
.nd-live-presence-online a,
.nd-live-presence-checking a {
    display: none;
}

.nd-live-presence-offline {
    background: #f8fafc;
}

.nd-live-header-actions button {
    align-items: center;
    background: rgba(255, 255, 255, .14);
    border: 0;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 18px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.nd-live-header-actions button:hover {
    background: rgba(255, 255, 255, .24);
}

.nd-live-loading,
.nd-live-start {
    overflow-y: auto;
    padding: 20px;
}

.nd-live-loading {
    color: #64748b;
    font-size: 13px;
    margin: auto;
    text-align: center;
}

.nd-live-intro {
    background: #eff6ff;
    border-radius: 16px;
    margin-bottom: 16px;
    padding: 14px;
}

.nd-live-intro strong {
    font-size: 15px;
}

.nd-live-intro p {
    color: #64748b;
    font-size: 12px;
    margin: 5px 0 0;
}

.nd-live-start form {
    display: grid;
    gap: 12px;
}

.nd-live-start label {
    color: #334155;
    display: grid;
    font-size: 12px;
    font-weight: 700;
    gap: 5px;
}

.nd-live-start input,
.nd-live-start textarea,
.nd-live-composer textarea {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: var(--nd-live-text);
    font: inherit;
    font-size: 13px;
    outline: none;
    padding: 10px 12px;
    width: 100%;
}

.nd-live-start input:focus,
.nd-live-start textarea:focus,
.nd-live-composer textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .13);
}

.nd-live-start textarea {
    min-height: 88px;
    resize: vertical;
}

.nd-live-primary,
.nd-live-send {
    background: var(--nd-live-blue);
    border: 0;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.nd-live-primary {
    min-height: 44px;
    padding: 10px 16px;
    width: 100%;
}

.nd-live-primary:disabled,
.nd-live-send:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.nd-live-form-status,
.nd-live-send-state {
    font-size: 11px;
    margin: 0;
    min-height: 16px;
}

.nd-live-status-error {
    color: #dc2626;
}

.nd-live-status-success {
    color: #15803d;
}

.nd-live-thread {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.nd-live-thread-meta {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 14px;
}

.nd-live-thread-meta div {
    min-width: 0;
}

.nd-live-thread-meta strong,
.nd-live-thread-meta div span {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nd-live-thread-meta strong {
    font-size: 12px;
}

.nd-live-thread-meta div span {
    color: #94a3b8;
    font-size: 9px;
    margin-top: 2px;
}

.nd-live-thread-meta > span {
    background: #dcfce7;
    border-radius: 999px;
    color: #15803d;
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    padding: 5px 8px;
}

.nd-live-messages {
    background: #f1f5f9;
    flex: 1 1 auto;
    min-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
}

.nd-live-empty {
    color: #94a3b8;
    font-size: 12px;
    margin: 42px auto;
    text-align: center;
}

.nd-live-message {
    display: flex;
    margin-bottom: 12px;
}

.nd-live-message-admin {
    justify-content: flex-start;
}

.nd-live-message-customer {
    justify-content: flex-end;
}

.nd-live-bubble {
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .07);
    font-size: 12px;
    line-height: 1.55;
    max-width: 82%;
    overflow-wrap: anywhere;
    padding: 9px 11px;
}

.nd-live-message-admin .nd-live-bubble {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 5px;
    color: #334155;
}

.nd-live-message-customer .nd-live-bubble {
    background: var(--nd-live-blue);
    border-bottom-right-radius: 5px;
    color: #fff;
}

.nd-live-sender {
    font-size: 9px;
    font-weight: 700;
    margin: 0 0 3px;
}

.nd-live-message-admin .nd-live-sender {
    color: #2563eb;
}

.nd-live-message-customer .nd-live-sender {
    color: #bfdbfe;
}

.nd-live-body {
    margin: 0;
    white-space: pre-wrap;
}

.nd-live-time {
    font-size: 8px;
    margin: 5px 0 0;
    opacity: .72;
}

.nd-live-attachment {
    background: rgba(255, 255, 255, .94);
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    color: #334155;
    margin-top: 7px;
    padding: 8px;
}

.nd-live-attachment img {
    border-radius: 7px;
    display: block;
    margin-bottom: 7px;
    max-height: 150px;
    max-width: 100%;
    object-fit: contain;
}

.nd-live-attachment p {
    font-size: 10px;
    margin: 0;
    overflow-wrap: anywhere;
}

.nd-live-attachment a {
    color: #2563eb;
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    margin-top: 5px;
    text-decoration: underline;
}

.nd-live-new-message {
    background: #2563eb;
    border: 0;
    border-radius: 999px;
    bottom: 86px;
    box-shadow: 0 7px 18px rgba(37, 99, 235, .25);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    left: 50%;
    padding: 7px 12px;
    position: absolute;
    transform: translateX(-50%);
}

.nd-live-composer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    flex: 0 0 auto;
    padding: 10px;
}

.nd-live-compose-row {
    align-items: flex-end;
    display: flex;
    gap: 7px;
}

.nd-live-composer textarea {
    max-height: 96px;
    min-height: 40px;
    resize: none;
}

.nd-live-attach {
    align-items: center;
    background: #f1f5f9;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.nd-live-attach input {
    display: none;
}

.nd-live-send {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 13px;
}

.nd-live-send-state {
    color: #64748b;
    padding: 4px 4px 0;
}

.nd-live-files {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-bottom: 7px;
}

.nd-live-file-chip {
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    font-size: 9px;
    gap: 5px;
    max-width: 100%;
    padding: 5px 7px;
}

.nd-live-file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nd-live-file-chip button {
    background: transparent;
    border: 0;
    color: #dc2626;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
}

.nd-live-honeypot,
.nd-live-sr-only {
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

@media (max-width: 640px) {
    .nd-live-panel {
        border-radius: 18px;
        bottom: 8px;
        height: calc(100dvh - 16px);
        left: 8px;
        right: 8px;
        width: auto;
    }

    .nd-live-launcher {
        bottom: 14px;
        right: 14px;
    }

    .nd-live-header {
        min-height: 64px;
    }

    .nd-live-messages {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nd-live-launcher {
        transition: none;
    }
}
