:root {
  color-scheme: dark;
  --bg: #07111c;
  --panel: #0b1723;
  --panel-2: #0e1d2b;
  --line: rgba(151, 189, 211, .13);
  --line-strong: rgba(151, 189, 211, .22);
  --text: #e5f0f5;
  --muted: #8199a8;
  --dim: #526b7a;
  --cyan: #69d3ed;
  --cyan-2: #2e9dbd;
  --rose: #d77b91;
  --gold: #e6bc79;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; font-size: 12px; letter-spacing: .01em; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 52% 40%, rgba(24, 63, 82, .18), transparent 50%), var(--bg); }
.topbar { height: 68px; flex: 0 0 68px; display: grid; grid-template-columns: 255px minmax(240px,1fr) 255px; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(7,17,28,.96); z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 29px; height: 29px; border: 1px solid rgba(105,211,237,.45); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-7deg); background: rgba(40,128,154,.1); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--cyan); box-shadow: 0 0 8px rgba(105,211,237,.55); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .75; }
.brand-name { font-size: 10px; font-weight: 800; letter-spacing: .14em; white-space: nowrap; }
.brand-name span { color: #7c97a8; font-weight: 600; }
.brand-sub, .eyebrow, .section-kicker, .micro-tag, .panel-index, .scene-chip, .scene-subtitle, .scene-corner, .scene-caption, .scene-help, .timeline-top, .speed-control label, .footerbar, .readout-top, .validation-values span, .validation-foot, .range-ends { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.brand-sub { color: #678294; font-size: 8px; letter-spacing: .15em; margin-top: 4px; }
.topbar-title { text-align: center; }
.eyebrow { font-size: 8px; color: #6c9aaa; letter-spacing: .2em; }
.topbar-title h1 { margin: 3px 0 0; font-size: 18px; font-weight: 650; letter-spacing: -.035em; }
.topbar-right { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.live-indicator { display: flex; align-items: center; gap: 8px; color: #8ba3b2; font: 9px ui-monospace, monospace; letter-spacing: .12em; }
.live-indicator i, .footer-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #55d3a2; box-shadow: 0 0 9px rgba(85,211,162,.7); }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.025); color: #a9c0cd; font-size: 16px; cursor: pointer; }
.icon-button:hover, .tool-button:hover, .transport-button:hover { border-color: rgba(105,211,237,.55); color: var(--cyan); }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: 260px minmax(420px,1fr) 286px; gap: 1px; background: var(--line); }
.control-panel, .insight-panel { background: linear-gradient(180deg, rgba(12,25,37,.98), rgba(9,20,31,.98)); min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #294557 transparent; }
.control-panel { padding: 22px 18px 18px 20px; }
.insight-panel { padding: 22px 18px 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.panel-heading h2 { font-size: 15px; margin: 5px 0 0; font-weight: 620; letter-spacing: -.025em; }
.section-kicker { color: #6f96a7; font-size: 8px; letter-spacing: .18em; font-weight: 700; }
.panel-index { color: #496779; font-size: 10px; border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; }
.preset-block { padding: 12px; background: linear-gradient(135deg, rgba(43,111,133,.13), rgba(19,46,62,.12)); border: 1px solid rgba(83,160,183,.18); border-radius: 10px; margin-bottom: 20px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-label-row label { color: #d0e0e8; font-size: 10px; font-weight: 560; }
.field-label-row output { color: var(--cyan); font: 11px ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.micro-tag { color: #63899b; font-size: 7px; letter-spacing: .12em; }
.select-control, .speed-control select { appearance: none; width: 100%; color: #d7e7ee; background: #122434; border: 1px solid rgba(123,168,190,.22); border-radius: 7px; padding: 9px 30px 9px 10px; margin-top: 9px; outline: none; background-image: linear-gradient(45deg, transparent 50%, #81a6b7 50%), linear-gradient(135deg, #81a6b7 50%, transparent 50%); background-position: calc(100% - 14px) 13px, calc(100% - 10px) 13px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; cursor: pointer; }
.field-hint { color: #7891a0; font-size: 9px; line-height: 1.45; margin: 8px 0 0; }
.control-section { margin: 18px 0 0; }
.control-section > .section-kicker { padding-bottom: 9px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.control-row { margin: 0 0 15px; }
input[type="range"] { appearance: none; display: block; width: 100%; height: 4px; margin: 12px 0 7px; background: linear-gradient(90deg, #287c96, #64cce2); border-radius: 99px; outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #d5f5fb; border: 2px solid #2b829b; box-shadow: 0 0 0 3px rgba(76,177,205,.14), 0 0 9px rgba(80,190,220,.4); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d5f5fb; border: 2px solid #2b829b; box-shadow: 0 0 0 3px rgba(76,177,205,.14); }
.range-ends { display: flex; justify-content: space-between; color: #5e7888; font-size: 8px; }
.control-footer { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 15px; }
.reset-note { display: flex; align-items: center; gap: 7px; color: #8299a7; font-size: 9px; line-height: 1.4; margin-bottom: 10px; }
.dot-cyan { width: 5px; height: 5px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 8px rgba(105,211,237,.7); flex: 0 0 auto; }
.button { border-radius: 7px; padding: 9px 10px; border: 1px solid var(--line-strong); cursor: pointer; font-size: 9px; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.button-quiet { width: 100%; background: rgba(255,255,255,.025); color: #91a8b6; }
.button-quiet:hover, .button-outline:hover { color: var(--cyan); border-color: rgba(105,211,237,.48); background: rgba(57,144,169,.08); }
.scene-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #07121e; position: relative; }
.scene-toolbar { height: 44px; flex: 0 0 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid rgba(151,189,211,.1); background: rgba(9,21,32,.96); }
.scene-toolbar-left, .scene-toolbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.scene-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 8px; letter-spacing: .12em; color: #b9d1dc; padding: 5px 7px; border: 1px solid rgba(90,166,191,.25); border-radius: 5px; background: rgba(36,107,131,.12); white-space: nowrap; }
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }
.scene-subtitle { font-size: 8px; color: #607e90; letter-spacing: .08em; white-space: nowrap; }
.tool-button { border: 1px solid transparent; border-radius: 5px; padding: 5px 7px; color: #6f8998; background: transparent; font: 8px ui-monospace, monospace; letter-spacing: .1em; cursor: pointer; }
.tool-button.active { color: var(--cyan); background: rgba(54,139,164,.12); border-color: rgba(92,186,213,.22); }
.camera-button { border-left: 1px solid var(--line); border-radius: 0; padding-left: 12px; font-size: 12px; }
.camera-button span { font-size: 8px; margin-left: 3px; }
.scene-viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 52% 46%, #102d40 0%, #091a28 48%, #06111b 100%); }
.scene-canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; z-index: 1; outline: none; }
.scene-vignette { position: absolute; z-index: 2; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 44%, rgba(2,8,14,.32) 100%); }
.scene-corner { position: absolute; z-index: 3; top: 14px; display: flex; flex-direction: column; gap: 4px; color: #668496; font-size: 8px; letter-spacing: .12em; pointer-events: none; }
.scene-corner b { color: #a4c3d0; font-weight: 500; }
.scene-corner--tl { left: 16px; }
.scene-corner--tr { right: 16px; text-align: right; }
.scene-caption { position: absolute; z-index: 3; bottom: 17px; left: 16px; display: flex; align-items: center; gap: 8px; color: #6f91a2; font-size: 8px; letter-spacing: .11em; pointer-events: none; }
.caption-line { width: 20px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.scene-help { position: absolute; z-index: 3; right: 15px; bottom: 17px; color: #668292; font-size: 8px; letter-spacing: .09em; pointer-events: none; }
.scene-help span { color: #355d70; margin: 0 4px; }
.mouse-icon { font-size: 12px; color: #8bb9c9; }
.webgl-overlay { display: none; position: absolute; z-index: 8; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(82%,360px); text-align: center; color: #b3d4e0; background: rgba(6,16,25,.9); border: 1px solid rgba(105,211,237,.28); border-radius: 10px; padding: 14px; font-size: 10px; line-height: 1.5; }
.webgl-lost .webgl-overlay { display: block; }
.world-label { position: absolute; z-index: 4; pointer-events: none; display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border-left: 1px solid rgba(105,211,237,.7); background: rgba(4,14,23,.7); backdrop-filter: blur(5px); border-radius: 0 5px 5px 0; white-space: nowrap; transform-origin: top left; }
.world-label__title { color: #c9e8f0; font: 8px ui-monospace, monospace; letter-spacing: .07em; }
.world-label__detail { color: #7da1b0; font: 7px ui-monospace, monospace; }
.label-front { border-left-color: #61d8ff; }
.label-band { border-left-color: #d77b91; }
.label-gel { border-left-color: #e6bc79; }
.transport-bar { height: 66px; flex: 0 0 66px; display: flex; align-items: center; gap: 15px; padding: 0 15px; background: #0b1926; border-top: 1px solid rgba(151,189,211,.12); }
.transport-controls { display: flex; align-items: center; gap: 6px; }
.transport-button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #9db4c0; cursor: pointer; font-size: 12px; }
.transport-button.primary { width: 34px; height: 34px; background: linear-gradient(135deg, #236b83, #174c64); color: #e4f9ff; border-color: rgba(105,211,237,.5); box-shadow: 0 0 18px rgba(34,126,155,.2); }
.timeline-block { flex: 1; min-width: 0; }
.timeline-top { display: flex; justify-content: space-between; color: #6d8796; font-size: 8px; letter-spacing: .1em; margin-bottom: 8px; }
.timeline-top strong { color: #b8d3df; font-weight: 500; font-size: 9px; }
.timeline-track { height: 3px; background: #1b3445; border-radius: 9px; position: relative; }
.timeline-fill { height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #287e9a, #77d5e9); box-shadow: 0 0 9px rgba(105,211,237,.35); }
.timeline-marker { position: absolute; width: 8px; height: 8px; border-radius: 50%; top: 50%; left: 0%; transform: translate(-50%,-50%); background: #c8f4fc; border: 2px solid #3e9db6; box-shadow: 0 0 8px rgba(105,211,237,.65); }
.speed-control { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.speed-control label { color: #6d8796; font-size: 7px; letter-spacing: .15em; }
.speed-control select { margin: 0; width: 65px; padding: 6px 18px 6px 7px; font: 9px ui-monospace, monospace; background-position: calc(100% - 10px) 10px, calc(100% - 6px) 10px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.readout-card { min-width: 0; padding: 11px 10px 9px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, rgba(22,44,60,.58), rgba(12,26,39,.65)); }
.readout-card--wide { grid-column: span 2; }
.readout-top { display: flex; justify-content: space-between; align-items: center; color: #7592a2; font-size: 7px; letter-spacing: .13em; }
.readout-icon { font-size: 14px; line-height: 1; }
.readout-icon.cyan { color: var(--cyan); }
.readout-icon.rose { color: var(--rose); }
.readout-icon.gold { color: var(--gold); }
.readout-value { margin-top: 8px; font-size: 24px; font-weight: 620; letter-spacing: -.055em; font-variant-numeric: tabular-nums; line-height: 1; color: #e4f0f4; }
.readout-value small { font-size: 10px; color: #85a2b1; font-weight: 500; letter-spacing: 0; }
.readout-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; color: #718c9a; font-size: 8px; line-height: 1.3; }
.mini-bar { width: 58px; height: 3px; background: #233c4d; border-radius: 9px; flex: 0 0 auto; overflow: hidden; }
.mini-bar i { display: block; width: 36%; height: 100%; background: var(--cyan); border-radius: inherit; }
.readout-tag { color: #6b9a9e; border: 1px solid rgba(92,175,178,.25); border-radius: 3px; padding: 2px 4px; font: 7px ui-monospace, monospace; }
.validation-card { padding: 12px 11px 10px; border: 1px solid rgba(93,163,180,.2); border-radius: 9px; background: linear-gradient(145deg, rgba(24,55,69,.4), rgba(11,25,37,.72)); margin-bottom: 13px; }
.validation-heading { display: flex; justify-content: space-between; align-items: center; }
.pass-pill { color: #79d8b4; border: 1px solid rgba(86,198,151,.32); background: rgba(51,150,113,.1); border-radius: 4px; padding: 3px 5px; font: 7px ui-monospace, monospace; letter-spacing: .08em; }
.validation-card h3 { margin: 9px 0 4px; font-size: 11px; font-weight: 620; }
.validation-card p { margin: 0; color: #7893a2; font-size: 8px; line-height: 1.45; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); }
.validation-values div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.validation-values span { color: #658294; font-size: 7px; letter-spacing: .08em; }
.validation-values strong { color: #c5dce5; font: 10px ui-monospace, monospace; white-space: nowrap; }
.validation-foot { color: #5f7e8f; font-size: 7px; margin-top: 8px; }
.science-panel { border: 1px solid var(--line); border-radius: 9px; background: rgba(12,27,40,.68); margin-bottom: 14px; overflow: hidden; }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 11px 10px; list-style: none; cursor: pointer; color: #d1e3ea; font-size: 10px; font-weight: 600; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-symbol { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; margin-right: 7px; border-radius: 5px; color: var(--cyan); background: rgba(72,156,181,.14); font-size: 13px; }
.summary-chevron { color: #6b8797; font-size: 15px; transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 10px 12px; border-top: 1px solid var(--line); }
.science-step { display: flex; gap: 8px; margin-top: 12px; }
.step-number { flex: 0 0 19px; height: 19px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(105,211,237,.25); border-radius: 5px; color: var(--cyan); font: 8px ui-monospace, monospace; }
.science-step h4, .science-notes h4 { margin: 0 0 4px; font-size: 9px; color: #c9dce4; }
.science-step p { margin: 0; color: #8098a5; font-size: 8px; line-height: 1.55; }
.equation { margin: 8px 0 0 27px; padding: 8px 7px; border-radius: 5px; background: rgba(61,125,149,.1); border: 1px solid rgba(91,160,184,.12); color: #9fd9e8; font: 10px ui-monospace, monospace; overflow-x: auto; white-space: nowrap; }
.science-notes { margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.science-notes ul { margin: 6px 0 0; padding-left: 14px; color: #7893a2; font-size: 8px; line-height: 1.55; }
.science-notes li { margin: 0 0 4px; }
.disclaimer { margin: 8px 0 0; color: #587687; font-size: 7px; line-height: 1.45; }
.legend-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 11px; color: #7792a0; font-size: 7px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; margin-left: 3px; }
.cyan-dot { background: var(--cyan); }
.rose-dot { background: var(--rose); }
.gold-dot { background: var(--gold); }
.display-options { border-top: 1px solid var(--line); padding-top: 13px; }
.display-options > .section-kicker { margin-bottom: 9px; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; color: #9bb1bd; font-size: 9px; padding: 7px 0; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-row i { width: 28px; height: 15px; border-radius: 10px; background: #263d4c; border: 1px solid #3a5667; position: relative; transition: background .2s ease; }
.toggle-row i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 9px; height: 9px; border-radius: 50%; background: #91aab7; transition: transform .2s ease, background .2s ease; }
.toggle-row input:checked + i { background: #1b7188; border-color: #3ba0ba; }
.toggle-row input:checked + i::after { transform: translateX(13px); background: #d9f9ff; }
.toggle-row input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 3px; }
.button-outline { width: 100%; margin-top: 10px; background: rgba(255,255,255,.025); color: #a6c0cc; }
.footerbar { height: 25px; flex: 0 0 25px; display: flex; justify-content: space-between; align-items: center; padding: 0 15px; border-top: 1px solid var(--line); background: #07111c; color: #587283; font-size: 7px; letter-spacing: .1em; }
.footer-dot { width: 5px; height: 5px; margin-right: 5px; }
.footer-divider { color: #2d4b5d; padding: 0 5px; }
.keyboard-hints { display: flex; align-items: center; gap: 5px; }
kbd { border: 1px solid #294657; border-radius: 3px; padding: 1px 4px; color: #89a5b4; font: 7px ui-monospace, monospace; }

.embed-mode .topbar, .embed-mode .footerbar { display: none; }
.embed-mode .workspace { grid-template-columns: 230px minmax(360px,1fr) 250px; }
.embed-mode .control-panel, .embed-mode .insight-panel { padding-top: 14px; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 238px minmax(360px,1fr) 260px; }
  .topbar { grid-template-columns: 220px minmax(200px,1fr) 220px; }
  .control-panel { padding-left: 15px; padding-right: 14px; }
  .insight-panel { padding-left: 14px; padding-right: 14px; }
  .scene-subtitle { display: none; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .app { min-height: 100vh; }
  .topbar { grid-template-columns: 1fr auto; height: 58px; flex-basis: 58px; padding: 0 14px; }
  .topbar-title { display: none; }
  .topbar-right { grid-column: 2; }
  .workspace { display: flex; flex-direction: column; gap: 1px; min-height: auto; }
  .scene-column { order: 0; height: min(62vh, 540px); min-height: 390px; flex: 0 0 auto; }
  .control-panel { order: 1; overflow: visible; padding: 18px 16px; }
  .insight-panel { order: 2; overflow: visible; padding: 18px 16px; }
  .control-panel, .insight-panel { min-height: auto; }
  .footerbar { position: relative; height: auto; min-height: 27px; padding: 7px 12px; gap: 8px; flex-wrap: wrap; }
  .footerbar > div:nth-child(2) { display: none; }
  .scene-toolbar { padding: 0 12px; }
  .transport-bar { padding: 0 12px; gap: 10px; }
  .scene-help { font-size: 7px; }
}
@media (max-width: 520px) {
  .brand-name { font-size: 9px; }
  .brand-sub { font-size: 7px; }
  .live-indicator { font-size: 7px; }
  .scene-column { height: 475px; min-height: 420px; }
  .scene-toolbar { height: 40px; flex-basis: 40px; }
  .scene-toolbar-right { gap: 3px; }
  .tool-button { padding: 5px 5px; font-size: 7px; }
  .camera-button { padding-left: 6px; }
  .camera-button span { display: none; }
  .scene-corner { top: 10px; font-size: 7px; }
  .scene-caption { left: 10px; bottom: 12px; font-size: 6px; }
  .scene-help { right: 9px; bottom: 12px; font-size: 6px; }
  .transport-bar { height: 61px; flex-basis: 61px; gap: 8px; }
  .transport-button { width: 28px; height: 28px; }
  .transport-button.primary { width: 31px; height: 31px; }
  .timeline-top { font-size: 7px; }
  .timeline-top strong { font-size: 8px; }
  .speed-control select { width: 58px; }
  .world-label { padding: 4px 5px; }
  .world-label__title { font-size: 6px; }
  .world-label__detail { font-size: 6px; }
  .footerbar { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
