:root {
  color-scheme: dark;
  --bg: #07111e;
  --panel: #0b1725;
  --panel-2: #101f30;
  --line: rgba(159, 195, 221, .14);
  --line-strong: rgba(159, 195, 221, .24);
  --text: #edf6ff;
  --muted: #8ca3b8;
  --muted-2: #627b92;
  --cyan: #8edcff;
  --cyan-strong: #4cc8f4;
  --violet: #b6a1ff;
  --green: #83e1c2;
  --amber: #ffd38a;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
#app { width: 100%; height: 100%; display: flex; flex-direction: column; background: radial-gradient(ellipse at 20% 0%, rgba(31, 72, 101, .24), transparent 38%), var(--bg); }
.topbar { height: 68px; min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(5, 13, 23, .82); z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(141, 220, 255, .35); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(145deg, rgba(92, 178, 220, .18), rgba(125, 112, 217, .08)); transform: rotate(-8deg); }
.brand-mark span { width: 3px; border-radius: 5px; background: var(--cyan); display: block; transform: skewY(-26deg); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .72; }
.brand-kicker, .section-kicker { font-size: 9px; line-height: 1.3; letter-spacing: .17em; color: #7fa6c0; font-weight: 800; }
h1 { font-size: 16px; line-height: 1.3; letter-spacing: -.025em; margin: 3px 0 0; font-weight: 690; white-space: nowrap; }
h1 span { color: #8fa8bc; font-size: 13px; font-weight: 450; }
.topbar-meta { display: flex; align-items: center; gap: 17px; font-size: 9px; letter-spacing: .13em; font-weight: 800; color: var(--muted); }
.live-indicator { display: flex; align-items: center; gap: 7px; }
.live-indicator i, .chip-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--green); box-shadow: 0 0 10px rgba(131, 225, 194, .75); }
.seed-tag { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: #9bb1c3; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; }
.visual-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 88px; border-right: 1px solid var(--line); }
.scene-wrap { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 55%, #102a40, #071321 72%); }
.scene-container { position: absolute; inset: 0; overflow: hidden; }
.scene-container canvas { display: block; width: 100%; height: 100%; }
.scene-loading, .scene-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; z-index: 2; text-align: center; background: radial-gradient(ellipse at 50% 50%, rgba(18, 45, 67, .93), rgba(7, 17, 30, .98)); color: var(--text); }
.scene-loading[hidden], .scene-fallback[hidden] { display: none; }
.scene-loading strong, .scene-fallback strong { font-size: 13px; letter-spacing: .02em; }
.scene-loading small, .scene-fallback p { font-size: 11px; color: var(--muted); max-width: 360px; line-height: 1.55; margin: 0; }
.loading-orbit { width: 36px; height: 36px; border: 1px solid rgba(142, 220, 255, .22); border-top-color: var(--cyan); border-radius: 50%; position: relative; animation: orbit 1.8s linear infinite; margin-bottom: 6px; }
.loading-orbit span { position: absolute; width: 5px; height: 5px; background: var(--cyan); border-radius: 50%; top: -2px; left: 14px; box-shadow: 0 0 12px var(--cyan); }
.loading-orbit span:nth-child(2) { top: 15px; left: 30px; opacity: .55; }
.loading-orbit span:nth-child(3) { top: 30px; left: 8px; opacity: .35; }
@keyframes orbit { to { transform: rotate(360deg); } }
.fallback-icon { font-size: 44px; color: var(--cyan); opacity: .65; }
.scene-topline { position: absolute; top: 17px; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; z-index: 3; pointer-events: none; }
.scene-chip { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(169, 208, 232, .17); border-radius: 7px; padding: 8px 10px; background: rgba(6, 16, 28, .54); backdrop-filter: blur(10px); font-size: 9px; letter-spacing: .13em; font-weight: 800; color: #c0d5e5; }
.scene-actions { display: flex; gap: 7px; pointer-events: auto; }
.icon-button { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid rgba(169, 208, 232, .18); border-radius: 8px; background: rgba(6, 16, 28, .56); color: #c5deef; font-size: 18px; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; backdrop-filter: blur(10px); }
.icon-button:hover { background: rgba(42, 93, 126, .55); border-color: rgba(142, 220, 255, .5); transform: translateY(-1px); }
.scene-annotations { position: absolute; inset: 0; pointer-events: none; z-index: 2; font-size: 8px; letter-spacing: .15em; font-weight: 800; color: rgba(213, 233, 247, .76); }
.annotation { position: absolute; display: flex; align-items: center; gap: 7px; text-shadow: 0 2px 9px #07111e; }
.annotation-line { display: block; width: 25px; height: 1px; background: rgba(142, 220, 255, .72); }
.annotation-sun { top: 25%; right: 17%; }
.annotation-arc { top: 39%; left: 43%; }
.annotation-crystal { bottom: 24%; right: 15%; }
.scene-legend { position: absolute; left: 18px; bottom: 17px; display: flex; flex-wrap: wrap; gap: 12px; z-index: 3; color: #a7bdce; font-size: 9px; letter-spacing: .015em; pointer-events: none; }
.scene-legend span { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 13px; height: 3px; border-radius: 4px; display: inline-block; }
.legend-swatch.spectrum { background: linear-gradient(90deg,#ff745f,#ffe08a,#78e7ca,#779aff,#ba8cff); }
.legend-swatch.reference { background: #7baac6; opacity: .65; }
.legend-swatch.crystal { background: #c5f0ff; }
.scene-bottomline { position: absolute; bottom: 18px; right: 18px; z-index: 3; display: flex; gap: 12px; font-size: 8px; letter-spacing: .13em; color: #68859c; font-weight: 800; pointer-events: none; }
#scene-status { color: #91cde8; }
.transport-bar { min-height: 88px; display: flex; align-items: center; gap: 22px; padding: 14px 20px; background: linear-gradient(180deg, #0c1928, #091522); border-top: 1px solid var(--line); }
.transport-main { display: flex; align-items: center; gap: 8px; }
.play-button { height: 40px; padding: 0 14px; border: 1px solid rgba(104, 207, 246, .45); border-radius: 9px; background: linear-gradient(135deg, rgba(55, 157, 203, .25), rgba(63, 111, 171, .18)); color: #dff7ff; font-size: 11px; font-weight: 750; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.play-button:hover { background: rgba(54, 146, 189, .36); }
.play-glyph { color: var(--cyan); font-size: 13px; }
.step-button, .reset-button { height: 36px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); color: #9bb1c3; font-size: 9px; font-weight: 800; letter-spacing: .08em; padding: 0 10px; cursor: pointer; }
.step-button:hover, .reset-button:hover { border-color: var(--line-strong); color: var(--text); }
.speed-control { min-width: 145px; flex: 1; max-width: 235px; }
.speed-control label { display: flex; justify-content: space-between; color: #7894aa; font-size: 8px; letter-spacing: .12em; font-weight: 800; margin-bottom: 8px; }
.speed-control label b { color: #c4d8e7; font-size: 10px; letter-spacing: 0; }
.quality-control { margin-left: auto; display: flex; flex-direction: column; gap: 7px; color: #7894aa; font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.16); gap: 2px; }
.segmented button { border: 0; background: transparent; color: #748da2; font-size: 8px; letter-spacing: .08em; font-weight: 800; padding: 6px 9px; border-radius: 5px; cursor: pointer; }
.segmented button[aria-pressed="true"] { color: #d8f5ff; background: rgba(71, 165, 205, .2); box-shadow: inset 0 0 0 1px rgba(110, 210, 244, .22); }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px 15px; background: linear-gradient(180deg, rgba(12, 25, 39, .98), rgba(8, 19, 31, .98)); scrollbar-width: thin; scrollbar-color: #2b4b62 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 16px; margin: 4px 0 0; letter-spacing: -.025em; }
.panel-index { color: #59768e; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.preset-block, .controls-block, .readouts-block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.subheading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; color: #9bb4c7; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.subtle { color: #5d778d; font-size: 8px; font-weight: 650; letter-spacing: .08em; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 7px 10px; border: 1px solid rgba(151, 190, 217, .10); border-radius: 9px; background: rgba(255,255,255,.018); text-align: left; cursor: pointer; transition: border-color .18s, background .18s; }
.preset-button:hover { border-color: rgba(142,220,255,.35); background: rgba(73, 144, 180, .08); }
.preset-button.active { border-color: rgba(116, 209, 244, .38); background: linear-gradient(90deg, rgba(53, 143, 183, .17), rgba(53, 143, 183, .045)); }
.preset-icon { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border-radius: 7px; color: var(--cyan); background: rgba(116, 206, 242, .10); font-size: 14px; }
.preset-button b { display: block; font-size: 10px; font-weight: 750; color: #d8e8f4; }
.preset-button small { display: block; margin-top: 3px; color: #7892a7; font-size: 8px; }
.range-control { padding: 8px 0 9px; }
.range-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.range-label label { font-size: 10px; color: #c5d7e5; font-weight: 600; }
.range-label output { font-size: 10px; font-weight: 750; color: var(--cyan); font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 4px; margin: 0; border-radius: 8px; background: linear-gradient(90deg, #2c9bc4, #6c8fba 55%, #293d51); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; border: 2px solid #c8f1ff; border-radius: 50%; background: #3aa8d2; box-shadow: 0 0 0 3px rgba(76, 200, 244, .13), 0 0 10px rgba(76, 200, 244, .35); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #c8f1ff; border-radius: 50%; background: #3aa8d2; box-shadow: 0 0 0 3px rgba(76, 200, 244, .13); }
.range-ends { display: flex; justify-content: space-between; margin-top: 6px; color: #5f7a90; font-size: 7px; letter-spacing: .09em; font-weight: 700; }
.compact-control { padding-bottom: 0; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-height: 72px; padding: 9px 10px 8px; border: 1px solid rgba(154, 193, 220, .12); border-radius: 9px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); }
.readout-card > span { display: flex; justify-content: space-between; gap: 4px; color: #718da3; font-size: 7px; letter-spacing: .1em; font-weight: 850; white-space: nowrap; }
.readout-card > span i { color: #526d84; font-size: 7px; font-style: normal; letter-spacing: 0; }
.readout-card strong { display: block; margin-top: 5px; color: #e3f5ff; font-size: 20px; font-weight: 650; line-height: 1.05; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.readout-card small { display: block; margin-top: 5px; color: #657f95; font-size: 8px; }
.validation-strip { display: flex; align-items: center; gap: 9px; margin-top: 9px; padding: 9px 10px; border: 1px solid rgba(126, 218, 192, .18); border-radius: 9px; background: rgba(67, 153, 127, .065); }
.validation-mark { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 20px; border-radius: 50%; color: #92e7c8; background: rgba(110, 213, 176, .13); font-size: 12px; }
.validation-strip div:nth-child(2) { flex: 1; min-width: 0; }
.validation-strip span { display: block; color: #7bbba7; font-size: 7px; font-weight: 850; letter-spacing: .1em; }
.validation-strip strong { display: block; margin-top: 3px; color: #c8f0df; font-size: 10px; font-variant-numeric: tabular-nums; }
.validation-strip button { width: 21px; height: 21px; border: 1px solid rgba(126, 218, 192, .22); border-radius: 50%; background: transparent; color: #9ccfbd; cursor: pointer; font-size: 10px; }
.science-panel { border-bottom: 1px solid var(--line); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 15px 1px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; color: #c9deed; font-size: 9px; letter-spacing: .13em; }
.science-panel summary small { display: block; margin-top: 4px; color: #6d879c; font-size: 8px; }
.details-chevron { color: #7da6bd; font-size: 17px; transition: transform .2s; }
.science-panel[open] .details-chevron { transform: rotate(180deg); }
.science-content { padding: 0 0 14px; }
.science-step { padding: 9px 0; border-top: 1px solid rgba(159,195,221,.08); }
.science-step > span, .equation-card > span, .source-links > span { color: #7faac4; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.science-step p, .assumption-note p { margin: 6px 0 0; color: #9db2c4; font-size: 9px; line-height: 1.55; }
.science-step b { color: #d6eaf7; }
.equation-card { margin: 7px 0; padding: 10px; border: 1px solid rgba(139, 187, 215, .13); border-radius: 8px; background: rgba(4, 13, 22, .45); }
.equation-card code { display: block; margin: 6px 0 4px; color: #d6f3ff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; white-space: normal; }
.equation-card small { color: #708ca2; font-size: 8px; }
.assumption-note { margin-top: 9px; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.025); }
.assumption-note > b { color: #91aec3; font-size: 8px; letter-spacing: .1em; }
.assumption-note ul { margin: 6px 0 10px; padding-left: 15px; color: #8ea5b7; font-size: 8px; line-height: 1.7; }
.source-links { display: flex; flex-direction: column; gap: 7px; padding: 11px 2px 0; }
.source-links a { color: #8ecce8; font-size: 8px; text-decoration: none; }
.source-links a:hover { color: #d6f4ff; text-decoration: underline; }
.disclaimer { padding: 12px 0 4px; color: #536e83; font-size: 8px; line-height: 1.5; }
.embed-mode .topbar { display: none; }
.embed-mode .layout { grid-template-columns: minmax(0, 1fr) 320px; }
.embed-mode .control-panel { padding-top: 13px; }
.embed-mode .visual-column { grid-template-rows: minmax(0,1fr) 76px; }
.embed-mode .transport-bar { min-height: 76px; }
@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0,1fr) 330px; }
  .transport-bar { gap: 14px; padding-inline: 14px; }
  .scene-annotations { opacity: .82; }
  .annotation-crystal { right: 7%; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  #app { min-height: 100%; height: auto; }
  .topbar { height: 58px; min-height: 58px; padding: 0 13px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 9px; }
  .brand-kicker { font-size: 7px; }
  h1 { font-size: 13px; }
  h1 span { display: none; }
  .topbar-meta { gap: 0; }
  .live-indicator { display: none; }
  .seed-tag { font-size: 8px; padding: 6px 7px; }
  .layout, .embed-mode .layout { display: flex; flex-direction: column; min-height: 0; }
  .visual-column, .embed-mode .visual-column { display: grid; grid-template-rows: minmax(340px, 46vh) auto; border-right: 0; }
  .scene-wrap { min-height: 340px; }
  .scene-topline { top: 11px; left: 11px; right: 11px; }
  .scene-chip { font-size: 8px; padding: 7px 8px; }
  .icon-button { width: 31px; height: 31px; }
  .scene-annotations { display: none; }
  .scene-legend { left: 11px; bottom: 11px; gap: 8px; font-size: 7px; }
  .scene-legend span { gap: 4px; }
  .scene-bottomline { right: 11px; bottom: 12px; font-size: 7px; }
  .transport-bar, .embed-mode .transport-bar { min-height: 80px; padding: 10px 11px; gap: 10px; flex-wrap: wrap; }
  .transport-main { gap: 5px; }
  .play-button { height: 36px; padding: 0 10px; font-size: 10px; }
  .step-button, .reset-button { height: 33px; padding: 0 8px; font-size: 8px; }
  .speed-control { min-width: 100px; max-width: none; flex: 1; }
  .speed-control label { font-size: 7px; }
  .quality-control { margin-left: 0; flex-direction: row; align-items: center; gap: 6px; }
  .quality-control > span { display: none; }
  .segmented button { padding: 6px 7px; }
  .control-panel { overflow: visible; padding: 17px 14px 24px; }
  .panel-heading h2 { font-size: 15px; }
  .preset-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .preset-button { flex-direction: column; align-items: flex-start; min-height: 92px; padding: 9px; gap: 7px; }
  .preset-button b { font-size: 9px; line-height: 1.3; }
  .preset-button small { font-size: 7px; line-height: 1.35; }
  .preset-icon { width: 24px; height: 24px; flex-basis: 24px; }
  .range-control { padding: 9px 0 10px; }
  .range-label label { font-size: 10px; }
  .readout-card { min-height: 76px; }
  .readout-card strong { font-size: 22px; }
  .embed-mode .topbar { display: none; }
}
@media (max-width: 390px) {
  .transport-bar { gap: 8px; }
  .transport-main { width: 100%; }
  .speed-control { min-width: 0; }
  .quality-control { margin-left: auto; }
  .readout-card > span { font-size: 6.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
