/* ── Synthèse & Explainer Agent ──────────────────────────────────────────── */

.nd-synth-panel {
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.nd-code-layout.nd-synth-active .nd-code-explorer,
.nd-code-layout.nd-synth-active .nd-code-viewer,
.nd-code-layout.nd-synth-active .nd-code-chat-panel,
.nd-code-layout.nd-synth-active .nd-ios-preview,
.nd-code-layout.nd-synth-active .nd-web-preview,
.nd-code-layout.nd-synth-active .nd-translate-input-panel,
.nd-code-layout.nd-synth-active .nd-document-preview,
.nd-code-layout.nd-synth-active .nd-slides-preview,
.nd-code-layout.nd-synth-active .nd-spreadsheet-preview,
.nd-code-layout.nd-synth-active .nd-research-panel {
    display: none !important;
}

.nd-code-layout.nd-synth-active .nd-synth-panel {
    display: flex;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.nd-sy-sidebar {
    width: 340px;
    min-width: 280px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
    overflow: hidden;
}

.nd-sy-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.nd-sy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.nd-sy-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
}

.nd-sy-badge svg { color: rgba(255, 255, 255, 0.3); }

.nd-sy-back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.nd-sy-back-btn:hover {
    color: rgba(255, 255, 255, 0.65);
    border-color: rgba(255, 255, 255, 0.13);
}

/* ── Input section ───────────────────────────────────────────────────────── */

.nd-sy-inputs {
    padding: 14px 13px 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* YouTube URL input */
.nd-sy-url-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s;
}

.nd-sy-url-wrap:focus-within {
    border-color: rgba(255, 255, 255, 0.16);
}

.nd-sy-url-icon { color: rgba(255, 255, 255, 0.25); flex-shrink: 0; }

.nd-sy-url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12.5px;
    font-family: inherit;
}

.nd-sy-url-input::placeholder { color: rgba(255, 255, 255, 0.2); }

.nd-sy-url-clear {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
    transition: color 0.12s;
}
.nd-sy-url-clear:hover { color: rgba(255, 255, 255, 0.55); }

/* YouTube preview card */
.nd-sy-yt-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    margin-top: 2px;
    animation: nd-sy-card-drop 0.18s ease;
}
.nd-sy-yt-preview[hidden] { display: none !important; }
.nd-sy-yt-thumb {
    width: 72px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
}
.nd-sy-yt-info { flex: 1; min-width: 0; }
.nd-sy-yt-title {
    display: block;
    font-size: 11.5px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Separator */
.nd-sy-separator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.18);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nd-sy-separator::before,
.nd-sy-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
}

/* ── Upload area (file mode) ────────────────────────────────────────────── */

.nd-sy-upload-area {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

/* Background drop zone (z-0) */
.nd-sy-drop-bg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    padding: 28px 12px;
    cursor: pointer;
    text-align: center;
    position: relative;
    z-index: 0;
    transition: background 0.15s;
}
.nd-sy-drop-bg.drag-over,
.nd-sy-drop-bg:hover { background: rgba(255, 255, 255, 0.025); }
.nd-sy-drop-bg input { display: none; }

/* Dashed border overlay (z-20, pointer-events none) */
.nd-sy-drop-border-overlay {
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    pointer-events: none;
    z-index: 20;
    transition: border-color 0.15s;
}
.nd-sy-drop-bg.drag-over ~ .nd-sy-drop-border-overlay {
    border-color: rgba(255, 255, 255, 0.26);
}

.nd-sy-drop-label {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.35);
    margin: 6px 0 3px;
}
.nd-sy-drop-types {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.18);
    letter-spacing: 0.02em;
}
.nd-sy-drop-icon { color: rgba(255, 255, 255, 0.18); margin-bottom: 2px; }

/* ── Document upload area ─────────────────────────────────────────────────── */
#nd-sy-doc-upload-area .nd-sy-drop-bg { min-height: 130px; padding: 22px 12px; }

/* Doc file card (same drop animation as video card) */
.nd-sy-doc-card {
    position: absolute;
    z-index: 10;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: calc(100% - 20px);
}
.nd-sy-doc-card[hidden] { display: none !important; }
.nd-sy-doc-card.is-dropping {
    animation: nd-sy-card-drop-in 0.85s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}
.nd-sy-doc-card.is-dropping .nd-sy-doc-inner {
    animation: nd-sy-card-inner-bounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s both;
}
.nd-sy-doc-card.is-removing {
    animation: nd-sy-card-remove-out 0.35s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Hide drop-bg content when file loaded (card covers it) */
.nd-sy-upload-area.has-file .nd-sy-drop-bg { visibility: hidden; }

/* Doc inner: full-area card matching the drop zone size */
.nd-sy-doc-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px 16px 18px;
    border-radius: 10px;
    background: rgba(14, 14, 18, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    position: relative;
    min-height: 110px;
    text-align: center;
}
.nd-sy-doc-icon {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, 0.45);
}
.nd-sy-doc-details { width: 100%; }
.nd-sy-doc-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nd-sy-doc-size {
    display: block;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.28);
    margin-top: 3px;
}
/* X button: absolute top-right, same style as video remove */
.nd-sy-doc-remove-btn {
    position: absolute;
    top: -7px; right: -7px;
    width: 19px; height: 19px;
    border-radius: 50%;
    background: rgba(210, 45, 45, 0.9);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.12s, background 0.15s;
    z-index: 5;
}
.nd-sy-doc-remove-btn:hover { transform: scale(1.1); background: rgb(220, 38, 38); }

/* File selected state (legacy, kept for doc section if needed) */
.nd-sy-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.nd-sy-file-icon {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

.nd-sy-file-name {
    flex: 1;
    min-width: 0;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nd-sy-file-size {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.nd-sy-file-remove {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
    line-height: 1;
    transition: color 0.12s;
    flex-shrink: 0;
}
.nd-sy-file-remove:hover { color: rgba(255, 255, 255, 0.55); }

/* Start button */
.nd-sy-start-btn {
    margin-top: 2px;
    width: 100%;
    padding: 8px 16px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.nd-sy-start-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.18);
}

.nd-sy-start-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.nd-sy-start-btn--stop {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: rgba(248, 113, 113, 0.9);
}

/* ── Depth slider ────────────────────────────────────────────────────────── */

.nd-sy-depth-bar {
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.nd-sy-depth-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.28);
    font-weight: 500;
    letter-spacing: 0.01em;
    user-select: none;
}

.nd-sy-depth-track-wrap {
    position: relative;
    height: 18px;
    display: flex;
    align-items: center;
}

.nd-sy-depth-track {
    position: absolute;
    left: 0; right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.nd-sy-depth-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 99px;
    transition: width 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 50%; /* default: moyen */
}

.nd-sy-depth-stops {
    position: absolute;
    left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nd-sy-depth-stop {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.nd-sy-depth-stop:hover { background: rgba(255, 255, 255, 0.45); transform: scale(1.3); }
.nd-sy-depth-stop.active { background: rgba(255, 255, 255, 0.9); }

.nd-sy-depth-thumb {
    position: absolute;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transform: translateX(-50%);
    left: 50%; /* default: moyen */
    transition: left 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    pointer-events: none;
}

/* ── Progress ────────────────────────────────────────────────────────────── */

.nd-sy-progress-wrap {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 12px;
}

.nd-sy-progress-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 13px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.12s;
}

.nd-sy-progress-toggle:hover { background: rgba(255, 255, 255, 0.02); }

.nd-sy-progress-toggle-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nd-sy-progress-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    transition: background 0.2s;
}

.nd-sy-progress-dot--running {
    background: rgba(255, 255, 255, 0.7);
    animation: nd-sy-pulse 1.4s ease-in-out infinite;
}

.nd-sy-progress-dot--done  { background: rgba(134, 239, 172, 0.6); }
.nd-sy-progress-dot--error { background: rgba(248, 113, 113, 0.7); }

@keyframes nd-sy-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.nd-sy-progress-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nd-sy-progress-chevron {
    color: rgba(255, 255, 255, 0.22);
    transition: transform 0.18s;
}

.nd-sy-progress-toggle[aria-expanded="true"] .nd-sy-progress-chevron {
    transform: rotate(180deg);
}

.nd-sy-steps {
    padding: 2px 0 6px;
    max-height: 180px;
    overflow-y: auto;
}

.nd-sy-step {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 4px 13px;
}

.nd-sy-step-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.nd-sy-step--pending .nd-sy-step-icon { color: rgba(255,255,255,0.15); }
.nd-sy-step--running .nd-sy-step-icon { color: rgba(255,255,255,0.65); }
.nd-sy-step--done    .nd-sy-step-icon { color: rgba(255,255,255,0.28); }
.nd-sy-step--error   .nd-sy-step-icon { color: rgba(248,113,113,0.75); }

.nd-sy-step-label {
    font-size: 11px;
    line-height: 1.5;
    color: rgba(255,255,255,0.35);
    word-break: break-word;
}

.nd-sy-step--running .nd-sy-step-label { color: rgba(255,255,255,0.75); }
.nd-sy-step--done    .nd-sy-step-label { color: rgba(255,255,255,0.22); }
.nd-sy-step--error   .nd-sy-step-label { color: rgba(248,113,113,0.7); }

@keyframes nd-sy-spin { to { transform: rotate(360deg); } }
.nd-sy-spin { animation: nd-sy-spin 0.9s linear infinite; }

/* ── Transcription collapsible (bottom of sidebar) ───────────────────────── */

.nd-sy-transcript-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.nd-sy-transcript-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 13px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.12s;
    flex-shrink: 0;
}

.nd-sy-transcript-toggle:hover { background: rgba(255, 255, 255, 0.02); }

.nd-sy-transcript-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nd-sy-transcript-chevron {
    color: rgba(255, 255, 255, 0.2);
    transition: transform 0.18s;
}

.nd-sy-transcript-toggle[aria-expanded="true"] .nd-sy-transcript-chevron {
    transform: rotate(180deg);
}

.nd-sy-transcript-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 13px 12px;
}

.nd-sy-transcript-text {
    font-size: 11px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.38);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Right panel ─────────────────────────────────────────────────────────── */

.nd-sy-report-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.nd-sy-report-title {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nd-sy-copy-btn,
.nd-sy-export-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.nd-sy-copy-btn:hover,
.nd-sy-export-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.nd-sy-report-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.1);
    padding: 40px;
}

.nd-sy-report-empty p {
    font-size: 12.5px;
    line-height: 1.6;
    text-align: center;
    max-width: 260px;
    margin: 0;
    color: rgba(255,255,255,0.18);
}

.nd-sy-report {
    flex: 1;
    overflow-y: auto;
    padding: 28px 36px 48px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13.5px;
    line-height: 1.72;
}

/* Markdown */
.nd-sy-report h1, .nd-sy-report h2, .nd-sy-report h3, .nd-sy-report h4 {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    margin: 1.6em 0 0.5em;
    line-height: 1.3;
}
.nd-sy-report h1 { font-size: 21px; border-bottom: 1px solid rgba(255,255,255,0.07); padding-bottom: 9px; margin-top: 0; }
.nd-sy-report h2 { font-size: 16px; }
.nd-sy-report h3 { font-size: 14px; }
.nd-sy-report h4 { font-size: 13px; color: rgba(255,255,255,0.6); }
.nd-sy-report p  { margin: 0.7em 0; }
.nd-sy-report strong { color: rgba(255,255,255,0.95); font-weight: 600; }
.nd-sy-report em     { color: rgba(255,255,255,0.7); }
.nd-sy-report a      { color: rgba(255,255,255,0.5); text-decoration: underline; text-decoration-color: rgba(255,255,255,0.18); }
.nd-sy-report a:hover { color: rgba(255,255,255,0.8); }
.nd-sy-report ul, .nd-sy-report ol { padding-left: 20px; margin: 0.6em 0; }
.nd-sy-report li { margin: 0.3em 0; }
.nd-sy-report blockquote { border-left: 2px solid rgba(255,255,255,0.14); padding-left: 14px; margin: 1em 0; color: rgba(255,255,255,0.45); font-style: italic; }
.nd-sy-report table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 1em 0; }
.nd-sy-report th { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); font-weight: 600; padding: 7px 12px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.09); }
.nd-sy-report td { padding: 6px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: rgba(255,255,255,0.62); }
.nd-sy-report hr { border: none; border-top: 1px solid rgba(255,255,255,0.06); margin: 1.8em 0; }
.nd-sy-report code { background: rgba(255,255,255,0.06); border-radius: 4px; padding: 1px 5px; font-size: 12px; font-family: 'SFMono-Regular','Consolas',monospace; }

/* ── Source picker (Vidéo mode step 1) ───────────────────────────────────── */

.nd-sy-source-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nd-sy-pick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: left;
}
.nd-sy-pick-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
}
.nd-sy-pick-btn svg { flex-shrink: 0; color: rgba(255,255,255,0.3); }

/* Sub-source wrapper */
.nd-sy-sub-source {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

/* Back button */
.nd-sy-source-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.28);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.12s;
    margin-bottom: 2px;
}
.nd-sy-source-back:hover { color: rgba(255, 255, 255, 0.55); }

/* ── Video preview card (drops from above) ───────────────────────────────── */

/* Card is absolutely centered inside .nd-sy-upload-area */
.nd-sy-video-card {
    position: absolute;
    z-index: 10;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: calc(100% - 20px);
}
.nd-sy-video-card[hidden] { display: none !important; }

/* Drop-in animation */
@keyframes nd-sy-card-drop-in {
    from { transform: translateX(-50%) translateY(calc(-50% - 600px)); }
    to   { transform: translateX(-50%) translateY(-50%); }
}
/* Bounce on inner card after landing */
@keyframes nd-sy-card-inner-bounce {
    from { transform: scale(0.92); }
    to   { transform: scale(1.0); }
}
/* Remove animation */
@keyframes nd-sy-card-remove-out {
    from { transform: translateX(-50%) translateY(-50%) scale(1); opacity: 1; filter: blur(0); }
    to   { transform: translateX(-50%) translateY(-50%) scale(0.1); opacity: 0; filter: blur(6px); }
}

.nd-sy-video-card.is-dropping {
    animation: nd-sy-card-drop-in 0.85s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}
.nd-sy-video-card.is-dropping .nd-sy-video-inner {
    animation: nd-sy-card-inner-bounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s both;
}
.nd-sy-video-card.is-removing {
    animation: nd-sy-card-remove-out 0.35s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Inner card (handles border/bg/shadow independently of position animation) */
.nd-sy-video-inner {
    position: relative;
    border-radius: 10px;
    overflow: visible; /* so X button can overflow */
    background: rgba(10, 10, 14, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.nd-sy-video-el {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    background: #000;
}

/* Loading spinner overlay */
.nd-sy-video-loading {
    position: absolute;
    inset: 0;
    height: auto;
    aspect-ratio: 16 / 9;
    top: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.nd-sy-video-loading[hidden] { display: none !important; }
.nd-sy-video-spinner {
    width: 22px; height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: nd-sy-spin 0.65s linear infinite;
}
@keyframes nd-sy-spin { to { transform: rotate(360deg); } }

.nd-sy-video-play-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    backdrop-filter: blur(4px);
    z-index: 4;
}
.nd-sy-video-play-btn:hover { background: rgba(0, 0, 0, 0.88); }

.nd-sy-video-remove-btn {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: rgba(210, 45, 45, 0.9);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, transform 0.12s;
    z-index: 25;
}
.nd-sy-video-inner:hover .nd-sy-video-remove-btn { opacity: 1; }
.nd-sy-video-remove-btn:hover { transform: scale(1.1); background: rgb(220, 38, 38); }

.nd-sy-video-filename {
    padding: 6px 10px 7px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.38);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0 0 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Middle transcript panel ─────────────────────────────────────────────── */

.nd-sy-transcript-panel {
    width: 270px;
    min-width: 200px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.01);
    overflow: hidden;
    animation: nd-sy-panel-in 0.22s ease;
}

@keyframes nd-sy-panel-in {
    from { width: 0; opacity: 0; }
    to   { width: 270px; opacity: 1; }
}

.nd-sy-transcript-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.nd-sy-transcript-panel-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nd-sy-transcript-panel-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s;
}
.nd-sy-transcript-panel-close:hover { color: rgba(255, 255, 255, 0.6); }

.nd-sy-transcript-panel .nd-sy-transcript-text {
    flex: 1;
    overflow-y: auto;
    padding: 12px 13px 16px;
    margin: 0;
    font-size: 11px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.35);
    white-space: pre-wrap;
    word-break: break-word;
}

/* "Transcription" button in report header */
.nd-sy-transcript-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.nd-sy-transcript-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}
.nd-sy-transcript-toggle-btn.active {
    color: rgba(255, 255, 255, 0.65);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
}

/* ── Header right (mode badge + back btn) ────────────────────────────────── */

.nd-sy-header-right {
    display: flex;
    align-items: center;
    gap: 7px;
}

.nd-sy-mode-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 7px;
}

/* ── Source sections ─────────────────────────────────────────────────────── */

/* Prevent display:flex from overriding [hidden] */
.nd-sy-source-section[hidden],
.nd-sy-transcript-panel[hidden],
.nd-sy-report-empty[hidden],
.nd-sy-report[hidden],
.nd-sy-report-header[hidden] { display: none !important; }

/* ── Model selector bar ──────────────────────────────────────────────────── */

.nd-sy-model-bar {
    position: relative;
    padding: 6px 10px 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.nd-sy-model-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 7px;
    padding: 5px 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11.5px;
    font-family: inherit;
    text-align: left;
    transition: background 0.12s, border-color 0.12s;
}
.nd-sy-model-btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.13); }

.nd-sy-model-icon {
    width: 16px; height: 16px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    line-height: 1;
}
.nd-sy-model-icon img { width: 15px; height: 15px; object-fit: contain; border-radius: 3px; }

.nd-sy-model-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.nd-sy-model-chevron {
    flex-shrink: 0;
    color: rgba(255,255,255,0.3);
    transition: transform 0.15s;
}
.nd-sy-model-btn[aria-expanded="true"] .nd-sy-model-chevron { transform: rotate(180deg); }

/* Dropdown */
.nd-sy-model-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    left: 10px;
    right: 10px;
    z-index: 200;
    background: #1a1a1f;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow: hidden;
}
.nd-sy-model-dropdown[hidden] { display: none !important; }

.nd-sy-model-search-wrap {
    padding: 8px 8px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.nd-sy-model-search {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 5px 8px;
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.nd-sy-model-search::placeholder { color: rgba(255,255,255,0.2); }
.nd-sy-model-search:focus { border-color: rgba(255,255,255,0.18); }

.nd-sy-model-list {
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
}

.nd-sy-model-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255,255,255,0.72);
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
}
.nd-sy-model-item:hover { background: rgba(255,255,255,0.06); }
.nd-sy-model-item.is-selected { color: #fff; background: rgba(255,255,255,0.08); }
.nd-sy-model-item__icon {
    width: 16px; height: 16px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.nd-sy-model-item__icon img { width: 14px; height: 14px; object-fit: contain; border-radius: 2px; }
.nd-sy-model-item__label {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis;
}
.nd-sy-model-item__check {
    flex-shrink: 0;
    color: rgba(255,255,255,0.5);
    display: none;
}
.nd-sy-model-item.is-selected .nd-sy-model-item__check { display: block; }
.nd-sy-model-group-header {
    padding: 5px 10px 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 2px;
}
.nd-sy-model-group-header:first-child { border-top: none; margin-top: 0; }

/* ── Source sections ─────────────────────────────────────────────────────── */

.nd-sy-source-section {
    padding: 12px 13px 10px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
    max-height: 480px;
}

/* "ou" separator */
.nd-sy-separator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.18);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.nd-sy-separator::before,
.nd-sy-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
}

/* Start button wrapper */
.nd-sy-start-wrap {
    padding: 10px 13px 4px;
    flex-shrink: 0;
}
.nd-sy-start-wrap .nd-sy-start-btn { margin-top: 0; }

/* ── Paste textarea ──────────────────────────────────────────────────────── */

.nd-sy-paste-wrap {
    display: flex;
    flex-direction: column;
}

.nd-sy-paste {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 9px 11px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 90px;
    outline: none;
    transition: border-color 0.15s;
}
.nd-sy-paste:focus { border-color: rgba(255, 255, 255, 0.16); }
.nd-sy-paste::placeholder { color: rgba(255, 255, 255, 0.18); }

/* ── Narrow overlay variant (2 cols, no grid overflow) ───────────────────── */

.nd-agent-panel--narrow {
    max-width: 520px;
}

.nd-agent-panel__grid--2col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */

.nd-sy-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(28, 28, 32, 0.96);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.75);
    font-size: 12.5px;
    z-index: 9999;
    animation: nd-sy-toast-in 0.2s ease;
    backdrop-filter: blur(12px);
}
.nd-sy-toast--error { border-color: rgba(248,113,113,0.3); color: rgba(248,113,113,0.85); }
@keyframes nd-sy-toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
