/* Dry Ice Simulator – shared styles for the room sizer and the workflow page */
:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
body{margin:0;padding:0}
img{max-width:100%}
[hidden]:not([hidden=until-found i]){display:none!important}
/* Layout: side view of a confined space of any size with a big number, then a live CO₂ graph, exposure tiles and the limits explained. */
:root {
  --bg: #eef1f2;        /* frost */
  --card: #fbfcfc;
  --ink: #1d2326;
  --muted: #5d686d;
  --line: #cfd7da;
  --co2: #c4361c;       /* CO₂ */
  --vent: #1f4fb8;      /* ventilation */
  --ice: #ffffff;
  --alt: #6a3fa0;       /* filling room curve */
  --ok: #1d7a55; --warn: #a86400; --bad: #c4361c;
  --f-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --f-data: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1518; --card: #172024; --ink: #e8eef0; --muted: #94a3a9; --line: #2a373c;
  --co2: #ff6a45; --alt: #c79bff; --vent: #6f9bff; --ice: #e9f3f6; --ok: #47c08b; --warn: #f0a640; --bad: #ff6a45; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0f1518; --card: #172024; --ink: #e8eef0; --muted: #94a3a9; --line: #2a373c;
  --co2: #ff6a45; --alt: #c79bff; --vent: #6f9bff; --ice: #e9f3f6; --ok: #47c08b; --warn: #f0a640; --bad: #ff6a45; color-scheme: dark }

body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); }
.wrap { max-width: 1100px; margin: 0 auto; padding-block: 24px 36px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 14px; }
header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px 24px; }
h1 { font: 700 clamp(24px, 3.4vw, 34px)/1.1 var(--f-display); margin: 0; text-wrap: balance; }
h2 { font: 600 13px var(--f-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; padding: 12px 14px; }
.ctl { display: grid; gap: 4px; min-width: 0; }
.ctl > span { font-size: 12px; color: var(--muted); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg button { font: 500 13.5px var(--f-body); padding: 7px 12px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; transition: background-color 150ms ease, color 150ms ease; white-space: nowrap; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--ink); font: 600 16px var(--f-body); cursor: pointer; }
.stepper button:disabled { color: var(--line); cursor: default; }
.stepper output { min-width: 66px; text-align: center; font: 500 13.5px var(--f-data); border-inline: 1px solid var(--line); line-height: 34px; font-variant-numeric: tabular-nums; }
.size { flex: 1 1 260px; }
.sizer { display: flex; align-items: center; gap: 10px; height: 34px; }
#vol { flex: 1; min-width: 0; accent-color: var(--co2); }
.sizer output { font: 500 15px var(--f-data); min-width: 54px; text-align: right; font-variant-numeric: tabular-nums; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button { font: 500 12px var(--f-body); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; cursor: pointer; }
.presets button[aria-pressed="true"] { color: var(--card); background: var(--ink); border-color: var(--ink); }
#size { display: block; width: 100%; height: 220px; cursor: pointer; }
.icon { font: 600 13.5px var(--f-body); width: 40px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; margin-left: auto; }
.icon:active, .seg button:active, .stepper button:active { transform: scale(0.97); }
button { transition: transform 160ms var(--ease-out); }
button:focus-visible { outline: 2px solid var(--vent); outline-offset: 2px; }

/* scene */
.scene { position: relative; overflow: hidden; }
#room { display: block; width: 100%; aspect-ratio: 16 / 7.6; max-width: 100%; }
.hud { position: absolute; top: 16px; left: 18px; display: grid; gap: 6px; pointer-events: none; }
.ppm { font: 500 clamp(34px, 6vw, 60px)/1 var(--f-data); color: var(--co2); font-variant-numeric: tabular-nums; }
.ppm small { font-size: 0.32em; color: var(--muted); margin-left: 6px; }
.pill { justify-self: start; font: 600 12px var(--f-body); letter-spacing: 0.05em; text-transform: uppercase; color: #fff; padding: 3px 10px; border-radius: 99px; background: var(--ok); transition: background-color 250ms ease; }
.clock { position: absolute; top: 16px; right: 18px; text-align: right; pointer-events: none; font: 400 12.5px/1.5 var(--f-data); color: var(--muted); font-variant-numeric: tabular-nums; }
.clock b { display: block; font-size: 22px; font-weight: 500; color: var(--ink); }
.readouts { display: flex; flex-wrap: wrap; gap: 4px 22px; padding: 9px 18px 11px; border-top: 1px solid var(--line); font: 400 12.5px var(--f-data); color: var(--muted); font-variant-numeric: tabular-nums; }
.readouts .in { color: var(--co2); } .readouts .out { color: var(--vent); }

/* graph */
.graph { padding: 12px 14px 8px; display: grid; gap: 6px; }
.graph-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; align-items: baseline; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--co2); vertical-align: middle; margin-right: 6px; }
.legend i.prev { border-top: 2px dashed var(--muted); }
#graph { display: block; width: 100%; height: 240px; cursor: crosshair; touch-action: pan-y; }
.hint { font-size: 12px; color: var(--muted); }

/* exposure tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 12px 14px; display: grid; gap: 2px; border-left: 4px solid var(--ok); }
.tile.warn { border-left-color: var(--warn); } .tile.bad { border-left-color: var(--bad); }
.tile span { font-size: 12.5px; color: var(--muted); }
.tile b { font: 500 22px var(--f-data); font-variant-numeric: tabular-nums; }
.tile small { font-size: 12px; color: var(--muted); }

/* limits */
.limits { padding: 14px; display: grid; gap: 10px; }
.limits-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.lim { display: grid; grid-template-columns: 112px minmax(0, 1fr) 220px; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.lim .v { font: 500 15px var(--f-data); font-variant-numeric: tabular-nums; }
.lim .v small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.lim .what b { display: block; font-weight: 600; }
.lim .what p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; max-width: 62ch; }
.lim .what cite { font-style: normal; font-size: 12px; color: var(--muted); }
.lim .now { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--bg); }
.lim .now b { font-family: var(--f-data); font-weight: 500; }
.lim .now.ok { color: var(--ok); } .lim .now.warn { color: var(--warn); } .lim .now.bad { color: var(--bad); }
.lim.band .v { color: var(--muted); }
.workonly[hidden], #ctlN[hidden] { display: none; }
.sig { color: var(--ink); font-weight: 500; }
.foot { font-size: 12px; color: var(--muted); max-width: 90ch; margin: 0; }

@media (max-width: 760px) {
  #room { aspect-ratio: 4 / 3.3; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lim { grid-template-columns: 84px minmax(0, 1fr); }
  .lim .now { grid-column: 2; }
  .seg button { padding: 7px 9px; font-size: 13px; }
  .icon { margin-left: 0; }
  #scen { display: none; }
  #graph { height: 200px; }
}
@media (hover: hover) and (pointer: fine) { .icon:hover, .stepper button:not(:disabled):hover, .seg button:not([aria-pressed="true"]):hover { background: var(--bg); } }

/* site navigation */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.brand { font: 700 16px var(--f-display); color: var(--ink); text-decoration: none; }
.tabs { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.tabs a { font: 500 13.5px var(--f-body); padding: 7px 14px; color: var(--ink); text-decoration: none; border-left: 1px solid var(--line); white-space: nowrap; transition: background-color 150ms ease, color 150ms ease; }
.tabs a:first-child { border-left: 0; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--card); }
a:focus-visible { outline: 2px solid var(--vent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .tabs a:not([aria-current="page"]):hover { background: var(--bg); } }

/* playback bar under the scene and under the graph */
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 18px 11px; border-top: 1px solid var(--line); }
.graph .transport { padding: 8px 0 4px; margin-top: 2px; }
.tbtn { font: 500 13px var(--f-body); height: 34px; min-width: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; }
.tbtn.play { min-width: 52px; background: var(--ink); color: var(--card); border-color: var(--ink); }
.tbtn:disabled { color: var(--line); cursor: default; }
.tbtn:not(:disabled):active { transform: scale(0.97); }
.spd { font: 500 13px var(--f-data); color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .tbtn:not(.play):not(:disabled):hover { background: var(--bg); } }
@media (max-width: 760px) { .transport { padding: 8px 14px 10px; } .tbtn { padding: 0 9px; } }

/* derived value under a control */
.note { max-width: 34ch; }

/* number fields in a stepper, dashed secondary buttons */
.ctl > .stepper { justify-self: start; }
.kgf { display: flex; align-items: center; gap: 4px; border-inline: 1px solid var(--line); padding: 0 8px; height: 34px; font: 500 13.5px var(--f-data); }
.kgf input { width: 44px; border: 0; background: transparent; color: var(--ink); font: 500 14px var(--f-data); text-align: right; padding: 0; }
.kgf input:focus-visible { outline: 2px solid var(--vent); outline-offset: 2px; border-radius: 3px; }
.btn2 { font: 500 13px var(--f-body); border: 1px dashed var(--line); background: transparent; color: var(--ink); border-radius: 9px; padding: 7px 12px; cursor: pointer; }

/* advanced: each container on its own */
.adv { flex: 1 1 100%; display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.adv-h { font-size: 12px; color: var(--muted); }
.arow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.arow b { font: 600 12px var(--f-data); width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--card); display: inline-grid; place-items: center; }
.arow .role { min-width: 86px; color: var(--muted); font-size: 12.5px; }
.arow input { width: 52px; font: 500 13.5px var(--f-data); padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); text-align: right; }
.arow input:focus-visible { outline: 2px solid var(--vent); outline-offset: 1px; }
.arow .when { color: var(--muted); font: 400 12px var(--f-data); }
.adv .btn2 { justify-self: start; }
.foot a { color: inherit; }

/* validation write-up */
.doc { max-width: 880px; }
.docsec { padding: 16px 18px; display: grid; gap: 10px; }
.docsec p, .docsec ol, .docsec ul { margin: 0; max-width: 78ch; }
.docsec ol, .docsec ul { padding-left: 22px; display: grid; gap: 6px; }
.docsec table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.docsec th { text-align: left; font: 600 12px var(--f-body); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.docsec td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.docsec tr:last-child td { border-bottom: 0; }
.docsec td:last-child { font-family: var(--f-data); font-size: 12.5px; }
.docsec { min-width: 0; overflow-wrap: anywhere; }
.docsec code { font: 400 13px var(--f-data); background: var(--bg); padding: 1px 5px; border-radius: 5px; }
