:root{--paper:#f4f2ec;--panel:#fffdf8;--ink:#1b242c;--ink-2:#4a545d;--ink-3:#7d858c;--line:#dcd8cd;--line-2:#e9e5db;--navy:#1d2a36;--accent:#c2412d;--accent-soft:#f6e3dc;--ok:#2f7a4f;--ok-soft:#e2efe5;--warn:#a8700f;--warn-soft:#f7ecd2;--sel:#2563a8;--grid:#e6e2d7;--grid-major:#d6d1c3;--shadow:0 1px 0 #1b242c0a, 0 2px 6px #1b242c0d, 0 12px 28px -18px #1b242c40;--sans:"IBM Plex Sans", system-ui, sans-serif;--mono:"IBM Plex Mono", ui-monospace, monospace}*{box-sizing:border-box}html,body{background:var(--paper);color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased;margin:0;font-size:14px}button,input,select{font:inherit;color:inherit}.mono{font-family:var(--mono);font-size:.92em}.muted{color:var(--ink-3)}.small{font-size:12.5px;line-height:1.5}.app{flex-direction:column;min-height:100vh;display:flex}.top{background:var(--navy);color:#f1ede4;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;padding:12px 20px;display:flex}.brand{align-items:center;gap:12px;display:flex}.logo{fill:none;stroke:#e8664a;stroke-width:1.8px;stroke-linecap:round;width:34px;height:34px}.brand h1{letter-spacing:.01em;margin:0;font-size:19px;font-weight:700}.brand p{color:#b9c0c7;margin:1px 0 0;font-size:12.5px}.top-controls{flex-wrap:wrap;align-items:center;gap:14px;display:flex}.field.inline{flex-direction:row;align-items:center;gap:8px}.field.inline span{color:#b9c0c7;font-size:12px}.top .field select{color:#f1ede4;background:#2a3947;border:1px solid #3c4d5d;border-radius:6px;max-width:290px;padding:6px 8px}.badge-warn{letter-spacing:.02em;color:#ffd9cf;background:#c2412d2e;border:1px solid #8e3a2a;border-radius:999px;padding:5px 9px;font-size:11.5px;font-weight:600}.layout{flex:1;grid-template-columns:minmax(0,1fr) 380px;align-items:start;gap:16px;padding:16px 20px;display:grid}.stage{flex-direction:column;gap:12px;min-width:0;display:flex}.side{flex-direction:column;gap:12px;display:flex}.toolbar{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:10px;flex-wrap:wrap;gap:4px;padding:5px;display:flex}.tool{cursor:pointer;color:var(--ink-2);background:0 0;border:1px solid #0000;border-radius:7px;align-items:center;gap:6px;padding:6px 10px;font-size:13px;font-weight:500;display:inline-flex}.tool svg{fill:none;stroke:currentColor;stroke-width:1.6px;stroke-linecap:round;stroke-linejoin:round;width:18px;height:18px}.tool:hover{background:var(--line-2);color:var(--ink)}.tool.on{background:var(--navy);color:#fff}.tb-sep{background:var(--line);width:1px;margin:4px 6px}.canvas-wrap{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;flex-direction:column;height:min(62vh,620px);min-height:340px;display:flex;position:relative;overflow:hidden}.canvas{touch-action:none;-webkit-user-select:none;user-select:none;flex:1;width:100%;min-height:0;display:block}.canvas.tool-pipe,.canvas.tool-junction,.canvas.tool-head{cursor:crosshair}.canvas.tool-delete .pipe,.canvas.tool-delete .node{cursor:not-allowed}.canvas.tool-select .node{cursor:grab}.canvas .pipe{cursor:pointer}.grid-bg{fill:#fbfaf6}.grid{stroke:var(--grid);stroke-width:.12px}.grid.major{stroke:var(--grid-major);stroke-width:.22px}.crit{stroke:#c2412d29;stroke-linecap:round}.sel-halo{stroke:#2563a847;stroke-linecap:round}.arrow path{fill:var(--navy);opacity:.85}.pipe-label{fill:var(--ink-2);font-family:var(--mono);paint-order:stroke;stroke:#fbfaf6;stroke-width:.35px}.node-label{fill:var(--ink);font-family:var(--mono);paint-order:stroke;stroke:#fbfaf6;stroke-width:.4px;font-weight:500}.node-tag{fill:var(--accent);font-family:var(--sans);letter-spacing:.08em;font-weight:700}.head-body{fill:#fff;stroke:var(--navy)}.head-cross{stroke:var(--accent);stroke-linecap:round}.junction{fill:var(--navy)}.source{fill:var(--accent);stroke:var(--navy)}.sel-ring{fill:none;stroke:var(--sel)}.gov-ring{fill:none;stroke:var(--accent);stroke-dasharray:.6 .4}.rubber{stroke:var(--sel);stroke-dasharray:1 .7}.hint{color:var(--ink-2);pointer-events:none;font-size:12px;position:absolute;top:10px;left:12px;right:12px}.legend{border-top:1px solid var(--line);color:var(--ink-2);background:#f7f5ef;flex-wrap:wrap;align-items:center;gap:10px 16px;padding:8px 12px;font-size:11.5px;display:flex}.legend-scale{width:200px}.legend-title{color:var(--ink);font-weight:600}.ramp{border-radius:4px;height:7px;margin:0 0 2px}.ramp-ticks{font-family:var(--mono);justify-content:space-between;font-size:10.5px;display:flex}.ramp-ticks span:nth-child(2){margin-left:28%}.ramp-ticks span:nth-child(3){margin-left:2%}.legend-row{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.key{border-radius:4px;width:18px;height:7px;display:inline-block}.crit-key{background:#c2412d40}.gov-key{border:1.5px dashed var(--accent);border-radius:50%;width:10px;height:10px;margin-left:6px}.tables{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;overflow:hidden}.tabs{border-bottom:1px solid var(--line);gap:2px;padding:6px 6px 0;display:flex}.tabs button{color:var(--ink-3);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;margin-bottom:-1px;padding:8px 14px;font-weight:600}.tabs button.on{color:var(--ink);border-bottom-color:var(--accent)}.table-scroll{max-height:320px;overflow:auto}table{border-collapse:collapse;width:100%;font-size:12.5px}th{text-align:left;color:var(--ink-2);border-bottom:1px solid var(--line);white-space:nowrap;background:#f7f5ef;padding:7px 10px;font-size:11.5px;font-weight:600;position:sticky;top:0}td{border-bottom:1px solid var(--line-2);white-space:nowrap;padding:6px 10px}td.num{text-align:right;font-family:var(--mono);font-size:12px}tbody tr{cursor:pointer}tbody tr:hover{background:#f7f4ec}tr.row-sel{background:#e7eef7!important}tr.row-gov td:first-child{box-shadow:inset 3px 0 0 var(--accent)}.dot{vertical-align:1px;border-radius:50%;width:8px;height:8px;margin-right:6px;display:inline-block}.card{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;padding:14px 16px}.card h2{letter-spacing:.005em;margin:0;font-size:14px;font-weight:600}.card-head{justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px;display:flex}.status{letter-spacing:.04em;text-transform:uppercase;border-radius:999px;padding:4px 9px;font-size:11.5px;font-weight:700}.s-adequate{background:var(--ok-soft);color:var(--ok)}.s-marginal{background:var(--warn-soft);color:var(--warn)}.s-inadequate{background:var(--accent-soft);color:var(--accent)}.kpis{grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:8px;display:grid}.kpis div{border:1px solid var(--line-2);background:#f7f5ef;border-radius:8px;flex-direction:column;gap:2px;padding:8px;display:flex}.kpis span{color:var(--ink-3);font-size:11px}.kpis strong{font-variant-numeric:tabular-nums;font-size:18px;font-weight:600}.kpis strong.neg{color:var(--accent)}.kpis em{color:var(--ink-3);font-size:11.5px;font-style:normal;font-weight:500}.kpis small{color:var(--ink-2);font-size:11px}.chart{width:100%;height:auto;display:block}.c-grid{stroke:var(--line-2);stroke-width:1px}.c-tick{font-family:var(--mono);fill:var(--ink-3);font-size:9.5px}.c-axis{fill:var(--ink-2);font-size:10.5px}.c-supply{fill:none;stroke:var(--navy);stroke-width:2.2px}.c-system{fill:none;stroke:var(--accent);stroke-width:1.8px;stroke-dasharray:5 3}.c-hose{stroke:var(--accent);stroke-width:1.5px}.c-margin{stroke-width:1.5px;stroke-dasharray:2 2}.c-margin.ok{stroke:var(--ok)}.c-margin.bad{stroke:var(--accent)}.c-demand{fill:var(--accent);stroke:#fff;stroke-width:1.5px}.c-total{fill:#fff;stroke:var(--accent);stroke-width:2px}.c-op{fill:var(--navy);stroke:#fff;stroke-width:1.5px}.chart-legend{color:var(--ink-2);flex-wrap:wrap;gap:4px 12px;margin-top:4px;font-size:11px;display:flex}.chart-legend span{align-items:center;gap:5px;display:inline-flex}.lg{display:inline-block}.lg.supply{background:var(--navy);width:16px;height:2.5px}.lg.system{border-top:2px dashed var(--accent);width:16px;height:0}.lg.dpt{background:var(--accent);border-radius:50%;width:8px;height:8px}.lg.tpt{border:2px solid var(--accent);width:8px;height:8px}.lg.opt{background:var(--navy);border-radius:50%;width:8px;height:8px}.budget{border-top:1px solid var(--line-2);margin-top:12px;padding-top:10px}.budget-title{color:var(--ink-2);margin-bottom:6px;font-size:11.5px}.budget-bar{background:var(--line-2);border-radius:6px;height:12px;display:flex;overflow:hidden}.budget-keys{color:var(--ink-2);font-variant-numeric:tabular-nums;flex-wrap:wrap;gap:4px 12px;margin-top:6px;font-size:11px;display:flex}.budget-keys span{align-items:center;gap:5px;display:inline-flex}.budget-keys i{border-radius:2px;width:9px;height:9px;display:inline-block}.b-end{background:var(--navy)}.b-elev{background:#7c8b99}.b-fric{background:var(--accent)}.b-margin{background:#8fbf9f}.issues ul{flex-direction:column;gap:6px;margin:8px 0 0;padding:0;list-style:none;display:flex}.issues li{cursor:pointer;border-radius:7px;padding:7px 9px;font-size:12.5px}.issues li.error{background:var(--accent-soft);color:#8e2c1c}.issues li.warning{background:var(--warn-soft);color:#7a5208}.field{flex-direction:column;gap:4px;min-width:0;display:flex}.field>span{color:var(--ink-2);font-size:11.5px;font-weight:500}.field em{color:var(--ink-3);font-style:normal;font-weight:400}.field input,.field select{border:1px solid var(--line);font-variant-numeric:tabular-nums;background:#fff;border-radius:6px;width:100%;padding:6px 8px}.field input:focus,.field select:focus{border-color:var(--sel);outline:2px solid #2563a840}.field .static{font-family:var(--mono);color:var(--ink-2);padding:6px 0;font-size:12.5px}.grid2{grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px;display:grid}.grid3{grid-template-columns:1fr 1fr 1fr;gap:10px;margin-bottom:10px;display:grid}.seg{background:var(--line-2);border-radius:8px;margin-bottom:10px;padding:3px;display:flex}.seg button{cursor:pointer;color:var(--ink-2);background:0 0;border:0;border-radius:6px;flex:1;padding:6px;font-weight:500}.seg button.on{color:var(--ink);background:#fff;box-shadow:0 1px 2px #00000014}.link-danger{color:var(--accent);cursor:pointer;background:0 0;border:0;font-size:12.5px;font-weight:600}.fittings{border-top:1px solid var(--line-2);padding-top:8px}.sub{color:var(--ink-2);margin-bottom:4px;font-size:11.5px;font-weight:600}.fit-row{justify-content:space-between;align-items:center;padding:3px 0;font-size:12.5px;display:flex}.stepper{align-items:center;gap:8px;display:inline-flex}.stepper button{border:1px solid var(--line);cursor:pointer;background:#fff;border-radius:6px;width:24px;height:24px;line-height:1}.stepper span{text-align:center;min-width:12px}.readout{border-top:1px solid var(--line-2);grid-template-columns:auto 1fr;gap:4px 12px;margin:10px 0 0;padding-top:10px;font-size:12.5px;display:grid}.readout dt,.solver dt{color:var(--ink-3)}.readout dd,.solver dd{font-variant-numeric:tabular-nums;margin:0}.solver dl{grid-template-columns:auto 1fr;gap:5px 12px;margin:10px 0 0;font-size:12.5px;display:grid}.foot{padding:6px 20px 24px}.foot p{max-width:980px;color:var(--ink-3);margin:0;font-size:12px;line-height:1.6}@media (width<=1080px){.layout{grid-template-columns:1fr}}@media (width<=640px){.top,.layout{padding:12px 16px}.tool span{display:none}.tool{padding:7px}.canvas-wrap{height:58vh;min-height:300px}.hint{font-size:11px}.kpis strong{font-size:15px}.grid3{grid-template-columns:1fr 1fr}.top .field select{max-width:100%}.foot{padding:6px 16px 24px}}
