/* V-belt drive — on top of calc.css */
main.vb .tabs { grid-template-columns: repeat(3, 1fr); }
main.vb .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.vb .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 .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }

/* pulleys and belt */
.vb-rim { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1.1; }
.vb-web { fill: var(--steel-50); stroke: var(--steel-500); stroke-width: .8; }
.vb-hole { fill: var(--surface-2); stroke: var(--steel-500); stroke-width: .8; }
.vb-mark { stroke: var(--steel-500); stroke-width: 1.4; }
.vb-hub { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1; }
.vb-key { fill: var(--steel-700); }
.vb-bore { fill: var(--surface); stroke: var(--steel-700); stroke-width: .9; }
.vb-datum { fill: none; stroke: var(--steel-500); stroke-width: .7; stroke-dasharray: 6 3 1.5 3; pointer-events: none; }
.vb-belt { fill: none; stroke: var(--steel-750); stroke-linejoin: round; pointer-events: none; }
.vb-tight { stroke: var(--steel-850); stroke-linecap: butt; pointer-events: none; }
.vb-run { fill: none; stroke: var(--steel-350); stroke-dasharray: 2 14; stroke-linecap: round; pointer-events: none; }
.vb-ctr { stroke: var(--steel-700); stroke-width: .9; }
.vb-wrap { fill: none; stroke: var(--sel); stroke-width: 1.2; stroke-dasharray: 3 2.5; pointer-events: none; }
.vb-ext { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.vb-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.vb-dimh { fill: var(--steel-550); }
.vb-load line { stroke: var(--load); stroke-width: 1.8; }
.vb-load path { fill: var(--load); stroke: none; }
.vb-load.vb-grey line { stroke: var(--steel-550); } .vb-load.vb-grey path { fill: var(--steel-550); }
.vb-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.vb-role { font-size: 11px; fill: var(--text-3); }
.vb-nm { cursor: text; }
.vb-nm:hover .vb-name, .vb-nm:focus .vb-name { fill: var(--sel); }
.vb-nm:focus { outline: 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.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.beta rect { stroke: color-mix(in srgb, var(--sel) 35%, transparent); } #view .pill.beta text { fill: var(--x-1e4fbf, #1e4fbf); }
#view .pill.set rect { stroke: var(--text-2); }
#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; }
.vb-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); }
.vb-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.vb-edit-name input { width: 180px; text-align: center; }
.vb-edit span { font-size: 11.5px; color: var(--text-3); }

/* live strip and flags */
.vb-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; }
.vb-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.vb-live i { font-style: normal; color: var(--text-3); }
.vb-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.vb-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 */
.vb-fam { font-size: 11.5px; color: var(--text-3); margin: 6px 0 4px; }
.vb-fam:first-child { margin-top: 0; }
.vb-profs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.vb-prof { display: grid; justify-items: center; gap: 0; padding: 4px 8px 3px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); cursor: pointer; font-size: 12px; color: var(--text-2); }
.vb-prof:hover { border-color: var(--line-2); }
.vb-prof.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); color: var(--text); }
.vb-seg { margin-bottom: 6px; }
.vb-snap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 2px 0 4px; font-size: 12px; color: var(--text-3); }
.vb-snap > span { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.vb-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; }
.vb-chip:hover { border-color: var(--line-2); }
.vb-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.vb-lab { font-size: 12px; color: var(--text-3); margin: 8px 0 4px; }
.vb-duty { display: grid; gap: 4px; }
.vb-card { display: grid; gap: 1px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; cursor: pointer; color: var(--text); font-size: 12.5px; }
.vb-card b { font-weight: 500; }
.vb-card span { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.vb-card:hover { border-color: var(--line-2); }
.vb-card.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }

/* summary */
.vb-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.vb-des { font-weight: 600; color: var(--x-1e4fbf, #1e4fbf); }
.vb-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; }

/* installation and the chart */
.vb-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.vb-inst-grid { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 16px; align-items: start; }
.vb-kv { display: grid; gap: 0; }
.vb-kv > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.vb-kv span { color: var(--text-2); }
.vb-kv b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vb-kv i { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; color: var(--text-3); }
.vb-gfig .small-note { margin-top: 4px; }
.vb-gcap { margin: 2px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.4; }
.vb-groove { display: block; width: 100%; height: auto; }
.vb-pul { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1; }
.vb-sec { fill: var(--steel-350); stroke: var(--steel-750); stroke-width: 1; }
.vb-gt { font-size: 12px; font-weight: 600; fill: var(--load); }
.vb-gs { font-size: 11.5px; fill: var(--text-2); }
.vb-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
#tchart .tdrag { cursor: ew-resize; }
#tchart { touch-action: none; user-select: none; }

/* other profiles */
table.vb-alt { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.vb-alt th { font-weight: 500; font-size: 11.5px; color: var(--text-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vb-alt td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vb-alt th.l, .vb-alt td.l { text-align: left; }
.vb-alt tr.sel td { background: var(--sel-bg); }
.vb-pn { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1100px) { .vb-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .vb-inst-grid { grid-template-columns: minmax(0, 1fr); }
  .vb-gfig { max-width: 300px; }
  table.vb-alt thead { display: none; }
  table.vb-alt, .vb-alt tbody, .vb-alt tr, .vb-alt td { display: block; width: 100%; }
  .vb-alt tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .vb-alt td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .vb-alt td:nth-child(1) { font-weight: 500; }
  .vb-alt td:nth-child(3)::before { content: "pulleys "; color: var(--text-3); }
  .vb-alt td:nth-child(4)::before { content: "a "; color: var(--text-3); }
  .vb-alt td:nth-child(5)::before { content: "v "; color: var(--text-3); }
  .vb-alt td:nth-child(6)::before { content: "face "; color: var(--text-3); }
  .vb-alt td:nth-child(7)::before { content: "shaft load "; color: var(--text-3); }
  .vb-alt td:nth-child(8), .vb-alt td:nth-child(9) { text-align: right; }
  .vb-profs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
#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); }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
/* phones: the margins as stacked cards (no sideways scroll) */
@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); }
}
@media print { .vb-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-1e4fbf: #749ff5; --x-6e7177: #85827f;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-6e7177: #85827f;
  }
}
/* theme-auto:end */
