/* Crane runway girder — on top of calc.css. Colours of the drawing are tokens (main.cw), so a site-wide theme can
   restyle them in one place; the site is light-only for now (calc.css). */
main.cw { --cw-steel: var(--steel-blue); --cw-flange: var(--steel-250); --cw-ink: var(--steel-750); --cw-rail: var(--steel-350); --cw-wheel: var(--steel-300); --cw-carr: var(--steel-100); --cw-pill: var(--surface); --cw-pill-line: var(--steel-300); --cw-grid: var(--fill-1); --cw-plot: var(--surface); --cw-mfill: color-mix(in srgb, var(--moment) 13%, transparent); --cw-hot: color-mix(in srgb, var(--load) 18%, transparent); }
main.cw .tabs { grid-template-columns: repeat(4, 1fr); }
main.cw .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.cw .stage-bar .hist { margin-left: auto; }
main.cw .stage-bar .seg { flex: 0 0 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 .knob { fill: var(--cw-pill); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }

/* parts */
.cw-girder { fill: var(--cw-steel); stroke: var(--cw-ink); stroke-width: 1; }
.cw-flange { fill: var(--cw-flange); stroke: var(--cw-ink); stroke-width: 1; }
.cw-flange.hot { fill: var(--cw-hot); }
.cw-rail { fill: var(--cw-rail); stroke: var(--cw-ink); stroke-width: .9; stroke-linejoin: round; }
.cw-wheel { fill: var(--cw-wheel); stroke: var(--cw-ink); stroke-width: 1.1; }
.cw-hub { fill: var(--cw-ink); }
.cw-carr { fill: var(--cw-carr); stroke: var(--cw-ink); stroke-width: 1.1; }
.cw-col { fill: url(#cwHatch); stroke: var(--cw-ink); stroke-width: 1; }
.cw-sup { fill: var(--cw-pill); stroke: var(--cw-ink); stroke-width: 1.1; }
.cw-ground { stroke: var(--cw-ink); stroke-width: 1; }
.cw-axis { stroke: var(--steel-550); stroke-width: .7; stroke-dasharray: 9 3 1.5 3; fill: none; pointer-events: none; }
.cw-ext { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.cw-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.cw-dimh { fill: var(--steel-550); }
.cw-base { stroke: var(--cw-ink); stroke-width: .9; }
.cw-m { fill: var(--cw-mfill); stroke: var(--moment); stroke-width: 1.4; stroke-linejoin: round; }
.cw-env { fill: none; stroke: var(--moment); stroke-width: 1; stroke-dasharray: 4 3; }
.cw-worst { fill: var(--moment); }
.cw-load line { stroke: var(--load); stroke-width: 1.8; }
.cw-load path.hd { fill: var(--load); stroke: none; }
.cw-load.cw-grey line { stroke: var(--steel-550); } .cw-load.cw-grey path.hd { fill: var(--steel-550); }
.cw-sec { font-size: 11px; font-weight: 600; fill: var(--text-2); letter-spacing: .04em; }
.cw-cap { font-size: 11px; fill: var(--text-3); }
.cw-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.cw-role { font-size: 11px; fill: var(--text-3); }
.cw-nm { cursor: text; }
.cw-nm:hover .cw-name, .cw-nm:focus .cw-name { fill: var(--sel); }
.cw-nm:focus { outline: none; }
.cw-runway { stroke: var(--cw-ink); stroke-width: 2.2; }
.cw-runway2 { stroke: var(--steel-550); stroke-width: 1.6; }
.cw-bridge { fill: var(--cw-carr); stroke: var(--cw-ink); stroke-width: 1.1; }
.cw-trolley { fill: var(--cw-flange); stroke: var(--cw-ink); stroke-width: 1.1; }
.cw-hook { fill: var(--load); }
.cw-wlead { stroke: var(--steel-400); stroke-width: .8; }

/* pills */
#view .pill rect { fill: var(--cw-pill); stroke: var(--cw-pill-line); }
#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(--cw-pill-line); }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.load text { fill: var(--load-ink); font-weight: 600; }
#view .pill.mom rect { stroke: color-mix(in srgb, var(--moment) 40%, transparent); } #view .pill.mom text { fill: var(--x-33508f, #33508f); 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.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; }
.cw-edit { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--cw-pill); border: 1.5px solid var(--sel); border-radius: 9px; padding: 2px 8px 2px 4px; box-shadow: 0 6px 18px rgba(20, 22, 28, .14); }
.cw-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); }
.cw-edit-name input { width: 180px; text-align: center; }
.cw-edit span { font-size: 11.5px; color: var(--text-3); }

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

/* panel */
.cw-seg { margin-bottom: 6px; }
.cw-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.cw-chip { border: 1px solid var(--line); background: var(--cw-pill); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.cw-chip:hover { border-color: var(--line-2); }
.cw-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
.cw-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 6px 0 2px; cursor: pointer; }
.cw-check input { margin: 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); }

/* summary */
.cw-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.cw-tag { display: inline-block; 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; }

/* actions and chart */
.cw-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cw-kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
.cw-kv h3 { grid-column: 1 / -1; font-size: 12px; font-weight: 500; color: var(--text-3); margin: 10px 0 2px; }
.cw-kv h3:first-child { margin-top: 0; }
.cw-kv > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.cw-kv span { color: var(--text-2); }
.cw-kv b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cw-kv i { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; color: var(--text-3); }
#lchart { touch-action: none; user-select: none; }
#lchart .ldrag { cursor: ew-resize; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
@media (max-width: 1100px) { .cw-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .cw-kv { 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: "actual "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "limit "; 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 { .cw-edit { display: none !important; } }

/* 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-155e75: #72a7bb; --x-1d4ed8: #79a1f8; --x-1e4fbf: #749ff5; --x-33508f: #819dd6; --x-4d7c0f: #8fb96b;
    --x-6e7177: #85827f; --x-78350f: #d19375; --x-7a4fa0: #b895dc; --x-9f1239: #e67986; --x-b45309: #ea9567;
    --x-be185d: #ee829f;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-155e75: #72a7bb; --x-1d4ed8: #79a1f8; --x-1e4fbf: #749ff5; --x-33508f: #819dd6; --x-4d7c0f: #8fb96b;
    --x-6e7177: #85827f; --x-78350f: #d19375; --x-7a4fa0: #b895dc; --x-9f1239: #e67986; --x-b45309: #ea9567;
    --x-be185d: #ee829f;
  }
}
/* theme-auto:end */
