:root {
  color-scheme: dark;
  --bg: #07121f;
  --panel: #0c1a29;
  --panel-2: #102235;
  --line: rgba(154, 191, 216, .14);
  --muted: #8297aa;
  --text: #e8f3f8;
  --accent: #61e4d0;
  --accent-2: #8af3e3;
  --accent-dim: rgba(97, 228, 208, .12);
  --warning: #f3bd79;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: 100%; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 48% -30%, rgba(27, 74, 93, .22), transparent 55%), var(--bg); }
.topbar { min-height: 68px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(7, 18, 31, .94); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(97, 228, 208, .24); background: rgba(97, 228, 208, .07); color: var(--accent); border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.brand-mark svg { width: 29px; height: 29px; }
.eyebrow, .panel-kicker, .caption-label, .overlay-kicker { font-size: 9px; font-weight: 750; letter-spacing: .16em; color: #8ca7b9; }
h1 { font-size: 17px; line-height: 1.2; margin: 3px 0 0; letter-spacing: -.025em; font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { min-height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; background: rgba(17, 36, 54, .72); display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #bfd0dc; font-size: 11px; font-weight: 650; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.icon-button:hover { background: #18334a; border-color: rgba(97, 228, 208, .4); }
.icon-button:active { transform: translateY(1px); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.primary-action { color: #05211f; background: var(--accent); border-color: var(--accent); min-width: 91px; }
.primary-action:hover { background: var(--accent-2); border-color: var(--accent-2); }
.primary-action svg { stroke: #05211f; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 354px; gap: 12px; padding: 12px 14px 10px; overflow: hidden; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 9px; }
.stage-heading { display: flex; justify-content: space-between; align-items: center; min-height: 22px; padding: 0 3px; gap: 12px; }
.stage-heading-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 11px rgba(97, 228, 208, .8); }
.stage-label { color: #c5d7e2; font-size: 9px; font-weight: 800; letter-spacing: .15em; white-space: nowrap; }
.stage-divider { color: #4e6679; font-size: 12px; }
.stage-subtitle { color: #8aa1b3; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-meta { display: flex; gap: 7px; align-items: center; color: #6e8799; font-size: 9px; white-space: nowrap; }
.meta-tag { font-size: 8px; color: var(--accent); border: 1px solid rgba(97, 228, 208, .28); padding: 2px 5px; border-radius: 4px; letter-spacing: .1em; font-weight: 800; }
.canvas-wrap { position: relative; flex: 1; min-height: 180px; border-radius: 15px; overflow: hidden; border: 1px solid rgba(123, 178, 204, .17); background: #081b2a; box-shadow: 0 16px 45px rgba(0,0,0,.2), inset 0 0 45px rgba(16, 78, 92, .12); }
#simCanvas { display: block; width: 100%; height: 100%; }
.canvas-vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(3, 12, 23, .32); }
.canvas-overlay { position: absolute; z-index: 1; pointer-events: none; }
.overlay-top-left { left: 17px; top: 16px; width: 170px; }
.overlay-top-right { right: 18px; top: 16px; text-align: right; }
.overlay-kicker { font-size: 8px; color: #7f9bac; }
.phase-name { font-size: 14px; font-weight: 650; margin-top: 5px; color: #e4f3f6; }
.phase-track { margin-top: 8px; height: 3px; background: rgba(168, 209, 218, .17); border-radius: 4px; overflow: hidden; }
.phase-track span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; box-shadow: 0 0 8px rgba(97,228,208,.65); }
.formation-display { font-size: 25px; font-weight: 720; letter-spacing: -.05em; margin-top: 1px; color: var(--accent); font-variant-numeric: tabular-nums; }
.formation-display small { font-size: 11px; color: #819aaa; font-weight: 500; letter-spacing: 0; }
.threshold-note { display: flex; justify-content: flex-end; align-items: center; gap: 5px; color: #839aaa; font-size: 9px; margin-top: 1px; }
.threshold-note i { width: 5px; height: 5px; border-radius: 50%; background: var(--warning); }
.overlay-bottom-left { left: 17px; bottom: 15px; display: flex; align-items: center; gap: 7px; color: #9db3c0; font-size: 9px; }
.legend-ring { width: 12px; height: 7px; border: 1px solid var(--accent); border-radius: 50%; box-shadow: 0 0 8px rgba(97,228,208,.55); margin-right: -2px; }
.legend-jet { width: 12px; height: 2px; background: #70a9d0; border-radius: 2px; margin-left: 8px; margin-right: -2px; }
.overlay-bottom-right { right: 18px; bottom: 15px; color: #6e8798; font-size: 8px; font-weight: 750; letter-spacing: .14em; }
.caption-strip { min-height: 59px; padding: 10px 13px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(12, 26, 41, .85); }
.caption-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-dim); color: var(--accent); font-size: 13px; flex: 0 0 auto; }
.caption-label { font-size: 8px; letter-spacing: .13em; color: #7993a5; }
.caption-strip p { margin: 3px 0 0; color: #c1d1db; font-size: 11px; line-height: 1.4; }
.control-column { min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 9px; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #28475b transparent; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(15, 33, 50, .96), rgba(10, 24, 38, .96)); padding: 13px 14px; }
.panel-header, .audit-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-kicker { font-size: 8px; color: #7793a7; }
h2 { margin: 3px 0 0; font-size: 14px; letter-spacing: -.02em; font-weight: 680; }
.unit-note { font-size: 7px; letter-spacing: .12em; font-weight: 800; color: #7b98a9; border: 1px solid rgba(132, 166, 185, .18); padding: 4px 6px; border-radius: 5px; white-space: nowrap; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.readout { background: rgba(5, 17, 29, .48); border: 1px solid rgba(129, 169, 190, .1); border-radius: 9px; padding: 8px 9px 7px; min-width: 0; }
.readout-name { color: #8ca4b4; font-size: 9px; }
.readout-value { margin-top: 4px; color: #e6f2f7; font-size: 19px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { color: #8ba5b4; font-size: 9px; font-weight: 550; letter-spacing: 0; }
.readout-foot { margin-top: 2px; color: #637e91; font-size: 8px; }
.reynolds-line { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: #7892a4; font-size: 8px; }
.reynolds-line strong { color: #c6e5e5; font-size: 9px; font-variant-numeric: tabular-nums; }
.reynolds-line em { margin-left: auto; color: #688397; font-size: 7px; font-style: normal; }
.formation-meter { margin-top: 9px; }
.meter-head { display: flex; justify-content: space-between; color: #a9becb; font-size: 9px; }
.meter-threshold { color: var(--warning); font-variant-numeric: tabular-nums; }
.meter-threshold em, .slider-hint em, .source-tag { font-style: normal; color: #6f8a9d; font-size: 8px; letter-spacing: .03em; }
.meter-track { position: relative; height: 5px; border-radius: 5px; background: linear-gradient(90deg, rgba(97,228,208,.18), rgba(243,189,121,.18)); margin-top: 7px; overflow: visible; }
.meter-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4ed7c5, #8fe9b4, #e6b46e); border-radius: 5px; transition: width .1s linear; }
.meter-mark { position: absolute; top: -4px; left: 50%; width: 2px; height: 13px; background: var(--warning); box-shadow: 0 0 5px rgba(243,189,121,.5); }
.meter-ends { display: flex; justify-content: space-between; color: #6e8799; font-size: 8px; margin-top: 6px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 11px; }
.preset-button { height: 31px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(127, 166, 186, .17); background: rgba(5, 17, 29, .4); border-radius: 7px; color: #8fa8b8; font-size: 9px; font-weight: 650; cursor: pointer; transition: .16s ease; }
.preset-button:hover { border-color: rgba(97,228,208,.4); color: #d4e7ed; }
.preset-button.selected { color: var(--accent); border-color: rgba(97,228,208,.42); background: rgba(97,228,208,.08); }
.preset-dot { width: 5px; height: 5px; border-radius: 50%; background: #66869a; }
.preset-button.selected .preset-dot { background: var(--accent); box-shadow: 0 0 7px rgba(97,228,208,.6); }
.slider-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.slider-control { display: block; cursor: default; }
.slider-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #b9cbd5; font-size: 10px; }
.slider-value { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 13px; margin: 5px 0 0; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: #294255; border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #0b2633; margin-top: -4.5px; box-shadow: 0 0 0 2px rgba(97,228,208,.13); }
input[type="range"]::-moz-range-track { height: 3px; background: #294255; border-radius: 3px; }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #0b2633; }
.slider-hint { display: flex; justify-content: space-between; color: #627d90; font-size: 8px; margin-top: -1px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(132,166,185,.1); margin-top: 11px; padding-top: 9px; color: #8ca4b4; font-size: 9px; }
.segmented { display: flex; padding: 2px; background: rgba(4, 14, 25, .65); border: 1px solid rgba(129,169,190,.12); border-radius: 6px; gap: 2px; }
.segmented button { border: 0; background: transparent; color: #748da0; font-size: 8px; padding: 4px 9px; border-radius: 4px; cursor: pointer; }
.segmented button.active { color: #06211f; background: var(--accent); font-weight: 800; }
.audit-panel { padding-top: 11px; padding-bottom: 10px; }
.check-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(97,228,208,.11); color: var(--accent); font-size: 11px; }
.audit-values { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-top: 10px; }
.audit-values div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.audit-values span { color: #748fa1; font-size: 8px; }
.audit-values strong { color: #d9e8ef; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.audit-values strong small { color: #7d96a7; font-size: 8px; font-weight: 500; }
.audit-difference strong { color: var(--accent); }
.audit-note { color: #627c8f; font-size: 8px; margin: 8px 0 0; }
.science-panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(11, 25, 39, .88); overflow: hidden; flex: 0 0 auto; }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 11px 13px; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-glyph { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; background: rgba(97,228,208,.08); color: var(--accent); font-size: 14px; }
.science-panel summary strong { display: block; font-size: 10px; font-weight: 680; }
.science-panel summary small { display: block; color: #6e8799; font-size: 8px; margin-top: 2px; }
.chevron { margin-left: auto; color: #7e98a9; font-size: 17px; transition: transform .2s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid rgba(132,166,185,.1); padding: 10px 13px 13px; }
.science-content h3 { color: #b8d0dc; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; margin: 9px 0 5px; }
.science-content h3:first-child { margin-top: 0; }
.science-content p { color: #8ea6b5; font-size: 9px; line-height: 1.55; margin: 5px 0; }
.equation { color: #bdebe4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.disclaimer { padding-top: 8px; border-top: 1px solid rgba(132,166,185,.1); color: #6f8a9b !important; }
.footer-bar { min-height: 23px; padding: 0 18px 4px; display: flex; justify-content: space-between; align-items: center; color: #4e697d; font-size: 7px; letter-spacing: .11em; font-weight: 700; }
.footer-bar b { color: #7390a3; padding: 0 3px; }
.footer-right { letter-spacing: .04em; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 980px) and (min-width: 681px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; padding: 10px; gap: 9px; }
  .topbar { padding: 0 15px; }
  .icon-button { padding: 0 9px; }
}
@media (max-width: 680px) {
  body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .app-shell { height: 100vh; height: 100dvh; }
  .topbar { min-height: 56px; padding: 0 10px; gap: 7px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .eyebrow { font-size: 7px; letter-spacing: .12em; }
  h1 { font-size: 14px; }
  .top-actions { gap: 4px; }
  .icon-button { min-width: 32px; min-height: 32px; padding: 0 7px; gap: 0; }
  .icon-button span { display: none; }
  .primary-action { min-width: 34px; }
  .icon-button svg { width: 15px; height: 15px; }
  .workspace { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 5px; overflow: hidden; }
  .stage-column { flex: 0 0 42dvh; min-height: 220px; gap: 6px; }
  .stage-heading { min-height: 17px; padding: 0 2px; }
  .stage-subtitle { font-size: 9px; }
  .stage-label { font-size: 8px; }
  .stage-meta { font-size: 8px; }
  .canvas-wrap { min-height: 0; border-radius: 11px; }
  .overlay-top-left { left: 11px; top: 11px; width: 135px; }
  .overlay-top-right { right: 11px; top: 11px; }
  .phase-name { font-size: 12px; }
  .formation-display { font-size: 21px; }
  .overlay-bottom-left { left: 11px; bottom: 10px; font-size: 8px; }
  .overlay-bottom-right { right: 11px; bottom: 10px; font-size: 7px; }
  .caption-strip { min-height: 47px; padding: 7px 9px; gap: 8px; border-radius: 9px; }
  .caption-icon { width: 22px; height: 22px; }
  .caption-label { font-size: 7px; }
  .caption-strip p { font-size: 9px; line-height: 1.3; margin-top: 2px; }
  .control-column { flex: 1 1 0; min-height: 0; padding-right: 0; gap: 7px; }
  .panel { padding: 10px 11px; border-radius: 11px; }
  .panel-kicker { font-size: 7px; }
  h2 { font-size: 12px; }
  .readout-grid { gap: 5px; margin-top: 8px; }
  .readout { padding: 6px 7px; border-radius: 7px; }
  .readout-name { font-size: 8px; }
  .readout-value { font-size: 16px; margin-top: 2px; }
  .readout-value small { font-size: 8px; }
  .readout-foot { font-size: 7px; }
  .formation-meter { margin-top: 7px; }
  .reynolds-line { margin-top: 6px; }
  .meter-head, .meter-ends { font-size: 8px; }
  .controls-panel .slider-list { gap: 8px; }
  .preset-row { margin-top: 8px; }
  .slider-list { margin-top: 9px; }
  .slider-label { font-size: 9px; }
  .slider-hint { font-size: 7px; }
  .quality-row { margin-top: 8px; padding-top: 7px; }
  .audit-values { margin-top: 7px; }
  .audit-note { margin-top: 5px; }
  .footer-bar { min-height: 17px; padding: 0 10px 3px; font-size: 6px; }
}
@media (max-width: 370px) {
  .stage-column { flex-basis: 40dvh; }
  .stage-subtitle { display: none; }
  .icon-button { min-width: 29px; padding: 0 5px; }
  .readout-value { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
