/* ── Utility ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Details slide animation ────────────────────────────────────────── */
#verify-row-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.45s ease, opacity 0.35s ease;
}

#verify-row-details.details-open {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.5s ease, opacity 0.4s ease 0.05s;
}

/* ── Base ──────────────────────────────────────────────────────────── */
* {
    font-family: 'Roboto Condensed', Arial, Helvetica, sans-serif;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background-color: #f9f6f9;
    padding-top: 56px;
    /* navbar height */
    display: flex;
    flex-direction: column;
}

body>.container-fluid,
body>.container {
    flex: 1;
}

.footer {
    margin-top: auto;
}

code,
.real-vector,
.pipeline-box__preview,
.pipeline-box__size,
.bit-size,
.kpi-value,
.score-value {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* ── GREYC brand ────────────────────────────────────────────────────── */
.greyccolor {
    background-color: rgb(99, 16, 88);
    color: white;
}

.btn-greyc {
    background-color: rgb(99, 16, 88);
    color: white;
    border: none;
}

.btn-greyc:hover {
    background-color: rgb(76, 10, 68);
    color: white;
}

.btn-outline-greyc {
    color: rgb(99, 16, 88);
    border: 1px solid rgb(99, 16, 88);
    background: transparent;
}

.btn-outline-greyc:hover {
    background-color: rgba(99, 16, 88, 0.08);
}

/* ── Navbar ─────────────────────────────────────────────────────────── */
.logoheader {
    width: 160px;
    padding-right: 20px;
}

/* ── Loading overlay ────────────────────────────────────────────────── */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#loading-overlay.hidden {
    display: none;
}

.loader-content {
    text-align: center;
    max-width: 380px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #eee;
    border-top-color: rgb(99, 16, 88);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.progress-fill {
    background: rgb(99, 16, 88);
}

/* ── Section layout ─────────────────────────────────────────────────── */
.demo-container {
    padding-top: 20px;
}

.section-title {
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 1.4rem;
    font-weight: 700;
}

.step-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgb(99, 16, 88);
    margin-bottom: 6px;
}

.step-desc {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* ── Step indicator ─────────────────────────────────────────────────── */
#step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #e8e0e8;
    color: #666;
    font-size: 0.85rem;
    cursor: default;
    transition: background 0.2s, color 0.2s;
}

.step.done {
    cursor: pointer;
}

.step.done:hover {
    background: rgba(99, 16, 88, 0.28);
}

.step.active {
    background: rgb(99, 16, 88);
    color: white;
}

.step.done {
    background: rgba(99, 16, 88, 0.18);
    color: rgb(99, 16, 88);
}

.step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.step-divider {
    flex: 1;
    max-width: 32px;
    height: 2px;
    background: #ddd;
}

.step-divider.done {
    background: rgb(99, 16, 88);
}

/* ── Step sections (single-page: toujours visible) ─────────────────── */
.step-section {
    display: block;
}


#enrolled-preview-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

#method-prompt {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 0.7rem;
    color: #92400e;
    font-weight: 600;
}
#method-prompt i { color: #f59e0b; }

#gallery-prompt {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 0.7rem;
    color: #92400e;
    font-weight: 600;
    animation: pulse-orange 1.8s ease-in-out infinite;
}
#gallery-prompt i { color: #f59e0b; }

#gallery-live-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    border: 1.5px solid #059669;
    border-radius: 6px;
    padding: 5px 10px;
    margin-bottom: 8px;
    font-size: 0.68rem;
    color: #065f46;
    font-weight: 500;
}
#gallery-live-hint i { color: #059669; }

@keyframes pulse-orange {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.0); }
    50%       { box-shadow: 0 0 0 4px rgba(245,158,11,0.25); }
}

/* ── Progressive unlock ─────────────────────────────────────────────── */
.section-disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(60%);
    transition: opacity 0.35s ease, filter 0.35s ease;
}

/* Spinner overlay for section loading (model load) */
.section-loading {
    position: relative;
}
.section-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid rgba(99,16,88,0.15);
    border-top-color: #631058;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    pointer-events: none;
    z-index: 10;
}

/* Highlight du select méthode quand enrollment fait mais méthode non choisie */
.method-select--highlight {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.35);
    animation: pulse-border 1.4s ease-in-out infinite;
}
@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 2px rgba(245,158,11,0.35); }
    50%       { box-shadow: 0 0 0 4px rgba(245,158,11,0.15); }
}

/* ── Camera / video ─────────────────────────────────────────────────── */
.camera-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.video-wrapper {
    position: relative;
    max-width: 350px;
    height: 280px;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* 1. Ajoute l'effet miroir visuel à la vidéo */
}

.video-wrapper canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    /* 2. Force le canvas à avoir la même taille que la vidéo */
    height: 100%;
}

.video-wrapper--small {
    width: 220px;
    height: 145px;
}

/* .face-guide — cercle pointillé supprimé sur demande */
.face-guide-DISABLED {
    position: absolute;
    top: 7%;
    left: 50%;
    transform: translateX(-50%);
    width: 56%;
    height: 84%;
    border: 2px dashed rgba(99, 16, 88, 0.65);
    border-radius: 50%;
    pointer-events: none;
}

/* ── Result panel ───────────────────────────────────────────────────── */
.result-panel.hidden {
    display: none;
}

.face-canvas {
    border: 2px solid #ddd;
    border-radius: 4px;
    display: block;
}

/* ── Card panels ────────────────────────────────────────────────────── */
.card-panel {
    background: white;
    border: 1px solid #e8e0e8;
    border-radius: 6px;
    padding: 8px 12px;
}

.panel-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgb(99, 16, 88);
    margin-bottom: 6px;
}

/* ── Step 2: Method selection ───────────────────────────────────────── */
.method-info-panel {
    background: white;
    border: 1px solid #e8e0e8;
    border-radius: 6px;
    padding: 8px 12px;
    min-height: 90px;
}

.method-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.btp-case-pill {
    background: rgb(99, 16, 88);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.method-metric {
    color: #777;
    font-size: 0.82rem;
}

.method-kpi {
    display: flex;
    gap: 20px;
    margin-bottom: 4px;
}

.method-kpi span {
    font-size: 0.85rem;
    color: #555;
}

.method-kpi strong {
    color: rgb(99, 16, 88);
    font-size: 1.05rem;
}

.iso-table {
    width: 100%;
    font-size: 0.82rem;
    border-collapse: collapse;
}

.iso-table td {
    padding: 0px 6px;
}

.prop-name {
    font-weight: 600;
    width: 130px;
}

.prop-status {
    width: 24px;
    text-align: center;
}

.prop-note {
    color: #555;
}

.status-msg {
    font-size: 0.82rem;
    padding: 4px 0;
    color: #444;
}

.spinner-inline {
    display: inline-block;
    width: 10px; height: 10px;
    border: 2px solid #d1d5db;
    border-top-color: #631058;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-msg.hidden {
    display: none;
}

/* ── Step 3: 3-column layout ────────────────────────────────────────── */
.verify-row1 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    min-height: 0;
}


/* Gallery */
.face-gallery {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    max-height: 280px;
}

.gallery-item {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    max-height: 58px;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
    display: block;
}

.gallery-item:hover {
    border-color: rgba(99, 16, 88, 0.4);
}

.gallery-item.selected {
    border-color: #631058;
    box-shadow: 0 0 0 3px rgba(99,16,88,0.35);
    transform: scale(1.12);
    z-index: 2;
}

.gallery-item.disabled {
    opacity: 0.4;
    cursor: default;
    filter: grayscale(80%);
}

/* Controls / KPI */
.kpi-panel {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.kpi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: rgb(99, 16, 88);
}

.kpi-note {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 4px;
}

.kpi-note--taxonomy {
    font-size: 0.62rem;
    color: #bbb;
    margin-top: 6px;
    border-top: 1px solid #eee;
    padding-top: 6px;
    line-height: 1.5;
}

.taxonomy-link {
    color: #631058;
    text-decoration: underline dotted;
}

.taxonomy-link:hover {
    color: #4c0a44;
    text-decoration: underline;
}

.form-group--sm label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.divider-sm {
    margin: 6px 0;
    border-color: #eee;
}

/* ── Pipeline schema ────────────────────────────────────────────────── */
.pipeline-container {
    overflow-x: auto;
    padding: 3px 0;
    min-height: 64px;
}

.pipeline-flow {
    display: flex;
    align-items: flex-start;
    gap: 0;
    flex-wrap: nowrap;
    justify-content: center;
}

.pipeline-arrow {
    display: flex;
    align-items: center;
    padding: 0 4px;
    font-size: 0.95rem;
    color: rgb(99, 16, 88);
    align-self: center;
    flex-shrink: 0;
}

.pipeline-box {
    min-width: 112px;
    max-width: 160px;
    flex-shrink: 0;
    border: 1px solid rgb(99, 16, 88);
    border-radius: 3px;
    padding: 4px 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(99, 16, 88, 0.07);
    font-size: 0.63rem;
}

.pipeline-box--model {
    background: rgb(99, 16, 88);
    color: white;
    border-color: rgb(76, 10, 68);
}

.pipeline-box--model .pipeline-box__size,
.pipeline-box--model .pipeline-box__info {
    color: rgba(255, 255, 255, 0.78);
}

.pipeline-box__label {
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
}

.pipeline-box__size {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: #888;
}

.pipeline-box--model .pipeline-box__size {
    color: rgba(255, 255, 255, 0.6);
}

.pipeline-box__info {
    font-size: 0.58rem;
    color: #bbb;
    line-height: 1.3;
}

.pipeline-box__preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: rgb(99, 16, 88);
    word-break: break-all;
    margin-top: 2px;
    line-height: 1.3;
}

.pipeline-empty {
    color: #aaa;
    font-size: 0.66rem;
}

/* ── Row main résultats: Template (2fr) · Score (1fr) ──────────────── */
.verify-row-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

/* ── Details toggle button row ──────────────────────────────────────── */
.details-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Row details: ligne 1 ROC+Dist (1fr 1fr), ligne 2 Pipeline (full) ── */
.verify-row-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
}

.verify-row-pipeline-desc {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

.verify-col--pipeline {
    overflow-x: auto;
}

.verify-col--pipeline .pipeline-container {
    overflow-x: auto;
}

.verify-col--method-desc {
    display: flex;
    flex-direction: column;
}

#method-description {
    font-size: 0.82rem;
    line-height: 1.6;
    color: #374151;
    flex: 1;
}

#method-description .method-bibref {
    margin-top: 12px;
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
}

/* ── Propriétés toutes méthodes ─────────────────────────────────────── */
.props-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}
.props-table th {
    background: #f5f0f5;
    color: #631058;
    font-weight: 700;
    padding: 4px 8px;
    border: 1px solid #e8e0e8;
    text-align: center;
    white-space: nowrap;
}
.props-table td {
    padding: 4px 8px;
    border: 1px solid #e8e0e8;
    text-align: center;
    font-size: 1rem;
    cursor: default;
}
.props-table td.prop-label {
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    color: #444;
    white-space: nowrap;
}

/* ── Method info (?) ────────────────────────────────────────────────── */
.btn-method-info {
    background: none;
    border: 1px solid #631058;
    border-radius: 4px;
    color: #631058;
    font-size: 0.68rem;
    padding: 2px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}
.btn-method-info:hover { background: #faf0f8; }

#method-properties {
    background: #faf0f8;
    border: 1px solid #e8d0e4;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 6px;
}
.prop-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
    font-size: 0.67rem;
}
.prop-row:last-child { margin-bottom: 0; }
.prop-name { font-weight: 600; color: #333; }
.prop-note { color: #666; line-height: 1.3; margin-top: 1px; }

/* ── Gallery enroll highlight ───────────────────────────────────────── */
.gallery-item.enroll-selected {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5,150,105,0.4) !important;
    transform: scale(1.12);
    z-index: 2;
}

/* ── Gallery item 21 (webcam probe) ────────────────────────────────── */
#gallery-item-21 {
    border: 2px dashed #631058 !important;
    overflow: visible; /* allow × button to stick out */
    position: relative;
    /* inherits aspect-ratio:1 and max-height:58px from .gallery-item */
}
#gallery-item-21 img {
    /* inherits .gallery-item img rules — identical to other photos */
}
#gallery-item-21 .gallery-probe-label {
    position: absolute;
    bottom: -16px;
    left: 0; right: 0;
    font-size: 0.5rem;
    font-weight: 600;
    color: #631058;
    text-align: center;
    line-height: 1.4;
    pointer-events: none;
}
#gallery-item-21 .probe-remove-btn {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #631058;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 9px;
    line-height: 16px;
    text-align: center;
    padding: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}
#gallery-item-21 .probe-remove-btn:hover {
    background: #4a0c40;
}

/* ── Grisement recalcul ─────────────────────────────────────────────── */
#verify-result {
    min-height: 60px; /* ensures spinner is visible on first load */
}

.result-stale {
    opacity: 0.25;
    pointer-events: none;
    transition: opacity 0.15s ease;
    position: relative;
}

.result-stale::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.45);
    border-radius: 6px;
    z-index: 9;
}

.result-stale::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 4px solid rgba(99,16,88,0.15);
    border-top-color: #631058;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    pointer-events: none;
    z-index: 10;
}

/* ── Gallery legend ─────────────────────────────────────────────────── */
.gallery-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: 0.6rem;
    color: #888;
    font-style: italic;
}
.gallery-legend__swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px dashed #631058;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── Webcam probe (Step 3) ──────────────────────────────────────────── */
#webcam-probe-wrap {
    margin-top: 4px;
}
#probe-video {
    width: 100%;
    border-radius: 4px;
    display: block;
}

.score-flex-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* Lock/score */
#lock-container {
    text-align: center;
}

#lock-icon svg {
    margin: 4px auto;
}

#lock-icon rect,
#lock-icon path {
    stroke: #ccc;
}

#lock-icon circle {
    fill: #ccc;
}

#lock-icon.locked rect,
#lock-icon.locked path {
    stroke: #dc2626;
    fill: none;
}

#lock-icon.locked rect {
    fill: #dc2626;
}

#lock-icon.locked circle {
    fill: white;
}

#lock-icon.unlocked rect,
#lock-icon.unlocked path {
    stroke: #059669;
    fill: none;
}

#lock-icon.unlocked rect {
    fill: #059669;
}

#lock-icon.unlocked circle {
    fill: white;
}

.score-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    justify-content: center;
    margin: 4px 0;
}

.score-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.score-metric {
    font-size: 0.78rem;
    color: #777;
}

.score-threshold {
    font-size: 0.78rem;
    color: #777;
    display: block;
    text-align: center;
}

/* Face compare */
.face-compare {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-top: 6px;
}

.face-compare__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.face-canvas-sm {
    border: 1px solid #ddd;
    border-radius: 3px;
}

.face-label {
    font-size: 0.72rem;
    color: #888;
}

.compare-arrow {
    color: rgb(99, 16, 88);
    font-size: 1.2rem;
}

/* Template preview */
#tpl-barcode-container {
    margin-top: 4px;
    overflow-x: auto;
}

#tpl-real-container {
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: rgb(99, 16, 88);
    word-break: break-all;
    line-height: 1.4;
}

/* ── Methods table ──────────────────────────────────────────────────── */
.methods-table th {
    background: rgba(99, 16, 88, 0.07);
}

.ref-list {
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer {
    background-color: rgb(208, 208, 208);
    border-top: 1px solid #bdc1c4;
    margin-top: 10px;
}

.footer-logo-main {
    width: 100px;
}

.footer-logos-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.imgfooter {
    height: 44px;
}

/* ── Separators ─────────────────────────────────────────────────────── */
.solid {
    border-color: rgb(99, 16, 88);
    margin-top: 16px;
}

/* ── ROC and Distribution charts: compact ────────────────────────────────── */
#roc-canvas,
#distribution-chart {
    width: 100%;
    max-height: 240px;
    aspect-ratio: 4 / 3;
    display: block;
}

/* ── Visual pipeline ────────────────────────────────────────────────── */
.pl-flow {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 4px 0 6px;
}

.pl-arrow {
    padding: 0 5px;
    font-size: 1.4rem;
    color: #631058;
    flex-shrink: 0;
    user-select: none;
    align-self: center;
}

.pl-node {
    flex-shrink: 0;
    border: 1.5px solid #631058;
    border-radius: 5px;
    padding: 6px 8px;
    background: white;
    text-align: center;
    font-size: 0.72rem;
}

.pl-node--face {
    min-width: 80px;
    text-align: center;
}

/* NN nodes (extractor + Key-MLP) */
.pl-node--nn {
    background: #631058;
    color: white;
    border-color: #4c0a44;
    min-width: 180px;
    text-align: left;
}

.pl-node--nn .pl-bits   { color: rgba(255,255,255,0.55); }
.pl-node--nn .pl-label  { color: white; }
.pl-node--nn .pl-sublabel { color: rgba(255,255,255,0.75); }
.pl-node--nn .pl-vectext  { color: rgba(255,255,255,0.8); max-width: 110px; }

/* Non-NN method node */
.pl-node--method {
    background: white;
    color: #631058;
    border-color: #631058;
    min-width: 150px;
    text-align: left;
}

/* Shared header layout for both NN and non-NN nodes */
.pl-nn-header, .pl-method-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.pl-nn-title-wrap {
    flex: 1;
    min-width: 0;
}

/* ⓘ info button */
.pl-info-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.5);
    color: rgba(255,255,255,0.85);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    line-height: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.pl-node--method .pl-info-btn {
    border-color: #631058;
    color: #631058;
}

.pl-info-btn:hover {
    background: rgba(255,255,255,0.2);
}

.pl-node--method .pl-info-btn:hover {
    background: rgba(99,16,88,0.1);
}

/* Tooltip popup */
.pl-tooltip {
    position: absolute;
    z-index: 9999;
    background: #2a002a;
    color: #f0e6f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    padding: 8px 10px;
    border-radius: 6px;
    max-width: 320px;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    pointer-events: none;
    white-space: pre-wrap;
}

.pl-node--data {
    min-width: 120px;
}

.pl-label {
    font-weight: 700;
    font-size: 0.74rem;
    margin: 2px 0;
}

.pl-sublabel {
    font-size: 0.62rem;
    opacity: 0.8;
}

.pl-bits {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: #888;
    margin-top: 1px;
}

/* (legacy overrides moved to .pl-node--nn and .pl-node--method rule blocks above) */

.pl-key-badge {
    display: inline-block;
    background: white;
    color: #631058;
    border-radius: 8px;
    padding: 1px 7px;
    font-size: 0.65rem;
    font-weight: 700;
    margin: 3px 0;
}

.pl-vectext {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    color: #631058;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    margin-top: 2px;
}


/* In / out size rows inside pipeline nodes */
.pl-io-sizes {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 5px 0 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding-top: 4px;
}

.pl-node--method .pl-io-sizes {
    border-top-color: rgba(99, 16, 88, 0.2);
}

.pl-io-sz {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
}

.pl-io-sz-lbl {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 700;
    min-width: 28px;
}

.pl-node--method .pl-io-sz-lbl {
    color: rgba(99, 16, 88, 0.55);
}

.pl-io-sz-val {
    color: rgba(255, 255, 255, 0.85);
}

.pl-node--method .pl-io-sz-val {
    color: #631058;
}

/* Size tag for data nodes */
.pl-sizetag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: #888;
    margin: 1px 0;
}


/* legacy io-row (kept for safety) */
.pl-io-row {
    display: flex;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 4px;
    margin-top: 3px;
}

.pl-empty {
    color: #bbb;
    font-size: 0.82rem;
    text-align: center;
    padding: 14px;
    margin: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
/* ── Template comparison ────────────────────────────────────────────────── */
/* ── Template comparison (new aligned layout) ── */
#tpl-comparison-wrap {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tpl-empty {
    color: #999;
    font-size: 0.8rem;
    margin: 0;
}

.tpl-cmp-row {
    align-items: center;
    gap: 8px;
}

.tpl-cmp-label {
    width: 72px;
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #631058;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tpl-cmp-row--diff .tpl-cmp-label {
    color: #555;
    font-weight: 400;
}

.tpl-cmp-canvas {
    flex: 1;
    display: block;
    border-radius: 3px;
    /* let canvas set its own height via height attribute */
    max-width: 100%;
}

.tpl-cmp-stats {
    display: flex;
    gap: 16px;
    padding: 4px 0 2px 80px;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
}

.tpl-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tpl-stat--match {
    color: #16a34a;
}

.tpl-stat--diff {
    color: #dc2626;
}

@media (max-width: 860px) {

    .verify-row1,
    .verify-row3 {
        grid-template-columns: 1fr;
    }

    .video-wrapper--small {
        width: 100%;
        height: 180px;
    }

    .face-gallery {
        grid-template-columns: repeat(7, 1fr);
        max-height: 120px;
    }

    .pipeline-flow {
        flex-wrap: wrap;
    }
}
/* ── Enrollment gallery (Step 1, under "Choose a face") ───────────────── */
#enroll-gallery-wrap {
    margin-top: 8px;
    border-top: 1px solid #eee;
    padding-top: 6px;
}
.enroll-gallery-prompt {
    font-size: 0.62rem;
    color: #e67e00;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
}
.enroll-gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    max-height: 220px;
    overflow-y: auto;
}
.enroll-gallery-grid .gallery-item {
    max-height: 52px;
}
#btn-enroll-from-gallery.active-pick {
    background-color: rgba(230, 126, 0, 0.1);
    border-color: #e67e00;
    color: #e67e00;
}
