/* Project Eden - Governance Wrapper Architecture Demo */
/* Complete Styling for D = G x S Visualization */

:root {
    /* Core colors */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #64748b;

    /* Status colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;

    /* Equation term colors */
    --decision-color: #3b82f6;
    --governance-color: #8b5cf6;
    --optimizer-color: #06b6d4;

    /* Background and surface */
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --surface-elevated: #475569;

    /* Text */
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Borders */
    --border: #334155;
    --border-light: #475569;

    /* Gate colors */
    --gate-auto: #06b6d4;
    --gate-human: #f59e0b;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon svg {
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.logo-text h1 {
    font-size: 1.5rem;
    color: var(--primary-light);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.equation-display {
    background: linear-gradient(135deg, var(--surface-light), var(--surface));
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--primary);
    box-shadow: var(--shadow-glow);
}

.equation-display .equation {
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 2px;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.75rem 1.25rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--surface-light);
    color: var(--text);
    border-color: var(--border-light);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

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

h2 {
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 600;
}

.section-intro {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 800px;
}

/* ============================================
   OVERVIEW VIEW
   ============================================ */

.overview-hero {
    background: linear-gradient(135deg, var(--surface), var(--surface-light));
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.hero-content h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-weight: 500;
}

.equation-large {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.equation-large .term {
    font-family: 'Georgia', serif;
    font-size: 4rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: 12px;
    min-width: 100px;
}

.equation-large .term.decision {
    color: var(--decision-color);
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid var(--decision-color);
}

.equation-large .term.governance {
    color: var(--governance-color);
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid var(--governance-color);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.equation-large .term.optimizer {
    color: var(--optimizer-color);
    background: rgba(6, 182, 212, 0.1);
    border: 2px solid var(--optimizer-color);
}

.equation-large .operator {
    font-size: 3rem;
    color: var(--text-muted);
    font-weight: 300;
}

.equation-legend {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.decision { background: var(--decision-color); }
.legend-color.governance { background: var(--governance-color); }
.legend-color.optimizer { background: var(--optimizer-color); }

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Extended G Equation in Overview */
.g-extended-equation {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem auto;
    max-width: 600px;
    text-align: center;
}

.g-ext-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.g-ext-formula {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.g-component {
    font-family: 'Georgia', serif;
    font-size: 1.5rem;
    color: var(--primary-light);
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.g-component.highlight {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--warning);
    color: var(--warning);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.g-mult {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.g-ext-desc {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.g-part {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.g-part strong {
    color: var(--primary-light);
}

/* Decomposition Section */
.decomposition-section {
    margin-bottom: 3rem;
}

.decomposition-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.decomposition-step {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.decomposition-step:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.step-title {
    font-weight: 600;
    color: var(--text);
}

.step-equation {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    color: var(--primary-light);
    background: var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.8;
}

.step-description {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Key Properties */
.key-properties {
    margin-bottom: 2rem;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.property-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
}

.property-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.property-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.property-card h4 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.property-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.property-card.highlight-card {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--surface), rgba(245, 158, 11, 0.1));
}

.property-card.highlight-card h4 {
    color: var(--warning);
}

/* ============================================
   ARCHITECTURE VIEW
   ============================================ */

.wrapper-diagram {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.diagram-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.input-section, .output-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-label, .output-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.input-arrow, .output-arrow {
    font-size: 2rem;
    color: var(--primary);
}

/* Eden Wrapper */
.eden-wrapper {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
    border: 3px solid var(--primary);
    border-radius: 20px;
    padding: 1.5rem;
    min-width: 600px;
    position: relative;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.2);
}

.wrapper-label {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.25rem 1.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Gate Sections */
.gate-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    margin: 0.5rem 0;
}

.gate-section.g-in {
    border: 2px solid var(--success);
}

.gate-section.g-out {
    border: 2px solid var(--warning);
}

.gate-label {
    font-family: 'Georgia', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    text-align: center;
}

.gate-components {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.gate-component {
    background: var(--surface-light);
    border-radius: 10px;
    padding: 1rem;
    min-width: 150px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.gate-component.auto {
    border-color: var(--gate-auto);
}

.gate-component.human {
    border-color: var(--gate-human);
}

.gate-component.pass {
    background: var(--success-light);
    border-color: var(--success);
}

.gate-component.fail {
    background: var(--danger-light);
    border-color: var(--danger);
}

.gate-component.active {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
}

.gate-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.gate-name {
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.gate-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.gate-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-muted);
}

/* Flow Arrows */
.flow-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    text-align: center;
    margin: 0.5rem 0;
}

.flow-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.iteration-loop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--warning-light);
    color: #92400e;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.iteration-loop.active {
    opacity: 1;
    animation: pulse 1s infinite;
}

.iteration-arrow {
    font-size: 1.2rem;
}

/* Optimizer Section */
.optimizer-section {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.optimizer-box {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05));
    border: 3px solid var(--optimizer-color);
    border-radius: 16px;
    padding: 1.5rem 2.5rem;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.2);
}

.optimizer-label {
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--optimizer-color);
    margin-bottom: 0.25rem;
}

.optimizer-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.optimizer-models {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.model-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    background: var(--surface-light);
    border-radius: 20px;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Architecture Equation Display */
.arch-equation-display {
    text-align: center;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
    border-radius: 12px;
    border: 2px solid var(--primary);
}

.arch-eq-main {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.arch-eq-expanded {
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* Governance Kernel Layer in Architecture */
.governance-kernel-layer {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kernel-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary-light);
    background: var(--surface);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.kernel-rights {
    display: flex;
    gap: 0.5rem;
}

.kernel-rights span {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: help;
    transition: all 0.2s;
}

.kernel-rights span:hover {
    background: var(--primary);
    transform: scale(1.2);
}

/* Safeguard Indicators */
.safeguard-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--success);
    margin-bottom: 0.75rem;
}

.safeguard-icon {
    font-size: 0.9rem;
}

.safeguard-indicator.runtime-safeguard {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    color: var(--warning);
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* Governance Pre-Check Indicator */
.flow-arrow-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.governance-check-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary-light);
}

.check-icon {
    color: var(--success);
    font-weight: bold;
}

/* Enhanced Optimizer Section with G_run */
.optimizer-section-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.grun-arch-monitor {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border: 2px solid var(--warning);
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
    max-width: 400px;
}

.grun-arch-label {
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    color: var(--warning);
    text-align: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.grun-arch-indicators {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.grun-ind {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--surface);
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.grun-ind-icon {
    font-size: 1rem;
}

/* Safeguards Summary in Architecture */
.safeguards-summary {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 2px solid var(--success);
}

.safeguards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.safeguard-card {
    padding: 1.25rem;
    background: var(--surface-light);
    border-radius: 10px;
    border-left: 4px solid var(--success);
}

.safeguard-stage {
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.safeguard-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* G_run row in table */
.gate-table tr.grun-row {
    background: rgba(245, 158, 11, 0.1);
}

.gate-table tr.grun-row td code {
    color: var(--warning);
}

/* Gate Details Table */
.gate-details {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.gate-table {
    width: 100%;
    border-collapse: collapse;
}

.gate-table th, .gate-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.gate-table th {
    background: var(--surface-light);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.gate-table td {
    color: var(--text);
}

.gate-table code {
    font-family: 'Georgia', serif;
    color: var(--primary-light);
    font-size: 1rem;
}

/* ============================================
   GOVERNANCE KERNEL VIEW
   ============================================ */

/* Certification Section */
.certification-section {
    margin-bottom: 3rem;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.certificate-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid var(--border);
    position: relative;
    transition: all 0.3s ease;
}

.certificate-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.certificate-card.ecc {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--surface), rgba(16, 185, 129, 0.1));
}

.certificate-card.egc {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--surface), rgba(139, 92, 246, 0.1));
}

.cert-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 2px;
}

.ecc .cert-badge {
    background: var(--success);
    color: white;
}

.egc .cert-badge {
    background: var(--primary);
    color: white;
}

.certificate-card h4 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.certificate-card > p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.cert-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--surface-light);
    border-radius: 8px;
}

.cert-icon {
    color: var(--success);
    font-weight: bold;
}

.cert-note {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--warning);
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Rights Section */
.rights-section {
    margin-bottom: 3rem;
}

.rights-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.right-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.right-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.right-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.right-content {
    flex: 1;
}

.right-content h4 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.right-premise {
    font-style: italic;
    color: var(--primary-light);
    padding: 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary);
}

.right-content > p {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.right-implementation {
    font-size: 0.85rem;
    padding: 0.75rem;
    background: var(--surface-light);
    border-radius: 8px;
    color: var(--text-muted);
}

.right-implementation strong {
    color: var(--text);
}

/* Runtime Section */
.runtime-section {
    margin-bottom: 3rem;
}

.runtime-diagram {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.runtime-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.runtime-stage {
    padding: 1rem 2rem;
    background: var(--surface-light);
    border-radius: 12px;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    color: var(--primary-light);
    border: 2px solid var(--primary);
}

.runtime-arrow {
    font-size: 2rem;
    color: var(--primary);
}

.optimizer-stage {
    padding: 0;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.optimizer-inner {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05));
    border: 3px solid var(--optimizer-color);
    border-radius: 12px;
    color: var(--optimizer-color);
    font-weight: 600;
}

.grun-wrapper {
    width: 100%;
}

.grun-monitor {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 2px solid var(--warning);
    border-radius: 12px;
    padding: 1rem;
}

.grun-label {
    font-family: 'Georgia', serif;
    font-size: 1rem;
    color: var(--warning);
    text-align: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.monitor-indicators {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--surface);
    border-radius: 6px;
    font-size: 0.75rem;
}

.ind-icon {
    font-size: 1rem;
}

.ind-name {
    flex: 1;
    color: var(--text-muted);
}

.ind-status {
    padding: 0.15rem 0.5rem;
    background: var(--success);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.65rem;
}

.ind-status.warning {
    background: var(--warning);
}

.ind-status.fail {
    background: var(--danger);
}

/* G_run Details Table */
.grun-details {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.grun-table {
    width: 100%;
    border-collapse: collapse;
}

.grun-table th,
.grun-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.grun-table th {
    background: var(--surface-light);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.grun-table td {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.grun-table td strong {
    color: var(--text);
}

/* G_run Equation Block */
.grun-equation {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--primary);
}

.equation-block {
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-light);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.eq-line {
    font-family: 'Georgia', serif;
    font-size: 1.5rem;
    color: var(--primary-light);
    margin: 0.5rem 0;
}

.eq-line.small {
    font-size: 1rem;
    color: var(--text-muted);
}

.eq-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Architecture Stack */
.stack-section {
    margin-bottom: 2rem;
}

.architecture-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.stack-layer {
    width: 100%;
    max-width: 600px;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.stack-layer.kernel {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    border: 3px solid var(--primary);
}

.stack-layer.collapse {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border: 3px solid var(--success);
}

.stack-layer.optimizer {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.1));
    border: 3px solid var(--optimizer-color);
}

.layer-label {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.kernel .layer-label { color: var(--primary-light); }
.collapse .layer-label { color: var(--success); }
.optimizer .layer-label { color: var(--optimizer-color); }

.layer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-rights,
.layer-gates,
.layer-models {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.layer-rights span,
.layer-gates span {
    padding: 0.25rem 0.75rem;
    background: var(--surface);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text);
}

.layer-gates span {
    font-family: 'Georgia', serif;
}

.layer-models {
    font-size: 0.9rem;
    color: var(--text);
}

.layer-question {
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stack-arrow {
    font-size: 1.5rem;
    color: var(--text-dim);
    margin: 0.25rem 0;
}

/* ============================================
   SIMULATOR VIEW
   ============================================ */

.simulator-container {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 1.5rem;
}

.simulator-controls {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.control-group {
    margin-bottom: 1.25rem;
}

.control-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.control-group select,
.control-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text);
    font-size: 0.9rem;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.primary {
    background: var(--primary);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.btn.secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: var(--surface-elevated);
    border-color: var(--border-light);
}

.btn.danger {
    background: var(--danger);
    color: white;
}

.btn.danger:hover {
    background: #dc2626;
}

.run-btn {
    width: 100%;
    margin-bottom: 0.75rem;
}

.btn-icon {
    font-size: 0.8rem;
}

/* Simulator Display */
.simulator-display {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

/* Governance Kernel Bar in Simulator */
.governance-kernel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    border: 2px solid var(--primary);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.kernel-bar-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary-light);
}

.kernel-bar-rights {
    display: flex;
    gap: 0.5rem;
}

.kernel-right {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: help;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.kernel-right:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.kernel-right.active {
    background: var(--success);
    border-color: var(--success);
    animation: kernelPulse 1s infinite;
}

@keyframes kernelPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

.kernel-bar-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-muted);
}

.kernel-bar-status.active {
    background: var(--success);
    color: white;
}

.kernel-bar-status.checking {
    background: var(--warning);
    color: white;
    animation: blink 0.5s infinite;
}

/* Stage Safeguard Indicators */
.stage-safeguard {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 0.6rem;
    opacity: 0.5;
    transition: all 0.3s;
}

.stage-safeguard.active-safeguard {
    opacity: 1;
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.stage-safeguard.checking-safeguard {
    opacity: 1;
    background: var(--warning);
    border-color: var(--warning);
    color: white;
    animation: blink 0.5s infinite;
}

.stage-safeguard.pass-safeguard {
    opacity: 1;
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.stage-safeguard.fail-safeguard {
    opacity: 1;
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.runtime-safeguard-sim {
    position: relative;
    top: auto;
    right: auto;
    margin-top: 0.5rem;
    width: auto;
    padding: 0 0.5rem;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--warning);
    color: var(--warning);
    opacity: 1;
}

/* Make sim-stage position relative for safeguard positioning */
.sim-stage {
    position: relative;
}

.sim-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Live Equation */
.live-equation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--surface-light);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.eq-term {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.eq-label {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-light);
}

.eq-value {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.25rem 1rem;
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-muted);
    min-width: 60px;
    text-align: center;
}

.eq-value.pass { background: var(--success-light); color: var(--success); }
.eq-value.fail { background: var(--danger-light); color: var(--danger); }
.eq-value.pending { background: var(--warning-light); color: var(--warning); }

.eq-operator {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* G Decomposition */
.g-decomposition {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    border: 1px solid var(--primary);
}

.g-term {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.g-label {
    font-family: 'Georgia', serif;
    font-size: 1rem;
    color: var(--primary-light);
}

.g-value {
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-muted);
}

.g-value.pass { background: var(--success-light); color: var(--success); }
.g-value.fail { background: var(--danger-light); color: var(--danger); }

.g-operator {
    color: var(--text-muted);
}

/* Simulation Flow */
.sim-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    overflow-x: auto;
}

.sim-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--surface-light);
    border-radius: 10px;
    min-width: 80px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.sim-stage.active {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    animation: pulse 1s infinite;
}

.sim-stage.pass {
    border-color: var(--success);
    background: var(--success-light);
}

.sim-stage.fail {
    border-color: var(--danger);
    background: var(--danger-light);
}

.sim-stage.skip {
    opacity: 0.4;
}

.stage-icon {
    font-size: 1.25rem;
}

.stage-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.stage-status {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.iteration-counter {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--warning);
    display: none;
}

.iteration-counter.visible {
    display: block;
}

.sim-arrow {
    font-size: 1rem;
    color: var(--text-dim);
    flex-shrink: 0;
}

/* G_run Mini Monitor in Simulator */
.optimizer-sim-stage {
    min-width: 120px !important;
}

.grun-mini-monitor {
    margin-top: 0.5rem;
    padding: 0.4rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: 6px;
}

.grun-mini-label {
    font-family: 'Georgia', serif;
    font-size: 0.6rem;
    color: var(--warning);
    text-align: center;
    margin-bottom: 0.25rem;
}

.grun-mini-indicators {
    display: flex;
    justify-content: center;
    gap: 0.2rem;
}

.mini-ind {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.mini-ind.pass {
    background: var(--success);
    color: white;
}

.mini-ind.fail {
    background: var(--danger);
    color: white;
    animation: blink 0.5s infinite;
}

.mini-ind.checking {
    background: var(--warning);
    color: white;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* G_run Threshold Slider */
.grun-threshold {
    margin-top: 0.75rem;
}

.grun-threshold label {
    font-size: 0.8rem;
    font-weight: 400 !important;
    color: var(--text-muted);
}

.grun-threshold input[type="range"] {
    width: 100%;
    margin-top: 0.25rem;
    accent-color: var(--warning);
}

/* Result Display */
.sim-result {
    background: var(--surface-light);
    border-radius: 10px;
    padding: 1.5rem;
    min-height: 100px;
}

.result-placeholder {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.result-badge.passed {
    background: var(--success-light);
    color: var(--success);
}

.result-badge.blocked {
    background: var(--danger-light);
    color: var(--danger);
}

.result-equation {
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    color: var(--primary-light);
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.result-detail {
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 8px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 600;
    color: var(--text);
}

/* Simulator Log */
.simulator-log {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.log-container {
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
}

.log-placeholder {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

.log-entry {
    padding: 0.5rem;
    border-left: 3px solid var(--border);
    margin-bottom: 0.5rem;
    background: var(--surface-light);
    border-radius: 0 6px 6px 0;
}

.log-entry.info { border-left-color: var(--primary); }
.log-entry.success { border-left-color: var(--success); }
.log-entry.warning { border-left-color: var(--warning); }
.log-entry.error { border-left-color: var(--danger); }

.log-time {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.log-message {
    color: var(--text);
}

/* ============================================
   AUDIT TRAIL VIEW
   ============================================ */

.audit-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.audit-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.audit-stat {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-light);
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.audit-record-template {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.record-structure {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.record-field {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.record-field.governance-field {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    border-left-color: var(--primary);
}

.record-field.governance-field .field-name {
    color: var(--primary-light);
}

.record-field.safeguard-field {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-left-color: var(--success);
}

.record-field.safeguard-field .field-name {
    color: var(--success);
}

.record-field.grun-field {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border-left-color: var(--warning);
}

.record-field.grun-field .field-name {
    color: var(--warning);
}

.field-name {
    font-weight: 600;
    color: var(--text);
    min-width: 200px;
}

.field-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.audit-records {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.records-list {
    max-height: 400px;
    overflow-y: auto;
}

.no-records {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

.audit-record {
    background: var(--surface-light);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.audit-record.passed { border-left: 4px solid var(--success); }
.audit-record.blocked { border-left: 4px solid var(--danger); }

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.record-id {
    font-weight: 700;
    font-family: monospace;
    color: var(--text);
}

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

.record-result {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.record-result.passed { background: var(--success-light); color: var(--success); }
.record-result.blocked { background: var(--danger-light); color: var(--danger); }

.record-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.record-section {
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 6px;
}

.record-section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.record-section-value {
    font-size: 0.85rem;
    color: var(--text);
}

.record-section.governance-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    border-left: 3px solid var(--primary);
}

.record-section.governance-section .record-section-title {
    color: var(--primary-light);
}

.record-section.safeguard-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-left: 3px solid var(--success);
}

.record-section.safeguard-section .record-section-title {
    color: var(--success);
}

.record-section.grun-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border-left: 3px solid var(--warning);
}

.record-section.grun-section .record-section-title {
    color: var(--warning);
}

/* ============================================
   DOMAINS VIEW
   ============================================ */

.domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.domain-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.domain-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.domain-card.critical {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--surface), rgba(239, 68, 68, 0.1));
}

.domain-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.domain-icon {
    font-size: 2rem;
}

.domain-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.security-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.domain-config {
    margin-bottom: 1.5rem;
}

.config-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.config-row:last-child {
    border-bottom: none;
}

.config-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.config-value {
    font-family: 'Georgia', serif;
    font-size: 0.85rem;
    color: var(--primary-light);
}

/* Domain Simulation Panel */
.domain-simulation {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid var(--primary);
    margin-top: 2rem;
    box-shadow: var(--shadow-glow);
}

.domain-sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.domain-sim-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

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

.domain-sim-content {
    min-height: 200px;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.auth-details {
    background: var(--surface-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text);
    font-size: 0.9rem;
}

.signature-box {
    height: 80px;
    background: var(--surface-light);
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.signature-box:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.signature-box.signed {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-light);
}

.signature-placeholder {
    color: var(--text-muted);
}

.signature-text {
    font-family: 'Brush Script MT', cursive;
    font-size: 1.5rem;
    color: var(--text);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
}

.footer-content p {
    margin: 0.25rem 0;
}

.footer-equation {
    font-family: 'Georgia', serif;
    color: var(--primary-light);
    font-size: 1.1rem;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .simulator-container {
        grid-template-columns: 1fr;
    }

    .simulator-controls {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 1024px) {
    .decomposition-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .certificates-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .safeguards-grid {
        grid-template-columns: 1fr;
    }

    .g-ext-desc {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .equation-large .term {
        font-size: 2.5rem;
        min-width: 60px;
    }

    .decomposition-steps {
        grid-template-columns: 1fr;
    }

    .right-card {
        flex-direction: column;
        text-align: center;
    }

    .right-number {
        margin: 0 auto;
    }

    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .audit-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .diagram-container {
        flex-direction: column;
    }

    .eden-wrapper {
        min-width: auto;
        width: 100%;
    }

    .sim-flow {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .sim-arrow {
        display: none;
    }

    .g-extended-equation {
        padding: 1rem;
    }

    .g-ext-formula {
        flex-wrap: wrap;
    }

    .g-component {
        font-size: 1.1rem;
        padding: 0.4rem 0.75rem;
    }

    .governance-kernel-bar {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .kernel-bar-rights {
        order: 2;
    }

    .grun-arch-indicators {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-elevated);
}
