:root {
  color-scheme: dark;
  --bg: #07101b;
  --panel: #0d1927;
  --panel-2: #101f30;
  --panel-3: #132438;
  --line: rgba(155, 187, 211, .13);
  --line-strong: rgba(155, 187, 211, .23);
  --text: #e8f1f7;
  --muted: #8fa4b6;
  --soft: #627b90;
  --cyan: #65d7e8;
  --cyan-2: #35a8c4;
  --amber: #ffb86b;
  --amber-2: #f28b4d;
  --green: #9be2c1;
  --radius: 16px;
  --grid: 8px;
  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%; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; background: radial-gradient(ellipse at 48% -18%, rgba(34, 89, 111, .22), transparent 44%), var(--bg); }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
.topbar { height: 68px; flex: 0 0 68px; padding: 0 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(7, 16, 27, .82); }
.brand-lockup, .topbar-right, .seed-chip, .icon-button { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(101, 215, 232, .35); border-radius: 11px; position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; background: rgba(44, 130, 150, .12); }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--cyan); box-shadow: 0 0 10px rgba(101, 215, 232, .4); }
.brand-mark span:nth-child(1) { height: 12px; opacity: .6; }.brand-mark span:nth-child(2) { height: 20px; }.brand-mark span:nth-child(3) { height: 15px; opacity: .75; }
.eyebrow { color: #7792a7; font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.4; }
.brand-name { font-size: 14px; font-weight: 680; letter-spacing: .015em; margin-top: 2px; }
.topbar-right { gap: 18px; }
.seed-chip { gap: 7px; color: #91a8ba; font-size: 10px; letter-spacing: .08em; font-weight: 700; }
.seed-dot { width: 6px; height: 6px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 10px rgba(101, 215, 232, .8); }
.number-note { color: #647d91; font-size: 8px; letter-spacing: .04em; font-weight: 500; text-transform: lowercase; }
.icon-button { gap: 8px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; background: rgba(17, 34, 50, .65); font-size: 11px; font-weight: 650; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.icon-button:hover { border-color: rgba(101, 215, 232, .55); background: rgba(34, 70, 89, .55); transform: translateY(-1px); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: var(--cyan); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.workspace { width: min(1560px, 100%); margin: 0 auto; padding: 20px 24px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 16px; flex: 1; }
body.embed-mode .workspace { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2c4558 transparent; }
.visual-column, .control-column { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(16, 31, 47, .96), rgba(10, 22, 35, .97)); box-shadow: 0 14px 34px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .018); }
.stage-card { padding: 20px 20px 16px; overflow: hidden; }
.stage-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 0 2px 16px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(22px, 2.2vw, 29px); line-height: 1.12; letter-spacing: -.045em; font-weight: 720; margin-top: 5px; }
.stage-subtitle { color: var(--muted); font-size: 12px; margin-top: 7px; line-height: 1.5; }
.state-pill { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(101, 215, 232, .22); background: rgba(36, 106, 123, .12); color: #a9e9ef; border-radius: 99px; padding: 8px 11px; font-size: 8px; letter-spacing: .1em; font-weight: 800; margin-top: 7px; white-space: nowrap; }
.state-pulse { width: 6px; height: 6px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 0 4px rgba(101, 215, 232, .1), 0 0 10px var(--cyan); }
.state-pill.warning { color: #ffd1a0; border-color: rgba(255, 184, 107, .25); background: rgba(190, 108, 52, .12); }
.state-pill.warning .state-pulse { background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 184, 107, .1), 0 0 10px var(--amber); }
.canvas-wrap { position: relative; height: clamp(330px, 42vw, 470px); min-height: 300px; overflow: hidden; border: 1px solid rgba(101, 164, 190, .17); border-radius: 13px; background: #071724; }
.canvas-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(5, 17, 27, .04), transparent 25%, transparent 75%, rgba(5, 17, 27, .14)); box-shadow: inset 0 0 80px rgba(3, 11, 19, .25); }
canvas { display: block; width: 100%; height: 100%; }
.canvas-corner { position: absolute; z-index: 1; left: 14px; display: flex; flex-direction: column; gap: 3px; color: #7392a5; font-size: 9px; text-shadow: 0 1px 8px #06111a; pointer-events: none; }
.corner-top-left { top: 13px; }.corner-bottom-left { bottom: 13px; }
.corner-kicker { color: #a9c5d4; font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.canvas-overlay-note { position: absolute; z-index: 1; right: 14px; bottom: 13px; color: rgba(155, 193, 209, .72); font-size: 8px; letter-spacing: .12em; font-weight: 700; display: flex; align-items: center; gap: 7px; pointer-events: none; }
.overlay-line { width: 20px; height: 1px; background: var(--amber); box-shadow: 0 0 7px rgba(255, 184, 107, .6); }
.legend-row { display: flex; flex-wrap: wrap; gap: 13px 20px; padding: 14px 3px 12px; border-bottom: 1px solid var(--line); }
.legend-item { display: flex; align-items: center; gap: 7px; color: #92a7b7; font-size: 9px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend-swatch.water { background: #48b8d1; box-shadow: 0 0 9px rgba(72, 184, 209, .3); }.legend-swatch.gas { background: var(--amber); box-shadow: 0 0 8px rgba(255, 184, 107, .25); }.legend-swatch.pit { background: #446b7e; }.legend-swatch.front { background: transparent; border: 1px solid var(--amber); border-radius: 50%; }
.caption-strip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 3px 1px; }
.caption-icon { flex: 0 0 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--cyan); background: rgba(70, 169, 190, .12); font-size: 15px; }
.caption-label { color: #7894a8; font-size: 8px; font-weight: 800; letter-spacing: .14em; margin: 1px 0 4px; }
.caption-strip p { color: #b9cbd6; font-size: 11px; line-height: 1.5; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric-card { min-height: 112px; padding: 13px 14px 12px; }
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.metric-label { color: #8ba3b5; font-size: 8px; letter-spacing: .1em; font-weight: 750; }
.metric-tag { color: #7893a5; font-size: 7px; letter-spacing: .06em; font-weight: 750; white-space: nowrap; }
.metric-tag.illustrative { color: #d4b78e; }.metric-tag.scaled { color: #a4b5cb; }.metric-tag.model { color: #8fc9c8; }.metric-tag.textbook { color: #9dd7c4; }
.metric-value { display: flex; align-items: baseline; gap: 5px; font-size: clamp(21px, 2vw, 27px); font-weight: 690; letter-spacing: -.045em; margin-top: 13px; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 10px; color: #9ab0bf; letter-spacing: 0; font-weight: 600; }
.metric-foot { color: #71899b; font-size: 8px; margin-top: 6px; line-height: 1.35; }
.metric-bar { height: 4px; border-radius: 5px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 9px; }
.metric-bar span { display: block; height: 100%; width: 93.8%; border-radius: inherit; background: linear-gradient(90deg, #3aabc2, #73d8d8); transition: width .3s ease; }
.science-panel { overflow: hidden; }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 14px 16px; user-select: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-summary-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--cyan); background: rgba(74, 174, 193, .12); font-size: 17px; }
.science-panel summary strong { display: block; font-size: 11px; }.science-panel summary small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.summary-chevron { margin-left: auto; color: #7c95a8; font-size: 17px; transition: transform .2s; }.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.equation-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; padding: 14px 0; }
.equation-card { background: rgba(5, 17, 28, .42); border: 1px solid rgba(145, 177, 198, .1); border-radius: 10px; padding: 12px; }
.equation-name { color: #7f9bad; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.equation { color: #b8eef0; font: 17px Georgia, serif; margin: 10px 0 8px; white-space: nowrap; }
.equation-card p { color: #8ea4b3; font-size: 9px; line-height: 1.55; }
.assumption-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; padding: 4px 0 14px; }
.assumption-grid h3 { color: #d9e6ed; font-size: 10px; margin-bottom: 9px; }
.assumption-grid ul { margin: 0; padding-left: 16px; color: #91a7b5; font-size: 9px; line-height: 1.6; }
.assumption-grid li + li { margin-top: 4px; }
.assumption-grid dl { margin: 0; display: grid; gap: 7px; }
.assumption-grid dl div { display: flex; justify-content: space-between; gap: 8px; font-size: 8px; border-bottom: 1px solid rgba(145,177,198,.08); padding-bottom: 5px; }
.assumption-grid dt { color: #91a7b5; }.assumption-grid dd { margin: 0; color: #d2e0e7; text-align: right; white-space: nowrap; }.assumption-grid em { display: block; color: #6f8b9e; font-size: 7px; font-style: normal; margin-top: 2px; }
.audit-line { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid rgba(111, 206, 172, .16); background: rgba(56, 134, 112, .08); border-radius: 10px; }
.audit-check { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #9be2c1; background: rgba(111, 206, 172, .13); font-size: 12px; }
.audit-line strong { display: block; color: #b8e4d4; font-size: 9px; }.audit-line p { color: #8eaa9f; font-size: 8px; margin-top: 3px; line-height: 1.4; }
.audit-result { margin-left: auto; color: #a8dfc6; font-size: 10px; font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.disclaimer { color: #70899a; font-size: 8px; text-align: center; margin-top: 12px; }
.control-card, .preset-card, .playback-card { padding: 17px; }
.control-heading, .preset-heading, .playback-heading { display: flex; justify-content: space-between; align-items: center; }
.control-heading h2, .preset-heading h2, .playback-heading h2 { font-size: 14px; letter-spacing: -.02em; margin-top: 4px; }
.control-glyph { font-size: 28px; color: var(--cyan); opacity: .65; transform: rotate(-20deg); }
.control-group { padding: 17px 0 15px; border-bottom: 1px solid var(--line); }
.control-group:first-of-type { margin-top: 4px; }.last-control { border-bottom: 0; padding-bottom: 1px; }
.control-label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.control-label-row label { color: #d6e3ea; font-size: 10px; font-weight: 650; }
.control-label-row output { color: #9ce3e9; font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 18px; background: transparent; margin: 9px 0 3px; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #287c91, #4cc1d0 60%, #274354); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #287c91, #4cc1d0 60%, #274354); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #d5fbff; border: 3px solid #43b6c8; box-shadow: 0 0 0 4px rgba(67,182,200,.13), 0 0 12px rgba(67,182,200,.35); margin-top: -5px; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #d5fbff; border: 3px solid #43b6c8; box-shadow: 0 0 0 4px rgba(67,182,200,.13); }
.range-ends { display: flex; justify-content: space-between; gap: 6px; color: #647f92; font-size: 7px; }.range-ends em { color: #526e81; font-size: 6px; font-style: normal; }
.control-hint { color: #758d9f; font-size: 8px; line-height: 1.5; margin-top: 8px; }
.preset-card { padding-bottom: 14px; }
.preset-buttons { display: grid; gap: 8px; margin-top: 13px; }
.preset-button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(7, 18, 29, .5); text-align: left; cursor: pointer; transition: .2s ease; }
.preset-button:hover, .preset-button.active { border-color: rgba(101,215,232,.38); background: rgba(40, 102, 120, .13); }
.preset-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; }.preset-icon.wet { color: #78d8e8; background: rgba(76,185,205,.12); }.preset-icon.dry { color: #ffc07c; background: rgba(229,145,75,.12); }
.preset-button strong { display: block; font-size: 9px; font-weight: 700; }.preset-button small { display: block; color: #7991a2; font-size: 8px; margin-top: 3px; }
.preset-arrow { margin-left: auto; color: #7893a5; font-size: 13px; }
.fps-chip { color: #8bd8c1; background: rgba(83, 170, 139, .1); border: 1px solid rgba(83,170,139,.16); padding: 5px 7px; border-radius: 7px; font-size: 8px; font-weight: 750; }.fps-chip small { color: #729e91; font-size: 7px; }
.playback-buttons { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 7px; margin-top: 14px; }
.run-button, .secondary-button { min-height: 36px; border-radius: 9px; display: flex; justify-content: center; align-items: center; gap: 7px; cursor: pointer; font-size: 9px; font-weight: 700; transition: .2s ease; }
.run-button { background: linear-gradient(135deg, #45b8c9, #27869d); border: 1px solid rgba(101,215,232,.4); color: #06141d; box-shadow: 0 5px 18px rgba(35, 145, 166, .16); }.run-button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line-strong); background: rgba(19, 39, 57, .65); color: #b6c9d4; }.secondary-button:hover { border-color: rgba(101,215,232,.4); color: #e6f6fa; background: rgba(32,66,84,.6); }.secondary-button span { color: var(--cyan); font-size: 13px; }
.quality-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 11px; border-bottom: 1px solid var(--line); color: #8299aa; font-size: 8px; }
.quality-toggle { display: flex; gap: 3px; padding: 3px; background: rgba(3, 13, 22, .55); border: 1px solid var(--line); border-radius: 8px; }.quality-toggle button { border: 0; border-radius: 5px; background: transparent; padding: 4px 9px; color: #71899b; font-size: 8px; cursor: pointer; }.quality-toggle button[aria-pressed="true"] { background: #1b3b4e; color: #a9e8ef; box-shadow: inset 0 0 0 1px rgba(101,215,232,.16); }
.time-row { display: flex; justify-content: space-between; gap: 6px; padding-top: 11px; color: #6e8799; font-size: 7px; letter-spacing: .08em; }.time-row b { color: #b7cbd6; font-size: 8px; font-weight: 650; letter-spacing: 0; margin-left: 3px; font-variant-numeric: tabular-nums; }.time-row b small { color: #6d8798; font-size: 6px; font-weight: 500; }
.tip-card { display: flex; gap: 10px; padding: 12px 13px; border: 1px solid rgba(255, 184, 107, .15); border-radius: 12px; background: rgba(150, 91, 43, .07); }
.tip-mark { flex: 0 0 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #ffca8c; background: rgba(255,184,107,.12); font: 700 10px Georgia, serif; }.tip-card p { color: #9aa9af; font-size: 8px; line-height: 1.55; }.tip-card strong { color: #e6bd8e; }
.footer { width: min(1560px, 100%); margin: 0 auto; padding: 0 24px 13px; display: flex; justify-content: space-between; gap: 12px; color: #50697b; font-size: 7px; letter-spacing: .09em; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1fr) 360px; }.canvas-wrap { height: 500px; } }
@media (max-width: 1120px) { .workspace { grid-template-columns: minmax(0,1fr) 310px; padding: 16px; gap: 12px; }.stage-card { padding: 16px; }.control-card, .preset-card, .playback-card { padding: 14px; }.metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.metric-card { min-height: 100px; } }
@media (max-width: 820px) {
  .topbar { height: 60px; flex-basis: 60px; padding: 0 15px; }.topbar-right { gap: 10px; }.seed-chip { font-size: 8px; gap: 5px; }.number-note { display: none; }.icon-button { padding: 8px 9px; font-size: 9px; }.icon-button svg { width: 14px; height: 14px; }
  .workspace { display: flex; flex-direction: column; gap: 12px; padding: 12px; }.visual-column, .control-column { width: 100%; gap: 12px; }.canvas-wrap { height: min(43vh, 350px); min-height: 255px; }.stage-card { padding: 14px; }.stage-heading { padding-bottom: 12px; }.stage-subtitle { font-size: 10px; max-width: 320px; }.state-pill { padding: 7px 8px; font-size: 7px; }.legend-row { gap: 9px 13px; padding: 11px 2px; }.legend-item { font-size: 8px; }.caption-strip { padding-top: 11px; }.caption-strip p { font-size: 10px; }
  .control-column { display: grid; grid-template-columns: 1fr; }.control-card { order: 1; }.preset-card { order: 2; }.playback-card { order: 3; }.tip-card { order: 4; }
  .footer { padding: 0 14px 10px; font-size: 6px; }
}
@media (max-width: 480px) {
  .brand-mark { width: 30px; height: 30px; }.brand-name { font-size: 12px; }.eyebrow { font-size: 8px; }.icon-button span { display: none; }.icon-button { width: 34px; height: 34px; justify-content: center; padding: 0; }.seed-chip { letter-spacing: .04em; }
  .workspace { padding: 9px; gap: 10px; }.visual-column, .control-column { gap: 10px; }.stage-card { padding: 12px; }.stage-heading { gap: 7px; }.stage-heading h1 { font-size: 22px; }.stage-subtitle { max-width: 220px; font-size: 9px; }.state-pill { white-space: normal; max-width: 106px; line-height: 1.35; font-size: 6px; gap: 6px; }.canvas-wrap { height: 310px; min-height: 270px; }.canvas-corner { left: 10px; font-size: 8px; }.canvas-overlay-note { right: 9px; font-size: 6px; }.legend-row { gap: 8px 12px; }.legend-item { font-size: 7px; }.legend-swatch { width: 8px; height: 8px; }.metrics-grid { gap: 8px; }.metric-card { min-height: 96px; padding: 11px; }.metric-label { font-size: 7px; }.metric-tag { font-size: 6px; }.metric-value { font-size: 23px; margin-top: 11px; }.metric-foot { font-size: 7px; }.control-card, .preset-card, .playback-card { padding: 14px; }.equation-grid { grid-template-columns: 1fr; }.equation-card { padding: 10px; }.equation { font-size: 16px; }.assumption-grid { grid-template-columns: 1fr; gap: 14px; }.assumption-grid dl div { font-size: 8px; }.footer { flex-direction: column; gap: 4px; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
