/* Product viewer: CSS scenes, shared controls and no additional image downloads. */
html[data-theme] body[data-view=products][data-category] :is(.product-model-stage,.product-model-dialog-stage){
  --view-top:#f4f5f4;--view-bottom:#dfe4e5;--view-light:#ffffffc9;--view-accent:#c5d7e33d;
  background:radial-gradient(ellipse at 48% 18%,var(--view-light),transparent 70%),radial-gradient(ellipse at 95% 85%,var(--view-accent),transparent 62%),linear-gradient(155deg,var(--view-top),var(--view-bottom));
  background-size:auto;background-blend-mode:normal;isolation:isolate;
}
html[data-theme=dark] body[data-view=products][data-category] :is(.product-model-stage,.product-model-dialog-stage){--view-top:#26333d;--view-bottom:#17222b;--view-light:#7593a326;--view-accent:#7ca7c215}
html[data-theme] body[data-view=products][data-category] :is(.product-model-stage,.product-model-dialog-stage)::before,
html[data-theme] body[data-view=products][data-category] :is(.product-model-stage,.product-model-dialog-stage)::after{content:none}
html[data-theme] body[data-view=products][data-category] .product-model-stage>.printpb-model{inset:0 0 45px;top:0;width:100%;height:calc(100% - 45px);opacity:0;transition:opacity .32s ease;--poster-color:transparent}
html[data-theme] body[data-view=products][data-category] .printpb-model.is-model-ready{opacity:1}
html[data-theme] body[data-view=products][data-category] .product-model-stage>.model-gesture-hint{left:10px;top:9px;padding:5px 9px;width:auto;border:1px solid var(--ui-line);border-radius:7px;box-shadow:none;background:var(--ui-surface);color:var(--ui-muted);font-size:10px;opacity:.92}
html[data-theme] body[data-view=products][data-category] .model-gesture-hint :is(.model-gesture-icon,strong+span){display:none}
html[data-theme] body[data-view=products][data-category] .model-gesture-hint strong{font-size:10px;font-weight:550;line-height:1.4}
html[data-theme] body[data-view=products][data-category] .product-model-stage>.model-toolbar{bottom:5px;width:auto;max-width:calc(100% - 12px)}
html[data-theme] body[data-view=products][data-category] .model-toolbar .model-angles{display:flex;flex-wrap:nowrap;gap:2px;width:auto;padding:3px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-surface);color:var(--ui-muted);box-shadow:0 2px 8px #12283a08}
html[data-theme] body[data-view=products][data-category] .model-angles button{min-width:54px;width:auto;height:32px;min-height:32px;padding:6px 10px;font-family:inherit;font-size:11px;font-weight:600;line-height:1.2;white-space:nowrap;border-radius:7px;transition:background .18s,color .18s}
html[data-theme] body[data-view=products][data-category] .model-angles button[aria-pressed=true]{background:var(--ui-soft);color:var(--ui-accent)}
html[data-theme] body[data-view=products][data-category] .product-model-note{margin:9px 2px 0;padding:8px 10px;border-radius:8px;background:var(--ui-soft);color:var(--ui-muted);font-size:12px;line-height:1.55}
html[data-theme] body[data-view=products][data-category] .model-load-cover{position:absolute;inset:0;z-index:5;display:grid;place-items:center;background:var(--ui-soft);color:var(--ui-ink)}
html[data-theme] body[data-view=products][data-category] .model-load-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.45}
html[data-theme] body[data-view=products][data-category] .model-load-panel{position:relative;width:min(280px,calc(100% - 32px));padding:15px 18px;border:1px solid var(--ui-line);border-radius:13px;background:var(--ui-surface);box-shadow:0 6px 24px #132b3b0d;text-align:center}
html[data-theme] body[data-view=products][data-category] .model-load-panel p{margin:0;color:var(--ui-muted);font-size:12px;line-height:1.6}
html[data-theme] body[data-view=products][data-category] .model-load-track{height:3px;margin-top:12px;border-radius:4px;background:var(--ui-soft);overflow:hidden}
html[data-theme] body[data-view=products][data-category] .model-load-track span{display:block;width:0;height:100%;border-radius:inherit;background:var(--ui-accent);transition:width .25s ease}
html[data-theme] body[data-view=products][data-category] .model-load-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:14px}
html[data-theme] body[data-view=products][data-category] .model-load-actions button{min-height:44px;padding:9px 12px;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-soft);color:var(--ui-ink);font-family:inherit;font-size:12px;font-weight:600;line-height:1.4;cursor:pointer}
html[data-theme] body[data-view=products][data-category] .product-model-dialog{--viewer-surface:var(--ui-surface,#fff);position:fixed;inset:0;width:calc(100vw - 64px);max-width:1240px;height:calc(100dvh - 48px);max-height:960px;margin:auto;padding:20px;overflow:hidden;border:1px solid var(--ui-line);border-radius:24px;background:var(--viewer-surface);color:var(--ui-ink);box-shadow:0 24px 90px #0818223d}
html[data-theme] body[data-view=products][data-category] .product-model-dialog[open]{display:flex;flex-direction:column;gap:16px;animation:model-dialog-enter .24s cubic-bezier(.2,.7,.3,1)}
html[data-theme] body[data-view=products][data-category] .product-model-dialog::backdrop{background:#0a1727b0}
html[data-theme] body[data-view=products][data-category] .product-model-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:0 2px}
html[data-theme] body[data-view=products][data-category] .product-model-heading{min-width:0}
html[data-theme] body[data-view=products][data-category] .model-dialog-eyebrow{margin:0 0 5px;color:var(--ui-accent);font-size:10px;font-weight:700;line-height:1.4;letter-spacing:.13em;text-transform:uppercase}
html[data-theme] body[data-view=products][data-category] .product-model-dialog-head h2{margin:0;color:var(--ui-ink);font-size:clamp(18px,2vw,23px);font-weight:700;line-height:1.3;letter-spacing:-.025em;overflow-wrap:anywhere}
html[data-theme] body[data-view=products][data-category] .product-model-close{display:grid;place-items:center;flex:none;width:44px;height:44px;min-width:44px;padding:0;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-soft);color:var(--ui-muted);font-size:19px;font-weight:400;cursor:pointer}
html[data-theme] body[data-view=products][data-category] .product-model-dialog-stage{flex:1;display:block;min-height:160px;border:1px solid var(--ui-line);border-radius:17px;overflow:hidden}
html[data-theme] body[data-view=products][data-category] .product-model-dialog-stage>.printpb-model{position:absolute;inset:0;width:100%;height:100%;min-height:0;opacity:0;transition:opacity .32s ease;--poster-color:transparent}
html[data-theme] body[data-view=products][data-category] .product-model-dialog-stage>.printpb-model.is-model-ready{opacity:1}
html[data-theme] body[data-view=products][data-category] .product-model-dialog-stage .model-load-photo{object-fit:contain;inset:5%;width:90%;height:90%;opacity:.65}
html[data-theme] body[data-view=products][data-category] .model-dialog-dock{display:flex;flex-direction:column;gap:12px;flex:none;padding:0 2px}
html[data-theme] body[data-view=products][data-category] .model-dialog-tools:empty{display:none}
html[data-theme] body[data-view=products][data-category] .model-dialog-tools>.model-toolbar{position:static;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px;width:100%;max-width:none;transform:none}
html[data-theme] body[data-view=products][data-category] .model-dialog-tools .model-angles{border:0;padding:0;background:var(--ui-soft);border-radius:11px;box-shadow:none}
html[data-theme] body[data-view=products][data-category] .model-dialog-tools .model-angles button{min-width:80px;min-height:44px;height:44px;padding:10px 14px;font-size:12px}
html[data-theme] body[data-view=products][data-category] .model-camera-tools{display:flex;align-items:center;gap:5px}
html[data-theme] body[data-view=products][data-category] .model-camera-tools button{display:grid;place-items:center;min-width:44px;height:44px;padding:0 12px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-surface);color:var(--ui-ink);font-family:inherit;font-size:21px;font-weight:600;line-height:1;cursor:pointer;touch-action:manipulation;transition:background .18s}
html[data-theme] body[data-view=products][data-category] .model-camera-tools .model-auto-rotate{font-size:12px;min-width:66px}
html[data-theme] body[data-view=products][data-category] .model-camera-tools button[aria-pressed=true]{background:var(--ui-soft);border-color:var(--ui-accent);color:var(--ui-accent)}
html[data-theme] body[data-view=products][data-category] .model-dialog-options{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-top:12px;border-top:1px solid var(--ui-line)}
html[data-theme] body[data-view=products][data-category] .model-background-picker{align-self:auto;justify-content:flex-start;flex-wrap:nowrap;gap:10px;font-size:12px;color:var(--ui-muted)}
html[data-theme] body[data-view=products][data-category] .model-background-picker select{width:190px;max-width:55vw;min-height:44px;padding:8px 26px 8px 12px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-soft);color:var(--ui-ink);font-family:inherit;font-size:12px;font-weight:500;line-height:1.3}
html[data-theme] body[data-view=products][data-category] .model-keyboard-guide{display:none;margin:0;gap:12px;color:var(--ui-muted);font-size:11px}
html[data-theme] body[data-view=products][data-category] .model-keyboard-keys{grid-template-columns:repeat(3,18px);grid-template-rows:repeat(2,16px);gap:2px}
html[data-theme] body[data-view=products][data-category] .model-keyboard-keys kbd{font-size:10px;border-radius:3px;box-shadow:0 1px 0 var(--ui-line);background:var(--ui-soft);border-color:var(--ui-line);color:var(--ui-muted)}
html[data-theme] body[data-view=products][data-category] .model-keyboard-keys .key-up{grid-column:2;grid-row:1}
html[data-theme] body[data-view=products][data-category] .model-keyboard-keys .key-left{grid-column:1;grid-row:2}
html[data-theme] body[data-view=products][data-category] .model-keyboard-keys .key-down{grid-column:2;grid-row:2}
html[data-theme] body[data-view=products][data-category] .model-keyboard-keys .key-right{grid-column:3;grid-row:2}
html[data-theme] body[data-view=products][data-category] .model-keyboard-keys kbd.is-held{background:var(--ui-accent);color:var(--ui-surface);transform:translateY(1px)}
html[data-theme] body[data-view=products][data-category] .product-model-dialog-guide{margin:0;color:var(--ui-muted);font-size:11px;line-height:1.5;text-align:center}
html[data-theme] body[data-view=products][data-category] .product-model-dialog .model-detail{max-width:380px;max-height:calc(100% - 24px);border-color:var(--ui-line);background:var(--ui-surface);color:var(--ui-ink)}
@media(min-width:768px) and (hover:hover) and (pointer:fine){html[data-theme] body[data-view=products][data-category] .model-keyboard-guide{display:flex}}
@media(hover:hover){html[data-theme] body[data-view=products][data-category] :is(.model-angles button,.model-camera-tools button,.product-model-close,.model-load-actions button):hover{background:var(--ui-soft);color:var(--ui-accent)}}
@media(max-width:767px){
  html[data-theme] body[data-view=products][data-category] .product-model-dialog{width:100%;height:100dvh;max-height:none;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));border:0;border-radius:0}
  html[data-theme] body[data-view=products][data-category] .product-model-dialog[open]{gap:14px}
  html[data-theme] body[data-view=products][data-category] .product-model-dialog-head h2{font-size:18px}
  html[data-theme] body[data-view=products][data-category] .product-model-dialog-stage{border-radius:15px}
  html[data-theme] body[data-view=products][data-category] .model-dialog-tools>.model-toolbar{justify-content:space-between;gap:8px}
  html[data-theme] body[data-view=products][data-category] .model-dialog-tools .model-angles button{min-width:0;padding:8px 10px;font-size:11px}
  html[data-theme] body[data-view=products][data-category] .model-camera-tools{gap:4px}
  html[data-theme] body[data-view=products][data-category] .model-camera-tools button{min-width:42px;padding:0 9px}
  html[data-theme] body[data-view=products][data-category] .model-camera-tools .model-auto-rotate{min-width:48px;font-size:11px}
  html[data-theme] body[data-view=products][data-category] .model-dialog-options{padding-top:8px}
  html[data-theme] body[data-view=products][data-category] .model-background-picker{width:100%;justify-content:space-between}
  html[data-theme] body[data-view=products][data-category] .model-background-picker select{width:min(240px,70vw);max-width:none}
  html[data-theme] body[data-view=products][data-category] .model-dialog-dock{gap:9px}
  html[data-theme] body[data-view=products][data-category] .product-model-stage>.model-toolbar{bottom:4px}
  html[data-theme] body[data-view=products][data-category] .product-model-stage .model-angles button{min-height:38px;height:38px}
  html[data-theme] body[data-view=products][data-category] .product-model-stage>.printpb-model{inset:0 0 49px;height:calc(100% - 49px)}
}
@media(max-width:374px){html[data-theme] body[data-view=products][data-category] .model-dialog-tools>.model-toolbar{flex-wrap:wrap;justify-content:center}}
@media(max-height:520px) and (orientation:landscape){
  html[data-theme] body[data-view=products][data-category] .product-model-dialog[open]{display:grid;grid-template-columns:minmax(0,1fr) 230px;grid-template-rows:auto minmax(0,1fr);gap:10px;padding:12px}
  html[data-theme] body[data-view=products][data-category] .product-model-dialog-head{grid-column:1/-1}
  html[data-theme] body[data-view=products][data-category] .product-model-dialog-stage{height:100%;min-height:0}
  html[data-theme] body[data-view=products][data-category] .model-dialog-dock{align-self:center}
  html[data-theme] body[data-view=products][data-category] .model-dialog-tools>.model-toolbar{flex-wrap:wrap;justify-content:center}
  html[data-theme] body[data-view=products][data-category] .model-background-picker{flex-wrap:wrap;gap:4px}
  html[data-theme] body[data-view=products][data-category] .model-background-picker select{width:100%;max-width:100%}
  html[data-theme] body[data-view=products][data-category] .model-keyboard-guide{display:none}
}
@keyframes model-dialog-enter{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){html[data-theme] body[data-view=products][data-category] .product-model-dialog[open]{animation:none}html[data-theme] body[data-view=products][data-category] :is(.printpb-model,.model-load-track span,.model-angles button,.model-camera-tools button){transition:none}}
