/* ==========================================================================
   PROTEUS-AI v7.8 — Ultra-High-End Cyberpunk Genomics Studio Design System
   Obsidian Glassmorphism 2.0, BioBank Modal & High-Performance WebGL
   Lead Architect & UI Engineer: Abolfazl Saadat (ابوالفضل سعادت)
   ========================================================================== */

:root {
    --bg-obsidian: #020612;
    --bg-surface: rgba(6, 12, 24, 0.78);
    --bg-panel: rgba(8, 16, 32, 0.88);
    --bg-card: rgba(14, 25, 48, 0.65);
    --bg-card-hover: rgba(20, 36, 68, 0.85);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(255, 255, 255, 0.16);
    --border-glow-emerald: rgba(0, 255, 136, 0.35);
    --border-glow-cyan: rgba(0, 229, 255, 0.35);

    --bio-emerald: #00ff88;
    --bio-cyan: #00e5ff;
    --bio-violet: #a855f7;
    --bio-gold: #ffd700;
    --bio-pink: #ff00ea;
    --bio-red: #ff4466;

    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --text-muted: #64748b;

    --font-fa: 'Vazirmatn', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    --font-tech: 'Rajdhani', sans-serif;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-obsidian);
    color: var(--text-main);
    font-family: var(--font-fa);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Bioluminescent Mesh Glows */
.ambient-mesh-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.28;
    animation: ambientFloat 14s infinite alternate ease-in-out;
}

.glow-top-left {
    width: 550px;
    height: 550px;
    top: -150px;
    left: -100px;
    background: radial-gradient(circle, var(--bio-emerald) 0%, transparent 70%);
}

.glow-bottom-right {
    width: 650px;
    height: 650px;
    bottom: -200px;
    right: -150px;
    background: radial-gradient(circle, var(--bio-violet) 0%, transparent 70%);
    animation-delay: -5s;
}

.glow-center-cyan {
    width: 450px;
    height: 450px;
    top: 35%;
    left: 40%;
    background: radial-gradient(circle, var(--bio-cyan) 0%, transparent 75%);
    animation-delay: -9s;
}

@keyframes ambientFloat {
    0% { transform: scale(1.0) translate(0, 0); }
    100% { transform: scale(1.15) translate(30px, -25px); }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: rgba(2, 6, 18, 0.8);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.25);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--bio-emerald);
}

/* App Shell */
.app-shell {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

/* 1. TOP HEADER HUD */
.top-hud-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 18px;
    background: rgba(4, 9, 20, 0.92);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
    gap: 14px;
}

.brand-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-main-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-orb {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 229, 255, 0.2));
    border: 1px solid var(--bio-emerald);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.logo-dna-icon {
    color: var(--bio-emerald);
    font-size: 1.05rem;
}

.brand-title {
    font-family: var(--font-tech);
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 14px var(--bio-emerald);
}

.brand-ai {
    color: var(--bio-cyan);
}

.version-tag {
    font-family: var(--font-code);
    font-size: 0.62rem;
    color: #000;
    background: var(--bio-emerald);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}

.brand-subtitle {
    font-size: 0.68rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-subtitle strong {
    color: var(--bio-cyan);
}

.status-live-pulse {
    font-family: var(--font-code);
    font-size: 0.60rem;
    color: var(--bio-emerald);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--bio-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--bio-emerald);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Presets Dock & Search */
.presets-dock {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    max-width: 55%;
}

.dock-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.btn-open-biobank-modal {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25), rgba(0, 229, 255, 0.25));
    border: 1px solid var(--bio-emerald);
    color: #fff;
    font-family: var(--font-fa);
    font-size: 0.70rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-open-biobank-modal:hover {
    background: var(--bio-emerald);
    color: #000;
    box-shadow: 0 0 14px rgba(0, 255, 136, 0.4);
}

.dock-tabs {
    display: flex;
    gap: 4px;
}

.dock-filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-fa);
    font-size: 0.66rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dock-filter-btn:hover, .dock-filter-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.presets-btn-group {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    font-family: var(--font-fa);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.preset-btn:hover, .preset-btn.active {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--bio-emerald);
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.25);
}

.top-actions {
    display: flex;
    gap: 6px;
}

.btn-top {
    font-family: var(--font-fa);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.terminal-toggle-btn {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid var(--bio-cyan);
    color: #fff;
}

.terminal-toggle-btn:hover, .terminal-toggle-btn.active {
    background: var(--bio-cyan);
    color: #000;
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}

.btn-top.primary {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25), rgba(0, 229, 255, 0.25));
    border: 1px solid var(--bio-emerald);
    color: #fff;
}

.btn-top.primary:hover {
    background: var(--bio-emerald);
    color: #000;
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.4);
}

.btn-top.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-top.secondary:hover {
    border-color: var(--bio-cyan);
    color: #fff;
}

/* 2. MAIN 3-COLUMN STUDIO */
.main-studio {
    display: grid;
    grid-template-columns: 330px 1fr 350px;
    gap: 10px;
    padding: 10px;
    flex: 1;
    overflow: hidden;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}

.panel-card {
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 6px;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.card-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-subtitle-code {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.icon-card {
    color: var(--bio-emerald);
}

.badge-tag {
    font-family: var(--font-code);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-sub);
}

.badge-tag.cyan { color: var(--bio-cyan); background: rgba(0, 229, 255, 0.12); border: 1px solid var(--bio-cyan); }
.badge-tag.green { color: var(--bio-emerald); background: rgba(0, 255, 136, 0.12); border: 1px solid var(--bio-emerald); }
.badge-tag.gold { color: var(--bio-gold); background: rgba(255, 215, 0, 0.12); border: 1px solid var(--bio-gold); }
.badge-tag.purple { color: var(--bio-violet); background: rgba(168, 85, 247, 0.12); border: 1px solid var(--bio-violet); }
.badge-tag.red { color: var(--bio-red); background: rgba(255, 68, 102, 0.12); border: 1px solid var(--bio-red); }

.target-chip-row {
    display: flex;
    gap: 6px;
}

.t-chip {
    font-size: 0.70rem;
    color: var(--text-sub);
    background: rgba(0, 0, 0, 0.35);
    padding: 4px 8px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.protein-mechanism-text {
    font-size: 0.72rem;
    color: var(--text-sub);
    line-height: 1.7;
}

.metric-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.metric-glass-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.m-lbl { font-size: 0.64rem; color: var(--text-muted); }
.m-val { font-family: var(--font-code); font-size: 0.84rem; font-weight: 800; color: #fff; }
.m-val.green { color: var(--bio-emerald); }
.m-val.cyan { color: var(--bio-cyan); }
.m-val.gold { color: var(--bio-gold); }
.m-val.purple { color: var(--bio-violet); }
.m-val.highlight { color: #fff; text-shadow: 0 0 8px var(--bio-emerald); }

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    padding: 3px 0;
}

.m-label { color: var(--text-sub); }
.eng-sub { font-family: var(--font-code); font-size: 0.64rem; direction: ltr; display: inline-block; color: var(--text-muted); }

.cdr-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cdr-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cdr-hdr {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
}

.cdr-pos { font-family: var(--font-code); font-size: 0.64rem; color: var(--text-muted); }
.cdr-seq { font-family: var(--font-code); font-size: 0.70rem; color: var(--text-main); letter-spacing: 0.05em; word-break: break-all; }

/* 3. CENTER STAGE (3D WEBGL) */
.center-stage {
    position: relative;
    background: #020612;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.canvas-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

#proteus-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.viewport-stats-hud {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.vstat-item {
    font-family: var(--font-code);
    font-size: 0.64rem;
    color: var(--text-sub);
    background: rgba(10, 20, 36, 0.85);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    padding: 3px 8px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vstat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.vstat-dot.green { background: var(--bio-emerald); box-shadow: 0 0 6px var(--bio-emerald); }

.viewport-controls-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.btn-vp {
    background: rgba(10, 20, 36, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-fa);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-vp:hover, .btn-vp.active {
    border-color: var(--bio-emerald);
    color: #fff;
    background: rgba(0, 255, 136, 0.15);
}

/* Floating 3D Residue Quick-Mutation Popover Widget */
.residue-3d-popover {
    position: absolute;
    top: 48px;
    left: 10px;
    width: 250px;
    background: rgba(6, 12, 24, 0.94);
    backdrop-filter: blur(20px);
    border: 1px solid var(--bio-emerald);
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 25;
    animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.residue-3d-popover.active {
    display: flex;
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.92) translateY(-6px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.r3d-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 5px;
}

.r3d-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #fff;
}

.r3d-dot {
    width: 7px;
    height: 7px;
    background: var(--bio-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--bio-emerald);
}

.btn-close-r3d {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.70rem;
    cursor: pointer;
}
.btn-close-r3d:hover { color: #ff4466; }

.r3d-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-sub);
}

.r3d-quick-mut-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.r3d-lbl {
    font-size: 0.64rem;
    color: var(--text-muted);
}

.r3d-chips-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.r3d-chip {
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #fff;
    font-family: var(--font-code);
    font-size: 0.64rem;
    padding: 3px 2px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.r3d-chip:hover {
    background: var(--bio-emerald);
    border-color: var(--bio-emerald);
    color: #000;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.btn-open-full-mod {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    font-family: var(--font-fa);
    font-size: 0.66rem;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.btn-open-full-mod:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--bio-cyan);
    color: #fff;
}

.colormode-selector-bar {
    position: absolute;
    top: 45px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(10, 20, 36, 0.85);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.cm-label { font-size: 0.66rem; color: var(--text-muted); margin-left: 4px; }

.btn-colormode {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-sub);
    font-family: var(--font-fa);
    font-size: 0.66rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-colormode:hover, .btn-colormode.active {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--bio-cyan);
    color: #fff;
}

.plddt-legend-bar-viewport {
    position: absolute;
    bottom: 85px;
    right: 10px;
    background: rgba(8, 16, 32, 0.90);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.plddt-leg-title { font-family: var(--font-code); font-size: 0.60rem; color: var(--text-muted); }
.plddt-spectrum-track { display: flex; gap: 4px; }

.p-band {
    font-family: var(--font-code);
    font-size: 0.58rem;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 700;
}

.b-vhigh { background: rgba(0, 255, 136, 0.2); color: #00ff88; border: 1px solid #00ff88; }
.b-conf { background: rgba(0, 229, 255, 0.2); color: #00e5ff; border: 1px solid #00e5ff; }
.b-low { background: rgba(255, 215, 0, 0.2); color: #ffd700; border: 1px solid #ffd700; }
.b-vlow { background: rgba(255, 68, 102, 0.2); color: #ff4466; border: 1px solid #ff4466; }

.fasta-folding-dock {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(8, 16, 30, 0.94);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.fasta-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.70rem;
    color: var(--text-sub);
}

.fasta-badge { font-family: var(--font-code); font-size: 0.60rem; color: var(--bio-emerald); }
.fasta-input-row { display: flex; gap: 8px; }

.fasta-input-field {
    flex: 1;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    color: #fff;
    font-family: var(--font-code);
    font-size: 0.72rem;
    padding: 6px 10px;
    border-radius: 6px;
    outline: none;
    direction: ltr;
}

.fasta-input-field:focus {
    border-color: var(--bio-emerald);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.25);
}

.btn-fold-action {
    background: linear-gradient(135deg, var(--bio-emerald), var(--bio-cyan));
    border: none;
    color: #000;
    font-family: var(--font-fa);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* 4. RIGHT PANEL: 6 GENOMICS TOOL TABS */
.tool-tabs-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    background: rgba(4, 9, 20, 0.95);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tool-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-sub);
    font-family: var(--font-fa);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 5px 2px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.tool-tab-btn i { font-size: 0.75rem; }

.tool-tab-btn:hover, .tool-tab-btn.active {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--bio-emerald);
    color: #fff;
}

.tool-tab-panel { display: none; flex-direction: column; gap: 10px; }
.tool-tab-panel.active { display: flex; }
.tool-desc { font-size: 0.70rem; color: var(--text-sub); line-height: 1.6; }

/* Modifier Sequence Ribbon */
.modifier-seq-wrapper {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 6px 4px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.seq-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    min-width: 28px;
    transition: all 0.15s ease;
}

.seq-node:hover {
    border-color: var(--bio-cyan);
    background: rgba(0, 229, 255, 0.1);
}

.seq-node.selected {
    border-color: var(--bio-emerald);
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.35);
}

.node-idx { font-family: var(--font-code); font-size: 0.55rem; color: var(--text-muted); }
.node-aa { font-family: var(--font-code); font-size: 0.78rem; color: #fff; }

.aa-selector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    max-height: 110px;
    overflow-y: auto;
    padding: 2px;
}

.btn-aa-choice {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    font-family: var(--font-code);
    font-size: 0.60rem;
    padding: 4px 2px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.btn-aa-choice:hover, .btn-aa-choice.active {
    border-color: var(--bio-cyan);
    color: #fff;
    background: rgba(0, 212, 255, 0.18);
}

.mutation-preview-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mp-row { display: flex; justify-content: space-between; font-size: 0.70rem; }
.mp-impact { font-size: 0.65rem; color: var(--bio-emerald); }

.btn-apply-mutation-action {
    background: linear-gradient(135deg, var(--bio-emerald), var(--bio-cyan));
    border: none;
    color: #000;
    font-family: var(--font-fa);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 7px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tag-insert-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
    padding-top: 6px;
}

.tag-sec-lbl { font-size: 0.66rem; color: var(--text-muted); }
.tag-btn-group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }

.btn-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    font-family: var(--font-code);
    font-size: 0.62rem;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-tag:hover {
    border-color: var(--bio-gold);
    color: var(--bio-gold);
    background: rgba(255, 215, 0, 0.1);
}

.mut-history-box { display: flex; flex-direction: column; gap: 3px; max-height: 80px; overflow-y: auto; }
.hist-lbl { font-size: 0.64rem; color: var(--text-muted); }
.hist-empty { font-size: 0.64rem; color: var(--text-muted); text-align: center; }

.hist-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.64rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 6px;
    border-radius: 3px;
}

.hist-tag { font-family: var(--font-code); color: var(--bio-gold); font-weight: 700; }
.hist-time { color: var(--text-muted); }

/* 5. BIOBANK FULL MODAL */
.biobank-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 18, 0.85);
    backdrop-filter: blur(20px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.biobank-modal-backdrop.active {
    display: flex;
}

.biobank-modal-window {
    width: 100%;
    max-width: 1100px;
    height: 85vh;
    background: rgba(8, 16, 32, 0.96);
    border: 1px solid var(--bio-emerald);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.25);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.biobank-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(4, 9, 20, 0.95);
    border-bottom: 1px solid var(--border-color);
}

.bm-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bm-dna-icon {
    font-size: 1.8rem;
    color: var(--bio-emerald);
}

.bm-title-group h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}

.bm-title-group p {
    font-size: 0.72rem;
    color: var(--text-sub);
}

.bm-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bm-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
}

#bm-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-fa);
    font-size: 0.75rem;
    width: 220px;
}

.btn-close-biobank {
    background: rgba(255, 68, 102, 0.2);
    border: 1px solid #ff4466;
    color: #fff;
    font-family: var(--font-fa);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.biobank-cards-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.biobank-card {
    background: rgba(14, 25, 48, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.biobank-card:hover {
    border-color: var(--bio-emerald);
    background: rgba(20, 38, 70, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 255, 136, 0.2);
}

.biobank-card.active {
    border-color: var(--bio-cyan);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
}

.bc-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bc-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
}

.bc-sub {
    font-size: 0.68rem;
    color: var(--bio-cyan);
}

.bc-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.66rem;
    color: var(--text-muted);
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    padding-top: 4px;
}

.bc-meta strong { color: #fff; }
.bc-desc { font-size: 0.68rem; color: var(--text-sub); line-height: 1.5; flex: 1; }

.btn-load-target {
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid var(--bio-emerald);
    color: #fff;
    font-family: var(--font-fa);
    font-size: 0.70rem;
    font-weight: 700;
    padding: 6px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.biobank-card:hover .btn-load-target {
    background: var(--bio-emerald);
    color: #000;
}

/* 6. CYBERPUNK CODING TERMINAL DRAWER */
.terminal-drawer {
    position: fixed;
    bottom: -360px;
    left: 12px;
    right: 12px;
    height: 330px;
    background: rgba(4, 9, 20, 0.98);
    backdrop-filter: blur(28px);
    border: 1px solid var(--bio-cyan);
    box-shadow: 0 -8px 35px rgba(0, 229, 255, 0.25);
    border-radius: 10px 10px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    direction: ltr;
}

.terminal-drawer.active { bottom: 30px; }

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 14px;
    background: rgba(8, 16, 32, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.term-title-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: #fff;
}

.term-dot { width: 9px; height: 9px; border-radius: 50%; }
.term-dot.green { background: #00ff88; }
.term-dot.yellow { background: #ffd700; }
.term-dot.red { background: #ff4466; }

.term-ctrls { display: flex; align-items: center; gap: 8px; }
.term-hint { font-family: var(--font-fa); font-size: 0.65rem; color: var(--text-muted); direction: rtl; }

.btn-close-term {
    background: rgba(255, 68, 102, 0.15);
    border: 1px solid #ff4466;
    color: #fff;
    font-family: var(--font-fa);
    font-size: 0.66rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.terminal-output {
    flex: 1;
    padding: 10px 14px;
    overflow-y: auto;
    font-family: var(--font-code);
    font-size: 0.74rem;
    line-height: 1.5;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #020612;
}

.term-line.term-echo { color: #94a3b8; }
.term-line.term-success { color: #00ff88; }
.term-line.term-error { color: #ff4466; font-weight: 700; }
.term-line.term-info { color: #38bdf8; }

.term-prompt { color: #00ff88; font-weight: 700; margin-right: 6px; }
.term-cmd { color: #fff; font-weight: 700; }
.term-cyan { color: #00e5ff; }
.term-gold { color: #ffd700; }
.term-green { color: #00ff88; }

.term-quick-chips {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    background: rgba(6, 12, 24, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
}

.chip-label {
    font-family: var(--font-fa);
    font-size: 0.62rem;
    color: var(--text-muted);
    white-space: nowrap;
    direction: rtl;
}

.t-chip-btn {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--bio-cyan);
    font-family: var(--font-code);
    font-size: 0.60rem;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.t-chip-btn:hover { background: var(--bio-cyan); color: #000; }

.terminal-input-bar {
    display: flex;
    align-items: center;
    padding: 7px 14px;
    background: rgba(8, 16, 32, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-cli-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-code);
    font-size: 0.78rem;
}

/* 7. BOTTOM SYSTEM RIBBON */
.bottom-ribbon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 18px;
    background: rgba(4, 9, 20, 0.98);
    border-top: 1px solid var(--border-color);
    font-size: 0.70rem;
    color: var(--text-muted);
    z-index: 50;
}

.ribbon-left strong { color: var(--bio-emerald); }
.sep { margin: 0 6px; color: rgba(255, 255, 255, 0.2); }

/* Responsive Rules */
@media (max-width: 1200px) {
    .main-studio { grid-template-columns: 290px 1fr 310px; }
}

@media (max-width: 992px) {
    .app-shell { height: auto; min-height: 100vh; overflow-y: auto; }
    .top-hud-bar { flex-direction: column; align-items: stretch; gap: 8px; }
    .presets-dock { max-width: 100%; overflow-x: auto; }
    .main-studio { display: flex; flex-direction: column; overflow: visible; }
    .center-stage { height: 420px; min-height: 420px; }
    .side-panel { max-height: none; }
    .bottom-ribbon { flex-direction: column; gap: 4px; text-align: center; }
}

/* Mobile laboratory layout */
@media(max-width:760px){html,body{overflow-y:auto!important;overflow-x:hidden}.app-shell{height:auto!important;min-height:100dvh}.top-hud-bar{padding:14px!important;gap:14px!important}.brand-title,.brand-main-row{font-size:19px!important;flex-wrap:wrap}.brand-subtitle{font-size:10px!important;line-height:1.8}.main-studio,.main-stage{display:flex!important;flex-direction:column!important;overflow:visible!important}.side-panel{width:100%!important;max-height:none!important;overflow:visible!important}.center-stage{width:100%!important;min-width:0!important;min-height:320px!important;height:380px!important}.cortex-3d-wrapper{min-height:320px!important}.case-btn-group,.target-nav-group,.case-selector-dock{flex-wrap:wrap!important;max-width:100%}.ct-slicer-grid,.control-grid{grid-template-columns:minmax(0,1fr)!important}.bottom-ribbon{position:static!important;flex-wrap:wrap;line-height:1.9}.data-table-wrapper{overflow:auto}.panel-card{min-width:0}.presets-dock{max-width:100%;overflow:auto}.modal-content{width:calc(100% - 24px)!important;max-height:90dvh;overflow:auto}button{min-height:42px}}
