/* Pipe & Cable Clip custom styles (extends /shared/css/base.css) */

/* Screw detail: the fastener as measured, in the drawing's upper right (or the panel).
   The fastener is a line drawing in the hardware's pale brass; its sizes are value boxes. */
.screw-detail {
  font: 12px/1.35 var(--sheet-font); color: var(--ink); background: #fff;
  border: 1px solid rgba(18, 53, 95, 0.45); border-radius: 2px;
}
.sd-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 6px 10px; border-bottom: 1px solid rgba(18, 53, 95, 0.45);
}
.sd-head strong { font-size: 13px; }
.sd-head span { color: var(--muted); }
.screw-detail[hidden], .sd-foot[hidden] { display: none; }
.viewer .screw-detail { position: absolute; top: 20px; right: 20px; z-index: 5; width: 290px; }
.panel .screw-detail { margin: 4px 0 14px; }
.sd-body { position: relative; }
.sd-drawing { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sd-foot { margin: 0; padding: 5px 10px 6px; color: var(--muted); border-top: 1px solid rgba(18, 53, 95, 0.12); }
.sd-foot.error { color: var(--error); }
.screw-detail .dim-note { display: none; }
/* A detail's lettering is smaller than the main drawing's, and each caption sits over its
   value and unit, so the boxes stay narrow beside the fastener. The two outer columns share
   any spare width, which centres the value and unit under the caption. Unlike the main
   drawing's boxes, these keep "mm" (or "in") on phones too. */
.screw-detail .dim { min-height: 0; padding: 2px 6px 3px; }
.screw-detail .dim-row { display: grid; grid-template-columns: 1fr auto auto 1fr; column-gap: 0; align-items: baseline; }
.screw-detail .dim-cap { grid-column: 1 / -1; font-size: 10.5px; line-height: 1.25; text-align: center; }
.screw-detail .dim input[type="text"] { grid-column: 2; min-width: 0; font-size: 13px; line-height: 1.2; }
.screw-detail .dim-unit { grid-column: 3; margin-left: 3px; }
.screw-detail .dim-unit.len { display: inline; }
.screw-detail .dim-unit.deg { margin-left: 1px; }
.sd-measure { position: absolute; left: 0; top: 0; visibility: hidden; white-space: pre; pointer-events: none; }
.sd-part { fill: #f5eedd; stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.sd-crest { fill: none; stroke: var(--ink); stroke-width: 0.7; stroke-opacity: 0.8; }
.sd-hidden { fill: none; stroke: var(--ink); stroke-width: 0.8; stroke-dasharray: 3 2; stroke-opacity: 0.7; }
.sd-center { fill: none; stroke: var(--ink); stroke-width: 0.6; stroke-dasharray: 9 3 2 3; stroke-opacity: 0.5; }
.sd-ext { fill: none; stroke: var(--ink); stroke-width: 0.7; stroke-opacity: 0.75; }
.sd-line { fill: none; stroke: var(--ink); stroke-width: 0.9; }
.sd-arrow { fill: var(--ink); }
.sd-dim.active .sd-ext, .sd-dim.active .sd-line { stroke: var(--accent); stroke-opacity: 1; }
.sd-dim.active .sd-arrow { fill: var(--accent); }
.sd-dim.invalid .sd-ext, .sd-dim.invalid .sd-line { stroke: var(--error); stroke-opacity: 1; }
.sd-dim.invalid .sd-arrow { fill: var(--error); }
.sd-dim.active .sd-line, .sd-dim.invalid .sd-line { stroke-width: 1.8; }
.sd-dim.active .sd-ext, .sd-dim.invalid .sd-ext { stroke-width: 1.2; }

/* Fastener picker: a tile per fastener, each a small section drawing of the clip's base
   with the fastener seated in it, in the drawing's own ink, hatch and brass. */
.fastener-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fastener-tile {
  --tile-bg: #fff;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px 7px; font-size: 12px; line-height: 1.2; text-align: center; color: var(--text);
  background: var(--tile-bg); border: 1px solid var(--line); border-radius: 7px; cursor: pointer;
}
.fastener-tile input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.fastener-tile svg { display: block; width: 100%; max-width: 104px; height: auto; }
.fastener-tile span { padding: 1px 6px 2px; border-radius: 4px; }
.fastener-tile:hover { border-color: var(--accent); }
.fastener-tile:has(input:checked) { --tile-bg: #f3f6fb; color: var(--ink); border-color: var(--ink); }
.fastener-tile:has(input:checked) span { color: #fff; font-weight: 600; background: var(--ink); }
.fastener-tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.fa-wall { fill: rgba(18, 53, 95, 0.07); }
.fa-face { fill: none; stroke: rgba(18, 53, 95, 0.4); stroke-width: 1; }
.fa-edge { fill: none; stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.fa-cut { fill: var(--tile-bg); }
.fa-part { fill: #f5eedd; stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.fa-hidden { fill: none; stroke: var(--ink); stroke-width: 0.8; stroke-dasharray: 2 1.5; stroke-opacity: 0.7; }
.fa-center { fill: none; stroke: var(--ink); stroke-width: 0.6; stroke-dasharray: 6 2 1.5 2; stroke-opacity: 0.45; }
#mount-help { margin-top: 10px; }
