/* Corrosion — on top of calc.css */
main.co { --co-rock: var(--rock); --co-rock-2: var(--x-ddd8cf, #ddd8cf); --co-joint: var(--x-8d867b, #8d867b); --co-void: var(--surface-2); --co-bolt: var(--moment); --co-short: var(--bad); --co-shot: var(--x-9aa7b4, #9aa7b4); --co-need: var(--warn); --co-plot: var(--surface); --co-grid: var(--fill-1); --co-pill: var(--surface); --co-pill-line: var(--steel-300); --co-c1: var(--bg); --co-c2: var(--x-f1f4e3, #f1f4e3); --co-c3: var(--warn-bg); --co-c4: var(--x-f6e5cc, #f6e5cc); --co-c5: var(--x-f3dac2, #f3dac2); --co-c6: var(--x-efceb8, #efceb8); --co-c7: var(--x-eac2b0, #eac2b0); --co-c8: var(--x-e3b3a6, #e3b3a6); --co-c9: var(--steel-blue); }
main.co .tabs { grid-template-columns: repeat(3, 1fr); }
main.co .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.co .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(--co-pill); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }

/* the section */
.co-rock { fill: var(--co-rock); }
.co-void { fill: var(--co-void); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.co-joint { fill: none; stroke: var(--co-joint); stroke-width: .8; stroke-linecap: round; opacity: .55; pointer-events: none; }
.co-joint.r { stroke-width: .7; opacity: .45; }
.co-shot { fill: var(--co-shot); stroke: none; opacity: .85; pointer-events: none; }
.co-bolt { stroke: var(--co-bolt); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.co-bolt.short { stroke: var(--co-short); }
.co-plate { fill: var(--co-bolt); pointer-events: none; }
.co-need { fill: none; stroke: var(--co-need); stroke-width: 1.3; stroke-dasharray: 6 4; pointer-events: none; }
.co-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; pointer-events: none; }
.co-cl { fill: none; stroke: var(--steel-500); stroke-width: .7; stroke-dasharray: 8 3 1.5 3; pointer-events: none; }
.co-floor { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.co-surf { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-dasharray: 2 3; }
.co-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.co-role { font-size: 11px; fill: var(--text-3); }
.co-nm { cursor: text; }
.co-nm:hover .co-name, .co-nm:focus .co-name { fill: var(--sel); }
.co-nm:focus { outline: none; }
.co-legend { font-size: 11px; fill: var(--text-2); }

/* pills */
#view .pill rect { fill: var(--co-pill); stroke: var(--co-pill-line); }
#view .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.bolt rect { stroke: color-mix(in srgb, var(--moment) 50%, transparent); } #view .pill.bolt text { fill: var(--x-2c4a91, #2c4a91); font-weight: 600; }
#view .pill.need rect { stroke: color-mix(in srgb, var(--warn) 55%, transparent); } #view .pill.need text { fill: var(--wip-ink); font-weight: 600; }
#view .pill.bad rect { stroke: color-mix(in srgb, var(--bad) 55%, transparent); } #view .pill.bad text { fill: var(--x-b0321f, #b0321f); font-weight: 600; }
#view .pill.qq rect { stroke: rgba(23, 24, 26, .35); } #view .pill.qq text { fill: var(--text); font-weight: 600; }
#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; }
.co-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); }
.co-edit input { width: 82px; 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); }
.co-edit-name input { width: 200px; text-align: center; }
.co-edit span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

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

/* panel */
.co-seg { margin-bottom: 6px; }
.co-lab { font-size: 12px; color: var(--text-3); margin: 8px 0 4px; }
.co-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.co-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.co-chip:hover { border-color: var(--line-2); }
.co-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.co-desc { font-size: 12px; color: var(--text-3); line-height: 1.4; margin: -2px 0 8px; }
.co-desc b { color: var(--text-2); font-weight: 500; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#panel .small-note a { color: inherit; }
#panel .f.sel select { min-width: 0; }
#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); }
.co-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 6px 0; cursor: pointer; }
.co-check input { margin: 0; }

/* summary */
.co-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 38ch; }
.co-big { font-weight: 600; color: var(--text); }
.co-tag { display: inline-flex; align-items: center; 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; }

/* three systems */
.co-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.co-sys h3 { font-size: 13px; font-weight: 600; margin: 0 0 6px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.co-sys h3 span { font-weight: 500; color: var(--text-3); font-size: 12px; }
.co-sys table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.co-sys td { padding: 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.co-sys td:last-child { text-align: right; color: var(--text); font-weight: 500; white-space: nowrap; padding-left: 10px; }
.co-sys tr.tot td { border-bottom: 0; font-weight: 600; color: var(--text); padding-top: 6px; }
.co-sys tr.on td { color: var(--text); }
.co-sys tr.on td:first-child::after { content: " · used"; color: var(--sel); font-weight: 500; }
.co-sys small { color: var(--text-3); }

/* charts */
.co-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#swChart, #lpChart { touch-action: none; user-select: none; }
#swChart .cdrag, #lpChart .cdrag { cursor: ew-resize; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }

@media (max-width: 1100px) { .co-two { grid-template-columns: minmax(0, 1fr); } .co-three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 760px) {
  .co-three { grid-template-columns: minmax(0, 1fr); }
  #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: "installed "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "needed "; 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; }
}
@media print { .co-edit { display: none !important; } }

/* the panel in plan and section */
.co-pil { stroke: var(--ink); stroke-width: 1.2; }
.co-room { fill: var(--co-void); }
.co-trib { fill: color-mix(in srgb, var(--load) 6%, transparent); stroke: var(--load); stroke-width: 1.2; stroke-dasharray: 6 4; pointer-events: none; }
.co-strata { fill: var(--co-rock); stroke: none; }
.co-break { fill: none; stroke: var(--ink); stroke-width: 1; }
.co-ground { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.co-arrow { stroke: var(--load); stroke-width: 1.8; }
.co-arrowh { fill: var(--load); }
.co-cap { font-size: 11px; fill: var(--text-3); }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 50%, transparent); } #view .pill.load text { fill: var(--load-ink); font-weight: 600; }

/* corrosion: the section, the magnifier and the category scale */
main.co { --co-steel: var(--steel-250); --co-steel-2: var(--x-cfd5db, #cfd5db); --co-zinc: var(--x-b9c7d6, #b9c7d6); --co-zinc-2: var(--x-9fb2c6, #9fb2c6); --co-lost: var(--x-f3d9cf, #f3d9cf); --co-air: var(--sel-bg); }
.co-plate { fill: var(--co-steel); stroke: var(--ink); stroke-width: 1.2; }
.co-core { fill: var(--co-steel); stroke: none; }
.co-zinc { fill: var(--co-zinc); stroke: var(--co-zinc-2); stroke-width: .8; }
.co-lostband { stroke: none; }
.co-hatch { stroke: color-mix(in srgb, var(--bad) 45%, transparent); stroke-width: .8; }
.co-req { fill: none; stroke: var(--warn); stroke-width: 1.3; stroke-dasharray: 6 4; }
.co-face { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.co-break { fill: none; stroke: var(--ink); stroke-width: 1; }
.co-air { fill: var(--co-air); }
.co-mag { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; }
.co-magring { fill: none; stroke: var(--steel-550); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.co-band { stroke: none; }
.co-axis { fill: none; stroke: var(--steel-550); stroke-width: 1; }
.co-tick { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.co-catl { font-size: 11.5px; font-weight: 600; fill: var(--text-2); }
.co-catw { font-size: 10.5px; fill: var(--text-3); }
.co-mark { fill: var(--sel); stroke: var(--halo); stroke-width: 1.5; }
.co-drop { fill: none; stroke: var(--x-7fa3c6, #7fa3c6); stroke-width: 1.2; stroke-linecap: round; pointer-events: none; }
#view .pill.lost rect { stroke: color-mix(in srgb, var(--bad) 45%, transparent); } #view .pill.lost text { fill: var(--x-b0321f, #b0321f); font-weight: 600; }
#view .pill.zinc rect { stroke: color-mix(in srgb, var(--x-506e8c, #506e8c) 55%, transparent); } #view .pill.zinc text { fill: var(--x-3d5872, #3d5872); font-weight: 600; }
#view .pill.req rect { stroke: color-mix(in srgb, var(--warn) 55%, transparent); } #view .pill.req text { fill: var(--wip-ink); font-weight: 600; }
.co-two { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
#galvChart .gv-row { cursor: pointer; }
#galvChart .gv-row:hover .gv-hl, #galvChart .gv-row:focus .gv-hl { fill: color-mix(in srgb, var(--sel) 7%, transparent); }
#galvChart .gv-row:focus { outline: none; }
#lossChart { touch-action: none; user-select: none; }
#lossChart .cdrag { cursor: ew-resize; }
table.co-zinc { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.co-zinc th { font-weight: 500; color: var(--text-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.co-zinc th.l, table.co-zinc td.l { text-align: left; }
table.co-zinc td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; color: var(--text-2); }
table.co-zinc td.l small { display: block; color: var(--text-3); font-size: 11.5px; }
table.co-zinc tr.on td { color: var(--text); font-weight: 500; background: color-mix(in srgb, var(--sel) 5%, transparent); }
table.co-zinc tr[data-sys] { cursor: pointer; }
table.co-zinc tr[data-sys]:hover td { background: color-mix(in srgb, var(--sel) 4%, transparent); }
.co-cls { display: inline-flex; align-items: center; line-height: 1; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 8px; }
.co-cls.VH { background: var(--x-d6eadd, #d6eadd); color: var(--good-ink); } .co-cls.H { background: var(--x-e5efd9, #e5efd9); color: var(--x-3f6b2a, #3f6b2a); } .co-cls.M { background: var(--x-f6e3c2, #f6e3c2); color: var(--x-875611, #875611); } .co-cls.L, .co-cls.VL { background: var(--x-f6d3cd, #f6d3cd); color: var(--x-962617, #962617); }
.co-comp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
@media (max-width: 1100px) { .co-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .co-comp { grid-template-columns: minmax(0, 1fr); } table.co-zinc th, table.co-zinc td { padding: 6px 4px; } }
@media (max-width: 760px) {
  #metalSeg { flex: 1 1 100%; }
  #metalSeg button { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; }
  main.co .co-seg button { white-space: normal; min-width: 0; }
}
@media (max-width: 760px) { table.co-zinc th:nth-child(3), table.co-zinc td:nth-child(3) { display: none; } }

/* zinc-class badges, AA on their own tints in both themes: the light "M" ink is a step darker than --warn-ink (4.2:1 on
   its tint before); in dark M takes --warn-ink and L/VL take --bad-ink (the rule's red reached only 4.4:1) */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .co-cls.M { color: var(--warn-ink); }
  :root:not([data-theme="light"]) .co-cls.L, :root:not([data-theme="light"]) .co-cls.VL { color: var(--bad-ink); }
}
@media screen {
  :root[data-theme="dark"] .co-cls.M { color: var(--warn-ink); }
  :root[data-theme="dark"] .co-cls.L, :root[data-theme="dark"] .co-cls.VL { color: var(--bad-ink); }
}

/* 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-1d4ed8: #79a1f8; --x-2c4a91: #81a0e0; --x-3d5872: #879fb6; --x-3f6b2a: #89b079; --x-506e8c: #7f98b2;
    --x-6e7177: #85827f; --x-7fa3c6: #7c99b6; --x-8d867b: #767068; --x-962617: #e07f6e; --x-9aa7b4: #525c65;
    --x-9fb2c6: #475563; --x-a0b4c8: #465462; --x-b0321f: #ef8470; --x-b5651d: #e5a06c; --x-b9c7d6: #3c4650;
    --x-cfd5db: #373b3f; --x-d6eadd: #28352c; --x-ddd8cf: #3b3832; --x-e3b3a6: #967268; --x-e3eed8: #2a3023;
    --x-e5efd9: #292f22; --x-eac2b0: #62463a; --x-ebbcb5: #72514d; --x-eef4ea: #272a24; --x-efceb8: #4b3527;
    --x-f1f4e3: #282a1f; --x-f3cdbf: #4b332a; --x-f3d9cf: #403029; --x-f3dac2: #413121; --x-f3eccd: #312d19;
    --x-f6d3cd: #452f2c; --x-f6dfc4: #3d2f1d; --x-f6e3c2: #3a2e18; --x-f6e5cc: #382d1d;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1d4ed8: #79a1f8; --x-2c4a91: #81a0e0; --x-3d5872: #879fb6; --x-3f6b2a: #89b079; --x-506e8c: #7f98b2;
    --x-6e7177: #85827f; --x-7fa3c6: #7c99b6; --x-8d867b: #767068; --x-962617: #e07f6e; --x-9aa7b4: #525c65;
    --x-9fb2c6: #475563; --x-a0b4c8: #465462; --x-b0321f: #ef8470; --x-b5651d: #e5a06c; --x-b9c7d6: #3c4650;
    --x-cfd5db: #373b3f; --x-d6eadd: #28352c; --x-ddd8cf: #3b3832; --x-e3b3a6: #967268; --x-e3eed8: #2a3023;
    --x-e5efd9: #292f22; --x-eac2b0: #62463a; --x-ebbcb5: #72514d; --x-eef4ea: #272a24; --x-efceb8: #4b3527;
    --x-f1f4e3: #282a1f; --x-f3cdbf: #4b332a; --x-f3d9cf: #403029; --x-f3dac2: #413121; --x-f3eccd: #312d19;
    --x-f6d3cd: #452f2c; --x-f6dfc4: #3d2f1d; --x-f6e3c2: #3a2e18; --x-f6e5cc: #382d1d;
  }
}
/* theme-auto:end */
