/* Weld group 3D (prototype) — additions on top of ../calc.css, in the 2D weld tool's language. */
.tabs { grid-template-columns: repeat(3, 1fr); }

/* stage bar: examples, colour switch, then help and history at the right edge */
.stage-bar { justify-content: flex-start; gap: 10px 12px; flex-wrap: wrap; }
.mapgrp { display: inline-flex; align-items: center; gap: 7px; }
.seg-cap { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.bar-end { position: relative; margin-left: auto; display: flex; align-items: center; gap: 6px; }
.qhelp { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line-2); border-radius: 50%;
  font-size: 11.5px; font-weight: 500; color: var(--text-3); cursor: help; user-select: none; -webkit-user-select: none; }
.qhelp:hover, .qhelp:focus { color: var(--text); border-color: var(--text-2); outline: none; }
.qpop { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; width: min(300px, calc(100vw - 64px)); padding: 9px 12px; border: 1px solid var(--line-2);
  border-radius: 9px; background: var(--surface); box-shadow: 0 6px 20px rgba(0,0,0,.1); font-size: 12.5px; font-weight: 400; line-height: 1.45; color: var(--text-2); cursor: default; text-align: left; }
.qhelp:hover .qpop, .qhelp:focus .qpop, .qhelp.open .qpop { display: block; }
.hist { display: flex; gap: 2px; }
.hist .ghost { font-size: 16px; padding: 2px 8px; }
.hist .ghost:disabled { opacity: .35; cursor: default; background: none; }

/* examples menu (as in column/) */
.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; width: min(330px, calc(100vw - 48px)); }
.ex-menu[hidden] { display: none; }
.ex-menu button { border: 0; background: none; text-align: left; padding: 6px 10px 6px 6px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.ex-menu button svg { grid-row: span 2; }
.ex-menu button small { color: var(--text-3); font-size: 11.5px; line-height: 1.3; }
.ex-menu button:hover, .ex-menu button:focus { background: var(--fill-1); outline: none; }
.ex-menu button.on { background: var(--sel-bg); }

/* the stage card's frame as a shadow ring (same look; the QA padding audit reads a bordered box as a tight chip) */
.work > .stage { border: 0; box-shadow: 0 0 0 1px var(--line); }

/* the drawing with its hover card and the inline dimension editor */
.vwrap { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
#view { aspect-ratio: 800 / 560; }
#view .bead { cursor: pointer; }
#view .dimk { cursor: grab; }
#view .dimp { cursor: text; }
.w3-tip { position: absolute; z-index: 5; pointer-events: none; width: 248px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 8px 26px rgba(20, 24, 30, .14); padding: 8px 11px 9px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.w3-tip[hidden] { display: none; }
.w3-tip .h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 600; color: var(--text); margin-bottom: 4px; white-space: nowrap; }
.w3-tip .h span { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.w3-tip table { width: 100%; border-collapse: collapse; }
.w3-tip td { padding: 1px 0; }
.w3-tip td:last-child { text-align: right; color: var(--text); white-space: nowrap; }
.w3-tip tr.sep td { border-top: 1px solid var(--fill-1); padding-top: 3px; }
.w3-tip .ms { min-width: 0; font-size: 11.5px; padding: 1px 7px; }
.w3-edit { position: absolute; z-index: 6; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--sel); border-radius: 999px; padding: 2px 9px 2px 3px; box-shadow: 0 4px 14px rgba(37, 99, 235, .15); }
.w3-edit[hidden] { display: none; }
.w3-edit input { width: 64px; border: 0; outline: none; text-align: right; font-size: 13px; padding: 2px 4px; background: none; }
.w3-edit .u { font-size: 12px; color: var(--text-3); }

/* legend */
.stage-foot .legend-dots { flex-wrap: wrap; row-gap: 4px; }
.stage-foot .legend-dots span { white-space: nowrap; }
.legend-heat .ticks.wt span:first-child { transform: none; }
.legend-heat .ticks.wt span:last-child { transform: translateX(-100%); }
.legend-dots svg { vertical-align: middle; }

/* panel */
.sidepick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--fill-1); border-radius: 8px; padding: 2px; }
.sidepick button { display: flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; border-radius: 6px; padding: 4px 4px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.sidepick button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.btnrow { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; padding: 5px 8px; font-size: 12.5px; }
.btnrow .btn:disabled { opacity: .4; cursor: default; }
.grp-h .aside .ms { min-width: 0; font-size: 11.5px; padding: 1px 7px; }
.subgrp { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; }
.subh { font-size: 11.5px; font-weight: 600; color: var(--text-3); margin: 2px 0 4px; }
.facechip { display: inline-block; font-size: 11.5px; color: var(--text-2); background: var(--fill-1); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

/* sheets */
.sheets.wsheets { grid-template-columns: minmax(0, 1fr); gap: 22px; }
.sheet.segs3 { min-width: 980px; }
.sheet.loads3 { min-width: 680px; }
/* phones: both sheets are cards (calc.css .sheet.cards): type, size and bead first, the start, then the end, face, arc
   and the margin; a load's name first, its point, then its force or moment */
@media (max-width: 760px) {
  .sheet.segs3.cards, .sheet.loads3.cards { min-width: 0; }
  .sheet.cards select.cellsel { width: auto; border-color: var(--line); height: 28px; }
  .sheet.segs3.cards td.msc { margin-left: auto; }
  .sheet.segs3.cards td.msc > * { flex: none; }
  .sheet.cards td.na { white-space: normal; font-size: 12px; }
}
.sheet.segs3 col.nrm { width: 9%; } .sheet.segs3 col.arc { width: 5.5%; } .sheet.segs3 col.ty { width: 8%; } .sheet.segs3 col.sz { width: 7%; } .sheet.segs3 col.sd { width: 96px; } .sheet.segs3 col.msc { width: 8.5%; }
.sheet select.cellsel { width: 100%; border: 1px solid transparent; background: none; border-radius: 6px; padding: 3px 2px; font-size: 12.5px; cursor: pointer; }
.sheet select.cellsel:hover { border-color: var(--line-2); }
.sheet input.bad { color: var(--bad); }

/* margins table */
.margins td.rules { white-space: normal; }
.rule { display: inline-block; font-size: 11.5px; border-radius: 6px; padding: 1px 6px; margin: 1px 3px 1px 0; }
.rule.ok { color: var(--text-3); background: var(--fill-1); }
.rule.no { color: var(--bad); background: var(--bad-bg); font-weight: 600; }
.rule.adv { color: var(--warn); background: var(--warn-bg); }
.gov { font-size: 12px; font-weight: 600; }
.gov.weld { color: var(--text-2); }
.gov.base { color: var(--clamp); }
.verdict .s.method { font-size: 11.5px; color: var(--text-3); margin-top: 4px; max-width: 290px; }

/* preview card beside a margins-table row: the weld's cross-section at its worst point (screen only) */
.w3-pv { position: fixed; z-index: 60; width: 236px; padding: 8px 10px 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); }
.w3-pv[hidden] { display: none; }
.w3-pv svg { display: block; width: 216px; height: auto; margin: 2px 0 4px; }
.w3-pv .pv-h { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w3-pv .pv-c { color: var(--text-2); line-height: 1.35; }
.w3-pv .pv-m { margin-top: 4px; color: var(--text-3); }
table.margins td.chk { display: flex; align-items: center; gap: 8px; cursor: help; }
table.margins td.chk .th { flex: none; width: 46px; height: 46px; margin: -8px 0; }
#table td.chk:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; border-radius: 6px; }
@media print { .w3-pv, .w3-tip { display: none !important; } }

/* first ten seconds: on narrow screens the verdict follows the drawing, the inputs come after it */
@media (max-width: 1040px) {
  .work { display: contents; }
  .work > .stage { order: -3; }
  #summary { order: -2; }
  .work > .panel { order: -1; }
}
@media (max-width: 640px) { .bar { flex-wrap: wrap; row-gap: 8px; } .bar-right { flex-wrap: wrap; gap: 8px; } #view { aspect-ratio: 400 / 440; } }
@media (max-width: 560px) { .seg-cap { display: none; } .legend-heat { flex-wrap: wrap; } .title h1 { white-space: nowrap; } .w3-tip { width: 228px; } }
#summary:empty { min-height: 123px; }
@media (max-width: 1040px) { #summary:empty { min-height: 240px; } }

.sheet td.na .unpin { font-size: 12px; padding: 1px 8px; margin-left: 4px; font-style: normal; }
.w3-pv .pv-n { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--fill-1); color: var(--warn); line-height: 1.35; }

/* scrolling areas fade at an edge where there is more, so nothing looks cut off (as coatings/ and friction/) */
#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); }
.table-wrap.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.table-wrap.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); mask-image: linear-gradient(to right, transparent, #000 40px); }
.table-wrap.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
/* the input panel grows with its content instead of scrolling (nothing cut off at its bottom edge) */
.work { align-items: start; }
#panel { overflow: visible; }
.step .eq.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.step .eq.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); mask-image: linear-gradient(to right, transparent, #000 40px); }
.step .eq.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }

/* a value pill's leader starts on its dimension knob: the leader never takes the pointer, so a press there drags the knob */
#view .dimp line { pointer-events: 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-3f8e64: #83c29d; --x-6e7177: #85827f; --x-6fb08a: #9bd0b0; --x-7a3a2a: #cb8f7f; --x-a8291f: #eb8071;
    --x-a9cf9f: #9fbd97; --x-c3c9d0: #3f4348; --x-cfd5dc: #373b40; --x-d9533c: #fd9681; --x-d9583a: #fd977e;
    --x-e6a03a: #f8be72; --x-ec9a5c: #feb987; --x-f2cf9a: #513910;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-3f8e64: #83c29d; --x-6e7177: #85827f; --x-6fb08a: #9bd0b0; --x-7a3a2a: #cb8f7f; --x-a8291f: #eb8071;
    --x-a9cf9f: #9fbd97; --x-c3c9d0: #3f4348; --x-cfd5dc: #373b40; --x-d9533c: #fd9681; --x-d9583a: #fd977e;
    --x-e6a03a: #f8be72; --x-ec9a5c: #feb987; --x-f2cf9a: #513910;
  }
}
/* theme-auto:end */
