/* 
   OPTIC STATE LABORATORIES — INVESTOR PRE-PRINT STYLE SHEETS
   Matlab / MathematicaStacked Paper Research Aesthetic
*/

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --paper-bg:      #fafaf8;
  --sheet-bg:      #ffffff;
  --text-primary:  #11110f;
  --text-secondary:#3a3a37;
  --text-muted:    #7c7c76;
  
  /* Matlab/Mathematica Clinical Palette */
  --math-blue:     #1a5fb4;
  --math-teal:     #038477;
  --math-red:      #c01c28;
  --math-orange:   #e66100;
  --math-purple:   #813d9c;
  
  --grid-line:     #e8e8e3;
  --border-light:  #e2e2de;
  --border-dark:   #1f1f1e;
  
  --font-serif:    'EB Garamond', Georgia, serif;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--paper-bg);
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.8;
  padding: 5rem 2rem 8rem;
  -webkit-font-smoothing: antialiased;
}

/* Document Wrapper */
.document-container {
  max-width: 820px;
  margin: 0 auto;
  perspective: 2000px; /* Enable 3D sheet tilting */
}

/* Cover Banner & Branding */
.cover-banner {
  text-align: center;
  margin-bottom: 5rem;
  padding-bottom: 3rem;
  border-bottom: 1.5px solid var(--border-light);
}

.cover-emblem {
  width: 54px;
  height: 54px;
  margin: 0 auto 1.5rem;
  stroke: var(--text-primary);
  stroke-width: 1.5;
  fill: none;
}

/* Preface / Narrative Intro */
.preface-container {
  margin-bottom: 6rem;
}

.preface-title {
  font-size: 2.35rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 2rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.narrative-large {
  font-size: 1.45rem;
  line-height: 1.9;
  margin-bottom: 2rem;
  text-align: justify;
  color: var(--text-primary);
}

.narrative-large em {
  font-style: italic;
}

.narrative-large strong {
  font-weight: 600;
}

/* preprint header styling */
.preprint-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
  margin-bottom: 3.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preprint-tag {
  background-color: rgba(26, 95, 180, 0.08);
  color: var(--math-blue);
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-weight: 600;
}

/* Stacked Paper Sheets with 3D Tilt Transitions */
.paper-sheet {
  background-color: var(--sheet-bg);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  box-shadow: 
    0 4px 20px rgba(0,0,0,0.015),
    0 1px 3px rgba(0,0,0,0.01);
  padding: 5rem 4.5rem;
  margin-bottom: 6rem;
  position: relative;
  min-height: 1100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  
  /* Stable, professional flat sheet */
  transition: box-shadow 0.3s ease;
}

.paper-sheet:hover {
  box-shadow: 
    0 12px 30px rgba(0,0,0,0.025),
    0 2px 6px rgba(0,0,0,0.01);
}

.sheet-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
  margin-bottom: 3.5rem;
  display: flex;
  justify-content: space-between;
}

.sheet-header-title {
  font-weight: 600;
  color: var(--text-secondary);
}

.sheet-content {
  flex-grow: 1;
}

.sheet-footer {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
  margin-top: 3.5rem;
  display: flex;
  justify-content: space-between;
}

/* Titles and numbering */
h2.sheet-section-title {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--text-primary);
  padding-bottom: 0.35rem;
}

h3.sheet-subsection-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.25rem 0 1rem;
  display: flex;
  align-items: baseline;
}

h3.sheet-subsection-title .sub-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

/* Inferences Grid and Trait Boxes */
.inferences-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.inference-box {
  background-color: #fafafa;
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.005);
}

.inference-box-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.35rem;
}

.inference-name {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.inference-score {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--math-blue);
}

.inference-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
  text-align: justify;
}

/* Matlab Plot Canvas */
.matlab-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  background-color: #fbfbfa;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  margin: 1.25rem 0 2rem;
}

.plot-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  background-color: #fcfcfb;
  padding: 0.85rem;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.control-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.control-select, .control-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background-color: var(--sheet-bg);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.control-btn.active {
  background-color: var(--border-dark);
  color: var(--sheet-bg);
  border-color: var(--border-dark);
}

.matlab-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  outline: none;
  margin: 0.35rem 0;
}

.matlab-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--math-blue);
  cursor: pointer;
  border: 1px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Sidenotes / Margin boxes */
.marginalia {
  background-color: rgba(240, 240, 235, 0.45);
  border-left: 3px solid var(--text-muted);
  padding: 0.85rem 1.15rem;
  margin: 1.5rem 0;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.marginalia-title {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
}

/* Equations styling for KaTeX */
.math-equation-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.75rem 0;
  padding: 0.85rem 1.35rem;
  background-color: rgba(240, 240, 235, 0.2);
  border: 1px dashed var(--border-light);
  overflow-x: auto;
}

.math-formula {
  text-align: center;
  flex: 1;
  font-size: 1.15rem;
}

.math-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Ingestion Ledger Table */
.ledger-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.ledger-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border-dark);
  padding: 0.6rem;
  text-align: left;
}

.ledger-table td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.ledger-table tr:hover td {
  background-color: #fafafa;
  color: var(--text-primary);
}

.ledger-weight {
  font-family: var(--font-mono);
  color: var(--math-blue);
  font-weight: 600;
}

/* SVG graph layout */
.graph-split-layout {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.evidence-svg-canvas {
  width: 100%;
  height: 260px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
}

.graph-details-panel {
  background-color: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.details-header {
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

/* SVG dynamic selectors */
.node-label { font-family: var(--font-mono); font-size: 9px; fill: var(--text-secondary); }
.node-point { cursor: pointer; transition: r 0.2s; }
.node-point:hover { r: 8px !important; }
.link-line { stroke: var(--grid-line); stroke-width: 1.2; stroke-dasharray: 2 2; }
.link-line.active { stroke: var(--math-teal); stroke-width: 1.8; stroke-dasharray: none; }

/* Checklist and metrics */
.repair-split-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.repair-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checklist-item input { margin-top: 0.22rem; }

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

.var-stat-box {
  background-color: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 0.65rem;
  text-align: center;
  font-family: var(--font-mono);
}

.var-val {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--math-blue);
  margin-top: 0.2rem;
}

.var-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Flowchart connectors */
.flow-line {
  stroke: var(--border-light);
  stroke-width: 1.5;
  fill: none;
}

.flow-pulse {
  stroke: var(--math-teal);
  stroke-width: 2;
  stroke-dasharray: 6 12;
  fill: none;
  animation: flow-dash 10s linear infinite;
}

@keyframes flow-dash {
  to { stroke-dashoffset: -300px; }
}

/* Typewriter Signal Court Terminal Console */
.signal-court-console {
  background-color: #fafafa;
  border: 1.5px solid var(--border-dark);
  border-radius: 4px;
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
}

.court-stamp {
  border: 2px double var(--math-red);
  color: var(--math-red);
  padding: 0.25rem 0.5rem;
  font-weight: 700;
  display: inline-block;
  transform: rotate(-3deg);
  margin-bottom: 1rem;
}

.court-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.court-form-group label {
  font-weight: 600;
  color: var(--text-secondary);
}

.court-input {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem;
  border: 1px solid var(--border-light);
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.court-input:focus {
  border-color: var(--border-dark);
}

.court-appeal-status {
  background-color: rgba(3, 132, 119, 0.08);
  border: 1px solid rgba(3, 132, 119, 0.2);
  color: var(--math-teal);
  padding: 0.75rem;
  border-radius: 4px;
  margin-top: 1rem;
  line-height: 1.45;
  display: none;
}

/* Dynamic Diligence Scan Box */
.investor-gate-box {
  background-color: #181816;
  border: 1.5px solid var(--border-dark);
  border-radius: 6px;
  padding: 2.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #a8a8a4;
  margin: 3.5rem 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

.investor-gate-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  opacity: 0.35;
}

.investor-gate-header {
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  border-bottom: 1px solid #3c3c39;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
}

.diligence-stat {
  color: var(--math-teal);
  font-weight: 600;
  animation: pulse-glow 2.5s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; text-shadow: none; }
  50% { opacity: 1.0; text-shadow: 0 0 8px var(--math-teal); }
}

.terminal-input-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.terminal-input {
  flex-grow: 1;
  background-color: #242422;
  border: 1px solid #4a4a46;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  outline: none;
  border-radius: 4px;
}

.terminal-input:focus {
  border-color: var(--math-teal);
}

.terminal-btn {
  background-color: var(--math-teal);
  color: #ffffff;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.terminal-btn:hover {
  background-color: #029486;
}

.terminal-log {
  background-color: #121210;
  border: 1px solid #3c3c39;
  border-radius: 4px;
  padding: 1rem;
  height: 140px;
  overflow-y: auto;
  line-height: 1.5;
  color: #03ff88;
  display: none;
}

/* System Alerts / Regulatory Callouts */
.compliance-callout {
  background-color: rgba(192, 28, 40, 0.03);
  border: 1px solid rgba(192, 28, 40, 0.12);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.6;
}

.compliance-title {
  font-weight: 700;
  color: var(--math-red);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* Page Indicator for sheets */
.sheet-num-marker {
  font-weight: 600;
  color: var(--text-primary);
}

/* Print/A4 Aspect Adjustments */
@media (max-width: 768px) {
  body { padding: 1.5rem 0.5rem; }
  .paper-sheet { padding: 2.5rem 1.5rem; min-height: auto; margin-bottom: 4rem; }
  .inferences-grid { grid-template-columns: 1fr; }
  .graph-split-layout { grid-template-columns: 1fr; }
  .repair-split-grid { grid-template-columns: 1fr; }
}

/* Custom Premium Tooltips for Jargon Context & Citations */
.jargon-term {
  position: relative;
  text-decoration: underline dotted var(--math-teal);
  cursor: help;
  color: var(--text-primary);
  font-weight: 500;
}

.jargon-term::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background-color: #121210;
  color: #fafafa;
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  border: 1px solid #3c3c39;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  line-height: 1.45;
  white-space: normal;
  width: 250px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  text-align: left;
  font-weight: normal;
  text-decoration: none !important;
}

.jargon-term:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(-4px);
  pointer-events: auto;
}

.citation-ref {
  position: relative;
  color: var(--math-blue);
  cursor: help;
  font-weight: bold;
  padding: 0 2px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  display: inline-block;
  vertical-align: super;
}

.citation-ref::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background-color: #121210;
  color: #a8a8a4;
  padding: 0.55rem 0.8rem;
  border-radius: 4px;
  border: 1px solid #3c3c39;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  line-height: 1.4;
  white-space: normal;
  width: 280px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  text-align: left;
  font-weight: normal;
}

.citation-ref:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(-4px);
  pointer-events: auto;
}

/* Custom Tooltip Arrows */
.jargon-term::before {
  content: '';
  position: absolute;
  bottom: 122%;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  border-width: 5px;
  border-style: solid;
  border-color: #121210 transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.jargon-term:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(-4px);
}

.citation-ref::before {
  content: '';
  position: absolute;
  bottom: 132%;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  border-width: 5px;
  border-style: solid;
  border-color: #121210 transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.citation-ref:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(-4px);
}

/* Slide-out Sub-Context Side Panel Drawer */
.panel-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: 100%;
  background-color: #121210;
  border-left: 1.5px solid var(--border-dark);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.35);
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  color: #fafafa;
}
.side-panel.open {
  transform: translateX(0);
}

.side-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #3c3c39;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--math-teal);
}

.side-panel-close-btn {
  background: none;
  border: 1px solid #4a4a46;
  color: #a8a8a4;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.side-panel-close-btn:hover {
  border-color: #ffffff;
  color: #ffffff;
}

.side-panel-body {
  padding: 2rem 1.5rem;
  flex-grow: 1;
  overflow-y: auto;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.65;
}

.side-panel-body h3 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  border-bottom: 1px solid #3c3c39;
  padding-bottom: 0.35rem;
}

.side-panel-body h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: bold;
  color: var(--math-orange);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.side-panel-body p {
  color: #a8a8a4;
  margin-bottom: 1.25rem;
  text-align: justify;
}

.side-panel-body ul, .side-panel-body ol {
  margin-left: 1.25rem;
  margin-bottom: 1.25rem;
  color: #a8a8a4;
}

.side-panel-body li {
  margin-bottom: 0.5rem;
}

.side-panel-body strong {
  color: #ffffff;
}

.context-trigger-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: underline dotted var(--math-orange);
  color: var(--math-orange) !important;
  font-weight: 600;
  margin-left: 0.5rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.context-trigger-link:hover {
  opacity: 0.8;
}

/* Zero-Gravity Floating Animation for Antigravity Protocol */
@keyframes float-drift {
  0% {
    transform: translateY(0) rotate(0deg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.015), 0 1px 3px rgba(0,0,0,0.01);
  }
  25% {
    transform: translateY(-8px) rotate(0.2deg);
  }
  50% {
    transform: translateY(-15px) rotate(-0.2deg);
    box-shadow: 0 20px 45px rgba(0,0,0,0.035), 0 5px 12px rgba(0,0,0,0.02);
  }
  75% {
    transform: translateY(-6px) rotate(0.1deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.015), 0 1px 3px rgba(0,0,0,0.01);
  }
}
.antigravity-float {
  animation: float-drift 7s ease-in-out infinite !important;
}

/* Retro CRT Green-Phosphor Phosphor-Shadow Matrix Theme */
body.retro-matrix-mode {
  background-color: #030803 !important;
  color: #33ff33 !important;
  --paper-bg: #030803;
  --sheet-bg: #061206;
  --text-primary: #33ff33;
  --text-secondary: #22ee22;
  --text-muted: #11bb11;
  --border-light: #163616;
  --border-dark: #33ff33;
  --math-blue: #33ff33;
  --math-teal: #88ff88;
  --math-red: #ff3333;
  --math-orange: #ff9900;
  --math-purple: #bb66ff;
  
  font-family: var(--font-mono) !important;
  text-shadow: 0 0 3px rgba(51, 255, 51, 0.45);
}

body.retro-matrix-mode * {
  font-family: var(--font-mono) !important;
}

body.retro-matrix-mode .paper-sheet {
  background-color: #061206 !important;
  border: 1px solid #33ff33 !important;
  box-shadow: 0 0 12px rgba(51, 255, 51, 0.1) !important;
}

body.retro-matrix-mode .plot-controls,
body.retro-matrix-mode .inferences-grid > div,
body.retro-matrix-mode .marginalia,
body.retro-matrix-mode .compliance-callout,
body.retro-matrix-mode .signal-court-console,
body.retro-matrix-mode .graph-details-panel,
body.retro-matrix-mode .math-equation-block {
  background-color: #040a04 !important;
  border: 1.5px dashed #22cc22 !important;
  color: #33ff33 !important;
}

body.retro-matrix-mode input[type="range"]::-webkit-slider-thumb {
  background: #33ff33 !important;
  box-shadow: 0 0 6px #33ff33 !important;
}

body.retro-matrix-mode input[type="checkbox"] {
  accent-color: #33ff33 !important;
}

body.retro-matrix-mode .control-btn,
body.retro-matrix-mode .control-select,
body.retro-matrix-mode .court-input,
body.retro-matrix-mode .terminal-input,
body.retro-matrix-mode .terminal-btn,
body.retro-matrix-mode .side-panel-close-btn {
  border: 1px solid #33ff33 !important;
  background-color: #030803 !important;
  color: #33ff33 !important;
  text-shadow: 0 0 2px rgba(51, 255, 51, 0.4);
}

body.retro-matrix-mode .control-btn.active {
  background-color: #33ff33 !important;
  color: #030803 !important;
}

body.retro-matrix-mode canvas {
  filter: hue-rotate(90deg) invert(1) brightness(1.2) contrast(1.1);
}

body.retro-matrix-mode svg {
  border-color: #22cc22 !important;
}

body.retro-matrix-mode svg line {
  stroke: #22bb22 !important;
}

body.retro-matrix-mode svg line.active {
  stroke: #88ff88 !important;
}

body.retro-matrix-mode svg circle,
body.retro-matrix-mode svg rect,
body.retro-matrix-mode svg polygon {
  stroke: #33ff33 !important;
  fill: #061206 !important;
}

body.retro-matrix-mode svg text {
  fill: #33ff33 !important;
}

body.retro-matrix-mode .node-point:hover {
  r: 8px !important;
  fill: #88ff88 !important;
}

body.retro-matrix-mode .flow-pulse {
  stroke: #88ff88 !important;
}

body.retro-matrix-mode .flow-line {
  stroke: #163616 !important;
}
