:root {
  color-scheme: light;
  --ink: #10100f;
  --muted: #77756f;
  --line: #deddd8;
  --paper: #f7f6f3;
  --white: #fff;
  --radius-sm: 13px;
  --radius-md: 20px;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

html[lang="zh-CN"] body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html[lang="zh-CN"] .brand { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
html[lang="zh-CN"] .nav-item span { font-size: 8px; }
html[lang="zh-CN"] .settings-row-label,
html[lang="zh-CN"] .settings-row-value,
html[lang="zh-CN"] .profile-group-title { white-space: nowrap; }

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: #e8e7e4; color: var(--ink); }
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
body.sheet-open { overflow: hidden; }

button { color: inherit; font: inherit; }

button, [tabindex] { -webkit-tap-highlight-color: transparent; }

button:focus-visible, [tabindex]:focus-visible { outline: 2px solid #111; outline-offset: 3px; }

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  background: #e8e7e4;
}

.phone {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 42px rgba(20,20,18,.07);
}

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}

.app-content {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(21px + env(safe-area-inset-top)) 16px calc(116px + env(safe-area-inset-bottom));
}

.app-header { display: flex; align-items: center; justify-content: space-between; margin: 0 1px 17px; }

.brand {
  color: #0c0c0b;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -.074em;
  line-height: .92;
  white-space: nowrap;
}
.brand-e {
  position: relative;
  display: inline-block;
  margin: 0 -.015em 0 .012em;
  letter-spacing: 0;
  transform: rotate(-8deg) translateY(-.018em);
  transform-origin: 50% 72%;
}
.brand-hook {
  position: absolute;
  left: .27em;
  bottom: .61em;
  width: .30em;
  height: .31em;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(8deg);
  transform-origin: 50% 100%;
}
.header-actions { display: flex; gap: 8px; }
.icon-button, .sheet-close {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #e6e5e0; background: rgba(255,255,255,.82); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.04);
}
.icon-button.dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.icon-button svg, .sheet-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.hero-card {
  position: relative;
  height: 202px;
  overflow: hidden;
  border-radius: 24px;
  background: #d8d5ce;
  color: #fff;
}
.hero-card > img { width: 100%; height: 100%; object-fit: cover; object-position: 24% 25%; filter: saturate(.72) contrast(.94); }
.hero-wash { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,9,8,.14) 0%, rgba(9,9,8,.04) 38%, rgba(7,7,6,.5) 100%); }
.hero-index { position: absolute; top: 15px; left: 16px; margin: 0; padding: 6px 9px; border-radius: 20px; background: rgba(248,247,243,.82); color: #292824; font-size: 9px; font-weight: 700; letter-spacing: .12em; backdrop-filter: blur(10px); }
.hero-panel { position: absolute; top: 0; right: 0; width: 50%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 20px 17px 18px 14px; border-left: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(4px); }
.eyebrow { margin: 0 0 5px; color: #76736d; font-size: 9px; line-height: 1.2; font-weight: 700; letter-spacing: .13em; }
.hero-panel .eyebrow { color: rgba(255,255,255,.72); }
.hero-panel h1 { margin: 0; font-size: 28px; line-height: .92; letter-spacing: -.055em; font-weight: 660; }
.hero-panel h1 em { font-family: Georgia, serif; font-weight: 400; }
.weather-row { display: flex; align-items: center; gap: 9px; }
.weather-icon { flex: 0 0 31px; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.88); color: #191918; }
.weather-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.weather-row strong { display: block; font-size: 18px; line-height: 1; letter-spacing: -.04em; }
.weather-row small { display: block; margin-top: 3px; font-size: 7px; letter-spacing: .08em; color: rgba(255,255,255,.7); }
.hero-arrow { position: absolute; right: 13px; bottom: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #fff; color: #111; display: none; place-items: center; cursor: pointer; }
.hero-arrow svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.content-section { margin-top: 27px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin: 0 1px 13px; }
.section-heading h2, .sheet-header h2, .look-sheet h2 { margin: 0; font-size: 21px; line-height: 1; letter-spacing: -.045em; font-weight: 650; }
.text-button { padding: 5px 0; border: 0; background: none; color: #686660; font-size: 11px; cursor: pointer; }
.text-button span { margin-left: 3px; color: #111; }

.look-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.look-card { min-width: 0; cursor: pointer; }
.image-wrap { position: relative; height: 225px; overflow: hidden; border-radius: var(--radius-sm); background: #e5e3df; }
.image-wrap img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.78); transition: transform .35s ease; }
.look-card:hover .image-wrap img { transform: scale(1.025); }
.card-meta { min-height: 25px; display: flex; align-items: center; justify-content: space-between; margin: 7px 1px 0; }
.card-meta > span { font-size: 8px; font-weight: 700; color: #7d7a73; letter-spacing: .11em; }
.look-card h3 { margin: -1px 1px 0; font-size: 14px; font-weight: 560; letter-spacing: -.025em; }
.save-button { width: 25px; height: 25px; margin-right: -4px; padding: 3px; border: 0; background: transparent; cursor: pointer; }
.save-button svg { width: 16px; fill: none; stroke: #111; stroke-width: 1.35; stroke-linejoin: round; }
.save-button.saved svg { fill: #111; }

.saved-section { margin-top: 32px; }
.look-count { padding-bottom: 2px; color: #918e87; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.saved-grid { padding-bottom: 20px; }
.saved-card { position: relative; height: 177px; overflow: hidden; padding: 0; border: 0; border-radius: var(--radius-sm); background: #ddd; cursor: pointer; text-align: left; }
.saved-card img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(.96); transition: transform .35s ease; }
.saved-card:hover img { transform: scale(1.025); }
.saved-card::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.54)); }
.saved-card span { position: absolute; z-index: 1; left: 12px; bottom: 11px; color: #fff; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.recent-section { padding-bottom: 24px; }
.recent-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.recent-item-card { min-width: 0; overflow: hidden; padding: 0; border: 1px solid rgba(27,27,26,.08); border-radius: var(--radius-sm); background: #efeeeb; color: var(--ink); cursor: pointer; text-align: left; }
.recent-item-card img { display: block; width: 100%; aspect-ratio: 1 / 1.08; object-fit: contain; background: #ecebe8; }
.recent-item-copy { display: grid; gap: 4px; min-height: 54px; padding: 10px 11px 11px; }
.recent-item-copy small { color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.recent-item-copy strong { overflow: hidden; font-size: 12px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.bottom-nav {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 448px);
  height: 68px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 7px 5px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 25px;
  background: rgba(246,245,242,.84);
  box-shadow: 0 12px 30px rgba(0,0,0,.16), inset 0 0 0 1px rgba(0,0,0,.035);
  backdrop-filter: blur(18px) saturate(1.2);
}
.nav-item { position: relative; min-width: 0; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; border: 0; background: transparent; color: #aaa7a0; cursor: pointer; transition: color .18s ease, transform .18s ease; }
.nav-item { text-decoration: none; }
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.nav-item span { font-size: 7px; line-height: 1; }
.nav-item.active { color: #111; font-weight: 600; }
.nav-item.active::before { display: none; }
.nav-item:active { color: #111; transform: scale(.94); }
.nav-item:focus-visible { outline: 1px solid rgba(17,17,17,.12); outline-offset: -5px; border-radius: 18px; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); max-width: calc(100% - 40px); padding: 10px 14px; border-radius: 20px; background: rgba(17,17,16,.9); color: #fff; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .22s ease; backdrop-filter: blur(12px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.scrim { position: fixed; z-index: 20; inset: 0; background: rgba(9,9,8,.28); backdrop-filter: blur(2px); }
.bottom-sheet { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; width: 100%; max-width: 480px; margin: 0 auto; padding: 10px 19px calc(24px + env(safe-area-inset-bottom)); border-radius: 29px 29px 0 0; background: rgba(249,248,245,.97); box-shadow: 0 -20px 50px rgba(0,0,0,.18); animation: sheet-in .28s cubic-bezier(.2,.75,.25,1); }
.bottom-sheet[hidden], .scrim[hidden] { display: none; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 17px; border-radius: 3px; background: #cbc9c4; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 21px; }
.sheet-close { width: 36px; height: 36px; background: #eeece7; border: 0; box-shadow: none; }
.sheet-actions { display: grid; gap: 8px; }
.sheet-actions > button { display: grid; grid-template-columns: 45px 1fr auto; gap: 12px; align-items: center; min-height: 68px; padding: 10px 13px 10px 9px; border: 1px solid #e7e5df; border-radius: 17px; background: #fff; text-align: left; cursor: pointer; }
.sheet-action-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: #f1efea; }
.sheet-action-icon svg { width: 20px; fill: none; stroke: #111; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sheet-actions strong { display: block; font-size: 13px; font-weight: 600; }
.sheet-actions small { display: block; margin-top: 3px; color: #918e87; font-size: 9px; }
.sheet-actions b { font-size: 14px; font-weight: 400; }

.look-sheet { padding-top: 10px; }
.look-detail-image { height: 285px; margin: 0 0 18px; overflow: hidden; border-radius: 18px; background: #ddd; }
.look-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.sheet-close.floating { position: absolute; z-index: 2; top: 28px; right: 31px; background: rgba(250,249,246,.9); }
.look-sheet h2 { font-size: 25px; }
.look-tags { display: flex; gap: 6px; margin: 15px 0 19px; }
.look-tags span { padding: 6px 8px; border: 1px solid #dad8d2; border-radius: 20px; color: #68655f; font-size: 8px; font-weight: 700; letter-spacing: .09em; }
.primary-button { width: 100%; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border: 0; border-radius: 16px; background: #111; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }

@media (max-width: 520px) {
  html, body { background: var(--paper); }
  .stage { background: var(--paper); }
  .phone { max-width: none; box-shadow: none; }
  .bottom-nav { bottom: max(9px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Closet page */
.closet-content {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(21px + env(safe-area-inset-top)) 16px calc(116px + env(safe-area-inset-bottom));
}

.closet-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 40px;
}

.closet-header h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 620;
  letter-spacing: -.045em;
}

.header-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid #e6e4df;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 4px 12px rgba(0,0,0,.035);
  color: #282724;
  font-size: 10px;
  cursor: pointer;
}

.header-pill:first-child { justify-self: start; }
.header-pill:last-child { justify-self: end; }
.header-pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

body.upload-menu-open { overflow: hidden; }
body.upload-menu-open #openUpload {
  position: relative;
  z-index: 44;
  border-color: rgba(255,255,255,.72);
  background: rgba(246,245,242,.88);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
body.upload-menu-open #openUpload:focus-visible {
  outline: 1px solid #aaa8a2;
  outline-offset: 1px;
}
.upload-action-scrim {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, 480px);
  padding: 0;
  border: 0;
  background: rgba(235,234,231,.24);
  opacity: 0;
  transform: translateX(-50%);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: opacity .28s ease, backdrop-filter .28s ease, -webkit-backdrop-filter .28s ease;
  cursor: default;
}
.upload-action-scrim[hidden] { display: none; }
body.upload-menu-open .upload-action-scrim {
  opacity: 1;
  backdrop-filter: blur(7px) saturate(.82);
  -webkit-backdrop-filter: blur(7px) saturate(.82);
}
.upload-quick-actions {
  position: absolute;
  z-index: 45;
  top: calc(54px + env(safe-area-inset-top));
  right: 15px;
  width: 104px;
  height: 94px;
  pointer-events: none;
}
.upload-quick-actions[hidden] { display: none; }
.upload-action-button {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: rgba(231,231,228,.9);
  color: #4d4b47;
  opacity: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,.09), inset 0 0 0 1px rgba(0,0,0,.035);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  will-change: transform, opacity;
}
.upload-action-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gallery-action {
  top: 0;
  right: 51px;
  transform: translate(52px,-31px) scale(.55);
  transition: transform .34s cubic-bezier(.2,.78,.2,1), opacity .2s ease;
}
.camera-action {
  top: 31px;
  right: 3px;
  transform: translate(3px,-60px) scale(.55);
  transition: transform .36s cubic-bezier(.2,.78,.2,1) .055s, opacity .22s ease .035s;
}
body.upload-menu-open .upload-quick-actions { pointer-events: auto; }
body.upload-menu-open .upload-action-button { opacity: 1; transform: translate(0,0) scale(1); }
.upload-action-button:active { transform: translate(0,1px) scale(.95) !important; }
.upload-action-button:focus-visible { outline: 1px solid #77746e; outline-offset: 2px; }

.closet-search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
  animation: reveal .18s ease;
}
.closet-search-panel[hidden] { display: none; }
.closet-search-panel input {
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #dddbd5;
  border-radius: 15px;
  outline: none;
  background: #fff;
  font: inherit;
  font-size: 12px;
}
.closet-search-panel input:focus { border-color: #99968e; box-shadow: 0 0 0 3px rgba(0,0,0,.045); }
.closet-search-panel button { width: 42px; border: 0; border-radius: 15px; background: #111; color: #fff; cursor: pointer; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }

.view-switcher {
  width: 174px;
  height: 38px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 19px auto 18px;
  padding: 3px;
  border-radius: 20px;
  background: #e9e7e2;
}
.view-switcher button {
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #86827b;
  font-size: 9px;
  cursor: pointer;
}
.view-switcher button.active {
  background: #fff;
  color: #111;
  box-shadow: 0 2px 8px rgba(0,0,0,.07), inset 0 0 0 1px rgba(0,0,0,.05);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 17px;
}
.filter-chip {
  min-width: 0;
  height: 30px;
  padding: 0 5px;
  overflow: hidden;
  border: 0;
  border-radius: 15px;
  background: #ebe9e5;
  color: #67645e;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.filter-chip.active { background: #181817; color: #fff; }

.wardrobe-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 1px 12px;
}
.wardrobe-meta h2 { margin: 0; font-size: 22px; line-height: 1; font-weight: 650; letter-spacing: -.045em; }
.wardrobe-meta span { color: #89867f; font-size: 8px; font-weight: 700; letter-spacing: .11em; }

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

.wardrobe-card {
  position: relative;
  min-width: 0;
  height: 224px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.04);
  border-radius: 15px;
  background: #e8e6e2;
  cursor: pointer;
}
.wardrobe-card[hidden] { display: none; }
.wardrobe-card > img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.76) contrast(.97); transition: transform .3s ease; }
.wardrobe-card.item-card > img { object-fit: contain; background: #f0efed; filter: saturate(.82) contrast(.98); }
.wardrobe-card:hover > img { transform: scale(1.025); }
.wardrobe-card::after { content: ""; position: absolute; inset: 62% 0 0; pointer-events: none; background: linear-gradient(transparent, rgba(0,0,0,.22)); opacity: 0; transition: opacity .2s ease; }
.wardrobe-card:hover::after { opacity: 1; }
.wardrobe-card-label {
  position: absolute;
  z-index: 2;
  left: 11px;
  bottom: 10px;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  opacity: 0;
  transition: opacity .2s ease;
}
.wardrobe-card:hover .wardrobe-card-label { opacity: 1; }
.heart-button {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 9px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  background: rgba(247,246,242,.76);
  color: #9e9b95;
  cursor: pointer;
  backdrop-filter: blur(9px);
}
.heart-button[hidden] { display: none; pointer-events: none; }
.heart-button svg { width: 16px; height: 16px; fill: transparent; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.heart-button.saved { color: #161615; background: rgba(255,255,255,.9); }
.heart-button.saved svg { fill: currentColor; }
.heart-button,
.remove-item-button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.remove-item-button {
  position: absolute;
  z-index: 4;
  top: 3px;
  right: 3px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(.72);
  transition: opacity .18s ease, transform .18s cubic-bezier(.2,.8,.2,1);
}
.remove-item-button[hidden] { display: none; }
.remove-item-button::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #1d1d1b;
  box-shadow: 0 5px 14px rgba(0,0,0,.2);
}
.remove-item-button svg { position: relative; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.wardrobe-card.is-remove-target { outline: 1px solid rgba(25,25,24,.22); outline-offset: -1px; }
.wardrobe-card.is-remove-target > img { transform: scale(.985); filter: saturate(.68) contrast(.96); }
.wardrobe-card.is-remove-target .remove-item-button { opacity: 1; pointer-events: auto; transform: scale(1); }
.wardrobe-card.is-remove-target::after { opacity: .28; }
.wardrobe-card.item-card { touch-action: pan-y; -webkit-touch-callout: none; user-select: none; }

.clothing-detail-page,
.upload-flow-page,
.profile-sheet,
.try-on-subpage { scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

@media (max-width: 480px) {
  input,
  select,
  textarea { font-size: 16px !important; }
}
body.item-delete-open { overflow: hidden; }
.item-delete-dialog-layer { z-index: 170; }
.item-delete-dialog .item-delete-confirm { border-color: #1d1d1b; background: #1d1d1b; color: #fff; }
.item-delete-dialog button:focus-visible { outline: 1.5px solid #1d1d1b; outline-offset: 2px; }

.empty-state {
  grid-column: 1 / -1;
  padding: 70px 24px;
  border: 1px dashed #d5d2cb;
  border-radius: 18px;
  text-align: center;
  color: #88847d;
  font-size: 11px;
}
.empty-state[hidden] { display: none; }

.closet-detail-copy { margin-top: 17px; }
.closet-detail-copy h2 { margin: 0; font-size: 25px; line-height: 1; letter-spacing: -.045em; }
.closet-detail-copy p:not(.eyebrow) { margin: 9px 0 0; color: #77736c; font-size: 10px; line-height: 1.5; }

@media (hover: none) {
  .wardrobe-card::after { opacity: .5; }
  .wardrobe-card-label { opacity: 1; }
}

/* Clothing detail */
body.detail-open {
  overflow: hidden;
}

.clothing-detail-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  justify-content: center;
  background: rgba(226,225,221,.94);
  opacity: 0;
  transition: opacity .28s ease;
}
.clothing-detail-layer.visible { opacity: 1; }

.clothing-detail-page {
  position: relative;
  width: min(100%, 480px);
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  background: #fbfbfa;
  color: #151514;
  box-shadow: 0 0 45px rgba(0,0,0,.09);
  overscroll-behavior: contain;
  scrollbar-width: none;
  transform: translateY(100%);
  transition: transform .34s cubic-bezier(.2,.78,.24,1);
}
.clothing-detail-page::-webkit-scrollbar { display: none; }
.clothing-detail-layer.visible .clothing-detail-page { transform: translateY(0); }

.detail-topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  height: 0;
  pointer-events: none;
}
.detail-close-button,
.viewer-close,
.drawer-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(251,251,250,.86);
  color: #3d3c39;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,.035);
  backdrop-filter: blur(10px);
}
.detail-close-button {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  pointer-events: auto;
}
.detail-close-button svg,
.viewer-close svg,
.drawer-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
}
.detail-close-button:focus-visible,
.viewer-close:focus-visible,
.drawer-close:focus-visible {
  outline: 1px solid #aaa8a2;
  outline-offset: 1px;
}
.detail-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.clothing-gallery {
  position: relative;
  height: calc(220px + env(safe-area-inset-top));
  min-height: 220px;
  max-height: 248px;
  padding: calc(12px + env(safe-area-inset-top)) 32px 4px;
  background: #f8f8f6;
}
.clothing-gallery-track {
  width: 100%;
  height: 100%;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.clothing-gallery-track::-webkit-scrollbar { display: none; }
.gallery-image-button {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  scroll-snap-align: center;
}
.gallery-image-button img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: saturate(.83) contrast(.99);
}
.gallery-pagination {
  position: absolute;
  left: 50%;
  bottom: 8px;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}
.gallery-pagination span { width: 4px; height: 4px; border-radius: 50%; background: #d1d0cc; }
.gallery-pagination span.active { background: #4c4a46; }

.clothing-attributes { padding: 0 16px; }
.attribute-section {
  padding: 5px 0 4px;
  border-top: 1px solid #ebeae6;
}
.attribute-section:first-child { border-top: 0; }
.attribute-heading {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.attribute-heading h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1;
  font-weight: 620;
  letter-spacing: -.02em;
}
.attribute-chip-grid { display: flex; flex-wrap: wrap; gap: 0 6px; }
.attribute-chip {
  position: relative;
  z-index: 0;
  min-width: 58px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #4f4d48;
  font-size: 11px;
  cursor: pointer;
}
.attribute-chip::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6px 0;
  border: 1px solid #e2e0db;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.025);
}
.attribute-chip.selected { color: #1d1c1a; font-weight: 600; }
.attribute-chip.selected::before {
  border-color: #d5d3cd;
  background: #e8e7e3;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.type-chip-grid .attribute-chip { min-width: 66px; }
.season-chip-grid { flex-wrap: nowrap; }
.season-chip-grid .attribute-chip { flex: 1 1 0; min-width: 0; padding-inline: 5px; }

.colour-all-button {
  min-width: 54px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin: -11px 0 -11px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3f3d39;
  font-size: 11px;
  cursor: pointer;
}
.colour-all-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.colour-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 4px; }
.colour-option {
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #504e49;
  font-size: 11px;
  cursor: pointer;
}
.colour-option.selected { background: #ecebe7; color: #171716; font-weight: 600; }
.colour-dot {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.colour-option.selected .colour-dot { outline: 2px solid #c7c5bf; outline-offset: 2px; }

.weather-options { display: flex; align-items: center; gap: 9px; padding-top: 5px; }
.weather-option {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e2e0db;
  border-radius: 50%;
  background: #fff;
  color: #77746e;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
.weather-option svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.weather-option.selected { border-color: #ccc9c2; background: #e6e5e1; color: #242321; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); }

.fixed-save-bar {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: 0;
  width: min(100%, 480px);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(251,251,250,0), rgba(251,251,250,.96) 22%, #fbfbfa 48%);
  transform: translateX(-50%);
}
.detail-save-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 24px;
  background: #252524;
  color: #fff;
  font-size: 14px;
  font-weight: 560;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.13);
}
.detail-save-button:disabled {
  background: #d6d4cf;
  color: #89867f;
  box-shadow: none;
  cursor: default;
}
.detail-save-button.saved { background: #3b3a37; color: #fff; }

.fullscreen-image-viewer {
  position: fixed;
  z-index: 160;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(248,248,246,.985);
}
.fullscreen-image-viewer[hidden] { display: none; }
.viewer-close { position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top)); right: 14px; background: rgba(235,234,230,.88); }
.viewer-image-stage { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.viewer-image { width: 92%; height: 82%; object-fit: contain; transform-origin: center; transition: transform .05s linear; user-select: none; -webkit-user-drag: none; }
.viewer-zoom-controls {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  grid-template-columns: repeat(3, 44px);
  overflow: hidden;
  border: 1px solid #dedcd6;
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 26px rgba(0,0,0,.09);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}
.viewer-zoom-controls button { width: 44px; height: 44px; border: 0; background: transparent; color: #343330; font-size: 16px; cursor: pointer; }
.viewer-zoom-controls button + button { border-left: 1px solid #e7e5e0; }

.detail-sub-layer {
  position: fixed;
  z-index: 145;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.detail-sub-layer[hidden] { display: none; }
.detail-sub-scrim { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(20,20,19,.24); backdrop-filter: blur(2px); }
.colour-drawer {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  padding: 9px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: #fbfbfa;
  box-shadow: 0 -18px 48px rgba(0,0,0,.15);
  animation: sheet-in .25s ease;
}
.colour-drawer-handle { width: 38px; height: 4px; margin: 0 auto 10px; border-radius: 3px; background: #cfcdc7; }
.colour-drawer-header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; }
.colour-drawer-header h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.drawer-close { background: #efeeea; box-shadow: none; }
.colour-drawer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 12px; }
.drawer-colour-option {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 2px;
  border: 1px solid #e7e5e0;
  border-radius: 15px;
  background: #fff;
  color: #5c5953;
  font-size: 10px;
  cursor: pointer;
}
.drawer-colour-option.selected { border-color: #c9c6bf; background: #ebeae6; color: #1d1c1a; font-weight: 600; }
.drawer-colour-dot { width: 24px; height: 24px; border: 1px solid rgba(0,0,0,.12); border-radius: 50%; background: var(--swatch); box-shadow: 0 2px 5px rgba(0,0,0,.08); }

.unsaved-dialog-layer { z-index: 150; align-items: center; padding: 20px; }
.unsaved-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 340px);
  padding: 24px;
  border-radius: 22px;
  background: #fbfbf9;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.unsaved-dialog h2 { margin: 3px 0 0; font-size: 22px; line-height: 1.05; letter-spacing: -.045em; }
.unsaved-dialog > p:not(.eyebrow) { margin: 11px 0 20px; color: #706d66; font-size: 12px; line-height: 1.45; }
.unsaved-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.unsaved-actions button { min-height: 44px; border-radius: 22px; font-size: 12px; cursor: pointer; }
.secondary-dialog-button { border: 1px solid #dfddd7; background: #fff; color: #3f3d39; }
.primary-dialog-button { border: 1px solid #222220; background: #222220; color: #fff; }

/* Upload flow */
.upload-bottom-sheet {
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  background: #f8f7f4;
}
.upload-sheet-header { margin-bottom: 16px; }
.upload-choice-list { display: grid; gap: 8px; }
.upload-choice-button {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 9px 10px;
  border: 1px solid #e5e3dd;
  border-radius: 18px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.upload-choice-button strong { display: block; font-size: 13px; font-weight: 620; letter-spacing: -.015em; }
.upload-choice-button small { display: block; margin-top: 4px; color: #8b8881; font-size: 9px; }
.upload-choice-arrow { justify-self: end; color: #56534e; font-size: 14px; }
.upload-cancel-button,
.upload-sheet-secondary {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border: 1px solid #e5e2dc;
  border-radius: 24px;
  background: #fff;
  color: #56534e;
  font-size: 12px;
  cursor: pointer;
}
.camera-instructions { display: grid; gap: 4px; margin: 0 0 18px; padding: 0; list-style: none; }
.camera-instructions li {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border-bottom: 1px solid #e8e6e1;
  color: #45433f;
  font-size: 12px;
}
.instruction-mark { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #2d2c29; }
.upload-inline-notice { min-height: 17px; margin: -7px 2px 9px; color: #8a5349; font-size: 10px; line-height: 1.4; }
.upload-sheet-primary {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 24px;
  background: #252524;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.upload-flow-layer {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  justify-content: center;
  background: #e8e7e4;
}
.upload-flow-page {
  position: relative;
  width: min(100%, 480px);
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: calc(8px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  background: #fbfbfa;
  color: #171716;
  box-shadow: 0 0 42px rgba(0,0,0,.08);
  overscroll-behavior: contain;
  scrollbar-width: none;
  animation: upload-page-in .34s cubic-bezier(.2,.78,.24,1);
}
.upload-flow-page::-webkit-scrollbar { display: none; }
@keyframes upload-page-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.upload-flow-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.upload-flow-header h1 { margin: 0; font-size: 21px; line-height: 1; font-weight: 660; letter-spacing: -.045em; }
.upload-flow-header p { margin: 5px 0 0; color: #817e77; font-size: 9px; line-height: 1.35; }
.upload-flow-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e5e3dd;
  border-radius: 50%;
  background: #fff;
  color: #4d4b46;
  cursor: pointer;
}
.upload-flow-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.upload-preview-frame {
  position: relative;
  height: clamp(330px, 54dvh, 470px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e8e6e1;
  border-radius: 22px;
  background: #efeeeb;
}
.upload-preview-frame img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.upload-flow-actions { display: grid; gap: 8px; padding: 14px 0 0; }
.upload-primary-button,
.upload-secondary-button,
.upload-text-button,
.upload-add-button {
  width: 100%;
  min-height: 48px;
  border-radius: 24px;
  font-size: 12px;
  cursor: pointer;
}
.upload-primary-button,
.upload-add-button { border: 1px solid #252524; background: #252524; color: #fff; font-weight: 600; }
.upload-secondary-button { border: 1px solid #dedcd6; background: #fff; color: #33322f; }
.upload-text-button { border: 0; background: transparent; color: #77736c; }
.upload-primary-button:disabled,
.upload-add-button:disabled { border-color: #cfcdc7; background: #cfcdc7; color: #77736c; cursor: default; }
.upload-centered-status {
  min-height: calc(100dvh - 100px - env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.upload-centered-status strong { margin-top: 17px; font-size: 15px; }
.upload-centered-status p { max-width: 250px; margin: 7px 0 0; color: #827f78; font-size: 10px; line-height: 1.5; }
.upload-centered-status .upload-primary-button { margin-top: 22px; }
.upload-spinner {
  width: 30px;
  height: 30px;
  display: inline-block;
  border: 2px solid #d4d2cc;
  border-top-color: #292825;
  border-radius: 50%;
  animation: upload-spin .8s linear infinite;
}
@keyframes upload-spin { to { transform: rotate(360deg); } }
.processing-preview { height: clamp(430px, 66dvh, 570px); }
.processing-preview > img { filter: saturate(.7); opacity: .48; }
.processing-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  min-height: 144px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 17px;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 20px;
  background: rgba(251,251,249,.92);
  box-shadow: 0 12px 32px rgba(0,0,0,.09);
  text-align: center;
  backdrop-filter: blur(12px);
}
.processing-card .upload-spinner { width: 25px; height: 25px; }
.processing-card strong { margin-top: 11px; font-size: 14px; }
.processing-card p { margin: 5px 0 0; color: #77746e; font-size: 9px; line-height: 1.4; }
.mock-service-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 10px;
  padding: 0 8px;
  border: 1px solid #d8d5cf;
  border-radius: 11px;
  color: #77736c;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .11em;
}
.single-action { padding-top: 10px; }
.processing-disabled { box-shadow: none; }
.result-preview { height: clamp(330px, 48dvh, 430px); background: #ecebe8; }
.result-preview img { padding: 0; }
.editor-preview-frame { touch-action: pan-y; }
.mask-editor-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ecebe8;
}
.mask-editor-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  transform-origin: center;
  transition: transform .18s ease;
  pointer-events: none;
}
.mask-editor-canvas.editing {
  touch-action: none;
  pointer-events: auto;
  cursor: crosshair;
  transition: none;
}
.mask-cleanup-status {
  min-height: 31px;
  display: flex;
  align-items: center;
  margin: 8px 0 0;
  padding: 0 3px;
  color: #77746e;
  font-size: 9px;
  line-height: 1.35;
}
.result-tool-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.result-tool-tabs button,
.mask-editor-button-row button {
  min-height: 44px;
  border: 1px solid #dedcd6;
  border-radius: 22px;
  background: #fff;
  color: #4d4a45;
  font-size: 10px;
  cursor: pointer;
}
.result-tool-tabs button.active,
.mask-editor-button-row button.active {
  border-color: #262522;
  background: #262522;
  color: #fff;
}
.mask-editor-controls {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #e3e1db;
  border-radius: 18px;
  background: #f6f5f2;
}
.mask-editor-button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.mask-editor-button-row.edit-mode-row { grid-template-columns: 1fr 1fr; }
.mask-editor-button-row.compact-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}
.mask-editor-button-row.compact-row button {
  min-width: 0;
  padding: 0 5px;
  font-size: 9px;
}
.mask-editor-button-row button:disabled { color: #b1aea7; background: #eeece7; cursor: default; }
.mask-editor-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 12px;
  min-height: 50px;
  margin-top: 7px;
  color: #4d4a45;
  font-size: 10px;
}
.mask-editor-slider-row output { color: #77736c; font-variant-numeric: tabular-nums; }
.mask-editor-slider-row input {
  grid-column: 1 / -1;
  width: 100%;
  height: 28px;
  margin: -5px 0 0;
  accent-color: #292825;
}
.mask-editor-note { margin: 7px 2px 0; color: #807c75; font-size: 8.5px; line-height: 1.45; }
.mock-disclosure,
.upload-failure-copy {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #e7e5df;
  border-radius: 15px;
  background: #f6f5f2;
}
.mock-disclosure strong,
.upload-failure-copy strong { display: block; font-size: 11px; }
.mock-disclosure p,
.upload-failure-copy p { margin: 4px 0 0; color: #7f7b74; font-size: 9px; line-height: 1.45; }
.result-actions { padding-bottom: 4px; }
.attribute-upload-preview { height: 180px; margin-bottom: 7px; border-radius: 18px; }
.attribute-upload-preview img { padding: 8px; }
.upload-attributes-host { margin: 0 -16px; padding-bottom: 86px; }
.upload-save-bar {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 0;
  width: min(100%, 480px);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: #fbfbfa;
  border-top: 1px solid #ebe9e4;
  transform: translateX(-50%);
}

@media (max-width: 370px) {
  .upload-flow-page { padding-inline: 14px; }
  .upload-preview-frame { height: clamp(300px, 50dvh, 410px); }
  .processing-preview { height: clamp(390px, 62dvh, 510px); }
  .upload-choice-button { min-height: 66px; }
  .attribute-upload-preview { height: 158px; }
  .result-preview { height: 315px; }
  .mask-editor-controls { padding-inline: 10px; }
  .mask-editor-button-row.compact-row { grid-template-columns: 1fr 1fr; }
}

/* Profile page */
.profile-body,
.profile-stage,
.profile-screen { min-height: 100vh; min-height: 100dvh; background: #f4f3f0; }
.profile-content,
.profile-subpage { min-height: 100vh; min-height: 100dvh; padding: calc(22px + env(safe-area-inset-top)) 16px calc(124px + env(safe-area-inset-bottom)); }
.profile-header { text-align: center; }
.profile-brand { margin: 0 0 18px; text-align: left; font-size: 21px; letter-spacing: -.07em; }
.profile-identity { display: flex; flex-direction: column; align-items: center; }
.profile-avatar { width: 76px; height: 76px; overflow: hidden; padding: 0; border: 4px solid #fff; border-radius: 50%; background: #ddd; box-shadow: 0 7px 22px rgba(0,0,0,.11); cursor: pointer; }
.profile-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 22%; filter: saturate(.78); }
.profile-identity h1 { margin: 12px 0 2px; font-size: 20px; line-height: 1; letter-spacing: -.045em; font-weight: 650; }
.profile-identity > p { margin: 3px 0 0; color: #85827b; font-size: 10px; }
.profile-edit-link { min-height: 44px; margin-top: 1px; padding: 0 13px; border: 0; background: transparent; color: #34332f; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wardrobe-summary-card { width: 100%; min-height: 152px; display: block; margin-top: 13px; padding: 19px 19px 16px; border: 0; border-radius: 24px; background: #293035; color: #fff; box-shadow: 0 12px 25px rgba(24,28,30,.16); text-align: left; }
.wardrobe-summary-card > .eyebrow { color: rgba(255,255,255,.56); }
.wardrobe-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 15px; }
.wardrobe-summary-grid > button { min-width: 0; min-height: 44px; padding: 0 9px 0 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.wardrobe-summary-grid > button + button { padding-left: 13px; border-left: 1px solid rgba(255,255,255,.16); }
.wardrobe-summary-grid strong { display: block; overflow: hidden; font-size: 23px; line-height: 1; letter-spacing: -.05em; text-overflow: ellipsis; }
.wardrobe-summary-grid small { display: block; margin-top: 6px; color: rgba(255,255,255,.62); font-size: 8px; white-space: nowrap; }
.summary-status { width: 100%; min-height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.73); font-size: 9px; text-align: left; cursor: pointer; }
.summary-status svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.wardrobe-summary-grid > button:focus-visible,
.summary-status:focus-visible { outline: 1px solid rgba(255,255,255,.8); outline-offset: 3px; }
.profile-settings-section { margin-top: 24px; }
.profile-group-title { margin: 0 3px 8px; color: #817e77; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.settings-card { overflow: hidden; border: 1px solid #e4e2dc; border-radius: 21px; background: rgba(255,255,255,.88); box-shadow: 0 7px 17px rgba(28,27,24,.045); }
.settings-row { position: relative; width: 100%; min-height: 57px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto 18px; gap: 9px; align-items: center; padding: 6px 14px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.settings-row + .settings-row::before { content: ''; position: absolute; top: 0; left: 55px; right: 14px; height: 1px; background: #ebe9e4; }
.settings-row-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #f0efeb; color: #56544e; }
.settings-row-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.settings-row-label { min-width: 0; font-size: 12px; font-weight: 520; }
.settings-row-value { max-width: 120px; overflow: hidden; color: #96928a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.settings-row-chevron { color: #aaa79f; }
.settings-row-chevron svg { width: 14px; height: 14px; display: block; fill: none; stroke: currentColor; stroke-width: 1.5; }
.settings-row.destructive .settings-row-label { color: #87574f; }
.profile-reset-button { width: 100%; min-height: 48px; margin-top: 24px; border: 1px solid #dedbd4; border-radius: 17px; background: transparent; color: #69665f; font-size: 11px; cursor: pointer; }
.profile-version { margin: 17px 0 0; color: #aaa69e; font-size: 8px; letter-spacing: .08em; text-align: center; }
.profile-subheader { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; text-align: center; }
.profile-subheader > button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #e2e0da; border-radius: 50%; background: rgba(255,255,255,.76); cursor: pointer; }
.profile-subheader > button svg { width: 18px; fill: none; stroke: #222; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.profile-subheader .eyebrow { margin-bottom: 4px; }
.profile-subheader h1 { margin: 0; font-size: 19px; line-height: 1.05; letter-spacing: -.04em; }
.profile-lead { max-width: 310px; margin: 21px auto 18px; color: #77746d; font-size: 11px; line-height: 1.55; text-align: center; }
.data-preview-card,
.profile-copy-card,
.feedback-card { margin-top: 15px; padding: 19px; border: 1px solid #e3e1db; border-radius: 22px; background: rgba(255,255,255,.9); box-shadow: 0 7px 18px rgba(0,0,0,.04); }
.data-preview-copy h2,
.profile-copy-card h2 { margin: 0; font-size: 19px; letter-spacing: -.04em; }
.data-preview-copy > p:last-child,
.profile-copy-card p { color: #77746d; font-size: 11px; line-height: 1.55; }
.data-thumbnails { display: flex; gap: 7px; margin: 16px 0; }
.data-thumbnails img { width: 67px; height: 78px; object-fit: contain; border-radius: 12px; background: #efeeea; }
.data-preview-card > button { width: 100%; min-height: 46px; border: 1px solid #ddd9d1; border-radius: 15px; background: #f5f4f1; color: #514f49; font-size: 10px; cursor: pointer; }
.data-preview-card > button:disabled { color: #aaa69e; cursor: default; }
.model-data-preview { height: 230px; margin: 14px 0; overflow: hidden; border-radius: 16px; background: #e9e7e2; }
.model-data-preview img { width: 100%; height: 100%; object-fit: contain; }
.local-data-note { margin: 19px 7px 0; color: #918e86; font-size: 9px; line-height: 1.55; text-align: center; }
.profile-copy-card { margin-top: 25px; }
.profile-copy-card p + p { padding-top: 14px; border-top: 1px solid #eceae5; }
.about-card .profile-brand { margin-bottom: 26px; }
.about-card dl { margin: 24px 0 0; }
.about-card dl > div { display: flex; justify-content: space-between; padding: 13px 0; border-top: 1px solid #eceae5; font-size: 10px; }
.about-card dt { color: #8d8981; }
.about-card dd { margin: 0; }
.feedback-card { display: grid; gap: 16px; margin-top: 25px; }
.feedback-card label,
.profile-form label { display: grid; gap: 7px; color: #6e6b64; font-size: 9px; font-weight: 650; letter-spacing: .04em; }
.feedback-card select,
.feedback-card textarea,
.profile-form input,
.profile-form select { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #dedbd4; border-radius: 13px; background: #f8f7f4; color: #24231f; font: inherit; font-size: 12px; outline: 0; }
.feedback-card textarea { resize: vertical; }
.feedback-card > button { min-height: 49px; border: 0; border-radius: 17px; background: #222220; color: #fff; font-size: 11px; }
.feedback-note { margin: -4px 0 0; color: #96928b; font-size: 9px; line-height: 1.4; text-align: center; }
.profile-layer { position: fixed; z-index: 120; inset: 0; display: flex; justify-content: center; align-items: flex-end; }
.profile-layer-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(22,22,20,.28); backdrop-filter: blur(3px); }
.profile-sheet { position: relative; z-index: 1; width: 100%; max-width: 480px; max-height: min(780px, 92dvh); overflow-y: auto; padding: 10px 18px calc(23px + env(safe-area-inset-bottom)); border-radius: 29px 29px 0 0; background: #f8f7f4; box-shadow: 0 -20px 50px rgba(0,0,0,.17); animation: sheet-in .28s cubic-bezier(.2,.75,.25,1); }
.profile-sheet .sheet-header { margin-bottom: 17px; }
.profile-sheet .sheet-close { font-size: 20px; font-weight: 300; }
.profile-form { display: grid; gap: 14px; }
.profile-form input:disabled { color: #99958d; }
.edit-avatar-button { width: 92px; display: grid; gap: 7px; justify-items: center; margin: 0 auto 4px; padding: 0; border: 0; background: transparent; color: #55524c; font-size: 9px; cursor: pointer; }
.edit-avatar-button img { width: 70px; height: 70px; object-fit: cover; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.profile-primary { width: 100%; min-height: 49px; border: 0; border-radius: 17px; background: #222220; color: #fff; font-size: 11px; font-weight: 600; cursor: pointer; }
.preference-options { display: grid; gap: 8px; }
.preference-options > button { width: 100%; min-height: 51px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border: 1px solid #e1dfd8; border-radius: 15px; background: #fff; font-size: 11px; text-align: left; cursor: pointer; }
.preference-options > button i { width: 19px; height: 19px; border: 1px solid #ccc8c0; border-radius: 50%; }
.preference-options > button.selected { border-color: #959189; background: #eeece7; }
.preference-options > button.selected i { border: 5px solid #eeece7; background: #222220; box-shadow: 0 0 0 1px #222220; }
.preference-options > button small { color: #aaa69e; font-size: 8px; }
.preference-options > button:disabled { color: #a6a29a; cursor: default; }
.selector-note { margin: 12px 4px 16px; color: #8e8a83; font-size: 9px; line-height: 1.45; }
.confirm-layer { align-items: center; padding: 20px; }
.profile-confirm { position: relative; z-index: 1; width: min(100%, 350px); padding: 23px; border-radius: 23px; background: #faf9f6; box-shadow: 0 24px 55px rgba(0,0,0,.22); }
.profile-confirm h2 { margin: 0; font-size: 21px; line-height: 1.08; letter-spacing: -.04em; }
.profile-confirm > p:not(.eyebrow) { margin: 12px 0 21px; color: #77746d; font-size: 11px; line-height: 1.5; }
.profile-confirm > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-confirm button { min-height: 46px; border: 1px solid #ddd9d1; border-radius: 14px; background: #f1efeb; font-size: 10px; cursor: pointer; }
.profile-confirm button.danger { border-color: #302e2b; background: #302e2b; color: #fff; }
body.profile-overlay-open { overflow: hidden; }

@media (max-width: 370px) {
  .profile-content,
  .profile-subpage { padding-left: 13px; padding-right: 13px; }
  .wardrobe-summary-card { padding-left: 16px; padding-right: 16px; }
  .wardrobe-summary-grid strong { font-size: 21px; }
  .settings-row { grid-template-columns: 30px minmax(0,1fr) auto 15px; padding-left: 11px; padding-right: 11px; }
  .settings-row-value { max-width: 92px; }
}

@media (max-width: 370px) {
  .clothing-gallery { height: calc(220px + env(safe-area-inset-top)); padding-inline: 28px; }
  .clothing-attributes { padding-inline: 14px; }
  .type-chip-grid { gap-inline: 4px; }
  .type-chip-grid .attribute-chip { min-width: 62px; padding-inline: 8px; }
  .colour-option { gap: 5px; padding-inline: 4px; font-size: 10px; }
}

/* Try On */
.try-on-screen { min-height: 100vh; min-height: 100dvh; background: #f7f6f3; }
#tryOnApp { min-height: 100vh; min-height: 100dvh; }
.try-on-main-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(21px + env(safe-area-inset-top)) 16px env(safe-area-inset-bottom);
}
.try-on-title { min-height: 40px; display: grid; place-items: center; }
.try-on-title h1 { margin: 0; font-size: 19px; line-height: 1; font-weight: 620; letter-spacing: -.045em; }
.try-on-segment,
.try-on-filter,
.detail-segment {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: 3px;
  border-radius: 20px;
  background: #e9e7e2;
}
.try-on-segment { width: 174px; height: 38px; margin: 12px auto 0; }
.try-on-segment button,
.try-on-filter button,
.detail-segment button {
  min-width: 0;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #86827b;
  font-size: 9px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.try-on-segment button.active,
.try-on-filter button.active,
.detail-segment button.active {
  background: #fff;
  color: #181817;
  box-shadow: 0 2px 8px rgba(0,0,0,.065);
}
.try-on-mode-content { animation: try-on-reveal .28s ease; }
@keyframes try-on-reveal { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.try-on-stack {
  position: relative;
  width: min(100%, 330px);
  height: 258px;
  margin: 24px auto 3px;
}
.try-on-stack-card {
  position: absolute;
  top: 34px;
  width: 137px;
  height: 184px;
  margin: 0;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,.94);
  border-radius: 22px;
  background: #e8e7e3;
  box-shadow: 0 10px 24px rgba(30,29,27,.11), 0 0 0 1px rgba(30,29,27,.08);
}
.try-on-stack-card img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center top; filter: saturate(.74) contrast(.97); }
.try-on-stack-mannequin .try-on-stack-card { background: #e9e7e2; }
.try-on-stack-mannequin .try-on-stack-card img { object-fit: contain; object-position: center; filter: saturate(.72) contrast(.98); }
.try-on-stack-card.left { left: 11px; transform: rotate(-8deg) scale(.91); }
.try-on-stack-card.right { right: 11px; transform: rotate(8deg) scale(.91); }
.try-on-stack-card.centre { z-index: 2; top: 11px; left: 50%; width: 158px; height: 220px; transform: translateX(-50%); }
.try-on-stack-model .try-on-stack-card { border-color: rgba(255,255,255,.96); }
.try-on-copy { text-align: center; }
.try-on-copy .eyebrow { margin-bottom: 7px; }
.try-on-copy h2 { margin: 0; font-size: 22px; line-height: 1; font-weight: 630; letter-spacing: -.045em; }
.try-on-copy p:not(.eyebrow) { margin: 11px 0 0; color: #77746e; font-size: 11px; line-height: 1.55; }
.try-on-main-action { margin-top: auto; padding: 18px 8px calc(84px + env(safe-area-inset-bottom)); }
.try-on-primary,
.try-on-secondary {
  width: 100%;
  min-height: 48px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.try-on-primary { border: 1px solid #262625; background: #262625; color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.11); }
.try-on-secondary { border: 1px solid #dedbd5; background: #fff; color: #3f3d39; }
.try-on-primary:disabled { border-color: #d3d1cb; background: #d3d1cb; color: #89867f; box-shadow: none; cursor: default; }

.try-on-subpage {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding: calc(13px + env(safe-area-inset-top)) 16px calc(176px + env(safe-area-inset-bottom));
}
.try-on-subheader { min-height: 58px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 7px; }
.try-on-subheader > div { text-align: center; }
.try-on-subheader .eyebrow { margin: 0 0 4px; font-size: 7px; }
.try-on-subheader h1 { margin: 0; font-size: 20px; line-height: 1; font-weight: 640; letter-spacing: -.045em; }
.try-on-back {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e6e4de;
  border-radius: 50%;
  background: rgba(255,255,255,.8);
  color: #343330;
  cursor: pointer;
}
.try-on-back svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.try-on-header-spacer { width: 44px; }
.try-on-filter { grid-template-columns: repeat(3, 1fr); width: 238px; min-height: 38px; margin: 18px auto; }
.mannequin-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.mannequin-card {
  min-width: 0;
  padding: 6px 6px 10px;
  border: 1px solid #e2e0da;
  border-radius: 19px;
  background: #fdfdfc;
  color: #282725;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.mannequin-card.selected { border-color: #56534e; box-shadow: inset 0 0 0 1px #56534e, 0 8px 18px rgba(0,0,0,.07); transform: translateY(-1px); }
.mannequin-image { height: 185px; display: block; overflow: hidden; border-radius: 14px; background: #e7e6e2; }
.mannequin-image img { width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(.74); }
.mannequin-image img[src*="mannequin-"] { object-fit: contain; object-position: center; filter: saturate(.72) contrast(.98); }
.mannequin-card > span:last-child { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 9px 5px 0; }
.mannequin-card strong { font-size: 12px; font-weight: 620; }
.mannequin-card small { color: #8a867f; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.try-on-fixed-action {
  position: fixed;
  z-index: 7;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: min(100%, 480px);
  padding: 10px 24px;
  background: rgba(247,246,243,.94);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}
.wardrobe-placeholder-visual { height: 410px; margin: 17px 0 20px; overflow: hidden; border: 1px solid #e2e0db; border-radius: 22px; background: #e9e8e4; }
.wardrobe-placeholder-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(.74); }
.wardrobe-placeholder-visual img[src*="mannequin-"] { object-fit: contain; object-position: center; filter: saturate(.72) contrast(.98); }

.model-create-intro { padding-top: 22px; }
.model-lead { max-width: 310px; margin: 0 0 18px; font-size: 17px; line-height: 1.25; font-weight: 590; letter-spacing: -.025em; }
.model-requirements { margin: 0; padding: 0; list-style: none; border-top: 1px solid #e4e2dc; }
.model-requirements li { min-height: 46px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #e4e2dc; color: #4d4a45; font-size: 11px; }
.model-requirements li span { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #343330; }
.privacy-card { margin-top: 18px; padding: 14px 15px; border: 1px solid #e3e1db; border-radius: 16px; background: #efeee9; }
.privacy-card strong { display: block; font-size: 11px; }
.privacy-card p { margin: 5px 0 0; color: #77736c; font-size: 9px; line-height: 1.45; }
.privacy-card.compact { margin-top: 22px; }
.consent-control { min-height: 54px; display: grid; grid-template-columns: 1px 22px 1fr; align-items: center; gap: 9px; margin-top: 9px; cursor: pointer; }
.consent-control input { width: 1px; height: 1px; opacity: 0; }
.consent-control > span { width: 22px; height: 22px; border: 1px solid #cbc8c1; border-radius: 7px; background: #fff; }
.consent-control input:checked + span { background: #222220; box-shadow: inset 0 0 0 6px #fff; }
.consent-control b { color: #5f5c56; font-size: 9px; line-height: 1.35; font-weight: 520; }

.model-upload-visual { height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 18px 0 14px; border: 1px solid #e2e0db; border-radius: 22px; background: #eeede9; }
.body-frame { position: relative; width: 108px; height: 205px; display: block; border: 1px dashed #a9a69f; border-radius: 54px 54px 34px 34px; }
.body-frame::before { content: ""; position: absolute; top: 21px; left: 50%; width: 38px; height: 38px; border: 1.5px solid #77746d; border-radius: 50%; transform: translateX(-50%); }
.body-frame i { position: absolute; top: 67px; left: 50%; width: 63px; height: 112px; border: 1.5px solid #77746d; border-radius: 26px 26px 17px 17px; transform: translateX(-50%); }
.model-upload-visual p { margin: 14px 0 0; color: #88847d; font-size: 8px; letter-spacing: .035em; }
.model-upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.intro-upload-actions { margin-top: 18px; }
.model-source-button { min-height: 118px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 8px; border: 1px solid #e2e0da; border-radius: 18px; background: #fff; cursor: pointer; }
.model-source-button > span { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 9px; border-radius: 50%; background: #efeeea; }
.model-source-button svg { width: 19px; height: 19px; fill: none; stroke: #2b2a27; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.model-source-button b { font-size: 11px; }
.model-source-button small { margin-top: 4px; color: #918d86; font-size: 8px; }
.model-upload-privacy { margin: 13px 0 0; text-align: center; color: #88847d; font-size: 8px; }
.model-photo-preview { height: 500px; margin-top: 16px; overflow: hidden; border: 1px solid #e1dfda; border-radius: 22px; background: #e9e8e4; }
.model-photo-preview img { width: 100%; height: 100%; display: block; object-fit: contain; }
.model-preview-note { margin: 12px 0; color: #77746e; text-align: center; font-size: 9px; }
.model-confirm-actions { display: grid; grid-template-columns: .75fr 1.25fr; gap: 9px; }

.model-details-form { display: grid; gap: 14px; padding-top: 24px; }
.privacy-photo-summary {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e1dfd9;
  border-radius: 18px;
  background: #eeede9;
}
.privacy-photo-summary img { width: 78px; height: 104px; display: block; object-fit: contain; border-radius: 13px; background: #e5e3de; }
.privacy-photo-summary strong { display: block; font-size: 11px; }
.privacy-photo-summary p { margin: 5px 0 0; color: #77736c; font-size: 9px; line-height: 1.45; }
.model-final-consent {
  width: 100%;
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 15px;
  border: 1px solid #e1dfd9;
  border-radius: 18px;
  background: #fff;
  transform: none;
  cursor: pointer;
}
.model-details-form .model-final-consent input[type="checkbox"] {
  position: static;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  opacity: 1;
  transform: none;
  accent-color: #222220;
}
.model-consent-copy {
  flex: 1;
  min-width: 0;
  display: block;
  white-space: normal;
  word-break: break-word;
  writing-mode: horizontal-tb;
}
.model-details-form .model-consent-copy strong { display: block; color: #35332f; font-size: 11px; line-height: 1.5; font-weight: 560; white-space: normal; word-break: break-word; }
.model-details-form .model-consent-copy small { display: block; margin: 5px 0 0; color: #706c65; font-size: 9px; line-height: 1.45; text-decoration: underline; text-underline-offset: 2px; white-space: normal; word-break: break-word; }
.model-details-save { margin-top: 18px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.model-details-page { overflow-x: hidden; padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.model-details-form fieldset { margin: 0; padding: 0; border: 0; }
.model-details-form legend,
.model-details-form label > span:first-child { display: block; margin-bottom: 8px; color: #4e4b46; font-size: 11px; font-weight: 600; }
.model-details-form small { margin-left: 4px; color: #9a968f; font-size: 8px; font-weight: 400; }
.detail-segment { grid-template-columns: repeat(3, 1fr); min-height: 42px; }
.model-details-form label { display: block; }
.model-details-form input,
.model-details-form select { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #dedcd6; border-radius: 15px; outline: 0; background: #fff; color: #2c2b28; font: inherit; font-size: 11px; }
.input-with-unit { position: relative; display: block; }
.input-with-unit input { padding-right: 45px; }
.input-with-unit b { position: absolute; top: 50%; right: 14px; color: #89867f; font-size: 9px; transform: translateY(-50%); }

.model-crop-guidance { max-width: 310px; margin: 10px auto 13px; color: #68655f; text-align: center; font-size: 10px; line-height: 1.5; }
.model-crop-stage {
  position: relative;
  width: min(100%, 340px);
  height: min(56dvh, 470px);
  min-height: 360px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #dedbd5;
  border-radius: 22px;
  background: #d8d6d1;
  touch-action: none;
  user-select: none;
}
.model-crop-stage > img {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform-origin: center;
  pointer-events: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.model-crop-shade { display: none; }
.model-free-crop-box {
  position: absolute;
  z-index: 3;
  border: 1.5px solid rgba(255,255,255,.98);
  box-shadow: 0 0 0 999px rgba(17,17,16,.42);
  cursor: move;
  touch-action: none;
}
.model-free-crop-box::before { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.01); }
.crop-grid { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 33.2%, rgba(255,255,255,.46) 33.4%, transparent 33.8%, transparent 66.2%, rgba(255,255,255,.46) 66.4%, transparent 66.8%), linear-gradient(transparent 33.2%, rgba(255,255,255,.46) 33.4%, transparent 33.8%, transparent 66.2%, rgba(255,255,255,.46) 66.4%, transparent 66.8%); pointer-events: none; }
.crop-handle { position: absolute; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; touch-action: none; }
.crop-handle::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: #fff; border-style: solid; }
.crop-handle.nw { top: -13px; left: -13px; cursor: nwse-resize; }
.crop-handle.ne { top: -13px; right: -13px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -13px; left: -13px; cursor: nesw-resize; }
.crop-handle.se { right: -13px; bottom: -13px; cursor: nwse-resize; }
.crop-handle.nw::after { right: 1px; bottom: 1px; border-width: 2px 0 0 2px; }
.crop-handle.ne::after { bottom: 1px; left: 1px; border-width: 2px 2px 0 0; }
.crop-handle.sw::after { top: 1px; right: 1px; border-width: 0 0 2px 2px; }
.crop-handle.se::after { top: 1px; left: 1px; border-width: 0 2px 2px 0; }
.model-crop-controls { margin: 13px auto 12px; max-width: 340px; }
.model-crop-controls label { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 9px; color: #5c5953; font-size: 10px; }
.model-crop-controls input { width: 100%; accent-color: #282725; }
.model-crop-controls > div { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; margin-top: 10px; }
.model-crop-controls button { min-height: 44px; display: grid; place-items: center; padding: 0 10px; border: 1px solid #dedbd5; border-radius: 22px; background: #fff; color: #343330; font-size: 10px; cursor: pointer; }
.model-crop-controls svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.model-crop-page .model-confirm-actions { max-width: 340px; margin: 0 auto; }

.model-generation-page { text-align: center; }
.generation-visual { position: relative; width: 238px; height: 332px; margin: 35px auto 23px; }
.generation-image { width: 100%; height: 100%; overflow: hidden; border: 5px solid #fff; border-radius: 27px; background: #e7e6e2; box-shadow: 0 15px 36px rgba(0,0,0,.12); }
.generation-image img { width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(.6) contrast(.96); opacity: .7; }
.generation-spinner { position: absolute; left: 50%; bottom: -16px; width: 42px; height: 42px; border-radius: 50%; background: #f7f6f3; transform: translateX(-50%); }
.generation-spinner::before { content: ""; position: absolute; inset: 0; border: 3px solid #d3d1cb; border-top-color: #272623; border-radius: 50%; animation: upload-spin .85s linear infinite; }
.generation-visual.failed .generation-spinner::before { animation: none; border-color: #8d8982; }
.generation-visual.qa-static .generation-spinner::before { animation: none; transform: rotate(28deg); }
.generation-copy .mock-service-badge { margin-top: 0; }
.generation-copy h2 { margin: 13px 0 0; font-size: 21px; letter-spacing: -.04em; }
.generation-copy p { max-width: 270px; margin: 8px auto 0; color: #7f7b74; font-size: 10px; line-height: 1.45; }
.generation-progress { width: 220px; height: 4px; overflow: hidden; margin: 18px auto 0; border-radius: 3px; background: #dedcd6; }
.generation-progress span { display: block; height: 100%; border-radius: inherit; background: #272623; transition: width .35s ease; }

.digital-model-page { padding-bottom: calc(224px + env(safe-area-inset-bottom)); }
.digital-model-current { margin-top: 17px; }
.digital-model-current > p,
.digital-model-library > p { margin: 0 0 9px; }
.digital-model-current-card {
  width: 100%;
  min-height: 148px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 8px;
  border: 1px solid #dfddd7;
  border-radius: 22px;
  background: #fdfdfc;
  color: #292825;
  text-align: left;
  cursor: pointer;
}
.digital-model-current-card img { width: 112px; height: 132px; display: block; object-fit: cover; object-position: center top; border-radius: 16px; background: #e9e8e4; }
.digital-model-current-card > span { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding-right: 8px; }
.digital-model-current-card strong { font-size: 16px; letter-spacing: -.03em; }
.digital-model-current-card small { margin-top: 7px; color: #7d7972; font-size: 9px; line-height: 1.4; }
.digital-model-current-card em { margin-top: 14px; padding: 6px 9px; border-radius: 14px; background: #eeece7; color: #5f5b55; font-size: 8px; font-style: normal; }
.digital-model-detail-preview { height: min(64dvh, 560px); margin-top: 16px; overflow: hidden; border: 1px solid #e1dfda; border-radius: 23px; background: #e9e8e4; }
.digital-model-detail-preview img { width: 100%; height: 100%; object-fit: contain; }
.digital-model-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.digital-model-meta span { padding: 6px 10px; border: 1px solid #dedbd5; border-radius: 15px; color: #716e68; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.digital-model-note { margin: 13px auto 0; max-width: 300px; color: #7f7b74; text-align: center; font-size: 9px; line-height: 1.5; }
.delete-model-button { width: 100%; min-height: 44px; margin-top: 16px; border: 0; background: transparent; color: #815e57; font-size: 10px; text-decoration: underline; cursor: pointer; }
.digital-model-action-grid,
.digital-model-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; padding-bottom: calc(34px + env(safe-area-inset-bottom)); }
.digital-model-action-grid .full,
.digital-model-detail-actions .try-on-primary,
.digital-model-detail-actions .delete-model-button { grid-column: 1 / -1; }
.digital-model-action-grid .delete-model-button,
.digital-model-detail-actions .delete-model-button { margin-top: 1px; }
.digital-model-state-page { min-height: calc(100dvh - 110px); }
.digital-model-state { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.digital-model-state .generation-spinner { position: relative; left: auto; bottom: auto; display: block; margin-bottom: 26px; transform: none; }
.digital-model-state h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.digital-model-state p { max-width: 270px; margin: 10px auto 0; color: #7f7b74; font-size: 10px; line-height: 1.5; }
.digital-model-library { margin-top: 18px; }
.digital-model-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.digital-model-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dedbd5;
  border-radius: 19px;
  background: #fdfdfc;
  color: #2d2c29;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  user-select: none;
}
.digital-model-card.active { border-color: #20201e; box-shadow: inset 0 0 0 1px #20201e; }
.digital-model-card.is-remove-target { outline: 1px solid rgba(25,25,24,.22); outline-offset: -1px; }
.digital-model-card.is-remove-target .digital-model-card-select { pointer-events: none; }
.digital-model-card.is-remove-target .digital-model-card-image img { transform: scale(.985); filter: saturate(.68) contrast(.96); }
.digital-model-card.is-remove-target .digital-model-card-top { display: none; }
.digital-model-card.is-remove-target .remove-item-button { opacity: 1; pointer-events: auto; transform: scale(1); }
.digital-model-card-select {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 5px 5px 11px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.digital-model-card-select:active { transform: scale(.995); }
.digital-model-card-image { width: 100%; aspect-ratio: 3 / 4; display: block; overflow: hidden; border-radius: 14px; background: #ebeae6; }
.digital-model-card-image img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center top; pointer-events: none; }
.digital-model-card-copy { min-width: 0; display: block; padding: 9px 5px 0; }
.digital-model-card-copy b { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.digital-model-card-copy small { display: block; overflow: hidden; margin-top: 4px; color: #88847d; font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.digital-model-card-top {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.digital-model-card-top em {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 15px;
  background: rgba(22,22,21,.9);
  color: #fff;
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
  backdrop-filter: blur(9px);
}
.digital-model-more {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: rgba(248,247,244,.9);
  color: #292825;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(9px);
}
.digital-model-more svg { width: 18px; height: 18px; fill: currentColor; }
.digital-model-management-actions { grid-template-columns: 1fr; margin-top: 20px; padding-bottom: calc(42px + env(safe-area-inset-bottom)); }
.digital-model-management-actions > button { width: 100%; }
.digital-model-action-layer { position: fixed; z-index: 155; inset: 0; }
.digital-model-action-layer[hidden] { display: none; }
.digital-model-action-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(12,12,11,.3); backdrop-filter: blur(2px); }
.digital-model-action-menu {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(calc(100% - 28px), 420px);
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 24px;
  background: rgba(249,248,245,.97);
  box-shadow: 0 20px 54px rgba(0,0,0,.2);
  transform: translateX(-50%);
  backdrop-filter: blur(20px);
}
.digital-model-action-menu p { margin: 3px 8px 8px; color: #77736c; font-size: 9px; font-weight: 650; letter-spacing: .04em; }
.digital-model-action-menu button { width: 100%; min-height: 50px; padding: 0 12px; border: 0; border-top: 1px solid #e7e4de; background: transparent; color: #34322e; font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.digital-model-action-menu button:first-of-type { border-top: 0; }
.digital-model-action-menu button.danger { color: #8a413b; }
body.digital-model-menu-open { overflow: hidden; }
.digital-model-empty-action { max-width: 250px; margin-top: 22px; }

.try-on-provider-badge,
.try-on-result-page > .mock-service-badge {
  width: max-content;
  display: block;
  margin: 11px auto 0;
  padding: 6px 9px;
  border: 1px solid #d9d6cf;
  border-radius: 14px;
  background: #eeece7;
  color: #6f6b64;
  font-size: 7px;
  font-weight: 650;
  letter-spacing: .09em;
}
.try-on-provider-badge.live { background: #e9ece7; color: #4f5a4e; }
.try-on-guidance { max-width: 310px; margin: 14px auto 16px; color: #77736c; text-align: center; font-size: 9px; line-height: 1.45; }
.try-on-change-photo-link { min-height: 44px; display: block; margin: 2px auto -8px; padding: 0 13px; border: 0; background: transparent; color: #625f59; font-size: 9px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.try-on-garment-slots { display: grid; gap: 14px; padding-bottom: 92px; }
.try-on-garment-slot { padding: 14px; border: 1px solid #dfddd7; border-radius: 21px; background: #fdfdfc; }
.try-on-slot-header { min-height: 44px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.try-on-slot-header .eyebrow { margin: 0 0 4px; color: #8b877f; font-size: 7px; letter-spacing: .13em; }
.try-on-slot-header h2 { margin: 0; font-size: 16px; line-height: 1.05; letter-spacing: -.035em; }
.try-on-slot-clear,
.try-on-slot-change {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #66625c;
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.try-on-slot-empty {
  width: 100%;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed #cfccc5;
  border-radius: 16px;
  background: #f1f0ec;
  color: #373532;
  cursor: pointer;
}
.try-on-slot-empty > span { font-size: 20px; font-weight: 300; line-height: 1; }
.try-on-slot-empty b { font-size: 10px; font-weight: 620; }
.try-on-slot-selected { min-width: 0; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.try-on-slot-selected > span { width: 62px; height: 72px; overflow: hidden; border-radius: 13px; background: #ebeae6; }
.try-on-slot-selected img { width: 100%; height: 100%; display: block; object-fit: contain; }
.try-on-slot-selected strong,
.try-on-slot-selected small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.try-on-slot-selected strong { font-size: 11px; }
.try-on-slot-selected small { margin-top: 4px; color: #89857e; font-size: 8px; }
.try-on-slot-picker { margin-top: 13px; padding-top: 13px; border-top: 1px solid #e2e0da; }
.try-on-slot-picker > p { margin: 0 0 10px; color: #706c65; font-size: 9px; }
.try-on-slot-picker .try-on-clothing-card.selected { border-color: #292826; box-shadow: inset 0 0 0 1px #292826; }
.try-on-slot-empty-copy { padding: 18px 0; text-align: center; }
.try-on-clothing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.try-on-clothing-card {
  min-width: 0;
  padding: 6px 6px 10px;
  border: 1px solid #e1dfd9;
  border-radius: 19px;
  background: #fdfdfc;
  color: #282725;
  text-align: left;
  cursor: pointer;
}
.try-on-clothing-card > span { height: 176px; display: block; overflow: hidden; border-radius: 14px; background: #eae9e5; }
.try-on-clothing-card img { width: 100%; height: 100%; display: block; object-fit: contain; }
.try-on-clothing-card strong,
.try-on-clothing-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.try-on-clothing-card strong { margin: 9px 5px 0; font-size: 11px; }
.try-on-clothing-card small { margin: 3px 5px 0; color: #8a867f; font-size: 8px; }
.try-on-clothing-card.unsupported { opacity: .48; cursor: not-allowed; }
.try-on-confirm-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.try-on-confirm-pair.count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.try-on-confirm-pair.count-3 figure > span { height: 218px; border-radius: 18px; }
.try-on-confirm-pair figure { min-width: 0; margin: 0; }
.try-on-confirm-pair figure > span {
  height: 290px;
  display: block;
  overflow: hidden;
  border: 1px solid #dfddd7;
  border-radius: 22px;
  background: #e9e8e4;
}
.try-on-confirm-pair figure > span.transparent-preview { background: #ecebe8; }
.try-on-confirm-pair img { width: 100%; height: 100%; display: block; object-fit: contain; }
.try-on-confirm-pair figcaption { padding: 9px 4px 0; }
.try-on-confirm-pair small,
.try-on-confirm-pair strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.try-on-confirm-pair small { color: #8c8881; font-size: 7px; letter-spacing: .09em; text-transform: uppercase; }
.try-on-confirm-pair strong { margin-top: 3px; font-size: 11px; }
.try-on-checklist { margin-top: 18px; padding: 14px; border: 1px solid #dfddd7; border-radius: 17px; background: #eeede9; }
.try-on-checklist > p { margin: 0; color: #6f6b64; font-size: 9px; line-height: 1.5; }
.try-on-consent { grid-template-columns: 1px 22px 1fr; margin-top: 8px; border-top: 1px solid #dad7d0; }
.try-on-quality-section { margin-top: 18px; }
.try-on-quality-section h2 { margin: 0 0 10px; font-size: 13px; font-weight: 630; letter-spacing: -.02em; }
.try-on-quality-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.try-on-quality-option {
  min-height: 82px;
  display: grid;
  grid-template-columns: 16px 1fr;
  align-content: center;
  column-gap: 8px;
  padding: 12px;
  border: 1px solid #dfddd7;
  border-radius: 17px;
  background: #fff;
  color: #34322f;
  text-align: left;
  cursor: pointer;
}
.try-on-quality-option > span {
  width: 16px;
  height: 16px;
  grid-row: 1 / span 2;
  border: 1px solid #aaa69f;
  border-radius: 50%;
  background: #fff;
}
.try-on-quality-option.selected { border-color: #77736c; background: #eeede9; box-shadow: inset 0 0 0 1px #77736c; }
.try-on-quality-option.selected > span { border-color: #2d2c29; box-shadow: inset 0 0 0 4px #fff; background: #2d2c29; }
.try-on-quality-option b { align-self: end; font-size: 10px; font-weight: 650; }
.try-on-quality-option small { align-self: start; margin-top: 4px; color: #817d76; font-size: 8px; line-height: 1.35; }
.try-on-quality-badge {
  width: max-content;
  display: block;
  padding: 5px 8px;
  border: 1px solid #d7d4cd;
  border-radius: 12px;
  background: #f7f6f3;
  color: #625f59;
  font-size: 7px;
  font-weight: 650;
  letter-spacing: .08em;
}
.try-on-inline-error { margin: 11px 0 0; color: #865f57; text-align: center; font-size: 9px; line-height: 1.4; }
.try-on-fixed-action.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 9px; }
.try-on-fixed-action.triple { display: grid; grid-template-columns: 1fr 1fr 1.12fr; gap: 7px; }
.try-on-fixed-action.triple .try-on-primary,
.try-on-fixed-action.triple .try-on-secondary { min-width: 0; padding-inline: 7px; font-size: 10px; }
.try-on-job-page { text-align: center; }
.try-on-job-visual {
  min-height: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 25px 0 0;
  border: 1px solid #e0ded8;
  border-radius: 24px;
  background: #edebe6;
}
.try-on-job-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 64px;
  height: 64px;
  border: 5px solid #deddd8;
  border-top-color: #222;
  border-radius: 50%;
  animation: spinner-rotate .9s linear infinite;
  flex-shrink: 0;
}
@keyframes spinner-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.try-on-job-visual p { margin: 24px 0 0; color: #44413c; font-size: 13px; font-weight: 600; }
.try-on-job-visual small { margin-top: 9px; color: #817d76; font-size: 10px; line-height: 1.45; }
.try-on-result-page { padding-bottom: calc(122px + env(safe-area-inset-bottom)); }
.try-on-result-gallery { margin-top: 16px; }
.try-on-result-mode-row { min-height: 24px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.try-on-result-mode-row .try-on-quality-badge { margin: 0; }
.try-on-demo-badge {
  width: max-content;
  padding: 5px 8px;
  border: 1px solid #dedbd4;
  border-radius: 12px;
  background: #efede8;
  color: #6d6962;
  font-size: 7px;
  font-weight: 650;
  letter-spacing: .06em;
}
.try-on-result-segment {
  width: min(100%, 266px);
  height: 38px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  margin: 13px auto 12px;
  padding: 3px;
  border-radius: 20px;
  background: #e9e7e2;
}
.try-on-result-segment button {
  min-width: 0;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #77736c;
  font-size: 10px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.try-on-result-segment button.active {
  background: #fff;
  color: #171716;
  font-weight: 620;
  box-shadow: 0 2px 8px rgba(25,25,23,.08);
}
.try-on-result-media {
  width: 100%;
  min-height: 430px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 10px;
  border: 1px solid #dedcd6;
  border-radius: 24px;
  background: #e9e8e4;
  cursor: zoom-in;
  transition: transform .16s ease, border-color .16s ease;
}
.try-on-result-media:active { transform: scale(.995); border-color: #c9c6bf; }
.try-on-result-media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(62dvh, 610px);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.try-on-result-zoom-hint { margin: 8px 0 0; color: #969188; font-size: 8px; text-align: center; }
.try-on-result-actions { display: grid; gap: 8px; margin-top: 18px; }
.try-on-result-actions > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.try-on-result-actions .try-on-primary.saved:disabled { background: #343330; color: #fff; opacity: 1; }
.try-on-image-viewer {
  position: fixed;
  z-index: 220;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0a0a09;
  color: #fff;
  overscroll-behavior: contain;
  touch-action: none;
}
.try-on-viewer-close {
  position: absolute;
  z-index: 3;
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: rgba(32,32,30,.76);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(14px);
}
.try-on-viewer-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.try-on-viewer-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(72px + env(safe-area-inset-top)) 12px calc(28px + env(safe-area-inset-bottom));
  cursor: zoom-out;
  touch-action: none;
}
.try-on-viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
body.try-on-viewer-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}
.try-on-result-message { min-height: 430px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.try-on-result-message > span { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid #c8c4bd; border-radius: 50%; color: #69655f; font-size: 26px; font-weight: 300; }
.try-on-result-message h2 { margin: 17px 0 0; font-size: 20px; letter-spacing: -.04em; }
.try-on-result-message p { max-width: 280px; margin: 8px 0 0; color: #79756e; font-size: 10px; line-height: 1.5; }
.try-on-result-message small { margin-top: 8px; color: #a09b93; font-size: 7px; letter-spacing: .06em; }

@media (max-width: 370px) {
  .try-on-main-page, .try-on-subpage { padding-inline: 14px; }
  .try-on-stack { height: 236px; margin-top: 16px; transform: scale(.91); transform-origin: center top; }
  .try-on-copy h2 { font-size: 20px; }
  .mannequin-image { height: 160px; }
  .model-upload-visual { height: 285px; }
  .model-photo-preview, .digital-model-preview { height: 430px; }
  .try-on-clothing-card > span { height: 154px; }
  .try-on-confirm-pair figure > span { height: 250px; }
  .try-on-confirm-pair.count-3 figure > span { height: 188px; }
  .try-on-result-media { min-height: 390px; }
  .try-on-fixed-action.triple { padding-inline: 14px; }
}

/* Outfit collection detail and actions */
.wardrobe-card.collection-card {
  touch-action: pan-y;
  -webkit-touch-callout: none;
  user-select: none;
}

.outfit-detail-layer {
  position: fixed;
  z-index: 105;
  inset: 0;
  display: flex;
  justify-content: center;
  background: rgba(226,225,221,.94);
  opacity: 0;
  transition: opacity .28s ease;
}
.outfit-detail-layer.visible { opacity: 1; }
.outfit-detail-page {
  position: relative;
  width: min(100%, 480px);
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  background: #fbfbfa;
  color: #171716;
  box-shadow: 0 0 45px rgba(0,0,0,.09);
  overscroll-behavior: contain;
  scrollbar-width: none;
  transform: translateY(100%);
  transition: transform .34s cubic-bezier(.2,.78,.24,1);
}
.outfit-detail-page::-webkit-scrollbar { display: none; }
.outfit-detail-layer.visible .outfit-detail-page { transform: translateY(0); }
.outfit-detail-topbar {
  position: sticky;
  z-index: 8;
  top: 0;
  min-height: calc(64px + env(safe-area-inset-top));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(#fbfbfa 72%, rgba(251,251,250,.88));
}
.outfit-detail-icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e4e2dc;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #292826;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.045);
  backdrop-filter: blur(12px);
}
.outfit-detail-icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.outfit-detail-icon-button:focus-visible,
.outfit-detail-more-menu button:focus-visible,
.outfit-detail-actions button:focus-visible {
  outline: 1.5px solid #353432;
  outline-offset: 2px;
}
.outfit-detail-menu-wrap { position: relative; }
.outfit-detail-more-menu {
  position: absolute;
  z-index: 2;
  top: 50px;
  right: 0;
  width: 164px;
  overflow: hidden;
  padding: 5px;
  border: 1px solid #dedcd6;
  border-radius: 16px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 16px 35px rgba(0,0,0,.13);
  backdrop-filter: blur(16px);
}
.outfit-detail-more-menu[hidden] { display: none; }
.outfit-detail-more-menu button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #292826;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.outfit-detail-more-menu button:hover { background: #f1f0ec; }
.outfit-detail-more-menu button.danger { color: #8c302b; }
.outfit-detail-more-menu svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.outfit-detail-content { padding: 0 16px; }
.outfit-detail-hero {
  width: 100%;
  min-height: 360px;
  height: min(56dvh, 560px);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e4e2dc;
  border-radius: 22px;
  background: #efeeeb;
  cursor: zoom-in;
}
.outfit-detail-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.outfit-detail-hero:active { transform: scale(.997); }
.outfit-detail-image-missing { color: #8f8b84; font-size: 11px; }
.outfit-detail-copy { padding: 24px 2px 18px; border-bottom: 1px solid #e8e6e1; }
.outfit-detail-copy .eyebrow { margin: 0 0 7px; }
.outfit-detail-copy h1 {
  margin: 0;
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 660;
}
.outfit-detail-count { margin: 10px 0 0; color: #74716a; font-size: 11px; }
.outfit-detail-pieces { padding: 20px 0 4px; }
.outfit-detail-pieces h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.035em; }
.outfit-detail-piece-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.outfit-detail-piece-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e2e0da;
  border-radius: 17px;
  background: #fff;
}
.outfit-detail-piece-image { height: 174px; display: grid; place-items: center; background: #f0efec; }
.outfit-detail-piece-image img { width: 100%; height: 100%; object-fit: contain; }
.outfit-detail-piece-copy { min-width: 0; padding: 10px 11px 12px; }
.outfit-detail-piece-copy small {
  display: block;
  color: #8a867e;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.outfit-detail-piece-copy strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outfit-detail-no-pieces {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 18px;
  border: 1px dashed #d8d5ce;
  border-radius: 17px;
  color: #88847c;
  font-size: 11px;
  text-align: center;
}
.outfit-detail-actions { display: grid; gap: 9px; padding: 22px 0 calc(12px + env(safe-area-inset-bottom)); }
.outfit-detail-actions button {
  width: 100%;
  min-height: 48px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.outfit-detail-edit-button { border: 0; background: #232322; color: #fff; }
.outfit-detail-delete-button { border: 1px solid #d8d5ce; background: #fff; color: #7e302b; }
.outfit-detail-error {
  min-height: calc(100dvh - 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.outfit-detail-error h1 { margin: 8px 0 0; font-size: 25px; letter-spacing: -.04em; }
.outfit-detail-error > p:last-child { max-width: 280px; margin: 10px 0 0; color: #7e7a73; font-size: 11px; line-height: 1.6; }

.fullscreen-image-viewer.collection-image-viewer { background: rgba(8,8,8,.96); }
.collection-image-viewer .viewer-close {
  background: rgba(34,34,34,.88);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,.3);
}
.collection-image-viewer .viewer-zoom-controls {
  border-color: rgba(255,255,255,.18);
  background: rgba(30,30,30,.82);
}
.collection-image-viewer .viewer-zoom-controls button { color: #fff; }
.collection-image-viewer .viewer-zoom-controls button + button { border-left-color: rgba(255,255,255,.14); }

body.collection-action-open,
body.collection-edit-open,
body.collection-delete-open { overflow: hidden; }
.collection-card-action-layer {
  position: fixed;
  z-index: 175;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}
.collection-card-action-layer[hidden] { display: none; }
.collection-card-action-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(20,20,19,.3);
  backdrop-filter: blur(3px);
}
.collection-card-action-menu {
  position: relative;
  z-index: 1;
  width: min(280px, 100%);
  padding: 8px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 22px;
  background: rgba(249,248,245,.98);
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
}
.collection-card-action-menu .eyebrow { margin: 7px 10px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-card-action-menu button {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #252422;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.collection-card-action-menu button:hover { background: #eeece7; }
.collection-card-action-menu button.danger { color: #8b302b; }
.collection-edit-dialog-layer,
.collection-delete-dialog-layer { z-index: 185; }
.collection-edit-dialog label { display: grid; gap: 7px; margin: 18px 0 4px; color: #706d66; font-size: 10px; }
.collection-edit-dialog input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #dad7d1;
  border-radius: 14px;
  background: #fff;
  color: #1d1c1a;
  font-size: 16px;
  outline: none;
}
.collection-edit-dialog input:focus { border-color: #8e8a82; box-shadow: 0 0 0 3px rgba(30,30,29,.05); }
.collection-delete-confirm { border-color: #252422 !important; background: #252422 !important; color: #fff !important; }

@media (max-width: 370px) {
  .outfit-detail-content { padding-inline: 14px; }
  .outfit-detail-hero { min-height: 330px; height: 52dvh; }
  .outfit-detail-piece-image { height: 154px; }
}
