/* lu.ca/calc/sheet: sheet and plate tolerances */
.sh-stage { padding: 16px 20px 18px; }
.sh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sh-prods { display: flex; flex-wrap: wrap; gap: 8px 20px; min-width: 0; flex: 1 1 520px; }
.sh-fam { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.sh-famh { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.sh-prod { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.sh-prod i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sh-prod b { font-weight: 500; color: var(--text); }
.sh-prod span { font-size: 12px; color: var(--text-3); }
.sh-prod:hover { border-color: var(--line-2); }
.sh-prod[aria-checked="true"] { background: var(--surface); border-color: var(--text-2); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.sh-prod:focus-visible { outline: 2px solid var(--sel); outline-offset: 1px; }

.sh-grid { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 20px; align-items: start; }
.sh-in { display: grid; gap: 12px; }
.sh-dims, .sh-opts { display: grid; gap: 10px; }
.sh-f { display: grid; gap: 4px; min-width: 0; }
.sh-f > span:first-child { font-size: 12px; color: var(--text-3); }
.sh-f select, .sh-iu input { width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 8px; min-width: 0; }
.sh-f select:focus, .sh-iu input:focus { outline: none; border-color: var(--text-2); }
.sh-iu { position: relative; display: block; }
.sh-iu input { padding-right: 44px; font-variant-numeric: tabular-nums; }
.sh-iu i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--text-3); pointer-events: none; }

.sh-draw { position: relative; min-width: 0; }
#draw { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
#draw .band { fill: var(--x-e3e8f1, #e3e8f1); }
#draw .bandl { fill: none; stroke: var(--moment); stroke-width: 1; stroke-dasharray: 4 3; }
#draw .plate { fill: var(--steel-150); stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; }
#draw .nom { fill: none; stroke: var(--ink); stroke-width: .8; stroke-dasharray: 5 3; stroke-opacity: .7; }
#draw .dimc { stroke: var(--moment); stroke-width: 1.3; }
#draw .edge { stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; }
#draw .cap { font-size: 12px; fill: var(--text-2); }
#draw .cap.scale { fill: var(--text-3); }
#draw .pill rect { fill: var(--surface); stroke: var(--line-2); }
#draw .pill text { fill: var(--text); font-weight: 500; }
#draw .pill[data-edit] { cursor: text; }
#draw .pill[data-edit]:hover rect, #draw .pill[data-edit]:focus rect { stroke: var(--text-2); }
#draw .pill:focus { outline: none; }
#draw .hdl { cursor: grab; }
#draw.dragging, #draw.dragging .hdl { cursor: grabbing; }
#draw .hdl .hit { fill: transparent; }
#draw .hdl .ring { fill: var(--surface); stroke: var(--sel); stroke-width: 2; }
#draw .hdl:hover .ring, #draw .hdl:focus .ring { fill: var(--sel-bg-2); }
#draw .hdl:focus { outline: none; }
.sh-ped { position: absolute; z-index: 5; box-sizing: border-box; font: 500 12px/1 var(--font); padding: 0 10px; border: 1px solid var(--text-2); border-radius: 999px; background: var(--surface); color: var(--text); }
.sh-ped:focus { outline: none; }

.sh-sum { margin-top: 14px; display: grid; gap: 8px; }
.sh-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 16px; }
.sh-kv > div { display: grid; gap: 2px; min-width: 0; }
.sh-kv span { font-size: 12px; color: var(--text-3); }
.sh-kv b { font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.sh-std { margin: 0; font-size: 12.5px; color: var(--text-3); }
.sh-warn { background: var(--warn-bg); color: var(--x-6f4a12, #6f4a12); border-radius: 8px; padding: 8px 12px; font-size: 13px; }

.sh-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.sh-t th { font-weight: 500; font-size: 12px; color: var(--text-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sh-t th.l, .sh-t td.l { text-align: left; }
.sh-t td { text-align: right; padding: 8px; border-bottom: 1px solid var(--fill-1); vertical-align: top; font-variant-numeric: tabular-nums; }
.sh-t td.v { white-space: nowrap; }
.sh-t td.c { color: var(--text-3); white-space: nowrap; font-size: 12.5px; }
.sh-t td.l b { font-weight: 500; }
.sh-t td small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.4; margin-top: 2px; font-weight: 400; }
.sh-t td.v small { display: inline; margin: 0 0 0 4px; }
.sh-t tr.k-agree td.v, .sh-t tr.k-none td.v { color: var(--text-2); white-space: normal; }
#tol td.l { width: 46%; }
.sh-tnote { margin: 10px 0 0; }
.sh-mass td.l { width: 60%; }
.sh-c tbody tr { cursor: pointer; }
.sh-c tbody tr:hover { background: var(--surface-2); }
.sh-c tbody tr.sel { background: var(--sel-bg); }
.sh-c tbody tr:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; }
.sh-c td { white-space: nowrap; }
.sh-c td.l { white-space: normal; min-width: 180px; }

.sh-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.sh-gsys { margin-bottom: 10px; }
.sh-gg { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.sh-gb { display: grid; gap: 1px; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 5px 9px; cursor: pointer; font: inherit; }
.sh-gb b { font-weight: 600; font-size: 13px; color: var(--text); }
.sh-gb span { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-gb:hover { border-color: var(--line-2); }
.sh-gb.on { background: var(--sel-bg); border-color: var(--sel); }
.sh-gb.on b { color: var(--sel); }

.sh-cin { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.sh-m td small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.sh-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.sh-steps b { color: var(--text); font-weight: 500; }
.sh-links p { margin: 0; font-size: 13.5px; }
.sh-unc { color: var(--text-3); font-size: 12.5px; }

@media (max-width: 999px) {
  .sh-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sh-grid { grid-template-columns: minmax(0, 1fr); }
  .sh-draw { order: -1; }
  .sh-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sh-dims { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sh-opts { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .sh-stage { padding: 14px 14px 16px; }
  .sh-cin { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* stacked cards instead of wide tables */
  #tol, #tol tbody, #tol tr, #tol td, #cmp, #cmp tbody, #cmp tr, #cmp td { display: block; }
  #tol thead, #cmp thead { display: none; }
  #tol tr, #cmp tr { padding: 8px 0; border-bottom: 1px solid var(--fill-1); }
  #tol td, #cmp td { border: 0; padding: 1px 8px; text-align: left; width: auto !important; white-space: normal; }
  #tol td.v:empty { display: none; }
  #tol td.v, #tol td.c { display: inline-block; margin-right: 12px; }
  #tol td.v:first-of-type { font-weight: 500; }
  #tol tr.k-agree td.v, #tol tr.k-none td.v { display: block; }
  #cmp td:not(.l) { display: inline-block; margin-right: 10px; }
  #cmp td:not(.l)::before { content: attr(data-h) " "; color: var(--text-3); font-size: 12px; }
}
@media (max-width: 420px) {
  .sh-dims { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .sh-dims .sh-iu input { padding-right: 34px; }
  .sh-opts { grid-template-columns: minmax(0, 1fr); }
  .sh-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .sh-m th, .sh-m td { padding: 6px 4px; font-size: 12.5px; }
  .sh-m .ms { min-width: 0; padding: 2px 6px; }
}
@media (max-width: 560px) {
  .sh-prods { gap: 10px; }
  .sh-fam { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; width: 100%; }
  .sh-famh { grid-column: 1 / -1; }
  .sh-prod { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 6px; padding: 5px 9px; text-align: left; white-space: normal; }
  .sh-prod span { grid-column: 2; }
  .sh-head .ex-wrap { order: -1; }
}

/* 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-3b8bb0: #7fbddd; --x-6e7177: #85827f; --x-6f4a12: #b8976d; --x-9a8a3a: #c6b97a; --x-b07b3b: #dbad7b;
    --x-e3e8f1: #2c2f34;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-3b8bb0: #7fbddd; --x-6e7177: #85827f; --x-6f4a12: #b8976d; --x-9a8a3a: #c6b97a; --x-b07b3b: #dbad7b;
    --x-e3e8f1: #2c2f34;
  }
}
/* theme-auto:end */
