/* natural frequency — on top of calc.css */
main.nf .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.nf .stage-bar .hist { margin-left: auto; }
.tabs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#view { display: block; width: 100%; height: auto; flex: none; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .hit { fill: transparent; stroke: none; }
.stage { position: relative; }
main.nf .card.stage { overflow: visible; }
#sysBtn { display: inline-flex; align-items: center; gap: 6px; padding-left: 6px; }
#sysBtn svg { width: 26px; height: 20px; }

/* mode chips */
.nf-chips { display: inline-flex; gap: 2px; background: var(--fill-1); border-radius: 8px; padding: 2px; flex-wrap: wrap; }
.nf-chips button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--text-3); font-size: 12.5px; font-weight: 500; display: inline-flex; gap: 6px; align-items: baseline; font-variant-numeric: tabular-nums; }
.nf-chips button b { font-weight: 600; color: var(--text-2); }
.nf-chips button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.nf-chips button[aria-pressed="true"] b { color: var(--sel); }

/* drawing */
.nf-title { font-weight: 600; fill: var(--text); }
.nf-title2 { font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.nf-axis { stroke: var(--steel-350); stroke-width: 1; stroke-dasharray: 3 3; fill: none; pointer-events: none; }
.nf-ghost { fill: none; stroke: var(--x-9db6ee, #9db6ee); stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.nf-beamline { fill: none; stroke: var(--x-cfd5dc, #cfd5dc); stroke-width: 8; stroke-linejoin: round; stroke-linecap: butt; pointer-events: none; }
.nf-beamcore { fill: none; stroke: var(--sel); stroke-width: 1.8; stroke-linejoin: round; pointer-events: none; }
.nf-node { fill: var(--surface); stroke: var(--sel); stroke-width: 1.4; pointer-events: none; }
.nf-block { fill: var(--steel-100); stroke: var(--steel-700); stroke-width: 1; }
.nf-hinge { fill: var(--surface); stroke: var(--ink); stroke-width: 1.3; }
.nf-hatch { stroke: var(--steel-550); stroke-width: .8; }
.nf-ground { stroke: var(--steel-700); stroke-width: 1.2; }
.nf-mass { fill: var(--steel-250); stroke: var(--x-4b5563, #4b5563); stroke-width: 1.1; }
.nf-massedge { fill: none; stroke: var(--x-4b5563, #4b5563); stroke-width: .8; }
.nf-massg { cursor: ew-resize; }
.nf-massg:focus { outline: none; }
.nf-massg:hover .nf-mass, .nf-massg.sel .nf-mass, .nf-massg:focus .nf-mass { stroke: var(--sel); }
.nf-sup { cursor: ew-resize; }
.nf-sup.nf-end { cursor: pointer; }
.nf-sup.locked { cursor: default; }
.nf-sup:focus { outline: none; }
.nf-sup:hover .nf-block, .nf-sup:focus .nf-block, .nf-sup.sel .nf-block { stroke: var(--sel); }
.nf-sup.nf-end:hover .hit, .nf-sup.nf-end:focus .hit { fill: color-mix(in srgb, var(--sel) 6%, transparent); }
.nf-arrow { stroke: var(--load); stroke-width: 1.8; fill: none; }
.nf-dim { stroke: var(--text-4); stroke-width: .8; fill: none; }
.nf-spring { fill: none; stroke: var(--x-4b5563, #4b5563); stroke-width: 1.3; stroke-linejoin: round; }
.nf-note { font-size: 11px; fill: var(--text-3); }
.nf-sym { font-weight: 600; fill: var(--text); }
.nf-msg { font-size: 13px; fill: var(--bad); font-weight: 500; }
.nf-quad { stroke: var(--halo); stroke-width: .35; pointer-events: none; }
.nf-rest { fill: none; stroke: var(--steel-350); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.nf-leader { stroke: var(--steel-500); stroke-width: .8; stroke-dasharray: 2 2; fill: none; pointer-events: none; }
.nf-nodal { fill: none; stroke: var(--x-1e3a8a, #1e3a8a); stroke-width: 1.4; stroke-dasharray: 5 3; pointer-events: none; }
.nf-edge { cursor: pointer; }
.nf-edge:focus { outline: none; }
.nf-edgehit { stroke: transparent; stroke-width: 16; fill: none; }
#view .nf-edgehit.hit { stroke: transparent; fill: none; }
.nf-edge:hover .nf-edgehit, .nf-edge:focus .nf-edgehit { stroke: color-mix(in srgb, var(--sel) 12%, transparent); }
.nf-edge-C { stroke: var(--steel-700); stroke-width: 2.2; fill: none; }
.nf-edge-S { stroke: var(--steel-700); stroke-width: 1.4; stroke-dasharray: 6 2; fill: none; }
.nf-tri { fill: var(--surface); stroke: var(--steel-700); stroke-width: .8; }
.nf-shaft { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: 1; }
.nf-gen { fill: none; stroke: var(--sel); stroke-width: 1.6; pointer-events: none; }
.nf-disk { cursor: ew-resize; }
.nf-disk:focus { outline: none; }
.nf-diskf { fill: var(--steel-100); stroke: var(--x-4b5563, #4b5563); stroke-width: 1.1; }
.nf-disk:hover .nf-diskf, .nf-disk.sel .nf-diskf, .nf-disk:focus .nf-diskf { stroke: var(--sel); }
.nf-hub { fill: var(--steel-300); stroke: var(--steel-700); stroke-width: .8; }
.nf-markdot { fill: var(--sel); }
.nf-tick { stroke: var(--steel-700); stroke-width: 1; }
.nf-twist { fill: none; stroke: var(--sel); stroke-width: 1.8; stroke-linejoin: round; }
.nf-twdot { fill: var(--sel); }
.nf-string { fill: none; stroke: var(--sel); stroke-width: 1.8; }
.nf-ampbar { stroke: var(--sel); stroke-width: 1.8; }
#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 */
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.mass rect { stroke: var(--x-b9c0c8, #b9c0c8); } #view .pill.mass text { fill: var(--text); font-weight: 600; }
#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.dimv rect { stroke: var(--steel-200); }
#view .pill.edge rect { stroke: var(--steel-200); fill: var(--surface-2); } #view .pill.edge text { fill: var(--text-3); }
#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; }

/* legend and live strip */
.nf-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); }
.nf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.nf-legend .nf-tip { color: var(--text-3); }
.nf-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: 34px; align-items: center; }
.nf-live b { font-weight: 500; color: var(--text-3); margin-right: 6px; }
.nf-live .x-ok { color: var(--good); font-weight: 500; }
.nf-live .x-no { color: var(--bad); font-weight: 500; }

/* in-place editor and popovers */
.nf-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); }
.nf-edit input { width: 92px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.nf-edit span { font-size: 11.5px; color: var(--text-3); }
.nf-pop { position: absolute; z-index: 6; width: 248px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 22, 28, .14); padding: 10px 12px; display: grid; gap: 8px; font-size: 13px; }
.nf-pop-h { display: flex; justify-content: space-between; font-weight: 600; }
.nf-pop .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.nf-pop .seg button { padding: 4px 6px; }
.nf-pop .why { margin: 0; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.nf-pop .row { display: grid; grid-template-columns: minmax(0, 1fr) 128px; align-items: center; gap: 8px; }
.nf-pop .row > span:first-child { color: var(--text-2); font-size: 12.5px; }
.nf-pop .del { border: 0; background: none; color: var(--bad); text-align: left; padding: 2px 0; cursor: pointer; font: inherit; font-size: 12.5px; }

/* examples and system 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: min(340px, calc(100vw - 48px)); max-width: calc(100vw - 48px); }
.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.nf-sys button { grid-template-columns: 34px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.ex-menu.nf-sys button svg { grid-row: span 2; }

/* panel: grows with its content, nothing is clipped */
main.nf .work { align-items: start; }
main.nf .panel { contain: none; }
main.nf .panel-body { overflow: visible; }
/* wide screens: the beam drawing is short, so the verdict and summary sit right under it in the left column and the panel
   (as tall as both) scrolls inside, instead of the drawing's card leaving an empty band beside a tall panel */
@media (min-width: 1041px) {
  main.nf { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  main.nf > * { grid-column: 1 / -1; }
  main.nf > .work { display: contents; }
  main.nf .work > .stage { grid-column: 1; grid-row: 1; }
  main.nf > #summary { grid-column: 1; grid-row: 2; align-self: stretch; }
  main.nf .work > .panel { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; height: 0; min-height: 100%; display: flex; flex-direction: column; }
  main.nf .work > .panel .panel-body { flex: 1 1 0; min-height: 0; overflow: auto; padding-bottom: 28px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }
}
@media (max-width: 560px) {
  main.nf .stage-bar .hist { order: 2; }
  main.nf .stage-bar .nf-chips { order: 3; width: 100%; box-sizing: border-box; justify-content: space-between; }
  .nf-chips button { padding: 4px 6px; font-size: 12px; gap: 4px; }
  .nf-types { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
}
.nf-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.nf-type { display: grid; justify-items: center; gap: 2px; padding: 6px 8px 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; font: inherit; font-size: 11.5px; color: var(--text-2); min-width: 0; }
.nf-type span { text-align: center; line-height: 1.2; }
.nf-type:hover { border-color: var(--line-2); background: var(--surface-2); }
.nf-type.on { border-color: var(--sel); background: var(--sel-bg); color: var(--text); }
.nf-seg { margin: 4px 0; }
.nf-seg button { padding: 4px 8px; font-size: 12.5px; white-space: normal; line-height: 1.25; }
.f.segf { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.f.segf > label { grid-template-columns: minmax(0, 1fr); }
.f.segf > label i:empty { display: none; }
.f.segf .seg { margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
main.nf .seg.nf-sect { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { main.nf .seg.nf-sect { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
main.nf .seg.nf-sect button, main.nf .nf-seg button { min-width: 0; }
.nf-list { display: grid; gap: 6px; }
.nf-item { border: 1px solid var(--line); border-radius: 9px; padding: 4px 8px 6px; }
.nf-item.sel { border-color: var(--sel); }
.nf-item-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding: 2px 0; }
.nf-grow { flex: 1; }
.nf-nm { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.nf-name { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin-left: -6px; cursor: text; }
.nf-name:hover { border-color: var(--line); }
.nf-name:focus { border-color: var(--line-2); background: var(--surface); outline: none; }
.nf-nm small { flex: none; font-size: 11px; color: var(--text-3); }
.nf-add-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.nf-add-row button { border: 1px dashed var(--line-2); background: none; border-radius: 7px; padding: 4px 10px; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.nf-add-row button:hover { border-color: var(--sel); color: var(--sel); }
.nf-kv { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.nf-hchips { display: inline-flex; gap: 2px; background: var(--fill-1); border-radius: 8px; padding: 2px; }
.nf-hchips button { border: 0; background: none; padding: 4px 12px; border-radius: 6px; cursor: pointer; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.nf-hchips button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* summary */
.nf-say { display: block; margin-top: 6px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
main.nf .verdict { max-width: 400px; }
@media (max-width: 1040px) { main.nf .verdict { max-width: none; } }

/* margins table, the lug standard: icon and name, preview card on hover */
table.nfms td.chk { display: flex; align-items: center; gap: 10px; white-space: normal; }
table.nfms td.chk .th { flex: none; width: 46px; height: 46px; margin: -8px 0; }
table.nfms td.chk > span { display: grid; gap: 1px; }
table.nfms td.chk small, table.nfms td small.nf-side { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
table.nfms td { padding-top: 6px; padding-bottom: 6px; }
table.nfms tr[data-mode] { cursor: pointer; }
#checks td.chk:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; border-radius: 6px; }
table.nfms small.nf-ph { display: none; }
@media (max-width: 700px) {
  #checks th:nth-child(3), #checks td:nth-child(3), #checks th:nth-child(5), #checks td:nth-child(5), #checks th:nth-child(4), #checks td:nth-child(4) { display: none; }
  table.nfms small.nf-ph { display: block; color: var(--text-2); }
  .margins td, .margins th { padding-left: 4px; padding-right: 4px; }
  .margins .ms { min-width: 54px; padding: 2px 6px; }
}
.nf-pv { position: fixed; z-index: 60; width: 236px; 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); box-sizing: border-box; }
.nf-pv[hidden] { display: none; }
.nf-pv svg { display: block; width: 220px; height: auto; margin: 4px 0 6px; }
.nf-pv .pv-h { font-weight: 600; }
.nf-pv .pv-c { color: var(--text-2); line-height: 1.35; }
.nf-pv .pv-m { margin-top: 4px; color: var(--text-3); }
.nf-pv .pv-t { font-size: 10.5px; fill: var(--text-3); }
@media print { .nf-pv { display: none !important; } }

/* Campbell chart */
#camp { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
#camp .drag { cursor: ew-resize; }
.ch-t { fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ch-a { fill: var(--text-2); }
.ch-l { font-weight: 600; }

@media (max-width: 700px) { .step .eq .katex { font-size: .86em; } }
@media (prefers-reduced-motion: reduce) { #view * { animation: none !important; } }
/* panel labels wrap rather than end in an ellipsis ("Added mass along the beam", "Tension + / compression −") */
.f > label span { white-space: normal; overflow: visible; }

/* 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-1e3a8a: #8aaaf4; --x-4b5563: #939ca9; --x-6e7177: #85827f; --x-9db6ee: #b4caf8; --x-b4533a: #e9947e;
    --x-b9c0c8: #44494f; --x-c4d3f3: #333d52; --x-cfd5dc: #373b40;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e3a8a: #8aaaf4; --x-4b5563: #939ca9; --x-6e7177: #85827f; --x-9db6ee: #b4caf8; --x-b4533a: #e9947e;
    --x-b9c0c8: #44494f; --x-c4d3f3: #333d52; --x-cfd5dc: #373b40;
  }
}
/* theme-auto:end */
