:root {
  color-scheme: dark;
  --bg: #07131a;
  --panel: #0c1b23;
  --panel-2: #10242d;
  --line: rgba(160, 204, 215, .13);
  --muted: #8299a3;
  --text: #e9f2f3;
  --cyan: #59d7df;
  --cyan-soft: rgba(89, 215, 223, .14);
  --amber: #f2b66e;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; 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, canvas:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 32% 0%, rgba(28, 78, 88, .22), transparent 40%), var(--bg); }
.topbar { height: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(6, 18, 24, .94); position: relative; z-index: 4; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 29px; height: 29px; border: 1px solid rgba(89,215,223,.45); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-8deg); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--cyan); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .75; }
.brand-name { font-size: 11px; letter-spacing: .16em; font-weight: 800; color: #e8f3f4; }
.brand-name span { color: #78919b; font-weight: 600; }
.brand-subtitle { margin-top: 4px; font-size: 8px; letter-spacing: .19em; color: #6e8993; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.live-indicator, .seed-chip { font-size: 9px; letter-spacing: .12em; color: #a8c0c5; }
.live-indicator { display: flex; align-items: center; gap: 7px; }
.live-indicator i { display: block; width: 6px; height: 6px; background: #70e4ba; border-radius: 50%; box-shadow: 0 0 10px rgba(112,228,186,.75); }
.seed-chip { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; color: #8fa7ae; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 350px; }
.stage-wrap { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #06141b; }
.stage { position: relative; flex: 1; min-height: 480px; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 50% 43%, #123b49 0%, #0a2632 44%, #06151d 100%); }
#sceneCanvas { width: 100%; height: 100%; display: block; touch-action: none; }
.stage-vignette { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,14,19,.32), transparent 45%, rgba(4,14,19,.08)), linear-gradient(0deg, rgba(4,14,19,.42), transparent 30%, rgba(4,14,19,.18)); z-index: 1; }
.scene-heading { position: absolute; top: 27px; left: 30px; max-width: 390px; z-index: 2; pointer-events: none; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.eyebrow { color: #79b8c0; font-size: 9px; font-weight: 750; letter-spacing: .2em; }
.scene-heading h1 { font-size: clamp(26px, 3vw, 42px); letter-spacing: -.045em; line-height: 1.04; margin: 10px 0 8px; font-weight: 650; }
.scene-heading h1 em { color: #78dce0; font-style: normal; font-weight: 420; }
.scene-heading p { color: #a8c1c6; font-size: 12px; line-height: 1.5; margin: 0; max-width: 330px; }
.process-chain { margin-top: 11px; color: #83aeb6; font-size: 7px; letter-spacing: .13em; font-weight: 700; text-shadow: 0 1px 10px rgba(0,0,0,.4); }
.process-chain b { color: #e9b87f; padding: 0 3px; font-size: 9px; }
.scene-tags { position: absolute; top: 30px; right: 26px; z-index: 2; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.scene-tags span { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: rgba(5,20,27,.52); border: 1px solid rgba(155,208,215,.14); border-radius: 5px; color: #b6cbd0; font-size: 8px; letter-spacing: .13em; backdrop-filter: blur(8px); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.cyan { background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.dot.amber { background: var(--amber); box-shadow: 0 0 9px var(--amber); }
.wind-indicator { position: absolute; left: 31px; bottom: 126px; z-index: 2; display: flex; align-items: center; gap: 9px; color: #a6c0c5; font-size: 8px; letter-spacing: .18em; pointer-events: none; }
.wind-arrow { color: #f2bd7c; font-size: 27px; line-height: 1; font-weight: 300; }
.stage-status { position: absolute; bottom: 126px; right: 27px; color: #84a4ad; z-index: 2; font-size: 8px; letter-spacing: .16em; pointer-events: none; }
.context-banner { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%,-50%); max-width: 360px; padding: 14px 18px; border: 1px solid rgba(242,182,110,.4); border-radius: 10px; background: rgba(14,29,36,.95); color: #f4d7b4; font-size: 12px; line-height: 1.5; text-align: center; }
.metrics-dock { position: absolute; z-index: 2; bottom: 16px; left: 20px; right: 20px; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; pointer-events: none; }
.metric-card { min-width: 0; padding: 11px 12px 10px; border: 1px solid rgba(151,203,211,.15); border-radius: 8px; background: rgba(6,21,28,.74); backdrop-filter: blur(12px); box-shadow: 0 8px 22px rgba(0,0,0,.13); }
.metric-label { display: block; color: #9ab5bb; font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
.metric-label small { color: #63858d; font-size: 7px; margin-left: 3px; }
.metric-card strong { display: block; margin-top: 7px; color: #eff9f8; font-size: clamp(16px, 1.8vw, 22px); letter-spacing: -.035em; font-weight: 620; white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric-card strong i { color: #8caeb5; font-size: 10px; font-style: normal; font-weight: 500; letter-spacing: 0; }
.metric-note { display: block; color: #6f8e97; font-size: 8px; margin-top: 4px; }
.stage-footer { height: 30px; flex: 0 0 30px; display: flex; align-items: center; gap: 18px; padding: 0 22px; color: #6f8992; font-size: 8px; letter-spacing: .06em; background: #081921; border-top: 1px solid rgba(154,202,211,.09); }
.footer-key { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; }
.footer-key.cyan { background: #55d4dd; }
.footer-key.white { background: #e7f4f0; }
.footer-right { margin-left: auto; color: #587680; letter-spacing: .12em; }
.footer-right b { color: #a9c5ca; font-weight: 650; }
.sidebar { min-height: 0; overflow-y: auto; background: linear-gradient(180deg, #0c1b23, #091820); border-left: 1px solid var(--line); padding: 21px 20px 14px; scrollbar-width: thin; scrollbar-color: #29434d transparent; }
.sidebar-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.sidebar-head h2 { font-size: 19px; letter-spacing: -.035em; margin: 6px 0 0; font-weight: 620; }
.reset-text { background: none; border: 0; color: #80b8bf; font-size: 10px; cursor: pointer; padding: 4px 0; }
.reset-text:hover { color: #c6f4f1; }
.control-section, .preset-section { padding: 15px 0 13px; border-top: 1px solid var(--line); }
.section-title { color: #a8c3c9; font-size: 9px; font-weight: 750; letter-spacing: .15em; margin-bottom: 16px; }
.section-title span { color: #5d8993; margin-right: 7px; }
.control-row { position: relative; margin: 0 0 17px; }
.control-row:last-child { margin-bottom: 3px; }
.control-row label { display: inline-block; color: #d5e3e4; font-size: 11px; font-weight: 540; }
.control-row label small { color: #78959e; font-size: 9px; margin-left: 4px; }
.control-row output { float: right; color: #78d8dc; font-size: 10px; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 3px; margin: 12px 0 6px; background: linear-gradient(90deg, #56cbd3 0%, #56cbd3 var(--range-fill, 50%), #2b414a var(--range-fill, 50%), #2b414a 100%); border-radius: 8px; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #d9fbf6; border: 2px solid #55c9d0; box-shadow: 0 0 0 3px rgba(85,201,208,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d9fbf6; border: 2px solid #55c9d0; box-shadow: 0 0 0 3px rgba(85,201,208,.12); }
.range-ends { display: flex; justify-content: space-between; color: #58747e; font-size: 8px; }
.preset-section { padding-bottom: 16px; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 10px; min-height: 43px; width: 100%; text-align: left; padding: 7px 9px; background: rgba(255,255,255,.018); border: 1px solid rgba(150,196,205,.1); border-radius: 7px; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.preset-button:hover { border-color: rgba(89,215,223,.38); transform: translateY(-1px); }
.preset-button.active { background: rgba(89,215,223,.075); border-color: rgba(89,215,223,.42); }
.preset-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; font-size: 17px; background: #132f39; color: #79d9dc; }
.storm-icon { color: #f0b87a; background: #332a25; }
.preset-button b { display: block; color: #d9e8e9; font-size: 10px; font-weight: 650; }
.preset-button small { display: block; color: #78949c; font-size: 8px; margin-top: 3px; }
.transport-section { padding: 14px 0 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.transport-main { display: grid; grid-template-columns: 1.15fr .8fr .9fr; gap: 7px; margin-bottom: 15px; }
.primary-button, .secondary-button, .export-button { min-height: 34px; border-radius: 6px; cursor: pointer; font-size: 10px; font-weight: 650; transition: background .18s, border-color .18s; }
.primary-button { border: 1px solid rgba(89,215,223,.55); background: #15515b; color: #eaffff; display: flex; align-items: center; justify-content: center; gap: 7px; }
.primary-button:hover { background: #1b6670; }
.secondary-button { background: rgba(255,255,255,.025); border: 1px solid var(--line); color: #b6c9cd; }
.secondary-button:hover, .export-button:hover { border-color: rgba(89,215,223,.45); color: #e5fbfb; }
.secondary-button b { color: var(--cyan); font-size: 14px; margin-left: 3px; }
.speed-row { margin-bottom: 14px; }
.quality-row { display: flex; align-items: center; gap: 7px; }
.quality-row > span { color: #68848d; font-size: 8px; letter-spacing: .1em; margin-right: auto; }
.segmented { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.12); }
.segmented button { border: 0; border-radius: 4px; padding: 5px 8px; background: transparent; color: #7d969d; font-size: 8px; cursor: pointer; }
.segmented button.selected { background: #1c414a; color: #c9f4f1; }
.export-button { min-height: 26px; padding: 0 8px; background: transparent; border: 1px solid var(--line); color: #90b4bb; font-size: 8px; }
.science-panel { margin-top: 14px; border: 1px solid rgba(125,184,194,.13); border-radius: 8px; background: rgba(12,33,42,.52); overflow: hidden; }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-symbol { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: #7ee0e1; background: rgba(89,215,223,.11); font-size: 16px; }
.science-panel summary b { display: block; font-size: 10px; color: #d8e9ea; }
.science-panel summary small { display: block; margin-top: 3px; font-size: 7px; letter-spacing: .12em; color: #688892; }
.chevron { margin-left: auto; color: #77a2aa; font-size: 16px; transition: transform .18s; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 12px 13px; }
.science-lead { color: #a6bdc2; font-size: 9px; line-height: 1.55; margin: 2px 0 12px; }
.variable-key { color: #829da4; font-size: 8px; line-height: 1.55; margin: 9px 1px; }
.variable-key b { color: #b7d0d3; }
.equation-block { padding: 9px 10px; margin: 7px 0; border: 1px solid rgba(125,184,194,.1); border-radius: 6px; background: rgba(4,16,22,.32); }
.eq-label { display: block; color: #668c96; font-size: 7px; letter-spacing: .11em; margin-bottom: 6px; }
.equation-block code { display: block; color: #d6eeee; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; line-height: 1.5; white-space: normal; }
.equation-block small { display: block; color: #809ba2; font-size: 8px; margin-top: 4px; }
.validation-card { padding: 10px; margin-top: 10px; border: 1px solid rgba(89,215,223,.2); border-radius: 7px; background: rgba(39,111,119,.08); }
.validation-head { display: flex; justify-content: space-between; align-items: center; color: #8db5bb; font-size: 8px; letter-spacing: .12em; }
.validation-badge { padding: 3px 5px; border-radius: 4px; background: rgba(89,215,223,.12); color: #8ce5e4; font-size: 7px; }
.validation-card p { color: #8faab0; font-size: 8px; line-height: 1.5; margin: 8px 0; }
.validation-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.validation-grid div { min-width: 0; padding: 6px 5px; border-radius: 4px; background: rgba(0,0,0,.18); }
.validation-grid small { display: block; color: #64858d; font-size: 6px; letter-spacing: .1em; }
.validation-grid b { display: block; margin-top: 4px; color: #d8eeee; font-size: 9px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.model-notes { margin-top: 12px; color: #8fa9af; font-size: 8px; line-height: 1.55; }
.model-notes b { color: #b6cdd1; font-size: 9px; }
.model-notes ul { margin: 6px 0 0; padding-left: 15px; }
.model-notes li { margin: 4px 0; }
.disclaimer { color: #607e87; font-size: 7px; line-height: 1.5; margin: 11px 0 0; }
.sidebar-foot { display: flex; justify-content: space-between; color: #4e6d77; font-size: 7px; letter-spacing: .13em; padding: 12px 1px 0; }
.embed-controls { display: none; position: absolute; z-index: 4; right: 14px; bottom: 14px; gap: 7px; }
.icon-button { width: 38px; height: 38px; border: 1px solid rgba(151,203,211,.25); border-radius: 50%; background: rgba(5,20,27,.8); color: #d9f4f2; cursor: pointer; backdrop-filter: blur(10px); }
.icon-button:hover { border-color: var(--cyan); }
.app-shell.embed-mode .topbar, .app-shell.embed-mode .sidebar, .app-shell.embed-mode .stage-footer { display: none; }
.app-shell.embed-mode .workspace { display: block; }
.app-shell.embed-mode .stage { height: 100vh; min-height: 360px; }
.app-shell.embed-mode .embed-controls { display: flex; }
.app-shell.embed-mode .metrics-dock { bottom: 16px; }
.app-shell.embed-mode .wind-indicator { bottom: 125px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0,1fr) 326px; }
  .sidebar { padding-left: 16px; padding-right: 16px; }
  .scene-heading { left: 22px; }
  .scene-tags { right: 18px; }
  .metrics-dock { left: 13px; right: 13px; gap: 6px; }
  .metric-card { padding-left: 9px; padding-right: 9px; }
}
@media (max-width: 820px) {
  .topbar { height: 56px; flex-basis: 56px; padding: 0 15px; }
  .workspace { display: flex; flex-direction: column; overflow: visible; }
  .stage-wrap { flex: none; }
  .stage { height: min(62vh, 590px); min-height: 430px; }
  .sidebar { overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 18px 18px 22px; }
  .preset-grid { grid-template-columns: repeat(3,1fr); }
  .preset-button { align-items: flex-start; flex-direction: column; gap: 6px; min-height: 83px; }
  .scene-heading { top: 20px; left: 18px; max-width: 310px; }
  .scene-heading h1 { font-size: 32px; }
  .scene-heading p { font-size: 10px; max-width: 250px; }
  .scene-tags { top: 20px; right: 12px; }
  .scene-tags span { font-size: 7px; padding: 6px 7px; }
  .metrics-dock { grid-template-columns: repeat(2,minmax(0,1fr)); bottom: 12px; }
  .metric-card { padding: 8px 9px; }
  .metric-card strong { margin-top: 4px; font-size: 17px; }
  .metric-note { display: none; }
  .wind-indicator, .stage-status { bottom: 170px; }
  .stage-footer { padding: 0 15px; }
}
@media (max-width: 480px) {
  .brand-name { font-size: 9px; }
  .brand-name span { display: none; }
  .brand-subtitle { font-size: 7px; }
  .topbar-right { gap: 8px; }
  .seed-chip { font-size: 7px; padding: 6px; }
  .live-indicator { font-size: 7px; }
  .stage { min-height: 440px; height: 56vh; }
  .scene-heading { top: 17px; left: 14px; max-width: 250px; }
  .scene-heading h1 { font-size: 28px; margin-top: 7px; }
  .scene-heading p { max-width: 220px; font-size: 9px; }
  .process-chain { max-width: 225px; font-size: 6px; line-height: 1.5; }
  .scene-tags { top: 17px; right: 9px; gap: 5px; }
  .scene-tags span { max-width: 132px; font-size: 6px; letter-spacing: .08em; }
  .wind-indicator { left: 15px; bottom: 170px; font-size: 7px; }
  .wind-arrow { font-size: 21px; }
  .stage-status { right: 12px; bottom: 170px; font-size: 7px; }
  .metrics-dock { left: 9px; right: 9px; bottom: 9px; gap: 5px; }
  .metric-card { padding: 7px 7px 6px; }
  .metric-label { font-size: 7px; letter-spacing: .08em; }
  .metric-label small { display: none; }
  .metric-card strong { font-size: 16px; }
  .metric-card strong i { font-size: 8px; }
  .stage-footer { gap: 10px; font-size: 7px; }
  .footer-right { display: none; }
  .sidebar { padding: 17px 14px 22px; }
  .preset-grid { gap: 5px; }
  .preset-button { padding: 7px; min-height: 78px; }
  .preset-button b { font-size: 9px; }
  .preset-button small { font-size: 7px; }
  .transport-main { grid-template-columns: 1.1fr .85fr .9fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
