/* beam — on top of calc.css */
main.bm .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.bm .stage-bar .hist { margin-left: auto; }
.tabs.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#view { display: block; width: 100%; height: auto; flex: none; user-select: none; touch-action: pan-y; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .hit { fill: transparent; stroke: none; }
.stage { position: relative; }

/* chips for the diagrams shown */
.bm-chips { display: inline-flex; gap: 2px; background: var(--fill-1); border-radius: 8px; padding: 2px; }
.bm-chips button { border: 0; background: none; padding: 4px 9px; border-radius: 6px; cursor: pointer; color: var(--text-3); font-size: 12.5px; font-weight: 500; min-width: 30px; }
.bm-chips button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* drawing */
.bm-beam { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1; }
.bm-block { fill: var(--steel-100); stroke: var(--steel-700); stroke-width: 1; }
.bm-hinge { fill: var(--surface); stroke: var(--ink); stroke-width: 1.3; }
.bm-hatch { stroke: var(--steel-550); stroke-width: .8; }
.bm-ground { stroke: var(--steel-700); stroke-width: 1.2; }
.bm-spring { fill: none; stroke: var(--steel-700); stroke-width: 1.2; stroke-linejoin: round; }
.bm-sup { cursor: ew-resize; }
.bm-sup:hover .bm-block, .bm-sup:focus .bm-block, .bm-sup.sel .bm-block { stroke: var(--sel); }
.bm-sup:focus { outline: none; }
.bm-load { cursor: ew-resize; }
.bm-load:focus { outline: none; }
.bm-arrow { stroke: var(--load); stroke-width: 1.8; fill: none; }
/* the arrow shaft never takes the pointer: a press on it lands on the load's hit strip and drags the load */
#view .bm-load .bm-arrow { pointer-events: none; }
.bm-arrow.thin { stroke-width: 1.1; }
.bm-arrow.dash { stroke-dasharray: 2 2; }
.bm-band { fill: color-mix(in srgb, var(--load) 7%, transparent); stroke: none; }
.bm-bandtop { stroke: var(--load); stroke-width: 1.4; fill: none; }
.bm-load:hover .bm-arrow, .bm-load.sel .bm-arrow { stroke: var(--rust); }
.bm-load.sel .bm-band, .bm-load:hover .bm-band { fill: color-mix(in srgb, var(--load) 13%, transparent); }
.bm-sw .bm-band { fill: color-mix(in srgb, var(--steel-700) 7%, transparent); }
.bm-sw .bm-bandtop, .bm-sw .bm-arrow { stroke: var(--steel-550); }
.bm-mv .bm-arrow { stroke: var(--purple); }
.bm-wheel { fill: var(--surface); stroke: var(--purple); stroke-width: 1.4; }
.bm-react { stroke: var(--text-2); stroke-width: 1.8; fill: none; }
.bm-defl { fill: none; stroke: var(--sel); stroke-width: 1.7; stroke-linejoin: round; pointer-events: none; }
.bm-dim { stroke: var(--text-4); stroke-width: .8; fill: none; }
.bm-guide { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.bm-zero { stroke: var(--x-a9adb3, #a9adb3); stroke-width: .9; }
.bm-band-sep { stroke: var(--line); }
.bm-note { font-size: 11px; fill: var(--text-3); }
.bm-sym { font-size: 14px; font-weight: 600; fill: var(--text); }
.bm-unit { font-size: 10.5px; fill: var(--text-3); }
.bm-ext { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bm-env { opacity: .55; }
.bm-envl { font-size: 10.5px; fill: var(--text-3); }
.bm-msg { font-size: 13px; fill: var(--bad); font-weight: 500; }
#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 .bm-wk { fill: var(--surface); stroke: var(--load); stroke-width: 1.5; cursor: ns-resize; }
#view .bm-wk:hover { fill: var(--load); }
#view .bm-end { cursor: ew-resize; }
.bm-segline { stroke: var(--warn); stroke-width: 3; stroke-linecap: round; opacity: .55; pointer-events: none; }
.bm-focus { fill: none; stroke: var(--warn); stroke-width: 1.6; pointer-events: none; }
.bm-brace { stroke: var(--steel-700); stroke-width: 1.3; }
.bm-brl { font-size: 11px; fill: var(--text-2); pointer-events: none; }
.bm-br { cursor: ew-resize; }
.bm-br:focus { outline: none; }
.bm-bracex { fill: var(--surface); stroke: var(--steel-600); stroke-width: 1.2; }

/* pills */
#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.load rect { stroke: color-mix(in srgb, var(--load) 40%, transparent); } #view .pill.load text { fill: var(--rust); font-weight: 600; }
#view .pill.mv rect { stroke: color-mix(in srgb, var(--purple) 45%, transparent); } #view .pill.mv text { fill: var(--x-6b3fa8, #6b3fa8); font-weight: 600; }
#view .pill.react rect { stroke: var(--x-cfd3d8, #cfd3d8); } #view .pill.react text { fill: var(--text-2); font-weight: 600; }
#view .pill.defl rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.defl text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.dimv rect { stroke: var(--steel-200); }
#view .pill.insp rect { fill: var(--sel); stroke: var(--sel); } #view .pill.insp text { fill: var(--on-accent); font-weight: 600; }
#view .pill.val rect { stroke: color-mix(in srgb, var(--sel) 35%, transparent); } #view .pill.val text { fill: var(--text); }
#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; }
#view .insp-line { stroke: var(--sel); stroke-width: 1.2; }
#view .hov-line { stroke: var(--steel-500); stroke-width: 1; stroke-dasharray: 2 2; pointer-events: none; }
#view .hov text { font-size: 11px; font-weight: 500; fill: var(--text); font-variant-numeric: tabular-nums; }
#view .hov rect { fill: color-mix(in srgb, var(--surface) 92%, transparent); stroke: var(--steel-300); }
#view .insp-k { cursor: ew-resize; }
#view .insp-k circle { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }

/* live strip */
.bm-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; }
.bm-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.bm-live .bm-tip { color: var(--text-3); }
.bm-live select { border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 12.5px; background: var(--surface); }
.bm-toast { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 9; background: var(--ink); color: var(--on-accent); font-size: 12.5px; padding: 6px 12px; border-radius: 8px; pointer-events: none; transition: opacity .3s; }

/* editors and popovers */
.bm-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); }
.bm-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.bm-edit span { font-size: 11.5px; color: var(--text-3); }
.bm-pop { position: absolute; z-index: 6; width: 240px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 22, 28, .14); padding: 8px; display: grid; gap: 6px; font-size: 12.5px; }
.bm-pop-h { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .03em; padding: 0 2px; display: flex; justify-content: space-between; }
.bm-pop .seg { width: 100%; }
.bm-pop .seg button { padding: 4px 6px; font-size: 12px; }
.bm-pop .seg button:disabled { opacity: .35; cursor: not-allowed; }
.bm-pop .row { display: grid; grid-template-columns: minmax(0, 1fr) 118px; align-items: center; gap: 8px; color: var(--text-2); }
.bm-pop .row .num input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: 12.5px; text-align: right; outline: none; padding-right: calc(10px + var(--u, 0px)); }
.bm-pop .row select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font-size: 12.5px; background: var(--surface); }
.bm-pop .del { justify-self: start; color: var(--bad); font-size: 12.5px; padding: 3px 2px; border: 0; background: none; cursor: pointer; }
.bm-pop .why { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }

/* examples / add menus */
.ex-wrap { position: relative; }
.ex-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 8; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 22, 28, .12); padding: 6px; display: grid; gap: 2px; min-width: 300px; }
.ex-menu[hidden] { display: none; }
.ex-menu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); display: grid; gap: 1px; }
.ex-menu button small { color: var(--text-3); font-size: 11.5px; }
.ex-menu button:hover, .ex-menu button:focus { background: var(--fill-1); outline: none; }
.ex-menu.bm-add { min-width: 220px; }
.ex-menu.bm-add button { grid-template-columns: 28px minmax(0, 1fr); align-items: center; column-gap: 8px; }
.ex-menu.bm-add button svg { grid-row: span 2; }

/* panel */
.bm-list { display: grid; gap: 6px; }
.bm-item { border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px 4px; display: grid; gap: 2px; }
.bm-item.sel { border-color: var(--sel); box-shadow: inset 0 0 0 1px var(--sel); }
.bm-item-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text); }
.bm-item-h svg { flex: none; }
.bm-item-h .bm-grow { flex: 1; }
.bm-item-h select { border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px; font-size: 12px; background: var(--surface); }
.bm-item .f { margin: 0; }
.bm-add-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.bm-add-row button { font-size: 12px; color: var(--sel); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.bm-add-row button:hover { border-color: var(--sel); }
.bm-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.bm-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); }
.bm-type:hover { border-color: var(--line-2); }
.bm-type.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); color: var(--text); }
.bm-seg { margin-bottom: 6px; }
.bm-seg button:disabled { opacity: .4; cursor: not-allowed; }
.bm-kv { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; color: var(--text-2); padding: 4px 0 2px; }
.bm-kv a { color: var(--text-3); font-size: 11px; }
.bm-combos { width: 100%; border-collapse: collapse; font-size: 12px; }
.bm-combos td { padding: 3px 4px; border-top: 1px solid var(--line); color: var(--text-2); }
.bm-combos tr.gov td { color: var(--text); font-weight: 600; }
.bm-combos td:last-child { text-align: right; white-space: nowrap; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
.small-note a { color: var(--text-2); }
.small-note .srcs a, .bm-kv .srcs a { text-decoration: none; color: var(--text-2); font-size: 11px; }

/* summary */
.bm-say { font-size: 12.5px; color: var(--text-2); margin-top: 6px; max-width: 36ch; line-height: 1.4; }
.bm-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bm-stats .stat .v { white-space: nowrap; }
.bm-stats .stat .s { overflow-wrap: anywhere; }
#checks tr.adv td.l:first-child { color: var(--text-2); }
.bm-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 */
.bm-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); }

/* charts */
#lenChart, #ltbChart { display: block; width: 100%; touch-action: pan-y; user-select: none; }
#lenChart .drag, #ltbChart .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; }

@media (max-width: 1200px) { .bm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bm-stats .stat:nth-child(4) { border-left: 0; } .bm-stats .stat:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 900px) { .bm-what { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .bm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bm-stats .stat { border-left: 0 !important; border-top: 1px solid var(--line); }
  .bm-stats .stat:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .bm-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; }
  .bm-live { font-size: 12px; gap: 3px 12px; }
  .bm-chips button { padding: 4px 7px; min-width: 26px; }
}
/* the stage card's outline as a shadow, so the stage reads as a card and not as a padded chip */
main.bm .card.stage { border: 0; box-shadow: 0 0 0 1px var(--line); }

/* legend for the symbols in use, under the drawing */
.bm-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 6px 14px 8px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--line); }
.bm-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bm-legend svg { flex: none; }
.bm-verdict { cursor: pointer; }
.bm-verdict:focus { outline: none; }

/* margins table: an icon per failure mode, and the preview card (screen only) */
#checks td.chk { display: flex; align-items: center; gap: 8px; }
#checks td.chk .th { flex: none; width: 46px; height: 46px; margin: -8px 0; }
#checks td.chk:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; border-radius: 6px; }
.bm-pv { position: fixed; z-index: 60; width: 258px; 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); }
.bm-pv[hidden] { display: none; }
.bm-pv svg { display: block; width: 240px; height: auto; margin: 4px 0 6px; }
.bm-pv .pv-h { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-pv .pv-c { color: var(--text-2); line-height: 1.35; }
.bm-pv .pv-m { margin-top: 4px; color: var(--text-3); }
@media print { .bm-pv { display: none !important; } }
@media (max-width: 640px) {
  #checks td.chk { gap: 6px; }
  #checks td.chk .th { width: 28px; height: 28px; margin: -4px 0; }
  #checks td, #checks th { font-size: 12px; }
  #checks th:nth-child(3), #checks td:nth-child(3) { display: none; }
}
.bm-copy { font-size: 12px; color: var(--sel); padding: 2px 8px; margin-left: 6px; }
.bm-reacts td, .bm-reacts th { white-space: nowrap; }
/* load and case names: the card title is the name, editable in place; the type sits under it in grey */
.bm-nm { display: grid; min-width: 64px; line-height: 1.15; }
.bm-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; }
.bm-name:hover { border-color: var(--line); }
.bm-name:focus { outline: none; border-color: var(--line-2); background: var(--surface); }
.bm-nm small { font-size: 11px; color: var(--text-3); font-weight: 400; }
.bm-name-pop, .bm-cname { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: 12.5px; outline: none; }
.bm-cname { text-align: left; }
.bm-name-pop:focus, .bm-cname:focus { border-color: var(--line-2); }
.num input.bm-cname, .num input.bm-name-pop { text-align: left; padding-right: 8px; }
.bm-by { margin-top: 10px; }
/* Examples menu: a drawn thumbnail of each preset beside its title and spec line */
#exMenu { min-width: 420px; }
#exMenu .bm-exi { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; column-gap: 12px; padding: 6px 10px 6px 6px; }
#exMenu .bm-th { width: 96px; height: 64px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); display: block; overflow: hidden; }
#exMenu .bm-thumb { display: block; }
#exMenu .bm-ext2 { display: grid; gap: 1px; }
@media (max-width: 640px) {
  #exMenu { min-width: 0; width: calc(100vw - 48px); grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
  #exMenu[hidden] { display: none; }
  #exMenu .bm-exi { grid-template-columns: minmax(0, 1fr); justify-items: start; row-gap: 4px; padding: 6px; }
  #exMenu .bm-th { width: 100%; height: auto; aspect-ratio: 3 / 2; }
  #exMenu .bm-thumb { width: 100%; height: auto; }
  #exMenu .bm-ext2 small { display: none; }
}

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