/* Cargo securing — on top of calc.css */
main.cg .tabs { grid-template-columns: repeat(3, 1fr); }
main.cg .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.cg .stage-bar .hist { margin-left: auto; }
main.cg .card.stage { overflow: visible; position: relative; }
#view { display: block; width: 100%; height: auto; flex: none; user-select: none; -webkit-user-select: none; touch-action: none; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view .knob { fill: var(--surface); fill-opacity: .2; stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus-visible .knob { stroke-width: 2.6; }
#view .handle:focus-visible { outline: none; }
#view .handle:focus-visible .hit { stroke: var(--sel); stroke-width: 1.2; stroke-dasharray: 3 2; }
.cg-deck { fill: var(--steel-350); stroke: var(--ink); stroke-width: 1; }
.cg-wheel { fill: var(--steel-700); stroke: var(--ink); }
.cg-hub { fill: var(--steel-300); }
.cg-board { fill: var(--steel-300); stroke: var(--ink); }
.cg-board.on { fill: var(--steel-500); }
.cg-load-box { fill: var(--sand); stroke: var(--ink); stroke-width: 1.2; }
.cg-plank { stroke: var(--x-cbb894, #cbb894); stroke-width: .8; }
.cg-mat { fill: var(--ink); }
.cg-strap { fill: none; stroke: var(--moment); stroke-width: 2.2; stroke-linejoin: round; pointer-events: none; }
.cg-strap.far { stroke-dasharray: 5 3; opacity: .7; }
.cg-strap.spring { stroke: var(--x-2c4a8c, #2c4a8c); stroke-width: 2.6; }
.cg-row { stroke: var(--x-8f7a55, #8f7a55); stroke-width: 1; }
.cg-ratchet { fill: var(--steel-250); stroke: var(--ink); }
.cg-point { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; }
.cg-ang { fill: none; stroke: var(--x-6e7177, #6e7177); stroke-width: 1; }
.cg-acc { stroke: var(--load); stroke-width: 1.8; }
.cg-acchead { fill: var(--load); }
.cg-cgc { fill: var(--surface); stroke: var(--ink); }
.cg-cgq { fill: var(--ink); }
.cg-dim { stroke: var(--x-6e7177, #6e7177); stroke-width: .8; }
.cg-dimhead { fill: var(--x-6e7177, #6e7177); }
.cg-lead { stroke: var(--steel-500); stroke-width: .8; pointer-events: none; }
.cg-leaddot { fill: var(--x-6e7177, #6e7177); pointer-events: none; }
.cg-cap { font-size: 11px; fill: var(--text-3); }
.fb-chart .cg-grid { fill: var(--fill-2); }
.fb-chart .cg-ok { fill: var(--good); opacity: .07; }
.fb-chart .cg-lim { fill: var(--good); opacity: .6; }
.fb-chart .cg-vl { cursor: ew-resize; }
.fb-chart .cg-vline { fill: var(--sel); }
#chart { touch-action: pan-y; }
.cgms tr.guide td { color: var(--text-3); }
/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-weight: 500; fill: var(--text-2); }
#view .pill.acc rect, #view .pill.mass rect { stroke: var(--x-c9d6f2, #c9d6f2); }
#view .pill.acc text, #view .pill.mass text { fill: var(--x-1e40af, #1e40af); font-weight: 600; }
#view .pill.acc.warn rect { stroke: color-mix(in srgb, var(--amber) 50%, transparent); } #view .pill.acc.warn text { fill: var(--x-9a6a12, #9a6a12); }
#view .pill.acc.bad rect { stroke: color-mix(in srgb, var(--bad) 45%, transparent); } #view .pill.acc.bad text { fill: var(--bad); }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 40%, transparent); }
#view .pill.load text { fill: var(--rust); font-weight: 600; }
#view .pill.editable { cursor: pointer; }
#view .pill.editable:hover rect, #view .pill.editable:focus-visible rect { stroke: var(--sel); }
#view .pill.editable:focus-visible { outline: none; }
.cg-ed { position: absolute; z-index: 20; width: 132px; }
.cg-ed input { box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
input.bad { border-color: var(--bad) !important; }

/* the strip under the drawing */
.cg-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; }
.cg-live .cg-slow { margin-left: auto; color: var(--text-3); font-size: 12px; }
.cg-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }

/* panel */
.cg-seg { margin: 4px 0 6px; }
.cg-seg button { white-space: normal; line-height: 1.25; }

/* chart */
.cg-chseg { flex-wrap: wrap; }
.cg-chseg button[hidden] { display: none; }
.fb-chart .cg-grid { fill: var(--fill-2); }
.fb-chart .cg-ok { fill: var(--good); opacity: .07; }
.fb-chart .cg-lim { fill: var(--bad); opacity: .55; }
.fb-chart .cg-vl { cursor: ew-resize; }
.fb-chart .cg-vline { fill: var(--sel); }
.fb-chart .hit { fill: transparent; }
.fb-chart .pill rect { fill: var(--surface); stroke: var(--sel); }
.fb-chart .pill text { fill: var(--sel); font-weight: 600; }
.fb-chart .halo { paint-order: stroke; stroke: var(--halo); stroke-width: 3.5px; stroke-linejoin: round; }
#chart { touch-action: pan-y; user-select: none; -webkit-user-select: none; }

/* margins table */
.cgms td.chk { white-space: normal; min-width: 260px; }
.cgms td.chk b { font-weight: 500; display: block; }
.cgms td.chk small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.35; }
.cgms td.chk small.cite { font-size: 11px; }
.grp .small-note { line-height: 1.45; }
.grp .small-note sub { font-size: .75em; }
.f > label span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
main.cg .panel-body { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); padding-bottom: 26px; }

@media (max-width: 1040px) { main.cg .work { grid-template-columns: minmax(0, 1fr); } main.cg .panel-body { -webkit-mask-image: none; mask-image: none; } }
@media (max-width: 760px) {
  .cg-chseg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .cg-chseg button { white-space: normal; }
  .cgms td.chk { min-width: 0; }
  .cgms thead { display: none; }
  .cgms, .cgms tbody { display: block; }
  .cgms tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; padding: 8px 6px; border-bottom: 1px solid var(--fill-1); }
  .cgms td { display: block; text-align: left; padding: 0; border: 0; }
  .cgms td.chk { grid-column: 1 / -1; }
  .cgms td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--text-3); }
}
#view .pill.seg.fall rect { stroke: color-mix(in srgb, var(--rust) 35%, transparent); } #view .pill.seg.fall text { fill: var(--rust); font-weight: 600; }
#view .pill.seg.dwell text { font-weight: 600; }
.cg-ed { position: absolute; z-index: 20; width: 132px; }
.cg-ed input { box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
@media (max-width: 560px) { .cg-types { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#view .pill.acc rect { stroke: color-mix(in srgb, var(--load) 40%, transparent); } #view .pill.acc text { fill: var(--rust); font-weight: 600; }
#view .pill.mass rect { stroke: var(--x-b9c0c8, #b9c0c8); } #view .pill.mass text { fill: var(--text); font-weight: 600; }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 40%, transparent); } #view .pill.load text { fill: var(--rust); font-weight: 600; }

/* 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-1e40af: #789ef5; --x-2c4a8c: #83a1dd; --x-6e7177: #85827f; --x-8f7a55: #9e8c6e; --x-9a6a12: #d0a66a;
    --x-b9c0c8: #44494f; --x-c9d6f2: #313a4c; --x-cbb894: #77694e; --x-e3e8f1: #2c2f34;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e40af: #789ef5; --x-2c4a8c: #83a1dd; --x-6e7177: #85827f; --x-8f7a55: #9e8c6e; --x-9a6a12: #d0a66a;
    --x-b9c0c8: #44494f; --x-c9d6f2: #313a4c; --x-cbb894: #77694e; --x-e3e8f1: #2c2f34;
  }
}
/* theme-auto:end */
/* dark, picked by hand: tyres stay rubber (near-black, below the card) with a light steel hub, instead of the
   mirrored steel ramp's pale tyres */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cg-wheel { fill: #131312; }
  :root:not([data-theme="light"]) .cg-hub { fill: #73777e; }
}
@media screen {
  :root[data-theme="dark"] .cg-wheel { fill: #131312; }
  :root[data-theme="dark"] .cg-hub { fill: #73777e; }
}
