/* Wire rope — on top of calc.css */
main.wr .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.wr .stage-bar .hist { margin-left: auto; }
.wr-rules button { white-space: nowrap; }
#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); }
#view .handle:focus { outline: none; }
#view.dragging .handle { cursor: grabbing; }

/* parts */
.wr-steel { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1.1; }
.wr-sheave { fill: var(--steel-100); stroke: var(--steel-700); stroke-width: 1.1; }
.wr-groove { fill: none; stroke: var(--steel-500); stroke-width: .8; stroke-dasharray: 3 2; pointer-events: none; }
.wr-hubc { fill: var(--steel-300); stroke: var(--steel-700); stroke-width: 1; }
.wr-drum { fill: var(--steel-250); stroke: var(--steel-750); stroke-width: 1.2; }
.wr-flange { fill: none; stroke: var(--steel-500); stroke-width: 1; stroke-dasharray: 5 3; pointer-events: none; }
.wr-rope { fill: none; stroke: var(--x-59606a, #59606a); stroke-linecap: butt; stroke-linejoin: round; pointer-events: none; }
.wr-ropehi { fill: none; stroke: var(--steel-500); stroke-linecap: butt; pointer-events: none; }
.wr-lead { fill: none; stroke-linecap: butt; pointer-events: none; }
.wr-beam { fill: url(#wrHatch); stroke: var(--steel-700); stroke-width: 1.1; }
.wr-block { fill: var(--steel-150); stroke: var(--steel-750); stroke-width: 1.1; }
.wr-hook { fill: none; stroke: var(--steel-750); stroke-width: 3.2; stroke-linecap: round; }
.wr-loadbox { fill: var(--steel-50); stroke: var(--steel-700); stroke-width: 1.1; }
.wr-ctr { stroke: var(--steel-550); stroke-width: .8; stroke-dasharray: 10 3 2 3; fill: none; pointer-events: none; }
.wr-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.wr-dimh { fill: var(--steel-550); }
.wr-load line { stroke: var(--load); stroke-width: 1.8; fill: none; }
.wr-load path.hd { fill: var(--load); stroke: none; }
.wr-pull line { stroke: var(--x-1e4fbf, #1e4fbf); stroke-width: 1.8; fill: none; }
.wr-pull path.hd { fill: var(--x-1e4fbf, #1e4fbf); stroke: none; }
.wr-anchor { fill: var(--steel-750); stroke: none; }
.wr-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.wr-role { font-size: 11px; fill: var(--text-3); }
.wr-nm { cursor: text; }
.wr-nm:hover .wr-name, .wr-nm:focus .wr-name { fill: var(--sel); }
.wr-nm:focus { outline: none; }
.wr-cap { font-size: 11px; fill: var(--text-3); }
.wr-sec-ring { fill: none; stroke: var(--steel-400); stroke-width: 1; stroke-dasharray: 3 2; pointer-events: none; }
.wr-wire { stroke: var(--steel-700); stroke-width: .35; }
.wr-fibre { fill: var(--sand); stroke: var(--soil-line); stroke-width: .6; }
.wr-plan { fill: var(--steel-100); stroke: var(--steel-700); stroke-width: 1; }
.wr-planrope { fill: none; stroke: var(--x-59606a, #59606a); stroke-width: 1.6; pointer-events: 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.load rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.load text { fill: var(--load); font-weight: 600; }
#view .pill.pull rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.pull text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.desig rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.desig text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.desig { cursor: pointer; }
#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, #view .pill.desig:focus { outline: none; }
#view .pm { cursor: pointer; }
#view .pm circle { fill: var(--surface); stroke: var(--steel-350); }
#view .pm:hover circle, #view .pm:focus circle { stroke: var(--sel); }
#view .pm text { font-size: 13px; font-weight: 600; fill: var(--text-2); }
#view .pm:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.wr-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); }
.wr-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.wr-edit-name input { width: 180px; text-align: center; }
.wr-edit span { font-size: 11.5px; color: var(--text-3); }

/* live strip */
.wr-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; }
.wr-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.wr-live i { font-style: normal; color: var(--text-3); }

/* panel */
.wr-seg { margin-bottom: 6px; }
.wr-lab { font-size: 12px; color: var(--text-3); margin: 8px 0 4px; }
.wr-classes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
.wr-cls { display: grid; justify-items: center; gap: 2px; padding: 5px 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 12px; color: var(--text-2); }
.wr-cls:hover { border-color: var(--line-2); }
.wr-cls.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); color: var(--text); }
.wr-cls span { line-height: 1.2; text-align: center; }
.wr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.wr-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.wr-chip:hover { border-color: var(--line-2); }
.wr-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.wr-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin: 6px 0; cursor: pointer; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#panel select { max-width: 100%; }
#panel .f.sel.wide { grid-template-columns: minmax(0, 1fr); }
#panel .f.sel.wide select { width: 100%; }
#panel .f > label span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }

/* summary */
.wr-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.wr-des { font-weight: 600; color: var(--x-1e4fbf, #1e4fbf); }
.wr-tag { display: inline-flex; align-items: center; line-height: 1; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin-left: 4px; white-space: nowrap; vertical-align: 1px; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }

/* charts */
.wr-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
#schart, #bchart { touch-action: none; user-select: none; }
#schart .tdrag, #bchart .tdrag { cursor: ew-resize; }
@media (max-width: 1100px) { .wr-two { grid-template-columns: minmax(0, 1fr); } }

/* inspection */
.wr-insp table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.wr-insp th { font-weight: 500; font-size: 12px; color: var(--text-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.wr-insp th.l, .wr-insp td.l { text-align: left; }
.wr-insp td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--fill-1); }
.wr-insp .st { display: inline-flex; align-items: center; line-height: 1; font-weight: 500; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.wr-insp .st.keep { color: var(--good); background: var(--good-bg); }
.wr-insp .st.remove { color: var(--bad); background: var(--bad-bg); }
.wr-insp .wr-empty { color: var(--text-2); font-size: 13px; line-height: 1.5; margin: 0; }
.wr-insp .small-note { margin-top: 10px; }

#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); }
@media (max-width: 760px) {
  .wr-rules { width: 100%; }
  .wr-rules button { flex: 1 1 0; padding-left: 4px; padding-right: 4px; }
  .wr-insp table.cards { display: block; }
}
@media print { .wr-edit { display: none !important; } }
.wr-insp .st.check { color: var(--x-8a5a00, #8a5a00); background: var(--warn-bg); }

/* 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-59606a: #8c929b; --x-5f666e: #878d94; --x-6e7177: #85827f; --x-7b838c: #6f767d;
    --x-8a5a00: #c89e66; --x-8a5cb8: #c09bea; --x-c4b594: #695e46; --x-d8cdb0: #47402c;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-59606a: #8c929b; --x-5f666e: #878d94; --x-6e7177: #85827f; --x-7b838c: #6f767d;
    --x-8a5a00: #c89e66; --x-8a5cb8: #c09bea; --x-c4b594: #695e46; --x-d8cdb0: #47402c;
  }
}
/* theme-auto:end */
