:root {
  color-scheme: dark;
  --bg: #080d15;
  --panel: #0d1521;
  --panel-2: #111c2a;
  --panel-3: #142233;
  --line: rgba(164, 190, 208, .13);
  --line-strong: rgba(164, 190, 208, .23);
  --text: #edf4f6;
  --muted: #91a4b1;
  --dim: #637887;
  --accent: #8ce0d0;
  --accent-strong: #b4f2e5;
  --accent-wash: rgba(140, 224, 208, .10);
  --warm: #e7bf8a;
  --blue: #82a9cb;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; overflow-x: hidden; }
html.embed-mode { height: 100%; overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 25% -20%, rgba(34, 70, 83, .22), transparent 45%), var(--bg); }
body.embed-mode .app { height: 100%; min-height: 0; overflow: hidden; }
.topbar { height: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 21, .94); }
.brand-lockup, .topbar-right, .live-indicator { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 29px; height: 29px; border: 1px solid rgba(140,224,208,.45); border-radius: 50%; position: relative; display: grid; place-items: center; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; border: 1px solid rgba(140,224,208,.48); border-radius: 50%; transform: rotate(-28deg); width: 19px; height: 8px; }
.brand-mark::after { transform: rotate(58deg); width: 8px; height: 19px; }
.brand-mark span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { display: none; }
.eyebrow { font-size: 9px; letter-spacing: .19em; color: var(--dim); font-weight: 750; }
.brand-title { margin-top: 3px; font-size: 13px; font-weight: 650; letter-spacing: .01em; }
.topbar-right { gap: 18px; }
.live-indicator { gap: 8px; color: #9bb0bc; font-size: 9px; letter-spacing: .13em; font-weight: 700; }
.live-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px rgba(140,224,208,.65); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); background: #101a27; border-radius: 8px; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.icon-button:hover { background: #182637; border-color: rgba(140,224,208,.48); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: #c1d0d7; stroke-width: 1.5; }
.subbar { height: 38px; flex: 0 0 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(13,21,33,.65); }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 9px; letter-spacing: .13em; color: var(--dim); font-weight: 700; }
.breadcrumb i { font-style: normal; color: #405260; }
.breadcrumb strong { color: #b9c9d0; font-weight: 750; }
.subbar-note { font-size: 9px; letter-spacing: .12em; color: #718693; font-weight: 650; }
.tiny-star { color: var(--accent); margin-right: 5px; }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 388px; }
.visual-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #09111b; }
.canvas-wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 48%, rgba(18, 43, 55, .45), rgba(7, 13, 22, .95) 70%); }
#spaceCanvas { display: block; width: 100%; height: 100%; }
.canvas-topline { position: absolute; top: 18px; left: 22px; right: 22px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scene-label { display: flex; align-items: center; gap: 10px; color: #9eb2be; font-size: 9px; letter-spacing: .15em; font-weight: 750; }
.scene-index { color: var(--accent); font-size: 10px; }
.frame-chip { border: 1px solid rgba(160,190,205,.18); background: rgba(8,15,24,.62); border-radius: 4px; padding: 7px 9px; font-size: 8px; color: #8095a1; letter-spacing: .12em; font-weight: 700; }
.chip-dot { display: inline-block; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.canvas-legend { position: absolute; bottom: 17px; left: 22px; display: flex; flex-wrap: wrap; gap: 17px; color: #8497a2; font-size: 8px; letter-spacing: .1em; font-weight: 700; pointer-events: none; }
.canvas-legend span { display: flex; align-items: center; gap: 7px; }
.legend-line { display: inline-block; width: 17px; height: 1px; background: var(--accent); box-shadow: 0 0 5px rgba(140,224,208,.5); }
.legend-pulse { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #f1fffb; box-shadow: 0 0 8px var(--accent); }
.legend-sun { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 7px rgba(231,191,138,.5); }
.canvas-coordinates { position: absolute; right: 22px; bottom: 17px; color: #607581; font-size: 9px; letter-spacing: .04em; pointer-events: none; }
.canvas-coordinates span { color: #354b58; margin: 0 5px; }
.caption-strip { flex: 0 0 82px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-top: 1px solid var(--line); background: #0c1520; }
.caption-symbol { width: 29px; height: 29px; flex: 0 0 29px; border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: var(--accent-wash); font-size: 17px; }
.caption-copy { min-width: 0; }
.caption-heading { font-size: 12px; font-weight: 700; color: #dce8eb; margin-bottom: 4px; }
.caption-copy p { margin: 0; color: #8da1ad; font-size: 10px; line-height: 1.45; max-width: 650px; }
.caption-tag { margin-left: auto; white-space: nowrap; border: 1px solid rgba(140,224,208,.22); color: #9dd8cc; background: rgba(140,224,208,.055); border-radius: 4px; padding: 6px 8px; font-size: 8px; letter-spacing: .12em; font-weight: 750; }
.control-panel { min-height: 0; background: linear-gradient(180deg, #0e1723, #0b131e); overflow: hidden; }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 10px; scrollbar-width: thin; scrollbar-color: #314653 transparent; }
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #314653; border-radius: 5px; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 10px; }
.panel-heading h1 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.035em; font-weight: 650; }
.model-badge { color: var(--accent); border: 1px solid rgba(140,224,208,.2); background: rgba(140,224,208,.06); padding: 5px 7px; border-radius: 4px; font-size: 9px; letter-spacing: .08em; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 9px; text-align: left; border: 1px solid var(--line); border-radius: 7px; padding: 9px 8px; background: rgba(18,30,44,.68); cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-button:hover { border-color: rgba(140,224,208,.36); transform: translateY(-1px); }
.preset-button.active { border-color: rgba(140,224,208,.48); background: rgba(140,224,208,.075); }
.preset-button b { display: block; font-size: 10px; font-weight: 700; color: #dce8eb; }
.preset-button small { display: block; margin-top: 3px; font-size: 8px; color: #8296a2; white-space: nowrap; }
.preset-icon { position: relative; flex: 0 0 25px; height: 25px; border: 1px solid rgba(140,224,208,.24); border-radius: 50%; }
.preset-icon::before { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--warm); left: 9px; top: 9px; }
.close-icon::after { content: ""; position: absolute; width: 18px; height: 7px; border: 1px solid var(--accent); border-radius: 50%; left: 2px; top: 8px; transform: rotate(-8deg); }
.wide-icon::after { content: ""; position: absolute; width: 20px; height: 15px; border: 1px dashed var(--accent); border-radius: 50%; left: 1px; top: 4px; transform: rotate(-8deg); }
.control-section { margin-bottom: 10px; }
.section-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: #8196a2; font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.section-rule { flex: 1; height: 1px; background: var(--line); }
.control-item { margin-bottom: 8px; }
.control-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.control-label-row label { color: #c5d3d9; font-size: 10px; font-weight: 600; }
.control-label-row label i { color: #dce8eb; }
.control-label-row label sub { font-size: 8px; }
.control-label-row output { color: var(--accent-strong); font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 700; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; background: transparent; appearance: none; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(140,224,208,.72), rgba(140,224,208,.16)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(140,224,208,.72), rgba(140,224,208,.16)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-strong); border: 2px solid #18312f; margin-top: -4.5px; box-shadow: 0 0 0 3px rgba(140,224,208,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-strong); border: 2px solid #18312f; box-shadow: 0 0 0 3px rgba(140,224,208,.12); }
.range-ends { display: flex; justify-content: space-between; color: #5f7380; font-size: 8px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.compact-section { margin-top: 2px; }
.micro-note { margin-top: 6px; color: #728792; font-size: 8px; }
.textbook-label, .illustrative-label, .scaled-label { display: inline-block; border-radius: 3px; padding: 2px 4px; font-size: 7px; font-weight: 800; letter-spacing: .08em; margin-left: 5px; }
.textbook-label { color: #91b6d0; background: rgba(130,169,203,.1); }
.illustrative-label { color: #b1d8cf; background: rgba(140,224,208,.09); }
.scaled-label { color: #c6b28f; background: rgba(198,178,143,.1); }
.motion-section { margin-bottom: 10px; }
.playback-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; margin-top: 7px; }
.primary-control, .secondary-control { height: 32px; border-radius: 6px; font-size: 9px; font-weight: 700; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.primary-control { border: 1px solid rgba(140,224,208,.5); color: #0a1b1b; background: var(--accent); display: flex; align-items: center; justify-content: center; gap: 7px; }
.primary-control:hover { background: #a8eee1; }
.pause-glyph { font-size: 13px; line-height: 1; }
.secondary-control { border: 1px solid var(--line-strong); color: #bdcbd1; background: #121e2b; }
.secondary-control:hover { background: #1a2a3b; border-color: rgba(140,224,208,.3); }
.secondary-control span { color: var(--accent); margin-left: 4px; }
.readout-section { margin-top: 1px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.metric-card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: rgba(17,29,43,.8); padding: 9px 10px 8px; }
.featured-metric { border-color: rgba(140,224,208,.25); background: linear-gradient(135deg, rgba(140,224,208,.085), rgba(17,29,43,.86) 70%); }
.metric-label { color: #8296a2; font-size: 7px; letter-spacing: .1em; font-weight: 800; white-space: nowrap; }
.metric-info { display: inline-grid; place-items: center; width: 11px; height: 11px; border-radius: 50%; border: 1px solid #637b87; color: #a9bbc3; font-size: 7px; text-transform: none; cursor: help; }
.metric-value { margin-top: 5px; color: #e5f0f0; font-size: 20px; line-height: 1.1; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.featured-metric .metric-value { color: var(--accent-strong); }
.metric-value small { font-size: 10px; letter-spacing: 0; font-weight: 600; color: #93aab3; }
.metric-foot { margin-top: 6px; color: #5f7480; font-size: 7px; letter-spacing: .08em; white-space: nowrap; }
.metric-foot .textbook-label, .metric-foot .illustrative-label, .metric-foot .scaled-label { font-size: 6px; }
.check-card { margin-top: 8px; border: 1px solid rgba(130,169,203,.18); border-radius: 6px; background: rgba(130,169,203,.045); padding: 9px 10px 8px; }
.check-head { display: flex; align-items: center; gap: 6px; color: #91a9b8; font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.check-icon { display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; color: #10201f; background: var(--accent); font-size: 9px; }
.check-status { margin-left: auto; color: var(--accent); font-size: 7px; }
.check-values { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: #8397a2; font-size: 8px; }
.check-values b { color: #d7e4e7; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-diff { margin-top: 6px; color: #718692; font-size: 8px; }
.check-diff strong { color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.check-diff span { color: #5d727e; }
.utility-row { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 10px; padding: 9px 1px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toggle-control { display: flex; align-items: center; gap: 7px; color: #aabac1; font-size: 9px; cursor: pointer; }
.toggle-control input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 25px; height: 14px; background: #2b3a46; border: 1px solid #425562; border-radius: 10px; position: relative; transition: background .18s ease; }
.toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: #9aabb4; transition: transform .18s ease, background .18s ease; }
.toggle-control input:checked + .toggle-track { background: rgba(140,224,208,.28); border-color: rgba(140,224,208,.55); }
.toggle-control input:checked + .toggle-track::after { transform: translateX(11px); background: var(--accent); }
.toggle-control input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.quality-control { display: flex; align-items: center; gap: 7px; color: #6f8490; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.quality-control button { border: 1px solid rgba(140,224,208,.28); background: rgba(140,224,208,.07); color: var(--accent); border-radius: 4px; padding: 4px 7px; font-size: 7px; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.science-panel { border: 1px solid var(--line); border-radius: 6px; background: rgba(16,27,40,.6); }
.science-panel summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 11px 10px; color: #bdcbd1; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { color: var(--accent); font-size: 14px; }
.summary-chevron { margin-left: auto; color: #78909d; font-size: 13px; transition: transform .18s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 11px 12px; border-top: 1px solid var(--line); }
.science-intro { margin: 11px 0; color: #9aadb6; font-size: 9px; line-height: 1.55; }
.equation-block { border: 1px solid rgba(140,224,208,.15); background: rgba(140,224,208,.035); border-radius: 5px; padding: 9px; margin-bottom: 7px; overflow: hidden; }
.equation-name { color: #7f9b9f; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.equation { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 4px; color: #e0eceb; font-family: Georgia, "Times New Roman", serif; font-size: 15px; white-space: nowrap; }
.frac { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; vertical-align: middle; font-size: .78em; }
.frac span:first-child { border-bottom: 1px solid #9bb5b3; padding: 0 3px 2px; }
.frac span:last-child { padding-top: 2px; }
.bracket { color: var(--accent); }
.equation-note { margin-top: 7px; color: #7d929d; font-size: 8px; line-height: 1.4; }
.secondary-equation .equation { font-size: 13px; }
.science-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.science-columns b { color: #c2d2d7; font-size: 8px; }
.science-columns p { margin: 4px 0 0; color: #8297a1; font-size: 8px; line-height: 1.5; }
.scale-note { margin: 10px 0; padding: 9px; border: 1px solid rgba(140,224,208,.16); border-radius: 5px; background: rgba(140,224,208,.035); }
.scale-note b { color: #a8d8cf; font-size: 7px; letter-spacing: .1em; }
.scale-note p { margin: 5px 0 0; color: #8197a1; font-size: 8px; line-height: 1.5; }
.constants-note { color: #6f8490; font-size: 7px; line-height: 1.55; border-top: 1px solid var(--line); padding-top: 8px; }
.constants-note b { color: #9bb0b9; letter-spacing: .08em; }
.model-disclaimer { margin: 9px 0 0; color: #728894; font-size: 8px; font-style: italic; line-height: 1.4; }
.panel-footer { display: flex; justify-content: space-between; color: #506570; font-size: 7px; letter-spacing: .1em; padding: 11px 1px 2px; }

@media (min-width: 761px) {
  .workspace { min-height: 0; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 350px; }
  .panel-scroll { padding-left: 16px; padding-right: 16px; }
  .canvas-coordinates { font-size: 8px; }
}
@media (max-width: 760px) {
  body { min-height: 100%; }
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .topbar { height: 54px; flex-basis: 54px; padding: 0 14px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-title { font-size: 12px; }
  .eyebrow { font-size: 8px; }
  .topbar-right { gap: 10px; }
  .live-indicator { font-size: 7px; }
  .icon-button { width: 31px; height: 31px; }
  .subbar { height: 32px; flex-basis: 32px; padding: 0 14px; }
  .breadcrumb { font-size: 8px; gap: 7px; }
  .subbar-note { font-size: 7px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .visual-panel { flex: 0 0 42%; min-height: 245px; border-right: 0; border-bottom: 1px solid var(--line); }
  .canvas-wrap { min-height: 0; }
  .canvas-topline { top: 12px; left: 13px; right: 13px; }
  .scene-label { font-size: 8px; gap: 7px; }
  .frame-chip { font-size: 6px; padding: 6px; }
  .canvas-legend { bottom: 10px; left: 13px; gap: 10px; font-size: 6px; }
  .canvas-coordinates { right: 12px; bottom: 10px; font-size: 7px; }
  .canvas-coordinates span { margin: 0 2px; }
  .caption-strip { flex-basis: 68px; padding: 0 13px; gap: 9px; }
  .caption-symbol { width: 25px; height: 25px; flex-basis: 25px; font-size: 14px; }
  .caption-heading { font-size: 10px; margin-bottom: 3px; }
  .caption-copy p { font-size: 8px; line-height: 1.35; }
  .caption-tag { display: none; }
  .control-panel { flex: 1 1 0; min-height: 0; overflow: hidden; }
  .panel-scroll { padding: 13px 14px 10px; }
  .panel-heading { margin-bottom: 11px; }
  .panel-heading h1 { font-size: 16px; }
  .preset-row { margin-bottom: 14px; }
  .control-section { margin-bottom: 13px; }
  .control-item { margin-bottom: 9px; }
  .section-heading { margin-bottom: 9px; }
  .control-label-row { margin-bottom: 5px; }
  .control-label-row label, .control-label-row output { font-size: 9px; }
  .range-ends { font-size: 7px; }
  .metric-card { padding: 8px; }
  .metric-label { font-size: 6px; }
  .metric-value { font-size: 18px; }
  .metric-foot { font-size: 6px; }
  .check-values, .check-diff { font-size: 7px; }
  .science-panel summary { padding: 10px; }
}
@media (max-width: 420px) {
  .visual-panel { flex-basis: 40%; min-height: 238px; }
  .canvas-coordinates { font-size: 6px; }
  .canvas-legend { gap: 7px; font-size: 6px; }
  .panel-scroll { padding-left: 12px; padding-right: 12px; }
  .preset-button { padding: 8px 6px; gap: 7px; }
  .preset-button b { font-size: 9px; }
  .preset-button small { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
