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

/* the system */
.pu-datum { stroke: var(--steel-500); stroke-width: .8; stroke-dasharray: 8 3 2 3; pointer-events: none; }
.pu-tank { fill: none; stroke: var(--steel-700); stroke-width: 1.6; stroke-linejoin: round; }
.pu-liq { fill: var(--sel-line); stroke: none; pointer-events: none; }
.pu-surf { stroke: var(--x-6f93b8, #6f93b8); stroke-width: 1.2; pointer-events: none; }
.pu-tri { fill: var(--surface); stroke: var(--x-4f7aa6, #4f7aa6); stroke-width: 1; }
.pu-tric { stroke: var(--x-4f7aa6, #4f7aa6); stroke-width: 1; }
.pu-pipe { fill: none; stroke: var(--steel-700); stroke-linejoin: round; stroke-linecap: butt; pointer-events: none; }
.pu-bore { fill: none; stroke: var(--sel-line); stroke-linejoin: round; stroke-linecap: butt; pointer-events: none; }
.pu-flow { fill: none; stroke: var(--x-4f7aa6, #4f7aa6); stroke-width: 1.6; stroke-dasharray: 3 11; stroke-linecap: round; pointer-events: none; }
.pu-casing { fill: var(--steel-200); stroke: var(--steel-750); stroke-width: 1.3; }
.pu-noz { fill: var(--steel-300); stroke: var(--steel-750); stroke-width: 1; }
.pu-imp { fill: var(--steel-50); stroke: var(--steel-500); stroke-width: .8; }
.pu-vane { fill: none; stroke: var(--steel-700); stroke-width: 1.2; stroke-linecap: round; }
.pu-hub { fill: var(--steel-700); }
.pu-frame { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1; }
.pu-coup { fill: var(--steel-350); stroke: var(--steel-700); stroke-width: .9; }
.pu-motor { fill: var(--steel-250); stroke: var(--steel-750); stroke-width: 1.2; }
.pu-fin { stroke: var(--steel-500); stroke-width: .8; }
.pu-fan { fill: var(--steel-350); stroke: var(--steel-700); stroke-width: .9; }
.pu-base { fill: var(--steel-350); stroke: var(--steel-700); stroke-width: .9; }
.pu-foot { stroke: var(--steel-700); stroke-width: 1.4; }
.pu-valve { fill: var(--surface); stroke: var(--steel-850); stroke-width: 1.4; stroke-linejoin: round; }
.pu-stem { stroke: var(--steel-850); stroke-width: 1.6; stroke-linecap: round; }
.pu-track { stroke: var(--steel-300); stroke-width: 3; stroke-linecap: round; }
.pu-track.on { stroke: color-mix(in srgb, var(--sel) 45%, transparent); }
.pu-dim { stroke: var(--steel-550); stroke-width: .9; }
.pu-dimh { fill: var(--steel-550); }
.pu-load line { stroke: var(--load); stroke-width: 1.8; }
.pu-load path { fill: var(--load); stroke: none; }
.pu-flowa line { stroke: var(--x-4f7aa6, #4f7aa6); } .pu-flowa path { fill: var(--x-4f7aa6, #4f7aa6); }
.pu-bub { fill: var(--surface); stroke: var(--bad); stroke-width: 1; animation: pu-bub 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pu-bub { 0% { transform: scale(.3); opacity: .2; } 55% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pu-bub { animation: none; } }
.pu-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.pu-role { font-size: 11px; fill: var(--text-3); }
.pu-nm { cursor: text; }
.pu-nm:hover .pu-name, .pu-nm:focus .pu-name { fill: var(--sel); }
.pu-nm:focus { outline: none; }

/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.dimv rect { stroke: var(--steel-200); }
#view .pill.flowp rect { stroke: color-mix(in srgb, var(--x-4f7aa6, #4f7aa6) 55%, transparent); } #view .pill.flowp text { fill: var(--x-2f5c8a, #2f5c8a); font-weight: 600; }
#view .pill.headp rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.headp text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.npshp { cursor: pointer; }
#view .pill.npshp.good rect { stroke: color-mix(in srgb, var(--good) 50%, transparent); } #view .pill.npshp.good text { fill: var(--good); font-weight: 600; }
#view .pill.npshp.warn rect { stroke: color-mix(in srgb, var(--amber) 60%, transparent); } #view .pill.npshp.warn text { fill: var(--x-a46d10, #a46d10); font-weight: 600; }
#view .pill.npshp.bad rect { stroke: color-mix(in srgb, var(--bad) 60%, transparent); } #view .pill.npshp.bad text { fill: var(--bad); font-weight: 600; }
#view .pill.linep { cursor: pointer; }
#view .pill.linep:hover rect, #view .pill.linep:focus rect { stroke: var(--sel); }
#view .pill.linep:focus { outline: none; }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect, #view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.pu-edit { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1.5px solid var(--sel); border-radius: 9px; padding: 2px 8px 2px 4px; box-shadow: 0 6px 18px rgba(20, 22, 28, .14); }
.pu-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.pu-edit-name input { width: 180px; text-align: center; }
.pu-edit span { font-size: 11.5px; color: var(--text-3); }

/* live strip and flags */
.pu-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; }
.pu-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.pu-live i { font-style: normal; color: var(--text-3); }
.pu-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pu-flags span { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }

/* panel */
.pu-seg { margin-bottom: 6px; }
#panel input.bad, #panel textarea.bad { color: var(--bad); border-color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#panel .grp.flash { background: var(--sel-bg); transition: background .4s; }
#panel .f.sel select { min-width: 0; max-width: 100%; }
.pu-fits { display: grid; gap: 2px; margin: 2px 0 6px; }
.pu-fit { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); padding: 2px 0; border-bottom: 1px solid var(--line); }
.pu-fl { min-width: 0; line-height: 1.3; }
.pu-fk { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pu-step { display: inline-flex; align-items: center; gap: 2px; }
.pu-step b { min-width: 18px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.pu-step button { width: 24px; height: 24px; padding: 0; border-radius: 6px; font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.pu-ptw { margin: 6px 0; }
table.pu-pts { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.pu-pts th { font-weight: 500; font-size: 11.5px; color: var(--text-2); text-align: left; padding: 0 3px 4px; line-height: 1.25; }
.pu-pts th i { display: block; font-style: normal; color: var(--text-3); font-weight: 400; }
.pu-pts th:last-child { width: 28px; }
.pu-pts td { padding: 2px 3px; }
.pu-pts input { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; background: var(--surface); }
.pu-pts input:focus { outline: none; border-color: var(--line-2); }
.pu-x { width: 24px; height: 24px; padding: 0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.pu-ptb { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.pu-paste { display: grid; gap: 6px; margin: 4px 0 8px; }
.pu-paste textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; resize: vertical; }
.pu-paste button { justify-self: start; }

/* summary */
.pu-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 38ch; }
.pu-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.6; }

/* charts */
.pu-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#hq { touch-action: none; user-select: none; }
#hq .hqdrag { cursor: ew-resize; }
.pu-halo { paint-order: stroke; stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; }

/* head budget */
.pu-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--fill-1); margin: 4px 0 10px; }
.pu-bar span { display: block; height: 100%; }
table.pu-btab { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pu-btab td { text-align: right; padding: 5px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
.pu-btab td.l { text-align: left; }
.pu-btab td.note { white-space: normal; color: var(--text-3); font-size: 11.5px; line-height: 1.35; }
.pu-btab td i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.pu-btab tr.tot td { font-weight: 600; color: var(--text); border-bottom: 0; }

/* vapour pressure table */
table.pu-vt { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pu-vt th { font-weight: 500; font-size: 11.5px; color: var(--text-2); text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pu-vt th i { font-style: normal; color: var(--text-3); font-weight: 400; }
.pu-vt td { text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--line); }
.pu-vt tr.cur td { background: var(--sel-bg); font-weight: 600; color: var(--text); }

@media (max-width: 1100px) { .pu-two { grid-template-columns: minmax(0, 1fr); } }
#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); }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
@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; }
  .pu-btab td.note { display: none; }
}
@media print { .pu-edit { display: none !important; } }
#panel .f > label span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
#panel .f.sel { grid-template-columns: minmax(0, 1fr); gap: 3px; }
#panel .f.sel > label { grid-template-columns: 42px minmax(0, 1fr); }
#panel .f.sel select { width: 100%; }

/* 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-1e4fbf: #749ff5; --x-2f5c8a: #7ea4ce; --x-4f7aa6: #8cb1d7; --x-5a6c9c: #95a6d0; --x-6e7177: #85827f;
    --x-6f93b8: #85a2c1; --x-7d8fbf: #9babd3; --x-7fae94: #759a85; --x-a46d10: #d6a769; --x-c07a52: #e7aa89;
    --x-d98b5f: #f4b28d;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-2f5c8a: #7ea4ce; --x-4f7aa6: #8cb1d7; --x-5a6c9c: #95a6d0; --x-6e7177: #85827f;
    --x-6f93b8: #85a2c1; --x-7d8fbf: #9babd3; --x-7fae94: #759a85; --x-a46d10: #d6a769; --x-c07a52: #e7aa89;
    --x-d98b5f: #f4b28d;
  }
}
/* theme-auto:end */
