/* Kit Studio v2 (3D kit designer). Linked from <head> only on pages that show the viewer. Mobile-first.
   Every height here is set by CSS (never by JS or by the 3D scene), so nothing shifts when the viewer wakes up. */
.k3sec { overflow-x: clip; }
html:not(.js) .k3sec { display: none; }
.k3 { --k3-ink: #11141B; --k3-line: var(--border, #E6E3E1); --k3-line2: var(--border-strong, #CFCAC6); --k3-mute: var(--text-subtle, #5B6270);
  position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--k3-line); border-radius: 16px; overflow: hidden; background: #fff; }
.k3 [hidden] { display: none !important; }

/* ---------------------------------------------------------------- stage */
.k3__stage { position: relative; flex: none; height: 300px; height: clamp(230px, 38svh, 380px); overflow: hidden; contain: layout paint; touch-action: pan-y; outline-offset: -3px;
  background: radial-gradient(ellipse 70% 62% at 50% 46%, #fff 0, #F1EEE9 62%, #E4DFD8 100%); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.k3__stage:focus-visible { outline: 3px solid var(--accent, #C4132F); }
.k3__poster { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .35s ease; }
.k3__poster svg { width: min(54%, 300px); height: auto; filter: drop-shadow(0 16px 20px rgba(17, 20, 27, .22)); }
.k3__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .45s ease; touch-action: pan-y; cursor: grab; }
.k3__canvas:active { cursor: grabbing; }
.k3.is-live .k3__canvas { opacity: 1; }
.k3.is-live .k3__poster { opacity: 0; visibility: hidden; }
.k3.is-lost .k3__canvas { opacity: 0; }
.k3.is-lost .k3__poster { opacity: 1; visibility: visible; }
.k3.is-loading .k3__poster svg { animation: k3pulse 1.1s ease-in-out infinite alternate; }
@keyframes k3pulse { to { opacity: .55; } }

.k3__hint { position: absolute; left: 12px; top: 12px; margin: 0; padding: 7px 12px; border-radius: 999px; background: rgba(17, 20, 27, .78); color: #fff; font: 600 .76rem/1 var(--font-body, system-ui); letter-spacing: .02em; pointer-events: none; transition: opacity .4s; white-space: nowrap; opacity: 0; max-width: calc(100% - 80px); }
.k3.is-live:not(.is-touched) .k3__hint { opacity: 1; }
.k3__hint-touch { display: none; }
@media (pointer: coarse) { .k3__hint-pc { display: none; } .k3__hint-touch { display: inline; } }

/* overlay controls */
.k3__tools { position: absolute; display: flex; gap: 8px; z-index: 2; }
.k3__tools--top { top: 10px; right: 10px; }
.k3__tools--side { top: 62px; right: 10px; flex-direction: column; }
.k3__tools--views { left: 50%; bottom: 10px; transform: translateX(-50%); gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .88); box-shadow: 0 0 0 1px var(--k3-line), 0 4px 14px rgba(17, 20, 27, .12); max-width: calc(100% - 24px); }
.k3-ico { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--k3-ink); box-shadow: 0 0 0 1px var(--k3-line), 0 3px 10px rgba(17, 20, 27, .14); cursor: pointer; transition: background .15s, color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.k3-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.k3-ico[aria-pressed="true"] { background: var(--k3-ink); color: #fff; }
.k3-ico:active { transform: scale(.94); }
.k3-vw { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--k3-ink); font: 700 .8rem/1 var(--font-body, system-ui); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.k3-vw:active { background: rgba(17, 20, 27, .1); }
@media (hover: hover) { .k3-vw:hover { background: rgba(17, 20, 27, .08); } .k3-ico:hover { background: #fff; } .k3-ico[aria-pressed="true"]:hover { background: #000; } }
.k3-ico:focus-visible, .k3-vw:focus-visible { outline: 3px solid var(--accent, #C4132F); outline-offset: 2px; }

.k3__tip { position: absolute; left: 12px; right: 66px; bottom: 58px; margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(17, 20, 27, .9); color: #fff; font-size: .86rem; line-height: 1.4; z-index: 2; pointer-events: none; }
.k3__load { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); min-height: 46px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--k3-ink); color: #fff; font: 700 .95rem var(--font-body, system-ui); cursor: pointer; z-index: 3; }
.k3__fail { position: absolute; inset: auto 12px 12px; margin: 0; padding: 10px 14px; border-radius: 8px; background: rgba(17, 20, 27, .88); color: #fff; font-size: .88rem; line-height: 1.4; z-index: 3; }

/* hotspots */
.k3__hot { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.k3-hot { position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: rgba(17, 20, 27, .88); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); cursor: pointer; pointer-events: auto; transition: opacity .2s, visibility .2s, background .2s; will-change: transform; -webkit-tap-highlight-color: transparent; touch-action: pan-y; }
.k3-hot::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.k3-hot i { position: absolute; inset: 0; }
.k3-hot i::before, .k3-hot i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; background: #fff; border-radius: 1px; transition: transform .2s; }
.k3-hot i::after { transform: rotate(90deg); }
.k3-hot.is-on { background: var(--accent, #C4132F); }
.k3-hot.is-on i::after { transform: rotate(0); }
.k3-hot.is-hid { opacity: 0; visibility: hidden; pointer-events: none; }
.k3-hot:focus-visible { outline: 3px solid var(--accent, #C4132F); outline-offset: 3px; }
.k3:not(.is-touched) .k3-hot:not(.is-on)::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(17, 20, 27, .5); animation: k3ring 2s ease-out 3; pointer-events: none; }
@keyframes k3ring { from { transform: scale(.7); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }

/* ---------------------------------------------------------------- side: tabs, panes, call to action */
.k3__side { display: flex; flex-direction: column; min-width: 0; border-top: 1px solid var(--k3-line); }
.k3__panel { display: flex; flex-direction: column; min-width: 0; }
.k3__panel[inert] .k3__body { background: var(--bg-soft, #F6F5F4); }
.k3__panel[inert] .k3-chip, .k3__panel[inert] .k3-btn { color: var(--k3-mute); }

.k3__tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--k3-line); background: #fff; -webkit-overflow-scrolling: touch; }
.k3__tabs::-webkit-scrollbar { display: none; }
.k3__tab { flex: 1 0 auto; min-height: 48px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--k3-mute); font: 700 .86rem/1 var(--font-body, system-ui); letter-spacing: .02em; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.k3__tab[aria-selected="true"] { color: var(--k3-ink); border-bottom-color: var(--accent, #C4132F); }
.k3__tab:focus-visible { outline: 3px solid var(--accent, #C4132F); outline-offset: -3px; }

.k3__body { height: 200px; height: clamp(190px, 27svh, 240px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.k3__pane { display: grid; gap: 16px; align-content: start; }
.k3__grp { margin: 0; padding: 0; border: 0; min-width: 0; }
.k3__grp legend { padding: 0; margin: 0 0 8px; font: 700 .7rem/1 var(--font-body, system-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--k3-mute); }
.k3__row { display: flex; flex-wrap: wrap; gap: 8px; }
.k3__row--sw { gap: 8px; align-items: center; }
.k3__row--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px; -webkit-overflow-scrolling: touch; }
.k3__row--scroll::-webkit-scrollbar { display: none; }
.k3__row--scroll > * { flex: none; }
.k3__row--checks { gap: 8px; }
.k3__note { margin: 0; font-size: .82rem; line-height: 1.45; color: var(--k3-mute); }

.k3-chip, .k3-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--k3-line2); border-radius: 999px; background: #fff; color: var(--text-primary, #16181F); font: 600 .88rem/1 var(--font-body, system-ui); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.k3-chip--sm { min-height: 40px; padding: 0 13px; font-size: .84rem; }
.k3-chip:active, .k3-btn:active { transform: scale(.97); }
.k3-chip[aria-pressed="true"], .k3-btn.is-on { background: var(--k3-ink); border-color: var(--k3-ink); color: #fff; }
.k3-btn:disabled { opacity: .45; cursor: default; }
.k3-btn--wide { width: 100%; background: var(--k3-ink); border-color: var(--k3-ink); color: #fff; }
.k3-chip:focus-visible, .k3-btn:focus-visible, .k3-sw:focus-visible, .k3-field input:focus-visible, .k3-field select:focus-visible, .k3-field textarea:focus-visible, .k3-pick input:focus-visible, .k3-check input:focus-visible, .k3-range input:focus-visible { outline: 3px solid var(--accent, #C4132F); outline-offset: 2px; }
@media (hover: hover) { .k3-chip:not([aria-pressed="true"]):hover, .k3-btn:not(:disabled):not(.k3-btn--wide):hover { border-color: var(--k3-ink); } }
.k3__row--act .k3-btn { flex: 1 1 auto; padding: 0 14px; }

.k3-sw { position: relative; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 2px solid #fff; cursor: pointer; box-shadow: 0 0 0 1px var(--k3-line2); background: var(--c, #ccc); -webkit-tap-highlight-color: transparent; }
.k3-sw--set { background: linear-gradient(135deg, var(--m) 0 52%, var(--a) 52% 82%, var(--t) 82%); width: 44px; height: 44px; }
.k3-sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--k3-ink); }

.k3-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 4px; border: 1px solid var(--k3-line2); border-radius: 999px; background: #fff; font: 600 .84rem var(--font-body, system-ui); cursor: pointer; }
.k3-pick input { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.k3-pick input::-webkit-color-swatch-wrapper { padding: 0; }
.k3-pick input::-webkit-color-swatch { border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--k3-line2); }
.k3-pick input::-moz-color-swatch { border: 2px solid #fff; border-radius: 50%; }

.k3__inputs { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 12px; }
.k3-field { display: grid; gap: 6px; min-width: 0; }
.k3-field > span { font: 700 .7rem/1.25 var(--font-body, system-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--k3-mute); }
.k3-field input, .k3-field select, .k3-field textarea { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--field-border, #8A847F); border-radius: 8px; background: #fff; color: var(--text-primary, #16181F); font: 600 16px/1.3 var(--font-body, system-ui); letter-spacing: .02em; }
.k3-field input[data-bind="team"], .k3-field input[data-bind="name"], .k3-field input[data-bind="number"] { text-transform: uppercase; letter-spacing: .04em; }
.k3-field textarea { padding: 10px 14px; resize: vertical; min-height: 64px; }
.k3-field--num input { text-align: center; }
.k3-check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--k3-line2); border-radius: 999px; background: #fff; font: 600 .84rem/1 var(--font-body, system-ui); cursor: pointer; }
.k3-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--k3-ink); }
.k3-check:has(input:checked) { border-color: var(--k3-ink); box-shadow: 0 0 0 1px var(--k3-ink); }
.k3-range label { display: flex; justify-content: space-between; margin-bottom: 4px; font: 700 .7rem/1 var(--font-body, system-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--k3-mute); }
.k3-range input { width: 100%; height: 36px; accent-color: var(--k3-ink); }

.k3__cta { display: grid; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--k3-line); background: #fff; }
.k3__cta .btn { width: 100%; text-align: center; justify-content: center; }
.k3__cta p { margin: 0; font-size: .78rem; line-height: 1.45; color: var(--k3-mute); }

/* ---------------------------------------------------------------- wider screens: stage on the left, sticky */
@media (min-width: 768px) {
  .k3 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: start; border: 0; border-radius: 0; background: none; overflow: visible; gap: clamp(20px, 3vw, 36px); }
  .k3__stage { height: auto; aspect-ratio: 1 / 1; max-height: min(78svh, 680px); width: 100%; border: 1px solid var(--k3-line); border-radius: 16px; position: sticky; top: calc(var(--header-h, 72px) + 16px); }
  html.hdr-hide .k3__stage { top: 16px; }
  .k3__stage { transition: top .28s ease; }
  .k3__side { border: 1px solid var(--k3-line); border-radius: 16px; overflow: hidden; background: #fff; }
  .k3__body { height: 340px; }
  .k3__tab { flex: 1 1 0; padding: 0 6px; }
}
@media (min-width: 768px) and (max-width: 1000px) { .k3__tab { font-size: .8rem; padding: 0 4px; } }

/* phones held sideways: two columns, short card */
@media (max-height: 520px) and (orientation: landscape) {
  .k3:not(.is-full) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--k3-line); border-radius: 16px; overflow: hidden; background: #fff; gap: 0; }
  .k3:not(.is-full) .k3__stage { height: min(86svh, 420px); max-height: none; aspect-ratio: auto; position: relative; top: auto; border: 0; border-radius: 0; }
  .k3:not(.is-full) .k3__side { border: 0; border-left: 1px solid var(--k3-line); border-radius: 0; }
  .k3:not(.is-full) .k3__body { height: calc(min(86svh, 420px) - 48px - 106px); min-height: 110px; }
}

/* ---------------------------------------------------------------- full screen studio */
html.k3-lock { overflow: hidden; overscroll-behavior: none; }
.k3.is-full .k3__stage, .k3.is-full .k3__canvas { touch-action: none; }
.k3.is-full { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; border: 0; border-radius: 0; background: #fff; overflow: hidden; max-height: none; overscroll-behavior: contain; touch-action: none; }
.k3.is-full .k3__stage { flex: 1 1 auto; min-height: 140px; height: auto; max-height: none; aspect-ratio: auto; position: relative; top: auto; border: 0; border-radius: 0; }
.k3.is-full .k3__side { flex: none; border: 0; border-top: 1px solid var(--k3-line); border-radius: 0; max-height: 70%; overflow: auto; }
.k3.is-full .k3__body { height: clamp(150px, 26dvh, 280px); }
@media (min-width: 900px), (max-height: 520px) and (orientation: landscape) {
  .k3.is-full { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 44%); }
  .k3.is-full .k3__stage { height: 100%; }
  .k3.is-full .k3__side { max-height: none; height: 100%; border-top: 0; border-left: 1px solid var(--k3-line); display: flex; flex-direction: column; }
  .k3.is-full .k3__panel { flex: 1 1 auto; min-height: 0; }
  .k3.is-full .k3__body { flex: 1 1 auto; height: auto; min-height: 0; }
}

/* phone keyboard open: keep a slice of the model in view while typing */
@media (max-width: 767px) {
  .k3.is-typing .k3__stage { height: 130px; min-height: 0; }
  .k3.is-typing .k3__hint, .k3.is-typing .k3__tools--side, .k3.is-typing .k3__tools--views, .k3.is-typing .k3__tip { display: none; }
  html.k3-typing .mobile-cta { display: none !important; }
}

/* ---------------------------------------------------------------- failure and small screens */
.k3.is-failed .k3__panel { display: none; }
.k3.is-failed .k3__stage { height: auto; aspect-ratio: 16 / 10; }
.k3.is-failed .k3__tools, .k3.is-failed .k3__hint { display: none; }
@media (max-width: 380px) { .k3__tab { padding: 0 6px; font-size: .78rem; } .k3-chip { padding: 0 13px; } .k3__inputs { grid-template-columns: minmax(0, 1fr) 80px; } .k3__body { padding-inline: 12px; } .k3__row--scroll { margin-inline: -12px; padding-inline: 12px; } }
@media (max-width: 440px) { .k3__tab { padding: 0 5px; font-size: .78rem; letter-spacing: 0; } .k3__tools--side { top: 56px; gap: 6px; } .k3-ico { width: 40px; height: 40px; } }
@media (pointer: coarse) { .k3-vw { min-height: 40px; } .k3-sw { width: 42px; height: 42px; } .k3-check, .k3-pick { min-height: 44px; } }
.k3:not(.is-ready) .k3__tools, .k3:not(.is-ready) .k3__hint { visibility: hidden; }
.k3__skel { height: 48px; border-bottom: 1px solid var(--k3-line); }
.k3__skel + .k3__body, .k3__panel > .k3__skel:only-child { }
.k3__panel:has(> .k3__skel)::after { content: ""; display: block; height: 200px; height: clamp(190px, 27svh, 240px); background: var(--bg-soft, #F6F5F4); }
@media (min-width: 768px) { .k3__panel:has(> .k3__skel)::after { height: 340px; } }
@media (prefers-reduced-motion: reduce) { .k3-hot::after, .k3.is-loading .k3__poster svg { animation: none !important; } .k3__canvas, .k3__poster, .k3-chip, .k3-ico { transition: none; } }
@media print { .k3sec { display: none; } }

/* ---------------------------------------------------------------- method switch: 3D designer / own photo / send us your design */
.k3__mode { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.k3-mode { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--border-strong, #CFCAC6); border-radius: 999px; background: #fff; color: var(--text-primary, #16181F); font: 700 .9rem/1.1 var(--font-body, system-ui); cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.k3-mode[aria-pressed="true"] { background: #11141B; border-color: #11141B; color: #fff; }
.k3-mode--help { border-color: var(--accent, #C4132F); color: var(--accent, #C4132F); }
.k3-mode:focus-visible { outline: 3px solid var(--accent, #C4132F); outline-offset: 2px; }
@media (hover: hover) { .k3-mode:not([aria-pressed="true"]):hover { border-color: #11141B; } }
@media (max-width: 520px) { .k3__mode { display: grid; grid-template-columns: 1fr 1fr; } .k3-mode--help { grid-column: 1 / -1; } .k3-mode { padding: 0 10px; font-size: .86rem; } }

/* ---------------------------------------------------------------- photo studio */
.k3p .k3__stage { background: #EDEAE5 repeating-conic-gradient(#E4E0DA 0 25%, #EDEAE5 0 50%) 0 0 / 22px 22px; }
.k3p.is-picking .k3__canvas { cursor: crosshair; }
.k3p__canvas { cursor: default; opacity: 1; }
.k3p__empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 16px; text-align: center; background: rgba(247, 245, 242, .94); z-index: 1; }
.k3p.has-photo .k3p__empty { display: none; }
.k3p__lead { margin: 0; max-width: 28ch; font: 600 1rem/1.4 var(--font-body, system-ui); color: var(--text-primary, #16181F); }
.k3p__open { width: auto; min-width: 200px; }
.k3p__or { margin: 4px 0 0; font-size: .82rem; color: var(--k3-mute); }
.k3p__samples { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.k3p__sample { width: 64px; height: 64px; padding: 0; border: 2px solid #fff; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--k3-line2); cursor: pointer; }
.k3p__sample img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k3p__sample:focus-visible { outline: 3px solid var(--accent, #C4132F); outline-offset: 2px; }
.k3p__tip { top: 12px; bottom: auto; right: 66px; }
.k3p__top { top: 10px; right: 10px; }
.k3p__selbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: 0 0 0 1px var(--k3-line), 0 4px 14px rgba(17, 20, 27, .14); max-width: calc(100% - 20px); }
.k3p__add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.k3-dot { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(17, 20, 27, .35); }
.k3-x { margin-left: 8px; padding: 0 4px; font-size: 1.1rem; line-height: 1; }
.k3-check--wide { width: 100%; border-radius: 12px; padding: 10px 12px; line-height: 1.3; }
.k3-range small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.k3[hidden] { display: none !important; }
.k3-btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.k3-field > label > span, .k3-field > label { display: block; }
.k3-field > label > span { font: 700 .7rem/1.25 var(--font-body, system-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--k3-mute); }
