/* shaft — on top of calc.css */
main.sh .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.sh .stage-bar .hist { margin-left: auto; }
#view { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .hit { fill: transparent; stroke: none; }
#view text { font-variant-numeric: tabular-nums; }

/* shaft and parts */
.sh-shaft { stroke: var(--steel-750); stroke-width: 1.1; stroke-linejoin: round; }
.sh-edge { stroke: var(--steel-600); stroke-width: .8; }
.sh-gear { fill: var(--steel-200); stroke: var(--steel-600); stroke-width: 1; }
.sh-helix { stroke: var(--steel-500); stroke-width: .9; fill: none; }
.sh-break { fill: none; stroke: var(--steel-600); stroke-width: 1; }
.sh-blade { fill: none; stroke: var(--steel-600); stroke-width: 1; }
.sh-part, .sh-feat, .sh-bear { cursor: ew-resize; }
.sh-part:hover .sh-gear, .sh-part.on .sh-gear { stroke: var(--sel); }
.sh-key { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1; }
.sh-notch { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1; }
.sh-feat:hover .sh-key, .sh-feat.on .sh-key, .sh-feat:hover .sh-notch, .sh-feat.on .sh-notch { stroke: var(--sel); stroke-width: 1.4; }
.sh-brg { fill: var(--steel-100); stroke: var(--steel-700); stroke-width: 1; }
.sh-roll { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1; }
.sh-split { stroke: var(--steel-700); stroke-width: .9; fill: none; }
.sh-stop { stroke: var(--steel-700); stroke-width: 2.2; fill: none; }
.sh-float { stroke: var(--steel-700); stroke-width: 1.2; }
.sh-bear:hover .sh-brg, .sh-bear.on .sh-brg { stroke: var(--sel); }
.sh-bear:focus { outline: none; }
.sh-bear .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.6; }
.sh-bear:hover .knob, .sh-bear.on .knob { fill: var(--sel); }
.sh-bl { font-weight: 600; fill: var(--text); }
.sh-tq { stroke: var(--purple); stroke-width: 1.6; opacity: .55; pointer-events: none; }
.sh-tqc { fill: none; stroke: var(--purple); stroke-width: 1.3; pointer-events: none; }
.sh-tqa { fill: none; stroke: var(--purple); stroke-width: 1.4; }
.sh-defl { fill: none; stroke: var(--sel); stroke-width: 1.6; pointer-events: none; }
.sh-force { stroke: var(--load); stroke-width: 2; }
.sh-lead { stroke: var(--steel-350); stroke-dasharray: 2 2; }
.sh-zc { fill: var(--surface); stroke: var(--load); stroke-width: 1.4; }
.sh-zd { fill: var(--load); }
.sh-zx { stroke: var(--load); stroke-width: 1.4; }
.sh-dh { cursor: ns-resize; }
.sh-sh { cursor: ew-resize; }
#view .handle { cursor: ew-resize; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob { fill: var(--sel); }

/* pills */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-weight: 500; fill: var(--text-2); }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 40%, transparent); }
#view .pill.load text { fill: var(--rust); font-weight: 600; }
#view .pill.load.in rect { stroke: color-mix(in srgb, var(--purple) 50%, transparent); }
#view .pill.dia rect { fill: color-mix(in srgb, var(--surface) 88%, transparent); }
#view .pill.dimv rect { stroke: var(--steel-200); }
#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; }

/* strip and markers */
.sh-stripbox { fill: none; stroke: var(--steel-350); stroke-width: .8; }
.sh-mark { cursor: pointer; }
.sh-mark .sh-mn { font-weight: 600; }
.sh-mark:hover circle, .sh-mark.on circle { stroke-width: 2.6; }
.sh-mark:focus { outline: none; }

/* diagrams */
.sh-zero { stroke: var(--line-2); stroke-width: 1; }
.sh-line { fill: none; stroke-width: 1.2; stroke-linejoin: round; }
.sh-line.res, .sh-line.main { stroke-width: 2; }
.sh-line.res { stroke: var(--moment); }
.sh-fill.res { fill: color-mix(in srgb, var(--moment) 10%, transparent); }
.sh-line.py { stroke: var(--sel); stroke-dasharray: 5 3; }
.sh-line.pz { stroke: var(--clamp); stroke-dasharray: 2 2; }
.sh-line.py.main, .sh-line.pz.main { stroke-dasharray: none; }
.sh-fill.py { fill: color-mix(in srgb, var(--sel) 8%, transparent); }
.sh-fill.pz { fill: color-mix(in srgb, var(--clamp) 8%, transparent); }
.sh-line.tq { stroke: var(--purple); stroke-width: 2; }
.sh-fill.tq { fill: color-mix(in srgb, var(--purple) 10%, transparent); }
.sh-line.sl, .sh-line.df { stroke: var(--sel); stroke-width: 2; }
.sh-fill.sl, .sh-fill.df { fill: color-mix(in srgb, var(--sel) 8%, transparent); }
.sh-limbar { stroke: color-mix(in srgb, var(--good) 22%, transparent); stroke-width: 5; }
.sh-lim { stroke: var(--good); stroke-width: 1.6; }
.sh-pk { fill: var(--surface); stroke: var(--moment); stroke-width: 1.4; }
.sh-pk.tq { stroke: var(--purple); }
.sh-pk.sl, .sh-pk.df, .sh-pk.py { stroke: var(--sel); }
.sh-pk.pz { stroke: var(--clamp); }
.sh-ph { font-weight: 600; fill: var(--text); }
.sh-ph .ky, .sh-pv .ky { fill: var(--sel); font-weight: 500; }
.sh-ph .kz { fill: var(--clamp); font-weight: 500; }
.sh-ph .kr { fill: var(--moment); font-weight: 500; }
.sh-pkv { fill: var(--text-2); font-weight: 600; paint-order: stroke; stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; }
.sh-pkv.res { fill: var(--moment); } .sh-pkv.tq { fill: var(--purple); } .sh-pkv.sl, .sh-pkv.df, .sh-pkv.py { fill: var(--sel); } .sh-pkv.pz { fill: var(--clamp); }
.sh-gn { font-weight: 600; fill: var(--text); }
.sh-gu, .sh-gl { fill: var(--text-3); }
.sh-gu .ky { fill: var(--sel); } .sh-gu .kz { fill: var(--clamp); }
.sh-pu { font-weight: 400; fill: var(--text-3); }
.sh-pn { font-weight: 600; fill: var(--text-2); }
.sh-role { fill: var(--purple); font-weight: 500; }
.sh-fl { fill: var(--rust); font-weight: 600; }
.sh-blms { font-weight: 600; }
.sh-leader { stroke-width: 1; opacity: .7; }
#view .pill.ms rect { fill: var(--surface); }
#view .pill.ms.good rect { stroke: var(--x-9cc9ae, #9cc9ae); } #view .pill.ms.good text { fill: var(--good); }
#view .pill.ms.warn rect { stroke: var(--x-e8c68a, #e8c68a); } #view .pill.ms.warn text { fill: var(--warn); }
#view .pill.ms.bad rect { stroke: var(--x-eba69f, #eba69f); } #view .pill.ms.bad text { fill: var(--bad); }
#view .pill.ms.gov rect { stroke-width: 1.8; } #view .pill.ms.gov text { font-weight: 700; }
#view .pill.ms.good.gov rect { stroke: var(--good); } #view .pill.ms.warn.gov rect { stroke: var(--warn); } #view .pill.ms.bad.gov rect { stroke: var(--bad); }
.sh-msp { cursor: pointer; } .sh-msp:focus { outline: none; } .sh-msp:hover rect, .sh-msp.on rect { stroke-width: 2; }
#view.narrow .sh-gn, #view.narrow .sh-gu { display: none; }
.sh-note { fill: var(--text-3); }
.sh-xh { stroke: var(--sel); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.sh-xd { fill: var(--surface); stroke: var(--sel); stroke-width: 1.4; pointer-events: none; }

/* live strip */
.sh-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; }
.sh-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.sh-live em { font-style: normal; font-weight: 600; }
.sh-leg { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; }
.sh-leg > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.sh-leg i { display: inline-block; width: 16px; height: 9px; border-radius: 2px; }
.sh-hint { color: var(--text-3); margin-left: auto; }

/* editors and popovers */
.stage { position: relative; }
.sh-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); }
.sh-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.sh-edit span { font-size: 11.5px; color: var(--text-3); }
.sh-pop { position: absolute; z-index: 6; width: 200px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 22, 28, .14); padding: 6px; display: grid; gap: 2px; }
.sh-pop-h { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .03em; padding: 3px 8px 5px; }
.sh-pop-sep { border-top: 1px solid var(--line); margin: 4px 0; }
.sh-pop > button { display: flex; justify-content: space-between; align-items: baseline; border: 0; background: none; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); text-align: left; }
.sh-pop > button small { color: var(--text-3); font-size: 11px; }
.sh-pop > button:hover { background: var(--fill-1); }
.sh-pop > button.on { box-shadow: inset 0 0 0 1px var(--text); }
/* failure preview card beside a margins-table row or a margin pill (screen only) */
.sh-pv { position: fixed; z-index: 60; width: 256px; padding: 8px 8px 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 24, 30, .14); pointer-events: none; font-size: 12px; color: var(--text); }
.sh-pv[hidden] { display: none; }
.sh-pv svg { display: block; width: 240px; height: auto; margin: 4px 0 6px; }
.sh-pv .pv-h { font-weight: 600; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-pv .pv-c { color: var(--text-2); line-height: 1.35; }
.sh-pv .pv-m { margin-top: 4px; color: var(--text-3); line-height: 1.35; }
@media print { .sh-pv { display: none !important; } }
#checks td.chk .chkw { display: flex; align-items: center; gap: 9px; }
#checks td.chk .th { flex: none; }
#checks td.chk:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; border-radius: 6px; }
.sh-card { position: absolute; z-index: 30; width: 280px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 22, 28, .16); padding: 10px; pointer-events: none; }
.sh-card[hidden] { display: none; }
.sh-card svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.sh-card .pc-t { font: 500 11px var(--font); fill: var(--text-2); }
.pc-b { display: grid; gap: 2px; font-size: 12.5px; color: var(--text-2); margin-top: 8px; line-height: 1.4; }
.pc-b b { color: var(--text); font-weight: 600; font-size: 13px; }
.pc-b em { font-style: normal; font-weight: 600; }

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

/* panel */
.sh-segs .cell input { padding: 5px 7px; }
.sh-line.vs { stroke-dasharray: none; stroke-width: 1.6; }
.sh-segs th:nth-child(2), .sh-segs th:nth-child(3), .sh-segs th:nth-child(4) { text-align: right; }
.sh-add { font-size: 12.5px; color: var(--sel); padding: 4px 2px; }
.sh-adds { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.sh-item { padding: 8px 10px; margin-bottom: 8px; }
.sh-item.on { background: var(--sel-bg); border-color: var(--x-c9d6f5, #c9d6f5); }
.sh-item .load-h b { color: var(--text); }
.sh-item .load-h span { flex: 1; }
.sh-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px 8px; }
.sh-mini { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.sh-mini .num input { padding: 4px 7px; padding-right: calc(8px + var(--u, 0px)); font-size: 12.5px; }
.sh-mini .num .u { font-size: 10.5px; right: 6px; }
.sh-seg { margin: 4px 0 6px; }
.sh-flip { font-size: 12px; color: var(--sel); padding: 2px 6px; }
.sh-kv { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; color: var(--text-2); padding: 4px 0 2px; }
.sh-src { color: var(--text-3); }

/* summary, table */
.sh-say { font-size: 12.5px; color: var(--text-2); margin-top: 6px; max-width: 36ch; line-height: 1.4; }
.sh-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sh-stats .stat .v { white-space: nowrap; }
.margins td.note { white-space: normal; min-width: 280px; font-size: 12px; color: var(--text-2); }
.sh-num { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid; font-size: 10.5px; font-weight: 600; margin-right: 7px; color: var(--text-2); }
.sh-what { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fix { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.fix b { font-weight: 600; font-size: 13.5px; }
.fix p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.fix .ms { margin-left: 6px; }

/* chart */
#pos { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
#pos .drag { cursor: ew-resize; }
.ms.na { color: var(--text-3); font-style: italic; font-weight: 400; }
.ch-t { font-size: 11.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ch-a { font-size: 12px; fill: var(--text-2); }
.ch-l { font-size: 12px; font-weight: 600; }
.small-note .srcs a { text-decoration: none; color: var(--text-2); font-size: 11px; }

@media (max-width: 1200px) { .sh-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sh-stats .stat:nth-child(4) { border-left: 0; } .sh-stats .stat:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 900px) { .sh-what { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .sh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-stats .stat { border-left: 0; border-top: 1px solid var(--line); }
  .sh-stats .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .sh-stats .stat:nth-child(-n+2) { border-top: 0; }
  .margins th:nth-child(3), .margins td:nth-child(3), .margins th:nth-child(4), .margins td.note { display: none; }
  .margins td.l { white-space: normal; }
  .margins td, .margins th { padding-left: 5px; padding-right: 5px; }
  .sh-live { font-size: 12px; gap: 3px 12px; }
  .sh-hint { display: none; }
  .ex-menu { min-width: 280px; }
}


/* verdict in the stage bar: the first thing to read */
.sh-verdict { display: inline-flex; align-items: baseline; gap: 7px; margin-left: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; max-width: 46ch; min-width: 0; }
.sh-verdict:hover { border-color: var(--line-2); }
.sh-verdict .k { color: var(--text-3); }
.sh-verdict b { font-weight: 700; font-size: 14px; white-space: nowrap; }
.sh-verdict .w { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
main.sh .stage-bar .hist { margin-left: 0; }
.sh-verdict:empty { display: none; }
/* compact cards: one line each, open to edit */
details.sh-item > summary { list-style: none; cursor: pointer; margin: 0; gap: 8px; }
details.sh-item > summary::-webkit-details-marker { display: none; }
/* a row's name field and remove button sit on its title line but outside the <summary> (no control inside a control):
   laid over the row from a wrapper, the summary keeps their room */
.sh-wrap { position: relative; }
.sh-wrap > .sh-del { position: absolute; top: 5px; right: 6px; }
.sh-wrap > details.sh-item > summary { padding-right: 26px; }
.sh-wrap > .sh-name-out { position: absolute; top: 5px; left: 26px; right: 36px; width: auto; }
details.sh-item > summary .sh-nm-sp { display: block; height: 22px; }
details.sh-item > summary span { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* the summary wraps to a second line rather than end in an ellipsis ("194.3–237.5 mm · Kt 2.14 (yours)" on phones) */
details.sh-item > summary span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
details.sh-item > summary b::before { content: "▸"; display: inline-block; width: 12px; color: var(--text-3); font-size: 10px; transition: transform .15s; }
details.sh-item[open] > summary b::before { transform: rotate(90deg); }
details.sh-item[open] > summary { margin-bottom: 8px; }
details.sh-item { padding: 7px 10px; margin-bottom: 6px; }
.sh-pop.wide { width: 300px; padding: 8px 10px 10px; }
.sh-pop.wide .sh-minis { margin-top: 2px; }
.sh-pop.wide .small-note { margin-top: 6px; }
@media (max-width: 640px) { .sh-verdict { order: 5; margin-left: 0; max-width: 100%; } }

main.sh .stage { padding-left: 6px; padding-right: 6px; }
main.sh .stage .stage-bar { margin: 0 -6px; }
/* load names: renamed inline in the row title, the type and position as a grey subtitle */
details.sh-item > summary span.sh-nm { display: grid; flex: 1; min-width: 0; line-height: 1.15; white-space: normal; overflow: visible; color: var(--text); font-size: 12.5px; }
.sh-name { font: inherit; font-weight: 600; font-size: 13px; color: var(--text); border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -6px; background: transparent; width: 100%; min-width: 0; cursor: text; }
.sh-name:hover { border-color: var(--line); }
.sh-name:focus { outline: none; border-color: var(--line-2); background: var(--surface); }
.sh-nm small { font-size: 11px; color: var(--text-3); font-weight: 400; padding-left: 0; }
/* a long load name in a check label wraps instead of widening the table */
#checks td.chk { white-space: normal; overflow-wrap: anywhere; }

/* 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-8cc3a1: #94c1a5; --x-9cc9ae: #6b8e79; --x-c3c9d0: #3f4348; --x-c9d6f5: #31394d;
    --x-cfd3d8: #3e3c38; --x-d9dde2: #373532; --x-e2a33c: #f4c073; --x-e8c68a: #977d4f; --x-eba69f: #f2b8b2;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-6e7177: #85827f; --x-8cc3a1: #94c1a5; --x-9cc9ae: #6b8e79; --x-c3c9d0: #3f4348; --x-c9d6f5: #31394d;
    --x-cfd3d8: #3e3c38; --x-d9dde2: #373532; --x-e2a33c: #f4c073; --x-e8c68a: #977d4f; --x-eba69f: #f2b8b2;
  }
}
/* theme-auto:end */
