/* springs — on top of calc.css */
main.spr .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.spr .stage-bar .hist { margin-left: auto; }
#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 .hit { fill: transparent; stroke: none; }

/* drawing */
#view .spg-h { font-size: 13.5px; font-weight: 600; fill: var(--text); }
#view .spg-h2 { font-size: 12.5px; font-weight: 600; fill: var(--text-2); }
#view .spg-sub { font-size: 11.5px; fill: var(--text-3); }
#view .spg-sub.bad { fill: var(--bad); font-weight: 600; }
#view .spg-lbl { font-size: 12px; font-weight: 600; fill: var(--text); }
#view .spg-dim2 { font-weight: 400; fill: var(--text-3); }
#view .spg-tiny { font-size: 10.5px; fill: var(--text-3); }
#view .spg-mkl { font-size: 11px; font-weight: 500; }
#view .spg-block { fill: var(--steel-100); stroke: var(--steel-700); stroke-width: 1; }
#view .spg-hatch { stroke: var(--steel-550); stroke-width: .8; }
#view .spg-w-o { fill: none; stroke: var(--steel-750); stroke-linecap: round; stroke-linejoin: round; }
#view .spg-w-f { fill: none; stroke: var(--x-cdd3d9, #cdd3d9); stroke-linecap: round; stroke-linejoin: round; }
#view .spg-w-s { fill: none; stroke: var(--steel-750); stroke-width: .9; stroke-linejoin: round; stroke-linecap: round; }
#view .spg-plane { stroke: var(--steel-750); stroke-width: .8; }
#view .spg-w-b { fill: none; stroke: var(--x-a7afb8, #a7afb8); stroke-linecap: round; stroke-linejoin: round; }
#view .spg-w-thin { fill: none; stroke: var(--steel-750); stroke-linecap: round; stroke-linejoin: round; }
#view .spg-cut { fill: url(#spHatch); stroke: var(--ink); stroke-width: 1; }
#view .spg-ghost { stroke: var(--steel-500); stroke-width: 1; stroke-dasharray: 4 3; fill: none; }
#view .spg-ext { stroke: var(--steel-400); stroke-width: .7; }
#view .spg-leader { fill: none; stroke: var(--steel-400); stroke-width: .8; }
#view .spg-plate { cursor: ns-resize; }
#view .spg-plate:hover .spg-block { stroke: var(--sel); }
#view .spg-mk-solid { stroke: var(--bad); stroke-width: 1.1; stroke-dasharray: 5 3; fill: var(--bad); }
#view .spg-mk-sa { stroke: var(--amber); stroke-width: 1; stroke-dasharray: 2 3; fill: var(--x-9a6a12, #9a6a12); }
#view .spg-mk-buck { stroke: var(--warn); stroke-width: 1.1; stroke-dasharray: 7 3; fill: var(--warn); }
#view .spg-mk-1 { stroke: var(--sel); stroke-width: 1.1; stroke-dasharray: 3 3; }
#view text.spg-mk-solid, #view text.spg-mk-sa, #view text.spg-mk-buck { stroke: none; }
#view .spg-bar-bg { fill: var(--fill-1); }
#view .spg-bar { transition: width .08s linear; }
#view .spg-bar-lim { stroke: var(--text); stroke-width: 1.4; }
#view .spg-bar-mk { stroke: var(--halo); stroke-width: 1.5; }
#view .spg-ring { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1.1; }
#view .spg-house { stroke: none; opacity: .55; }
#view .spg-bore { fill: none; stroke: var(--steel-700); stroke-width: 1.2; }
#view .spg-rod { stroke: var(--steel-700); stroke-width: 1.1; }
#view .spg-grow { fill: none; stroke: var(--steel-500); stroke-width: 1; stroke-dasharray: 3 3; }
#view .spg-pin { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1.4; }
#view .spg-rodl { stroke: var(--steel-700); stroke-width: 2.2; }
#view .spg-pt { fill: none; stroke: var(--text-3); stroke-width: 1.2; }
#view .spg-pt.hot { stroke: var(--bad); stroke-width: 2; }
#view .spg-ptl { font-size: 12px; font-weight: 600; fill: var(--text-2); }
#view .spg-leg { stroke: var(--steel-750); stroke-linecap: round; }
#view .spg-leg-ghost { stroke: var(--steel-500); stroke-linecap: round; stroke-dasharray: 4 3; opacity: .6; }
#view .spg-ring-t { fill: none; stroke: var(--x-b9c0c7, #b9c0c7); }
#view .spg-ring-e { fill: none; stroke: var(--steel-750); stroke-width: 1; }
#view .spg-arc { fill: none; stroke: var(--sel); stroke-width: 1.2; }
#view .spg-spring.hot .spg-w-o { stroke: var(--bad); }
#view .handle { cursor: grab; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob { fill: var(--sel); }
#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.load rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); }
#view .pill.load text { fill: var(--load); font-weight: 600; }
#view .pill.mk-1 rect { stroke: color-mix(in srgb, var(--sel) 40%, transparent); }
#view .pill.mk-1 text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#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; }
/* phones: text in user units scaled so it renders about 10.5 px on screen (the JS scales positions the same way) */
#view.narrow .spg-h { font-size: 21px; }
#view.narrow .spg-h2 { font-size: 19.5px; }
#view.narrow .spg-sub, #view.narrow .spg-mkl, #view.narrow .spg-ptl { font-size: 18.5px; }
#view.narrow .spg-lbl { font-size: 19.5px; }
#view.narrow .spg-tiny { font-size: 17px; }
#view.narrow .pill text { font-size: 18.6px; }

/* live strip */
.spg-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; }
.spg-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.spg-live i { font-style: normal; color: var(--text-3); }
.stage { position: relative; }
.spg-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); }
.spg-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.spg-edit span { font-size: 11.5px; color: var(--text-3); }

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

/* panel */
.spg-opts { display: grid; gap: 4px; }
.spg-opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spg-opt { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 3px 10px 3px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 12.5px; color: var(--text); text-align: left; }
.spg-opts.two .spg-opt { grid-template-columns: 28px minmax(0, 1fr); }
.spg-opt:hover { border-color: var(--line-2); }
.spg-opt.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.spg-opt b { font-weight: 500; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.spg-seats { display: grid; gap: 4px; margin-bottom: 4px; }
.spg-seg { margin-bottom: 6px; }
.spg-kv { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; color: var(--text-2); padding: 4px 0 2px; }
.spg-tag { font-style: normal; font-size: 10.5px; color: var(--text-3); background: var(--fill-1); border-radius: 999px; padding: 0 6px; }
.spg-tag.warn { color: var(--warn); background: var(--warn-bg); }
.spg-rm { display: block; width: 100%; height: auto; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
.small-note .srcs a { text-decoration: none; color: var(--text-2); font-size: 11px; }
.small-note .srcs + .srcs::before { content: "· "; color: var(--text-3); }

/* summary */
.spg-say { font-size: 12.5px; color: var(--text-2); margin-top: 6px; max-width: 36ch; line-height: 1.4; }
.spg-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.spg-stats .stat .v { white-space: nowrap; }

/* margins */
#checks td.chk { cursor: default; }
#checks td.chk.pv { cursor: help; }
#checks tr.adv td.l:first-child .nm { color: var(--text-2); }
.margins td.note { white-space: normal; min-width: 260px; color: var(--text-2); font-size: 12px; }
/* the failure drawings inside the shared preview card (margins-ui.js) */
.mui-pv .pv-wf { fill: none; stroke: var(--steel-750); stroke-linecap: round; }
.mui-pv .pv-wb { fill: none; stroke: var(--x-b9c0c7, #b9c0c7); stroke-linecap: round; }
.mui-pv .pv-wall { fill: var(--steel-250); stroke: var(--steel-700); }
.mui-pv .pv-t { font-size: 10.5px; font-weight: 600; fill: var(--text-2); }

/* design from forces */
.spg-dz { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin-bottom: 12px; }
.spg-dzf { display: grid; gap: 3px; font-size: 12.5px; color: var(--text-2); }
.spg-dzf small { color: var(--text-3); font-size: 11.5px; }
.spg-dzf .num input { width: 100%; }
.spg-dznote { grid-column: 1 / -1; margin: 0; }
.spg-dt td, .spg-dt th { white-space: nowrap; }
.spg-dt tbody tr { cursor: default; }

/* charts */
.spg-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#fd, #gd { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
#fd .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; }
.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: 1200px) { .spg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .spg-stats .stat:nth-child(4) { border-left: 0; } .spg-stats .stat:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 900px) { .spg-charts { grid-template-columns: minmax(0, 1fr); } .spg-dz { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* phones: the check table fits its card without scrolling sideways (check, actual, allowable and margin side by side) */
@media (max-width: 420px) { #checks td, #checks th { padding-left: 4px; padding-right: 4px; } }
@media (max-width: 640px) {
  .spg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spg-stats .stat { border-left: 0; border-top: 1px solid var(--line); }
  .spg-stats .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .spg-stats .stat:nth-child(-n+2) { border-top: 0; }
  .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; }
  .spg-live { font-size: 12px; gap: 3px 12px; }
  .spg-dt th:nth-child(5), .spg-dt td:nth-child(5) { display: none; }
}
.gl { stroke: var(--fill-1); }
.spr .stage { border: 0; box-shadow: inset 0 0 0 1px var(--line); }
#view .spg-axis { stroke: var(--steel-550); stroke-width: 1; fill: none; }
#view .spg-mcl { font-size: 11px; font-weight: 600; fill: var(--text); }
#view .spg-mcl.b { fill: var(--x-1e4fbf, #1e4fbf); }
#view .spg-mct { font-size: 10.5px; fill: var(--text-3); }
#view.narrow .spg-mcl { font-size: 18px; }
#view.narrow .spg-mct { font-size: 17px; }
#view .spg-ghost-plate { fill: color-mix(in srgb, var(--steel-100) 50%, transparent); stroke: var(--steel-500); stroke-width: 1; stroke-dasharray: 4 3; }
#view .spg-plate0 { cursor: ns-resize; }
#view .spg-plate0:hover .spg-ghost-plate { stroke: var(--sel); }
/* 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; }

/* until app.js draws it, the drawing holds its usual size, so nothing under it jumps on load (layout shift) */
#view:empty { aspect-ratio: 1000 / 600; }
@media (max-width: 560px) { #view:empty { aspect-ratio: 380 / 941; } }

/* 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-6e7177: #85827f; --x-9a6a12: #d0a66a; --x-a7afb8: #4f555c; --x-b9c0c7: #44494e;
    --x-cdd3d9: #393d41;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-6e7177: #85827f; --x-9a6a12: #d0a66a; --x-a7afb8: #4f555c; --x-b9c0c7: #44494e;
    --x-cdd3d9: #393d41;
  }
}
/* theme-auto:end */
