/* ==========================================================================
   Prompt Propagation Firewall (PPF) - Cyber Defense & Interactive Lab Styles
   Designed for Enterprise AI Security Research by Sapan Patel
   ========================================================================== */

:root {
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.35);
    --accent: #ec4899;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.35);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.35);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.35);
    
    --bg-dark: #0b0f19;
    --bg-darker: #05070d;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(31, 41, 55, 0.95);
    --bg-glass: rgba(15, 23, 42, 0.75);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(139, 92, 246, 0.3);
    --border-danger: rgba(239, 68, 68, 0.4);
    --border-success: rgba(16, 185, 129, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-heading: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

pre, code, kbd, samp {
    font-family: var(--font-mono);
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 85% 60%, rgba(6, 182, 212, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(239, 68, 68, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Background Cyber Grid */
#cyber-grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.75rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, #a78bfa 0%, #38bdf8 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.danger-gradient-text {
    background: linear-gradient(135deg, #f87171 0%, #fb923c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shield-gradient-text {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Top Sticky Header */
/* Top Sticky Header */
.lab-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 68px;
    z-index: 1000;
    background: rgba(7, 10, 19, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.lab-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1.5rem;
}

.lab-brand-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.back-portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--secondary);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    white-space: nowrap;
    transition: var(--transition);
}

.back-portfolio-link:hover {
    background: rgba(6, 182, 212, 0.18);
    border-color: var(--secondary);
    transform: translateX(-2px);
}

.brand-sep {
    color: rgba(255, 255, 255, 0.2);
    font-weight: 300;
    font-size: 0.9rem;
}

.lab-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.lab-brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.lab-brand-name {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.lab-brand-name .accent-text {
    color: #38bdf8;
    font-weight: 600;
}

.lab-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.lab-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
    padding: 0.35rem 0.1rem;
    position: relative;
}

.lab-nav a:hover, .lab-nav a.active {
    color: #fff;
}

.lab-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: var(--transition);
}

.lab-nav a:hover::after, .lab-nav a.active::after {
    width: 100%;
}

.lab-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%);
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(6, 182, 212, 0.2);
    transition: var(--transition);
}

.header-action-btn:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px var(--primary-glow);
}

.pulse-indicator {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    animation: threat-pulse 1.8s infinite;
}

.lab-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.lab-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-highlight);
}

/* Mobile Drawer */
.lab-mobile-drawer {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    width: 100%;
    background: rgba(7, 10, 19, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 1.75rem;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 999;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.lab-mobile-drawer.open {
    display: flex;
}

.mobile-drawer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}

.mobile-drawer-link:hover {
    color: #38bdf8;
}

.mobile-drawer-link.highlight {
    font-weight: 700;
    color: #a78bfa;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 4px 18px var(--danger-glow);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.5);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-highlight);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 1px solid rgba(6, 182, 212, 0.35);
}

.btn-outline:hover {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--secondary);
    transform: translateY(-2px);
}

/* Sections */
.lab-section {
    padding: 6.5rem 0;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.section-tagline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.2rem;
}

.tagline-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #f87171;
}

.tagline-shield {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.28);
    color: #c084fc;
}

.tagline-cyan {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.28);
    color: #38bdf8;
}

.section-head {
    margin-bottom: 3.5rem;
}

.section-head.text-center {
    text-align: center;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.sec-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.sec-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.lab-hero {
    padding-top: 9.5rem;
    padding-bottom: 6rem;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero-meta-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.pulse-threat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pulse-threat-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: threat-pulse 1.8s infinite;
}

@keyframes threat-pulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.author-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.author-chip strong {
    color: var(--text-primary);
}

.lab-hero-title {
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.6rem;
    letter-spacing: -0.03em;
}

.lab-hero-lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 980px;
    margin-bottom: 2.2rem;
}

.lab-hero-lead strong {
    color: #f1f5f9;
}

.hero-quote-box {
    background: rgba(15, 23, 42, 0.65);
    border-left: 4px solid var(--secondary);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.4rem 1.8rem;
    border-radius: 0 12px 12px 0;
    margin-bottom: 2.5rem;
    backdrop-filter: blur(8px);
}

.hero-quote-box p {
    font-size: 1.05rem;
    font-style: italic;
    color: #e2e8f0;
}

.hero-quote-box span {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-style: normal;
    color: var(--secondary);
    font-weight: 600;
}

.hero-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 3.5rem;
}

/* Hero Key Takeaway Grid */
.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.hero-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.4rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.hero-stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.hero-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.hero-stat-icon.red { color: #f87171; }
.hero-stat-icon.violet { color: #a78bfa; }
.hero-stat-icon.amber { color: #fbbf24; }
.hero-stat-icon.emerald { color: #34d399; }

.hero-stat-val {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.hero-stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   Section 1: AI Worm & Propagation Mechanics
   ========================================================================== */
.dual-col-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.threat-explanation-card,
.worm-loop-visual {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.threat-explanation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 2.2rem;
    backdrop-filter: blur(10px);
}

.threat-explanation-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}

.threat-bullets {
    list-style: none;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.threat-bullets li {
    display: flex;
    gap: 0.85rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.threat-bullets li i {
    color: var(--danger);
    font-size: 1.1rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.threat-bullets li strong {
    color: var(--text-primary);
}

/* Loop Diagram Card */
.worm-loop-visual {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-danger);
    border-radius: 14px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.worm-loop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.loop-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.propagation-chain {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chain-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: var(--transition);
}

.chain-step:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(239, 68, 68, 0.3);
    transform: translateX(4px);
}

.chain-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.chain-text {
    flex: 1;
}

.chain-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.chain-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chain-arrow {
    text-align: center;
    color: rgba(239, 68, 68, 0.5);
    font-size: 0.9rem;
    padding: 0.1rem 0;
}

/* ==========================================================================
   Interactive Simulation of Priya's Supplier Attack
   ========================================================================== */
.simulation-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.2rem;
    margin-top: 3.5rem;
}

.simulation-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sim-nav-pills {
    display: flex;
    gap: 0.5rem;
}

.sim-stage-btn {
    padding: 0.45rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sim-stage-btn.active, .sim-stage-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.sim-stage-content {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 2rem;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.sim-card {
    background: rgba(11, 15, 25, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.6rem;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
}

.sim-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sim-code-preview {
    background: #060912;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.55;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden;
}

.sim-code-preview .highlight-injection {
    background: rgba(239, 68, 68, 0.25);
    border: 1px dashed #ef4444;
    color: #fca5a5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    display: block;
    margin: 0.5rem 0;
}

.sim-visual-column {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.sim-verdict-box {
    padding: 1.25rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sim-verdict-box h4 {
    color: #fca5a5;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sim-verdict-box p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Section 2: Enterprise Attack Surface Grid (10 Surfaces)
   ========================================================================== */
.surface-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.surface-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.4rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.surface-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.surface-icon {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: var(--secondary);
}

.surface-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.surface-input, .surface-output {
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}

.surface-input strong {
    color: #fca5a5;
}

.surface-output strong {
    color: #38bdf8;
}

/* ==========================================================================
   Section 3: Plan Drift & MCP Risks
   ========================================================================== */
.plan-drift-comparison {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.plan-card {
    border-radius: 14px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
}

.plan-card.expected {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.plan-card.drifted {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.plan-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.plan-card.expected .plan-title { color: #34d399; }
.plan-card.drifted .plan-title { color: #f87171; }

.plan-sequence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.plan-node {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.plan-card.expected .plan-node {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.plan-card.drifted .plan-node {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid var(--border-color);
}

.plan-card.drifted .plan-node.hijacked {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid #ef4444;
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
}

.plan-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.plan-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ==========================================================================
   Section 4: Prompt Propagation Firewall (PPF) 7-Layer Architecture
   ========================================================================== */
.architecture-visual-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 3.5rem;
}

.control-plane-pipeline {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 900px;
    margin: 0 auto;
}

.pipeline-node {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.6rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.pipeline-node:hover, .pipeline-node.active-inspect {
    border-color: var(--secondary);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.2);
    transform: scale(1.01);
}

.node-layer-indicator {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c084fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1.4rem;
    flex-shrink: 0;
}

.pipeline-node.green .node-layer-indicator {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.pipeline-node.blue .node-layer-indicator {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.3);
    color: #38bdf8;
}

.pipeline-node.red .node-layer-indicator {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.node-meta {
    flex: 1;
}

.node-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.25rem;
}

.node-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.node-role-badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.node-question {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-style: italic;
}

.node-arrow {
    text-align: center;
    color: rgba(139, 92, 246, 0.4);
    font-size: 1.2rem;
    margin: -0.3rem 0;
}

/* Layer Details Modal / Inspector Card */
.layer-inspector-card {
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid var(--secondary);
    border-radius: 12px;
    padding: 1.6rem;
    margin-top: 1.8rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.layer-inspector-card.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Section 5: The 5-Tier Trust Model (T0 to T4)
   ========================================================================== */
.trust-table-wrapper {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
}

.trust-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.trust-table th {
    padding: 1rem 1.2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trust-table td {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.trust-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.trust-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
}

.t0-pill { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.t1-pill { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.t2-pill { background: rgba(139, 92, 246, 0.15); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }
.t3-pill { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.t4-pill { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* ==========================================================================
   Section 6: Interactive Replication Risk Score Calculator (R = S + I + P + W + X)
   ========================================================================== */
.calculator-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    gap: 2.5rem;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.calculator-container > div {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.calc-formula-display {
    background: rgba(11, 15, 25, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.4rem;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: #38bdf8;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calc-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.calc-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calc-row-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calc-row-label span.var-name {
    font-family: var(--font-mono);
    color: var(--secondary);
}

.calc-row-label span.var-val {
    font-family: var(--font-mono);
    color: #fff;
    font-weight: 700;
}

.calc-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: var(--transition);
}

.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--secondary-glow);
    transition: var(--transition);
}

.calc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Calculator Gauge & Result Display */
.calc-result-box {
    background: rgba(11, 15, 25, 0.95);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 2.2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.calc-result-box.state-block {
    border-color: #ef4444;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.25);
}

.calc-result-box.state-review {
    border-color: #f59e0b;
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.25);
}

.calc-result-box.state-sanitize {
    border-color: #06b6d4;
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.25);
}

.calc-result-box.state-allow {
    border-color: #10b981;
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.25);
}

.score-display-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    margin: 0 auto 1.4rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
}

.score-num {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
}

.score-max {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.verdict-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.verdict-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   Section 7: 8-Step Decision Engine Flow
   ========================================================================== */
.decision-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.decision-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: var(--transition);
}

.decision-step-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-3px);
}

.step-num-pill {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    background: rgba(6, 182, 212, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.step-icon {
    font-size: 1.4rem;
    color: #c084fc;
    margin-bottom: 0.8rem;
}

.step-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ==========================================================================
   Section 8: Red-Team Test Scenarios & Matrix
   ========================================================================== */
.redteam-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.scenario-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    width: 100%;
    max-width: 100%;
}

.scenario-tab-btn {
    padding: 0.5rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.scenario-tab-btn.active, .scenario-tab-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #fca5a5;
}

.scenario-panel {
    display: none;
    animation: fadeIn 0.3s ease;
    width: 100%;
    max-width: 100%;
}

.scenario-panel.active {
    display: block;
}

.scenario-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.scenario-block {
    background: rgba(11, 15, 25, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.6rem;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.scenario-block h4 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.scenario-block p {
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.scenario-block pre,
.scenario-block .sim-code-preview {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.scenario-block.payload h4 { color: #f87171; }
.scenario-block.defense h4 { color: #34d399; }

/* ==========================================================================
   Section 9: Live Interactive Security Demo Chatbot (The PPF Control Plane)
   ========================================================================== */
.chatbot-lab-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chat-interface-panel,
.telemetry-terminal-panel {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Chat Interface Side */
.chat-interface-panel {
    display: flex;
    flex-direction: column;
    height: 660px;
    min-width: 0;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    background: rgba(7, 10, 19, 0.9);
}

.chat-panel-header {
    padding: 1.25rem 1.6rem;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-agent-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.agent-avatar-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 0 15px var(--primary-glow);
}

.agent-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.agent-mode-tag {
    font-size: 0.72rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Mode Switcher Toggle */
.mode-toggle-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.25rem;
}

.mode-btn {
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--text-secondary);
}

.mode-btn.active.unprotected {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.mode-btn.active.protected {
    background: #10b981;
    color: #fff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Chat Messages Feed */
.chat-messages-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.chat-bubble {
    max-width: 88%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.55;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(99, 102, 241, 0.25));
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #f1f5f9;
    border-bottom-right-radius: 2px;
}

.chat-bubble.agent {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-color);
    color: #e2e8f0;
    border-bottom-left-radius: 2px;
}

.chat-bubble.blocked-banner {
    align-self: stretch;
    max-width: 100%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.88rem;
}

.bubble-sender {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    color: var(--secondary);
}

/* Quick Attack Presets */
.quick-attack-strip {
    padding: 0.75rem 1.25rem;
    background: rgba(11, 15, 25, 0.95);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
}

.quick-attack-chip {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.quick-attack-chip:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Chat Input Bar */
.chat-input-bar {
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.8rem;
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.chat-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
}

.chat-send-btn {
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

/* Telemetry & Inspection Terminal Side */
.telemetry-terminal-panel {
    background: #05070d;
    display: flex;
    flex-direction: column;
    height: 660px;
    min-width: 0;
    overflow: hidden;
}

.terminal-header {
    padding: 1rem 1.4rem;
    background: rgba(11, 15, 25, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-indicator {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.terminal-body {
    flex: 1;
    padding: 1.4rem;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.65;
    color: #94a3b8;
}

.log-line {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.6rem;
}

.log-timestamp {
    color: #64748b;
}

.log-badge {
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    font-size: 0.72rem;
}

.log-badge.info { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.log-badge.warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.log-badge.danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.log-badge.success { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.log-content {
    flex: 1;
    word-break: break-word;
}

.telemetry-summary-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.telemetry-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.telemetry-kv-item {
    color: var(--text-secondary);
}

.telemetry-kv-item strong {
    color: #fff;
}

/* ==========================================================================
   Section 10: Minimum Enterprise Control Set (11 Controls)
   ========================================================================== */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.control-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
}

.control-item-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-3px);
}

.control-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: #34d399;
    margin-bottom: 0.6rem;
}

.control-text {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Footer */
.lab-footer {
    padding: 4rem 0 3rem 0;
    background: rgba(5, 7, 13, 0.95);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-author-box {
    max-width: 680px;
    margin: 0 auto 2.5rem auto;
}

.footer-author-box h3 {
    font-size: 1.35rem;
    margin-bottom: 0.6rem;
}

.footer-author-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-copy {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
    .lab-nav {
        display: none !important;
    }
    .lab-menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    .hero-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dual-col-layout {
        grid-template-columns: 1fr;
    }
    .plan-drift-comparison {
        grid-template-columns: 1fr;
    }
    .calculator-container {
        grid-template-columns: 1fr;
    }
    .decision-pipeline-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chatbot-lab-container {
        grid-template-columns: 1fr;
    }
    .chat-interface-panel {
        height: 520px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .telemetry-terminal-panel {
        height: 420px;
    }
    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sim-stage-content {
        grid-template-columns: 1fr;
    }
    .scenario-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
    .lab-section {
        padding: 4rem 0;
    }
    .lab-hero {
        padding-top: 6.5rem;
        padding-bottom: 3.5rem;
        min-height: auto;
    }
    .lab-hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    .lab-hero-lead {
        font-size: 1.05rem;
        line-height: 1.6;
        margin-bottom: 1.75rem;
    }
    .sec-title {
        font-size: 1.85rem;
    }
    .sec-desc {
        font-size: 0.95rem;
    }
    .hero-quote-box {
        padding: 1.1rem 1.3rem;
        margin-bottom: 2rem;
    }
    .hero-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .controls-grid {
        grid-template-columns: 1fr;
    }
    .decision-pipeline-grid {
        grid-template-columns: 1fr;
    }
    .redteam-box {
        padding: 1.25rem;
    }
    .scenario-block {
        padding: 1.1rem;
    }
    .calculator-container {
        padding: 1.25rem;
        gap: 1.5rem;
    }
    .threat-explanation-card {
        padding: 1.25rem;
    }
    .worm-loop-visual {
        padding: 1.25rem;
    }
    .simulation-box {
        padding: 1.25rem;
        margin-top: 2rem;
    }
    .sim-card {
        padding: 1.25rem;
    }
    .plan-card {
        padding: 1.25rem;
    }
    .layer-inspector-card {
        padding: 1.25rem;
    }
    .control-item-card {
        padding: 1.2rem;
    }
    .trust-table-wrapper {
        padding: 0.75rem;
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
    }
    .trust-table {
        min-width: 560px;
    }
    .trust-table th, .trust-table td {
        padding: 0.75rem 0.85rem;
        font-size: 0.82rem;
    }
    .chat-interface-panel {
        height: 480px;
    }
    .telemetry-terminal-panel {
        height: 380px;
    }
}

@media (max-width: 640px) {
    .hero-cta-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 2.5rem;
    }
    .hero-cta-group .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .simulation-box-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }
    .sim-nav-pills {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        width: 100%;
    }
    .sim-stage-btn {
        padding: 0.5rem 0.4rem;
        font-size: 0.78rem;
        text-align: center;
        white-space: normal;
        line-height: 1.3;
    }
    .surface-matrix-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .surface-card {
        padding: 1.2rem;
    }
    .pipeline-node {
        padding: 1rem;
        gap: 0.75rem;
    }
    .node-layer-indicator {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-right: 0;
    }
    .node-title-row {
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .node-title {
        font-size: 0.95rem;
    }
    .node-question {
        font-size: 0.8rem;
    }
    .scenario-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.75rem;
        gap: 0.45rem;
        scrollbar-width: thin;
    }
    .scenario-tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 0.45rem 0.85rem;
    }
    .chat-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.9rem 1rem;
    }
    .mode-toggle-group {
        width: 100%;
        display: flex;
    }
    .mode-btn {
        flex: 1;
        text-align: center;
        padding: 0.4rem 0.5rem;
        font-size: 0.72rem;
    }
    .quick-attack-strip {
        padding: 0.6rem 0.85rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .quick-attack-chip {
        font-size: 0.74rem;
        padding: 0.3rem 0.65rem;
    }
    .footer-links-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .footer-links-row .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.85rem;
    }
    .lab-section {
        padding: 3rem 0;
    }
    .lab-hero-title {
        font-size: 1.85rem;
        line-height: 1.2;
    }
    .sec-title {
        font-size: 1.55rem;
    }
    .lab-header {
        height: 60px;
    }
    .lab-mobile-drawer {
        top: 60px;
        padding: 1.2rem 1rem;
    }
    .back-portfolio-link {
        font-size: 0.78rem;
        padding: 0.3rem 0.55rem;
    }
    .brand-sep, .lab-brand-badge {
        display: none;
    }
    .header-action-btn span {
        display: none;
    }
    .header-action-btn {
        padding: 0.45rem 0.7rem;
    }
    .sim-nav-pills {
        grid-template-columns: 1fr;
    }
    .plan-sequence {
        gap: 0.35rem;
    }
    .plan-node {
        padding: 0.3rem 0.55rem;
        font-size: 0.72rem;
    }
    .plan-arrow {
        font-size: 0.75rem;
    }
    .calc-formula-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        font-size: 0.92rem;
        padding: 0.75rem 0.9rem;
    }
    .score-display-ring {
        width: 100px;
        height: 100px;
        font-size: 1.5rem;
    }
    .verdict-title {
        font-size: 1.15rem;
    }
    .chat-input-bar {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .chat-input {
        padding: 0.65rem 0.85rem;
        font-size: 0.82rem;
    }
    .chat-send-btn {
        padding: 0.65rem 0.9rem;
        font-size: 0.82rem;
    }
    .chat-bubble {
        max-width: 95%;
        padding: 0.85rem 1rem;
        font-size: 0.86rem;
    }
    .terminal-body {
        padding: 1rem;
        font-size: 0.78rem;
    }
}

/* Mail Action Toast / Direct Fallback */
.mail-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--primary-glow);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    z-index: 99999;
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90vw;
    font-family: var(--font-body);
}

.mail-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mail-toast-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mail-toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.mail-toast-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.mail-toast-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.mail-toast-btn {
    padding: 0.45rem 0.95rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.mail-toast-btn-gmail {
    background: #ea4335;
    color: #fff !important;
}

.mail-toast-btn-gmail:hover {
    background: #d93025;
    transform: translateY(-1px);
}

.mail-toast-btn-copy {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.mail-toast-btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.mail-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition);
}

.mail-toast-close:hover {
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .mail-toast {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        bottom: 1rem;
        padding: 1.1rem;
    }
    .mail-toast-actions {
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

