/* IMECA3D — Screw boss & insert designer (loaded after snap-fit.css, which holds the shared form/result styles).
   Script: src/js/fasten.js. Server analysis: netlify/functions/fasten/. */

.fb--busy .sf-verdict { opacity: 0.75; transition: opacity 0.2s; }
.fb--empty .fb-draw, .fb--empty .fb-geo, .fb--empty .fb-dl, .fb--empty .fb-modes, .fb--empty .fb-torque, .fb--empty .fb-cmp, .fb--empty .sf-slicer, .fb--empty .sf-checks { display: none; }
.fb-status { margin: -4px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--light); }
.fb .fb-methods, .fb .sf-seg { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.fb .sf-seg span { white-space: normal; line-height: 1.25; text-align: center; }
.fb .sf-form, .fb .sf-out { min-width: 0; }
.fb .sf-seg span { padding: 9px 6px; font-size: 0.86rem; }
.sf-form [hidden] { display: none !important; }
.fb-tick { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; font-size: 0.92rem; cursor: pointer; }
.fb-tick input { width: 18px; height: 18px; accent-color: var(--accent); }

/* section drawing */
.fb-draw { border-radius: 12px; background: var(--light); padding: 6px; }
.fb-draw svg { display: block; width: 100%; height: auto; }
.fb-wall { fill: url(#fb-hatch); stroke: var(--text-3); stroke-width: 1; }
.fb-hatch { stroke: #B9C3CF; stroke-width: 1.2; }
.fb-boss { fill: #F4C9A6; stroke: var(--text); stroke-width: 1.2; }
.fb-rib { fill: #F8DCC5; stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 2; }
.fb-layers line { stroke: rgba(194,65,12,0.25); stroke-width: 0.8; }
.fb-hole { fill: #fff; stroke: var(--text); stroke-width: 1; }
.fb-insert { fill: #C9A227; stroke: #7A5F0E; stroke-width: 1; }
.fb-knurl { stroke: #7A5F0E; stroke-width: 0.8; }
.fb-screw { fill: #9CA3AF; stroke: #4B5563; stroke-width: 1; opacity: 0.85; }
.fb-thread { fill: none; stroke: #4B5563; stroke-width: 1; }
.fb-weak-o { stroke: #DC2626 !important; stroke-width: 2.5 !important; }
.fb-weak-s { stroke: #DC2626 !important; stroke-width: 3 !important; fill: none; }
.fb-dim { stroke: #2563EB; stroke-width: 1; }
.fb-arrow { fill: #2563EB; }
.fb-dimt { fill: #1D4ED8; font: 600 11px var(--font-body); }
.fb-lab { fill: var(--text-2); font: 600 11px var(--font-body); }
.fb-lab--w { fill: #B91C1C; }

/* downloads */
.fb-dl h3, .fb-geo h3, .fb-modes h3, .fb-torque h3, .fb-cmp h3 { margin-bottom: 10px; font-family: var(--font-head); font-size: 1rem; font-weight: 600; }
.fb-dl__row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.fb-dl__row .btn { padding: 9px 18px; }
.fb-dl__row .btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* failure modes */
.fb-modes ul, .fb-torque ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fb-modes li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 0.9rem; }
.fb-modes li b { font-family: var(--font-head); }
.fb-modes li.is-weak span, .fb-modes li.is-weak b { color: #B91C1C; }
.fb-mbar { position: relative; grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--light-2); }
.fb-mbar span { display: block; height: 100%; border-radius: 4px; background: #F07A2E; }
.fb-modes li.is-weak .fb-mbar span { background: #DC2626; }
.fb-mbar i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); }
.fb-mnote { display: block !important; font-size: 0.78rem !important; color: var(--text-3); }
.fb-torque li { font-size: 0.9rem; line-height: 1.5; padding-left: 14px; position: relative; }
.fb-torque li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.fb-torque li.is-warn, .sf-slicer li.is-warn { color: #92400E; font-weight: 600; }

/* comparison */
.fb-cmp__table { overflow-x: auto; }
.fb-cmp table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.fb-cmp th, .fb-cmp td { padding: 7px 8px; border-bottom: 1px solid var(--light-2); text-align: left; white-space: nowrap; }
.fb-cmp thead th { font-size: 0.76rem; color: var(--text-3); font-weight: 600; }
.fb-cmp tbody th button { padding: 0; border: 0; background: none; font: 600 0.86rem var(--font-body); color: var(--text); text-decoration: underline; cursor: pointer; text-align: left; }
.fb-cmp tr.is-cur { background: #FFF1E7; }
.fb-cmp tr.is-cur th button { text-decoration: none; color: #C2410C; }
.fb-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; vertical-align: 0; }
.fb-dot--pass { background: #16A34A; } .fb-dot--marginal { background: #D97706; } .fb-dot--fail { background: #DC2626; }
.fb-cmp .sf-note { margin-top: 8px; }
.fb-core { fill: #F4C9A6; }
