/* ==========================================================================
   24 Laws of Mechanical Engineering - Master Stylesheet
   Refined Sci-Fi Dark System (Clean Contrast, No Text Collisions & WCAG AA)
   ========================================================================== */

:root {
    --bg-main: #0b0f19;
    --bg-card: #131b2e;
    --bg-card-header: #1a243d;
    --bg-control: rgba(15, 23, 42, 0.6);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(56, 189, 248, 0.3);
    --border-highlight: #38bdf8;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #38bdf8;

    --badge-solid: #3b82f6;
    --badge-design: #8b5cf6;
    --badge-thermo: #f59e0b;
    --badge-fluid: #06b6d4;
    --badge-friction: #10b981;
    --badge-energy: #ec4899;

    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    overflow-x: hidden;
}

/* App Header & Top Navigation Bar */
.app-header {
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(12px);
    border-b: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 24px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-title h1 i {
    color: var(--text-accent);
}

.brand-title .subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mode-toggle-group {
    display: flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    padding: 4px;
    flex-shrink: 0;
}

.mode-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0 10px;
    font-weight: 600;
    white-space: nowrap;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.mode-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Global Screen Tip Tooltip Popover */
.screen-tip-container {
    position: fixed;
    z-index: 1000;
    background: #0f172a;
    border: 1px solid #38bdf8;
    border-radius: 10px;
    padding: 12px 16px;
    max-width: 320px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 0 15px rgba(56, 189, 248, 0.2);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.screen-tip-container.hidden {
    opacity: 0;
    transform: scale(0.95);
}

.tip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.85rem;
    color: #38bdf8;
    margin-bottom: 6px;
}

.tip-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.tip-analogy {
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.4;
    margin-bottom: 8px;
}

.tip-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
    padding-top: 6px;
}

.tip-effect {
    color: #34d399;
    font-weight: 600;
}

/* Main Container Workspace */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Scenario Selector Section */
.scenario-section {
    width: 100%;
}

.scenario-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 10px 16px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.scenario-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-accent);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.scenario-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-subtle);
    color: #cbd5e1;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scenario-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.scenario-btn.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: #60a5fa;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

/* HUD Mission Control Section - Frozen Sticky Top Dock */
.hud-section {
    width: 100%;
    position: sticky;
    top: 8px;
    z-index: 500;
    transition: all 0.3s ease;
}

.hud-section.sticky-disabled {
    position: relative;
    top: 0;
}

.hud-card {
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.75), 0 0 20px rgba(56, 189, 248, 0.15);
}

.hud-card.compact .readouts-grid {
    display: none;
}

.hud-card.compact .preset-bar {
    padding: 4px 10px;
}

.hud-pin-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-pin-btn:hover {
    background: rgba(14, 165, 233, 0.25);
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.hud-pin-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #34d399;
    color: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.hud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-b: 1px solid var(--border-subtle);
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.hud-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hud-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-active {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Scenario Presets Bar */
.preset-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: 10px;
    flex-wrap: wrap;
}

.preset-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

/* Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.control-group {
    background: var(--bg-control);
    border: 1px solid var(--border-subtle);
    padding: 12px 14px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.slider-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-accent);
    font-family: var(--font-mono);
    margin-left: auto;
    white-space: nowrap;
}

.slider-val-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.slider-econ-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--border-highlight);
    cursor: pointer;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.app-select {
    background: #0f172a;
    color: var(--text-primary);
    border: 1px solid var(--border-accent);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

/* Real-time Readouts Grid & Status Badges */
.readouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.readout-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    padding: 12px 14px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.readout-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.readout-number {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-mono);
    line-height: 1.2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.readout-unit {
    font-size: 0.85rem;
    color: var(--text-accent);
    font-weight: 600;
}

.readout-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.status-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.3); }
.status-cyan { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(34, 211, 238, 0.3); }
.status-green { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.status-yellow { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.status-red { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

.readout-sub {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Linkage Diagnostic Module Section */
.linkage-section {
    width: 100%;
}

.linkage-card {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

.linkage-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.linkage-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
    margin-bottom: 16px;
}

.linkage-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}

.linkage-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 14px;
}

.box-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-b: 1px solid var(--border-subtle);
    padding-bottom: 6px;
}

.linkage-tree-content, .linkage-cost-content {
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-row {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.link-label {
    font-weight: 600;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.link-eq {
    font-family: var(--font-mono);
    color: #38bdf8;
    font-size: 0.75rem;
}

.link-val {
    font-weight: 700;
    color: #34d399;
    font-family: var(--font-mono);
}

.cost-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px dashed var(--border-subtle);
}

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

.cost-label {
    color: #94a3b8;
    font-weight: 500;
}

.cost-amount {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #38bdf8;
}

/* 7-Stage Multi-Physics Computational Pipeline Section */
.pipeline-section {
    width: 100%;
}

.pipeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px;
}

.pipeline-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pipeline-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
    margin-bottom: 16px;
}

.pipeline-stages {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.stage-column {
    flex: 1;
    min-width: 150px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.stage-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-align: center;
    border-b: 1px solid var(--border-subtle);
    padding-bottom: 4px;
}

.flow-arrow {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.node-item {
    background: #1e293b;
    border: 1px solid var(--border-subtle);
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.node-item:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    transform: scale(1.02);
}

.node-num {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-accent);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
}

.loop-icon {
    margin-left: auto;
    color: #f59e0b;
    font-size: 0.75rem;
}

/* Category Filter Section */
.filters-section {
    width: 100%;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.filter-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 6px;
}

.filter-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-subtle);
    color: #cbd5e1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #ffffff;
}

.filter-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

/* 24 Laws Cards Container Grid */
.laws-grid-section {
    width: 100%;
}

.laws-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.law-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.law-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5);
}

.law-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-b: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}

.law-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.law-card-title span {
    color: var(--text-accent);
    font-family: var(--font-mono);
    margin-right: 6px;
}

.law-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-solid { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.3); }
.badge-design { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.3); }
.badge-thermo { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.badge-fluid { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(34, 211, 238, 0.3); }
.badge-friction { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.badge-energy { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.3); }

/* Mode-dependent Scoping & High-Contrast Visual Differentiation */
.mode-student .pro-only { display: none !important; }
.mode-pro .student-only { display: none !important; }

/* LAYMAN EXPLORER MODE STYLING HIGHLIGHTS */
.mode-student .analogy-section {
    background: rgba(16, 185, 129, 0.14) !important;
    border: 1px solid #34d399 !important;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.18) !important;
}

.mode-student .engraving-box {
    border-color: #34d399 !important;
}

/* PRO ENGINEER MODE STYLING HIGHLIGHTS */
.mode-pro .math-section {
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid #38bdf8 !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2) !important;
}

.mode-pro .sim-calc-box {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid #38bdf8 !important;
    color: #38bdf8 !important;
    font-weight: 700;
}

.mode-pro .live-sim-box {
    border-color: #38bdf8 !important;
}

/* 1. Formal Math Section (PRO MODE ONLY) */
.math-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 14px;
}

.math-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.math-formula {
    font-size: 1.1rem;
    text-align: center;
    padding: 8px 0;
    color: #ffffff;
}

.math-variables {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    border-t: 1px dashed var(--border-subtle);
    padding-top: 8px;
}

/* 2. Layman Hero Guide Section */
.analogy-section {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 10px;
    padding: 14px;
}

.analogy-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #34d399;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.analogy-text {
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.45;
}

/* 3. Dual Visual Hero Section */
.simulation-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sim-calc-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px dashed var(--border-accent);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: #38bdf8;
    text-align: center;
}

.dual-vis-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
}

.engraving-box, .live-sim-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.engraving-img {
    width: 100%;
    height: 125px;
    object-fit: contain;
    background: #fdfbf7;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.sim-target-container {
    width: 100%;
    height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.law-canvas {
    width: 100%;
    height: 125px;
    border-radius: 6px;
}

.plotly-container {
    width: 100%;
    height: 125px;
}

.vis-sub-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-play-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.live-play-btn:hover {
    background: rgba(14, 165, 233, 0.25);
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    transform: scale(1.04);
}

.live-play-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #34d399;
    color: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.4);
}

.live-sim-box.playing-active {
    border-color: #34d399 !important;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.3) !important;
}

/* Footer */
.app-footer {
    border-t: 1px solid var(--border-subtle);
    padding: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 40px;
}

.footer-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .laws-grid { grid-template-columns: 1fr; }
    .dual-vis-wrapper { grid-template-columns: 1fr; }
    .controls-grid { grid-template-columns: 1fr; }
    .linkage-grid { grid-template-columns: 1fr; }
}
