:root {
  color-scheme: dark;
  --bg: #0b1217;
  --panel: #101a21;
  --panel-2: #14212a;
  --line: rgba(190, 211, 219, .12);
  --line-strong: rgba(190, 211, 219, .2);
  --text: #edf2ef;
  --muted: #9aa9aa;
  --muted-2: #708185;
  --accent: #e4a56a;
  --accent-2: #f0c18d;
  --teal: #74c6bc;
  --danger: #db866d;
  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-2); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 38% -12%, rgba(59, 83, 86, .2), transparent 46%), var(--bg); }
.topbar { height: 66px; flex: 0 0 66px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(10, 17, 22, .88); }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(228,165,106,.45); color: var(--accent); display: grid; place-items: center; font-size: 19px; transform: rotate(0deg); border-radius: 10px; background: rgba(228,165,106,.06); }
.eyebrow, .stage-kicker, .mini-label, .section-heading, .readout-label, .mechanism-number, .validation-head, .app-footer, .topbar-tag, .stage-bottom-left, .stage-bottom-right { font-size: 9px; letter-spacing: .14em; font-weight: 700; color: var(--muted-2); }
.brand-title { font-size: 14px; font-weight: 650; letter-spacing: -.02em; margin-top: 3px; white-space: nowrap; }
.brand-title span { color: #627176; padding: 0 4px; font-weight: 400; }
.topbar-meta { display: flex; align-items: center; gap: 16px; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: var(--teal); font-size: 9px; letter-spacing: .13em; font-weight: 800; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px rgba(116,198,188,.7); }
.meta-divider { width: 1px; height: 16px; background: var(--line-strong); }
.topbar-tag { color: #849397; letter-spacing: .1em; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 365px; gap: 0; }
.visual-column { min-width: 0; display: flex; flex-direction: column; padding: 18px 18px 14px 22px; }
.stage-wrap { position: relative; min-height: 390px; height: clamp(350px, 48vh, 510px); max-height: 510px; overflow: hidden; border: 1px solid rgba(190,211,219,.14); border-radius: 14px; background: radial-gradient(ellipse at 52% 38%, #293d42 0%, #17262c 48%, #0b1419 100%); box-shadow: 0 18px 48px rgba(0,0,0,.24); isolation: isolate; }
.stage { position: absolute; inset: 0; z-index: 1; }
.stage canvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-vignette { pointer-events: none; position: absolute; inset: 0; z-index: 2; background: linear-gradient(90deg, rgba(8,15,19,.55), transparent 52%), linear-gradient(0deg, rgba(7,13,17,.55), transparent 30%, rgba(7,13,17,.12)); }
.stage-heading { position: absolute; z-index: 3; left: 28px; top: 27px; pointer-events: none; }
.stage-kicker { color: #c5a17e; font-size: 8px; }
.stage-heading h1 { margin: 13px 0 9px; font-size: clamp(26px, 3.2vw, 43px); line-height: .99; letter-spacing: -.055em; font-weight: 620; text-shadow: 0 2px 16px rgba(0,0,0,.35); }
.stage-heading h1 em { font-style: normal; color: #e6b98d; }
.stage-heading p { color: #a6b3b0; font-size: 11px; margin: 0; letter-spacing: .01em; }
.scene-tags { position: absolute; z-index: 3; left: 28px; bottom: 64px; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.scene-tag { display: flex; align-items: center; gap: 9px; padding: 6px 9px; width: fit-content; border: 1px solid rgba(208,221,215,.17); border-radius: 5px; background: rgba(9,17,21,.55); backdrop-filter: blur(8px); color: #d1d9d4; font-size: 8px; font-weight: 750; letter-spacing: .11em; }
.scene-tag b { color: var(--accent); font-size: 9px; }
.north-indicator { position: absolute; z-index: 3; right: 22px; top: 22px; width: 28px; height: 42px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: #c4d0cc; font-size: 9px; font-weight: 800; pointer-events: none; }
.north-indicator i { width: 1px; height: 19px; background: linear-gradient(var(--accent), transparent); position: relative; }
.north-indicator i::before { content: ''; position: absolute; top: 0; left: -3px; border-left: 3px solid transparent; border-right: 3px solid transparent; border-bottom: 5px solid var(--accent); }
.stage-bottom-left, .stage-bottom-right { position: absolute; z-index: 3; bottom: 19px; color: #9ba9a5; font-size: 8px; letter-spacing: .12em; pointer-events: none; }
.stage-bottom-left { left: 28px; display: flex; align-items: center; gap: 9px; }
.scale-line { display: inline-block; width: 30px; height: 5px; border-top: 1px solid #aebcb5; border-left: 1px solid #aebcb5; border-right: 1px solid #aebcb5; }
.stage-bottom-right { right: 22px; }
.webgl-notice, .context-loss { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(440px, calc(100% - 36px)); padding: 18px 20px; border: 1px solid rgba(228,165,106,.36); border-radius: 10px; background: rgba(10,18,23,.94); box-shadow: 0 18px 50px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 8px; }
.webgl-notice[hidden], .context-loss[hidden] { display: none; }
.webgl-notice strong, .context-loss strong { font-size: 13px; color: #f0c18d; }
.webgl-notice span, .context-loss span { color: #aab6b2; font-size: 11px; line-height: 1.55; }
.transport-bar { min-height: 66px; display: grid; grid-template-columns: auto minmax(130px, 1fr) auto auto; align-items: center; gap: 15px; padding: 9px 4px 9px 2px; border-bottom: 1px solid var(--line); }
.transport-controls { display: flex; align-items: center; gap: 7px; }
.control-button, .icon-button, .quality-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); border-radius: 7px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.control-button { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; color: #c4ceca; font-size: 10px; font-weight: 650; }
.control-button:hover, .icon-button:hover, .quality-button:hover { background: rgba(255,255,255,.075); border-color: rgba(220,230,224,.32); }
.control-button:active, .icon-button:active { transform: translateY(1px); }
.control-button.primary { background: rgba(228,165,106,.14); border-color: rgba(228,165,106,.4); color: #f0c18d; }
.control-button.primary:hover { background: rgba(228,165,106,.22); }
.play-icon { font-size: 10px; }
.transport-divider { height: 20px; width: 1px; background: var(--line-strong); margin: 0 2px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px; color: #bdc9c4; }
.transport-status { display: grid; grid-template-columns: auto minmax(35px, 1fr); gap: 12px; align-items: center; min-width: 0; }
.time-readout { white-space: nowrap; display: flex; align-items: baseline; gap: 5px; }
.time-readout .mini-label { font-size: 7px; letter-spacing: .12em; }
.time-readout strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.time-readout .unit { font-size: 9px; color: var(--muted-2); }
.timeline { height: 3px; background: rgba(190,211,219,.12); border-radius: 4px; overflow: hidden; }
.timeline div { height: 100%; width: 0; background: linear-gradient(90deg, #b67c53, #e5ba8d); border-radius: inherit; transition: width .12s linear; }
.quality-controls { display: flex; align-items: center; gap: 4px; }
.quality-controls .mini-label { font-size: 7px; margin-right: 4px; }
.quality-button { height: 27px; padding: 0 7px; font-size: 8px; letter-spacing: .08em; font-weight: 800; color: #829194; }
.quality-button.active { color: #e8b88c; border-color: rgba(228,165,106,.35); background: rgba(228,165,106,.1); }
.screenshot-button { color: var(--accent-2); font-size: 18px; }
.readout-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; padding: 12px 0 10px; }
.readout-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px 10px; background: linear-gradient(135deg, rgba(21,34,41,.78), rgba(15,25,31,.8)); }
.readout-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.readout-label { font-size: 7px; letter-spacing: .12em; white-space: nowrap; }
.readout-mark { color: #718287; font-size: 6px; letter-spacing: .06em; white-space: nowrap; }
.readout-value { display: flex; align-items: baseline; gap: 6px; margin-top: 7px; }
.readout-value strong { font-size: clamp(19px, 2vw, 26px); font-weight: 600; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.readout-value span { color: #a0afab; font-size: 9px; }
.readout-foot { color: #78898b; font-size: 8px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mechanism-strip { display: grid; grid-template-columns: minmax(0,1fr) 18px minmax(0,1fr) 18px minmax(0,1fr); gap: 7px; padding: 11px 2px 2px; border-top: 1px solid var(--line); }
.mechanism-step { min-width: 0; }
.mechanism-number { color: #bd956f; font-size: 7px; }
.mechanism-step strong { display: block; font-size: 10px; font-weight: 650; margin: 5px 0 3px; color: #d9e0dc; }
.mechanism-step p { margin: 0; color: #859496; font-size: 8px; line-height: 1.45; }
.mechanism-arrow { color: #9b826c; font-size: 16px; align-self: center; text-align: center; opacity: .75; }
.control-column { min-width: 0; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(17,27,34,.94), rgba(12,20,26,.98)); padding: 20px 18px 16px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 94px); overflow: auto; scrollbar-width: thin; scrollbar-color: #304149 transparent; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 19px; letter-spacing: -.035em; margin: 4px 0 0; font-weight: 600; }
.panel-index { color: #75868a; font-size: 9px; letter-spacing: .1em; }
.section-heading { display: flex; align-items: center; gap: 8px; font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
.section-rule { height: 1px; background: var(--line); flex: 1; }
.preset-section, .parameters-section { display: flex; flex-direction: column; gap: 10px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.preset-button { min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 7px; padding: 9px 7px; display: flex; align-items: flex-start; gap: 6px; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover { background: rgba(255,255,255,.055); }
.preset-button.selected { border-color: rgba(228,165,106,.5); background: rgba(228,165,106,.08); }
.preset-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 4px; flex: 0 0 auto; }
.water-dot { background: #6bc4ca; }.debris-dot { background: #d6a06d; }.blocky-dot { background: #b8a28a; }
.preset-button b { display: block; font-size: 8px; font-weight: 700; white-space: nowrap; }
.preset-button small { display: block; color: #7f8f91; font-size: 7px; margin-top: 4px; white-space: nowrap; }
.preset-description { color: #8d9b9c; font-size: 9px; line-height: 1.45; margin: -2px 0 0; min-height: 26px; }
.parameters-section { gap: 11px; }
.slider-control { display: flex; flex-direction: column; gap: 7px; }
.slider-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slider-label label { color: #c7d0cb; font-size: 10px; font-weight: 570; }
.slider-label output { color: #e7b98d; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; width: 100%; height: 3px; border-radius: 8px; background: linear-gradient(90deg, #b57f58 0%, #b57f58 50%, #34434a 50%, #34434a 100%); cursor: pointer; margin: 2px 0; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #e7b98d; border: 2px solid #17232a; box-shadow: 0 0 0 1px rgba(231,185,141,.55); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #e7b98d; border: 2px solid #17232a; box-shadow: 0 0 0 1px rgba(231,185,141,.55); }
.range-ends { display: flex; align-items: center; justify-content: space-between; color: #65767a; font-size: 7px; }
.apply-button { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid rgba(228,165,106,.45); border-radius: 7px; background: rgba(228,165,106,.13); color: #f0c18d; min-height: 36px; cursor: pointer; font-size: 10px; font-weight: 700; margin-top: 1px; transition: background .18s ease; }
.apply-button:hover { background: rgba(228,165,106,.22); }
.apply-button span { font-size: 13px; }
.control-hint { margin: -5px 0 0; color: #708185; font-size: 8px; line-height: 1.5; }
.science-panel { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; font-size: 9px; letter-spacing: .12em; color: #e3b58b; }
.science-panel summary small { display: block; margin-top: 4px; color: #7d8e91; font-size: 8px; }
.details-chevron { color: #9caaa5; font-size: 16px; transition: transform .2s ease; }
.science-panel[open] .details-chevron { transform: rotate(180deg); }
.science-content { padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.science-block h3, .validation-card h3 { margin: 0 0 5px; color: #dce4df; font-size: 10px; font-weight: 650; }
.science-block p { margin: 0; color: #89999a; font-size: 8px; line-height: 1.55; }
.science-block .equation { color: #e4c29f; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; line-height: 1.55; margin: 5px 0; overflow-wrap: anywhere; }
.validation-card { border: 1px solid rgba(116,198,188,.22); border-radius: 8px; padding: 11px; background: rgba(65,132,126,.07); }
.validation-head { display: flex; justify-content: space-between; align-items: center; color: #8ca5a2; font-size: 7px; }
.validation-head b { color: var(--teal); font-size: 7px; letter-spacing: .1em; }
.validation-card h3 { margin-top: 8px; }
.validation-card p { color: #8c9a9b; font-size: 8px; line-height: 1.5; margin: 0 0 10px; }
.validation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.validation-grid > div { background: rgba(5,13,17,.26); border-radius: 5px; padding: 7px; }
.validation-grid small { display: block; color: #6f8586; font-size: 6px; letter-spacing: .1em; }
.validation-grid strong { display: inline-block; color: #d6e8df; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; }
.validation-grid em { color: #8b9b99; font-size: 8px; font-style: normal; margin-left: 4px; }
.validation-diff { color: #8ca19d; font-size: 8px; margin-top: 8px; }
.validation-diff strong { color: var(--teal); font-weight: 700; }
.limitations ul { margin: 6px 0 0; padding-left: 14px; color: #829194; font-size: 8px; line-height: 1.6; }
.panel-footer { margin-top: auto; padding-top: 10px; color: #607176; font-size: 7px; line-height: 1.5; border-top: 1px solid var(--line); }
.app-footer { display: flex; align-items: center; justify-content: space-between; padding: 9px 24px; border-top: 1px solid var(--line); font-size: 7px; color: #5d7074; }
.app-footer b { color: #9b826c; padding: 0 4px; }
body.embed .topbar { height: 48px; flex-basis: 48px; }
body.embed .brand-mark { width: 27px; height: 27px; }
body.embed .topbar-tag, body.embed .meta-divider { display: none; }
body.embed .workspace { grid-template-columns: minmax(0,1fr) 340px; }
body.embed .visual-column { padding: 10px; }
body.embed .stage-wrap { height: min(55vw, 520px); min-height: 300px; }
body.embed .app-footer { display: none; }
body.embed .control-column { max-height: calc(100vh - 48px); }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0,1fr) 330px; }
  .visual-column { padding-left: 14px; padding-right: 14px; }
  .control-column { padding-left: 14px; padding-right: 14px; }
  .readout-card { padding-left: 9px; padding-right: 9px; }
  .readout-mark { display: none; }
  .transport-bar { gap: 9px; }
}
@media (max-width: 850px) {
  .topbar { padding: 0 15px; }
  .workspace, body.embed .workspace { grid-template-columns: minmax(0,1fr); }
  .visual-column { padding: 12px 12px 10px; }
  .stage-wrap { height: min(58vw, 440px); min-height: 330px; }
  .control-column, body.embed .control-column { max-height: none; border-left: 0; border-top: 1px solid var(--line); padding: 18px 16px; overflow: visible; }
  .control-column { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .panel-head, .science-panel, .panel-footer { grid-column: 1 / -1; }
  .preset-section, .parameters-section { min-width: 0; }
  .parameters-section { grid-row: span 2; }
  .science-panel { margin-top: 2px; }
  .app-footer { padding: 9px 15px; }
}
@media (max-width: 560px) {
  .topbar { height: 58px; flex-basis: 58px; padding: 0 12px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-title { font-size: 12px; }
  .eyebrow { font-size: 7px; }
  .topbar-meta { gap: 8px; }
  .topbar-tag { display: none; }
  .meta-divider { display: none; }
  .visual-column { padding: 8px 8px 10px; }
  .stage-wrap { height: 54vh; min-height: 340px; max-height: 500px; border-radius: 10px; }
  body.embed .stage-wrap { height: 54vh; min-height: 340px; max-height: 500px; }
  .stage-heading { left: 16px; top: 18px; }
  .stage-heading h1 { font-size: 28px; }
  .stage-heading p { font-size: 9px; }
  .stage-kicker { font-size: 7px; }
  .scene-tags { left: 14px; bottom: 48px; gap: 5px; }
  .scene-tag { font-size: 7px; padding: 5px 7px; }
  .stage-bottom-left { left: 15px; bottom: 14px; font-size: 6px; }
  .stage-bottom-right { right: 12px; bottom: 14px; font-size: 6px; }
  .north-indicator { right: 13px; top: 14px; }
  .transport-bar { min-height: 62px; grid-template-columns: auto minmax(80px,1fr) auto; gap: 8px; padding: 8px 0; }
  .transport-controls { gap: 5px; }
  .control-button { padding: 0 8px; min-height: 32px; font-size: 9px; }
  .control-button span:first-child { font-size: 10px; }
  .control-button:nth-of-type(2) span:last-child, .control-button:nth-of-type(3) span:last-child { display: none; }
  .control-button:nth-of-type(2), .control-button:nth-of-type(3) { width: 32px; justify-content: center; }
  .transport-divider { display: none; }
  .transport-status { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
  .time-readout { justify-content: center; }
  .time-readout .mini-label { display: none; }
  .timeline { width: 100%; }
  .quality-controls { display: none; }
  .screenshot-button { width: 32px; height: 32px; }
  .readout-strip { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; padding: 9px 0; }
  .readout-card { padding: 9px 10px; }
  .readout-label { font-size: 7px; }
  .readout-value strong { font-size: 22px; }
  .readout-foot { font-size: 7px; }
  .mechanism-strip { gap: 5px; padding-top: 9px; }
  .mechanism-step strong { font-size: 8px; }
  .mechanism-step p { font-size: 7px; }
  .mechanism-arrow { font-size: 12px; }
  .control-column { display: flex; gap: 16px; padding: 16px 13px; }
  .panel-head h2 { font-size: 18px; }
  .preset-grid { gap: 5px; }
  .preset-button { padding: 8px 6px; gap: 5px; }
  .preset-button b { font-size: 7px; }
  .preset-button small { font-size: 6px; }
  .slider-label label { font-size: 10px; }
  .slider-label output { font-size: 9px; }
  .app-footer { padding: 8px 12px; font-size: 6px; }
  body.embed .topbar { height: 42px; flex-basis: 42px; }
  body.embed .control-column { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
