/* column buckling — on top of calc.css */
main.col .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.col .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; }

/* elevation */
.co-h { font-size: 13.5px; font-weight: 600; fill: var(--text); }
.co-sub, .co-note { font-size: 11.5px; fill: var(--text-3); }
.co-hint { font-size: 10.5px; fill: var(--text-3); }
.co-dim { font-size: 11px; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.co-ghost { fill: none; stroke: var(--x-cfd3d8, #cfd3d8); stroke-dasharray: 3 3; }
.co-col { fill: var(--steel-200); stroke: var(--steel-600); stroke-width: 1; stroke-linejoin: round; cursor: copy; }
.co-mode { fill: none; stroke: var(--sel); stroke-width: 1.6; pointer-events: none; }
.co-mode.live { stroke: var(--load); }
.co-block { fill: var(--steel-100); stroke: var(--steel-700); stroke-width: 1; }
.co-hinge { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1.2; }
.co-hatch { stroke: var(--steel-550); stroke-width: .8; }
.co-ground { stroke: var(--steel-700); stroke-width: 1.2; }
.co-link { stroke: var(--steel-700); stroke-width: 1.4; }
.co-slide { fill: none; stroke: var(--steel-550); stroke-width: 1; }
.co-endsym { cursor: pointer; }
.co-endsym:hover .co-block, .co-endsym:focus .co-block { stroke: var(--sel); }
.co-endsym:hover .co-hinge, .co-endsym:focus .co-hinge { stroke: var(--sel); }
.co-endsym:focus { outline: none; }
.co-br { cursor: ns-resize; }
.co-strut { stroke: var(--steel-700); stroke-width: 1.6; }
.co-knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.5; }
.co-br:hover .co-knob { fill: var(--sel); }
.co-load { cursor: ew-resize; }
.co-infl { fill: var(--surface); stroke: var(--sel); stroke-width: 1.5; pointer-events: none; }
.co-lc { stroke: var(--sel); stroke-width: 1.2; }
.co-lc.virt { stroke-dasharray: 4 3; }
.co-split { stroke: var(--line); }
#view .handle { cursor: grab; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob { fill: var(--sel); }

/* pills (same language as the other calculators) */
#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.sm text { font-size: 11px; }
#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.lc rect, #view .pill.rr rect { stroke: color-mix(in srgb, var(--sel) 40%, transparent); } #view .pill.lc text, #view .pill.rr 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; }

/* section */
.co-sec { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1.1; stroke-linejoin: round; }
.co-sec.hl { stroke: var(--warn); stroke-width: 1.8; }
.co-hole { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1.1; }
.co-axis { stroke: var(--sel); stroke-width: 1.3; stroke-dasharray: 8 3 2 3; }
.co-axl { font-size: 12px; font-weight: 600; fill: var(--sel); }
.co-axo { font-size: 11px; fill: var(--text-3); }
.co-rline { stroke: var(--sel); stroke-width: .9; stroke-dasharray: 3 3; }
.co-r { stroke: var(--sel); stroke-width: 1.3; }
.co-cg { fill: var(--text); }
.co-scg circle { fill: var(--surface); stroke: var(--moment); stroke-width: 1.3; }
.co-pt circle { fill: var(--surface); stroke: var(--load); stroke-width: 1.6; }
.co-pt path { stroke: var(--load); stroke-width: 1.4; }
.co-ptl { fill: var(--load); font-weight: 600; font-size: 12px; }
.co-pk { font-size: 11.5px; fill: var(--text-3); }
.co-pv { font-size: 11.5px; fill: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.co-leader { stroke: var(--steel-400); stroke-width: .8; }

/* live strip and the load slider */
.co-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; }
.co-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.co-live i { font-style: normal; color: var(--text-3); }
.co-lr { display: inline-flex; align-items: center; gap: 4px; position: relative; }
.co-lr input { width: 200px; accent-color: var(--load); }
.co-lr i { font-size: 11px; color: var(--load); white-space: nowrap; }
body.loading #loadBtn { border-color: var(--load); color: var(--load); }
#loadBtn { min-width: 86px; }

/* editors and the end chooser */
.stage { position: relative; }
.co-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); }
.co-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.co-edit span { font-size: 11.5px; color: var(--text-3); }
.co-pop { position: absolute; z-index: 6; width: 180px; 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; }
.co-pop-h { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .03em; padding: 3px 8px 5px; }
.co-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; }
.co-pop button small { color: var(--text-3); font-size: 11px; }
.co-pop button:hover:not(:disabled) { background: var(--fill-1); }
.co-pop button.on { box-shadow: inset 0 0 0 1px var(--text); }
.co-pop button:disabled { color: var(--x-b5b7bb, #b5b7bb); cursor: not-allowed; }

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

/* panel */
.co-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.co-type { display: grid; justify-items: center; gap: 1px; padding: 5px 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 11.5px; color: var(--text-2); }
.co-type:hover { border-color: var(--line-2); }
.co-type.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); color: var(--text); }
.co-ends { display: grid; gap: 4px; }
.co-end { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; 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; }
.co-end:hover { border-color: var(--line-2); }
.co-end.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.co-end b { font-weight: 500; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-braces { display: grid; gap: 4px; margin-top: 8px; }
.co-brace { display: grid; grid-template-columns: minmax(0, 1fr) 128px 26px; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.co-brace .num input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; font-size: 13px; text-align: right; outline: none; padding-right: calc(10px + var(--u, 0px)); }
.co-add { justify-self: start; font-size: 12.5px; color: var(--sel); padding: 4px 2px; }
.co-seg { margin-bottom: 6px; }
.co-seg button:disabled { opacity: .4; cursor: not-allowed; }
.co-kv { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; color: var(--text-2); padding: 4px 0 2px; }
.co-kv a { color: var(--text-3); font-size: 11px; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
.small-note a { color: var(--text-2); }

/* summary */
.co-say { font-size: 12.5px; color: var(--text-2); margin-top: 6px; max-width: 34ch; line-height: 1.4; }
.co-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.co-stats .stat .v { white-space: nowrap; }
#checks tr.adv td.l:first-child { color: var(--text-2); }
.co-tag { font-size: 10.5px; color: var(--text-3); background: var(--fill-1); border-radius: 999px; padding: 0 6px; }
.margins td.note { white-space: normal; min-width: 260px; }

/* what would change it */
.co-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; }
.fix.done { background: var(--surface-2); }

/* chart */
#curve { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
#curve .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; }
.co-legend { display: none; }

@media (max-width: 1200px) { .co-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .co-stats .stat:nth-child(4) { border-left: 0; } .co-stats .stat:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 900px) { .co-what { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .co-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-stats .stat { border-left: 0; border-top: 1px solid var(--line); }
  .co-stats .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .co-stats .stat:nth-child(-n+2) { border-top: 0; }
  .co-lr input { width: 140px; }
  .margins td.note { min-width: 200px; }
}
@media (max-width: 640px) {
  .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; }
  .co-live { font-size: 12px; gap: 3px 12px; }
}
/* phones: the drawing is stacked (elevation over section, viewBox 600 wide) and its text set to about 10.5 px on screen */
#view.narrow .co-h { font-size: 19.5px; }
#view.narrow .co-sub, #view.narrow .co-note, #view.narrow .co-dim { font-size: 18.5px; }
#view.narrow .co-hint { display: none; }
#view.narrow .co-pk, #view.narrow .co-pv { font-size: 18.5px; }
#view.narrow .co-axl { font-size: 19.5px; }
#view.narrow .co-axo, #view.narrow .co-ptl { font-size: 18.5px; }
#view.narrow .pill text, #view.narrow .pill.sm text { font-size: 18.5px; }
.co-rl { font-size: 12px; font-weight: 600; fill: var(--sel); }
#view.narrow .co-rl { font-size: 19.5px; }
.small-note .srcs a, .co-kv .srcs a { text-decoration: none; color: var(--text-2); font-size: 11px; }
/* reserve the summary's height so the cards below do not jump when the page script fills it */
@media (min-width: 1041px) { main.col #summary { min-height: 160px; } }
@media (max-width: 1040px) { main.col #summary { min-height: 340px; } }
.co-libnote { margin: 0 0 8px; }

/* 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-b5b7bb: #504e4a; --x-cfd3d8: #3e3c38;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-6e7177: #85827f; --x-b5b7bb: #504e4a; --x-cfd3d8: #3e3c38;
  }
}
/* theme-auto:end */
