.detail-dialog { overflow:hidden; }
.detail-shell {
  height:min(610px, calc(100dvh - 50px));
  min-height:0;
  grid-template-rows:minmax(0, 1fr);
}
.detail-stage { min-height:0; }
.detail-info {
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#ccd9e9 transparent;
  scroll-padding-block:24px;
}
.detail-render {
  position:absolute;
  top:111px;
  left:50%;
  width:min(75%, 340px, max(96px, calc((100dvh - 245px) * .923)));
  aspect-ratio:12/13;
  transform:translateX(-50%);
  container-type:inline-size;
  isolation:isolate;
  pointer-events:none;
}
.detail-render .detail-image,
.custom-fabric {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  transform:none;
}
.custom-fabric { filter:drop-shadow(0 14px 15px #0a204638); }
.detail-render.has-custom-fabric .detail-image { opacity:0; }
.customizer-overlay {
  position:absolute;
  inset:0;
  pointer-events:none;
  mask-image:var(--custom-garment-mask, none);
  mask-position:center;
  mask-size:100% 100%;
  mask-repeat:no-repeat;
}
.custom-logo-preview,
.custom-text-preview {
  position:absolute;
  left:50%;
  transform:translate(-50%, -50%) rotate(var(--custom-rotation, 0deg));
}
.custom-logo-preview {
  top:37%;
  width:17%;
  max-height:40%;
  object-fit:contain;
}
.custom-text-preview {
  top:59%;
  width:max-content;
  max-width:78%;
  color:#fff;
  font:700 5cqw/1.08 var(--body);
  text-align:center;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.custom-fabric[hidden],
.custom-logo-preview[hidden],
.custom-text-preview[hidden] { display:none; }

.customizer {
  margin:0 0 11px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--paper);
}
.customizer summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:46px;
  padding:9px 12px;
  border-radius:inherit;
  color:var(--accent);
  font-size:.86rem;
  font-weight:700;
  cursor:pointer;
  list-style:none;
}
.customizer summary::-webkit-details-marker { display:none; }
.customizer summary::marker { content:""; }
.customizer summary:hover { background:#edf3fa; }
.customizer-summary-end { display:flex; align-items:center; flex-shrink:0; gap:9px; }
.customizer-design-state { color:var(--muted); font-size:.7rem; font-weight:600; }
.customizer-disclosure {
  width:8px;
  height:8px;
  border-right:1px solid currentColor;
  border-bottom:1px solid currentColor;
  transform:translateY(-2px) rotate(45deg);
}
.customizer[open] .customizer-disclosure { transform:translateY(2px) rotate(225deg); }
.customizer-controls { padding:0 12px 10px; }
.customizer-tabs {
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:3px;
  min-width:0;
  margin:0 0 13px;
  padding:3px;
  border:1px solid var(--line);
  border-radius:5px;
  background:var(--surface);
}
.customizer-tabs label {
  padding:7px 4px;
  border-radius:3px;
  color:var(--muted);
  font-weight:700;
  font-size:.78rem;
  text-align:center;
  cursor:pointer;
}
.customizer-tabs input:checked + label { background:var(--accent); color:#fff; }
.customizer-tabs input:focus-visible + label,
.customizer :is(summary, input, select):focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.customizer-panel { display:none; }
.customizer-controls:has(#custom-tab-fabric:checked) [data-custom-panel="fabric"],
.customizer-controls:has(#custom-tab-logo:checked) [data-custom-panel="logo"],
.customizer-controls:has(#custom-tab-text:checked) [data-custom-panel="text"] {
  display:grid;
  gap:9px;
}
.customizer-color-row,
.customizer-upload-row {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px 8px;
}
.customizer-panel label {
  color:var(--ink);
  font-size:.79rem;
  font-weight:700;
}
.customizer-color-row label,
.customizer-upload-row label { flex:1 1 auto; }
.customizer input[type="color"] {
  width:36px;
  height:34px;
  padding:3px;
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:4px;
  background:var(--surface);
  cursor:pointer;
}
.customizer-link {
  padding:4px 1px;
  border:0;
  background:none;
  color:var(--accent);
  font-size:.74rem;
  font-weight:700;
  text-decoration:underline;
  text-underline-offset:3px;
}
.customizer-link:disabled { color:var(--muted); opacity:.68; }
.customizer-upload-row input,
.customizer-text-field input,
.customizer-select-field select {
  display:block;
  width:100%;
  min-width:0;
  padding:6px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:4px;
  background:var(--surface);
  color:var(--ink);
  font:400 .83rem/1.3 var(--body);
}
.customizer-upload-row input::file-selector-button {
  padding:5px 6px;
  margin-right:6px;
  border:0;
  border-radius:3px;
  background:#e8f0fa;
  color:var(--accent);
  font:700 .75rem/1 var(--body);
  cursor:pointer;
}
.customizer-upload-row small,
.customizer-side-note,
.customizer-status { color:var(--muted); font-size:.72rem; line-height:1.35; }
.customizer-text-field input { margin-top:5px; padding:8px 9px; font-size:1rem; }
.customizer-select-field { min-width:0; }
.customizer-select-field select { min-height:34px; margin-top:4px; padding-inline:7px 4px; }
.customizer-type-row {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.customizer-sliders {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:2px 12px;
  padding-top:4px;
}
.customizer-sliders label {
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  gap:0 3px;
  font-size:.73rem;
}
.customizer-slider-wide { grid-column:1/-1; }
.customizer-sliders output { color:var(--muted); font:500 .69rem/1 var(--mono); }
.customizer-sliders input {
  grid-column:1/-1;
  width:100%;
  height:26px;
  margin:0;
  accent-color:var(--accent);
  cursor:pointer;
}
.customizer-bottom { padding-top:9px; margin-top:7px; border-top:1px solid var(--line); }
.customizer-status:not(:empty) { margin-top:6px; }
.customizer-footer-actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:4px 7px;
  margin-top:9px;
}
.customizer-download {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:36px;
  padding:5px 9px;
  border:1px solid #ccd9e9;
  border-radius:4px;
  background:var(--surface);
  color:var(--accent);
  font-size:.77rem;
  font-weight:700;
}
.customizer-download:hover:not(:disabled) { background:#edf3fa; border-color:var(--accent); }
.customizer-download:disabled { opacity:.65; }
.customizer-download-icon {
  position:relative;
  width:12px;
  height:13px;
  border-bottom:1px solid currentColor;
}
.customizer-download-icon::before,
.customizer-download-icon::after { content:""; position:absolute; }
.customizer-download-icon::before { left:5px; top:0; height:8px; border-left:1px solid currentColor; }
.customizer-download-icon::after {
  left:3px;
  top:4px;
  width:5px;
  height:5px;
  border-right:1px solid currentColor;
  border-bottom:1px solid currentColor;
  transform:rotate(45deg);
}

.bag-customization { display:block; color:var(--muted); font-size:.77rem; overflow-wrap:anywhere; }
.bag-summary #bag-storage-status { margin:8px 0 0; color:var(--muted); font-size:.8rem; }
.bag-summary #bag-storage-status:empty { display:none; }

@media(max-width:760px) {
  .detail-shell { height:min(610px, calc(100dvh - 30px)); }
  .detail-render { top:117px; width:min(88%, 330px, max(96px, calc((100dvh - 231px) * .923))); }
}
@media(max-width:540px) {
  .detail-dialog { height:min(742px, calc(100dvh - 28px)); }
  .detail-shell {
    --preview-height:clamp(190px, 38dvh, 292px);
    display:grid;
    height:100%;
    grid-template-columns:minmax(0, 1fr);
    grid-template-rows:var(--preview-height) minmax(0, 1fr);
  }
  .detail-stage { min-height:0; }
  .detail-rail { top:41px; }
  .detail-hanger { top:43px; }
  .detail-render { top:67px; width:min(63%, calc((var(--preview-height) - 112px) * .923)); }
  .detail-navigation { inset-block-start:46%; }
  .angle-switch { bottom:7px; }
  .angle-switch button { padding:6px 14px; }
  .customizer-select-field select { font-size:1rem; }
}
