/* Purlin 3D CAD viewer */
.cad-viewer{position:relative;width:100%;margin:0 auto;font-family:Inter,Arial,sans-serif;text-align:left}
.cad-viewer .cad-fallback{display:block;width:100%;height:330px;object-fit:contain}
.cad-viewer.cad-ready .cad-fallback{display:none}
.cad-stage{position:relative;height:460px;border:1px solid #d5e0e9;border-radius:10px;overflow:hidden;outline:none;cursor:grab;
  background:radial-gradient(ellipse at 50% 40%,#ffffff 0%,#eef4f9 60%,#e2ebf3 100%)}
.cad-stage:active{cursor:grabbing}
.cad-stage:focus-visible{box-shadow:0 0 0 2px #1478b8}
.cad-stage canvas{display:block;width:100%!important;height:100%!important;touch-action:none}
.cad-labels{position:absolute;inset:0;pointer-events:none}
.cad-dim-label{padding:3px 8px;border-radius:4px;background:#0e7bd0;color:#fff;font:600 12px/1.2 Inter,Arial,sans-serif;white-space:nowrap;box-shadow:0 2px 6px rgba(14,42,61,.18)}
.cad-loading{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#31506b;font-size:14px;text-align:center;padding:20px}
.cad-spinner{width:34px;height:34px;border:3px solid #cfdce8;border-top-color:#1478b8;border-radius:50%;animation:cadspin .8s linear infinite}
@keyframes cadspin{to{transform:rotate(360deg)}}
.cad-hint{position:absolute;left:50%;top:12px;transform:translateX(-50%);padding:6px 12px;border-radius:999px;background:rgba(14,42,61,.78);color:#fff;font-size:12px;pointer-events:none;transition:opacity .4s;white-space:nowrap}
.cad-touched .cad-hint{opacity:0}
.cad-part{position:absolute;z-index:3;padding:4px 9px;border-radius:4px;background:#0e2a3d;color:#fff;font-size:12px;pointer-events:none;white-space:nowrap}
.cad-toolbar{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;margin-top:10px}
.cad-group{display:flex;flex-wrap:wrap;gap:6px}
.cad-toolbar button{display:inline-flex;align-items:center;gap:6px;padding:7px 11px;border:1px solid #d5e0e9;border-radius:6px;background:#fff;color:#31506b;font:500 12px/1 Inter,Arial,sans-serif;cursor:pointer}
.cad-toolbar button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
.cad-toolbar button:hover{border-color:#1478b8;color:#1478b8}
.cad-toolbar button.on,.cad-toolbar button[aria-pressed="true"]{background:#0e2a3d;border-color:#0e2a3d;color:#fff}
.cad-toolbar button:focus-visible,.cad-play:focus-visible{outline:2px solid #1478b8;outline-offset:2px}
.cad-stroke{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:10px;padding:10px 14px;border:1px solid #d5e0e9;border-radius:8px;background:#f6f9fc;font-size:13px;color:#31506b}
.cad-stroke label b,.cad-len b{color:#0e2a3d;font-variant-numeric:tabular-nums}
.cad-stroke input[type=range]{flex:1 1 180px;accent-color:#1478b8}
.cad-play{padding:7px 12px;border:1px solid #1478b8;border-radius:6px;background:#1478b8;color:#fff;font:600 12px/1 Inter,Arial,sans-serif;cursor:pointer}
.cad-play[aria-pressed="true"]{background:#fff;color:#1478b8}
.cad-viewer:fullscreen{background:#fff;padding:16px;display:flex;flex-direction:column}
.cad-viewer:fullscreen .cad-stage{flex:1;height:auto}
@media(max-width:600px){.cad-stage{height:340px}.cad-toolbar button span{display:none}.cad-toolbar button{padding:8px}.cad-hint{font-size:11px}}
/* v24: Download CAD file button */
.cad-download{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:16px}
.cad-dl-btn{position:relative;display:inline-flex;align-items:center;gap:14px;padding:12px 26px 12px 14px;border-radius:12px;overflow:hidden;
  background:linear-gradient(135deg,#0e2a3d 0%,#16507a 55%,#1478b8 100%);color:#fff;text-decoration:none;text-align:left;
  box-shadow:0 10px 24px rgba(14,42,61,.28);transition:transform .18s ease,box-shadow .18s ease}
.cad-dl-btn::after{content:'';position:absolute;top:0;left:-60%;width:40%;height:100%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.22),transparent);transform:skewX(-20deg);animation:cadShine 3.6s ease-in-out infinite}
@keyframes cadShine{0%,60%{left:-60%}100%{left:130%}}
.cad-dl-btn:hover{transform:translateY(-2px);box-shadow:0 14px 30px rgba(20,120,184,.36)}
.cad-dl-btn:focus-visible{outline:3px solid #ffd000;outline-offset:3px}
.cad-dl-ic{flex:none;display:grid;place-items:center;width:42px;height:42px;border-radius:10px;background:#ffd000}
.cad-dl-ic svg{width:22px;height:22px;fill:none;stroke:#0e2a3d;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.cad-dl-btn:hover .cad-dl-ic svg{animation:cadBounce .6s ease}
@keyframes cadBounce{50%{transform:translateY(3px)}}
.cad-dl-txt{display:flex;flex-direction:column;gap:3px}
.cad-dl-txt b{font:700 16px/1.2 Archivo,Inter,Arial,sans-serif;letter-spacing:.2px}
.cad-dl-txt small{font:500 12px/1.2 Inter,Arial,sans-serif;color:#cfe3f2}
.cad-dl-alt{font:500 13px/1.3 Inter,Arial,sans-serif;color:#1478b8;text-decoration:none}
.cad-dl-alt:hover{text-decoration:underline}
@media (prefers-reduced-motion:reduce){.cad-dl-btn::after,.cad-dl-btn:hover .cad-dl-ic svg{animation:none}.cad-dl-btn{transition:none}}
.cad-dl-btn.is-busy{cursor:progress;opacity:.9}
.cad-dl-btn.is-busy .cad-dl-ic svg{animation:cadBounce .7s ease infinite}
.cad-dl-btn.is-done .cad-dl-ic{background:#22c55e}
.cad-dl-btn.is-done .cad-dl-ic svg{stroke:#fff}
/* v24: compact 3D view in the Technical Specifications box */
.cad-viewer.cad-compact .cad-stage{height:340px}
.cad-viewer.cad-compact .cad-toolbar{justify-content:center}
.cad-viewer.cad-compact .cad-toolbar button{padding:6px 9px;font-size:11.5px}
.cad-viewer.cad-compact .cad-dim-label{font-size:11px;padding:2px 6px}
.cad-viewer.cad-compact .cad-hint{font-size:11px}
@media(max-width:600px){.cad-viewer.cad-compact .cad-stage{height:300px}}
/* compact viewer fills its card and keeps its buttons on one row */
.cad-viewer.cad-compact .cad-stage{flex:1;height:auto;min-height:300px;border-radius:10px}
.cad-viewer.cad-compact .cad-toolbar{flex-wrap:nowrap;justify-content:space-between;gap:6px;margin-top:10px}
.cad-viewer.cad-compact .cad-group{flex-wrap:nowrap;gap:5px}
.cad-viewer.cad-compact .cad-toolbar button{padding:7px;border-radius:8px}
.cad-viewer.cad-compact .cad-toolbar button span{display:none}
.cad-viewer.cad-compact .cad-toolbar button svg{width:17px;height:17px}
/* v24: model finish picker (Silver / Purlin Blue / Blueprint / Black) */
.cad-themes{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin-top:10px}
.cad-themes-label{font:700 11px/1 Inter,Arial,sans-serif;letter-spacing:.8px;text-transform:uppercase;color:#5b6b78;margin-right:2px}
.cad-themes button{display:inline-flex;align-items:center;gap:7px;padding:5px 12px 5px 5px;border:1px solid #d5e0e9;border-radius:999px;background:#fff;color:#31506b;
  font:600 12px/1 Inter,Arial,sans-serif;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.cad-themes button i{width:20px;height:20px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
.cad-themes button:hover{border-color:#1478b8;transform:translateY(-1px)}
.cad-themes button.on{border-color:#1478b8;box-shadow:0 0 0 3px rgba(20,120,184,.18);color:#0e2a3d}
.cad-themes button:focus-visible{outline:3px solid #ffd000;outline-offset:2px}
.cad-stage.cad-dark{background:radial-gradient(ellipse at 50% 40%,#123d6b 0%,#0b2a4d 55%,#071c35 100%);border-color:#0b2a4d}
.cad-stage.cad-dark .cad-hint{background:rgba(255,255,255,.14)}
.cad-viewer.cad-compact .cad-themes{gap:6px;margin-top:8px}
.cad-viewer.cad-compact .cad-themes button{padding:4px}
.cad-viewer.cad-compact .cad-themes button span{display:none}
@media(max-width:600px){.cad-themes button span{display:none}.cad-themes button{padding:4px}}

/* v46: stroke-length selector (PAI-01-V1 to V7) - picks the 3D model and the STEP file */
.cad-stroke-pick{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px 12px;margin:4px auto 12px;padding:10px 14px;max-width:560px;border:1px solid #d5e0e9;border-radius:8px;background:#f6f9fc;font:500 13px/1.3 Inter,Arial,sans-serif;color:#31506b}
.cad-stroke-pick label{font-weight:600;color:#1f3a52}
.cad-stroke-sel{height:38px;min-width:130px;padding:0 34px 0 12px;border:1px solid #9fb6c9;border-radius:6px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231478b8' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center/12px 8px;-webkit-appearance:none;appearance:none;font:600 14px Inter,Arial,sans-serif;color:#13324a;cursor:pointer}
.cad-stroke-sel:hover{border-color:#1478b8}
.cad-stroke-sel:focus-visible{outline:3px solid rgba(20,120,184,.35);outline-offset:1px;border-color:#1478b8}
.cad-stroke-note{color:#5b7489;font-weight:400}
.cad-stroke-pick--compact{margin:2px 0 10px;padding:6px 10px;max-width:none;justify-content:flex-start;font-size:12px}
.cad-stroke-pick--compact .cad-stroke-sel{height:34px;min-width:110px;font-size:13px}
@media (max-width:600px){.cad-stroke-pick{justify-content:flex-start}.cad-stroke-sel{flex:1 1 140px;height:44px}}

/* v48: stroke picker styled like the "Technical drawing" selector in Document Downloads, with animation */
.cad-stroke-pick.csp-on{display:block;max-width:none;margin:6px 0 16px;padding:0;border:0;background:none}
.cad-stroke-pick.csp-on>label,.cad-stroke-pick.csp-on>.cad-stroke-sel,.cad-stroke-pick.csp-on>.cad-stroke-note{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}
.csp{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:14px;padding:14px 16px;border:1px solid #d5e0e9;border-radius:16px;
  background:linear-gradient(135deg,#f7fbff,#eaf3fa);box-shadow:0 8px 22px rgba(14,42,61,.07);text-align:left;animation:cspRise .45s cubic-bezier(.2,.8,.2,1) both}
.csp-label{font:700 12px/1.2 Inter,Arial,sans-serif;letter-spacing:.9px;text-transform:uppercase;color:#16507a}
.csp-dd{position:relative;flex:1 1 340px;max-width:520px}
.csp-btn{width:100%;display:flex;align-items:center;gap:12px;padding:8px 14px 8px 8px;border:1px solid #cfe0ee;border-radius:12px;background:#fff;cursor:pointer;text-align:left;
  box-shadow:0 4px 12px rgba(14,42,61,.06);transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.csp-btn:hover,.csp.open .csp-btn{border-color:#1478b8;box-shadow:0 0 0 4px rgba(20,120,184,.12)}
.csp-btn:active{transform:scale(.99)}
.csp-btn:focus-visible{outline:3px solid #ffd000;outline-offset:2px}
.csp-ic{position:relative;flex:none;width:40px;height:40px;border-radius:10px;overflow:hidden;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 3 7v10l9 5 9-5V7z'/%3E%3Cpath d='M3 7l9 5 9-5M12 12v10'/%3E%3C/svg%3E") center/21px 21px no-repeat,linear-gradient(135deg,#1aa0ff,#16507a);box-shadow:0 4px 10px rgba(20,120,184,.3)}
.csp-ic::after{content:"";position:absolute;inset:0;background:linear-gradient(115deg,transparent 30%,rgba(255,255,255,.55) 50%,transparent 70%);transform:translateX(-120%);animation:cspShine 3.6s ease-in-out 1s infinite}
.csp-txt{display:flex;flex-direction:column;gap:2px;min-width:0}
.csp-txt small{font:500 11.5px/1.2 Inter,Arial,sans-serif;color:#5b6b78}
.csp-val{display:block;overflow:hidden;height:22px;font:700 19px/22px Archivo,Inter,Arial,sans-serif;color:#0e2a3d;font-variant-numeric:tabular-nums}
.csp-val span{display:block}
.csp-bump .csp-val span{animation:cspRoll .38s cubic-bezier(.2,.8,.2,1)}
.csp-meta{margin-left:auto;padding:4px 10px;border-radius:999px;background:#eaf3fa;color:#16507a;font:600 11.5px/1.2 Inter,Arial,sans-serif;white-space:nowrap}
.csp-chev{flex:none;width:28px;height:28px;border-radius:8px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316507a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/16px 16px no-repeat,#f1f6fa;transition:transform .25s cubic-bezier(.2,.8,.2,1),background-color .2s}
.csp.open .csp-chev{transform:rotate(180deg);background-color:#dcebf6}
.csp-status{font:500 12.5px/1.3 Inter,Arial,sans-serif;color:#5b6b78}
.csp-panel{position:absolute;z-index:30;left:0;right:0;top:calc(100% + 8px);min-width:300px;padding:12px;border:1px solid #d5e0e9;border-radius:14px;background:#fff;
  box-shadow:0 22px 50px rgba(14,42,61,.22);transform-origin:top center;animation:cspIn .22s cubic-bezier(.2,.8,.2,1)}
.csp-panel[hidden]{display:none}
.csp-head{display:flex;justify-content:space-between;margin:0 2px 10px;font:700 11.5px/1.2 Inter,Arial,sans-serif;letter-spacing:.7px;text-transform:uppercase;color:#5b6b78}
.csp-head span{color:#1478b8}
.csp-list{list-style:none;margin:0;padding:2px;display:grid;grid-template-columns:repeat(auto-fill,minmax(78px,1fr));gap:6px;max-height:300px;overflow-y:auto;outline:none}
.csp-chip{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:9px 4px;border:1px solid #e1e9f0;border-radius:10px;background:#f8fbfd;color:#0e2a3d;cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .15s ease,box-shadow .15s ease;animation:cspChip .28s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i,0) * 14ms)}
.csp-chip b{font:700 16px/1 Archivo,Inter,Arial,sans-serif;font-variant-numeric:tabular-nums}
.csp-chip small{font:500 10.5px/1 Inter,Arial,sans-serif;color:#5b6b78}
.csp-chip:hover,.csp-chip:focus{border-color:#1478b8;background:#eaf3fa;transform:translateY(-2px);box-shadow:0 6px 14px rgba(20,120,184,.16);outline:none}
.csp-chip:focus-visible{box-shadow:0 0 0 3px rgba(20,120,184,.35)}
.csp-chip.active{background:linear-gradient(135deg,#0e2a3d,#1478b8);border-color:transparent;color:#fff}
.csp-chip.active small{color:#ffd000}
.csp-foot{display:flex;align-items:center;gap:8px;margin:10px 2px 0;font:500 11.5px/1.3 Inter,Arial,sans-serif;color:#5b6b78}
.csp-dot{width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 0 rgba(34,197,94,.5);animation:cspPing 1.8s ease-out infinite}
/* compact version (Technical Specifications tab) */
.cad-stroke-pick--compact.csp-on{margin:0 0 10px}
.csp--compact{padding:8px;border-radius:12px;gap:8px;box-shadow:none}
.csp--compact .csp-dd{flex:1 1 100%;max-width:none}
.csp--compact .csp-ic{width:34px;height:34px}
.csp--compact .csp-val{font-size:17px}
.csp--compact .csp-panel{min-width:0}
.csp--compact .csp-list{grid-template-columns:repeat(auto-fill,minmax(64px,1fr));max-height:240px}
/* stroke change: 3D box fades in, download button glows once */
.cad-viewer.csp-swap{animation:cspSwap .55s ease-out}
.cad-dl-btn.csp-flash{animation:cspFlash 1.1s ease-out}
@keyframes cspRise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cspIn{from{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:none}}
@keyframes cspChip{from{opacity:0;transform:translateY(6px) scale(.96)}to{opacity:1;transform:none}}
@keyframes cspRoll{from{opacity:0;transform:translateY(100%)}to{opacity:1;transform:none}}
@keyframes cspShine{0%,70%{transform:translateX(-120%)}100%{transform:translateX(120%)}}
@keyframes cspPing{0%{box-shadow:0 0 0 0 rgba(34,197,94,.5)}100%{box-shadow:0 0 0 8px rgba(34,197,94,0)}}
@keyframes cspSwap{from{opacity:.35;transform:scale(.99)}to{opacity:1;transform:none}}
@keyframes cspFlash{0%{box-shadow:0 0 0 0 rgba(255,208,0,.75)}60%{box-shadow:0 0 0 12px rgba(255,208,0,0)}100%{box-shadow:none}}
@media (max-width:600px){.csp-dd{flex-basis:100%}.csp-meta{display:none}.csp-list{grid-template-columns:repeat(4,1fr)}.csp--compact .csp-list{grid-template-columns:repeat(4,1fr)}}
@media (prefers-reduced-motion:reduce){.csp,.csp-panel,.csp-chip,.csp-ic::after,.csp-dot,.csp-bump .csp-val span,.cad-viewer.csp-swap,.cad-dl-btn.csp-flash{animation:none}.csp-chev,.csp-btn,.csp-chip{transition:none}}
/* picker list must open above the 3D canvas; the hidden native select takes no space */
.csp{z-index:6}.csp.open{z-index:60}
.cad-stroke-pick.csp-on{position:relative;z-index:6}
.cad-stroke-pick.csp-on:has(.csp.open){z-index:60}
.cad-stroke-pick.csp-on>.cad-stroke-sel{min-width:0!important}
.cad-stroke-pick.csp-open{z-index:60}
@media (max-width:600px){.csp-chev{margin-left:auto}}
/* v51: message under the download button (only if a browser cannot save the file from disk) */
.cad-dl-note{margin:10px 0 0;padding:8px 12px;border-radius:8px;background:#fff7e0;border:1px solid #f2d27a;color:#5a4300;font:500 13px/1.45 Inter,Arial,sans-serif}
