/* Two-phase pipe pressure drop — on top of calc.css (light only, the site's tokens) */
main.tp .tabs { grid-template-columns: repeat(3, 1fr); }
main.tp .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.tp .stage-bar .hist { margin-left: auto; }
main.tp .stage { position: relative; }
#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); }
#view .sb { font-size: 75%; }

/* the line and its phases */
.tp-liq { fill: var(--x-b8cde3, #b8cde3); stroke: none; }
.tp-gasf { fill: var(--steel-50); stroke: none; }
.tp-gas { fill: var(--steel-50); stroke: var(--x-8fa6bf, #8fa6bf); stroke-width: .6; }
.tp-bub { fill: var(--steel-50); stroke: var(--x-8fa6bf, #8fa6bf); stroke-width: .6; }
.tp-drop { fill: var(--x-7f9cbc, #7f9cbc); }
.tp-pipe { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.tp-end { fill: none; stroke: var(--ink); stroke-width: 1; }
.tp-wall { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.tp-break { fill: var(--surface); stroke: none; }
.tp-brk { fill: none; stroke: var(--text-4); stroke-width: 1; }
.tp-sw { stroke: var(--steel-350); stroke-width: .6; }
.tp-ref { fill: none; stroke: var(--steel-500); stroke-width: 1; stroke-dasharray: 4 3; }
.tp-flow { stroke: var(--blue); stroke-width: 1.8; }
.tp-flow-h { fill: var(--blue); }
.tp-g { stroke: var(--text-2); stroke-width: 1.4; }
.tp-g-h { fill: var(--text-2); }
.tp-lab { font-size: 11px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.tp-lab.small { font-size: 10.5px; fill: var(--text-3); }
.tp-lab.strong { font-weight: 600; fill: var(--text); }

/* charts */
.tp-plot { fill: var(--surface-2); stroke: var(--steel-350); stroke-width: .8; }
.tp-grid { fill: var(--fill-2); }
.tp-tick { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.tp-axt { font-size: 11px; font-weight: 500; fill: var(--text-2); }
.tp-axt.strong { font-weight: 600; fill: var(--text); }
.tp-bd { fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-linejoin: round; }
.tp-bd2 { fill: none; stroke: var(--text-2); stroke-width: 1.3; stroke-dasharray: 6 4; }
.tp-reg { font-size: 10.5px; font-weight: 500; fill: var(--text-3); }
.tp-path { fill: none; stroke: var(--sel); stroke-width: 1.6; stroke-dasharray: 3 2; }
.tp-outpt { fill: var(--surface); stroke: var(--sel); stroke-width: 1.6; }
.tp-sec { fill: var(--surface); stroke: var(--sel); stroke-width: 1.4; }
.tp-c { fill: none; stroke-width: 1.4; stroke-linejoin: round; opacity: .75; }
.tp-c.sel { stroke-width: 2.6; opacity: 1; }
.tp-vline { fill: color-mix(in srgb, var(--sel) 35%, transparent); }
.tp-dot { stroke: var(--halo); stroke-width: 1.2; }
.tp-cl { font-size: 10.5px; font-weight: 600; fill: var(--text); paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; stroke-linejoin: round; }
.tp-cl.ref { font-weight: 500; }

.pill rect { fill: var(--surface); stroke: var(--steel-300); }
.pill text { font-weight: 600; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.pill.sel rect { stroke: var(--sel); } .pill.sel text { fill: var(--sel); }
.pill.load rect { stroke: color-mix(in srgb, var(--load) 60%, transparent); } .pill.load text { fill: var(--load-ink); }
.pill.editable { cursor: text; }
.pill.editable:hover rect, .pill.editable:focus rect { stroke-width: 1.6; }
.pill.editable:focus { outline: none; }
.tp-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); }
.tp-edit input { width: 80px; 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); }
.tp-edit span { font-size: 11.5px; color: var(--text-3); }

/* live strip and flags */
.tp-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; }
.tp-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.tp-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tp-flags span { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.tp-flags span.tp-err { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.tp-seg { margin: 4px 0 6px; }
.f.tp-wide { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.f.tp-wide select { width: 100%; font: inherit; font-size: 13px; color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 6px; background: var(--surface); }
#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 */
.tp-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 40ch; }

/* tables */
table.tp-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.tp-table th { font-size: 12px; font-weight: 500; color: var(--text-3); text-align: right; padding: 6px 8px; white-space: normal; vertical-align: bottom; }
table.tp-table tr.u th { font-weight: 400; font-size: 11.5px; padding-top: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tp-table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tp-table .l { text-align: left; white-space: normal; }
table.tp-table tr.cur td { font-weight: 600; color: var(--text); }
.tp-key { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
@media print { .tp-edit { display: none !important; } }

@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.tp-table thead { display: none; }
  table.tp-table, table.tp-table tbody { display: block; width: 100%; }
  table.tp-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  table.tp-table td { display: block; border: 0; padding: 0; text-align: left; font-size: 12.5px; white-space: normal; }
  table.tp-table td.l { grid-column: 1 / -1; font-weight: 500; }
  table.tp-table td[data-l]::before { content: attr(data-l) " "; color: var(--text-3); }
}

/* 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-6f8f4e: #a4c089; --x-7f9cbc: #6f86a0; --x-8a6d2b: #c2a975; --x-8fa6bf: #556679;
    --x-b8cde3: #354452;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-6e7177: #85827f; --x-6f8f4e: #a4c089; --x-7f9cbc: #6f86a0; --x-8a6d2b: #c2a975; --x-8fa6bf: #556679;
    --x-b8cde3: #354452;
  }
}
/* theme-auto:end */
