:root {
  color-scheme: light;
  --page: #f4f7f5;
  --ink: #152c31;
  --muted: #51666a;
  --teal: #13675e;
  --pale: #e9f3ee;
  --line: #d6dfdb;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button, select, input[type=range], input[type=checkbox], label[for=mixture] { cursor: pointer; }
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; }
button, select, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible {
  outline: 3px solid #3b8eb1;
  outline-offset: 3px;
}
button { padding: 0; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 2; padding: .75rem; background: white; }
.skip:focus { top: .5rem; }
.icon-defs { width: 0; height: 0; position: absolute; overflow: hidden; }
.icon { flex: none; width: 1.28rem; height: 1.28rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(1256px, calc(100% - clamp(2rem, 8vw, 9rem))); margin-inline: auto; }
.mast { border-bottom: 1px solid var(--line); background: #fbfcfa; }
.mast-inner { min-height: 4.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .72rem; color: var(--ink); font: 1.3rem var(--serif); text-decoration: none; }
.monogram { width: 2.12rem; height: 2.12rem; display: grid; place-items: center; border: 1px solid var(--teal); color: var(--teal); font: 550 .84rem var(--sans); letter-spacing: -.07em; }
nav { display: flex; gap: clamp(.75rem, 2.2vw, 2rem); }
nav a { text-decoration: none; color: var(--muted); font-size: .88rem; line-height: 2.25rem; }
nav a:hover, footer a:hover { color: var(--teal); text-decoration: underline; text-underline-offset: .24em; }
.intro { padding: clamp(1.55rem, 2.8vw, 2.6rem) 0 1.6rem; }
h1 { font: 400 clamp(2.75rem, 4.2vw, 4.15rem)/1.04 var(--serif); letter-spacing: -.055em; }
.intro p { color: var(--muted); margin-top: .65rem; font-size: 1.02rem; line-height: 1.5; max-width: 55rem; }
.dashboard { display: grid; gap: 1.15rem; grid-template-columns: minmax(0, 2.04fr) minmax(18rem, 1fr); }
.panel { min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: .6rem; box-shadow: 0 2px 4px #20392d06; scroll-margin-top: 1rem; }
.panel-head { min-height: 3.6rem; padding: .8rem clamp(.95rem, 1.6vw, 1.5rem); display: flex; align-items: center; justify-content: space-between; gap: .65rem; border-bottom: 1px solid var(--line); }
h2 { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.06rem; line-height: 1.3; font-weight: 630; letter-spacing: -.021em; }
h2 .icon { color: var(--teal); }
.status { display: inline-flex; align-items: center; gap: .42rem; font: 500 .78rem var(--mono); border: 1px solid #d1e6da; border-radius: 2rem; color: #246653; background: #eff8f1; padding: .26rem .55rem; }
.status::before { content: ""; width: .4rem; height: .4rem; background: #338659; border-radius: 50%; }
.status.paused, .status[data-paused=true], body:has(#pause[data-paused=true]) .status { color: #69615b; background: #f6f3ee; border-color: #e2ddd4; }
.status.paused::before, .status[data-paused=true]::before, body:has(#pause[data-paused=true]) .status::before { background: #8c8179; }
.chamber-body { margin: 0; padding: 1rem clamp(.82rem, 1.3vw, 1.35rem) 0; }
#chamber { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 480; border-radius: .28rem; background: #101e2a; touch-action: none; cursor: crosshair; }
.color-key { display: flex; justify-content: space-between; align-items: center; gap: .65rem; margin: .72rem 0 .85rem; color: var(--muted); font-size: .8rem; }
.scale-legend { display: flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .75rem; }
.spectrum { display: inline-block; height: .36rem; width: clamp(4.8rem, 9vw, 8rem); border-radius: 1rem; background: linear-gradient(90deg, #43c5ec, #63d6b5, #f5d36d, #fc995f, #f16e89); }
.stats { margin-top: auto; padding: 1rem clamp(.9rem, 1.6vw, 1.5rem); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fafcfb; border-top: 1px solid var(--line); }
.stats div + div { padding-left: clamp(.4rem, 1.5vw, 1.5rem); border-left: 1px solid var(--line); }
dt { color: var(--muted); font-size: .81rem; line-height: 1.4; }
.stats dd { font: 500 clamp(.98rem, 1.45vw, 1.32rem)/1.25 var(--mono); margin-top: .32rem; letter-spacing: -.055em; white-space: nowrap; }
.control-body, .sample-body { padding: 1.05rem clamp(.95rem, 1.6vw, 1.5rem) 1.22rem; }
.control-body { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: 1.08rem; }
.run-actions { display: flex; gap: .55rem; }
.run-actions button, .expansion { display: inline-flex; justify-content: center; align-items: center; gap: .55rem; min-height: 2.4rem; border: 1px solid #c6d3ce; background: #fff; border-radius: .33rem; font-weight: 580; font-size: .89rem; }
.run-actions button { flex: 1; }
.run-actions button.primary { background: var(--teal); color: white; border-color: var(--teal); }
.run-actions button.primary:hover { background: #104e48; }
.run-actions button:not(.primary):hover, .expansion:hover { border-color: var(--teal); background: #eff6f2; }
button .icon { width: 1.06rem; height: 1.06rem; }
.pause-mark { height: .76rem; width: .7rem; border-inline: .21rem solid currentColor; }
#pause[data-paused=true] .pause-mark, #pause[aria-label^="Resume"] .pause-mark { width: 0; height: 0; border: solid transparent; border-width: .43rem 0 .43rem .65rem; border-left-color: currentColor; }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.field-row label, .field-row > span:first-child { font-size: .91rem; font-weight: 530; }
.field-row output { border-radius: .24rem; padding: .2rem .48rem; background: #eff5f1; color: #1b6356; font: 500 .85rem var(--mono); }
.range-control input { width: 100%; height: 1.35rem; padding: 0; margin: .27rem 0 0; accent-color: var(--teal); }
.range-limits { color: #566b68; display: flex; justify-content: space-between; font: .75rem var(--mono); }
.speed-row, .mixture-row { min-height: 1.75rem; }
.select-wrap { display: flex; position: relative; }
.select-wrap::after { content: ""; position: absolute; top: calc(50% - .22rem); right: .7rem; width: .37rem; height: .37rem; border: solid var(--teal); border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); pointer-events: none; }
select { padding: .36rem 1.8rem .36rem .65rem; border: 1px solid #c5d2cc; border-radius: .3rem; background: #fff; appearance: none; font: .85rem var(--mono); }
.switch { display: inline-block; appearance: none; width: 2.2rem; height: 1.27rem; flex: none; margin: 0; border: 1px solid #aabbb4; background: #c0cdc6; border-radius: 1.2rem; position: relative; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.27rem - 6px); height: calc(1.27rem - 6px); background: white; border-radius: 50%; }
.switch:checked { background: var(--teal); border-color: var(--teal); }
.switch:checked::after { left: auto; right: 2px; }
.expansion { width: 100%; background: #f5f9f6; color: #235b51; }
.segment { display: inline-flex; background: #f0f4f1; border: 1px solid #d7e1db; border-radius: .36rem; padding: .13rem; gap: .16rem; }
.segment button { min-height: 1.72rem; padding: .2rem .55rem; border: 1px solid transparent; border-radius: .25rem; font-size: .81rem; color: var(--muted); background: none; }
.segment button[aria-pressed=true] { background: #fff; color: var(--teal); box-shadow: 0 1px 3px #21382e18; border-color: #d7e0da; font-weight: 600; }
.chart-body { padding: 1rem .85rem .7rem; }
#histogram { display: block; width: 100%; height: 305px; }
.sample-body p { color: var(--muted); line-height: 1.55; font-size: .88rem; }
.sample-totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1rem 0; }
.sample-totals div + div { border-left: 1px solid var(--line); padding-left: 1rem; }
.sample-totals dd { font: 500 1.68rem/1.3 var(--mono); color: var(--teal); letter-spacing: -.05em; }
.area-row { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.area-row > span:first-child, .history-label { font-size: .82rem; color: var(--muted); }
#area { font: .85rem var(--mono); }
.history-label { margin-top: .8rem; }
#history { display: block; width: 100%; height: 4rem; margin: .4rem 0 .55rem; }
.sample-body .sample-note { font-size: .8rem; }
.notice { padding: 1rem; border: 1px solid var(--line); margin: 0 0 1rem; }
footer { margin-top: 1.5rem; border-top: 1px solid var(--line); padding: 1.2rem 0 2.35rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--muted); font-size: .8rem; }
footer a { text-underline-offset: .2em; }
@media (max-width: 850px) {
  .wrap { width: calc(100% - 2rem); }
  .dashboard { grid-template-columns: minmax(0, 1.55fr) minmax(16rem, 1fr); gap: .8rem; }
  .control-body { gap: .8rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .stats div + div { padding: 0; border: 0; }
  .stats div:nth-child(even) { padding-left: .9rem; border-left: 1px solid var(--line); }
  h2 { font-size: 1rem; }
}
@media (max-width: 680px) {
  .dashboard { grid-template-columns: 1fr; }
  .intro { padding-block: 1.55rem 1.3rem; }
  .mast-inner { min-height: 3.6rem; }
  .brand { font-size: 1.12rem; gap: .48rem; }
  nav { gap: .65rem; }
  nav a { font-size: .8rem; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .stats div + div { padding-left: .55rem; border-left: 1px solid var(--line); }
  .stats dd { font-size: .93rem; }
  .control-body { gap: 1.05rem; }
  #histogram { height: 280px; }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 1.25rem); }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .68rem; }
  .stats div + div { border: 0; padding: 0; }
  .stats div:nth-child(even) { border-left: 1px solid var(--line); padding-left: .75rem; }
  .panel-head { padding: .78rem; }
  .segment button { padding-inline: .4rem; }
  footer { flex-wrap: wrap; }
}
@media (forced-colors: active) {
  .switch { appearance: auto; }
  .switch::after { display: none; }
  .switch:checked { outline: 1px solid; }
}

.theory-key, .history-key, .history-key span { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .8rem; }
.theory-key { margin: .8rem .5rem .2rem; cursor: pointer; }
.theory-key input { accent-color: var(--teal); margin: 0 .1rem 0 0; width: 1rem; height: 1rem; }
.theory-key i, .history-key i { display: inline-block; width: 1.25rem; height: 0; border-top: 2px solid var(--teal); }
.theory-key .dashed-key, .history-key .dashed-key { border-top-style: dashed; border-color: #566b68; }
.history-key { gap: 1.1rem; margin-bottom: .75rem; }

.extra-experiments { display: block; margin-top: 1.15rem; }
.extra-experiments summary { display: flex; align-items: center; gap: .8rem; padding: 1.2rem clamp(.95rem, 1.6vw, 1.5rem); cursor: pointer; list-style: none; }
.extra-experiments summary::-webkit-details-marker { display: none; }
.extra-experiments summary::before { content: ""; width: .4rem; height: .4rem; flex: none; border: solid var(--teal); border-width: 1.7px 1.7px 0 0; transform: rotate(45deg); margin-right: .1rem; }
.extra-experiments[open] summary::before { transform: rotate(135deg); }
.extra-experiments summary span, .group-title { font-size: 1rem; font-weight: 610; }
.extra-experiments summary small, .experiment-group p, .pressure-stat span { color: var(--muted); font-size: .85rem; line-height: 1.55; }
.extra-grid { padding: 1.35rem clamp(.95rem, 1.6vw, 1.5rem); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.8rem; border-top: 1px solid var(--line); }
.experiment-group { display: flex; flex-direction: column; align-items: stretch; gap: .85rem; }
.group-title { margin: 0 0 .25rem; }
.experiment-group + .experiment-group { border-left: 1px solid var(--line); padding-left: 1.5rem; }
.experiment-group select { width: 100%; font-family: var(--sans); }
.pressure-stat { display: flex; justify-content: space-between; gap: .7rem; align-items: baseline; }
.pressure-stat output { font: 1rem var(--mono); color: var(--teal); }
@media (max-width: 680px) {
  .extra-grid { grid-template-columns: 1fr; }
  .experiment-group + .experiment-group { border: 0; padding: 1rem 0 0; border-top: 1px solid var(--line); }
  .extra-experiments summary { display: grid; grid-template-columns: .6rem 1fr; gap: .25rem .7rem; }
  .extra-experiments summary small { grid-column: 2; }
}
