:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #101923;
  --panel-2: #131f2a;
  --panel-3: #172531;
  --line: rgba(179, 205, 218, .12);
  --line-strong: rgba(179, 205, 218, .2);
  --text: #e8f0f3;
  --muted: #92a4ae;
  --dim: #667984;
  --accent: #64dfc2;
  --accent-strong: #3ac5a6;
  --accent-wash: rgba(100, 223, 194, .10);
  --warm: #c8a779;
  --danger: #e5a27f;
  --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%; height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; display: grid; grid-template-rows: 68px minmax(0, 1fr); background: radial-gradient(ellipse at 32% 18%, rgba(40, 77, 87, .16), transparent 44%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(11, 17, 24, .94); z-index: 2; min-width: 0; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(100, 223, 194, .42); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 3px; background: var(--accent-wash); flex: 0 0 auto; }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 10px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 13px; opacity: .75; }
.brand-copy { min-width: 0; }
.eyebrow { color: var(--dim); font-size: 9px; line-height: 1.3; font-weight: 750; letter-spacing: .16em; }
h1 { margin: 3px 0 0; font-size: 17px; line-height: 1.15; font-weight: 650; letter-spacing: -.025em; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: #8ca19e; font-size: 9px; letter-spacing: .13em; font-weight: 750; margin-right: 8px; }
.live-indicator i, .live-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(100, 223, 194, .55); display: inline-block; }
.utility-button { border: 1px solid var(--line-strong); background: #111c26; border-radius: 8px; padding: 8px 11px; color: #b7c5ca; font-size: 11px; font-weight: 600; cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.utility-button:hover, .utility-button:focus-visible { border-color: rgba(100, 223, 194, .55); color: var(--text); outline: none; }
.screenshot-button { color: var(--accent); border-color: rgba(100, 223, 194, .3); }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 392px; }
.stage-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 54px minmax(0, 1fr) 52px; border-right: 1px solid var(--line); background: #0d151d; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.view-tabs, .medium-tabs { display: flex; align-items: center; gap: 3px; padding: 3px; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 9px; }
.view-tab, .medium-tab { border: 0; background: transparent; border-radius: 6px; padding: 7px 12px; color: #8497a2; font-size: 11px; font-weight: 650; cursor: pointer; transition: color .18s ease, background .18s ease; }
.view-tab:hover, .medium-tab:hover { color: var(--text); }
.view-tab.is-active, .medium-tab.is-active { color: #dffaf3; background: rgba(100, 223, 194, .13); box-shadow: inset 0 0 0 1px rgba(100, 223, 194, .13); }
.medium-tabs { background: rgba(8, 14, 19, .62); }
.medium-tab { padding-left: 14px; padding-right: 14px; }
.canvas-wrap { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 44%, rgba(35, 69, 77, .17), transparent 54%), linear-gradient(135deg, rgba(14, 26, 35, .82), rgba(10, 17, 24, .95)); }
.canvas-wrap::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .17; background-image: linear-gradient(rgba(125, 163, 172, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(125, 163, 172, .08) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, black, transparent 92%); }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.scene-stamp { position: absolute; top: 17px; left: 22px; display: flex; align-items: center; gap: 8px; color: #718790; font-size: 9px; font-weight: 750; letter-spacing: .16em; pointer-events: none; }
.stamp-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .85; }
.stage-caption { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 36px)); padding: 10px 14px; border: 1px solid rgba(157, 191, 198, .14); border-radius: 9px; background: rgba(10, 18, 25, .82); backdrop-filter: blur(10px); color: #a8bbc1; font-size: 11px; line-height: 1.45; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.15); transition: opacity .2s ease; pointer-events: none; }
.transport-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 22px; border-top: 1px solid var(--line); background: rgba(12, 20, 28, .96); }
.transport-controls { display: flex; align-items: center; gap: 7px; }
.transport-button { border: 1px solid var(--line-strong); background: #121e28; border-radius: 7px; padding: 7px 11px; color: #aabac1; font-size: 10px; font-weight: 650; cursor: pointer; transition: .18s ease; }
.transport-button:hover, .transport-button:focus-visible { border-color: rgba(100, 223, 194, .5); color: var(--text); outline: none; }
.transport-button.primary { border-color: rgba(100, 223, 194, .32); background: var(--accent-wash); color: var(--accent); min-width: 83px; }
.play-symbol { font-size: 11px; margin-right: 5px; }
.simulation-state { display: flex; align-items: center; gap: 8px; color: #82949c; font-size: 9px; font-weight: 750; letter-spacing: .13em; white-space: nowrap; }
.state-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(100, 223, 194, .4); }
.state-dot.is-paused { background: var(--warm); box-shadow: none; }
.state-dot.is-moving { background: #e8c18d; box-shadow: 0 0 9px rgba(232, 193, 141, .35); }
.inspector { min-width: 0; min-height: 0; background: linear-gradient(180deg, #111b25, #0f1821); }
.inspector-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #31424c transparent; padding: 21px 20px 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-heading h2 { margin: 4px 0 0; font-size: 15px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; color: #8ba19e; font-size: 8px; letter-spacing: .12em; font-weight: 800; border: 1px solid rgba(100, 223, 194, .16); background: rgba(100, 223, 194, .05); border-radius: 20px; padding: 5px 8px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.readout-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: rgba(20, 32, 43, .72); padding: 11px 12px 10px; min-height: 88px; }
.readout-card.featured { border-color: rgba(100, 223, 194, .22); background: linear-gradient(145deg, rgba(100, 223, 194, .09), rgba(20, 32, 43, .72) 68%); }
.readout-label { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #93a6ae; font-size: 9px; line-height: 1.35; font-weight: 600; }
.source-tag { display: inline-block; color: #637b83; font-size: 7px; font-weight: 750; letter-spacing: .05em; white-space: nowrap; text-transform: uppercase; }
.readout-value { display: flex; align-items: baseline; gap: 5px; margin-top: 8px; color: #e8f5f3; font-size: 22px; line-height: 1; letter-spacing: -.04em; font-weight: 620; font-variant-numeric: tabular-nums; }
.featured .readout-value { color: var(--accent); }
.readout-value small { font-size: 9px; color: #7f929a; font-weight: 600; letter-spacing: 0; }
.readout-foot { margin-top: 7px; color: #647984; font-size: 8px; line-height: 1.3; }
.controls-section, .preset-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-heading.compact { margin-bottom: 13px; }
.unit-note { color: #71858e; font-size: 8px; white-space: nowrap; }
.control-row { margin: 0 0 13px; }
.control-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.control-head label { color: #b8c7cc; font-size: 10px; font-weight: 600; }
.control-head output { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-head sub { font-size: 8px; }
input[type="range"] { width: 100%; height: 14px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, var(--accent-strong), #34454f); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, var(--accent-strong), #34454f); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #d9fff5; border: 2px solid #36bda0; box-shadow: 0 0 0 3px rgba(100, 223, 194, .1); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d9fff5; border: 2px solid #36bda0; box-shadow: 0 0 0 3px rgba(100, 223, 194, .1); }
input[type="range"]:focus-visible { outline: 1px solid rgba(100, 223, 194, .5); outline-offset: 4px; border-radius: 6px; }
.range-ends { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; color: #586e78; font-size: 8px; }
.last-control { margin-bottom: 0; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 7px; }
.preset-button { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: rgba(20, 32, 43, .55); cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover, .preset-button:focus-visible { border-color: rgba(100, 223, 194, .35); outline: none; }
.preset-button.is-selected { border-color: rgba(100, 223, 194, .32); background: rgba(100, 223, 194, .055); }
.preset-swatch { width: 23px; height: 23px; flex: 0 0 auto; border-radius: 6px; background: linear-gradient(135deg, #d1b079, #74583c); border: 1px solid rgba(240, 203, 145, .3); }
.preset-swatch.alloy { background: linear-gradient(135deg, #b9c8ca, #607b83); border-color: rgba(190, 218, 220, .28); }
.preset-button b { display: block; color: #c7d4d8; font-size: 10px; font-weight: 650; }
.preset-button small { display: block; margin-top: 3px; color: #71858e; font-size: 8px; }
.preset-arrow { margin-left: auto; color: #718c8f; font-size: 13px; }
.check-section { display: flex; gap: 10px; margin-top: 17px; padding: 12px; border: 1px solid rgba(100, 223, 194, .16); border-radius: 9px; background: rgba(100, 223, 194, .045); }
.check-icon { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #0c1d1a; background: var(--accent); font-size: 11px; font-weight: 900; }
.check-copy { min-width: 0; }
.check-title { color: #b9cfce; font-size: 9px; font-weight: 700; }
.check-copy p { margin: 5px 0 4px; color: #7f969a; font-size: 8px; line-height: 1.4; }
.check-equation { display: flex; flex-wrap: wrap; gap: 4px; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.check-equation span { color: #8aa49f; }
.science-panel { margin-top: 15px; border: 1px solid var(--line); border-radius: 9px; background: rgba(17, 29, 39, .65); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; margin-top: 3px; font-size: 11px; font-weight: 650; }
.details-mark { color: var(--accent); font-size: 17px; transition: transform .2s ease; }
.science-panel[open] .details-mark { transform: rotate(45deg); }
.science-content { padding: 0 12px 13px; color: #8599a1; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 9px 0; }
.science-intro { color: #a8b9be; }
.equation-list { display: grid; gap: 6px; margin: 11px 0; }
.equation-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px; border: 1px solid rgba(179, 205, 218, .08); border-radius: 6px; background: rgba(255,255,255,.02); }
.equation-list b { color: #aabdc2; font-size: 8px; }
.equation-list code { color: var(--accent); font-size: 9px; white-space: nowrap; }
.constant-note { color: #9db0b4; }
.disclaimer { color: #7c9694; font-style: italic; }
.inspector-footer { margin-top: 16px; color: #526670; font-size: 7px; font-weight: 750; letter-spacing: .13em; text-align: center; }
.inspector-footer span { color: var(--accent); padding: 0 5px; }
button:focus-visible, summary:focus-visible { outline: 2px solid rgba(100, 223, 194, .65); outline-offset: 2px; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 350px; }
  .inspector-scroll { padding-left: 16px; padding-right: 16px; }
  .readout-card { padding: 10px; }
  .readout-value { font-size: 20px; }
}
@media (max-width: 680px) {
  .app-shell { grid-template-rows: 56px minmax(0, 1fr); }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 8px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 14px; }
  .live-indicator { display: none; }
  .top-actions { gap: 5px; }
  .utility-button { padding: 7px 8px; font-size: 9px; }
  .screenshot-button { font-size: 0; padding: 7px 9px; }
  .screenshot-button span { font-size: 12px; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(260px, 43dvh) minmax(0, 1fr); }
  .stage-panel { grid-template-rows: 42px minmax(0, 1fr) 42px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-toolbar { padding: 0 10px; gap: 6px; }
  .view-tabs, .medium-tabs { gap: 1px; padding: 2px; }
  .view-tab, .medium-tab { padding: 6px 8px; font-size: 9px; }
  .medium-tab { padding-left: 10px; padding-right: 10px; }
  .scene-stamp { top: 9px; left: 12px; font-size: 7px; }
  .stage-caption { bottom: 7px; width: calc(100% - 18px); padding: 7px 9px; font-size: 9px; }
  .transport-bar { padding: 0 10px; }
  .transport-button { padding: 6px 8px; font-size: 9px; }
  .transport-button.primary { min-width: 73px; }
  .simulation-state { font-size: 7px; }
  .inspector-scroll { padding: 13px 12px 16px; }
  .section-heading { margin-bottom: 10px; }
  .section-heading h2 { font-size: 13px; }
  .readout-grid { gap: 6px; }
  .readout-card { min-height: 74px; padding: 8px 9px; }
  .readout-label { font-size: 8px; }
  .source-tag { font-size: 6px; }
  .readout-value { margin-top: 6px; font-size: 18px; }
  .readout-value small { font-size: 8px; }
  .readout-foot { margin-top: 5px; font-size: 7px; }
  .controls-section, .preset-section { margin-top: 15px; padding-top: 13px; }
  .control-row { margin-bottom: 10px; }
  .control-head label, .control-head output { font-size: 9px; }
  .range-ends { font-size: 7px; }
  .preset-button { padding: 8px; }
  .check-section { margin-top: 12px; padding: 9px; }
  .science-panel { margin-top: 12px; }
}
@media (max-width: 370px) {
  .view-tab { padding-left: 6px; padding-right: 6px; }
  .medium-tab { padding-left: 8px; padding-right: 8px; }
  .brand-copy .eyebrow { display: none; }
  h1 { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
