:root {
  color-scheme: dark;
  --bg: #0b1217;
  --panel: #111a20;
  --panel-soft: #142028;
  --line: rgba(166, 190, 195, 0.13);
  --line-strong: rgba(166, 190, 195, 0.22);
  --text: #e8ece8;
  --muted: #94a5a7;
  --dim: #64777b;
  --accent: #d7a56f;
  --accent-bright: #edc28d;
  --blue: #85b8c9;
  --green: #8ac5a4;
  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 { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 40% 0%, rgba(39, 58, 65, .22), transparent 42%), var(--bg); }
.topbar { height: 66px; flex: 0 0 66px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(9, 15, 19, .76); }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 25px; height: 25px; position: relative; display: flex; align-items: end; gap: 3px; transform: skew(-14deg); }
.brand-mark span { display: block; width: 6px; border: 1px solid #d7a56f; background: linear-gradient(180deg, #e8bd8c, #9a6b45); border-radius: 1px 1px 0 0; }
.brand-mark span:nth-child(1) { height: 12px; opacity: .72; }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 16px; opacity: .82; }
.brand-name { font-size: 11px; font-weight: 750; letter-spacing: .17em; line-height: 1.4; }
.brand-name span { color: #a5b2b2; font-weight: 500; letter-spacing: .11em; }
.brand-sub { margin-top: 2px; color: #64777b; font-size: 8px; letter-spacing: .2em; font-weight: 650; }
.topbar-right { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.live-indicator { display: flex; align-items: center; gap: 8px; }
.live-indicator i, .clock-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #8ac5a4; box-shadow: 0 0 9px rgba(138, 197, 164, .7); }
.seed-label { padding-left: 18px; border-left: 1px solid var(--line-strong); color: #718387; }
.workspace { width: 100%; max-width: 1920px; margin: 0 auto; padding: 18px 22px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 358px; gap: 18px; flex: 1; align-items: start; }
.visual-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.scene-frame { height: clamp(460px, calc(100vh - 305px), 690px); min-height: 440px; position: relative; overflow: hidden; border: 1px solid rgba(158, 184, 190, .18); border-radius: 8px; background: radial-gradient(ellipse at 55% 42%, #253238 0%, #111c22 53%, #0d151b 100%); box-shadow: 0 18px 55px rgba(0, 0, 0, .22), inset 0 0 80px rgba(0, 0, 0, .2); }
#scene-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.scene-topline { position: absolute; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.scene-kicker, .scene-scale { color: #9aaeb0; font-size: 8px; font-weight: 700; letter-spacing: .15em; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.kicker-dot { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; box-shadow: 0 0 8px rgba(215,165,111,.8); }
.kicker-divider { margin: 0 7px; color: #526368; }
.scene-scale strong { margin-left: 7px; color: #d8b68f; font-weight: 650; }
.scene-title-block { position: absolute; top: 62px; left: 22px; pointer-events: none; text-shadow: 0 2px 16px rgba(0,0,0,.65); }
.eyebrow { color: #d1a574; font-size: 8px; font-weight: 750; letter-spacing: .22em; }
.scene-title-block h1 { margin: 7px 0 3px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4vw, 55px); font-weight: 400; letter-spacing: -.055em; line-height: 1; }
.scene-title-block h1 span { color: #d5a06a; }
.scene-title-block p { margin: 7px 0 0; color: #b5c1bf; font-size: 11px; letter-spacing: .025em; }
.callout { position: absolute; display: flex; align-items: center; gap: 7px; color: rgba(225, 231, 224, .82); font-size: 8px; font-weight: 700; letter-spacing: .13em; pointer-events: none; text-shadow: 0 1px 8px #0a1013; }
.callout-number { color: var(--accent-bright); font-size: 9px; }
.callout-line { width: 24px; height: 1px; background: rgba(222, 188, 145, .68); }
.callout-a { left: 21%; top: 40%; }
.callout-b { right: 7%; top: 27%; }
.callout-c { right: 16%; bottom: 27%; }
.scene-bottomline { position: absolute; left: 20px; right: 20px; bottom: 15px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scene-hint { color: #7f9397; font-size: 8px; letter-spacing: .13em; }
.mouse-icon { color: #d7b18a; font-size: 15px; vertical-align: -1px; margin-right: 5px; }
.hint-sep { margin: 0 7px; color: #53676c; }
.sim-clock { color: #91a3a5; font-size: 8px; letter-spacing: .14em; display: flex; align-items: center; gap: 7px; }
.sim-clock span:not(.clock-dot) { color: #e0c098; font-variant-numeric: tabular-nums; font-weight: 700; }
.clock-dot { width: 5px; height: 5px; }
.context-overlay, .loading-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 14, 18, .78); backdrop-filter: blur(7px); }
.context-overlay[hidden] { display: none; }
.loading-overlay[hidden] { display: none; }
.context-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: 11px; }
.context-card strong { color: var(--text); font-size: 14px; }
.context-icon { color: var(--accent); font-size: 30px; }
.loading-overlay { background: #0d151b; color: #9eafb0; font-size: 8px; letter-spacing: .18em; gap: 13px; transition: opacity .4s ease; }
.loading-overlay.done { opacity: 0; pointer-events: none; }
.loading-ring { width: 18px; height: 18px; border: 1px solid rgba(215,165,111,.25); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 12px 13px 11px; border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(145deg, rgba(21, 32, 38, .92), rgba(14, 22, 27, .95)); }
.readout-head { display: flex; justify-content: space-between; gap: 5px; align-items: center; }
.readout-label { color: #9eadae; font-size: 8px; font-weight: 700; letter-spacing: .105em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-mark { color: #53666b; font-size: 8px; }
.readout-value { display: flex; align-items: baseline; gap: 6px; margin-top: 7px; }
.readout-value strong { font-size: 24px; line-height: 1.05; font-weight: 560; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.readout-value span { color: #94a6a6; font-size: 10px; }
.readout-foot { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: #718387; font-size: 7px; letter-spacing: .07em; white-space: nowrap; }
.readout-foot em { margin-left: auto; color: #617579; font-style: normal; font-size: 6px; letter-spacing: .09em; }
.status-dot { display: inline-block; flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; }
.status-dot.amber { background: #d9a56d; }.status-dot.blue { background: #80b8ca; }.status-dot.white { background: #dce5df; }.status-dot.stone { background: #ad8668; }
.validation-strip { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 8px 13px; border: 1px solid rgba(129, 183, 151, .18); border-radius: 6px; background: rgba(22, 40, 34, .42); }
.validation-icon { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: rgba(121, 182, 145, .13); color: #8bc8a1; font-size: 12px; }
.validation-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.validation-copy strong { color: #b7c8bf; font-size: 8px; letter-spacing: .1em; }
.validation-copy span { color: #80958b; font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-tag { margin-left: auto; padding: 4px 7px; border: 1px solid rgba(132, 196, 154, .22); border-radius: 3px; color: #8bc8a1; font-size: 7px; font-weight: 750; letter-spacing: .14em; }
.control-column { min-width: 0; padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(165deg, rgba(19, 29, 35, .98), rgba(14, 22, 27, .98)); box-shadow: 0 15px 38px rgba(0,0,0,.16); }
.panel-heading { display: flex; justify-content: space-between; align-items: end; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 400; letter-spacing: -.035em; }
.panel-index { color: #64777b; font-size: 8px; letter-spacing: .16em; padding-bottom: 4px; }
.section-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: #a6b4b3; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.section-label span { color: #607378; font-size: 7px; font-weight: 600; }
.preset-section { padding: 13px 0 14px; border-bottom: 1px solid var(--line); }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 8px 6px; border: 1px solid rgba(166,190,195,.12); border-radius: 5px; background: rgba(255,255,255,.018); text-align: left; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.preset-button:hover { border-color: rgba(215,165,111,.42); background: rgba(215,165,111,.05); }
.preset-button.active { border-color: rgba(215,165,111,.6); background: rgba(215,165,111,.085); box-shadow: inset 0 0 0 1px rgba(215,165,111,.05); }
.preset-icon { flex: 0 0 17px; color: #d8ad7e; font-size: 18px; line-height: 1; text-align: center; }
.preset-icon.sun-icon { font-size: 17px; }
.preset-button strong, .preset-button small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.preset-button strong { color: #dce3df; font-size: 8px; font-weight: 700; }
.preset-button small { margin-top: 3px; color: #75888b; font-size: 7px; }
.control-list { padding: 14px 0 2px; }
.range-control { margin-bottom: 14px; }
.range-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.range-top label { color: #c1cdca; font-size: 10px; font-weight: 560; }
.range-top output { color: #e2b987; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 14px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #bd8e5e, #4d6266); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #bd8e5e, #4d6266); }
input[type="range"]::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; appearance: none; -webkit-appearance: none; border: 2px solid #e3bd91; border-radius: 50%; background: #17242a; box-shadow: 0 0 0 3px rgba(215,165,111,.1); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #e3bd91; border-radius: 50%; background: #17242a; box-shadow: 0 0 0 3px rgba(215,165,111,.1); }
.range-scale { display: flex; justify-content: space-between; margin-top: 2px; color: #627579; font-size: 6px; letter-spacing: .1em; }
.last-range { margin-bottom: 6px; }
.transport-section { padding: 12px 0 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.transport-row { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 6px; }
.primary-action, .icon-action { min-height: 34px; display: flex; justify-content: center; align-items: center; gap: 7px; border-radius: 4px; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.primary-action { border: 1px solid #c99b6b; background: linear-gradient(180deg, #d2a574, #ad7b4e); color: #171a19; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.primary-action:hover { background: #e0b686; }
.play-glyph { font-size: 12px; }
.icon-action { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #b9c5c1; font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.icon-action:hover { border-color: rgba(215,165,111,.55); background: rgba(215,165,111,.06); }
.square-action { font-size: 18px; }
.utility-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.segmented-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.segmented-wrap > span { color: #6f8386; font-size: 7px; font-weight: 700; letter-spacing: .12em; }
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0,0,0,.16); }
.segmented button { min-width: 32px; padding: 5px 7px; border: 0; border-radius: 3px; background: transparent; color: #7f9294; font-size: 8px; cursor: pointer; }
.segmented button.selected { background: #29383c; color: #e3bd91; box-shadow: inset 0 0 0 1px rgba(215,165,111,.14); }
.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.tool-button { padding: 7px 6px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.018); color: #93a5a5; font-size: 8px; cursor: pointer; }
.tool-button:hover { border-color: rgba(215,165,111,.42); color: #e2c49e; }
.tool-button span { margin-right: 5px; color: #d5ad7f; font-size: 12px; }
.science-panel { margin-top: 11px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.012); }
.science-panel summary { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-symbol { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid rgba(215,165,111,.26); border-radius: 4px; color: #dfb887; font-family: Georgia, serif; font-size: 15px; }
.science-panel summary strong, .science-panel summary small { display: block; }
.science-panel summary strong { color: #d5dfd9; font-size: 9px; }
.science-panel summary small { margin-top: 3px; color: #738689; font-size: 7px; }
.summary-chevron { margin-left: auto; color: #819396; font-size: 17px; transition: transform .2s; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 10px 11px; border-top: 1px solid var(--line); }
.science-step { padding-top: 10px; }
.science-step > span { color: #d3a878; font-size: 7px; font-weight: 750; letter-spacing: .14em; }
.science-step p, .science-note p { margin: 5px 0 0; color: #9aacab; font-size: 8px; line-height: 1.55; }
.equation { margin: 7px 0 2px; padding: 8px 9px; border-left: 2px solid rgba(215,165,111,.5); background: rgba(215,165,111,.055); color: #e1c39e; font-family: Georgia, serif; font-size: 12px; text-align: center; }
.science-note { margin-top: 12px; padding: 9px; border: 1px solid rgba(133,184,201,.16); border-radius: 4px; background: rgba(133,184,201,.035); }
.science-note strong { color: #9dc0c9; font-size: 7px; letter-spacing: .12em; }
.panel-footnote { margin-top: 10px; color: #627478; font-size: 7px; line-height: 1.5; }
.footerbar { min-height: 30px; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; border-top: 1px solid var(--line); color: #52656a; font-size: 7px; letter-spacing: .13em; }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; padding: 20px 28px 18px; }
  .control-column { padding: 18px; }
  .scene-frame { height: min(70vh, 780px); }
  .range-control { margin-bottom: 17px; }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; padding: 14px; gap: 12px; }
  .control-column { padding: 13px; }
  .readout-card { padding: 10px 9px; }
  .readout-value strong { font-size: 21px; }
  .readout-foot { font-size: 6px; }
  .readout-foot em { display: none; }
}
@media (max-width: 820px) {
  .topbar { height: 58px; flex-basis: 58px; padding: 0 16px; }
  .workspace { display: flex; flex-direction: column; padding: 12px; gap: 12px; }
  .visual-column, .control-column { width: 100%; }
  .scene-frame { height: min(56vh, 540px); min-height: 340px; }
  .control-column { padding: 15px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .control-list .section-label { grid-column: 1 / -1; }
  .range-control { margin-bottom: 15px; }
  .readout-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .footerbar { padding: 0 14px; }
}
@media (max-width: 540px) {
  .topbar { padding: 0 12px; }
  .brand-name { font-size: 9px; letter-spacing: .12em; }
  .brand-name span { font-size: 8px; }
  .brand-sub { font-size: 7px; }
  .brand-mark { transform: scale(.9) skew(-14deg); }
  .topbar-right { gap: 10px; font-size: 7px; }
  .seed-label { padding-left: 9px; }
  .workspace { padding: 8px; gap: 9px; }
  .scene-frame { height: 47vh; min-height: 330px; max-height: 440px; border-radius: 6px; }
  .scene-topline { top: 12px; left: 12px; right: 12px; }
  .scene-kicker, .scene-scale { font-size: 6px; }
  .scene-title-block { top: 48px; left: 14px; }
  .scene-title-block h1 { font-size: 36px; }
  .scene-title-block p { max-width: 180px; font-size: 9px; }
  .callout { font-size: 6px; gap: 4px; }
  .callout-line { width: 12px; }
  .callout-a { left: 8%; top: 47%; }
  .callout-b { right: 4%; top: 34%; }
  .callout-c { right: 5%; bottom: 25%; }
  .scene-bottomline { left: 12px; right: 12px; bottom: 10px; }
  .scene-hint, .sim-clock { font-size: 6px; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
  .readout-card { padding: 9px 10px 8px; }
  .readout-label { font-size: 7px; }
  .readout-value { margin-top: 5px; }
  .readout-value strong { font-size: 22px; }
  .readout-foot { margin-top: 6px; font-size: 6px; }
  .readout-foot em { display: inline; font-size: 5px; }
  .validation-strip { min-height: 48px; padding: 7px 9px; gap: 7px; }
  .validation-copy strong { font-size: 6px; }
  .validation-copy span { font-size: 7px; }
  .validation-tag { font-size: 6px; padding: 3px 5px; }
  .control-column { padding: 12px; }
  .panel-heading h2 { font-size: 23px; }
  .preset-button { gap: 4px; padding: 8px 4px; }
  .preset-icon { flex-basis: 14px; font-size: 15px; }
  .preset-button strong { font-size: 7px; }
  .preset-button small { font-size: 6px; }
  .control-list { grid-template-columns: 1fr; }
  .control-list .section-label { grid-column: auto; }
  .range-control { margin-bottom: 13px; }
  .range-top label { font-size: 9px; }
  .range-top output { font-size: 8px; }
  .transport-row { grid-template-columns: 1fr 1fr 36px; }
  .utility-row { gap: 8px; }
  .segmented button { min-width: 29px; padding: 5px 6px; }
  .footerbar { min-height: 26px; padding: 0 10px; font-size: 6px; }
  .footerbar span:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.embed-mode .topbar, .embed-mode .footerbar { display: none; }
.embed-mode .workspace { padding-top: 8px; }
.embed-mode .scene-frame { height: min(72vh, 760px); }
.embed-mode .scene-title-block { display: none; }
@media (max-width: 820px) { .embed-mode .scene-frame { height: 56vh; } }
