/* 3D bolt pattern builder (builder.js): the stepper, the step strip, the overlay in the 3D view and the flat face editor */
.bld-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.bld-steps button { display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: none; border-radius: 7px; padding: 5px 6px; font: inherit; font-size: 12.5px; color: var(--text-3); cursor: pointer; white-space: nowrap; min-width: 0; }
.bld-steps button b { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); font-size: 10.5px; font-weight: 600; color: var(--text-3); background: var(--surface); }
.bld-steps button:hover { color: var(--text); background: var(--fill-1); }
.bld-steps button.done { color: var(--text-2); }
.bld-steps button.done b { border-color: var(--text-3); color: var(--text-2); }
.bld-steps button[aria-selected="true"] { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }
.bld-steps button[aria-selected="true"] b { background: var(--text); border-color: var(--text); color: var(--on-accent); }

.bld-strip { padding: 8px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.bld-strip[hidden] { display: none; }
.bld-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.bld-row .grow { flex: 1; }
.bld-note { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.bld-fname { font-size: 13px; font-weight: 600; }
.bld-row .chip { font-family: inherit; }
.bld-row .chip span { color: var(--text-3); }
.bld-row .chip.on { border-color: var(--sel); color: var(--sel); background: color-mix(in srgb, var(--sel) 6%, transparent); }
.bld-row .ghost.small { font-size: 12.5px; padding: 4px 8px; }
.bld-gal { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.bld-card { display: grid; gap: 3px; justify-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 4px 6px 5px; cursor: pointer; font: inherit; color: var(--text); min-width: 0; }
.bld-card:hover { border-color: var(--line-2); background: var(--surface-2); }
.bld-card.on { border-color: var(--sel); box-shadow: 0 0 0 1px var(--sel) inset; }
.bld-th { display: block; width: 100%; max-width: 96px; aspect-ratio: 3 / 2; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bld-th svg { display: block; width: 100%; height: 100%; }
.bld-t { font-size: 11.5px; line-height: 1.25; text-align: center; color: var(--text-2); }
.bld-gen { padding-top: 2px; }
.bld-in { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); position: relative; }
.bld-in input { width: 84px; padding: 4px 32px 4px 6px; text-align: right; font-size: 12.5px; }
.bld-in i { position: absolute; right: 7px; font-style: normal; font-size: 11.5px; color: var(--text-3); pointer-events: none; }
.bld-ask { position: absolute; z-index: 12; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 8px; box-shadow: 0 8px 24px rgba(20, 22, 28, .14); font-size: 12.5px; color: var(--text-2); }
.bld-ask input { width: 90px; padding: 4px 6px; text-align: right; }
.bld-ask i { font-style: normal; color: var(--text-3); }

/* overlay in the 3D view */
#view .bld-h { cursor: grab; touch-action: none; }
#view .bld-h .hit { fill: transparent; }
#view .bld-hl { stroke: var(--sel); stroke-width: 1.3; stroke-dasharray: 3 2; }
#view .bld-ah { fill: var(--sel); }
#view .bld-knob { fill: var(--surface); stroke: var(--sel); stroke-width: 2; }
#view .bld-h:hover .bld-knob { fill: var(--sel); }
#view .bld-pill rect { fill: var(--surface); stroke: var(--sel); stroke-width: 1; }
#view .bld-pill text { fill: var(--sel); font-weight: 500; }
#view .bld-pill.pass { pointer-events: none; }
#view .bld-pill.pass rect { stroke: var(--line-2); }
#view .bld-pill.pass text { fill: var(--text); }
#view .bld-f { fill: color-mix(in srgb, var(--sel) 0%, transparent); stroke: none; stroke-width: 2; cursor: pointer; transition: fill .12s; }
#view .bld-f:hover, #view .bld-f.hov { fill: color-mix(in srgb, var(--sel) 10%, transparent); stroke: var(--sel); }
#view .bld-aim line { stroke: var(--load); stroke-width: 1.4; stroke-dasharray: 4 3; pointer-events: none; }
#view .bld-aim circle { fill: var(--load); pointer-events: none; }

/* the flat face editor, over the view */
.bld-ed { position: absolute; inset: 0; z-index: 3; background: var(--surface-2); display: flex; flex-direction: column; opacity: 0; transform: scale(.97); transition: opacity .2s ease, transform .2s ease; outline: none; }
.bld-ed.in { opacity: 1; transform: none; }
.bld-ed[hidden] { display: none; }
.bld-ed-svg { flex: 1; width: 100%; min-height: 0; display: block; touch-action: none; user-select: none; cursor: crosshair; }
.bld-ed-tip { margin: 0; padding: 7px 12px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--line); background: var(--surface); }
.bld-ed .ed-face { fill: var(--steel-50); stroke: var(--steel-600); }
.bld-ed .ed-bore { fill: var(--surface-2); stroke: var(--steel-600); }
.bld-ed .ed-guide { fill: none; stroke: var(--steel-400); }
.bld-ed .ed-cap { fill: var(--text-3); font-family: var(--font); }
.bld-ed .ed-ax path { fill: none; stroke: var(--text-2); }
.bld-ed .ed-ax text { fill: var(--text-2); font-family: var(--font); font-weight: 600; }
.bld-ed .ed-ghost { fill: color-mix(in srgb, var(--sel) 6%, transparent); stroke: var(--sel); pointer-events: none; }
.bld-ed .ed-b { cursor: grab; }
.bld-ed .ed-b .hit { fill: transparent; }
.bld-ed .ed-hex { fill: var(--steel-200); stroke: var(--steel-750); }
.bld-ed .ed-hole { fill: var(--surface); stroke: var(--steel-750); }
.bld-ed .ed-b:hover .ed-hex, .bld-ed .ed-b.sel .ed-hex { stroke: var(--sel); fill: var(--sel-line); }
.bld-ed .ed-n { fill: var(--text); font-weight: 600; paint-order: stroke; stroke: var(--surface-2); stroke-linejoin: round; font-family: var(--font); pointer-events: none; }
.bld-ed .ed-dim { stroke: var(--text-3); fill: none; pointer-events: none; }
.bld-ed .ed-snap { stroke: var(--sel); stroke-dasharray: 2 3; fill: none; pointer-events: none; }
.bld-ed .ed-pill { pointer-events: none; }
.bld-ed .ed-pill rect { fill: var(--surface); stroke: var(--line-2); }
.bld-ed .ed-pill text { fill: var(--text); font-family: var(--font); font-weight: 500; }
.bld-ed .ed-pill.bad rect { stroke: var(--bad); fill: var(--bad-bg); }
.bld-ed .ed-pill.bad text { fill: var(--bad); }

@media (max-width: 1040px) { .bld-gal { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .bld-steps { padding: 6px 8px; }
  .bld-steps button { flex-direction: column; gap: 2px; font-size: 11px; padding: 4px 2px; }
  .bld-gal { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .bld-t { font-size: 10.5px; }
  .bld-strip { padding: 8px; }
}

/* the input panel scrolls inside the stage's height: its cut edge fades (the strip above the drawing changes that height) */
.panel-body { padding-bottom: 22px; -webkit-mask-image: linear-gradient(#000 calc(100% - 20px), transparent); mask-image: linear-gradient(#000 calc(100% - 20px), transparent); }
@media (max-width: 1040px) { .panel-body { -webkit-mask-image: none; mask-image: none; } }
