:root {
  color-scheme: dark;
  --bg: #0b1117;
  --panel: #121b23;
  --panel-2: #16212b;
  --line: rgba(173, 194, 204, .13);
  --muted: #82919a;
  --text: #e9eeeb;
  --sand: #d6b184;
  --sand-bright: #f0c993;
  --cyan: #7ac8c4;
  --green: #a3c8a6;
  --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 { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; font-size: 13px; letter-spacing: .01em; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { max-width: 1680px; margin: 0 auto; padding: 0 26px 18px; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 31px; height: 31px; border: 1px solid rgba(214,177,132,.5); border-radius: 9px; display: grid; place-items: center; color: var(--sand-bright); font-family: Georgia, serif; font-size: 22px; font-style: italic; box-shadow: inset 0 0 18px rgba(214,177,132,.1); }
.eyebrow, .section-kicker, .micro-label, .hud-label, .readout-heading, .scene-badge, .control-label-row label, .slider-head output, .range-hints, .speed-control label, .quality-row, .app-footer, .seed-label { font-size: 9px; letter-spacing: .14em; font-weight: 750; }
.eyebrow { color: #8b9ba3; margin-bottom: 3px; }
.brand-title { font-size: 15px; letter-spacing: .12em; font-weight: 850; }
.brand-title span { color: var(--sand); font-weight: 500; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: #85959d; font-size: 9px; letter-spacing: .13em; font-weight: 700; }
.live-dot, .readout-live i { width: 6px; height: 6px; border-radius: 50%; background: #9dcba4; box-shadow: 0 0 0 4px rgba(157,203,164,.1); }
.meta-divider { height: 14px; width: 1px; background: var(--line); margin: 0 5px; }
.seed-label { color: #667781; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: #121b23; color: #b9c5c6; font-size: 16px; cursor: pointer; transition: background .2s, border-color .2s; }
.icon-button:hover { background: #1a2832; border-color: rgba(122,200,196,.4); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 376px; gap: 20px; padding-top: 19px; align-items: start; }
.scene-column { min-width: 0; }
.scene-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 0 2px 14px; }
.section-kicker { color: #84949b; }
.section-kicker span { color: var(--sand); padding: 0 3px; }
h1 { font-size: clamp(21px, 2vw, 29px); line-height: 1.12; letter-spacing: -.035em; margin: 7px 0 5px; font-weight: 670; }
.scene-subtitle { margin: 0; color: #8e9ba0; font-size: 12px; }
.scene-badges { display: flex; gap: 7px; flex-shrink: 0; padding-bottom: 3px; }
.scene-badge { border: 1px solid rgba(122,200,196,.2); color: #a5d0c8; padding: 7px 9px; border-radius: 20px; font-size: 8px; white-space: nowrap; }
.scene-badge.muted { border-color: var(--line); color: #829098; }
.badge-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #7ac8c4; margin-right: 5px; vertical-align: 1px; }
.scene-frame { height: clamp(430px, calc(100vh - 250px), 640px); min-height: 430px; position: relative; overflow: hidden; border: 1px solid rgba(166,184,187,.16); border-radius: 15px; background: radial-gradient(ellipse at 50% 40%, #27333a 0%, #18232b 45%, #101920 100%); box-shadow: 0 22px 70px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.04); }
.scene-mount { position: absolute; inset: 0; z-index: 1; }
.scene-mount canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.scene-vignette { pointer-events: none; position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, rgba(9,15,20,.38), transparent 24%, transparent 65%, rgba(8,13,17,.42)); }
.scene-hud { position: absolute; z-index: 3; pointer-events: none; }
.hud-top-left { left: 18px; top: 17px; }
.hud-top-right { right: 18px; top: 17px; text-align: right; }
.hud-label { color: #91a2a4; font-size: 8px; }
.wind-readout, .clock-readout { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }
.hud-top-right .clock-readout { justify-content: flex-end; }
.wind-readout strong, .clock-readout strong { font-size: 21px; font-weight: 620; letter-spacing: -.04em; color: #f0dfc8; font-variant-numeric: tabular-nums; }
.wind-readout span:last-child, .clock-readout span { font-size: 10px; color: #b2b9b4; }
.wind-arrow { color: var(--sand-bright); font-size: 17px; }
.hud-caption { color: #84969b; font-size: 8px; letter-spacing: .13em; margin-top: 2px; }
.hud-bottom-left { bottom: 16px; left: 17px; display: grid; gap: 7px; }
.legend-item { display: flex; align-items: center; gap: 7px; color: #c0c9c5; font-size: 9px; text-shadow: 0 1px 5px #111; }
.legend-item small { color: #84949a; font-size: 8px; }
.legend-grain { width: 6px; height: 6px; background: #f0c993; border-radius: 50%; box-shadow: 0 0 8px rgba(240,201,147,.6); }
.legend-facet { width: 10px; height: 7px; background: #c79b6d; transform: skew(-25deg); }
.legend-shadow { width: 10px; height: 7px; background: #59636a; border-radius: 2px; }
.hud-bottom-right { bottom: 16px; right: 17px; display: flex; align-items: center; gap: 13px; }
.orbit-hint { color: #9aabae; font-size: 8px; letter-spacing: .1em; text-shadow: 0 1px 5px #111; }
.orbit-hint b { color: var(--sand); padding: 0 4px; }
.camera-button { pointer-events: auto; border: 1px solid rgba(190,204,198,.23); border-radius: 7px; background: rgba(13,21,27,.72); padding: 7px 9px; color: #c6d0cb; font-size: 12px; cursor: pointer; backdrop-filter: blur(8px); }
.camera-button span { font-size: 8px; letter-spacing: .1em; margin-left: 4px; }
.annotation { position: absolute; left: 0; top: 0; z-index: 4; display: flex; align-items: center; gap: 6px; color: #e6d1b3; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-shadow: 0 1px 5px #10161b; pointer-events: none; transition: opacity .3s; }
.annotation-line { width: 24px; height: 1px; background: var(--sand); box-shadow: 0 0 6px rgba(214,177,132,.5); }
.annotation-facet { top: 44%; left: 16%; }
.annotation-shadow { top: 66%; right: 17%; color: #b3c0c1; }
.annotation-shadow .annotation-line { background: #8c9da1; }
.loading-overlay, .context-overlay { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 13px; background: rgba(12,19,25,.9); color: #aab7b6; font-size: 9px; letter-spacing: .16em; font-weight: 800; }
.loading-overlay[hidden], .context-overlay[hidden] { display: none; }
.loader-ring { width: 28px; height: 28px; border: 2px solid rgba(214,177,132,.18); border-top-color: var(--sand); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.context-overlay { z-index: 9; background: rgba(9,15,20,.94); text-align: center; padding: 24px; letter-spacing: 0; }
.context-overlay strong { color: #e7e8e1; font-size: 14px; letter-spacing: 0; }
.context-overlay span { color: #8d9ca0; font-size: 11px; max-width: 280px; line-height: 1.5; font-weight: 450; }
.context-symbol { color: var(--sand); font-size: 27px; }
.scene-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 3px 0; }
.cause-chain { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chain-step { color: #718189; font-size: 8px; letter-spacing: .11em; font-weight: 750; }
.chain-step b { color: #a1b0ad; margin-right: 3px; }
.chain-step.active { color: var(--sand-bright); }
.chain-step.active b { color: var(--sand-bright); }
.chain-arrow { color: #4d5b61; font-size: 10px; }
.footer-note { color: #65757d; font-size: 8px; letter-spacing: .11em; text-align: right; }
.control-column { min-width: 0; display: grid; gap: 12px; }
.control-card, .readout-card { background: linear-gradient(145deg, rgba(23,34,43,.98), rgba(16,25,33,.98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 36px rgba(0,0,0,.13); }
.primary-card { padding: 17px 17px 13px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.card-heading h2 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.025em; font-weight: 650; }
.status-pill { border: 1px solid rgba(146,193,153,.22); border-radius: 20px; padding: 5px 8px; color: #a9c8aa; font-size: 8px; letter-spacing: .11em; font-weight: 800; }
.status-pill i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #9ccba3; margin-right: 4px; vertical-align: 1px; }
.status-pill.paused { border-color: rgba(214,177,132,.24); color: var(--sand); }
.status-pill.paused i { background: var(--sand); }
.preset-block { margin-bottom: 15px; }
.control-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.control-label-row label { color: #a3b0b1; }
.micro-label { color: #64757c; font-size: 8px; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 7px 9px; border: 1px solid rgba(170,190,191,.1); border-radius: 9px; background: rgba(10,17,23,.3); text-align: left; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.preset-button:hover { background: rgba(214,177,132,.07); border-color: rgba(214,177,132,.25); }
.preset-button.active { border-color: rgba(214,177,132,.43); background: linear-gradient(90deg, rgba(214,177,132,.12), rgba(214,177,132,.035)); }
.preset-icon { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; background: rgba(214,177,132,.1); color: var(--sand-bright); font-size: 15px; }
.preset-button b { display: block; font-size: 10px; color: #dce2dc; font-weight: 650; }
.preset-button small { display: block; margin-top: 2px; color: #7f9095; font-size: 9px; }
.control-divider { height: 1px; background: var(--line); margin: 13px 0; }
.sliders-title { margin-bottom: 11px; }
.slider-control { margin: 0 0 12px; }
.slider-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 7px; }
.slider-head label { font-size: 10px; color: #c6d0ca; font-weight: 560; }
.slider-head output { color: #ead2af; font-size: 10px; letter-spacing: .015em; font-variant-numeric: tabular-nums; }
.slider-head output small { color: #87979a; font-size: 8px; font-weight: 550; letter-spacing: .02em; }
input[type="range"] { display: block; width: 100%; height: 4px; appearance: none; -webkit-appearance: none; background: linear-gradient(90deg, #c5a47b 0%, #c5a47b 35%, #3b4a51 35%, #3b4a51 100%); border-radius: 4px; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #e5c49a; border: 2px solid #17232b; box-shadow: 0 0 0 1px rgba(229,196,154,.7), 0 0 9px rgba(229,196,154,.3); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #e5c49a; border: 2px solid #17232b; box-shadow: 0 0 0 1px rgba(229,196,154,.7); }
.range-hints { display: flex; justify-content: space-between; color: #5f7077; font-size: 7px; letter-spacing: .1em; margin-top: 6px; font-weight: 650; }
.compact-slider { margin-bottom: 11px; }
.last-slider { margin-bottom: 0; }
.transport-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.transport-main { display: flex; gap: 6px; }
.transport-button { height: 34px; min-width: 36px; border: 1px solid rgba(169,190,190,.16); border-radius: 8px; background: #182630; color: #c4cfca; cursor: pointer; font-size: 14px; transition: background .2s, border-color .2s; }
.transport-button:hover { background: #22343e; border-color: rgba(122,200,196,.35); }
.play-button { min-width: 87px; display: flex; align-items: center; justify-content: center; gap: 7px; background: #d4b185; border-color: #d4b185; color: #1b2428; font-size: 9px; letter-spacing: .1em; font-weight: 850; }
.play-button:hover { background: #e2c49e; border-color: #e2c49e; }
.play-button span:first-child { font-size: 13px; }
.speed-control { display: flex; align-items: center; gap: 7px; }
.speed-control label { color: #74858a; font-size: 8px; }
.speed-control select { background: #101a21; border: 1px solid rgba(169,190,190,.17); border-radius: 7px; color: #cbd3cd; padding: 7px 7px; font-size: 9px; outline-offset: 2px; }
.quality-row { display: flex; align-items: center; gap: 8px; color: #718188; font-size: 8px; margin-top: 12px; }
.segmented { display: flex; padding: 2px; border: 1px solid rgba(169,190,190,.13); border-radius: 7px; background: #0e171e; gap: 2px; }
.segmented button { border: 0; border-radius: 5px; padding: 4px 7px; background: transparent; color: #7f9096; font-size: 8px; letter-spacing: .08em; cursor: pointer; }
.segmented button.selected { background: #293941; color: #e3d1b7; }
.export-button { margin-left: auto; border: 1px solid rgba(169,190,190,.16); border-radius: 7px; padding: 5px 8px; background: #182630; color: #b9c9c5; cursor: pointer; font-size: 12px; }
.export-button span { font-size: 8px; font-weight: 800; letter-spacing: .1em; margin-left: 3px; }
.readout-card { padding: 13px 15px 11px; }
.readout-heading { display: flex; justify-content: space-between; align-items: center; color: #a4b1ae; font-size: 8px; }
.readout-live { color: #86b9a1; font-size: 7px; display: flex; align-items: center; gap: 6px; }
.readout-live i { width: 5px; height: 5px; box-shadow: none; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 10px -2px 9px; }
.readout-cell { padding: 8px 7px 7px; border-top: 1px solid rgba(173,194,204,.09); }
.readout-cell:nth-child(odd) { border-right: 1px solid rgba(173,194,204,.09); }
.readout-cell span { display: block; color: #718188; font-size: 7px; letter-spacing: .1em; font-weight: 750; }
.readout-cell strong { display: block; margin-top: 4px; color: #e7d2b3; font-size: 19px; letter-spacing: -.04em; font-weight: 620; font-variant-numeric: tabular-nums; }
.readout-cell small { display: block; margin-top: 2px; color: #64757c; font-size: 7px; letter-spacing: .04em; }
.validation-strip { display: flex; align-items: center; gap: 8px; padding-top: 9px; border-top: 1px solid rgba(173,194,204,.1); }
.validation-icon { width: 20px; height: 20px; display: grid; place-items: center; flex-shrink: 0; border-radius: 6px; color: #a5c7a5; background: rgba(145,190,149,.12); font-size: 12px; }
.validation-copy { min-width: 0; flex: 1; }
.validation-copy b { display: block; color: #a7c6a7; font-size: 8px; letter-spacing: .1em; }
.validation-copy span { display: block; color: #7e8e91; font-size: 8px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.validation-strip button { width: 23px; height: 23px; border: 1px solid rgba(173,194,204,.14); border-radius: 6px; background: #18252d; color: #aab9b6; cursor: pointer; }
.validation-detail { padding: 9px 4px 1px 28px; display: grid; gap: 6px; }
.validation-detail[hidden] { display: none; }
.validation-detail div { display: flex; justify-content: space-between; gap: 12px; color: #839397; font-size: 9px; }
.validation-detail b { color: #d7e0d8; font-variant-numeric: tabular-nums; }
.validation-detail small { color: #687a80; font-size: 8px; line-height: 1.5; margin-top: 3px; }
.science-drawer { margin-top: 17px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #15212a, #101920); animation: drawer-in .25s ease-out; }
.science-drawer[hidden] { display: none; }
@keyframes drawer-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.science-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.science-drawer h2 { font-size: 20px; margin: 5px 0 0; letter-spacing: -.03em; }
.close-science { font-size: 22px; }
.science-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.science-grid article { border-top: 1px solid rgba(214,177,132,.27); padding-top: 11px; }
.science-number { color: var(--sand); font-size: 8px; letter-spacing: .12em; }
.science-grid h3 { margin: 5px 0 5px; font-size: 13px; }
.science-grid p, .science-footnotes p { margin: 0; color: #91a0a1; font-size: 10px; line-height: 1.6; }
.equation-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; padding: 13px; background: rgba(5,12,17,.34); border: 1px solid rgba(173,194,204,.09); border-radius: 9px; }
.equation-label { display: block; color: #7e9295; font-size: 8px; letter-spacing: .1em; font-weight: 750; margin-bottom: 7px; }
.equation-panel code { display: block; color: #e3c69e; font-size: 12px; white-space: normal; }
.equation-panel small { display: block; margin-top: 6px; color: #73848a; font-size: 8px; }
.science-footnotes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 13px; }
.science-footnotes b { color: #c9d2cb; }
.disclaimer { color: #718188; font-size: 8px; margin: 13px 0 0; }
.app-footer { display: flex; justify-content: space-between; color: #53646b; font-size: 7px; padding: 16px 2px 0; letter-spacing: .13em; }
.app-footer b { color: #927d62; padding: 0 3px; }
body.embed .app-shell { padding: 0; }
body.embed .topbar, body.embed .app-footer { display: none; }
body.embed .workspace { padding-top: 0; grid-template-columns: minmax(0, 1fr) 330px; }
body.embed .scene-header { padding-top: 12px; }
body.embed .scene-frame { border-radius: 0 0 12px 12px; }
body.embed .science-drawer { margin: 12px; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; } .scene-frame { height: min(66vh, 760px); } }
@media (max-width: 1100px) { .app-shell { padding: 0 16px 16px; } .workspace { grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; } .primary-card { padding: 14px; } .scene-frame { height: 520px; } }
@media (max-width: 820px) { .workspace { grid-template-columns: 1fr; } .scene-frame { height: min(70vw, 560px); min-height: 390px; } .control-column { grid-template-columns: minmax(0, 1fr) minmax(260px, .78fr); align-items: start; } .preset-grid { grid-template-columns: repeat(3, 1fr); } .preset-button { align-items: flex-start; gap: 6px; min-height: 68px; padding: 8px 6px; } .preset-icon { flex-shrink: 0; } .preset-button b { font-size: 9px; } .preset-button small { font-size: 8px; } .scene-header { align-items: flex-start; } }
@media (max-width: 600px) {
  .app-shell { padding: 0 10px 14px; }
  .topbar { height: 55px; }
  .brand-mark { width: 28px; height: 28px; }
  .topbar-meta { display: none; }
  .workspace { padding-top: 12px; gap: 12px; }
  .scene-header { padding: 0 2px 10px; gap: 7px; }
  .section-kicker { font-size: 8px; }
  h1 { font-size: 21px; margin-top: 5px; }
  .scene-subtitle { font-size: 10px; }
  .scene-badges { flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 3px; }
  .scene-badge { padding: 5px 7px; font-size: 7px; }
  .scene-frame { height: min(112vw, 510px); min-height: 360px; border-radius: 11px; }
  .hud-top-left { left: 11px; top: 12px; }
  .hud-top-right { right: 11px; top: 12px; }
  .wind-readout strong, .clock-readout strong { font-size: 18px; }
  .hud-caption { font-size: 7px; }
  .hud-bottom-left { left: 11px; bottom: 12px; gap: 5px; }
  .legend-item { font-size: 8px; }
  .legend-item small { font-size: 7px; }
  .hud-bottom-right { right: 10px; bottom: 11px; }
  .orbit-hint { display: none; }
  .camera-button { padding: 6px 7px; }
  .annotation { font-size: 7px; }
  .annotation-facet { left: 7%; top: 43%; }
  .annotation-shadow { right: 7%; top: 65%; }
  .annotation-line { width: 15px; }
  .scene-footer { padding-top: 9px; align-items: flex-start; }
  .cause-chain { gap: 5px; }
  .chain-step { font-size: 7px; }
  .chain-arrow { font-size: 8px; }
  .footer-note { max-width: 88px; font-size: 7px; line-height: 1.4; }
  .control-column { grid-template-columns: 1fr; }
  .primary-card { padding: 14px 13px 12px; }
  .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .preset-button { min-height: 66px; flex-direction: column; align-items: flex-start; padding: 7px; gap: 5px; }
  .preset-icon { width: 21px; height: 21px; font-size: 13px; }
  .preset-button b { font-size: 8px; line-height: 1.25; }
  .preset-button small { font-size: 7px; line-height: 1.25; }
  .slider-control { margin-bottom: 13px; }
  .slider-head label { font-size: 11px; }
  .slider-head output { font-size: 11px; }
  input[type="range"] { height: 5px; }
  input[type="range"]::-webkit-slider-thumb { width: 14px; height: 14px; }
  .transport-row { flex-wrap: wrap; }
  .transport-button { height: 38px; min-width: 40px; }
  .play-button { min-width: 92px; }
  .quality-row { margin-top: 13px; }
  .readout-card { padding: 13px; }
  .readout-cell strong { font-size: 21px; }
  .science-drawer { padding: 16px 14px; }
  .science-grid { grid-template-columns: 1fr; gap: 12px; }
  .science-grid article { padding-top: 9px; }
  .equation-panel, .science-footnotes { grid-template-columns: 1fr; gap: 12px; }
  .equation-panel code { font-size: 11px; }
  .app-footer { gap: 8px; line-height: 1.5; font-size: 6px; }
  body.embed .workspace { grid-template-columns: 1fr; }
  body.embed .scene-header { padding: 10px 12px; }
  body.embed .scene-frame { height: min(95vw, 500px); min-height: 340px; border-radius: 0 0 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .loader-ring { animation: none; border-top-color: var(--sand); }
}
