/* =========================================================
   ARCHITECTURE NODES & DIAGNOSTIC LOGS
   Design haute visibilité avec Overview et coloration syntaxique
========================================================= */

.node {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
    min-height: 0;
    min-width: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.node:hover {
    box-shadow: var(--shadow-md);
}

.node.active-tier {
    border-color: var(--accent-blue);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

/* Header des Nœuds */
.node-header {
    padding: 12px 16px;
    font-weight: 500;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #252526 !important; /* VS Code tab bar color */
    border-bottom: 1px solid #111111 !important;
    color: #cccccc !important;
    letter-spacing: 0.01em;
    user-select: none;
}

/* Window Controls (Mac Style) */
.window-controls {
    display: flex;
    gap: 6px;
    margin-right: 12px;
}

.control-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    opacity: 0.9;
}

.control-dot.close { background-color: #ff5f56; }
.control-dot.minimize { background-color: #ffbd2e; }
.control-dot.maximize { background-color: #27c93f; }

.node-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
}

.node-icon {
    font-size: 1rem;
}

.node-status-indicator {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    text-transform: uppercase;
}

/* Couleurs par nœud */
#node-bank .node-header {
    background: var(--node-bank-bg);
    border-bottom-color: var(--node-bank-border);
    color: #38bdf8;
}
#node-bank .node-status-indicator {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

#node-ai .node-header {
    background: var(--node-ai-bg);
    border-bottom-color: var(--node-ai-border);
    color: #fbbf24;
}
#node-ai .node-status-indicator {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

#node-llm .node-header {
    background: var(--node-llm-bg);
    border-bottom-color: var(--node-llm-border);
    color: #c084fc;
}
#node-llm .node-status-indicator {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.3);
}

/* Contenu du Nœud : Zone de défilement principale */
.node-content {
    flex: 1 1 0%;
    min-height: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #1e1e1e; /* VS Code dark theme background */
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
    font-family: 'Cairo', 'Cairo Play', sans-serif; /* Editor font */
}

.node-content::-webkit-scrollbar {
    width: 6px;
}

.node-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
}

.node-content::-webkit-scrollbar-thumb {
    background-color: #475569;
    border-radius: 4px;
}

.node-content::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}

/* Conteneur des logs interne */
.node-logs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-height: min-content;
}

/* Accordéons d'Interaction */
details.node-log-group {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

details.node-log-group[open] {
    border-color: #334155;
}

/* Header d'interaction amélioré avec Overview Tags */
.node-group-summary {
    font-size: 0.76rem;
    font-weight: 600;
    color: #e2e8f0;
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #1a2234;
    border-bottom: 1px solid transparent;
    user-select: none;
    gap: 8px;
}

.node-group-summary::-webkit-details-marker {
    display: none;
}

.node-group-summary::marker {
    display: none;
}

details.node-log-group[open] .node-group-summary {
    border-bottom-color: #1e293b;
    background-color: #162032;
}

.node-group-summary::after {
    content: '▼';
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: 4px;
}

details.node-log-group[open] .node-group-summary::after {
    transform: rotate(180deg);
    color: #38bdf8;
}

.summary-left {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.interaction-id {
    color: #38bdf8;
    font-weight: 700;
    font-size: 0.72rem;
}

.interaction-title {
    color: #cbd5e1;
    font-weight: 500;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.badge-pending {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-tag-amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-tag-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-tag-neutral {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
}

/* =========================================================
   CARTE D'OVERVIEW / SYNTHÈSE VISUELLE
========================================================= */
.interaction-overview-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.overview-badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.overview-badge.badge-continue {
    color: #fbbf24;
}

.overview-badge.badge-trigger {
    color: #34d399;
}

.overview-badge.badge-success {
    color: #38bdf8;
}

.overview-step-pill {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'Cairo', 'Cairo Play', sans-serif;
}

.overview-content-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.72rem;
}

.overview-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    line-height: 1.35;
}

.stat-lbl {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
}

.stat-val {
    color: #f1f5f9;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.highlight-continue {
    color: #fbbf24;
}

.highlight-trigger {
    color: #34d399;
}

/* =========================================================
   ENTRÉES DE LOGS JSON COMPACTES & SANS CASSE DE MOTS
========================================================= */
.logs-entries-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 2px 4px 2px;
}

.node-log-entry {
    font-family: 'Cairo', 'Cairo Play', sans-serif;
    font-size: 0.7rem;
    background: #090e1a;
    padding: 6px 9px;
    margin: 2px 4px;
    border-radius: 6px;
    border: 1px solid #1e293b;
    border-left: 3px solid #64748b;
    flex-shrink: 0;
    overflow-x: auto;
    position: relative;
}

.node-log-entry.out {
    border-left-color: #f59e0b;
}

.node-log-entry.in {
    border-left-color: #10b981;
}

.node-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.8);
    cursor: pointer;
    list-style: none;
    outline: none;
}

.node-log-header::-webkit-details-marker {
    display: none;
}

.node-log-dir {
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.03em;
}

.node-log-dir::after {
    content: "▼";
    font-size: 0.5rem;
    color: #64748b;
    margin-left: 4px;
    transition: transform 0.2s;
}

details:not([open]) > .node-log-header .node-log-dir::after {
    transform: rotate(-90deg);
}

.dir-icon-badge {
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 800;
}

.dir-icon-badge.out {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.dir-icon-badge.in {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.dir-target-name {
    color: #94a3b8;
}

.copy-json-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(51, 65, 85, 0.8);
    color: #94a3b8;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 3px;
}

.copy-json-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: #64748b;
}

/* Bloc de code JSON : Ne casse JAMAIS les mots au milieu ! */
.node-log-entry pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: break-word;
    color: #cbd5e1;
    line-height: 1.4;
    font-size: 0.68rem;
}

/* Coloration syntaxique */
.json-k {
    color: #38bdf8; /* Clés en bleu ciel */
}

.json-s {
    color: #e2e8f0; /* Valeurs chaînes en blanc adouci */
}

.json-n {
    color: #c084fc; /* Nombres en violet */
}

.json-b {
    color: #fb923c; /* Booléens en orange */
}

.val-continue {
    color: #fbbf24 !important;
    font-weight: 600;
}

.val-trigger {
    color: #34d399 !important;
    font-weight: 600;
}

/* =========================================================
   PLIAGE DE REGISTRY (Inline & Garanti sans casse)
========================================================= */
.registry-fold {
    display: inline;
    position: relative;
}

.registry-fold-summary {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.64rem;
    font-family: 'Cairo', 'Cairo Play', sans-serif;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    list-style: none;
    outline: none;
    transition: all 0.15s ease;
    vertical-align: baseline;
    line-height: 1.3;
}

.registry-fold-summary::-webkit-details-marker {
    display: none;
}

.registry-fold-summary::marker {
    display: none;
}

.registry-fold-summary:hover {
    background: rgba(56, 189, 248, 0.28);
    color: #ffffff;
    border-color: #38bdf8;
}

.registry-fold[open] .registry-fold-summary {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
    margin-bottom: 4px;
}

.registry-fold-content {
    display: block;
    padding-left: 10px;
    border-left: 2px solid rgba(56, 189, 248, 0.35);
    margin: 4px 0;
    color: #94a3b8;
    font-size: 0.66rem;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

/* Empty State */
.empty-logs-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6a9955; /* VS Code comment color */
    font-family: 'Cairo', 'Cairo Play', sans-serif;
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
    padding: 20px;
    gap: 6px;
}

.empty-logs-placeholder span::before {
    content: "// ";
}

/* =========================================================
   FLUX D'INFORMATION ENTRE NŒUDS
   req = requête (vers le LLM, bleu) · res = réponse (vers le mobile, vert)
========================================================= */
.flow-packet {
    position: absolute;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 280px;
    padding: 4px 10px 4px 4px;
    border-radius: 9999px;
    font-family: 'Cairo', 'Cairo Play', sans-serif;
    font-size: 0.68rem;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.flow-packet.req {
    background: #0c2a3d;
    border: 1px solid #38bdf8;
    color: #e0f2fe;
}

.flow-packet.res {
    background: #0b2e22;
    border: 1px solid #34d399;
    color: #d1fae5;
}

.flow-packet-hop,
.hop-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.62rem;
    font-weight: 800;
    color: #0b1120;
    flex-shrink: 0;
}

.flow-packet.req .flow-packet-hop,
.hop-badge.req { background: #38bdf8; }

.flow-packet.res .flow-packet-hop,
.hop-badge.res { background: #34d399; }

.hop-badge {
    min-width: 16px;
    height: 16px;
    font-size: 0.58rem;
}

.flow-packet-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.node.flow-sending {
    border-color: #f59e0b;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.3);
}

.node.flow-receiving {
    border-color: #34d399;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.3);
}

#node-mobile.flow-sending .iphone-frame {
    box-shadow: 0 0 0 2px #f59e0b, 0 0 24px rgba(245, 158, 11, 0.35);
}

#node-mobile.flow-receiving .iphone-frame {
    box-shadow: 0 0 0 2px #34d399, 0 0 24px rgba(16, 185, 129, 0.35);
}

.node-log-entry.just-arrived {
    animation: log-arrive 1.2s ease-out;
}

@keyframes log-arrive {
    0% { background: rgba(52, 211, 153, 0.18); }
    100% { background: #090e1a; }
}

@media (prefers-reduced-motion: reduce) {
    .flow-packet { display: none; }
    .node-log-entry.just-arrived { animation: none; }
}

/* =========================================================
   CARTE DE TRANSIT : IN → traitement → OUT d'un même nœud
========================================================= */
.transit-card {
    margin: 4px;
    border: 1px solid #1e293b;
    border-left: 3px solid #38bdf8;
    border-radius: 8px;
    background: #0b1222;
    overflow: hidden;
    flex-shrink: 0;
}

.transit-card.res {
    border-left-color: #34d399;
}

.transit-card .node-log-entry {
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 5px 9px;
}

.transit-card .node-log-entry.just-arrived {
    animation: transit-arrive 1.2s ease-out;
}

@keyframes transit-arrive {
    0% { background: rgba(52, 211, 153, 0.16); }
    100% { background: transparent; }
}

.transit-process {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 9px 0 17px;
    padding: 3px 0 3px 12px;
    border-left: 1px dashed #334155;
    font-size: 0.63rem;
    font-style: italic;
    color: #cbd5e1;
}

.transit-process-icon {
    font-style: normal;
    color: #64748b;
}

.transit-process.pending .transit-process-text {
    color: #fbbf24;
    animation: transit-pulse 1s ease-in-out infinite;
}

.transit-process.pending .transit-process-icon {
    display: inline-block;
    animation: transit-spin 1.4s linear infinite;
}

@keyframes transit-pulse {
    50% { opacity: 0.45; }
}

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

.transit-slot-in:empty,
.transit-slot-out:empty {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .transit-process.pending .transit-process-text,
    .transit-process.pending .transit-process-icon,
    .transit-card .node-log-entry.just-arrived { animation: none; }
}

/* =========================================================
   EN-TÊTE D'ACCORDÉON : message + badge / résumé pertinent du nœud
========================================================= */
.node-group-summary {
    flex-wrap: wrap;
    row-gap: 3px;
}

.node-group-summary .summary-left {
    flex: 1 1 0;
    min-width: 0;
}

.node-group-summary::after {
    order: 1;
}

.summary-detail {
    order: 2;
    flex-basis: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.66rem;
    font-weight: 500;
    color: #cbd5e1;
}

.detail-progress {
    color: #64748b;
}

.detail-progress.involved {
    color: #fbbf24;
    animation: transit-pulse 1s ease-in-out infinite;
}

.detail-muted {
    color: #64748b;
    font-style: italic;
}

.badge-tag-red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* =========================================================
   CORPS : une ligne par IN / OUT, JSON au clic
========================================================= */
.logs-entries-container {
    padding: 4px 2px;
}

.transit-card .node-log-entry {
    padding: 0;
}

.transit-card .node-log-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 5px 9px;
    border-bottom: none;
    font-size: 0.66rem;
}

.transit-card .node-log-header:hover {
    background: rgba(148, 163, 184, 0.06);
}

.transit-card .node-log-header::after {
    content: "▸";
    color: #475569;
    font-size: 0.6rem;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.transit-card details[open] > .node-log-header::after {
    transform: rotate(90deg);
}

.row-dir {
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.row-dir.in { color: #34d399; }
.row-dir.out { color: #fbbf24; }

.row-peer {
    flex-shrink: 0;
    color: #f1f5f9;
    font-weight: 700;
}

.node-log-preview {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #94a3b8;
}

.node-log-body {
    position: relative;
    margin: 0 9px 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #060a14;
    border: 1px solid #1e293b;
}

.node-log-body .copy-json-btn {
    position: absolute;
    top: 5px;
    right: 5px;
}

.transit-process {
    padding: 1px 0 1px 12px;
    font-size: 0.6rem;
    color: #94a3b8;
}

/* =========================================================
   INFORMATIONS PERSONNELLES DÉTECTÉES
========================================================= */
mark.pii {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.28);
    border-bottom: 1px solid #ef4444;
    border-radius: 3px;
    padding: 0 2px;
    cursor: help;
}

.pii-badge {
    flex-shrink: 0;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    color: #fecaca;
    background: rgba(220, 38, 38, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.55);
}

.transit-card .node-log-entry.has-pii .hop-badge {
    box-shadow: 0 0 0 2px #ef4444;
}

.secure-badge {
    flex-shrink: 0;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.5);
}

/* OTP simulé (SMS) affiché dans l'en-tête NAB Backend */
.otp-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 3px 1px 6px;
    border-radius: 5px;
    border: 1px solid rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font: inherit;
    font-size: 0.6rem;
    cursor: copy;
}

.otp-chip-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.otp-chip-code { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; color: #fef3c7; }

.otp-chip-copy {
    padding: 0 5px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.25);
    font-weight: 700;
}

.otp-chip:hover { background: rgba(245, 158, 11, 0.22); }

/* =========================================================
   REQUÊTE SÉCURISÉE BANQUE <-> APP (aucun échange avec l'IA)
========================================================= */
details.node-log-group.secure-flow {
    border-color: rgba(245, 158, 11, 0.45);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.07) 0%, #111827 60px);
}

details.node-log-group.secure-flow[open] {
    border-color: rgba(245, 158, 11, 0.65);
}

details.node-log-group.secure-flow > .node-group-summary {
    background-color: rgba(245, 158, 11, 0.08);
}

details.node-log-group.secure-flow .interaction-id {
    color: #fbbf24;
}

.secure-flow-note {
    order: 3;
    flex-basis: 100%;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 2px;
    padding-top: 5px;
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 0.64rem;
    font-weight: 500;
    line-height: 1.35;
    color: #fbbf24;
}

.secure-flow-note svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Mention sécurisée en pied d'accordéon (comme le pied du secure block dans l'iPhone) */
details.node-log-group.secure-flow > .secure-flow-note {
    order: initial;
    flex-basis: auto;
    margin: 4px 0 0;
    padding: 7px 12px;
    border-top: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(2, 6, 23, 0.35);
    font-size: 0.64rem;
    color: #94a3b8;
}

details.node-log-group.secure-flow > .secure-flow-note svg {
    color: #fbbf24;
}

/* Mention sécurisée : dans l'en-tête (toujours visible, même accordéon fermé), stylée comme un pied de bloc */
details.node-log-group.secure-flow > .node-group-summary > .secure-flow-note {
    order: 3;
    flex-basis: calc(100% + 24px);
    margin: 6px -12px -8px;
    padding: 7px 12px;
    border-top: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(2, 6, 23, 0.35);
    font-size: 0.64rem;
    font-weight: 500;
    color: #94a3b8;
}

details.node-log-group.secure-flow > .node-group-summary > .secure-flow-note svg {
    color: #fbbf24;
}

/* Ouvert : le filet du pied reste sous l'en-tête */
details.node-log-group.secure-flow[open] > .node-group-summary {
    border-bottom-color: rgba(245, 158, 11, 0.25);
}

/* Pied sécurisé identique fermé / ouvert */
details.node-log-group.secure-flow > .secure-flow-note {
    margin: 6px 0 0;
}

/* Passage sécurisé (NAB -> app avec secure block) dans une interaction qui a aussi impliqué l'IA */
.transit-card.secure {
    border-color: rgba(245, 158, 11, 0.45);
    border-left-color: #f59e0b;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.07) 0%, #0b1222 70px);
}

.transit-card.secure .node-log-entry.out .hop-badge { background: #f59e0b; }

.transit-card.secure > .transit-secure-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 6px 10px;
    border-top: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(2, 6, 23, 0.35);
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.35;
    color: #94a3b8;
}

.transit-card.secure > .transit-secure-note svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px; color: #fbbf24; }

/* Opération sécurisée dans l'interaction : badge dans l'en-tête */
.badge-tag-secure {
    display: inline-flex; align-items: center; gap: 4px;
    margin-inline-start: 4px; padding: 1px 7px; border-radius: 999px;
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em;
    color: #34d399; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-tag-secure svg { width: 10px; height: 10px; }

/* Étape d'outil interne (NAB Backend, sans transit) */
.node-log-entry.internal-step { border-color: rgba(16, 185, 129, 0.45) !important; background: rgba(16, 185, 129, 0.06) !important; }
.hop-badge.internal { background: #10b981 !important; color: #052e1f !important; }
.row-dir.internal { color: #34d399; font-weight: 700; }
.internal-step-note { padding: 2px 10px 6px 34px; font-size: 0.62rem; font-style: italic; color: #94a3b8; }
