/* fits and tolerances — on top of calc.css */
main.fits .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.fits .stage-bar .hist { margin-left: auto; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ft-type { flex: 1 1 200px; max-width: 280px; min-width: 150px; }
.ft-type input { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 14px; font-weight: 500; outline: none; background: var(--surface); }
.ft-type input:focus { border-color: var(--text-2); }
.ft-type input.bad { border-color: var(--bad); }
.ft-msg { margin: 0; padding: 0 14px; font-size: 12px; color: var(--bad); min-height: 0; }
.ft-msg:empty { display: none; }
.ft-msg:not(:empty) { padding: 6px 14px 0; }

#view { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .handle { cursor: grab; }
#view .handle.v { cursor: ns-resize; }
#view .handle.h { cursor: ew-resize; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob { fill: var(--sel); }
#view .grid-l { stroke: var(--fill-1); }
#view .ax-t { font-size: calc(10.5px * var(--tk, 1)); fill: var(--text-3); font-variant-numeric: tabular-nums; }
#view .zero { stroke: var(--ink); stroke-width: 1.2; }
#view .zero-t { font-size: calc(11px * var(--tk, 1)); fill: var(--text-2); }
#view .zone { cursor: pointer; }
#view .zone-l { font-size: calc(15px * var(--tk, 1)); font-weight: 600; }
#view .ext-l { stroke: var(--steel-400); stroke-width: .8; stroke-dasharray: 3 2; fill: none; }
#view .ft-err { font-size: calc(13px * var(--tk, 1)); fill: var(--bad); }
#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, #view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }
#view .pill.title text { fill: var(--text); font-weight: 600; }
#view .pill.hole rect { stroke: color-mix(in srgb, var(--clamp) 35%, transparent); } #view .pill.hole text { fill: var(--clamp); }
#view .pill.shaft rect { stroke: color-mix(in srgb, var(--moment) 35%, transparent); } #view .pill.shaft text { fill: var(--moment); }
#view .pill.dim rect { stroke: var(--dc); } #view .pill.dim text { fill: var(--dc); font-weight: 600; }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.load text { fill: var(--load); font-weight: 600; }
#view .s-part { fill: var(--steel-200); stroke: var(--steel-600); stroke-width: .9; }
#view .s-shaft { fill: var(--steel-50); stroke: var(--steel-700); stroke-width: .9; }
#view .cl { stroke: var(--steel-500); stroke-width: .7; stroke-dasharray: 12 3 2 3; fill: none; }
#view .s-lab { font-size: calc(11.5px * var(--tk, 1)); font-weight: 500; font-variant-numeric: tabular-nums; }
#view .s-cap { font-size: calc(10.5px * var(--tk, 1)); fill: var(--text-3); }
#view .sc-ax { stroke: var(--faint); stroke-width: 1.2; }
#view .sc-tk { stroke: var(--faint); stroke-width: 1; }
#view .sc-l { font-size: calc(10.5px * var(--tk, 1)); fill: var(--text-3); font-variant-numeric: tabular-nums; }
#view .sc-rng { fill: var(--sel); fill-opacity: .25; }
#view .p-out { fill: none; stroke: var(--steel-700); stroke-width: 1; }
#view .p-free { fill: var(--steel-50); }
#view .p-bore { stroke: var(--steel-700); stroke-width: 1; }
#view .p-name { font-size: calc(11.5px * var(--tk, 1)); fill: var(--text-2); }
#view .dimln { stroke: var(--steel-550); stroke-width: .8; fill: none; }
#view .leg-t, #view .leg-n { font-size: calc(10.5px * var(--tk, 1)); fill: var(--text-3); font-variant-numeric: tabular-nums; }
#view .tick { stroke: var(--faint); }
#view .l-t { fill: none; stroke: var(--clamp); stroke-width: 1.8; }
#view .l-r { fill: none; stroke: var(--moment); stroke-width: 1.4; stroke-dasharray: 5 3; }
#view .l-lab { font-size: calc(11px * var(--tk, 1)); font-weight: 600; fill: var(--clamp); }
#view .l-lab.r { fill: var(--moment); }
#view .l-dot { fill: var(--clamp); }

/* letter grid: every fundamental deviation at this size */
.ft-grid { border-top: 1px solid var(--line); padding: 8px 12px 6px; display: grid; gap: 6px; }
.ft-grid[hidden] { display: none; }
.ft-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: center; }
.ft-rl { display: grid; font-size: 12px; line-height: 1.3; }
.ft-rl span { color: var(--text-3); font-size: 11.5px; }
.ft-cells { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); gap: 2px; }
.ft-cell { border: 0; background: none; border-radius: 6px; padding: 2px 0 1px; cursor: pointer; display: grid; justify-items: center; gap: 0; min-width: 0; }
.ft-cell svg { width: 100%; max-width: 26px; height: 44px; display: block; }
.ft-cell span { font-size: 11px; color: var(--text-2); line-height: 1.2; }
.ft-cell:hover { background: var(--steel-50); }
.ft-cell.on { box-shadow: inset 0 0 0 1px var(--line-2); background: var(--steel-50); }
.ft-cell.on span { color: var(--text); font-weight: 600; }
.ft-cell:disabled { cursor: default; opacity: .5; }
.ft-cell:disabled:hover { background: none; }
.ft-cell .z0 { stroke: var(--steel-500); stroke-width: .8; }
.ft-cell .na { font-size: 10px; fill: var(--steel-400); }
.ft-gnote { margin: 0; font-size: 11.5px; color: var(--text-3); }
@media (max-width: 900px) {
  .ft-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ft-rl { grid-auto-flow: column; justify-content: start; gap: 8px; }
  .ft-cells { grid-template-columns: repeat(14, minmax(0, 1fr)); row-gap: 4px; }
}

.ft-grades { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 6px; align-items: start; padding: 4px 0; }
.ft-grades .lab { font-size: 12.5px; font-weight: 500; padding-top: 4px; }
.ft-grades .seg { display: flex; flex-wrap: wrap; gap: 2px; }
.ft-grades .seg button { padding: 3px 6px; font-size: 12px; min-width: 28px; }
.ft-cls { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font: inherit; font-size: 13.5px; font-weight: 500; outline: none; background: var(--surface); }
.ft-cls:focus { border-color: var(--text-2); }
.ft-cls.bad { border-color: var(--bad); }
.ft-cls:disabled { color: var(--text-3); background: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--line-2); }
.chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.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 .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; color: var(--text-2); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; text-align: right; }
table.ft-g { width: 100%; font-size: 12.5px; }
table.ft-g td.note { white-space: normal; color: var(--text-3); font-size: 11.5px; }

.th-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; }
.th-live b { font-weight: 500; color: var(--text-3); margin-right: 4px; }
.th-live .x-no { color: var(--bad); font-weight: 500; }
.th-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); }
.th-edit input { width: 92px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.th-edit span { font-size: 11.5px; color: var(--text-3); }
.ft-hero { display: flex; flex-direction: column; min-width: 0; overflow: hidden; position: relative; }

.ex-wrap { position: relative; }

/* summary */
.th-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 { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.story .mode a { color: var(--text-3); text-transform: none; letter-spacing: 0; font-weight: 500; }
.th-mini { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); border-left: 1px solid var(--line); }
.th-mini .stat { border-left: 0; border-top: 1px solid var(--line); }
.th-mini .stat:nth-child(-n+2) { border-top: 0; }
.th-mini .stat:nth-child(even) { border-left: 1px solid var(--line); }
@media (max-width: 1320px) {
  .th-sum { grid-template-columns: minmax(0, 1fr); }
  .th-mini { grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); }
  .th-mini .stat { border-top: 0; border-left: 1px solid var(--line); }
  .th-mini .stat:first-child { border-left: 0; }
}
@media (max-width: 700px) {
  .th-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .th-mini .stat:nth-child(odd) { border-left: 0; }
  .th-mini .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
#marginsCard[hidden] { display: none; }
#checks tr[data-check] { cursor: default; }
#checks td.note { white-space: normal; min-width: 180px; }
table.ft-lim td.l b { font-weight: 600; }

#chart { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
#chart .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; }
.halo { paint-order: stroke; stroke: var(--halo); stroke-width: 3.5px; stroke-linejoin: round; }

details.step.gov > summary .t::after { content: "result"; margin-left: 10px; font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: .03em; text-transform: uppercase; }
body.is-press details.step.gov > summary .t::after { content: "governs"; color: var(--bad); }
.step .where { font-size: 12px; color: var(--text-3); margin: 6px 0 0; line-height: 1.6; }
.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; }

@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; }
  table.ft-lim th:nth-child(6), table.ft-lim td:nth-child(6) { display: none; }
  .step .eq .katex { font-size: .82em; }
  .ex-menu { min-width: 270px; }
  .story { padding: 12px 14px; }
  .ft-type { max-width: none; order: 5; flex-basis: 100%; }
}
.ft-msg.info { color: var(--text-2); }
/* panel labels wrap to a second line instead of ending in an ellipsis (T029 QA) */
.f > label span { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.3; }

/* the panel fades out at an edge it scrolls past (fadePanel in app.js) */
#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); }

/* 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-6e7177: #85827f; --x-86621f: #c3a370; --x-9dbfe0: #6a849d; --x-a0762a: #d0ac73; --x-bcd3ea: #31404f;
    --x-d9622f: #fd9c76; --x-e8964b: #fcb77d; --x-efbb73: #d5ab72; --x-f2d9a6: #44330c;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-6e7177: #85827f; --x-86621f: #c3a370; --x-9dbfe0: #6a849d; --x-a0762a: #d0ac73; --x-bcd3ea: #31404f;
    --x-d9622f: #fd9c76; --x-e8964b: #fcb77d; --x-efbb73: #d5ab72; --x-f2d9a6: #44330c;
  }
}
/* theme-auto:end */
