/* Moment end plate — on top of calc.css */
main.ep .tabs { grid-template-columns: repeat(3, 1fr); }
main.ep .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.ep .stage-bar .hist { margin-left: auto; }
#view { display: block; width: 100%; height: auto; user-select: none; touch-action: none; }
#view .hit { fill: transparent; stroke: none; }
#view .handle { cursor: grab; }
#view .handle.hx { cursor: ew-resize; }
#view .handle.hy { cursor: ns-resize; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob, #view .handle:focus .knob { fill: var(--sel); }

/* parts */
.ep-web { fill: var(--steel-50); stroke: var(--steel-550); stroke-width: .8; }
.ep-hole { fill: var(--surface-2); stroke: var(--steel-500); stroke-width: .8; }
.ep-axis { stroke: var(--steel-550); stroke-width: .7; stroke-dasharray: 9 3 1.5 3; fill: none; pointer-events: none; }
.ep-ctr { stroke: var(--steel-700); stroke-width: .9; }
.ep-ext { fill: none; stroke: var(--steel-400); stroke-width: .8; }
.ep-dim { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.ep-dimh { fill: var(--steel-550); }
.ep-lead { stroke: color-mix(in srgb, var(--load) 55%, transparent); stroke-width: .9; pointer-events: none; }
.ep-cap { font-size: 11.5px; fill: var(--text-3); }
.ep-sec { font-size: 11px; font-weight: 600; fill: var(--text-2); letter-spacing: .04em; }
.ep-load line, .ep-load path.sh { stroke: var(--load); stroke-width: 1.8; fill: none; }
.ep-load path.hd { fill: var(--load); stroke: none; }
.ep-load.ep-grey line, .ep-load.ep-grey path.sh { stroke: var(--steel-550); } .ep-load.ep-grey path.hd { fill: var(--steel-550); }
.ep-dot { fill: var(--load); }
.ep-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.ep-role { font-size: 11px; fill: var(--text-3); }
.ep-nm { cursor: text; }
.ep-nm:hover .ep-name, .ep-nm:focus .ep-name { fill: var(--sel); }
.ep-nm:focus { outline: none; }

/* 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.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.desig rect { stroke: color-mix(in srgb, var(--sel) 45%, transparent); } #view .pill.desig text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.lock rect { stroke: color-mix(in srgb, var(--good) 45%, transparent); } #view .pill.lock text { fill: var(--good); font-weight: 600; }
#view .pill.free rect { stroke: color-mix(in srgb, var(--amber) 55%, transparent); } #view .pill.free text { fill: var(--x-9a6b12, #9a6b12); font-weight: 600; }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect, #view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }

/* editors in the drawing */
.stage { position: relative; }
.ep-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); }
.ep-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.ep-edit-name input { width: 180px; text-align: center; }
.ep-edit span { font-size: 11.5px; color: var(--text-3); }

/* live strip and flags */
.ep-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; }
.ep-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.ep-live i { font-style: normal; color: var(--text-3); }
.ep-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ep-flags span { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }

/* panel */
.ep-seg { margin-bottom: 6px; }
.ep-lab { font-size: 12px; color: var(--text-3); margin: 8px 0 4px; }
.ep-lab:first-child { margin-top: 0; }
.ep-cards { display: grid; gap: 4px; }
.ep-card { display: grid; gap: 1px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; cursor: pointer; color: var(--text); font-size: 12.5px; }
.ep-card b { font-weight: 500; }
.ep-card span { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.ep-card:hover { border-color: var(--line-2); }
.ep-card.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.ep-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.ep-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.ep-chip:hover { border-color: var(--line-2); }
.ep-chip.on { border-color: var(--text); color: var(--text); font-weight: 500; }
.ep-sel select { width: 100%; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
.ep-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 6px 0 2px; cursor: pointer; }

/* summary */
.ep-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 34ch; }
.ep-tag { display: inline-block; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; }

/* forces and chart */
.ep-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.ep-kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
.ep-kv h3 { grid-column: 1 / -1; font-size: 12px; font-weight: 500; color: var(--text-3); margin: 10px 0 2px; }
.ep-kv h3:first-child { margin-top: 0; }
.ep-kv > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ep-kv span { color: var(--text-2); }
.ep-kv b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ep-kv i { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; color: var(--text-3); }
#mchart .ndrag { cursor: ew-resize; }
.ep-rest { margin-top: 10px; }
#mchart { touch-action: none; user-select: none; }

/* materials */
table.ep-alt { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ep-alt th { font-weight: 500; font-size: 11.5px; color: var(--text-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ep-alt td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ep-alt th.l, .ep-alt td.l { text-align: left; }
.ep-alt td.l { white-space: normal; }
.ep-alt tr.sel td { background: var(--sel-bg); }
.ep-alt td.meth { color: var(--text-3); }

@media (max-width: 1100px) { .ep-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .ep-kv { grid-template-columns: minmax(0, 1fr); }
  table.ep-alt thead { display: none; }
  table.ep-alt, .ep-alt tbody, .ep-alt tr, .ep-alt td { display: block; width: 100%; }
  .ep-alt tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .ep-alt td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .ep-alt td:nth-child(1) { font-weight: 500; }
  .ep-alt td:nth-child(3)::before { content: "factor "; color: var(--text-3); }
  .ep-alt td:nth-child(4)::before { content: "allowable "; color: var(--text-3); }
  .ep-alt td:nth-child(5), .ep-alt td:nth-child(6) { text-align: right; }
}
#panel.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
#panel.fade-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px); mask-image: linear-gradient(to bottom, transparent, #000 28px); }
#panel.fade-t.fade-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
/* phones: the margins as stacked cards (no sideways scroll) */
@media (max-width: 760px) {
  #checks thead { display: none; }
  #checks, #checks tbody { display: block; width: 100%; }
  #checks tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  #checks td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  #checks td.chk { grid-column: 1; grid-row: 1; }
  #checks td:nth-child(5) { grid-column: 2; grid-row: 1; align-self: center; }
  #checks td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  #checks td:nth-child(3) { grid-column: 2; grid-row: 2; font-size: 12.5px; text-align: right; }
  #checks td:nth-child(2)::before { content: "actual "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "allowed "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); }
}
@media print { .ep-edit { display: none !important; } }

/* connection parts */
main.ep .stage-bar .seg { flex: 0 0 auto; }
.ep-support { fill: url(#hatchIron); stroke: var(--steel-700); stroke-width: 1; }
.ep-plate { fill: var(--steel-blue); fill-opacity: .92; stroke: var(--steel-800); stroke-width: 1.2; }
.ep-plateS { fill: url(#hatchPlate); stroke: var(--steel-800); stroke-width: 1.1; }
.ep-beam { fill: var(--steel-50); stroke: var(--steel-700); stroke-width: 1; }
.ep-flange { fill: var(--steel-250); stroke: var(--steel-700); stroke-width: 1; }
.ep-webS { fill: url(#hatchIron); stroke: var(--steel-700); stroke-width: 1; }
.ep-weld { fill: var(--steel-750); stroke: none; }
.ep-weldE { fill: url(#hatchWeld); stroke: var(--steel-750); stroke-width: .8; }
.ep-hole { fill: var(--surface); stroke: var(--steel-800); stroke-width: 1; }
.ep-bolt { fill: var(--steel-350); stroke: var(--steel-800); stroke-width: 1; }
.ep-boltX { stroke: var(--steel-800); stroke-width: .9; }
.ep-shank { fill: var(--steel-350); stroke: var(--steel-800); stroke-width: .9; }
.ep-hot { fill: none; stroke: var(--bad); stroke-width: 2; stroke-dasharray: 4 3; pointer-events: none; }
.ep-grp { min-height: 120px; }
.ep-grp svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.ep-grp .ep-gcap { margin: 6px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.45; }

.ep-gt { font-size: 11.5px; fill: var(--text-2); }
.ep-load.ep-thin line { stroke-width: 1.5; }
.ep-check input { margin: 0; }

/* 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 / 520; }
@media (max-width: 560px) { #view:empty { aspect-ratio: 394 / 760; } }

/* the joint */
.ep-cweb { fill: var(--steel-50); stroke: var(--steel-700); stroke-width: 1; }
.ep-cfl { fill: var(--steel-250); stroke: var(--steel-700); stroke-width: 1; }
.ep-bweb { fill: var(--steel-50); stroke: var(--steel-700); stroke-width: 1; }
.ep-bfl { fill: var(--steel-250); stroke: var(--steel-700); stroke-width: 1; }
.ep-stiff { fill: var(--steel-200); stroke: var(--steel-700); stroke-width: .9; }
.ep-plate { fill: url(#epHatch); stroke: var(--steel-800); stroke-width: 1.2; }
.ep-plateF { fill: var(--steel-blue); stroke: var(--steel-800); stroke-width: 1.2; }
.ep-hidden { fill: none; stroke: var(--steel-550); stroke-width: .9; stroke-dasharray: 5 3; }
.ep-holeF { fill: var(--surface); stroke: var(--steel-800); stroke-width: .9; }
.ep-boltF { fill: var(--steel-350); stroke: var(--steel-800); stroke-width: .8; }
.ep-nut { fill: var(--steel-350); stroke: var(--steel-800); stroke-width: .9; }
.ep-break { fill: none; stroke: var(--steel-550); stroke-width: .9; }
.ep-load.ep-grey line, .ep-load.ep-grey path.sh { stroke: var(--steel-550); } .ep-load.ep-grey path.hd { fill: var(--steel-550); }
#view .pill.grey rect { stroke: var(--steel-300); } #view .pill.grey text { fill: var(--text-2); font-weight: 600; }
.ep-row-n { font-size: 11px; fill: var(--text-3); }
/* bolt rows table */
table.ep-rows { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ep-rows th { font-weight: 500; font-size: 11.5px; color: var(--text-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ep-rows td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ep-rows th.l, .ep-rows td.l { text-align: left; }
.ep-rows td.l:last-child { white-space: normal; color: var(--text-2); }
.ep-bar { display: inline-block; vertical-align: middle; width: 54px; height: 6px; border-radius: 3px; background: var(--steel-100); margin-left: 6px; overflow: hidden; }
.ep-bar i { display: block; height: 100%; background: var(--load); opacity: .75; }
.ep-rowsbox .ep-gcap { margin: 8px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.45; }
/* panel rows */
.ep-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 28px; align-items: center; gap: 6px; }
.ep-row .f { margin: 0; grid-template-columns: minmax(0, 1fr); }
.ep-row .f label { display: none; }
.ep-rn { font-size: 12px; color: var(--text-2); display: grid; line-height: 1.25; }
.ep-rn small { font-size: 11px; color: var(--text-3); }
.ep-x { width: 28px; height: 28px; padding: 0; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.ep-halo { paint-order: stroke; stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; }
#mchart .mdrag { cursor: ns-resize; } #mchart .tdrag { cursor: ew-resize; }
@media (max-width: 760px) {
  table.ep-rows thead { display: none; }
  table.ep-rows, .ep-rows tbody { display: block; width: 100%; }
  .ep-rows tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .ep-rows td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .ep-rows td:nth-child(2)::before { content: "depth "; color: var(--text-3); }
  .ep-rows td:nth-child(3)::before { content: "lever arm "; color: var(--text-3); }
  .ep-rows td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .ep-rows td:nth-child(5) { grid-column: 1 / -1; font-size: 12px; }
}

/* the AISC option is shown but switched off until it is checked against the Design Guides */
#codeSeg button[disabled] { color: var(--text-3); cursor: not-allowed; }
.ep-off { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
@media (max-width: 560px) { .ep-off { white-space: normal; flex-basis: 100%; } }

/* 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-7a4fa0: #b895dc; --x-7d8da1: #636f7f; --x-9a6b12: #cfa76a;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-6e7177: #85827f; --x-7a4fa0: #b895dc; --x-7d8da1: #636f7f; --x-9a6b12: #cfa76a;
  }
}
/* theme-auto:end */
