/* lead and ball screws: on top of calc.css */
main.scr { --steel: var(--steel-300); --q: var(--moment); --bk: var(--x-8a4a8a, #8a4a8a); }
main.scr .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.scr .stage-bar .hist { margin-left: auto; }
.stage { position: relative; }
#view { display: block; width: 100%; height: auto; flex: 1; min-height: 0; user-select: none; touch-action: none; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .handle { cursor: grab; }
#view .handle.h { cursor: ew-resize; }
#view .handle .hit { fill: transparent; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob { fill: var(--sel); }
#view .nutg { cursor: ew-resize; }

/* side view */
#view .motor { fill: var(--steel-100); stroke: var(--steel-600); stroke-width: .9; }
#view .coup { fill: var(--steel-250); stroke: var(--steel-600); stroke-width: .8; }
#view .screw { fill: var(--steel); stroke: var(--ink); stroke-width: .9; }
#view .thr { stroke: var(--x-8f979f, #8f979f); stroke-width: .7; fill: none; }
#view .cl { stroke: var(--steel-500); stroke-width: .7; stroke-dasharray: 12 3 2 3; fill: none; }
#view .hous { fill: var(--steel-200); stroke: var(--steel-600); stroke-width: .9; }
#view .gnd { stroke: var(--steel-600); stroke-width: 1; }
#view .bball { fill: var(--steel-50); stroke: var(--steel-700); stroke-width: .8; }
#view .clamp { stroke: var(--ink); stroke-width: 1.4; }
#view .table { fill: var(--steel-100); stroke: var(--steel-600); stroke-width: .9; }
#view .brk { fill: var(--steel-200); stroke: var(--steel-600); stroke-width: .8; }
#view .nut { fill: var(--steel-150); stroke: var(--ink); stroke-width: 1; }
#view .bkband { fill: color-mix(in srgb, var(--x-8a4a8a, #8a4a8a) 10%, transparent); }
#view .mode { fill: none; stroke-width: 1.6; stroke-dasharray: 5 4; }
#view .mode.bk { stroke: var(--bk); }
#view .mode.wh { stroke: var(--q); }
#view .strk { fill: var(--x-c9d4ee, #c9d4ee); }
#view .dim { stroke: var(--steel-500); stroke-width: .9; fill: none; }
#view .dimh { fill: var(--steel-500); }
#view .cap { font-size: calc(11px * var(--tk, 1)); fill: var(--text-3); }
#view .arr { stroke: var(--load); stroke-width: 1.8; fill: none; }
#view .arrh { fill: var(--load); }
#view .rot { stroke: var(--text-3); stroke-width: 1.1; fill: none; }
#view .roth { fill: var(--text-3); }
/* thread inset */
#view .inset { fill: var(--surface-2); stroke: var(--steel-300); }
#view .iscr, #view .iscrf { fill: var(--steel); stroke: var(--ink); stroke-width: .9; stroke-linejoin: round; }
#view .inut, #view .inutf { fill: var(--steel-100); stroke: var(--steel-600); stroke-width: .9; stroke-linejoin: round; }
#view .igroove { fill: var(--surface-2); stroke: var(--ink); stroke-width: .9; }
#view .iball { fill: var(--steel-50); stroke: var(--steel-700); stroke-width: .9; }
#view .icl { stroke: var(--q); stroke-width: .9; stroke-dasharray: 4 3; }
#view .ipl { stroke: var(--q); stroke-width: .8; stroke-dasharray: 6 3; }
/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-size: calc(11.5px * var(--tk, 1)); font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }
#view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.6; }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 40%, transparent); }
#view .pill.load text { fill: var(--load); font-weight: 600; }
#view .pill.title text { fill: var(--text); font-weight: 600; }
#view .pill.title.editable rect { stroke: var(--steel-350); }
#view .pill.bk rect { stroke: color-mix(in srgb, var(--x-8a4a8a, #8a4a8a) 40%, transparent); }
#view .pill.bk text { fill: var(--bk); font-weight: 600; }
#view .pill.wh rect { stroke: color-mix(in srgb, var(--moment) 40%, transparent); }
#view .pill.wh text { fill: var(--q); font-weight: 600; }
#view .pill.dimv text { fill: var(--text-2); }

/* live strip under the drawing */
.sc-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: 34px; align-items: center; }
.sc-live b { font-weight: 500; color: var(--text-3); margin-right: 4px; }
.sc-live .x-ok { color: var(--good); font-weight: 500; }
.sc-live .x-no { color: var(--bad); font-weight: 500; }

/* in-place editor */
.sc-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); }
.sc-edit input { width: 92px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.sc-edit span { font-size: 11.5px; color: var(--text-3); }

/* examples menu */
.ex-wrap { position: relative; }

/* panel */
main.scr .f > label span { white-space: normal; overflow: visible; text-overflow: clip; }
.f.segf { grid-template-columns: minmax(0, 1fr) auto; }
.f.segf .seg button { padding: 4px 9px; font-size: 12.5px; }
.f.segf.stack { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.f.segf.stack > label:has(span:empty) { display: none; }
.f.segf.stack .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.f.sel { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.f.sel > label { grid-template-columns: minmax(0, 1fr); }
.f.sel > label i:empty { display: none; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; color: var(--text-2); margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; text-align: right; }
.sc-hint { font-size: 12px; color: var(--text-3); margin: 4px 0 6px; line-height: 1.45; }
.sc-hint a { color: var(--text-2); }
.sc-fr { display: grid; gap: 4px; margin: 6px 0 2px; }
.sc-frb { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; text-align: left; cursor: pointer; display: grid; gap: 1px; font: inherit; }
.sc-frb b { font-size: 12.5px; font-weight: 500; color: var(--text); }
.sc-frb span { font-size: 11.5px; color: var(--text-3); }
.sc-frb:hover, .sc-frb:focus-visible { border-color: var(--text-3); outline: none; }

/* summary */
.sc-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.story { padding: 14px 20px; display: grid; align-content: center; gap: 6px; min-width: 0; }
.story p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); max-width: 72ch; }
.story p.sub { font-size: 12.5px; color: var(--text-2); }
.story .mode { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.sc-mini { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); border-left: 1px solid var(--line); }
.sc-mini .stat { border-left: 0; border-top: 1px solid var(--line); }
.sc-mini .stat:nth-child(-n+2) { border-top: 0; }
.sc-mini .stat:nth-child(even) { border-left: 1px solid var(--line); }
@media (max-width: 1320px) {
  .sc-sum { grid-template-columns: minmax(0, 1fr); }
  .sc-mini { grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); }
  .sc-mini .stat { border-top: 0; border-left: 1px solid var(--line); }
  .sc-mini .stat:first-child { border-left: 0; }
}
@media (max-width: 700px) {
  .sc-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-mini .stat:nth-child(odd) { border-left: 0; }
  .sc-mini .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* margins */
#checks tr[data-check] { cursor: pointer; }
#checks td.chk { white-space: normal; min-width: 170px; }
#checks td.note { white-space: normal; min-width: 180px; color: var(--text-2); font-size: 12.5px; }
#checks .guide-tag { font-size: 11px; color: var(--text-3); margin-left: 6px; white-space: nowrap; }
#checks tr.ref td { color: var(--text-3); }

/* charts */
.sc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
#chartN, #chartT, #chartE { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
#chartN .drag { cursor: move; }
#chartT .drag, #chartE .drag { cursor: ew-resize; }
.ch-t { font-size: 10.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ch-a { font-size: 11px; fill: var(--text-2); }
.ch-l { font-size: 11px; font-weight: 600; }
@media (max-width: 1040px) { .sc-row { grid-template-columns: minmax(0, 1fr); } }

/* motor card */
.sc-motor { padding: 0 0 4px; }
.sc-mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.sc-mgrid .stat { border-left: 0; }
.sc-mgrid .stat:nth-child(even) { border-left: 1px solid var(--line); }
.sc-mgrid .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
.sc-motor .sc-hint { margin-top: 10px; }

/* duty cycle and sizes */
table.duty td input { width: 84px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; text-align: right; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; background: var(--surface); }
table.duty td input:focus { border-color: var(--text-2); outline: none; }
table.duty tr.cur td { background: var(--bg); }
table.duty td.n { color: var(--text-3); }
table.duty tbody tr { cursor: pointer; }
#addRow { margin-top: 10px; }
table.sizes tr.cur td { background: var(--bg); }
table.sizes tr.cur td.l { color: var(--sel); }
table.sizes tbody tr { cursor: pointer; }

/* steps and sources */
details.step.gov > summary .t::after { content: "governs"; margin-left: 10px; font-size: 11px; font-weight: 600; color: var(--bad); letter-spacing: .03em; text-transform: uppercase; }
.step .where { font-size: 12px; color: var(--text-3); margin: 6px 0 0; line-height: 1.6; }
.step .where a { color: var(--text-3); }
.refs-body .md-src li { margin: 5px 0; }
.sec-tag { font-style: normal; font-size: 11px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 4px; }

/* phone: stage, then summary, then the panel */
@media (max-width: 1040px) {
  main.scr .work { display: contents; }
  main.scr > * { order: 10; }
  main.scr .stage { order: 1; }
  main.scr #summary { order: 2; }
  main.scr .panel { order: 3; contain: none; }
}
@media (max-width: 700px) {
  #checks th:nth-child(4), #checks td:nth-child(4) { display: none; }
  .margins td, .margins th { padding-left: 4px; padding-right: 4px; }
  .margins .ms { min-width: 54px; padding: 2px 6px; }
  #checks td.chk { min-width: 0; }
  .step .eq .katex { font-size: .86em; }
  table.duty th:nth-child(n+6), table.duty td:nth-child(n+6) { display: none; }
  table.duty td:last-child, table.duty th:last-child { display: table-cell; }
  table.duty td input { width: 58px; padding: 4px; font-size: 12.5px; }
  table.sizes th:nth-child(3), table.sizes td:nth-child(3), table.sizes th:nth-child(4), table.sizes td:nth-child(4) { display: none; }
  .sc-mgrid { grid-template-columns: minmax(0, 1fr); }
  .sc-mgrid .stat:nth-child(even) { border-left: 0; }
  .sc-mgrid .stat:nth-child(n+2) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) { .ex-menu { min-width: 0; width: calc(100vw - 40px); } .story { padding: 12px 14px; } }
@media (max-width: 440px) { #checks th:nth-child(3), #checks td:nth-child(3) { display: none; } }
#view .ilab { font-size: calc(10.5px * var(--tk, 1)); }
@media (max-width: 560px) {
  main.scr .stage-bar { gap: 6px; }
  main.scr #kindSeg button { padding-left: 9px; padding-right: 9px; }
  main.scr .stage-bar .hist button { padding-left: 6px; padding-right: 6px; }
}
main.scr .panel-body.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
.step .eq.fade { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
#view .icp { fill: var(--q); }
@media (max-width: 420px) { main.scr #kindSeg .sc-long { display: none; } }
#view .iball { fill: var(--surface-2); stroke: var(--x-3f4650, #3f4650); stroke-width: 1; }
#view .iball { stroke: var(--steel-550); stroke-width: .8; }
#view .igr { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
/* verdict: the governing margin, then the next lowest ones */
main.scr .sc-verdict { justify-content: flex-start; }
.sc-next { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.sc-next li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.sc-next li span { min-width: 0; }
.sc-next .ms { flex: none; font-weight: 500; }
/* duty condition names: renamed in the first cell, the type as a grey subtitle */
table.duty td.n { min-width: 150px; }
.sc-nm { display: grid; line-height: 1.15; text-align: left; }
table.duty td input.sc-name { width: 100%; min-width: 0; text-align: left; font-weight: 600; color: var(--text); border-color: transparent; background: transparent; padding: 2px 6px; margin-left: -6px; font-variant-numeric: normal; }
table.duty td input.sc-name:hover { border-color: var(--line); }
table.duty td input.sc-name:focus { border-color: var(--line-2); background: var(--surface); }
.sc-nm small { font-size: 11px; color: var(--text-3); }
table.duty tr.sc-nmrow { display: none; }
@media (max-width: 700px) {
  table.duty tr.sc-nmrow { display: table-row; }
  table.duty tr.sc-nmrow td { padding-bottom: 0; border-bottom: 0; }
  table.duty th:first-child, table.duty td.n { display: none; }
  table.duty tr.sc-nmrow td input.sc-name { margin-left: 0; }
}

/* 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-3f4650: #a3aab3; --x-6e7177: #85827f; --x-8a4a8a: #c990c8; --x-8a6d1f: #c2a96f; --x-8f979f: #61676d;
    --x-b3b9c0: #4a4e53; --x-c3c9cf: #3f4347; --x-c9d4ee: #343b4c;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-3f4650: #a3aab3; --x-6e7177: #85827f; --x-8a4a8a: #c990c8; --x-8a6d1f: #c2a96f; --x-8f979f: #61676d;
    --x-b3b9c0: #4a4e53; --x-c3c9cf: #3f4347; --x-c9d4ee: #343b4c;
  }
}
/* theme-auto:end */
