/* tolerance stack-up — on top of calc.css */
main.su .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.su .stage-bar .hist { margin-left: auto; }
/* the stage card, named su-hero: the QA padding audit reads any class containing "tag" (as in "stage") as a tag pill */
.su-hero { display: flex; flex-direction: column; min-width: 0; position: relative; overflow: visible; }
#view { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .hit { fill: transparent; stroke: none; }
#view text { font-variant-numeric: tabular-nums; }
#view [data-edit], #view [data-gap] { cursor: pointer; }
#view [data-edit]:hover rect.pr, #view [data-gap]:hover rect.pr { stroke: var(--sel); }
#view [data-edit]:focus, #view [data-gap]:focus, #view [data-flip]:focus { outline: none; }
#view [data-edit]:focus-visible rect.pr, #view [data-gap]:focus-visible rect.pr { stroke: var(--sel); stroke-width: 1.6; }
#view [data-flip] { cursor: pointer; }
#view [data-flip]:hover circle { stroke: var(--sel); }
#view [data-grip] { cursor: grab; }
#view [data-grip]:hover circle { fill: var(--text-2); }
#view .band { cursor: ew-resize; }
#view .band:hover .knob, #view .band.on .knob { fill: var(--sel); }
#view .spec { cursor: ew-resize; }
#view .spec:hover line.sl { stroke-width: 2; }
#view .rowsel { fill: var(--sel-bg); }
.su-mseg button { padding: 4px 8px; }

/* live strip under the drawing */
.su-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; }
.su-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.su-live .ref { color: var(--sel); }
.su-live .bad { color: var(--bad); font-weight: 600; }
.su-live .good { color: var(--good); font-weight: 600; }

/* examples menu (same as the column tool) */
.ex-wrap { position: relative; }

/* popover editor on the drawing */
.su-pop { position: absolute; z-index: 7; width: 330px; max-width: calc(100% - 16px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 36px rgba(20, 22, 28, .16); padding: 10px 12px 12px; }
.su-pop-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.su-pop-h b { font-size: 12px; font-weight: 600; color: var(--text-3); }

/* editor fields (popover and the Chain tab) */
.su-ed { display: grid; gap: 6px; }
.su-ed .f { padding: 1px 0; grid-template-columns: minmax(0, 1fr) 150px; }
.su-ed .f > label { grid-template-columns: minmax(0, 1fr); }
.su-ed input.txt { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 13px; outline: none; }
.su-ed input.txt:focus { border-color: var(--text-2); }
.su-ed .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.su-ed .pair .num input { text-align: right; }
.su-ed .pair label { font-size: 11px; color: var(--text-3); display: block; margin-bottom: 2px; }
.su-ed .seg { width: 100%; }
.su-ed .lab { font-size: 12px; color: var(--text-3); margin: 2px 0 -2px; }
.su-ed .iso-note { font-size: 11.5px; color: var(--text-3); }
.su-ed .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.su-ed .acts .btn.del { color: var(--bad); }
.su-ed .acts .btn.del:hover { border-color: var(--bad); }
.su-ed .help { font-size: 11.5px; color: var(--text-3); line-height: 1.4; margin: 0; }
.su-ed input.bad { border-color: var(--bad); color: var(--bad); }

/* the Chain tab list */
.su-tabs { grid-template-columns: repeat(3, 1fr); }
.su-list { display: grid; gap: 2px; }
.su-li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; font-size: 13px; text-align: left; background: none; width: 100%; color: var(--text); }
.su-li:hover { background: var(--surface-2); }
.su-li.on { background: var(--sel-bg); border-color: var(--sel-line); }
.su-li .sg { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); }
.su-li .nm { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.su-li .v { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.su-li.gap .sg { border-color: var(--load); color: var(--load); }
.su-edwrap { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.su-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.su-chips .chip.on { border-color: var(--text-2); color: var(--text); background: var(--surface); font-weight: 500; }
.su-lim { display: grid; grid-template-columns: 20px minmax(0, 1fr) 150px; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; color: var(--text-2); }
.su-lim input[type=checkbox] { accent-color: var(--text); width: 15px; height: 15px; margin: 0; }
.su-lim .num input:disabled { background: var(--bg-2, #f6f6f4); color: var(--text-3); cursor: default; }
.su-lim .num input:disabled::placeholder { color: var(--text-3); opacity: 1; }
.su-lim .num:has(input:disabled) .u { visibility: hidden; }

/* summary */
.su-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.su-stats .stat .v { white-space: nowrap; }
.su-say { font-size: 12.5px; color: var(--text-2); margin-top: 6px; max-width: 38ch; line-height: 1.4; }
main.su .verdict .v small { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 4px; }

/* results and contributions */
.su-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.su-res td small { color: var(--text-3); font-size: 11.5px; }
.su-res .ms { min-width: 54px; }
.su-res tr.sel td.l { color: var(--text); }
.su-contrib { display: grid; gap: 7px; }
.su-cb { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 3.4rem; gap: 10px; align-items: center; font-size: 13px; cursor: pointer; border-radius: 6px; padding: 1px 0; }
.su-cb:hover .nm { color: var(--sel); }
.su-cb .nm { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; color: var(--text); }
.su-cb .nm small { display: block; font-size: 11px; color: var(--text-3); }
.su-cb .tr { position: relative; height: 14px; background: var(--fill-1); border-radius: 4px; overflow: hidden; }
.su-cb .tr i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--x-7d93b8, #7d93b8); border-radius: 4px; transition: width .2s ease-out; }
.su-cb.top .tr i { background: var(--sel); }
.su-cb .tr u { position: absolute; top: 2px; bottom: 2px; width: 2px; background: var(--text-2); opacity: .45; text-decoration: none; }
.su-cb .p { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.su-cnote { font-size: 12px; color: var(--text-3); margin: 8px 0 0; }
.su-cnote u { display: inline-block; width: 2px; height: 10px; background: var(--text-2); opacity: .45; vertical-align: -1px; margin: 0 3px; }

/* what would change it */
.su-what { display: grid; grid-template-columns: repeat(3, 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; }
.fix.done { background: var(--surface-2); }
.fix select { width: auto; max-width: 100%; padding: 2px 6px; font-size: 12.5px; margin-top: 4px; }

.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; }
.step .where { font-size: 12px; color: var(--text-3); margin: 6px 0 0; line-height: 1.6; }

@media (max-width: 1200px) { .su-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .su-stats .stat:nth-child(4) { border-left: 0; } .su-stats .stat:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 1100px) { .su-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .su-what { grid-template-columns: minmax(0, 1fr); } .su-mseg { display: none; } }
@media (max-width: 640px) {
  .su-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .su-stats .stat { border-left: 0; border-top: 1px solid var(--line); }
  .su-stats .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .su-stats .stat:nth-child(-n+2) { border-top: 0; }
  .su-res th:nth-child(4), .su-res td:nth-child(4), .su-res th:nth-child(5), .su-res td:nth-child(5) { display: none; }
  .su-res td, .su-res th { padding-left: 4px; padding-right: 4px; }
  .su-res td small { display: none; }
  .su-res .ms { min-width: 44px; padding: 2px 6px; }
  .su-res th .mui-n .th { display: none; }
  .su-res th.mui-h { white-space: normal; }
  table.su-res { font-size: 12px; }
  .su-cb { grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) 3rem; gap: 8px; }
  .su-live { font-size: 12px; gap: 3px 12px; }
  .su-ed .f { grid-template-columns: minmax(0, 1fr) 140px; }
}
@media (min-width: 1041px) { main.su #summary { min-height: 150px; } }

/* 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-3b8bb0: #7fbddd; --x-6d4fb3: #ab96ed; --x-6e7177: #85827f; --x-7d93b8: #7c8ead; --x-c9d3e3: #363d47;
    --x-e3e8f1: #2c2f34; --x-e59a90: #f8b8af;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-3b8bb0: #7fbddd; --x-6d4fb3: #ab96ed; --x-6e7177: #85827f; --x-7d93b8: #7c8ead; --x-c9d3e3: #363d47;
    --x-e3e8f1: #2c2f34; --x-e59a90: #f8b8af;
  }
}
/* theme-auto:end */
