/* 01 / Design tokens are reusable CSS variables, not JavaScript variables. */
:root {
  color-scheme: dark;
  --background: #050810;
  --panel: #0D1420;
  --border: #233247;
  --text: #EDF4FF;
  --secondary: #91A5BD;
  --electric: #49BAFF;
  --magnetic: #FF9B50;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font-size: 14px; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 42% 0%, #101e30 0%, transparent 45%); z-index: -1; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--electric); }
button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--electric); outline-offset: 4px; }
.app-shell { max-width: 1680px; margin: auto; padding: 0 5%; }
.topbar { height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #1b2939; }
.topbar-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav-button { background: transparent; border: 1px solid var(--border); color: var(--secondary); font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 8px 12px; border-radius: 4px; cursor: pointer; white-space: nowrap; transition: all 0.2s ease; }
.nav-button:hover { border-color: var(--electric); color: var(--text); }
.nav-button.active { background: var(--electric); color: #061421; border-color: var(--electric); }
.lab-container { display: block; }
.lab-container.hidden { display: none; }
.placeholder-lab { padding: 60px 24px; text-align: center; color: var(--secondary); }
.placeholder-lab h2 { color: var(--text); margin-bottom: 12px; }

.brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 800; letter-spacing: .13em; }
.brand-mark { color: var(--electric); font-size: 27px; line-height: 1; }
.brand small { color: var(--secondary); font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.topbar-right { display: flex; align-items: center; gap: 10px; color: var(--secondary); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.status-dot, .tiny-dot, .live-badge span { width: 6px; height: 6px; border-radius: 50%; background: #64d9b4; display: inline-block; }
.header-divider { height: 18px; border-left: 1px solid var(--border); margin: 0 10px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 51px 0 35px; }
.eyebrow, .section-kicker { color: var(--secondary); font-size: 10px; font-weight: 700; letter-spacing: .14em; margin: 0 0 11px; }
.eyebrow span, .section-kicker span { color: var(--electric); }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(32px, 3.5vw, 48px); line-height: 1.05; letter-spacing: -.045em; margin-bottom: 12px; }
h1 span { color: var(--electric); }
.intro p:last-child { color: var(--secondary); margin: 0; line-height: 1.6; }
.intro-note { color: var(--secondary); font-size: 9px; letter-spacing: .12em; line-height: 1.8; display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.intro-note strong { color: var(--text); font-size: 10px; }
.orbit-icon { color: var(--electric); font-size: 33px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 16px; align-items: stretch; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.panel-heading h2, .section-header h2, .explanation h2 { font-size: 18px; letter-spacing: -.02em; margin: 0; }
.panel-heading .section-kicker { margin-bottom: 7px; }
.live-badge { border: 1px solid #285349; color: #8ad9bd; background: #122a29; border-radius: 4px; padding: 7px 9px; font-size: 9px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.live-badge span { margin-right: 5px; }
.scene-container { height: 475px; position: relative; overflow: hidden; background: radial-gradient(ellipse at center, #101c2b 0%, #080f19 70%); }
.scene-container canvas { display: block; width: 100%; height: 100%; }
.visual-host { width: 100%; height: 100%; }
.lab-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 16px; }
.lab-stage { min-width: 0; }
.lab-stage .scene-container { height: 475px; }
.lab-controls { align-self: stretch; }
.scene-container.generic-scene .scene-top-label,
.scene-container.generic-scene .scene-axis-label,
.scene-container.generic-scene .scene-legend { display: none; }
.scene-top-label, .scene-axis-label, .scene-legend { position: absolute; pointer-events: none; font-size: 9px; font-weight: 700; letter-spacing: .1em; color: #738ba5; }
.scene-top-label { top: 20px; left: 24px; }
.scene-top-label span { color: #3c526a; }
.scene-axis-label { right: 24px; top: 20px; }
.scene-axis-label span { color: #d3e2f1; }
.scene-legend { bottom: 20px; left: 24px; display: flex; gap: 20px; }
.scene-legend span { display: flex; align-items: center; gap: 7px; }
.scene-legend b { color: #d6e5f4; font-size: 11px; }
.legend-line { width: 18px; height: 2px; display: inline-block; }
.electric { background: var(--electric); }
.magnetic { background: var(--magnetic); }
.fallback { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; text-align: center; padding: 60px; color: var(--secondary); line-height: 1.6; }
.fallback[hidden] { display: none; }
.visual-footer { display: flex; justify-content: space-between; gap: 12px; padding: 17px 24px; color: #849ab1; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.tiny-dot { background: var(--electric); margin-right: 7px; }
.control-icon { color: var(--electric); font-size: 28px; }
.controls-content { padding: 21px 24px 24px; }
.control { margin-bottom: 18px; }
.control-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; font-size: 12px; font-weight: 600; }
.control-label .inline-number { width: 76px; margin: 0 8px 0 auto; padding: 5px 7px; border: 1px solid #2d4055; border-radius: 4px; background: #09111b; color: var(--electric); text-align: right; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: -8px 0 18px; }
.preset-button { min-height: 31px; background: #101a27; border: 1px solid var(--border); color: var(--secondary); }
.preset-button:hover, .preset-button.active { border-color: var(--electric); color: var(--text); background: #12283a; }
output { color: var(--electric); font-size: 12px; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 4px; display: block; margin: 0; accent-color: var(--electric); cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; margin-top: 8px; color: #71859d; font-size: 10px; }
.divider { border-top: 1px solid var(--border); margin: 22px 0 19px; }
.toggle-title { margin-bottom: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 32px; color: #c7d5e5; font-size: 12px; cursor: pointer; }
.toggle-row span { display: flex; align-items: center; gap: 8px; }
.toggle-row small { color: var(--secondary); }
.toggle-row input { width: 17px; height: 17px; accent-color: var(--electric); cursor: pointer; }
.field-dot { width: 7px; height: 7px; border-radius: 50%; }
.field-dot.particles { background: #8594b0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 19px; }
button { min-height: 41px; border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 700; }
.primary-button { background: var(--electric); color: #061421; border: 1px solid var(--electric); }
.secondary-button { background: #172433; color: var(--text); border: 1px solid #2b3c50; }
button:hover { filter: brightness(1.13); }
button:disabled { opacity: .5; cursor: not-allowed; }
.measurements { padding: 48px 0 0; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-header p:last-child { color: var(--secondary); font-size: 12px; margin-bottom: 1px; }
.measurement-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.measurement-card { padding: 20px; }
.measurement-card > p:first-child { display: flex; justify-content: space-between; color: var(--secondary); font-size: 9px; letter-spacing: .1em; font-weight: 700; }
.measurement-card > p:first-child span { color: var(--electric); font-family: Georgia, serif; font-size: 16px; }
.measurement-card strong { font-size: clamp(19px, 1.8vw, 26px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.measurement-card small { color: var(--secondary); font-size: 11px; }
.measurement-card .formula { color: #7188a0; font-family: Georgia, serif; font-size: 13px; margin: 14px 0 0; }
.measurement-card.editable-card { transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.measurement-card.editable-card:hover { border-color: #36536e; transform: translateY(-2px); }
.measurement-card.editable-card:focus-within { border-color: var(--electric); background: #101b29; }
.property-input { width: 68%; min-width: 0; border: 1px solid transparent; border-bottom-color: #2d4055; border-radius: 3px 3px 0 0; background: transparent; color: var(--text); font-size: clamp(19px, 1.8vw, 26px); font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.property-input:hover, .property-input:focus { border-color: #3f5a73; background: #09111b; outline: 0; }
.scientific-input { font-size: clamp(15px, 1.35vw, 20px); width: 78%; }
.explanation { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; margin-top: 16px; padding: 30px; }
.explanation-intro p:not(.section-kicker) { max-width: 460px; color: var(--secondary); line-height: 1.7; margin: 13px 0 18px; }
.explanation-intro a { color: var(--electric); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.equations { border-left: 1px solid var(--border); padding-left: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.equation-tag { font-size: 9px; letter-spacing: .1em; font-weight: 700; }
.electric-text { color: var(--electric); }
.magnetic-text { color: var(--magnetic); }
.equations div p { font-family: Georgia, serif; font-size: 16px; line-height: 1.5; margin: 12px 0 0; }
.equation-note { grid-column: 1 / -1; color: var(--secondary); font-size: 11px; line-height: 1.6; margin: 0; }
.text-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.panel-content { padding: 24px; color: var(--text); }
.notebook-section, .references-section { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.notebook-section:last-child, .references-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.notebook-section h3, .references-section h3 { color: var(--electric); font-size: 14px; font-weight: 700; letter-spacing: .05em; margin: 0 0 14px; }
.stats-display { color: var(--secondary); line-height: 1.6; margin: 0; font-size: 13px; }
.notebook-controls, .references-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.control-button { background: #172433; color: var(--text); border: 1px solid #2b3c50; padding: 10px 16px; border-radius: 5px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.control-button:hover { background: #1f2d3f; border-color: var(--electric); color: var(--electric); }
.control-button:active { background: var(--electric); color: #061421; border-color: var(--electric); }
.control-select, .inline-form input, .inline-form textarea, .inline-form select { background: #09111b; border: 1px solid #2b3c50; border-radius: 5px; color: var(--text); padding: 9px 10px; }
.inline-form { display: grid; gap: 12px; margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 7px; background: #09111b; }
.inline-form.hidden { display: none; }
.inline-form label { display: grid; gap: 7px; color: var(--secondary); font-size: 11px; font-weight: 700; }
.inline-form textarea { resize: vertical; }
.form-actions { display: flex; gap: 8px; }
.reference-tools { display: grid; grid-template-columns: 1fr 150px; gap: 10px; margin-bottom: 12px; }
.entries-container, .questions-container, .sections-container, .bibliography-container { display: grid; gap: 12px; }
.entry-item, .question-item, .section-item, .bibliography-item { padding: 14px; background: #0a111a; border: 1px solid #1b2939; border-radius: 5px; }
.entry-item h4, .question-item h4, .section-item h4 { color: var(--text); font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.entry-item p, .question-item p, .section-item p, .bibliography-item p { color: var(--secondary); font-size: 12px; margin: 0 0 8px; line-height: 1.5; }
.entry-item p:last-child, .question-item p:last-child, .section-item p:last-child, .bibliography-item p:last-child { margin-bottom: 0; }
.entry-meta { color: #738ba5; font-size: 10px; letter-spacing: .05em; margin-top: 10px; padding-top: 10px; border-top: 1px solid #1b2939; }
.research-foundation { margin: 0 0 22px; }
.text-muted { color: var(--secondary); font-style: italic; }
.reference-section-button { width: 100%; text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.reference-content { white-space: pre-wrap; overflow-wrap: anywhere; color: #b8c7d8; font-family: inherit; font-size: 12px; line-height: 1.65; margin: 14px 0 0; }
footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 32px 0; color: #a6b8ca; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
footer .brand-mark { font-size: 16px; vertical-align: middle; }
.footer-muted { color: #657b93; }
/* The layout changes at smaller widths; controls remain native keyboard- and touch-operable. */
@media (max-width: 1000px) { .workspace { grid-template-columns: minmax(0, 1fr) 285px; } .measurement-grid { grid-template-columns: repeat(2, 1fr); } .equations { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .app-shell { padding: 0 16px; } .topbar { height: auto; flex-wrap: wrap; padding: 12px 0; gap: 12px; } .topbar-nav { flex: 1 1 100%; } .nav-button { flex: 1 1 calc(50% - 4px); } .topbar-right { display: none; } .intro { padding: 35px 0 25px; } .intro-note { display: none; } .workspace, .lab-workspace { grid-template-columns: 1fr; } .scene-container, .lab-stage .scene-container { height: 360px; } .visual-footer { flex-wrap: wrap; } .measurements { padding-top: 35px; } .section-header { align-items: start; flex-direction: column; gap: 8px; } .explanation { grid-template-columns: 1fr; gap: 25px; padding: 24px; } .equations { border-left: 0; border-top: 1px solid var(--border); padding: 23px 0 0; } footer { flex-wrap: wrap; } }
@media (max-width: 380px) { .live-badge { display: none; } .scene-legend { flex-direction: column; gap: 7px; } .measurement-card { padding: 15px; } .measurement-card strong { font-size: 18px; } .nav-button { flex: 1 1 calc(33.333% - 6px); font-size: 9px; padding: 6px 8px; } }

