:root {
  color-scheme: dark;
  --bg: #0d1210;
  --panel: #141b17;
  --panel-2: #19221c;
  --line: rgba(218, 228, 214, .10);
  --line-strong: rgba(218, 228, 214, .18);
  --text: #edf0e8;
  --muted: #98a49a;
  --soft: #718078;
  --accent: #c9d9bd;
  --accent-bright: #d9edc7;
  --teal: #82c9b8;
  --sand: #c5a47b;
  --gold: #d9bb8c;
  --danger: #e2a68f;
  --radius: 12px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-width: 320px; overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a: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 15% -20%, rgba(94, 126, 97, .12), transparent 45%), var(--bg); }
.topbar { height: 64px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(12, 17, 14, .92); position: relative; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.brand-mark i { display: block; width: 6px; height: 15px; border: 1px solid #b9d0ae; border-radius: 100% 100% 40% 40%; transform: rotate(-25deg); position: absolute; }
.brand-mark i:nth-child(1) { transform: rotate(-42deg) translateX(-5px); opacity: .6; }
.brand-mark i:nth-child(2) { transform: rotate(0deg) translateY(-1px); }
.brand-mark i:nth-child(3) { transform: rotate(42deg) translateX(5px); opacity: .8; }
.brand-name { font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.brand-name span { color: #819087; font-weight: 500; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: #9ba89f; font-size: 9px; letter-spacing: .15em; font-weight: 700; }
.live-dot, .status-pip, .data-live i { width: 6px; height: 6px; border-radius: 50%; background: #a9c58e; box-shadow: 0 0 10px rgba(169, 197, 142, .6); }
.topbar-divider { height: 13px; width: 1px; background: var(--line-strong); margin: 0 4px; }
.seed-label { color: #6f7d73; }
.icon-button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: #b8c5b7; cursor: pointer; font-size: 12px; }
.icon-button:hover, .round-button:hover { background: rgba(201, 217, 189, .12); border-color: rgba(201, 217, 189, .35); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 370px; flex: 1; min-height: 0; height: calc(100vh - 64px); }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 16px 16px 14px 18px; gap: 10px; }
.stage { position: relative; flex: 1; min-height: 420px; overflow: hidden; border: 1px solid rgba(211, 224, 206, .13); border-radius: 15px; background: radial-gradient(ellipse at 50% 42%, #39443b 0%, #1c2721 45%, #101713 100%); isolation: isolate; }
#scene { width: 100%; height: 100%; display: block; position: absolute; inset: 0; z-index: 0; touch-action: none; }
.stage-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(7, 11, 9, .55) 0%, transparent 23%, transparent 62%, rgba(8, 13, 10, .64) 100%), linear-gradient(90deg, rgba(8, 12, 9, .35), transparent 35%, transparent 75%, rgba(8, 12, 9, .14)); }
.stage-heading { position: absolute; top: 27px; left: 30px; z-index: 2; pointer-events: none; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #a6b59f; font-size: 9px; letter-spacing: .18em; font-weight: 750; }
.eyebrow-line { display: inline-block; width: 18px; height: 1px; background: #c1d4b4; }
.stage-heading h1 { margin: 11px 0 4px; font-size: clamp(30px, 3.3vw, 46px); letter-spacing: -.055em; line-height: 1; font-weight: 550; }
.stage-heading h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; color: #d4dfc8; }
.stage-heading p { margin: 8px 0 0; color: #a7b1a8; font-size: 11px; letter-spacing: .01em; }
.stage-status { position: absolute; top: 30px; right: 28px; z-index: 2; display: flex; align-items: center; gap: 8px; color: #c0cbbd; font-size: 8px; font-weight: 750; letter-spacing: .16em; }
.stage-annotations { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.annotation { position: absolute; display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid rgba(218, 228, 214, .14); background: rgba(12, 18, 14, .5); backdrop-filter: blur(8px); border-radius: 5px; color: #b5c2b3; font-size: 8px; letter-spacing: .13em; font-weight: 700; white-space: nowrap; }
.annotation-number { color: #d4b88d; font-family: Georgia, serif; font-size: 12px; }
.annotation-a { top: 27%; left: 8%; }
.annotation-b { top: 49%; right: 8%; }
.annotation-c { bottom: 26%; left: 38%; }
.stage-legend { position: absolute; left: 28px; bottom: 70px; z-index: 2; display: flex; gap: 15px; color: #c0c9bd; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.stage-legend span { display: flex; align-items: center; gap: 6px; }
.stage-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.legend-water { background: #73b8aa; box-shadow: 0 0 8px rgba(115,184,170,.55); }
.legend-mineral { background: #e1e5d4; }
.legend-sand { background: #b79265; }
.stage-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; min-height: 55px; padding: 10px 18px 11px 28px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid rgba(218, 228, 214, .12); background: rgba(9, 14, 11, .67); backdrop-filter: blur(10px); }
.transport-copy { display: flex; flex-direction: column; gap: 4px; color: #9ca89c; font-size: 9px; }
.transport-kicker { color: #c5d5b7; font-size: 8px; letter-spacing: .16em; font-weight: 800; }
.stage-actions { display: flex; align-items: center; gap: 7px; }
.round-button { width: 30px; height: 30px; border: 1px solid rgba(221, 231, 215, .2); border-radius: 8px; display: grid; place-items: center; background: rgba(18, 27, 21, .8); color: #c9d5c6; cursor: pointer; transition: background .18s, border-color .18s; }
.round-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.quality-glyph { font-size: 9px; font-weight: 850; letter-spacing: -.04em; }
.webgl-message { position: absolute; z-index: 6; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(330px, calc(100% - 40px)); padding: 18px; border: 1px solid rgba(221,231,215,.2); border-radius: 12px; background: rgba(13,19,15,.94); box-shadow: 0 16px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 8px; text-align: center; }
.webgl-message strong { font-size: 13px; }
.webgl-message span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.context-message { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 7; padding: 10px 14px; border-radius: 8px; background: rgba(13,19,15,.92); border: 1px solid var(--line-strong); color: #d4dcca; font-size: 11px; }
.timeline-bar { height: 30px; display: flex; align-items: center; gap: 12px; padding: 0 6px; color: #89978d; }
.timeline-title { display: flex; align-items: center; gap: 6px; font-size: 8px; font-weight: 800; letter-spacing: .14em; white-space: nowrap; }
.timeline-icon { font-size: 14px; color: #c1d1b5; }
.timeline-track { position: relative; flex: 1; height: 2px; background: rgba(205, 220, 199, .13); border-radius: 10px; }
.timeline-fill { height: 100%; width: 0%; background: #a6c291; box-shadow: 0 0 8px rgba(166,194,145,.35); border-radius: inherit; }
.timeline-marker { position: absolute; left: 0%; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: #d3e4c3; transform: translate(-50%,-50%); box-shadow: 0 0 9px rgba(211,228,195,.6); }
.timeline-value { min-width: 75px; text-align: right; color: #c0cbbd; font-size: 9px; font-weight: 750; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.control-column { min-height: 0; overflow: hidden; background: linear-gradient(180deg, rgba(22,30,24,.98), rgba(16,23,18,.98)); border-left: 1px solid var(--line); }
.panel-scroll { height: 100%; overflow: auto; padding: 23px 20px 18px; scrollbar-width: thin; scrollbar-color: #455348 transparent; }
.panel-section { padding-bottom: 19px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.035em; font-weight: 620; }
.model-chip { color: #b9c9ae; background: rgba(160, 188, 139, .09); border: 1px solid rgba(160,188,139,.18); border-radius: 5px; padding: 5px 7px; font-size: 7px; font-weight: 850; letter-spacing: .13em; }
.preset-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.preset-button { min-height: 51px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.018); border-radius: 8px; color: #a8b4a9; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding: 7px 9px; font-size: 9px; font-weight: 650; transition: border-color .18s, background .18s, color .18s; }
.preset-button:hover { border-color: rgba(201,217,189,.4); color: var(--text); }
.preset-button.active { border-color: rgba(184,211,164,.52); background: rgba(159,189,137,.11); color: #e2ead9; }
.preset-symbol { color: #c9d9bd; font-size: 13px; line-height: 1; }
.preset-description { min-height: 27px; margin: 9px 0 13px; color: #839188; font-size: 9px; line-height: 1.45; }
.control-list { display: flex; flex-direction: column; gap: 13px; }
.control-item { display: flex; flex-direction: column; gap: 6px; }
.control-item-last { padding-bottom: 1px; }
.control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.control-label label { color: #c5cec2; font-size: 10px; font-weight: 600; }
.control-label output { color: #dce8d2; font-size: 9px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, #a5bd91 0%, #718c70 55%, #3a4a3f 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, #a5bd91 0%, #718c70 55%, #3a4a3f 100%); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; border: 2px solid #dce9d1; background: #8eaa7c; box-shadow: 0 0 0 3px rgba(142,170,124,.14); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #dce9d1; background: #8eaa7c; box-shadow: 0 0 0 3px rgba(142,170,124,.14); }
.range-ends { display: flex; justify-content: space-between; color: #68766d; font-size: 8px; font-variant-numeric: tabular-nums; }
.compact-heading { margin-bottom: 12px; }
.compact-heading h2 { font-size: 15px; }
.playback-section { padding-bottom: 16px; }
.playback-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; }
.primary-button, .secondary-button { height: 36px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 10px; font-weight: 750; transition: background .18s, border-color .18s, transform .18s; }
.primary-button { border: 1px solid rgba(197,220,176,.5); background: linear-gradient(135deg, #a9c293, #78956f); color: #10170f; }
.primary-button:hover { background: linear-gradient(135deg, #c0d7ab, #8ea983); }
.secondary-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #c1cdc0; }
.secondary-button:hover { background: rgba(201,217,189,.08); border-color: rgba(201,217,189,.35); }
.play-icon { font-size: 12px; line-height: 1; }
.reset-button { color: #aab6a9; }
.speed-row { display: flex; align-items: center; gap: 10px; margin-top: 11px; }
.speed-row label { color: #738177; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.speed-row select { min-width: 67px; height: 25px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 5px; background: #18211b; color: #d7e2d1; font-size: 9px; }
.speed-row span { margin-left: auto; color: #748178; font-size: 8px; }
.data-section { padding-bottom: 15px; }
.data-live { display: inline-flex; align-items: center; gap: 5px; color: #91b18a; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.data-live i { width: 5px; height: 5px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-height: 77px; border: 1px solid rgba(220,230,216,.10); border-radius: 8px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); padding: 9px 10px; display: flex; flex-direction: column; justify-content: space-between; }
.readout-label { color: #8b998e; font-size: 7px; letter-spacing: .09em; font-weight: 800; }
.readout-label b { color: #68796d; font-size: 6px; margin-left: 2px; font-weight: 700; }
.readout-card strong { font-size: 20px; line-height: 1; letter-spacing: -.045em; color: #e0e8d9; font-variant-numeric: tabular-nums; font-weight: 550; }
.readout-unit { color: #7d8a80; font-size: 8px; }
.secondary-metrics { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; color: #7c897f; font-size: 8px; }
.secondary-metrics span { display: flex; justify-content: space-between; gap: 8px; }
.secondary-metrics b { color: #b5c2b2; font-weight: 650; font-variant-numeric: tabular-nums; }
.science-section { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.014); }
.science-toggle { width: 100%; min-height: 55px; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; }
.science-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: rgba(170,196,148,.1); color: #c3d8b1; font-family: Georgia,serif; font-size: 16px; }
.science-toggle span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.science-toggle b { font-size: 10px; font-weight: 750; }
.science-toggle small { color: #7e8b81; font-size: 8px; }
.chevron { margin-left: auto; color: #8f9c90; font-size: 17px; transition: transform .2s; }
.science-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid var(--line); padding: 13px 12px 12px; }
.science-block { margin-bottom: 14px; }
.science-block h3 { margin: 0 0 6px; color: #c9d6c2; font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.science-block p { margin: 0 0 7px; color: #9aa79b; font-size: 9px; line-height: 1.55; }
.equation { margin: 7px 0; padding: 9px 8px; border-radius: 6px; background: rgba(4,9,6,.42); border: 1px solid rgba(219,230,213,.08); color: #dce8d3; font-family: Georgia,serif; font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.validation-card { margin: 12px 0 14px; padding: 10px; border: 1px solid rgba(148,190,132,.22); border-radius: 8px; background: rgba(115,153,102,.07); }
.validation-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #a9bd9e; font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.validation-pass { padding: 3px 5px; border-radius: 4px; background: rgba(143,190,125,.14); color: #b9d5a9; }
.validation-card p { margin: 7px 0 10px; color: #8f9f90; font-size: 8px; line-height: 1.4; }
.validation-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.validation-values div { display: flex; flex-direction: column; gap: 4px; }
.validation-values small { color: #718176; font-size: 6px; font-weight: 800; letter-spacing: .12em; }
.validation-values b { color: #d9e5d1; font-size: 10px; font-variant-numeric: tabular-nums; }
.validation-foot { display: block; margin-top: 8px; color: #77867a; font-size: 7px; line-height: 1.4; }
.assumptions-block ul { margin: 6px 0 0; padding-left: 14px; color: #89968b; font-size: 8px; line-height: 1.55; }
.assumptions-block li { margin-bottom: 4px; }
.source-note { padding-top: 9px; border-top: 1px solid var(--line); color: #77847a; font-size: 8px; line-height: 1.5; }
.source-note b { color: #aab8a8; }
.disclaimer { margin: 11px 2px 0; color: #68756c; font-size: 7px; line-height: 1.4; text-align: center; }
body.embed-mode { overflow: hidden; }
body.embed-mode .topbar { display: none; }
body.embed-mode .workspace { height: 100vh; }
body.embed-mode .stage-column { padding: 0; }
body.embed-mode .stage { border-radius: 0; border: 0; }
body.embed-mode .control-column { border-radius: 0; }
@media (max-width: 1080px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .panel-scroll { padding-left: 16px; padding-right: 16px; }
  .stage-heading { left: 24px; }
  .stage-legend { left: 24px; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .app-shell { min-height: 100dvh; }
  .topbar { height: 54px; min-height: 54px; padding: 0 15px; }
  .topbar-meta { font-size: 8px; gap: 7px; }
  .workspace { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - 54px); }
  .stage-column { padding: 10px 10px 8px; gap: 7px; }
  .stage { flex: none; height: min(52vh, 440px); min-height: 320px; border-radius: 11px; }
  .stage-heading { top: 18px; left: 18px; }
  .stage-heading h1 { font-size: 33px; }
  .stage-heading p { max-width: 230px; font-size: 9px; }
  .stage-status { top: 20px; right: 15px; font-size: 7px; }
  .annotation { font-size: 6px; padding: 4px 5px; gap: 4px; }
  .annotation-a { left: 4%; top: 31%; }
  .annotation-b { right: 3%; top: 52%; }
  .annotation-c { left: 35%; bottom: 24%; }
  .stage-legend { left: 16px; bottom: 67px; gap: 9px; font-size: 6px; }
  .stage-bottom { min-height: 51px; padding: 8px 10px 8px 16px; }
  .transport-copy { max-width: calc(100% - 120px); font-size: 7px; }
  .transport-kicker { font-size: 7px; }
  .round-button { width: 27px; height: 27px; }
  .timeline-bar { padding: 0 3px; }
  .control-column { overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  .panel-scroll { height: auto; overflow: visible; padding: 17px 14px 24px; }
  .simulation-section { padding-bottom: 16px; }
  .preset-button { min-height: 48px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 13px; }
  .control-item-last { padding-bottom: 0; }
  .playback-row { grid-template-columns: 1.2fr 1fr 1fr; }
  .readout-card { min-height: 75px; }
  .science-content { padding: 12px; }
  body.embed-mode .workspace { min-height: 100vh; }
  body.embed-mode .stage { height: 100vh; }
  body.embed-mode .control-column { display: none; }
  body.embed-mode .timeline-bar { display: none; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 9px; letter-spacing: .13em; }
  .topbar-meta { letter-spacing: .08em; }
  .seed-label, .topbar-divider { display: none; }
  .top-help { width: 25px; height: 25px; }
  .stage { min-height: 305px; height: 43vh; }
  .stage-heading h1 { font-size: 29px; }
  .stage-heading p { max-width: 195px; }
  .stage-status { font-size: 6px; top: 21px; }
  .annotation { font-size: 5px; letter-spacing: .08em; }
  .annotation-number { font-size: 10px; }
  .stage-legend { gap: 7px; font-size: 5px; }
  .transport-copy { font-size: 6px; }
  .transport-kicker { font-size: 6px; }
  .timeline-title { font-size: 7px; }
  .timeline-value { font-size: 8px; min-width: 68px; }
  .panel-scroll { padding-left: 12px; padding-right: 12px; }
  .section-heading h2 { font-size: 16px; }
  .preset-button { padding: 7px 6px; font-size: 8px; }
  .control-list { column-gap: 10px; }
  .control-label label { font-size: 9px; }
  .control-label output { font-size: 8px; }
  .range-ends { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
