/* Rotor balancing — on top of calc.css */
#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 { stroke-width: 2.6; }

/* 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.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: text; }
#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; }
.bl-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); }
.bl-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.bl-edit-name input { width: 180px; text-align: center; }
.bl-edit span { font-size: 11.5px; color: var(--text-3); }
@media print { .bl-edit { display: none !important; } }

/* live strip and flags */
.bl-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; }
.bl-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.bl-live i { font-style: normal; color: var(--text-3); }
.bl-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bl-flags span { font-size: 11.5px; color: var(--warn-ink); border: 1px solid var(--line); background: var(--warn-bg); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
main.bl .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.bl .stage-bar .hist { margin-left: auto; }

/* panel */
.bl-seg { margin-bottom: 8px; }
.bl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.bl-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; }
.bl-chip:hover { border-color: var(--line-2); }
.bl-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); }
#panel select { font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; background: var(--surface); color: var(--text); min-width: 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 */
.bl-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 36ch; }
.bl-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; }

#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:last-child { 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; }
}
main.bl .tabs { grid-template-columns: repeat(3, 1fr); }
main.bl .stage-bar .seg { flex: 0 0 auto; }
/* side view */
.bl-shaft { fill: var(--steel-300); stroke: var(--steel-800); stroke-width: 1; }
.bl-body { fill: var(--steel-200); stroke: var(--steel-800); stroke-width: 1.3; }
.bl-axis { fill: none; stroke: var(--steel-550); stroke-width: .7; stroke-dasharray: 9 3 1.5 3; pointer-events: none; }
.bl-brg { fill: var(--surface); stroke: var(--steel-800); stroke-width: 1.2; stroke-linejoin: round; }
.bl-ground { stroke: var(--steel-800); stroke-width: 1.2; }
.bl-plane { stroke: var(--sel); stroke-width: 1.1; stroke-dasharray: 5 3; fill: none; }
.bl-pname { font-size: 12px; font-weight: 600; fill: var(--x-1e4fbf, #1e4fbf); }
.bl-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.bl-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.bl-dimh { fill: var(--steel-550); }
.bl-ext { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.bl-title { font-size: 11px; font-weight: 600; fill: var(--text-2); letter-spacing: .04em; }
#view .pill.tol rect { stroke: color-mix(in srgb, var(--good) 45%, transparent); } #view .pill.tol text { fill: var(--olive); font-weight: 600; }
#view .pill.tolc rect { stroke: color-mix(in srgb, var(--sel) 40%, transparent); } #view .pill.tolc text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.force rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.force text { fill: var(--load-ink); }
/* polar diagrams and plane end views */
.bl-ring { fill: none; stroke: var(--steel-200); stroke-width: .8; }
.bl-spoke { stroke: var(--steel-100); stroke-width: .8; }
.bl-ang { font-size: 10.5px; fill: var(--text-3); }
.bl-disc { fill: var(--steel-100); stroke: var(--steel-800); stroke-width: 1.3; }
.bl-hub { fill: var(--steel-350); stroke: var(--steel-800); stroke-width: 1; }
.bl-hole { fill: var(--surface); stroke: var(--steel-550); stroke-width: .9; }
.bl-trial { fill: var(--steel-350); stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 1.5; }
.bl-trialk { fill: var(--steel-350); stroke: var(--text-2); stroke-width: 1.2; }
.bl-corr { fill: var(--load); stroke: var(--x-a8401f, #a8401f); stroke-width: 1; }
#view .handle.hr { cursor: move; }
#view .handle.hr .knob { fill: transparent; }
#view .pill.v0 rect { stroke: color-mix(in srgb, var(--steel-800) 45%, transparent); } #view .pill.v0 text { fill: var(--steel-800); font-weight: 600; }
#view .pill.v1 rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.v1 text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.v2 rect { stroke: color-mix(in srgb, var(--x-7a4fa0, #7a4fa0) 45%, transparent); } #view .pill.v2 text { fill: var(--x-6a3f91, #6a3f91); font-weight: 600; }
#view .pill.res rect { stroke: color-mix(in srgb, var(--good) 45%, transparent); } #view .pill.res text { fill: var(--olive); font-weight: 600; }
#view .pill.trial rect { stroke: var(--steel-350); stroke-dasharray: 3 2; }
#view .pill.corr rect { stroke: color-mix(in srgb, var(--load) 45%, transparent); } #view .pill.corr text { fill: var(--load-ink); font-weight: 600; }
.bl-pair { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 6px; }
.f.bl-vec { grid-template-columns: minmax(0, 1fr) 176px; }
.bl-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 8px 0 2px; cursor: pointer; }
.bl-check input { margin: 0; }
#gchart .ndrag { cursor: ew-resize; }
#gchart { touch-action: none; user-select: none; }

/* 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-6a3f91: #b08dd5; --x-6e7177: #85827f; --x-7a4fa0: #b895dc; --x-a8401f: #e68b70;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-6a3f91: #b08dd5; --x-6e7177: #85827f; --x-7a4fa0: #b895dc; --x-a8401f: #e68b70;
  }
}
/* theme-auto:end */
