/* Timber beam and column — on top of calc.css */
main.tb .tabs { grid-template-columns: repeat(3, 1fr); }
main.tb .stage-bar { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
main.tb .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); }

/* the member */
.tb-wood { fill: var(--x-ecdcb6, #ecdcb6); stroke: none; }
.tb-lam { fill: none; stroke: var(--x-c9ae7b, #c9ae7b); stroke-width: .7; pointer-events: none; }
.tb-grain, .tb-ring { fill: none; stroke: var(--tb-grain, #c9ae7b); stroke-width: .8; pointer-events: none; }
/* dark: a quiet grain on the dark wood (the rule would lift it to a bright line); timberjoint uses the same classes */
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tb-grain: #57482b; } }   /* theme: keep */
@media screen { :root[data-theme="dark"] { --tb-grain: #57482b; } }   /* theme: keep */
.tb-edge { fill: none; stroke: var(--x-6f5530, #6f5530); stroke-width: 1.3; stroke-linejoin: round; }
.tb-wall { fill: var(--steel-200); stroke: none; }
.tb-hatch { stroke: var(--steel-550); stroke-width: .8; }
.tb-plate { fill: var(--steel-350); stroke: var(--steel-700); stroke-width: .8; }
.tb-sup { fill: var(--steel-300); stroke: var(--steel-700); stroke-width: 1; }
.tb-deck { fill: var(--steel-300); stroke: var(--steel-550); stroke-width: .8; }
.tb-tie { stroke: var(--ink); stroke-width: 1.6; fill: none; }
.tb-load { stroke: var(--load); stroke-width: 1.8; fill: none; }
.tb-load-h { fill: var(--load); stroke: none; }
.tb-axis { stroke: var(--steel-400); stroke-width: 1; fill: none; }
.tb-defl { stroke: var(--moment); stroke-width: 1.6; stroke-dasharray: 6 3; fill: none; }
.tb-dim { stroke: var(--steel-550); stroke-width: 1; fill: none; }
.tb-stress { fill: color-mix(in srgb, var(--moment) 16%, transparent); stroke: var(--moment); stroke-width: 1; }
.tb-fmd { stroke: var(--bad); stroke-width: 1.6; }
.tb-note { font-size: 11px; fill: var(--text-3); }
.tb-cls { font-size: 12px; font-weight: 600; fill: var(--x-6f5530, #6f5530); }
.tb-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.tb-role { font-size: 11px; fill: var(--text-3); }
.tb-nm { cursor: text; }
.tb-nm:hover .tb-name, .tb-nm:focus .tb-name { fill: var(--sel); }
.tb-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.ld rect { stroke: color-mix(in srgb, var(--load) 50%, transparent); } #view .pill.ld text { fill: var(--load-ink); font-weight: 600; }
#view .pill.ldg rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.ldg text { fill: var(--load-ink); }
#view .pill.df rect { stroke: color-mix(in srgb, var(--moment) 50%, transparent); } #view .pill.df text { fill: var(--x-2c4a8f, #2c4a8f); font-weight: 600; }
#view .pill.cl rect { stroke: color-mix(in srgb, var(--x-6f5530, #6f5530) 45%, transparent); } #view .pill.cl text { fill: var(--x-6f5530, #6f5530); font-weight: 600; }
#view .pill.st rect { stroke: color-mix(in srgb, var(--moment) 40%, transparent); } #view .pill.st text { fill: var(--x-2c4a8f, #2c4a8f); }
#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; }
.tb-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); }
.tb-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; background: transparent; color: var(--text); }
.tb-edit-name input { width: 180px; text-align: center; }
.tb-edit span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* live strip and flags */
.tb-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; }
.tb-live b { font-weight: 500; color: var(--text-3); margin-right: 5px; }
.tb-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tb-flags span { display: inline-flex; align-items: center; line-height: 1; font-size: 11.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.tb-flags span.tb-err { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); white-space: normal; }

/* panel */
.tb-seg { margin-bottom: 6px; }
.tb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.tb-chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin: 4px 0 6px; cursor: pointer; }
.tb-chk input { margin: 0; }
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) input { border-color: var(--bad); }
#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); }

.f.sel > label { grid-template-columns: minmax(0, 1fr); }

/* summary and table */
.tb-say { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; max-width: 40ch; }
.tb-cl { color: var(--text-2); }
#checks tr.tb-miss td { color: var(--text-2); font-size: 12.5px; white-space: normal; line-height: 1.45; padding-top: 10px; padding-bottom: 10px; }
#checks td.note { white-space: normal; min-width: 200px; line-height: 1.4; }
#spChart { touch-action: none; user-select: none; }
#spChart .cdrag { cursor: ew-resize; }
svg.fb-chart .ch-g { fill: var(--fill-1); }

@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 tr.tb-miss td { grid-column: 1 / -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: "effect "; color: var(--text-3); }
  #checks td:nth-child(3)::before { content: "resistance "; color: var(--text-3); }
  #checks td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; font-size: 12px; color: var(--text-3); min-width: 0; }
}
@media print { .tb-edit { display: none !important; } }

/* 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-2c4a8f: #82a0df; --x-2f7d7a: #76b1ae; --x-6e7177: #85827f; --x-6f5530: #af9878; --x-7a4fa0: #b895dc;
    --x-8a5a0e: #c89e6a; --x-b0506e: #e691a8; --x-c9ae7b: #c5af85; --x-cf6a2c: #f7a071; --x-ecdcb6: #3f341a;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-2c4a8f: #82a0df; --x-2f7d7a: #76b1ae; --x-6e7177: #85827f; --x-6f5530: #af9878; --x-7a4fa0: #b895dc;
    --x-8a5a0e: #c89e6a; --x-b0506e: #e691a8; --x-c9ae7b: #c5af85; --x-cf6a2c: #f7a071; --x-ecdcb6: #3f341a;
  }
}
/* theme-auto:end */
