/**
 * Nouvelle discussion — mise en page + sélecteur de modèle.
 * La chatbox reprend les styles globaux .ruixen-ai-chat (comme le dashboard).
 */

body.new-discussion-page.dashboard-page,
body.new-discussion-page.dashboard-page button,
body.new-discussion-page.dashboard-page textarea,
body.new-discussion-page.dashboard-page input {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        'SF Pro Display',
        'SF Pro Text',
        system-ui,
        sans-serif;
}

.nd-chat-main.dashboard-main {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nd-chat-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem 2rem;
    max-width: 52rem;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    gap: 0.35rem;
}

.nd-chat-title {
    font-family: inherit;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    margin: 0;
    line-height: 1.25;
}

.nd-chat-embedded {
    width: 100%;
    max-width: min(100%, 42rem);
    margin: 0 auto;
    padding: 0;
}

.nd-chat-hero-stack {
    width: 100%;
}

/* Input fichier masqué */
.nd-file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Bandeau de prévisualisation au-dessus du textarea (comme ClaudeChatInput React) */
body.new-discussion-page .ruixen-ai-chat {
    display: flex;
    flex-direction: column;
}

.nd-attachments-strip {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── iOS preview element selection chip ──────────────────────────── */
.nd-ios-sel-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 122, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12.5px;
    line-height: 1.3;
    flex-shrink: 0;
    animation: nd-ios-sel-in .15s ease;
}
.nd-ios-sel-bar--visible { display: flex; }
.nd-ios-sel-bar svg { flex-shrink: 0; opacity: .7; color: #007AFF; }
.nd-ios-sel-desc { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-ios-sel-desc strong { color: #fff; font-weight: 600; }
.nd-ios-sel-screen { color: rgba(255, 255, 255, 0.45); margin-left: 2px; }
.nd-ios-sel-clear {
    flex-shrink: 0;
    background: rgba(255,255,255,.1);
    border: none;
    border-radius: 50%;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,.6);
    padding: 0;
    transition: background .15s;
}
.nd-ios-sel-clear:hover { background: rgba(255,255,255,.18); }
@keyframes nd-ios-sel-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nd-attachments-strip[hidden] {
    display: none !important;
}

.nd-chat--drag {
    outline: 2px dashed rgba(59, 130, 246, 0.55);
    outline-offset: 2px;
    border-radius: 1rem;
}

@keyframes nd-attach-in {
    from { opacity: 0; transform: translateY(6px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.nd-attachment-card {
    position: relative;
    flex-shrink: 0;
    width: 5.5rem;
    min-height: 5.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s ease;
    animation: nd-attach-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nd-attachment-card:hover {
    border-color: rgba(255, 255, 255, 0.28);
}

/* ── Image : plein format (object-cover sur toute la carte) ── */
.nd-attachment-card--image {
    height: 5.5rem;
}

.nd-attachment-card--image .nd-attachment-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nd-attachment-card__img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.22);
    transition: background 0.2s ease;
    pointer-events: none;
}

.nd-attachment-card--image:hover .nd-attachment-card__img-overlay {
    background: rgba(0, 0, 0, 0);
}

.nd-attachment-card__doc {
    padding: 0.4rem 0.45rem 0.45rem;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nd-attachment-card__doc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.nd-attachment-card__file-ico {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.5);
}

.nd-attachment-card__ext {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.45);
    max-width: 2.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nd-attachment-card__name {
    margin: 0;
    font-size: 0.6rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.nd-attachment-card__meta {
    margin: 0;
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.38);
}

.nd-attachment-card__remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    z-index: 2;
}

.nd-attachment-card__remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.nd-attachment-card:hover .nd-attachment-card__remove {
    opacity: 1;
}

/* Groupe gauche du footer */
.nd-ruixen-footer-start {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.nd-tool-sep-before {
    flex-shrink: 0;
}

.nd-tool-group {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

.nd-tool-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    height: 2rem;
    padding: 0 0.35rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #a1a1aa;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
    flex-shrink: 0;
}

.nd-tool-toggle:hover {
    color: #e4e4e7;
    background: rgba(255, 255, 255, 0.06);
}

.nd-tool-toggle:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    outline-offset: 0;
}

.nd-tool-toggle__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.nd-tool-toggle__svg {
    display: block;
    width: 1rem;
    height: 1rem;
}

.nd-tool-toggle__label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    transition:
        max-width 0.22s ease,
        opacity 0.18s ease;
}

.nd-tool-toggle--active .nd-tool-toggle__label {
    max-width: 4.5rem;
    opacity: 1;
}

/* Web — cyan type réf. React */
.nd-tool-toggle--web.nd-tool-toggle--active {
    background: rgba(30, 174, 219, 0.12);
    border-color: #1eaedb;
    color: #1eaedb;
}

.nd-tool-toggle--web.nd-tool-toggle--active .nd-tool-toggle__svg {
    color: #1eaedb;
}

/* Think — violet type réf. React */
.nd-tool-toggle--think.nd-tool-toggle--active {
    background: rgba(139, 92, 246, 0.12);
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.nd-tool-toggle--think.nd-tool-toggle--active .nd-tool-toggle__svg {
    color: #8b5cf6;
}

.nd-model-footer-sep {
    width: 1px;
    height: 1rem;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

/* === Sélecteur modèle === */
.nd-model-picker {
    position: relative;
    min-width: 0;
    flex-shrink: 1;
}

.nd-model-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 2rem;
    max-width: 100%;
    padding: 0 0.45rem 0 0.2rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #d4d4d8;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s var(--ruixen-ease, ease), color 0.2s ease;
}

.nd-model-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fafafa;
}

.nd-model-trigger:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    outline-offset: 0;
}

.nd-model-trigger__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    color: #e4e4e7;
}

.nd-model-trigger__icon svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.nd-model-trigger__icon .nd-model-menu__logo {
    width: 1rem;
    height: 1rem;
    object-fit: contain;
    display: block;
    border-radius: 3px;
}

/* Auto mode: subtle highlight on trigger (no color overrides — stays white) */
.nd-model-trigger--auto {
    background: rgba(255, 255, 255, 0.05);
}

.nd-model-trigger__label {
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nd-model-trigger__chev {
    flex-shrink: 0;
    color: #71717a;
    transition: transform 0.2s ease;
}

.nd-model-trigger:hover .nd-model-trigger__chev {
    color: #a1a1aa;
}

.nd-model-trigger[aria-expanded='true'] .nd-model-trigger__chev {
    transform: rotate(180deg);
}

/* Calque sous le menu : intercepte les clics pour fermer (contenu page souvent sous le menu en z-index). */
.nd-model-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4990;
    background: transparent;
    cursor: default;
}

/* display:flex du shell ne doit pas annuler l’attribut HTML hidden */
.nd-model-menu-shell[hidden] {
    display: none !important;
    pointer-events: none !important;
}

/* Menu déplacé sous body par JS (évite overflow:hidden des ancêtres) */
.nd-model-menu-shell.nd-model-menu--portal {
    z-index: 5000;
}

.nd-model-menu-shell {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0.45rem 0.4rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(
        180deg,
        rgba(12, 12, 14, 0.98) 0%,
        rgba(24, 24, 28, 0.98) 50%,
        rgba(30, 30, 36, 0.98) 100%
    );
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    max-height: min(80vh, 520px);
    display: flex;
    flex-direction: column;
    min-width: min(100vw - 16px, 300px);
    max-width: min(100vw - 16px, 380px);
    overflow: clip; /* coupe le rendu sans bloquer les scroll containers enfants */
    box-sizing: border-box;
}

.nd-model-menu__search-wrap {
    padding: 0 0.15rem 0.35rem;
    flex-shrink: 0;
}

.nd-model-menu__search {
    width: 100%;
    box-sizing: border-box;
    height: 2rem;
    padding: 0 0.55rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: #fafafa;
    font-size: 0.78rem;
    outline: none;
}

.nd-model-menu__search::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.nd-model-menu__search:focus {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

/* ── Toggle Mode automatique ────────────────────────────────────── */
.nd-auto-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.42rem 0.5rem 0.42rem 0.35rem;
    margin: 0 0 0.35rem;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s;
}
.nd-auto-toggle-row:hover {
    background: rgba(255, 255, 255, 0.07);
}

.nd-auto-toggle-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    pointer-events: none;
}
.nd-auto-toggle-left svg {
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

/* When auto mode is ON: hide model list + filter bar in picker */
.nd-model-menu-shell--auto .nd-model-menu,
.nd-model-menu-shell--auto .nd-model-filter-bar,
.nd-model-menu-shell--auto .nd-model-menu__search-wrap {
    display: none;
}
.nd-model-menu-shell--auto {
    /* Shrink the picker height since only the toggle is visible */
    max-height: none;
}
.nd-model-menu-shell--auto .nd-auto-toggle-row {
    margin-bottom: 0;
}

/* iOS-style switch */
.nd-auto-switch {
    position: relative;
    width: 2.2rem;
    height: 1.3rem;
    border-radius: 99px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s ease;
    outline: none;
}
.nd-auto-switch:focus-visible {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.55);
}
.nd-auto-switch[aria-checked="true"] {
    background: rgba(59, 130, 246, 0.85);
}
.nd-auto-switch__thumb {
    position: absolute;
    top: 50%;
    left: 0.18rem;
    transform: translateY(-50%);
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.nd-auto-switch[aria-checked="true"] .nd-auto-switch__thumb {
    left: calc(100% - 0.18rem - 0.95rem);
}

/* ── Barre de filtres par type ──────────────────────────────────── */
.nd-model-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    /* Négatif sur les côtés = bord à bord dans le shell malgré son padding */
    margin: 0 -0.45rem;
    padding: 0.3rem 0.6rem 0.55rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}
.nd-model-filter-bar::-webkit-scrollbar { display: none; }

.nd-model-filter-chip {
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.18rem 0.5rem;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    transition: background 0.13s, color 0.13s, border-color 0.13s;
    white-space: nowrap;
    line-height: 1.5;
}
.nd-model-filter-chip:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.75);
}
.nd-model-filter-chip--active,
.nd-model-filter-chip[aria-pressed="true"] {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.22);
}

/* Couleurs accent par type quand actif */
.nd-model-filter-chip--free[aria-pressed="true"]  { background: rgba(163,230,53,0.12);  color: rgba(163,230,53,0.95);  border-color: rgba(163,230,53,0.28); }
.nd-model-filter-chip--text[aria-pressed="true"]  { background: rgba(52,211,153,0.12);  color: rgba(52,211,153,0.95);  border-color: rgba(52,211,153,0.28); }
.nd-model-filter-chip--img[aria-pressed="true"]   { background: rgba(244,114,182,0.12); color: rgba(244,114,182,0.95); border-color: rgba(244,114,182,0.28); }
.nd-model-filter-chip--audio[aria-pressed="true"] { background: rgba(251,146,60,0.12);  color: rgba(251,146,60,0.95);  border-color: rgba(251,146,60,0.28); }
.nd-model-filter-chip--embed[aria-pressed="true"]    { background: rgba(34,211,238,0.12);  color: rgba(34,211,238,0.95);  border-color: rgba(34,211,238,0.28); }
.nd-model-filter-chip--popular[aria-pressed="true"] { background: rgba(250,204,21,0.12);  color: rgba(250,204,21,0.95);  border-color: rgba(250,204,21,0.28); }

/* ── Auto model badge ─────────────────────────────────────────────────────── */
.nd-auto-badge {
    background: rgba(59,130,246,0.12);
    color: rgba(147,197,253,0.95);
    border-color: rgba(59,130,246,0.28);
    font-size: 0.72rem;
}

.nd-model-menu__hint {
    margin: 0 0.2rem 0.4rem;
    font-size: 0.65rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.38);
    font-weight: 500;
}

.nd-model-menu__status {
    margin: 0 0.2rem 0.35rem;
    font-size: 0.68rem;
    color: rgba(251, 191, 36, 0.9);
}

.nd-model-menu {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    margin: 0;
    padding: 0.4rem 0.05rem 0.05rem;
}

.nd-model-menu__section {
    list-style: none;
    margin: 0.35rem 0.25rem 0.2rem;
    padding: 0.2rem 0.35rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
    pointer-events: none;
}


.nd-model-menu__prov {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.1rem 0.32rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.nd-model-menu__prov--nv {
    background: rgba(118, 185, 0, 0.18);
    color: #b8f076;
}

.nd-model-menu__prov--bz {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

.nd-model-menu__prov--lg {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
}

/* Tags fonctionnels : Premium / Image / Code / Vision / Audio / Embed / Chat */
.nd-model-menu__lic {
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Premium — or */
.nd-model-menu__lic--pro {
    background: rgba(251, 191, 36, 0.12);
    color: rgba(251, 191, 36, 0.8);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Open source / Chat — vert teal */
.nd-model-menu__lic--oss {
    background: rgba(52, 211, 153, 0.1);
    color: rgba(52, 211, 153, 0.75);
    border: 1px solid rgba(52, 211, 153, 0.18);
}

/* Image — rose */
.nd-model-menu__lic--img {
    background: rgba(244, 114, 182, 0.1);
    color: rgba(244, 114, 182, 0.85);
    border: 1px solid rgba(244, 114, 182, 0.2);
}

/* Code — bleu */
.nd-model-menu__lic--code {
    background: rgba(96, 165, 250, 0.1);
    color: rgba(96, 165, 250, 0.85);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

/* Vision — violet */
.nd-model-menu__lic--vis {
    background: rgba(167, 139, 250, 0.1);
    color: rgba(167, 139, 250, 0.85);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

/* Audio — orange */
.nd-model-menu__lic--audio {
    background: rgba(251, 146, 60, 0.1);
    color: rgba(251, 146, 60, 0.85);
    border: 1px solid rgba(251, 146, 60, 0.2);
}

/* Embed — cyan */
.nd-model-menu__lic--embed {
    background: rgba(34, 211, 238, 0.1);
    color: rgba(34, 211, 238, 0.8);
    border: 1px solid rgba(34, 211, 238, 0.18);
}

/* Vidéo — indigo */
.nd-model-menu__lic--video {
    background: rgba(129, 140, 248, 0.1);
    color: rgba(129, 140, 248, 0.85);
    border: 1px solid rgba(129, 140, 248, 0.2);
}

/* Free — vert lime */
.nd-model-menu__lic--free {
    background: rgba(163, 230, 53, 0.1);
    color: rgba(163, 230, 53, 0.9);
    border: 1px solid rgba(163, 230, 53, 0.22);
}

/* Reasoning — rose-violet */
.nd-model-menu__lic--reason {
    background: rgba(217, 70, 239, 0.1);
    color: rgba(217, 70, 239, 0.9);
    border: 1px solid rgba(217, 70, 239, 0.22);
}

.nd-model-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.35rem;
    cursor: pointer;
    color: rgba(250, 250, 250, 0.92);
    transition: background 0.12s ease;
}

.nd-model-menu__item:hover,
.nd-model-menu__item:focus {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.nd-model-menu__left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.nd-model-menu__left .nd-model-menu__ico {
    display: flex;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.nd-model-menu__left .nd-model-menu__ico svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.nd-model-menu__logo {
    width: 1rem;
    height: 1rem;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    border-radius: 3px;
}

.nd-model-menu__name {
    font-size: 0.8rem;
    font-weight: 500;
}

.nd-model-menu__check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: #3b82f6;
    opacity: 0;
}

.nd-model-menu__item[aria-selected='true'] .nd-model-menu__check {
    opacity: 1;
}

/* Dictée : glyphe dans #send-btn, états micro / arrêt / chargement */
.nd-send-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nd-send-glyph svg {
    display: block;
}

body.new-discussion-page .ruixen-ai-chat__submit.nd-voice--recording {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    box-shadow: none;
}

body.new-discussion-page .ruixen-ai-chat__submit.nd-voice--recording:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.nd-send-spinner {
    animation: nd-send-spin 0.75s linear infinite;
}

@keyframes nd-send-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pendant la dictée : trois points à la place du texte (léger) */
.nd-chat-field-wrap {
    position: relative;
    width: 100%;
}

.nd-voice-dots {
    position: absolute;
    left: 1rem;
    top: 1.42rem;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
}

.nd-voice-dots[hidden] {
    display: none !important;
}

.nd-voice-dots__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    animation: nd-voice-dot-pulse 1.05s ease-in-out infinite;
}

.nd-voice-dots__dot:nth-child(2) {
    animation-delay: 0.18s;
}

.nd-voice-dots__dot:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes nd-voice-dot-pulse {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

body.new-discussion-page .ruixen-ai-chat__field.ruixen-ai-chat__field--voice-dots {
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    caret-color: transparent;
    pointer-events: none;
}

body.new-discussion-page .ruixen-ai-chat__field.ruixen-ai-chat__field--voice-dots::placeholder {
    opacity: 0;
}

/* ── Chat mode — layout ───────────────────────────────────────────── */

.nd-chat-main.nd-chat-mode {
    overflow: hidden;
}

.nd-chat-mode .nd-chat-inner {
    justify-content: flex-end;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    gap: 0;
    height: 100vh;
    height: 100dvh;
    /* Colonne conversation + saisie plus large qu’en landing (52rem) */
    max-width: min(100%, 60rem);
    /* Moins de marge latérale : les bulles peuvent aller plus à gauche / à droite */
    padding-left: clamp(0.2rem, 1.2vw, 0.65rem);
    padding-right: clamp(0.2rem, 1.2vw, 0.65rem);
}

.nd-chat-mode .nd-chat-title {
    display: none;
}

.nd-chat-mode .nd-chat-embedded {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
    /* Le dashboard centre les enfants (align-items: center) → bulles au milieu ; en chat on étire */
    align-items: stretch;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.nd-chat-mode .dashboard-content--embedded .hero-chat-stack,
.nd-chat-mode .nd-chat-hero-stack {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 0.625rem;
    flex-shrink: 0;
    /* Aligner la barre Ruixen sur la largeur des bulles (dashboard.css limite sinon à 44rem) */
    max-width: 100%;
    width: 100%;
}

/* ── Chat messages container ─────────────────────────────────────── */

.nd-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.35rem 0;
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.nd-chat-messages::-webkit-scrollbar { width: 4px; }
.nd-chat-messages::-webkit-scrollbar-track { background: transparent; }
.nd-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
}

/* ── Messages : avatar au-dessus de la bulle (flex-col), user à droite / assistant à gauche ─ */

.nd-chat-msg {
    display: flex;
    width: 100%;
    padding: 0.25rem 0;
    animation: nd-msg-in 0.18s ease;
}

.nd-chat-msg--user {
    justify-content: flex-end;
}

.nd-chat-msg--assistant {
    justify-content: flex-start;
}

/* Stack : flex-col gap-2 — avatar puis bulle (référence type shadcn / capture) */
.nd-chat-msg__stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(80%, 42rem);
    min-width: 0;
}

.nd-chat-msg--user .nd-chat-msg__stack {
    align-items: flex-end;
}

.nd-chat-msg--assistant .nd-chat-msg__stack {
    align-items: flex-start;
}

.nd-chat-msg__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

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

/* Bulle commune : text-sm, rounded-2xl, px-4 py-3 */
.nd-chat-msg__bubble {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    word-break: break-word;
    border-radius: 1rem;
}

/* User — type primary / clair : gris moins « flash » que du blanc pur */
.nd-chat-msg--user .nd-chat-msg__bubble {
    background: #d4d4d8;
    color: #0a0a0a;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Assistant — type secondary / sombre */
.nd-chat-msg--assistant .nd-chat-msg__bubble {
    background: rgba(39, 39, 42, 0.92);
    color: #fafafa;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.nd-chat-msg__text {
    min-width: 0;
    color: inherit;
}

.nd-chat-msg--user .nd-chat-msg__bubble a {
    color: #2563eb;
}

.nd-chat-msg--user .nd-chat-msg__bubble a:hover {
    color: #1d4ed8;
}

.nd-chat-msg--assistant .nd-chat-msg__bubble a {
    color: #93c5fd;
}

.nd-chat-msg--assistant .nd-chat-msg__bubble a:hover {
    color: #bfdbfe;
}

.nd-chat-msg__bubble p   { margin: 0 0 0.45em; }
.nd-chat-msg__bubble p:last-child { margin-bottom: 0; }

/* Tableaux Markdown dans les bulles */
.nd-chat-msg__bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.6em 0;
    font-size: 0.82rem;
    overflow-x: auto;
    display: block;
}
.nd-chat-msg__bubble th,
.nd-chat-msg__bubble td {
    padding: 0.35rem 0.65rem;
    text-align: left;
    white-space: nowrap;
}
.nd-chat-msg--assistant .nd-chat-msg__bubble th {
    background: rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 600;
    color: #e4e4e7;
}
.nd-chat-msg--assistant .nd-chat-msg__bubble td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #d4d4d8;
}
.nd-chat-msg--assistant .nd-chat-msg__bubble tr:last-child td {
    border-bottom: none;
}
.nd-chat-msg--user .nd-chat-msg__bubble th {
    background: rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    font-weight: 600;
}
.nd-chat-msg--user .nd-chat-msg__bubble td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.nd-chat-msg--user .nd-chat-msg__bubble tr:last-child td {
    border-bottom: none;
}

.nd-chat-msg--assistant .nd-chat-msg__bubble pre {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    overflow-x: auto;
    font-size: 0.84rem;
    margin: 0.6em 0;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    color: #e4e4e7;
}

.nd-chat-msg--user .nd-chat-msg__bubble pre {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    overflow-x: auto;
    font-size: 0.84rem;
    margin: 0.6em 0;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    color: #0a0a0a;
}

.nd-chat-msg--assistant .nd-chat-msg__bubble code {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    padding: 0.1em 0.32em;
    font-size: 0.875em;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

.nd-chat-msg--user .nd-chat-msg__bubble code {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    padding: 0.1em 0.32em;
    font-size: 0.875em;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    color: #0a0a0a;
}

.nd-chat-msg__bubble pre code { background: none; padding: 0; font-size: inherit; }

/* ── Collapsible code blocks ──────────────────────────────────────── */
.nd-code-block {
    margin: 0.6em 0;
}
.nd-code-block--agent { display: none; }

.nd-code-block-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    user-select: none;
    list-style: none;
    gap: 8px;
}
.nd-code-block-hdr::-webkit-details-marker { display: none; }
.nd-code-block-hdr::marker { display: none; }

.nd-code-block-lang {
    font-size: 11px;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.04em;
    flex: 1;
}

.nd-code-block-chevron {
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.nd-code-block[open] .nd-code-block-chevron {
    transform: rotate(0deg);
}
.nd-code-block:not([open]) .nd-code-block-chevron {
    transform: rotate(-90deg);
}

.nd-code-block[open] .nd-code-block-hdr {
    border-radius: 8px 8px 0 0;
    border-bottom-color: transparent;
}
.nd-code-block:not([open]) .nd-code-block-hdr {
    border-radius: 8px;
}

.nd-code-block pre {
    margin: 0 !important;
    border-radius: 0 0 8px 8px !important;
    border-top: none !important;
}

/* User message variant */
.nd-chat-msg--user .nd-code-block-hdr {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}
.nd-chat-msg--user .nd-code-block-lang { color: rgba(0,0,0,0.4); }
.nd-chat-msg--user .nd-code-block-chevron { color: rgba(0,0,0,0.25); }

/* Avatars : user = fond sombre + icône claire ; assistant = fond clair (logo modèle) */
.nd-chat-msg__avatar {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 14px;
}

.nd-chat-msg__avatar--user {
    background: #0a0a0a;
    color: #fafafa;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nd-chat-msg--assistant .nd-chat-msg__avatar {
    background: linear-gradient(180deg, #3f3f46 0%, #27272a 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.nd-chat-msg__avatar img,
.nd-chat-msg__avatar .nd-model-menu__logo,
.nd-chat-msg__avatar .nd-chat-msg__model-logo {
    width: 1.5rem;
    height: 1.5rem;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

/* Logos SVG inline (Gemini, Claude, OpenAI…) — même logique que le sélecteur de modèle */
.nd-chat-msg__avatar .nd-model-menu__ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    color: rgba(24, 24, 27, 0.92);
}

.nd-chat-msg--assistant .nd-chat-msg__avatar .nd-model-menu__ico {
    color: #e4e4e7;
}

.nd-chat-msg__avatar .nd-model-menu__ico svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
}

.nd-chat-msg__avatar-emoji {
    font-size: 1rem;
    line-height: 1;
}

/* Auto mode avatar — lightning bolt in a subtle circle */
.nd-chat-msg__auto-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

/* Barre d’actions sous la bulle (dans .nd-chat-msg__body) */
.nd-chat-msg__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem;
}

.nd-chat-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Régénérer : même hauteur / hover que Copier / Partager, boîte plus large pour logos côte à côte */
.nd-chat-action--regenerate {
    width: auto;
    min-width: 5.75rem;
    padding: 0 0.4rem 0 0.45rem;
    gap: 0;
}

.nd-chat-action__regen-inner {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 1.25rem;
}

.nd-chat-action__regen-logos {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.nd-chat-action__regen-logo {
    width: 13px;
    height: 13px;
    object-fit: contain;
    border-radius: 9999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.nd-chat-action__regen-refresh {
    flex-shrink: 0;
    opacity: 0.8;
}

.nd-chat-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
}

.nd-chat-action--active {
    color: rgba(96, 165, 250, 0.95);
    background: rgba(96, 165, 250, 0.12);
}

.nd-chat-action--done {
    color: rgba(52, 211, 153, 0.95);
}

/* Streaming cursor */
.nd-chat-msg__cursor {
    display: inline-block;
    width: 2px;
    height: 0.95em;
    background: rgba(255,255,255,0.55);
    margin-left: 2px;
    vertical-align: text-bottom;
    border-radius: 1px;
    animation: nd-blink 0.75s step-end infinite;
}

@keyframes nd-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Erreurs dans la bulle */
.nd-chat-msg--assistant .nd-chat-msg__bubble .nd-chat-error {
    color: rgba(252, 165, 165, 0.95);
    font-style: italic;
}

.nd-chat-error-switch {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(252,165,165,0.35);
    background: rgba(252,165,165,0.1);
    color: rgba(252,165,165,0.9);
    cursor: pointer;
    transition: background 0.15s;
}
.nd-chat-error-switch:hover {
    background: rgba(252,165,165,0.2);
}

.nd-chat-msg--user .nd-chat-msg__bubble .nd-chat-error {
    color: #b91c1c;
    font-style: italic;
}

/* ── Bloc de réflexion (thinking) — inspiré du composant task-list ─────────── */
.nd-think-block {
    margin-bottom: 0.65rem;
    background: rgba(24, 24, 27, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.65rem;
    overflow: hidden;
    font-size: 0.82rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* Header */
.nd-think-block__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    background: rgba(139, 92, 246, 0.08);
    border-bottom: 1px solid rgba(139, 92, 246, 0.12);
    user-select: none;
}

/* Icône statut — spinning pendant le stream */
.nd-think-block__status {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nd-think-block__status--spinning {
    color: rgba(167, 139, 250, 0.8);
    animation: nd-think-status-pulse 1.5s ease-in-out infinite;
}
.nd-think-block__status--spinning .nd-think-spin-icon {
    animation: nd-think-spin 1s linear infinite;
}
.nd-think-block__status--done {
    color: rgba(134, 239, 172, 0.9);
}

@keyframes nd-think-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes nd-think-status-pulse {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 1;   }
}

/* Label */
.nd-think-block__label {
    flex: 1;
    font-weight: 600;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(196, 181, 253, 0.85);
}

/* Points animés (...) pendant le stream */
.nd-think-block__dots span {
    animation: nd-think-dot 1.2s ease-in-out infinite;
    opacity: 0;
}
.nd-think-block__dots span:nth-child(1) { animation-delay: 0s; }
.nd-think-block__dots span:nth-child(2) { animation-delay: 0.2s; }
.nd-think-block__dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nd-think-dot {
    0%, 60%, 100% { opacity: 0; }
    30%            { opacity: 1; }
}

/* Bouton toggle */
.nd-think-block__toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0.15rem;
    cursor: pointer;
    color: rgba(167, 139, 250, 0.6);
    display: flex;
    align-items: center;
    border-radius: 0.25rem;
    transition: color 0.15s, background 0.15s;
}
.nd-think-block__toggle:hover {
    color: rgba(196, 181, 253, 0.9);
    background: rgba(139, 92, 246, 0.12);
}

/* Corps */
.nd-think-block__body {
    position: relative;
    padding: 0.55rem 0.75rem 0.55rem 1.5rem;
    transition: all 0.2s ease;
    max-height: 16rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.25) transparent;
}
.nd-think-block--collapsed .nd-think-block__body {
    display: none;
}

/* Ligne pointillée verticale (comme dans le composant React) */
.nd-think-block__line {
    position: absolute;
    left: 0.7rem;
    top: 0.4rem;
    bottom: 0.4rem;
    width: 0;
    border-left: 2px dashed rgba(139, 92, 246, 0.3);
}

/* Contenu texte */
.nd-think-block__content {
    color: rgba(216, 180, 254, 0.65);
    line-height: 1.6;
    word-break: break-word;
    font-size: 0.8rem;
}
.nd-think-block__content p       { margin: 0 0 0.4em; }
.nd-think-block__content p:last-child { margin-bottom: 0; }
.nd-think-block__content strong  { color: rgba(216, 180, 254, 0.9); font-weight: 600; }
.nd-think-block__content em      { color: rgba(216, 180, 254, 0.75); }
.nd-think-block__content code    { font-size: 0.77rem; background: rgba(139, 92, 246, 0.12); padding: 0.1em 0.3em; border-radius: 3px; }
.nd-think-block__content ul,
.nd-think-block__content ol      { margin: 0.2em 0 0.4em 1.1em; padding: 0; }
.nd-think-block__content li      { margin-bottom: 0.15em; }


/* ── Hide cyber progress markers in chat ─────────────────────────── */
.nd-chat-msg__text *[data-cyber-marker],
.nd-chat-msg__text .cyber-marker { display: none; }


/* ─────────────────────────── Image Generation Animation ─────────────────────── */
.nd-imggen-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

@keyframes ndImggenShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.nd-imggen-label {
    font-size: 0.95rem;
    font-weight: 500;
    background: linear-gradient(110deg,
        rgba(255,255,255,0.45) 35%,
        rgba(255,255,255,0.95) 50%,
        rgba(255,255,255,0.45) 75%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: ndImggenShimmer 3s linear infinite;
}
.nd-imggen-wrap[data-state="completed"] .nd-imggen-label {
    animation: none;
    background-position: 0 0;
}

.nd-imggen-card {
    position: relative;
    border-radius: 0.75rem;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    max-width: 28rem;
    overflow: hidden;
    min-height: 14rem;
}
.nd-imggen-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

.nd-imggen-overlay {
    position: absolute;
    inset: -12% 0 0 0;
    height: 125%;
    pointer-events: none;
    backdrop-filter: blur(48px);
    -webkit-backdrop-filter: blur(48px);
    background: rgba(20, 20, 24, 0.35);
    transition: opacity 0.4s ease;
    clip-path: polygon(0 0%, 100% 0%, 100% 100%, 0 100%);
    will-change: clip-path, opacity;
}
.nd-imggen-wrap[data-state="completed"] .nd-imggen-overlay {
    opacity: 0;
}

/* Placeholder pendant que l'image charge */
.nd-imggen-card--placeholder {
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.06),
        rgba(168, 85, 247, 0.04),
        rgba(59, 130, 246, 0.06));
    background-size: 200% 200%;
    animation: ndImggenBgShift 6s ease-in-out infinite;
}
@keyframes ndImggenBgShift {
    0%, 100% { background-position: 0% 0%; }
    50%      { background-position: 100% 100%; }
}

