/* lu.ca/calc/position: true position */
.tp-bar-l { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.tp-draw { position: relative; min-width: 0; }
#view { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
#view .plate { fill: var(--steel-100); stroke: var(--ink); stroke-width: 1.3; }
#view .hole { fill: var(--surface); stroke: var(--ink); stroke-width: 1.1; }
#view .bore { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; }
#view .cl { stroke: var(--text-4); stroke-width: .7; stroke-dasharray: 10 2.5 2 2.5; fill: none; }
#view .ext { stroke: var(--text-4); stroke-width: .7; }
#view .tick { stroke: var(--ink); stroke-width: 1; }
#view .zone { stroke-width: 1.4; }
#view .zone.good { fill: color-mix(in srgb, var(--good) 9%, transparent); stroke: var(--good); }
#view .zone.warn { fill: color-mix(in srgb, var(--warn) 10%, transparent); stroke: var(--warn); }
#view .zone.bad { fill: color-mix(in srgb, var(--bad) 8%, transparent); stroke: var(--bad); }
#view .zone0 { fill: none; stroke: var(--x-6e7177, #6e7177); stroke-width: .9; stroke-dasharray: 3 2.5; }
#view .zone2 { fill: color-mix(in srgb, var(--moment) 7%, transparent); stroke: var(--moment); stroke-width: 1.3; stroke-dasharray: 5 3; }
#view .tpx { stroke: var(--ink); stroke-width: 1; }
#view .devl { stroke: var(--ink); stroke-width: 1; }
#view .axp { fill: var(--ink); }
#view .axp2 { fill: none; stroke: var(--ink); stroke-width: 1; }
#view .cap { font-size: 12px; fill: var(--text-2); }
#view .cap.scale { fill: var(--text-3); }
#view .basic rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1; }
#view .basic text, #view .fcf text { fill: var(--text); font-size: 12px; font-weight: 500; }
#view .fcf rect.cell { fill: var(--surface); stroke: var(--ink); stroke-width: 1.1; }
#view .fcf .sym { fill: none; stroke: var(--text); stroke-width: 1.2; }
#view [data-edit], #view [data-cyc] { cursor: pointer; }
#view [data-edit]:hover rect, #view [data-edit]:focus rect, #view [data-cyc]:hover rect, #view [data-cyc]:focus rect { stroke: var(--sel); }
#view [data-edit]:focus, #view [data-cyc]:focus, #view .hdl:focus { outline: none; }
#view .dsym polygon { fill: var(--ink); }
#view .dsym line { stroke: var(--ink); stroke-width: 1; }
#view .dsym rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.1; }
#view .dsym text { font-size: 12px; font-weight: 600; fill: var(--text); }
#view .pill rect { fill: var(--surface); stroke: var(--line-2); }
#view .pill text { font-size: 12px; font-weight: 500; fill: var(--text); }
#view .pill.good rect { stroke: color-mix(in srgb, var(--good) 55%, transparent); } #view .pill.good text { fill: var(--good); }
#view .pill.warn rect { stroke: color-mix(in srgb, var(--warn) 60%, transparent); } #view .pill.warn text { fill: var(--warn); }
#view .pill.bad rect { stroke: color-mix(in srgb, var(--bad) 60%, transparent); } #view .pill.bad text { fill: var(--bad); }
#view .hdl { cursor: grab; }
#view.dragging, #view.dragging .hdl { cursor: grabbing; }
#view .hdl .hit { fill: transparent; }
#view .hdl .ring { fill: var(--surface); fill-opacity: .6; stroke: var(--sel); stroke-width: 2; }
#view .hdl:hover .ring, #view .hdl:focus .ring { fill: var(--sel-bg-2); fill-opacity: 1; }
#view .hdl.sz .ring { fill: var(--surface); stroke-width: 1.6; }
#view .deco { pointer-events: none; }
.tp-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: 6px; background: var(--surface); color: var(--text); text-align: center; }
.tp-ped:focus { outline: none; border-color: var(--sel); }

/* summary under the drawing */
.tp-sum { border-top: 1px solid var(--line); display: grid; grid-template-columns: auto minmax(0, 1fr); }
.tp-sum .verdict { padding: 12px 18px; min-width: 210px; }
.tp-sum .verdict .v { font-size: 22px; }
.tp-sum .verdict .v.good { color: var(--good); } .tp-sum .verdict .v.bad { color: var(--bad); } .tp-sum .verdict .v.warn { color: var(--warn-ink); }
.tp-sum .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tp-sum .stat { padding: 12px 16px; }
.tp-sum .stat .v { font-variant-numeric: tabular-nums; }

/* panel */
.tp-tabs { grid-template-columns: repeat(3, 1fr); }
.tp-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.tp-fl { display: grid; gap: 4px; min-width: 0; font-size: 12px; color: var(--text-3); }
.tp-fl .num input { text-align: right; }
.tp-seg { margin: 4px 0 8px; }
.tp-seg button { white-space: normal; line-height: 1.25; }
.tp-txt { margin: 4px 0 8px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.tp-txt b { color: var(--text-2); font-weight: 500; }
.tp-hole { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.tp-hole.sel { border-color: var(--sel); background: var(--surface-2); }
.tp-hole-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tp-hole-h input.nm { border: 1px solid transparent; background: none; font-weight: 600; font-size: 13px; padding: 3px 6px; border-radius: 6px; min-width: 0; width: 100%; }
.tp-hole-h input.nm:hover { border-color: var(--line); }
.tp-hole-h input.nm:focus { border-color: var(--text-2); background: var(--surface); }
.tp-hole-h .ty { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tp-hole-h .ms { min-width: 0; white-space: nowrap; flex: none; padding: 2px 8px; }
.tp-hole-h input.nm { flex: 1 1 auto; }
.tp-hole-h .x { flex: none; }
.tp-trip { display: grid; grid-template-columns: 64px repeat(3, minmax(0, 1fr)); gap: 4px; align-items: center; margin-top: 3px; }
.tp-trip .lab { font-size: 12px; color: var(--text-3); }
.tp-trip .num input { padding: 5px 7px; font-size: 12.5px; }
.tp-trip .hd { font-size: 11px; color: var(--text-3); text-align: right; padding-right: 7px; }
.tp-paste textarea { width: 100%; min-height: 110px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--surface); outline: none; }
.tp-paste textarea:focus { border-color: var(--text-2); }
.tp-msg { font-size: 12.5px; margin: 6px 0 0; color: var(--text-2); }
.tp-msg.bad { color: var(--bad); }
.tp-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* margins */
.tp-m td.l small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; white-space: normal; }
.tp-m td.c { color: var(--text-3); font-size: 12.5px; }
.tp-m td small.c { display: block; font-size: 12px; color: var(--text-3); }
.tp-m td { font-variant-numeric: tabular-nums; }
.tp-m tbody tr.sel td.l { color: var(--sel); }
.tp-foot { margin: 10px 0 0; }

/* fasteners */
.tp-fgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tp-fdraw { position: relative; min-width: 0; }
#fview { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
#fview .prt { fill: var(--steel-100); stroke: var(--ink); stroke-width: 1.2; }
#fview .hatch { stroke: var(--steel-400); stroke-width: .8; }
#fview .bolt { fill: var(--steel-300); stroke: var(--ink); stroke-width: 1.1; cursor: default; }
#fview .deco, #fview .pz { pointer-events: none; }
#fview .thr { stroke: var(--ink); stroke-width: .7; }
#fview .ax { stroke: var(--text-4); stroke-width: .7; stroke-dasharray: 10 2.5 2 2.5; }
#fview .pz { fill: color-mix(in srgb, var(--moment) 7%, transparent); stroke: var(--moment); stroke-width: 1; stroke-dasharray: 4 3; }
#fview .hit { fill: color-mix(in srgb, var(--bad) 90%, transparent); }
#fview .cap { font-size: 12px; fill: var(--text-2); }
#fview .cap.scale { fill: var(--text-3); }
#fview .pill rect { fill: var(--surface); stroke: var(--line-2); }
#fview .pill text { font-size: 12px; font-weight: 500; fill: var(--text); }
#fview [data-fedit] { cursor: pointer; }
#fview [data-fedit]:hover rect, #fview [data-fedit]:focus rect { stroke: var(--sel); }
#fview [data-fedit]:focus { outline: none; }
#fview .dim { stroke: var(--moment); stroke-width: 1; }
#fview .ext { stroke: var(--text-4); stroke-width: .7; }

.tp-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 13.5px; color: var(--text-2); }
.tp-steps b { color: var(--text); font-weight: 500; }
.tp-steps .f { display: inline; }
.tp-steps sub, .tp-steps sup { font-size: .72em; line-height: 0; }
.tp-links p { margin: 0; font-size: 13.5px; }

@media (max-width: 999px) {
  .tp-fgrid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) { .tp-long { display: none; } }
@media (max-width: 760px) {
  .tp-sum { grid-template-columns: minmax(0, 1fr); }
  .tp-sum .verdict { border-bottom: 1px solid var(--line); }
  .tp-sum .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tp-sum .stat { border-left: 0; padding: 10px 14px; }
  /* margins table as stacked rows */
  .tp-m, .tp-m tbody, .tp-m tr, .tp-m td { display: block; }
  .tp-m thead { display: none; }
  .tp-m tr { padding: 8px 0; border-bottom: 1px solid var(--fill-1); }
  .tp-m td { border: 0; padding: 2px 4px; text-align: left; white-space: normal; }
  .tp-m td:not(.l) { display: inline-block; margin-right: 12px; }
  .tp-m td:not(.l)[data-h]::before { content: attr(data-h) " "; color: var(--text-3); font-size: 12px; }
}
/* the panel scrolls: its bottom edge fades so a half-shown control reads as "more below" */
.tp-stage + .panel .panel-body { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent); }

/* chart: the measured features */
#bonusChart .tp-dot { cursor: pointer; }
#bonusChart .tp-dot:focus { outline: none; }
#bonusChart .tp-dot:focus circle:nth-child(2), #bonusChart .tp-dot:hover circle:nth-child(2) { stroke-width: 3; }
#view .zone.hl { stroke-width: 3; }
.tp-tip { position: fixed; z-index: 60; display: grid; gap: 2px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 24, 30, .14); font-size: 12.5px; color: var(--text-2); pointer-events: none; white-space: nowrap; }
.tp-tip[hidden] { display: none; }
.tp-tip b { color: var(--text); font-weight: 600; }
@media print { .tp-tip { 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-6e7177: #85827f;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-6e7177: #85827f;
  }
}
/* theme-auto:end */
