/* Psychrometrics — on top of calc.css */
main.ps .tabs { grid-template-columns: repeat(3, 1fr); }
main.ps .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.ps .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.dragging .handle { cursor: grabbing; }
#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 chart */
.ps-grid { fill: var(--fill-2); }
.ps-frame { fill: none; stroke: var(--steel-350); stroke-width: .8; pointer-events: none; }
.ps-fog { fill: var(--fill-1); stroke: none; }
.ps-sat { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.ps-rh { fill: none; stroke: var(--x-7f9fc4, #7f9fc4); stroke-width: .9; }
.ps-h { fill: none; stroke: var(--x-c9a46b, #c9a46b); stroke-width: .8; stroke-dasharray: 5 3; }
.ps-v { fill: none; stroke: var(--x-9aa7a0, #9aa7a0); stroke-width: .7; stroke-dasharray: 1.5 3; }
.ps-rhl, .ps-hl, .ps-vl { font-size: 10.5px; font-weight: 500; paint-order: stroke; stroke: var(--surface, #fff); stroke-width: 3px; stroke-linejoin: round; }
.ps-rhl { fill: var(--x-3d6491, #3d6491); }
.ps-hl { fill: var(--x-85612a, #85612a); }
.ps-vl { fill: var(--x-56645c, #56645c); }
.ps-tick { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ps-axt { font-size: 11px; font-weight: 500; fill: var(--text-2); }
.ps-hcap { fill: var(--x-85612a, #85612a); }
.ps-proc { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.ps-proc.dash { stroke-dasharray: 6 4; stroke-width: 1.6; }
.ps-proc.thin { stroke-width: 1; stroke-dasharray: 2 3; }
.ps-proc.sel { stroke-width: 3.4; }
.ps-adp { fill: var(--surface); stroke: var(--blue); stroke-width: 1.4; }
.ps-pt { fill: var(--text); stroke: var(--halo); stroke-width: 1.5; }
.ps-pt.other { fill: var(--x-6e7177, #6e7177); }
.ps-pt.sel { fill: var(--sel); }
.ps-badge { cursor: pointer; }
.ps-badge rect { fill: var(--surface); stroke: var(--steel-400); stroke-width: 1; }
.ps-badge text { font-size: 11px; font-weight: 600; fill: var(--text); font-variant-numeric: tabular-nums; }
.ps-badge.sel rect { stroke: var(--sel); stroke-width: 1.5; }
.ps-badge.sel text { fill: var(--sel); }
.ps-badge:hover rect, .ps-badge:focus rect { stroke: var(--sel); }
.ps-badge:focus { outline: none; }

/* live strip and flags */
.ps-live { display: flex; flex-wrap: wrap; gap: 4px 16px; 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; }
.ps-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.ps-lname { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.ps-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ps-flags span { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.ps-flags span.ps-err { color: var(--bad-ink, #b0321f); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }
.ps-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; border: 1px solid var(--steel-400); border-radius: 9px; font-size: 11px; font-weight: 600; line-height: 1; color: var(--text); margin-right: 6px; font-variant-numeric: tabular-nums; box-sizing: border-box; }

/* panel */
.ps-seg { margin-bottom: 6px; }
.ps-lab { font-size: 12px; color: var(--text-3); margin: 8px 0 4px; }
.f.ps-pair > label { display: block; }
.ps-pair label select { width: 100%; max-width: 100%; font: inherit; font-size: 12.5px; color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; background: var(--surface, #fff); }
.ps-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.ps-chip { border: 1px solid var(--line-2); background: var(--surface, #fff); border-radius: 999px; padding: 3px 11px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.ps-chip:hover { border-color: var(--text-3); color: var(--text); }
.ps-chip:disabled { opacity: .5; cursor: default; }
.ps-type { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.ps-x { font-size: 11.5px; padding: 1px 8px; }
#panel .grp.sel { background: var(--sel-bg); border-radius: 8px; box-shadow: 0 0 0 6px var(--sel-bg); }
#panel .grp-h h3 { display: inline-flex; align-items: center; }
#panel .grp-h .aside { display: inline-flex; align-items: center; gap: 8px; }
#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 */
.ps-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 38ch; }

/* tables */
table.ps-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.ps-table th { font-size: 12px; font-weight: 500; color: var(--text-3); text-align: right; padding: 6px 8px; white-space: nowrap; }
table.ps-table tr.u th { font-weight: 400; font-size: 11.5px; padding-top: 0; border-bottom: 1px solid var(--line); }
table.ps-table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.ps-table .l { text-align: left; white-space: normal; }
table.ps-table tr.sel td { background: var(--sel-bg); }
table.ps-table tr.adp td { color: var(--text-2); }
.ps-procs { margin-top: 14px; }
#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; }
  /* states: one card per state */
  table.ps-table thead { display: none; }
  table.ps-table, table.ps-table tbody { display: block; width: 100%; }
  table.ps-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  table.ps-table td { display: block; border: 0; padding: 0; text-align: left; font-size: 12.5px; white-space: normal; }
  table.ps-table td.l { grid-column: 1 / -1; font-weight: 500; }
  #states td:nth-child(2)::before { content: "db "; color: var(--text-3); }
  #states td:nth-child(3)::before { content: "wb "; color: var(--text-3); }
  #states td:nth-child(4)::before { content: "dp "; color: var(--text-3); }
  #states td:nth-child(5)::before { content: "RH "; color: var(--text-3); }
  #states td:nth-child(6)::before { content: "W "; color: var(--text-3); }
  #states td:nth-child(7)::before { content: "h "; color: var(--text-3); }
  #states td:nth-child(8)::before { content: "v "; color: var(--text-3); }
  #procs td:nth-child(2)::before { content: "total "; color: var(--text-3); }
  #procs td:nth-child(3)::before { content: "sensible "; color: var(--text-3); }
  #procs td:nth-child(4)::before { content: "latent "; color: var(--text-3); }
  #procs td:nth-child(5) { grid-column: 1 / -1; }
}

/* 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-3d6491: #85a7cf; --x-56645c: #88958e; --x-6e7177: #85827f; --x-7f9fc4: #809ab8; --x-85612a: #c1a276;
    --x-9aa7a0: #555f5a; --x-c4c9cf: #3f4347; --x-c9a46b: #e0c192;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-3d6491: #85a7cf; --x-56645c: #88958e; --x-6e7177: #85827f; --x-7f9fc4: #809ab8; --x-85612a: #c1a276;
    --x-9aa7a0: #555f5a; --x-c4c9cf: #3f4347; --x-c9a46b: #e0c192;
  }
}
/* theme-auto:end */
