/* Combustion — on top of calc.css */
main.cb .tabs { grid-template-columns: repeat(3, 1fr); }
main.cb .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.cb .stage-bar .hist { margin-left: auto; }
#view, #tChart { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
.hit { fill: transparent; stroke: none; }
.handle { cursor: ew-resize; }
.handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
.handle:hover .knob, .handle:focus .knob { fill: var(--sel); }

/* charts */
.cb-grid { fill: var(--fill-2); }
.cb-frame { fill: none; stroke: var(--steel-350); stroke-width: .8; pointer-events: none; }
.cb-tick { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.cb-axt { font-size: 11px; font-weight: 500; fill: var(--text-2); }
.cb-o2 { fill: none; stroke: var(--good); stroke-width: 2.2; }
.cb-co2 { fill: none; stroke: var(--text-2); stroke-width: 2.2; }
.cb-tad { fill: none; stroke: var(--heat); stroke-width: 2.2; }
.ch-l { font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--surface, #fff); stroke-width: 3px; stroke-linejoin: round; }
.cb-lo2 { fill: var(--olive); }
.cb-lco2 { fill: var(--steel-850); }
.cb-ltad { fill: var(--x-a3402a, #a3402a); }
.cb-op { stroke: var(--sel); stroke-width: 1.2; stroke-dasharray: 4 3; fill: none; pointer-events: none; }
.cb-dot { stroke: var(--halo); stroke-width: 1.5; }
.cb-dot.o2 { fill: var(--good); }
.cb-dot.co2 { fill: var(--text-2); }
.cb-dot.tad { fill: var(--heat); }
.cb-seg-r { stroke: var(--surface, #fff); stroke-width: .6; }
.cb-blab { font-size: 11.5px; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.cb-blab .k { font-weight: 600; fill: var(--text); }
.pill rect { fill: var(--surface, #fff); stroke: var(--steel-300); }
.pill text { font-size: 11.5px; font-weight: 600; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.pill.o2 rect { stroke: color-mix(in srgb, var(--good) 50%, transparent); } .pill.o2 text { fill: var(--olive); }
.pill.co2 rect { stroke: color-mix(in srgb, var(--text-2) 45%, transparent); } .pill.co2 text { fill: var(--steel-850); }
.pill.tad rect { stroke: color-mix(in srgb, var(--heat) 50%, transparent); } .pill.tad text { fill: var(--x-a3402a, #a3402a); }
.pill.ea rect { stroke: var(--sel); } .pill.ea text { fill: var(--sel); }
.pill.editable { cursor: text; }
.pill.editable:hover rect, .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
.pill.editable:focus { outline: none; }
.stage, .block { position: relative; }
.cb-edit { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--surface, #fff); border: 1.5px solid var(--sel); border-radius: 9px; padding: 2px 8px 2px 4px; box-shadow: 0 6px 18px rgba(20, 22, 28, .14); }
.cb-edit input { width: 72px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; background: transparent; color: var(--text); }
.cb-edit span { font-size: 11.5px; color: var(--text-3); }

/* live strip and flags */
.cb-live { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 38px; align-items: center; }
.cb-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.cb-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.cb-flags span { font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.cb-flags span.cb-err { color: var(--bad-ink, #b0321f); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.cb-seg { margin-bottom: 6px; }
.f.cb-row { grid-template-columns: minmax(0, 1fr) 104px 22px; }
.cb-x { padding: 0 4px; font-size: 15px; line-height: 1; color: var(--text-3); }
.cb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.cb-chip { border: 1px solid var(--line); background: var(--surface, #fff); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; color: var(--text-2); cursor: pointer; }
.cb-chip:hover { border-color: var(--text-3); color: var(--text); }
#panel .small-note.cb-bad { color: var(--bad-ink, #b0321f); }
#panel input.bad { color: var(--bad); }
#panel.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
#panel.fade-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px); mask-image: linear-gradient(to bottom, transparent, #000 28px); }
#panel.fade-t.fade-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); }

/* summary, tables */
.cb-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 38ch; }
.cb-tag { display: inline-block; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; line-height: 1.5; }
.cb-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
table.cb-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.cb-table th { font-size: 12px; font-weight: 500; color: var(--text-3); text-align: right; padding: 6px 8px; white-space: nowrap; }
table.cb-table tr.u th { font-weight: 400; font-size: 11.5px; padding-top: 0; border-bottom: 1px solid var(--line); }
table.cb-table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.cb-table .l { text-align: left; white-space: normal; }
table.cb-table tr.tot td { font-weight: 600; }
.cb-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.cb-dim { color: var(--text-3); font-size: 12px; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }

@media (max-width: 1100px) { .cb-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  #checks thead { display: none; }
  #checks, #checks tbody { display: block; width: 100%; }
  #checks tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  #checks td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  #checks td.chk { grid-column: 1; grid-row: 1; }
  #checks td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; }
  #checks td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  #checks td:nth-child(3) { grid-column: 2; grid-row: 2; font-size: 12.5px; text-align: right; }
  #checks td:nth-child(2)::before { content: "actual "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "allowed "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); min-width: 0; }
  table.cb-table th, table.cb-table td { padding: 6px 4px; font-size: 12px; }
  .cb-dim { display: none; }
}
@media print { .cb-edit { display: none !important; } }
.f.cb-pre { grid-template-columns: auto minmax(0, 1fr); }
.f.cb-pre > label { display: block; }
.f.cb-pre select { width: 100%; min-width: 0; }

/* flue-gas fills in dark, picked by hand: text-2 and the lifted blue made a glowing light stack in the wet-gas bar */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --cb-gas-co2: #7a776f; --cb-gas-h2o: #4d72a6; }
}
@media screen {
  :root[data-theme="dark"] { --cb-gas-co2: #7a776f; --cb-gas-h2o: #4d72a6; }
}
/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-6e7177: #85827f; --x-a3402a: #e38b77; --x-b8860b: #deb466; --x-cfe5d8: #2a3830;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-6e7177: #85827f; --x-a3402a: #e38b77; --x-b8860b: #deb466; --x-cfe5d8: #2a3830;
  }
}
/* theme-auto:end */
