/* ── Lab-specific styles (extends src/style.css) ──────── */

/* ── Lab header ─────────────────────────────────────────── */
.lab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 16px;
}

.lab-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.lab-logo {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text);
    text-decoration: none;
}
.lab-logo:hover { opacity: 0.7; }

.lab-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

.lab-sep {
    color: var(--border);
    font-size: 14px;
}

.lab-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.lab-nav::-webkit-scrollbar { display: none; }

.lab-nav a {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.lab-nav a:hover  { color: var(--text); background: rgba(255,255,255,0.04); }
.lab-nav a.active { color: var(--text); background: rgba(255,255,255,0.06); }
.lab-nav a.cta    { color: var(--accent); font-weight: 600; }
.lab-nav a.cta:hover { background: rgba(59,130,246,0.1); }

/* ── Control bar ─────────────────────────────────────────── */
.lab-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    height: 44px;
    background: #0c0c0c;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.lab-controls::-webkit-scrollbar { display: none; }

.ctrl-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ctrl-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.ctrl-pills {
    display: flex;
    gap: 2px;
}

.ctrl-pill {
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
}
.ctrl-pill:hover  { border-color: rgba(255,255,255,0.15); color: var(--text); }
.ctrl-pill.active { border-color: var(--accent); background: rgba(59,130,246,0.12); color: var(--accent); }

.ctrl-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

.ctrl-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.lab-btn {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-family: inherit;
    padding: 5px 14px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
}
.lab-btn:hover    { border-color: rgba(255,255,255,0.2); color: var(--text); }
.lab-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.lab-btn.primary  {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.lab-btn.primary:hover    { opacity: 0.85; }
.lab-btn.primary:disabled { opacity: 0.4; }

.ctrl-status {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Progress bar ────────────────────────────────────────── */
.lab-progress-track {
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}
.lab-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.15s linear;
}

/* ── Results modal ───────────────────────────────────────── */
#lab-results-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.res-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.res-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.res-modal-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.res-modal-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.res-close-btn {
    font-size: 20px;
    line-height: 1;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}
.res-close-btn:hover { color: var(--text); }

.res-modal-body {
    padding: 20px 24px 24px;
}

.res-section-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
    margin-top: 20px;
}
.res-section-label:first-child { margin-top: 0; }

.res-podium {
    display: flex;
    gap: 10px;
}
@media (max-width: 540px) {
    .res-podium { flex-direction: column; }
}

.res-agent {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.res-rank {
    font-size: 18px;
    line-height: 1;
    margin-bottom: 4px;
}

.res-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.res-arch {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.res-roi {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 4px 0;
}

.res-stats {
    font-size: 11px;
    color: var(--muted);
}

.res-dna {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.res-dna span {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: ui-monospace, monospace;
}

.res-hof-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
@media (max-width: 480px) {
    .res-hof-grid { grid-template-columns: repeat(2, 1fr); }
}

.res-hof-cell {
    background: var(--bg);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.res-hof-val {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.res-hof-lbl {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.res-hof-bot {
    font-size: 10px;
    color: var(--muted);
    font-family: ui-monospace, monospace;
}

.res-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    justify-content: flex-end;
}

.res-btn {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-family: inherit;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s;
}
.res-btn.primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
}
.res-btn.primary:hover { opacity: 0.85; }
.res-btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}
.res-btn.secondary:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }
