:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.08);
  --hairline-strong: rgba(0, 0, 0, 0.16);
  --blue: #0071e3;
  --blue-pressed: #0066cc;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --tool-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden],
.is-hidden {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: #fff;
  color: var(--text);
}

button {
  font: inherit;
}

button,
[role="button"],
.shoe-scene,
.shoe-art,
.mvp-shoe-frame {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  padding: 22px clamp(16px, 3vw, 40px) 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  object-fit: contain;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 10px);
  flex: 0 0 auto;
}

.top-actions .glass-button,
.top-actions .primary-button {
  min-height: clamp(34px, 3vw, 40px);
  padding: 0 clamp(12px, 1.25vw, 18px);
  font-size: clamp(12px, 1.05vw, 15px);
  line-height: 1.15;
  white-space: nowrap;
}

.top-actions .icon-button {
  width: clamp(34px, 3vw, 40px);
  height: clamp(34px, 3vw, 40px);
  font-size: clamp(16px, 1.5vw, 20px);
}

.icon-button,
.primary-button,
.glass-button,
.text-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.icon-button:active,
.primary-button:active,
.glass-button:active,
.text-button:active,
.home-model-card:active,
.effect-option-card:active,
.model-pill:active,
.part-button:active,
.swatch-button:active,
.texture-button:active {
  transform: scale(0.98);
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: var(--tool-radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 20px;
}

.primary-button {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.28);
}

.primary-button:hover {
  background: var(--blue-pressed);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
}

.home-view {
  display: grid;
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
}

.home-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(170px, 20vh, 230px);
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.58)),
    linear-gradient(145deg, rgba(248, 249, 252, 0.96), rgba(236, 238, 242, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(122deg, rgba(255, 255, 255, 0) 0 45%, color-mix(in srgb, var(--home-accent-a, #8ed8ff) 18%, transparent) 46% 62%, rgba(255, 255, 255, 0) 63%),
    linear-gradient(28deg, color-mix(in srgb, var(--home-accent-b, #ad94ff) 10%, transparent), rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
}

.home-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  width: min(860px, 100%);
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
  text-align: center;
}

.home-copy h2 {
  max-width: 720px;
  min-width: 0;
  margin: 0;
  font-size: clamp(32px, 3.8vw, 50px);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.home-copy p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.55;
}

.home-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

.home-meta span {
  padding: 7px 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #3b3b3f;
  font-size: 13px;
  font-weight: 800;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}


/* Carousel styles */
.carousel-container {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #f5f5f7;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 1;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

.carousel-indicators {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.indicator.active {
  background: #fff;
  transform: scale(1.2);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.home-showcase {
  display: none;
}

.home-orbit {
  position: absolute;
  width: min(92%, 720px);
  aspect-ratio: 1.9;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  transform: rotate(-8deg);
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.18) 58%, transparent 70%);
}

.home-shoe-art {
  position: relative;
  width: min(105%, 860px);
  aspect-ratio: 2401 / 1601;
  filter: drop-shadow(0 28px 36px rgba(0, 0, 0, 0.14));
  transform: translateX(-2%) translateY(2%);
}

.home-picker {
  display: grid;
  gap: 14px;
  padding: 2px 0 10px;
}

.home-product-grid {
  --product-gap: 18px;
  display: grid;
  grid-template-columns: repeat(var(--product-columns, 1), minmax(0, 1fr));
  gap: var(--product-gap);
  width: min(100%, var(--product-grid-width, 100%));
  margin: 0 auto;
}

.home-model-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  justify-items: center;
  gap: 9px;
  min-height: 0;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent-a) 24%, transparent), transparent 54%);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.06);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.home-model-card[aria-pressed="true"] {
  border-color: rgba(0, 113, 227, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.74)),
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent-b) 28%, transparent), transparent 58%);
  box-shadow: 0 16px 42px rgba(0, 113, 227, 0.14);
}

.home-card-title {
  min-height: 32px;
  color: #1d1d1f;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.home-card-thumb {
  display: grid;
  width: min(100%, 280px);
  max-width: 280px;
  aspect-ratio: 1.28;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-a) 42%, #ffffff), color-mix(in srgb, var(--accent-b) 34%, #f5f5f7)),
    #f5f5f7;
}

.home-card-thumb--real {
  position: relative;
  width: min(100%, 320px);
  max-width: 320px;
  aspect-ratio: 3 / 2;
  place-items: stretch;
  background: #f5f5f7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.home-card-thumb > img {
  width: 108%;
  height: 108%;
  object-fit: contain;
  transform: translateY(3%);
  pointer-events: none;
}

.real-product-carousel {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: inherit;
}

.home-card-thumb--real .real-product-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.025);
  animation: real-product-slide var(--carousel-duration) ease-in-out infinite;
  animation-delay: var(--carousel-delay);
}

.real-product-slide:first-child,
.real-product-slide:only-child {
  opacity: 1;
}

.real-product-slide:only-child {
  animation: none;
  transform: none;
}

.real-product-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 2;
  display: flex;
  transform: translateX(-50%);
  gap: 6px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.real-product-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  animation: real-product-dot var(--carousel-duration) ease-in-out infinite;
  animation-delay: var(--carousel-delay);
}

@keyframes real-product-slide {
  0% {
    opacity: 0;
    transform: scale(1.025);
  }

  2.5%,
  12.5% {
    opacity: 1;
  }

  15.5%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes real-product-dot {
  0%,
  15.5%,
  100% {
    background: rgba(255, 255, 255, 0.58);
    transform: scale(1);
  }

  2.5%,
  12.5% {
    background: #fff;
    transform: scale(1.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-card-thumb--real .real-product-slide,
  .real-product-dots span {
    animation: none;
  }

  .home-card-thumb--real .real-product-slide {
    opacity: 0;
    transform: none;
  }

  .home-card-thumb--real .real-product-slide:first-child {
    opacity: 1;
  }

  .real-product-dots {
    display: none;
  }
}

.home-card-thumb .mvp-shoe-frame {
  width: 108%;
  height: auto;
  aspect-ratio: 2401 / 1601;
  transform: translateY(3%);
}

.home-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(0, 113, 227, 0.12);
}

.home-card-body {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 0;
}

.home-card-kicker,
.home-card-body > span:last-child,
.home-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.home-card-kicker {
  font-weight: 800;
}

.home-card-body strong {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.05;
}

.home-card-body > span:last-child {
  display: none;
  max-width: 520px;
  line-height: 1.45;
}

.home-card-meta {
  padding: 7px 11px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.workspace-topbar,
.preview-stage,
.customizer {
  min-height: calc(100vh - 122px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
}

.preview-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(420px, 1fr) auto;
  overflow: hidden;
}

.model-strip {
  display: flex;
  gap: 8px;
  min-height: 70px;
  padding: 18px 18px 10px;
  overflow-x: auto;
}

.model-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 192px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  cursor: pointer;
}

.model-pill[aria-pressed="true"] {
  border-color: rgba(0, 113, 227, 0.5);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.12);
}

.model-thumb {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--thumb-a), var(--thumb-b));
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.model-pill strong,
.model-pill span {
  display: block;
  white-space: nowrap;
}

.model-pill strong {
  font-size: 14px;
}

.model-pill span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.view-tools {
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.segment-button {
  min-width: 76px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.segment-button[aria-selected="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.glass-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.shoe-scene {
  position: relative;
  display: grid;
  min-height: 420px;
  place-items: center;
  container: shoe-scene / size;
  padding: 20px;
  --shoe-fit-scale: 0.94;
  --shoe-max-width: 920px;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.shoe-scene:active {
  cursor: grabbing;
}

.shoe-scene::before {
  content: "";
  position: absolute;
  inset: 56px 6% 40px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.18) 56%, transparent 72%);
}

.shoe-shadow {
  position: absolute;
  bottom: clamp(2px, 0.8vh, 6px);
  left: 50%;
  z-index: 0;
  width: min(58%, 560px);
  height: clamp(28px, 4vh, 34px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.035) 58%, transparent 74%);
  filter: blur(8px);
  pointer-events: none;
}

.shoe-art {
  position: relative;
  z-index: 2;
  width: min(var(--shoe-fit-width, 94%), var(--shoe-max-width, 920px));
  width: min(var(--shoe-fit-width, 94%), var(--shoe-max-width, 920px), 94cqw, calc(94cqh * 1.499 - 108px));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 2401 / 1601;
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 240ms ease;
}

.shoe-art svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.hotspot {
  cursor: pointer;
  transition: opacity 160ms ease, filter 160ms ease;
}

.hotspot:hover,
.hotspot.is-selected {
  filter: drop-shadow(0 0 8px rgba(0, 113, 227, 0.28));
}

.mvp-shoe-frame {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  isolation: isolate;
}

.mvp-base-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.mvp-fixed-image,
.mvp-stitch-image,
.mvp-upper-fill,
.mvp-upper-hotspot,
.mvp-selection-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mvp-fixed-image,
.mvp-stitch-image {
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.mvp-fixed-image {
  z-index: var(--layer-index, 3);
}

.mvp-stitch-image {
  z-index: 200;
  mix-blend-mode: multiply;
}

.mvp-selection-ring {
  z-index: 190;
  object-fit: fill;
  opacity: 0.96;
  mix-blend-mode: normal;
  pointer-events: none;
  user-select: none;
}

.mvp-upper-fill {
  z-index: var(--layer-index, 2);
  background: var(--part-material);
  opacity: 0.9;
  mix-blend-mode: multiply;
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  transition: filter 180ms ease, opacity 180ms ease;
  pointer-events: none;
}

.mvp-upper-hotspot {
  z-index: 210;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.mvp-upper-hotspot span {
  position: absolute;
  left: 16%;
  top: 44%;
  padding: 5px 9px;
  border: 1px solid rgba(0, 113, 227, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.mvp-upper-hotspot:hover span,
.mvp-upper-hotspot:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.scene-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px 22px;
  color: var(--muted);
  font-size: 13px;
}

.customizer {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  overflow: auto;
}

.panel-heading h2 {
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0;
}

.panel-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.control-block,
.summary-block {
  padding-top: 4px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title h3 {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.section-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.part-button {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.part-button[aria-pressed="true"] {
  border-color: rgba(0, 113, 227, 0.52);
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.11);
}

.part-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.46;
  filter: grayscale(1);
}

.part-button strong,
.part-button span {
  display: block;
}

.part-button strong {
  font-size: 14px;
}

.part-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.swatch-button {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--swatch);
  cursor: pointer;
}

.swatch-button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--blue);
  border-radius: inherit;
}

.texture-list {
  display: grid;
  gap: 8px;
}

.texture-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.texture-button[aria-pressed="true"] {
  border-color: rgba(0, 113, 227, 0.52);
  background: #fff;
}

.texture-button--sub {
  margin-left: 18px;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.48);
}

.texture-subpanel {
  display: grid;
  gap: 8px;
  margin: -2px 0 4px 18px;
  padding: 10px;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
}

.texture-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.swatch-grid--inline {
  grid-template-columns: repeat(auto-fill, minmax(34px, 38px));
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.texture-preview {
  width: 46px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--texture);
}

.texture-button strong,
.texture-button span {
  display: block;
}

.texture-button strong {
  font-size: 14px;
}

.texture-button span {
  color: var(--muted);
  font-size: 12px;
}

.texture-check {
  color: var(--blue);
  font-weight: 900;
}

.summary-block {
  margin-top: auto;
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

pre {
  max-height: 150px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: #303034;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(320px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(29, 29, 31, 0.88);
  color: #fff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-grid input,
.embroidery-row input[type="text"],
.embroidery-row input:not([type]) {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  outline: none;
}

.field-grid input:focus,
.embroidery-row input[type="text"]:focus,
.embroidery-row input:not([type]):focus {
  border-color: rgba(0, 113, 227, 0.62);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.component-code {
  display: inline-grid;
  min-width: 30px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #1d1d1f;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.component-button i {
  display: block;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--component-color);
}

.component-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.component-button strong,
.component-button span span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-panel {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px solid var(--hairline);
}

.pad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pad-option {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 92px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  cursor: pointer;
}

.pad-option[aria-pressed="true"] {
  border-color: rgba(0, 113, 227, 0.54);
  background: #fff;
}

.pad-option img,
.pad-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1.55;
  object-fit: cover;
  border-radius: 6px;
  background: #f5f5f7;
}

.pad-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pad-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.embroidery-list,
.fixed-list {
  display: grid;
  gap: 8px;
}

.embroidery-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.embroidery-row {
  display: grid;
  grid-template-columns: 18px 38px minmax(76px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.embroidery-row span:nth-of-type(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.embroidery-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-left: 64px;
}

.embroidery-upload {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  border: 1px dashed var(--hairline-strong);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  cursor: pointer;
}

.embroidery-upload.has-image {
  border-style: solid;
  background: #fff;
}

.embroidery-upload img,
.embroidery-thumb-placeholder {
  width: 58px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: #f5f5f7;
}

.embroidery-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.embroidery-upload strong,
.embroidery-upload em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.embroidery-upload strong {
  font-size: 13px;
}

.embroidery-upload em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.embroidery-remove {
  min-height: 36px;
}

.fixed-list div {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) minmax(0, 1fr);
  gap: 2px 10px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.fixed-list strong {
  font-size: 13px;
}

.fixed-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.fixed-list em {
  grid-column: 1 / -1;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.summary-block {
  display: none;
}

.preview-stage {
  grid-template-rows: auto auto minmax(420px, 1fr) auto;
}

.shoe-scene {
  align-items: center;
  min-height: 420px;
}

.shoe-art {
  position: relative;
  z-index: 1;
  display: block;
  width: min(var(--shoe-fit-width, 94%), var(--shoe-max-width, 920px));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 2401 / 1601;
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 240ms ease;
}

.front-preview {
  width: 100%;
  height: 100%;
  transform: perspective(900px) rotateY(-15deg) translateX(12px);
  transform-origin: center;
}

.shoe-art svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.component-button {
  min-height: 62px;
}

.texture-list {
  display: grid;
  gap: 8px;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.confirm-modal.is-visible {
  display: block;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.confirm-dialog {
  position: absolute;
  inset: clamp(14px, 4vh, 42px) clamp(12px, 5vw, 64px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-width: 1080px;
  margin: auto;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.effect-dialog {
  position: absolute;
  inset: clamp(14px, 4vh, 42px) clamp(12px, 5vw, 64px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1120px, calc(100vw - clamp(24px, 10vw, 128px)));
  max-height: calc(100dvh - clamp(28px, 8vh, 84px));
  margin: auto;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.confirm-header,
.confirm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--hairline);
}

.confirm-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.confirm-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--hairline);
  border-bottom: 0;
}

.confirm-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.effect-body {
  display: grid;
  align-content: start;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  grid-auto-rows: max-content;
  gap: 14px;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.confirm-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.effect-preview-panel,
.effect-choice-panel {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.effect-preview-panel {
  display: grid;
  align-content: start;
  grid-template-rows: auto auto;
  gap: 10px;
}

.effect-preview-frame,
.confirm-effect-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.96), rgba(245, 245, 247, 0.62) 58%, rgba(232, 234, 238, 0.78) 100%),
    #f5f5f7;
}

.effect-preview-frame {
  width: 100%;
  min-height: 0;
  aspect-ratio: 2401 / 1601;
}

.effect-preview-snapshot {
  display: block;
  width: min(90%, 780px);
  height: auto;
  aspect-ratio: 2401 / 1601;
  object-fit: contain;
}

.effect-preview-loading {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.effect-choice-panel {
  align-self: stretch;
}

.effect-option-grid {
  display: grid;
  gap: 10px;
}

.effect-option-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 88px;
  padding: 9px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.effect-option-card[aria-pressed="true"] {
  border-color: rgba(0, 113, 227, 0.52);
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.11);
}

.effect-option-thumb {
  display: grid;
  width: 112px;
  aspect-ratio: 2401 / 1601;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(238, 240, 244, 0.74)),
    #f5f5f7;
}

.effect-option-thumb-image {
  display: block;
  width: 92%;
  height: auto;
  aspect-ratio: 2401 / 1601;
  object-fit: contain;
}

.effect-option-card strong,
.effect-option-card span span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.effect-option-card strong {
  font-size: 14px;
}

.effect-option-card span span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.confirm-effect-section,
.confirm-info-section,
.confirm-special-section {
  grid-column: 1;
}

.confirm-color-section {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.confirm-effect-preview {
  min-height: 190px;
  aspect-ratio: 2401 / 1601;
}

.confirm-effect-preview .mvp-shoe-frame {
  width: 106%;
  height: auto;
  aspect-ratio: 2401 / 1601;
}

.confirm-table {
  display: grid;
  gap: 6px;
}

.confirm-row {
  display: grid;
  grid-template-columns: 48px minmax(90px, 1fr) minmax(90px, 1fr) minmax(82px, 0.8fr);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--text);
  text-align: left;
}

.confirm-row:not(.confirm-row-head) {
  cursor: pointer;
}

.confirm-row-head {
  background: #f5f5f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.confirm-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.8fr) minmax(160px, 1.2fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.select-row select {
  height: 36px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
}

@media (max-width: 980px) {
  .home-hero {
    min-height: auto;
  }

  .home-copy {
    padding-bottom: 10px;
  }

  .home-product-grid {
    grid-template-columns: 1fr;
  }

  .confirm-body {
    grid-template-columns: 1fr;
  }

  .effect-dialog {
    width: auto;
  }

  .effect-body {
    grid-template-columns: 1fr;
  }

  .effect-preview-frame {
    min-height: 0;
  }

  .confirm-effect-section,
  .confirm-info-section,
  .confirm-special-section,
  .confirm-color-section {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .brand-lockup {
    gap: 10px;
  }

  .home-copy {
    padding: 22px 14px 18px;
  }

  .home-copy h2 {
    max-width: 300px;
    font-size: clamp(28px, 8vw, 34px);
    line-height: 1.02;
  }

  .home-copy p:not(.eyebrow) {
    max-width: 320px;
    font-size: 14px;
  }

  .home-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .home-actions .primary-button,
  .home-actions .glass-button {
    width: 100%;
    flex: 0 0 auto;
  }

  .home-model-card {
    grid-template-rows: auto auto auto auto auto;
    gap: 12px;
    min-height: 0;
    padding: 16px 12px;
  }

  .home-card-title {
    font-size: 28px;
  }

  .home-card-thumb {
    width: min(100%, 260px);
    max-width: 260px;
  }

  .home-card-thumb img {
    width: 108%;
    height: 108%;
  }

  .home-card-meta {
    padding: 7px 11px;
  }

  .confirm-dialog {
    inset: 8px;
  }

  .effect-dialog {
    inset: 8px;
    max-height: calc(100dvh - 16px);
  }

  .confirm-body {
    padding: 10px;
  }

  .effect-body {
    gap: 10px;
    padding: 10px;
  }

  .effect-preview-panel,
  .effect-choice-panel {
    padding: 10px;
  }

  .effect-preview-frame {
    min-height: 0;
  }

  .effect-preview-snapshot {
    width: 86%;
  }

  .effect-option-card {
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 76px;
    padding: 8px;
  }

  .effect-option-thumb {
    width: 92px;
  }

  .confirm-header,
  .confirm-actions {
    padding: 14px;
  }

  .confirm-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .confirm-actions .primary-button,
  .confirm-actions .glass-button {
    width: 100%;
  }

  .confirm-row {
    grid-template-columns: 42px minmax(72px, 1fr) minmax(72px, 1fr);
  }

  .confirm-row span:nth-child(4) {
    display: none;
  }

  .embroidery-row {
    grid-template-columns: 18px 34px minmax(0, 1fr);
  }

  .embroidery-row input:not([type]),
  .embroidery-row input[type="text"] {
    grid-column: 3;
  }

  .embroidery-upload-row {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .embroidery-remove {
    justify-self: start;
  }
}

/* Responsive customizer workspace: keep the shoe complete while controls scroll inside their own regions. */
body.drawer-open {
  overflow: hidden;
}

.workspace {
  position: relative;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  max-width: none;
  height: clamp(560px, calc(100dvh - 112px), 860px);
  max-height: calc(100dvh - 112px);
  overflow: hidden;
  background-color: #fff;
}

.workspace.is-customizer-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.is-customizer-collapsed .customizer {
  display: none;
}

.workspace-topbar,
.preview-stage,
.part-rail-block,
.customizer {
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.workspace-topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  overflow: hidden;
}

.preview-stage {
  grid-column: 1;
  grid-row: 2;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
}

.customizer {
  grid-column: 2;
  grid-row: 2;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
}

.preview-stage {
  grid-template-rows: minmax(0, 1fr) auto;
}

.model-strip {
  min-height: 0;
  padding: clamp(8px, 1.4vh, 16px) 18px 8px;
}

.model-pill {
  min-width: clamp(156px, 15vw, 192px);
}

.view-tools {
  min-height: 38px;
  padding: 0 18px;
}

.customizer-toggle {
  min-height: 32px;
  white-space: nowrap;
}

.shoe-scene {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: clamp(6px, 2vh, 18px);
}

.shoe-scene::before {
  inset: clamp(28px, 7vh, 56px) 5% clamp(18px, 5vh, 40px);
}

.shoe-shadow {
  bottom: clamp(2px, 0.8vh, 6px);
}

.shoe-art {
  width: min(var(--shoe-fit-width, 96%), var(--shoe-max-width, 920px));
  width: min(var(--shoe-fit-width, 96%), var(--shoe-max-width, 920px), 96cqw, calc(96cqh * 1.499 - 114px));
  max-width: 100%;
  max-height: 100%;
}

.mvp-base-image {
  object-fit: contain;
}

.scene-footer {
  min-height: 30px;
  padding: 0 18px 8px;
  flex-wrap: wrap;
}

.part-rail-block {
  grid-column: 1 / -1;
  grid-row: 3;
  min-width: 0;
  min-height: clamp(96px, 14vh, 126px);
  max-height: clamp(96px, 14vh, 126px);
  overflow: hidden;
  padding: 10px 18px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
}

.part-rail-block .section-title {
  margin-bottom: 8px;
}

.part-rail {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 4px;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.rail-part-button {
  flex: 0 0 clamp(128px, 11vw, 158px);
  min-width: 0;
  min-height: 58px;
}

.rail-part-button strong,
.rail-part-button span span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-backdrop {
  display: none;
}

.customizer {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  container: customizer-panel / inline-size;
  gap: 12px;
  padding: clamp(14px, 2vw, 20px);
  overflow: hidden;
}

.panel-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.drawer-close {
  display: grid;
}

.panel-heading h2 {
  margin-bottom: 6px;
  font-size: clamp(24px, 2.1vw, 30px);
}

.selected-part-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(0, 113, 227, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    rgba(0, 113, 227, 0.06);
}

.selected-part-card h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.25;
}

.customizer .section-title h3,
.customizer .section-title span,
.texture-button strong,
.texture-button span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.customizer-scroll {
  display: block;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 4px 0;
  overscroll-behavior: contain;
}

.customizer-scroll > * + * {
  margin-top: 14px;
}

.control-block {
  min-height: 0;
  padding-top: 0;
}

.swatch-grid {
  grid-template-columns: repeat(auto-fill, minmax(42px, 46px));
  justify-content: start;
  max-height: min(24dvh, 184px);
  overflow-y: auto;
  padding: 5px clamp(10px, 1.2vw, 14px);
}

.texture-list {
  max-height: min(34dvh, 290px);
  overflow-y: auto;
  padding-right: 3px;
}

.summary-block {
  margin-top: 0;
}

@media (max-height: 760px) and (min-width: 761px) {
  .workspace {
    height: calc(100dvh - 92px);
    max-height: calc(100dvh - 92px);
  }

  .app-shell {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .model-strip {
    padding-top: 8px;
    padding-bottom: 4px;
  }

  .model-thumb {
    width: 36px;
    height: 36px;
  }

  .model-pill {
    padding: 6px 10px 6px 6px;
  }

  .part-rail-block {
    min-height: 88px;
    max-height: 88px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .rail-part-button {
    min-height: 48px;
  }

  .panel-heading p:last-child {
    display: none;
  }
}

@media (max-width: 980px) and (min-width: 761px) {
  .workspace {
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    gap: 12px;
  }

  .workspace.is-customizer-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .customizer {
    grid-template-columns: none;
    padding: 12px;
  }

  .panel-heading h2 {
    font-size: 20px;
  }

  .selected-part-card {
    padding: 9px;
  }

  .swatch-grid {
    grid-template-columns: repeat(auto-fill, minmax(30px, 34px));
    justify-content: start;
  }

  .swatch-button {
    min-width: 30px;
    min-height: 30px;
  }

  .texture-button {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 7px;
  }

  .texture-preview {
    width: 30px;
    height: 26px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    min-height: 100dvh;
    padding: 8px;
  }

  .topbar {
    margin-bottom: 8px;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .glass-button,
  .top-actions .primary-button {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .top-actions .icon-button {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, 32%);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    height: calc(100dvh - 91px);
    max-height: calc(100dvh - 91px);
    min-height: 0;
    overflow: hidden;
  }

  .workspace.is-customizer-collapsed {
    display: block;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .preview-stage {
    height: 100%;
    border-radius: 14px;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .model-strip {
    min-height: 45px;
    padding: 7px 10px 4px;
  }

  .model-pill {
    min-width: 142px;
    padding: 5px 8px 5px 5px;
  }

  .model-thumb {
    width: 32px;
    height: 32px;
  }

  .view-tools {
    min-height: 34px;
    padding: 0 10px;
    overflow-x: auto;
  }

  .shoe-scene {
    min-height: 0;
    padding: 2px 8px;
    --shoe-fit-scale: 0.96;
    --shoe-max-width: 720px;
  }

  .shoe-art {
    width: min(var(--shoe-fit-width, 100%), var(--shoe-max-width, 720px));
    width: min(var(--shoe-fit-width, 100%), var(--shoe-max-width, 720px), 100cqw, calc(100cqh * 1.499 - 114px));
    max-height: 100%;
  }

  .shoe-shadow {
    bottom: 4px;
    height: 28px;
  }

  .scene-footer {
    min-height: 24px;
    padding: 0 10px 6px;
    font-size: 11px;
  }

  .part-rail-block {
    min-height: 104px;
    max-height: 104px;
    padding: 8px 10px 10px;
  }

  .part-rail {
    gap: 7px;
  }

  .rail-part-button {
    flex-basis: 136px;
    min-height: 52px;
    padding: 7px;
  }

  .component-button {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .component-code {
    min-width: 25px;
    height: 21px;
    font-size: 11px;
  }

  .component-button i {
    height: 18px;
  }

  .drawer-backdrop {
    display: none;
  }

  .customizer {
    position: relative;
    inset: auto;
    z-index: auto;
    display: grid;
    width: auto;
    height: 100%;
    max-height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 7px;
    padding: 8px 5px;
    overflow: hidden;
    border-radius: 14px;
    transform: none;
    transition: none;
  }

  .drawer-close {
    display: grid;
    width: 30px;
    height: 30px;
    justify-self: end;
  }

  .panel-top {
    display: block;
  }

  .panel-heading {
    display: none;
  }

  .summary-block {
    display: none;
  }

  .panel-heading h2 {
    font-size: 22px;
  }

  .panel-heading p:last-child {
    display: none;
  }

  .selected-part-card {
    padding: 7px 5px;
  }

  .selected-part-card .eyebrow {
    display: none;
  }

  .selected-part-card h3 {
    font-size: clamp(9px, 2.35vw, 11px);
    line-height: 1.16;
  }

  .customizer-scroll {
    display: block;
    gap: 8px;
    padding-right: 0;
  }

  .texture-block {
    margin-top: 8px;
  }

  .customizer .section-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    align-items: start;
    justify-content: start;
    margin-bottom: 6px;
  }

  .customizer .section-title h3 {
    width: 100%;
    font-size: clamp(10px, 2.55vw, 12px);
    line-height: 1.15;
    text-align: left;
    text-wrap: balance;
    white-space: normal;
  }

  .customizer .section-title span {
    width: 100%;
    font-size: clamp(9px, 2.35vw, 11px);
    line-height: 1.15;
    text-align: left;
    white-space: normal;
  }

  .swatch-grid {
    grid-template-columns: repeat(2, minmax(26px, 1fr));
    max-height: min(168px, 32dvh);
    gap: 6px;
    overflow-y: auto;
    padding: 4px 9px;
  }

  .swatch-button {
    min-width: 30px;
    min-height: 30px;
  }

  .texture-list {
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .texture-button {
    position: relative;
    justify-items: center;
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 56px;
    padding: 5px 4px;
    text-align: center;
  }

  .texture-preview {
    width: 32px;
    height: 24px;
  }

  .texture-button strong {
    font-size: clamp(9px, 2.35vw, 10px);
    line-height: 1.12;
    text-wrap: balance;
  }

  .texture-button span span {
    display: none;
  }

  .texture-check {
    position: absolute;
    right: 4px;
    top: 4px;
    font-size: 10px;
  }
}

@container customizer-panel (max-width: 92px) {
  .selected-part-card h3 {
    font-size: 9px;
    line-height: 1.14;
  }

  .customizer .section-title h3 {
    font-size: 10px;
  }

  .customizer .section-title span {
    font-size: 9px;
  }

  .texture-button strong {
    font-size: 9px;
    line-height: 1.1;
  }
}

@media (max-width: 760px) and (max-height: 520px) {
  .workspace {
    height: calc(100dvh - 58px);
    max-height: calc(100dvh - 58px);
  }

  .brand-mark,
  .eyebrow {
    display: none;
  }

  .topbar {
    align-items: center;
  }

  .brand-lockup h1 {
    font-size: 18px;
  }

  .model-strip,
  .scene-footer {
    display: none;
  }

  .preview-stage {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .part-rail-block {
    min-height: 86px;
    max-height: 86px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .rail-part-button {
    flex-basis: 126px;
    min-height: 46px;
  }

  .texture-list {
    max-height: none;
  }
}

/* Landscape phone final override: short screens use the mobile drawer model even when width is wider than 760px. */
@media (max-width: 900px) and (max-height: 520px) {
  .app-shell {
    min-height: 100dvh;
    padding: 8px;
  }

  .topbar {
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }

  .brand-lockup h1 {
    font-size: 18px;
  }

  .workspace {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(92px, 3fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    height: calc(100dvh - 66px);
    max-height: calc(100dvh - 66px);
    min-height: 0;
    overflow: hidden;
  }

  .workspace.is-customizer-collapsed {
    display: block;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .preview-stage {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .model-strip,
  .scene-footer {
    display: none;
  }

  .shoe-scene {
    min-height: 0;
    overflow: hidden;
    padding: 2px 8px;
    --shoe-fit-scale: 0.9;
    --shoe-max-width: 720px;
  }

  .shoe-art {
    width: min(var(--shoe-fit-width, 100%), var(--shoe-max-width, 720px));
    max-height: 100%;
  }

  .part-rail-block {
    min-height: 64px;
    max-height: 64px;
    padding: 7px 10px;
  }

  .part-rail-block .section-title {
    display: none;
  }

  .part-rail {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0;
  }

  .rail-part-button {
    flex: 0 0 126px;
    min-height: 46px;
  }

  .drawer-backdrop {
    display: none;
  }

  .customizer {
    position: relative;
    inset: auto;
    z-index: auto;
    display: grid;
    width: auto;
    height: 100%;
    max-height: 100%;
    grid-template-columns: none;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 7px;
    padding: 8px 6px;
    overflow: hidden;
    border-radius: 14px;
    transform: none;
    transition: none;
  }

  .drawer-close {
    display: grid;
  }

  .panel-heading {
    display: none;
  }

  .summary-block {
    display: none;
  }

  .panel-heading p:last-child {
    display: none;
  }

  .selected-part-card {
    padding: 9px;
  }

  .selected-part-card h3 {
    font-size: 15px;
  }

  .customizer-scroll {
    display: block;
    min-height: 0;
    overflow-y: auto;
  }

  .texture-block {
    margin-top: 8px;
  }

  .texture-list {
    max-height: none;
    min-height: 0;
    overflow: visible;
  }
}

/* Final shoe containment: keep the full boot visible before maximizing size. */
@media (min-width: 981px) and (min-height: 761px) {
  .workspace {
    height: clamp(560px, calc(100dvh - 124px), 860px);
    max-height: calc(100dvh - 124px);
  }

  .shoe-scene {
    --shoe-fit-scale: 0.9;
    --shoe-max-width: 820px;
  }

  .shoe-art {
    width: min(var(--shoe-fit-width, 90%), var(--shoe-max-width, 820px));
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .shoe-scene {
    --shoe-fit-scale: 0.9;
    --shoe-max-width: 700px;
  }

  .shoe-art {
    width: min(var(--shoe-fit-width, 84%), var(--shoe-max-width, 700px));
    width: min(var(--shoe-fit-width, 84%), var(--shoe-max-width, 700px), 84cqw, calc(84cqh * 1.499 - 72px));
  }
}

@media (max-width: 900px) and (max-height: 520px) {
  .shoe-scene {
    --shoe-fit-scale: 0.82;
    --shoe-max-width: 460px;
  }

  .shoe-art {
    width: min(var(--shoe-fit-width, 58%), var(--shoe-max-width, 460px));
    width: min(var(--shoe-fit-width, 58%), var(--shoe-max-width, 460px), 58cqw, calc(58cqh * 1.499 - 48px));
  }
}

/* Compact drawer controls for landscape phones. */
@media (max-width: 900px) and (max-height: 520px) {
  .panel-heading h2 {
    margin-bottom: 0;
    font-size: 20px;
  }

  .selected-part-card {
    padding: 8px;
  }

  .customizer-scroll {
    gap: 8px;
  }

  .customizer .section-title {
    margin-bottom: 5px;
  }

  .customizer .section-title h3 {
    font-size: 14px;
  }

  .swatch-grid {
    grid-template-columns: repeat(6, minmax(32px, 1fr));
    max-height: 86px;
    gap: 6px;
    padding: 3px;
  }

  .swatch-button {
    min-width: 32px;
    min-height: 32px;
  }

  .texture-list {
    max-height: 118px;
    min-height: 0;
  }

  .texture-button {
    min-height: 42px;
    padding: 5px 8px;
  }

  .summary-block {
    display: none;
  }
}

/* Landscape drawer color row: keep colors and material header separated. */
@media (max-width: 900px) and (max-height: 520px) {
  .swatch-grid {
    grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
    max-height: 52px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .swatch-button {
    min-width: 30px;
    min-height: 30px;
  }
}
