/* Belt conveyor — on top of calc.css */
main.bc .tabs { grid-template-columns: repeat(4, 1fr); }
main.bc .tabs button { white-space: normal; line-height: 1.2; }
main.bc .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.bc .stage-bar .hist { margin-left: auto; }
.cv-draw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 4px; align-items: start; }
#view, #sec { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view .hit, #sec .hit { fill: transparent; stroke: none; }
#view .handle, #sec .handle { cursor: grab; }
#view .handle.hx, #sec .handle.hx { cursor: ew-resize; }
#sec .handle.hy { cursor: ns-resize; }
#view .handle .knob, #sec .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob, #sec .handle:hover .knob, #sec .handle:focus .knob { fill: var(--sel); }

/* the profile */
.cv-ground { fill: none; stroke: var(--x-b9b2a3, #b9b2a3); stroke-width: 1.2; }
.cv-belt { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.cv-load { fill: var(--x-c8b48e, #c8b48e); stroke: none; }
.cv-pul { fill: var(--steel-150); stroke: var(--ink); stroke-width: 1.3; }
.cv-pul.drv { fill: var(--steel-350); }
.cv-axle { fill: var(--ink); }
.cv-idl { fill: var(--surface); stroke: var(--steel-600); stroke-width: 1; }
.cv-rope { fill: none; stroke: var(--text-2); stroke-width: 1.4; }
.cv-cw { fill: var(--steel-350); stroke: var(--ink); stroke-width: 1.2; }
.cv-motor rect { fill: var(--steel-250); stroke: var(--ink); stroke-width: 1.2; }
.cv-chute { fill: none; stroke: var(--text-2); stroke-width: 1.4; stroke-linejoin: round; }
.cv-dir { fill: none; stroke: var(--moment); stroke-width: 1.6; }
.cv-dirh { fill: var(--moment); }
.cv-dim { fill: none; stroke: var(--text-4); stroke-width: 1; }
.cv-dimh { fill: var(--text-4); }
.cv-ext { fill: none; stroke: var(--faint); stroke-width: .8; stroke-dasharray: 3 3; }
.cv-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.cv-role { font-size: 11px; fill: var(--text-3); }
.cv-cap { font-size: 11px; font-weight: 500; fill: var(--text-3); }
.cv-nm { cursor: text; }
.cv-nm:hover .cv-name, .cv-nm:focus .cv-name { fill: var(--sel); }
.cv-nm:focus { outline: none; }

/* the section */
.cv-roll { fill: var(--steel-150); stroke: var(--text-2); stroke-width: 1; }
.cv-frame { fill: none; stroke: var(--text-4); stroke-width: 1.4; }
.cv-mat { fill: var(--x-c8b48e, #c8b48e); stroke: var(--x-9c8659, #9c8659); stroke-width: .8; }
.cv-beltS { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.cv-guide { fill: none; stroke: var(--text-4); stroke-width: .9; stroke-dasharray: 3 2; }

/* pills */
#view .pill rect, #sec .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text, #sec .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.t1 rect { stroke: color-mix(in srgb, var(--bad) 45%, transparent); } #view .pill.t1 text { fill: var(--bad-ink); font-weight: 600; }
#view .pill.t2 rect { stroke: color-mix(in srgb, var(--moment) 50%, transparent); } #view .pill.t2 text { fill: var(--x-2c4a8a, #2c4a8a); font-weight: 600; }
#view .pill.tu rect { stroke: color-mix(in srgb, var(--text) 30%, transparent); } #view .pill.tu text { fill: var(--text); }
#view .pill.fl rect { stroke: color-mix(in srgb, var(--text) 35%, transparent); } #view .pill.fl text { fill: var(--text); font-weight: 600; }
#sec .pill.ar text { fill: var(--x-6f5a2c, #6f5a2c); }
#view .pill.editable, #sec .pill.editable { cursor: text; }
#view .pill.editable:hover rect, #view .pill.editable:focus rect, #sec .pill.editable:hover rect, #sec .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus, #sec .pill.editable:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.cv-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); }
.cv-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); }
.cv-edit-name input { width: 180px; text-align: center; }
.cv-edit span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* live strip and flags */
.cv-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; }
.cv-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.cv-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cv-flags span { display: inline-flex; align-items: center; line-height: 1; font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.cv-flags span.rg { color: var(--wip-ink); border-color: color-mix(in srgb, var(--x-8a5a0e, #8a5a0e) 40%, transparent); }
.cv-flags span.cv-err { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.cv-seg { margin-bottom: 6px; }
main.bc .f.sel { grid-template-columns: 76px minmax(0, 1fr); }
main.bc .f.sel > label { grid-template-columns: 0 minmax(0, 1fr); }
.cv-act { margin: 2px 0 8px; }
.cv-chk { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); margin: 6px 0; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#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 */
.cv-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 40ch; }
.cv-big { font-weight: 600; color: var(--x-2c4a8a, #2c4a8a); }

/* charts and the breakdown */
.cv-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
#tChart { touch-action: none; user-select: none; }
#tChart .cdrag { cursor: ns-resize; }
svg.fb-chart .ch-g { fill: var(--fill-1); }
svg.fb-chart .ch-g2 { fill: var(--grid-0); }
.cv-brk { display: grid; gap: 7px; padding: 4px 2px; font-size: 12.5px; }
.cv-br { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(40px, 1fr) auto 44px; gap: 10px; align-items: center; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cv-br .k { min-width: 0; line-height: 1.3; }
.cv-br .bar { height: 8px; background: var(--fill-1); border-radius: 4px; overflow: hidden; }
.cv-br .bar { display: block; } .cv-br .bar i { display: block; height: 8px; background: var(--x-8a9bc4, #8a9bc4); border-radius: 4px; }
.cv-br .bar i.neg { background: var(--x-c8b48e, #c8b48e); }
.cv-br .v { text-align: right; white-space: nowrap; color: var(--text); }
.cv-br .p { text-align: right; color: var(--text-3); }
.cv-br.tot { border-top: 1px solid var(--line); padding-top: 7px; font-weight: 600; }
.cv-br.tot .bar { background: transparent; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }

@media (max-width: 1100px) { .cv-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .cv-draw { grid-template-columns: minmax(0, 1fr); } #sec { max-width: 420px; margin: 0 auto; } }
@media (max-width: 760px) {
  #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: "allowed "; 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; }
  .cv-br { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .cv-br .bar { grid-column: 1 / -1; grid-row: 2; }
}
@media print { .cv-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-2c4a8a: #84a1dc; --x-6e7177: #85827f; --x-6f5a2c: #ae9b75; --x-7b8088: #73777e; --x-8a5a0e: #c89e6a;
    --x-8a9bc4: #8492b3; --x-9c8659: #ac9a75; --x-b9b2a3: #565146; --x-c8b48e: #837457;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-2c4a8a: #84a1dc; --x-6e7177: #85827f; --x-6f5a2c: #ae9b75; --x-7b8088: #73777e; --x-8a5a0e: #c89e6a;
    --x-8a9bc4: #8492b3; --x-9c8659: #ac9a75; --x-b9b2a3: #565146; --x-c8b48e: #837457;
  }
}
/* theme-auto:end */
