/* ═══════════════════════════════════════════════════════════
   Neoantigen mRNA Vaccine Design Pipeline
   PRECISION LABORATORY INTERFACE — Premium Research UX
   Frosted Glass · Gradient Glow · Micro-Interaction Design
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --bg-void: #050505;
    --bg-primary: #0a0a0a;
    --bg-secondary: #0f1012;
    --bg-surface: #121316;
    --bg-elevated: #1a1b1e;
    --bg-card: rgba(18, 19, 22, 0.65);
    --bg-glass: rgba(25, 26, 30, 0.45);
    --bg-glass-hover: rgba(35, 36, 40, 0.55);

    --border-dim: rgba(255, 255, 255, 0.05);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-active: rgba(14, 165, 233, 0.4);
    --border-glow: rgba(14, 165, 233, 0.25);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-label: #a1a1aa;
    --text-dim: #52525b;

    /* Hexart Gradient Palette */
    --accent-primary: #0ea5e9;
    --accent-secondary: #6366f1;
    --accent-teal: #14b8a6;
    --accent-emerald: #10b981;
    --accent-indigo: #6366f1;
    --accent-violet: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;

    --strong-binder: #10b981;
    --weak-binder: #f59e0b;
    --non-binder: #52525b;
    --dna-a: #10b981;
    --dna-t: #f43f5e;
    --dna-g: #0ea5e9;
    --dna-c: #f59e0b;

    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --radius-pill: 9999px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    --shadow-lg: 0 16px 64px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
    --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.15);

    --glass-blur: blur(28px);
    --glass-blur-heavy: blur(48px);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 0.3s;
    --duration-slow: 0.5s;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}


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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--bg-void);
    color: var(--text-primary);
    font-size: 13.5px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, .logo-text, .step-label {
    font-family: var(--font-heading);
}

/* Ambient background light hexart style */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle 800px at 20% 0%, rgba(14, 165, 233, 0.1) 0%, transparent 60%),
        radial-gradient(circle 1000px at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        radial-gradient(circle 600px at 50% 50%, rgba(20, 184, 166, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}

/* Fine grid overlay — subtle dark aesthetic */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.8;
}

::selection {
    background: rgba(109,175,212,0.22);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(100,120,150,0.18);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(100,120,150,0.32); }

/* ─── Layout ─────────────────────────────────────────────── */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    max-width: 100vw;
}

/* ─── Sidebar — Frosted Glass Panel ──────────────────────── */
.sidebar {
    width: 260px;
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: var(--glass-blur-heavy);
    -webkit-backdrop-filter: var(--glass-blur-heavy);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 20px 22px;
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: 16px;
}

.logo-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 6px rgba(109,175,212,0.15));
}

.logo-text {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    letter-spacing: 0.01em;
}
.logo-text span {
    color: var(--accent-primary);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.stepper { padding: 6px 0; }

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border-left: 2px solid transparent;
    font-size: 0.74rem;
    position: relative;
    margin: 1px 0;
}

.step-item:hover {
    background: rgba(109,175,212,0.04);
}

.step-item.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.08) 0%, transparent 100%);
    border-left-color: var(--accent-primary);
}

.step-item.completed .step-number {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.step-number {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.70rem;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all var(--duration) var(--ease);
}

.step-item.active .step-number {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.step-label {
    color: var(--text-muted);
    transition: color var(--duration) var(--ease);
    font-weight: 400;
}
.step-item:hover .step-label { color: var(--text-secondary); }
.step-item.active .step-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 50px 48px;
    max-width: calc(100vw - 260px);
    overflow-x: hidden;
    box-sizing: border-box;
}

.step-panel { display: none; }
.step-panel.active {
    display: block;
    animation: panelReveal 0.45s var(--ease-out) both;
}

@keyframes panelReveal {
    from {
        opacity: 0;
        transform: translateY(16px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ─── Panel Header ───────────────────────────────────────── */
.panel-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-dim);
    position: relative;
}
.panel-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.panel-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 680px;
    line-height: 1.7;
    font-weight: 300;
}

/* ─── Cards — Premium Frosted Glass ──────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 18px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-sm);
    transition:
        box-shadow var(--duration-slow) var(--ease),
        border-color var(--duration-slow) var(--ease),
        transform var(--duration) var(--ease),
        background var(--duration-slow) var(--ease);
    position: relative;
    overflow: hidden;
}

/* Top glossy edge */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.05) 20%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0.05) 80%,
        transparent 100%
    );
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
}

.card-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.card-title .icon {
    font-size: 1rem;
    filter: saturate(0.5) brightness(0.9);
}

/* ─── Info Boxes ─────────────────────────────────────────── */
.info-box {
    margin-bottom: 18px;
    padding: 16px 18px;
    background: rgba(109,175,212,0.025);
    border-radius: var(--radius);
    border-left: 2px solid rgba(109,175,212,0.25);
    transition: all var(--duration) var(--ease);
}
.info-box:hover {
    background: rgba(109,175,212,0.04);
    border-left-color: rgba(109,175,212,0.4);
}

.info-box.info-teal { border-left-color: rgba(90,184,168,0.3); background: rgba(90,184,168,0.025); }
.info-box.info-amber { border-left-color: rgba(200,160,80,0.3); background: rgba(200,160,80,0.025); }
.info-box.info-emerald { border-left-color: rgba(77,184,144,0.3); background: rgba(77,184,144,0.025); }

.info-box-title {
    font-weight: 600;
    font-size: 0.76rem;
    color: var(--accent-primary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.68rem;
}
.info-box.info-teal .info-box-title { color: var(--accent-teal); }
.info-box.info-amber .info-box-title { color: var(--accent-amber); }
.info-box.info-emerald .info-box-title { color: var(--accent-emerald); }

.info-box p, .info-box ul {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.info-box ul { padding-left: 18px; }
.info-box ul li { margin-bottom: 3px; }

/* ─── Procedure Cards (Step 0) ───────────────────────────── */
.procedure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.procedure-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

.procedure-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(109,175,212,0.08), transparent);
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}

.procedure-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}
.procedure-card:hover::before { opacity: 1; }

.procedure-card h4 {
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.procedure-card p, .procedure-card ul {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-weight: 300;
}
.procedure-card ul { padding-left: 16px; }
.procedure-card li { margin-bottom: 4px; }

.lab-list { list-style: none; padding: 0; }
.lab-list li {
    padding: 8px 14px;
    background: rgba(18,22,31,0.6);
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    font-size: 0.74rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.2s var(--ease);
}
.lab-list li:hover {
    border-color: var(--border-dim);
    background: rgba(18,22,31,0.8);
}
.lab-list .lab-region {
    font-size: 0.66rem;
    color: var(--text-dim);
    padding: 2px 8px;
    background: var(--bg-void);
    border-radius: var(--radius-pill);
    letter-spacing: 0.02em;
}

/* ─── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-label);
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

input[type="number"],
input[type="text"],
input[type="password"],
select {
    width: 100%;
    background: rgba(18, 22, 31, 0.7);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    transition: all var(--duration) var(--ease);
}

input:focus, select:focus {
    border-color: rgba(109,175,212,0.35);
    box-shadow: 0 0 0 3px rgba(109,175,212,0.06), 0 0 16px rgba(109,175,212,0.04);
    background: rgba(18, 22, 31, 0.9);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23586070'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
}

.checkbox-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.74rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease);
    border: 1px solid transparent;
}
.checkbox-label:hover {
    background: rgba(109,175,212,0.04);
    border-color: var(--border-dim);
}
.checkbox-label input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--accent-primary);
}

.hla-group-label {
    width: 100%;
    font-weight: 600;
    margin-top: 10px;
    color: var(--text-dim);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-subtle);
}

.form-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.5;
    font-weight: 300;
}

/* ─── Upload Zone ────────────────────────────────────────── */
.upload-zone {
    border: 1.5px dashed rgba(109,175,212,0.2);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    background: rgba(109,175,212,0.01);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(109,175,212,0.04) 0%, transparent 65%);
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease);
}

.upload-zone:hover {
    border-color: rgba(109,175,212,0.35);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.upload-zone:hover::before { opacity: 1; }

.upload-zone.dragover {
    background: rgba(109,175,212,0.05);
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(109,175,212,0.08);
    transform: translateY(-3px);
}

.upload-zone .icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 10px;
    filter: saturate(0.4) brightness(0.8);
    transition: transform var(--duration) var(--ease);
}
.upload-zone:hover .icon { transform: scale(1.08); }

.upload-zone .label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}
.upload-zone .hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 300;
}

input[type="file"] { display: none; }

/* ─── Buttons — Premium Glass ────────────────────────────── */
.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.btn {
    padding: 9px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border-dim);
    background: rgba(24, 29, 40, 0.7);
    backdrop-filter: blur(8px);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

/* Glossy sweep animation */
.btn::after {
    content: '';
    position: absolute;
    top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    transform: skewX(-15deg);
    transition: left 0.6s var(--ease);
    pointer-events: none;
}
.btn:hover::after { left: 130%; }

.btn:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    background: rgba(28, 34, 48, 0.8);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
    transition-duration: 0.08s;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.btn:disabled::after { display: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.6), 0 0 0 1px rgba(255,255,255,0.1) inset;
    color: #fff;
}

.btn-secondary { color: var(--text-muted); }
.btn-secondary:hover { color: var(--text-secondary); }

.btn-demo {
    background: rgba(90,184,168,0.06);
    border-color: rgba(90,184,168,0.18);
    color: var(--accent-teal);
}
.btn-demo:hover {
    background: rgba(90,184,168,0.1);
    border-color: rgba(90,184,168,0.3);
    box-shadow: 0 4px 16px rgba(90,184,168,0.06);
}

.btn-export {
    background: rgba(124,132,190,0.06);
    border-color: rgba(124,132,190,0.18);
    color: var(--accent-indigo);
}
.btn-export:hover {
    background: rgba(124,132,190,0.1);
    border-color: rgba(124,132,190,0.3);
    box-shadow: 0 4px 16px rgba(124,132,190,0.06);
}

/* ─── Stats Row ──────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(180deg, rgba(20,20,24,0.6) 0%, rgba(10,10,12,0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 18px 14px;
    text-align: center;
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Subtle top accent line */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 25%; right: 25%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(109,175,212,0.12), transparent);
    transition: opacity var(--duration) var(--ease);
}

.stat-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ─── Tables — Clinical Data Grid ────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) inset;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
}

thead {
    background: rgba(15, 15, 18, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1;
}

th {
    padding: 14px 18px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}

td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary);
    transition: all 0.15s var(--ease);
}

tr { transition: background 0.15s var(--ease); }
tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-strong { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); box-shadow: 0 0 10px rgba(16,185,129,0.1); }
.badge-weak { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-non { background: rgba(113, 113, 122, 0.15); color: #a1a1aa; border: 1px solid rgba(113, 113, 122, 0.2); }
.badge-method { background: rgba(14, 165, 233, 0.15); color: #38bdf8; font-size: 0.60rem; border: 1px solid rgba(14, 165, 233, 0.3); }

/* ─── Sequence Display ───────────────────────────────────── */
.sequence-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.9;
    padding: 18px 20px;
    background: rgba(6, 8, 16, 0.6);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    overflow-x: auto;
    word-break: break-all;
    color: var(--text-secondary);
}

.label-tag {
    display: inline-block;
    background: rgba(24, 29, 40, 0.8);
    color: var(--text-label);
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    margin-right: 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--border-dim);
}

/* ─── Construct Diagram ──────────────────────────────────── */
.construct-diagram {
    display: flex;
    gap: 3px;
    padding: 16px;
    background: rgba(6, 8, 16, 0.5);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 16px;
}

.construct-block {
    flex: 1;
    padding: 12px 10px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    min-width: 80px;
    transition: all 0.2s var(--ease);
}
.construct-block:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}
.construct-block small {
    display: block;
    font-weight: 400;
    font-size: 0.62rem;
    opacity: 0.55;
    margin-top: 3px;
}

.block-cap   { background: rgba(200,160,80,0.08); color: var(--accent-amber); border: 1px solid rgba(200,160,80,0.15); }
.block-utr   { background: rgba(109,154,200,0.06); color: var(--accent-blue); border: 1px solid rgba(109,154,200,0.15); }
.block-cds   { background: rgba(77,184,144,0.06); color: var(--accent-emerald); border: 1px solid rgba(77,184,144,0.15); flex: 3; }
.block-polya { background: rgba(142,128,184,0.06); color: var(--accent-violet); border: 1px solid rgba(142,128,184,0.15); }

/* ─── Charts ─────────────────────────────────────────────── */
.chart-container {
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    background: rgba(6, 8, 16, 0.4);
    margin-bottom: 16px;
    overflow: hidden;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ─── Spinner ────────────────────────────────────────────── */
.spinner {
    display: none;
    width: 14px; height: 14px;
    border: 2px solid rgba(109,175,212,0.12);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
.spinner.active { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast — Glass ──────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px; left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(24, 29, 40, 0.85);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 0.76rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: toastSlide 0.4s var(--ease-out);
    max-width: 400px;
}
.toast-success { border-left: 3px solid var(--accent-emerald); }
.toast-error { border-left: 3px solid var(--accent-rose); }
.toast-warning { border-left: 3px solid var(--accent-amber); }

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

/* ─── Details / Summary ──────────────────────────────────── */
details {
    transition: all var(--duration) var(--ease);
}
details summary {
    transition: color 0.2s var(--ease);
    list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s var(--ease);
    font-size: 0.7em;
    color: var(--text-dim);
}
details[open] summary::before { transform: rotate(90deg); }
details summary:hover { color: var(--text-primary); }
details[open] summary {
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: 0;
}

/* ─── NGL Viewer ─────────────────────────────────────────── */
#dock-ngl-viewport {
    border-radius: 0 0 var(--radius) var(--radius);
}
#dock-ngl-viewport canvas { border-radius: 0; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        width: 54px;
        padding: 12px 0;
    }
    .sidebar .logo-text, .sidebar .step-label { display: none; }
    .main-content {
        margin-left: 54px;
        padding: 20px 16px;
        max-width: calc(100vw - 54px);
    }
    .procedure-grid { grid-template-columns: 1fr; }
    .chart-row { grid-template-columns: 1fr; }
    .logo { padding: 8px 14px 16px; justify-content: center; }
}

/* ─── Utility Animations ─────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ─── Global Next Step Bar ───────────────────────────────── */
.next-step-bar {
    margin-top: 50px;
    padding: 24px 32px;
    background: rgba(20, 20, 24, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(14, 165, 233, 0.1) inset;
    flex-wrap: wrap;
    gap: 20px;
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.next-step-bar::before {
    content: '';
    position: absolute;
    top: 0; left: -100px;
    width: 200px; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.1), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s var(--ease);
}
.next-step-bar:hover::before { left: 120%; }

.next-step-title {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    color: #ffffff;
    font-weight: 700;
}

.next-step-desc {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.btn-next-step {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    transition: all var(--duration) var(--ease);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-next-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.6);
    filter: brightness(1.1);
}

.btn-next-step--locked,
.btn-next-step:disabled {
    background: rgba(30, 30, 35, 0.6) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    border: 1px dashed rgba(255, 255, 255, 0.12) !important;
    font-size: 0.82rem;
    text-transform: none;
    letter-spacing: 0;
    transform: none !important;
    filter: none !important;
    padding: 12px 20px;
}

/* ═══════════════════════════════════════════════════════════
   CHAT ASSISTANT WIDGET
   ═══════════════════════════════════════════════════════════ */

/* Floating button */
#chat-fab {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    width: 58px; height: 58px; border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1, #0ea5e9);
    background-size: 200% 200%;
    animation: chatFabPulse 3s ease infinite;
    border: none; cursor: pointer; color: #fff; font-size: 1.6rem;
    box-shadow: 0 6px 25px rgba(14, 165, 233, 0.4), 0 0 60px rgba(99, 102, 241, 0.15);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
#chat-fab:hover { transform: scale(1.1); box-shadow: 0 8px 35px rgba(14, 165, 233, 0.6); }
@keyframes chatFabPulse {
    0%,100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Chat panel */
#chat-panel {
    position: fixed; bottom: 92px; right: 24px; z-index: 9998;
    width: 400px; max-height: 560px;
    background: rgba(12, 12, 16, 0.92);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    display: none; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(14,165,233,0.08);
    overflow: hidden;
    animation: chatSlideUp 0.3s ease;
}
#chat-panel.open { display: flex; }
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chat header */
.chat-header {
    padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(14,165,233,0.04);
}
.chat-header-title { display: flex; align-items: center; gap: 10px; }
.chat-header-title .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }
.chat-header-title span { font-weight: 700; font-size: 0.88rem; color: #fff; }
.chat-header-actions { display: flex; gap: 6px; }
.chat-header-actions button {
    background: rgba(255,255,255,0.06); border: none; color: var(--text-muted); cursor: pointer;
    width: 30px; height: 30px; border-radius: 8px; font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
}
.chat-header-actions button:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Messages area */
.chat-messages {
    flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
    min-height: 280px; max-height: 360px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* Message bubbles */
.chat-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 0.82rem; line-height: 1.55; word-break: break-word; }
.chat-msg.user {
    align-self: flex-end; background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff; border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
    align-self: flex-start; background: rgba(255,255,255,0.06);
    color: var(--text-secondary); border-bottom-left-radius: 4px; border: 1px solid rgba(255,255,255,0.05);
}
.chat-msg.assistant strong { color: #fff; }
.chat-msg.assistant code { background: rgba(14,165,233,0.1); color: #38bdf8; padding: 1px 5px; border-radius: 4px; font-size: 0.78rem; }
.chat-msg img { max-width: 100%; border-radius: 10px; margin-top: 8px; }

/* Typing indicator */
.chat-typing { display: flex; gap: 5px; padding: 10px 14px; align-self: flex-start; }
.chat-typing span {
    width: 7px; height: 7px; background: var(--text-muted); border-radius: 50%;
    animation: chatBounce 1.4s infinite ease-in-out both;
}
.chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.chat-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes chatBounce { 0%,80%,100% { transform: scale(0.6); } 40% { transform: scale(1); } }

/* Chat input */
.chat-input-row {
    padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,0.2);
}
.chat-input-row input {
    flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 10px 14px; color: #fff; font-size: 0.82rem;
    outline: none; transition: border-color 0.2s;
}
.chat-input-row input:focus { border-color: rgba(14,165,233,0.4); }
.chat-input-row input::placeholder { color: var(--text-dim); }
.chat-input-row button {
    width: 38px; height: 38px; border-radius: 10px; border: none; cursor: pointer;
    background: linear-gradient(135deg, #0ea5e9, #6366f1); color: #fff; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: transform 0.15s;
}
.chat-input-row button:hover { transform: scale(1.08); }



/* Mobile responsive */
@media (max-width: 500px) {
    #chat-panel { width: calc(100vw - 20px); right: 10px; bottom: 82px; max-height: calc(100vh - 120px); }
    #chat-fab { bottom: 16px; right: 16px; width: 52px; height: 52px; }
}

/* ═══════════════════════════════════════════════════════════
   INLINE SVG ICONS (.ico)
   ═══════════════════════════════════════════════════════════ */
svg.ico {
    display: inline-block;
    width: 1em; height: 1em;
    vertical-align: -0.125em;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    opacity: 0.7;
}
h1 svg.ico, h2 svg.ico, h3 svg.ico { width: 1.1em; height: 1.1em; opacity: 0.85; }
.step-badge svg.ico, .feature-card svg.ico { width: 1.3em; height: 1.3em; opacity: 0.9; }

/* ═══════════════════════════════════════════════════════════
   CHAT IMAGE MODAL (fullscreen preview with AI disclaimer)
   ═══════════════════════════════════════════════════════════ */
#img-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 100000;
    background: rgba(0,0,0,.88); backdrop-filter: blur(12px);
    align-items: center; justify-content: center; flex-direction: column;
    cursor: zoom-out; animation: fadeIn .2s ease;
}
#img-modal-overlay.active { display: flex; }
#img-modal-overlay img {
    max-width: 92vw; max-height: 78vh; border-radius: 8px;
    box-shadow: 0 0 60px rgba(100,140,255,.15); object-fit: contain;
}
#img-modal-close {
    position: absolute; top: 16px; right: 20px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
    color: #fff; font-size: 1.4rem; width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
#img-modal-close:hover { background: rgba(255,255,255,.2); }
#img-modal-disclaimer {
    margin-top: 12px; padding: 10px 22px; border-radius: 8px;
    background: rgba(255,200,60,.08); border: 1px solid rgba(255,200,60,.2);
    color: rgba(255,255,255,.65); font-size: .75rem; max-width: 600px; text-align: center;
    line-height: 1.4;
}
#img-modal-disclaimer svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; opacity: .7; }

/* ═══════════════════════════════════════════════════════════
   CHAT NAV METALINKS
   ═══════════════════════════════════════════════════════════ */
.chat-nav-links { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chat-nav-link {
    display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .72rem;
    background: rgba(100,140,255,.1); border: 1px solid rgba(100,140,255,.2);
    color: rgba(180,200,255,.9); text-decoration: none; transition: all .2s;
    cursor: pointer; white-space: nowrap;
}
.chat-nav-link:hover { background: rgba(100,140,255,.25); color: #fff; }

/* Chat images */
.chat-msg img { max-width: 100%; border-radius: 6px; cursor: zoom-in; margin: 4px 0; }

/* ═══════════════════════════════════════════════════════════
   ENHANCED RESPONSIVENESS
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .pipeline-nav { flex-wrap: wrap; gap: 4px; }
    .pipeline-nav button { font-size: .65rem; padding: 5px 8px; }
    .step-header h2 { font-size: 1.1rem; }
    #chat-panel .chat-msg { font-size: .82rem; padding: 8px 10px; max-width: 92%; }
    #img-modal-overlay img { max-width: 98vw; max-height: 70vh; }
    #img-modal-disclaimer { font-size: .65rem; padding: 8px 14px; max-width: 95vw; }
}

/* ═══════════════════════════════════════════════════════════
   LEGAL FOOTER
   ═══════════════════════════════════════════════════════════ */
#legal-footer {
    position: fixed; bottom: 8px; left: 12px; z-index: 999;
    display: flex; align-items: center; gap: 8px;
    font-size: .65rem; color: rgba(255,255,255,.35);
}
#legal-footer a {
    color: rgba(255,255,255,.45); text-decoration: none; transition: color .2s;
}
#legal-footer a:hover { color: rgba(255,255,255,.75); }
#legal-footer span { color: rgba(255,255,255,.2); }

/* ═══════════════════════════════════════════════════════════
   TERMS / PRIVACY MODAL
   ═══════════════════════════════════════════════════════════ */
.legal-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,.82); backdrop-filter: blur(10px);
    align-items: center; justify-content: center;
    animation: fadeIn .2s ease;
}
.legal-modal-overlay.active { display: flex; }
.legal-modal {
    background: rgba(18,20,28,.95); border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px; padding: 28px 32px; max-width: 700px; width: 92vw;
    max-height: 80vh; overflow-y: auto; position: relative;
    box-shadow: 0 0 60px rgba(0,0,0,.5);
}
.legal-modal-close {
    position: absolute; top: 12px; right: 16px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
    color: #fff; font-size: 1.3rem; width: 36px; height: 36px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.legal-modal-close:hover { background: rgba(255,255,255,.15); }
.terms-tab {
    padding: 6px 14px; border-radius: 8px; font-size: .72rem;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.5); cursor: pointer; transition: all .2s;
}
.terms-tab.active {
    background: rgba(100,140,255,.15); border-color: rgba(100,140,255,.3);
    color: rgba(180,200,255,.9);
}
.terms-tab:hover { background: rgba(255,255,255,.1); }
.legal-content { color: rgba(255,255,255,.7); font-size: .8rem; line-height: 1.7; }
.legal-content h3 { color: #fff; font-size: 1rem; margin: 0 0 8px; }
.legal-content h4 { color: rgba(255,255,255,.85); font-size: .85rem; margin: 16px 0 6px; }
.legal-content ol, .legal-content ul { padding-left: 20px; }
.legal-content li { margin-bottom: 4px; }
.legal-content p { margin: 6px 0; }

/* ═══════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER
   ═══════════════════════════════════════════════════════════ */
#cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99998;
    background: rgba(12,14,20,.95); backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 14px 24px; display: flex; align-items: center;
    justify-content: space-between; gap: 16px;
    animation: toastSlide .4s ease;
}
.cookie-text {
    color: rgba(255,255,255,.6); font-size: .75rem; line-height: 1.5; flex: 1;
}
.cookie-text a { text-decoration: underline; }
.cookie-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-btn {
    padding: 7px 16px; border-radius: 8px; font-size: .72rem;
    cursor: pointer; transition: all .2s; border: 1px solid;
}
.cookie-accept {
    background: rgba(52,211,153,.15); border-color: rgba(52,211,153,.3);
    color: rgba(52,211,153,.9);
}
.cookie-accept:hover { background: rgba(52,211,153,.25); }
.cookie-reject {
    background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.5);
}
.cookie-reject:hover { background: rgba(255,255,255,.1); }

@media (max-width: 600px) {
    #legal-footer { font-size: .55rem; gap: 4px; bottom: 4px; left: 8px; }
    #cookie-banner { flex-direction: column; text-align: center; padding: 12px 16px; }
    .legal-modal { padding: 20px 18px; max-height: 85vh; }
}
