:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-strong: rgba(118, 118, 128, 0.2);
  --label: #1d1d1f;
  --label-2: rgba(60, 60, 67, 0.72);
  --label-3: rgba(60, 60, 67, 0.45);
  --separator: rgba(60, 60, 67, 0.18);
  --accent: #0066cc;
  --accent-ink: #ffffff;
  --danger: #c4251d;
  --tile: #ececee;
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --label: #f5f5f7;
    --label-2: rgba(235, 235, 245, 0.7);
    --label-3: rgba(235, 235, 245, 0.42);
    --separator: rgba(84, 84, 88, 0.6);
    --accent: #2997ff;
    --accent-ink: #000000;
    --danger: #ff6961;
    --tile: #2c2c2e;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 17px/1.41 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

h1, h2, p { margin: 0; }

button, input { font: inherit; color: inherit; }

/* Header */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
  padding: calc(env(safe-area-inset-top) + 8px) 16px 12px;
}

.bar-inner {
  max-width: 1080px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Buttons */
.btn {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:focus-visible, .segmented button:focus-visible, .card-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--fill); color: var(--accent); }
.btn-plain { background: none; color: var(--accent); padding: 0 8px; font-weight: 400; font-size: 17px; }
.btn-strong { font-weight: 600; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* Segmented control */
.segmented {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--fill);
  border-radius: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }

.segmented button,
.segmented-form span {
  flex: 1 0 auto;
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  position: relative;
}
/* Extend touch target to 44pt without changing the visual size */
.segmented button::after,
.segmented-form span::after {
  content: "";
  position: absolute;
  inset: -6px 0;
}
.segmented button[aria-selected="true"],
.segmented-form input:checked + span {
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) {
  .segmented button[aria-selected="true"],
  .segmented-form input:checked + span { background: #636366; }
}

/* Grid */
main {
  max-width: calc(1080px + 32px);
  margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 32px);
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }

.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--fill);
}
.card-meta { padding: 8px 12px 12px; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  font-size: 13px;
  color: var(--label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-action {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.card-action svg {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  fill: none;
}
.card-redo { right: 44px; }
.card[aria-busy="true"] .card-action { visibility: hidden; }

/* Cutouts sit on a neutral tile instead of filling the frame */
.card-cutout img {
  object-fit: contain;
  padding: 12px;
  background: var(--tile);
}
.card-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--label-2);
}
.card-progress::before, .cutout-status.is-busy::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--fill-strong);
  border-top-color: var(--label-2);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .card-progress::before, .cutout-status.is-busy::before { animation-duration: 2.4s; }
}

/* Empty + banner */
.empty { padding: 64px 0; max-width: 360px; }
.empty h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.empty p { color: var(--label-2); margin-bottom: 24px; }

.banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border-left: 3px solid var(--danger);
  font-size: 15px;
}

/* Sheet */
.sheet {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - env(safe-area-inset-top) - 24px);
  margin: auto auto 0;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 24px);
  border: 0;
  border-radius: 14px 14px 0 0;
  background: var(--bg);
  color: var(--label);
  overflow-y: auto;
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.4); }
@media (min-width: 600px) {
  .sheet { margin: auto; border-radius: 14px; padding-bottom: 24px; }
}
.sheet[open] { animation: sheet-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0 -16px 16px;
  padding: 8px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--separator);
}
.sheet-head h2 { font-size: 17px; font-weight: 600; }
.sheet-head .btn:first-child { justify-self: start; }
.sheet-head .btn:last-child { justify-self: end; }

.photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--separator);
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 24px;
}
.photo:has(+ .cutout-status:not([hidden])) { margin-bottom: 8px; }
.cutout-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin-bottom: 24px;
  padding: 0 16px;
  font-size: 13px;
  color: var(--label-2);
}
.cutout-status.is-note { color: var(--label); }
.photo input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.photo:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.photo-hint { display: grid; gap: 4px; text-align: center; padding: 16px; pointer-events: none; }
.photo-hint strong { color: var(--accent); font-weight: 600; }
.photo-hint span { font-size: 13px; color: var(--label-2); }

.group { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.group-label {
  padding: 0 0 8px 16px;
  font-size: 13px;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.segmented-form label { display: contents; }
.segmented-form input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-form input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.list {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  gap: 16px;
}
.row + .row { box-shadow: inset 16px 0.5px 0 var(--surface), inset 0 0.5px 0 var(--separator); }
.row > span { width: 72px; flex: none; }
.row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  background: none;
  outline: none;
  font-size: 17px;
}
.row input::placeholder { color: var(--label-3); }

.form-error {
  margin-top: 16px;
  padding: 0 16px;
  color: var(--danger);
  font-size: 15px;
}

/* Tab bar */
body:has(.tabbar) main { padding-bottom: calc(env(safe-area-inset-bottom) + 49px + 32px); }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
}
.tabbar a {
  flex: 0 1 160px;
  min-height: 49px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  color: var(--label-2);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
}
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: var(--radius-sm); }
.tabbar svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Profile */
.bar-inner-solo { margin-bottom: 0; min-height: 44px; }

.tip {
  margin-bottom: 24px;
  max-width: 640px;
  font-size: 15px;
  color: var(--label-2);
}
.tip strong { color: var(--label); font-weight: 600; margin-right: 4px; }

.slots {
  display: grid;
  gap: 24px;
}
@media (min-width: 700px) { .slots { grid-template-columns: 3fr 2fr; align-items: start; } }

.slot {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 16px;
  border-bottom: 0.5px solid var(--separator);
}
.slot-head h2 { font-size: 17px; font-weight: 600; }
.slot-head p { font-size: 13px; color: var(--label-2); }

.file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
}
.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-btn input:disabled { cursor: default; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot[aria-busy="true"] .file-btn { opacity: 0.4; }

.slot-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  background: var(--fill);
}
.slot[data-kind="face"] .slot-photo { aspect-ratio: 1; }
.slot-photo img { width: 100%; height: 100%; object-fit: contain; }
.slot-empty { font-size: 15px; color: var(--label-3); }
@media (min-width: 700px) { .slot-photo { max-height: 70vh; } }
.card-progress[hidden], .cutout-status[hidden], .photo-hint[hidden] { display: none; }

/* Outfits */
.btn-link { display: inline-flex; align-items: center; text-decoration: none; }
.btn-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 16px; }
.builder { margin-bottom: 40px; }
.builder-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 800px) {
  .builder-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
  .builder-grid .flatlay { position: sticky; top: 120px; }
}

.flatlay {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  background: var(--tile);
  overflow: hidden;
}
.flatlay img, .card .flatlay img {
  position: absolute;
  width: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: none;
}
.flatlay img.is-photo { border-radius: var(--radius-sm); }
.flatlay-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--label-3);
}
.flatlay:not(.is-empty) .flatlay-empty { display: none; }
.builder-grid > .flatlay { width: 100%; max-width: min(420px, 36vh); margin: 0 auto; }

.picker { margin-bottom: 16px; }
.picker-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 0 8px;
}
.picker-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.picker-value {
  font-size: 13px;
  color: var(--label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 2px 16px 4px;
}
.picker-strip::-webkit-scrollbar { display: none; }
.pick {
  flex: none;
  width: 76px;
  height: 96px;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 0.5px var(--separator);
  cursor: pointer;
  scroll-snap-align: start;
}
.pick img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pick img.is-photo { object-fit: cover; border-radius: 4px; }
.pick[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker-none {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--label-3);
}

.save-form { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.save-form .list { flex: 1; min-width: 0; }

.saved-empty { color: var(--label-2); font-size: 15px; }
.flatlay-thumb { border-radius: 0; }
.outfit-card .card-action { top: 4px; right: 4px; }
.card-buttons { display: flex; flex-wrap: wrap; gap: 0 8px; }
.card-worn { font-size: 12px; }

/* Wear history */
.history { margin-top: 40px; }
.wear-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.wear-list:empty { display: none; }
.wear-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text del" "strip strip"; gap: 8px 12px; align-items: center; padding: 12px 8px 12px 16px; }
.wear-row + .wear-row { box-shadow: inset 16px 0.5px 0 var(--surface), inset 0 0.5px 0 var(--separator); }
@media (min-width: 700px) { .wear-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "text strip del"; } }
.wear-text { grid-area: text; min-width: 0; }
.wear-day { font-size: 15px; font-weight: 600; }
.wear-what { font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wear-strip { grid-area: strip; display: flex; gap: 8px; overflow-x: auto; }
.wear-strip img { flex: none; width: 44px; height: 56px; object-fit: contain; padding: 4px; border-radius: var(--radius-sm); background: var(--tile); }
.wear-strip img.is-photo { object-fit: cover; padding: 0; }
.wear-delete { grid-area: del; min-height: 44px; color: var(--danger); font-size: 15px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 49px + 16px);
  transform: translate(-50%, 8px);
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--label);
  color: var(--bg);
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Try On */
.btn-small { min-height: 32px; padding: 0 14px; font-size: 13px; margin-top: 8px; position: relative; }
.btn-small::after { content: ""; position: absolute; inset: -6px 0; }
.tryon-bar { justify-content: flex-start; gap: 4px; }
.tryon-bar h1 { font-size: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-link { margin-left: -8px; min-height: 44px; gap: 2px; }
.back-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tryon { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 800px) { .tryon { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.tryon-stage {
  display: flex;
  justify-content: center;
  min-height: 320px;
  border-radius: var(--radius);
  background: var(--tile);
  overflow: hidden;
  touch-action: none;
}
.tryon-stage .konvajs-content { max-width: 100%; }
.tryon-status { font-size: 15px; color: var(--label-2); margin-bottom: 16px; max-width: 520px; }
.tryon-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tryon-actions .list { flex: 1 0 100%; }
.tryon-actions .form-error { flex-basis: 100%; }
.tryon[hidden] { display: none; }
.fit-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 17px; cursor: pointer; }
.switch-row input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 51px; height: 31px; border-radius: 999px; background: var(--fill-strong);
  position: relative; cursor: pointer; transition: background-color 0.2s;
}
.switch-row input::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s;
}
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::before { transform: translateX(20px); }
.switch-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#adjust-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) { .switch-row input, .switch-row input::before { transition: none; } }
.bg-picker { margin-bottom: 24px; }
.bg-title { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--label-2); margin-bottom: 8px; }
.bg-strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.bg-pick {
  flex: 0 0 72px;
  display: grid; gap: 4px; justify-items: start;
  padding: 0; border: 0; background: none; color: var(--label-2);
  font: inherit; font-size: 12px; text-align: left; cursor: pointer;
  scroll-snap-align: start;
}
.bg-pick > span:last-child { width: 100%; line-height: 1.25; }
.bg-thumb {
  width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--fill); box-shadow: inset 0 0 0 0.5px var(--separator);
}
.bg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-thumb-plain { background: #f2f2f2; }
.bg-pick[aria-pressed="true"] { color: var(--label); font-weight: 600; }
.bg-pick[aria-pressed="true"] .bg-thumb { box-shadow: 0 0 0 2px var(--accent); }
.bg-pick:focus-visible { outline: none; }
.bg-pick:focus-visible .bg-thumb { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--surface); }
.bg-hint { font-size: 13px; color: var(--label-2); margin-top: 8px; max-width: 520px; }
.bg-hint a { color: var(--accent); }
@media (max-width: 599px) {
  .save-form { flex-wrap: wrap; }
  .save-form .list { flex: 1 0 100%; }
  .save-form .btn { flex: 1; }
}

/* Stylist */
.stylist-form { max-width: 560px; margin-bottom: 32px; }
.stylist-form .list { margin-bottom: 24px; }
.stylist-go { width: 100%; }
.stylist-form .list:has(+ .weather-note:not([hidden])) { margin-bottom: 4px; }
.weather-note { display: flex; align-items: center; gap: 4px; margin: 0 0 16px; padding-left: 16px; font-size: 13px; color: var(--label-2); }
.weather-refresh {
  min-height: 44px; padding: 0 8px; border: 0; background: none;
  font: inherit; color: var(--accent); cursor: pointer;
}
.weather-refresh:disabled { color: var(--label-3); cursor: default; }
.weather-refresh:focus-visible { outline: 2px solid var(--accent); outline-offset: -8px; border-radius: var(--radius-sm); }
@media (min-width: 600px) { .stylist-go { width: auto; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  font-size: 15px;
  cursor: pointer;
  position: relative;
}
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.completing { margin-bottom: 24px; }
.completing .picker-head { justify-content: space-between; align-items: center; padding: 0; margin-bottom: 4px; }
.completing .group-label { margin: 0; padding-bottom: 0; }
.completing-clear { font-size: 15px; margin-right: -8px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  flex: none;
  width: 72px;
  height: 88px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--tile);
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb img.is-photo { object-fit: cover; border-radius: 4px; }
.stylist-status { font-size: 15px; color: var(--label-2); margin-bottom: 16px; }
.suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 800px) { .suggestions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
.suggestion {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
}
.suggestion .thumbs { margin-bottom: 16px; }
.suggestion-title { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.suggestion-reason { font-size: 15px; color: var(--label-2); margin-bottom: 16px; flex: 1; }
.suggestion-actions { display: flex; gap: 12px; }
.suggestion-actions .btn { flex: 1; justify-content: center; }
@media (min-width: 600px) { .suggestion-actions .btn { flex: none; } }

/* Profile: body cutout status + backgrounds */
.slot-status { margin: 0; padding: 12px 16px; border-top: 0.5px solid var(--separator); }

.scenes { margin-top: 40px; }
.scenes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.scenes-head .section-title { margin-bottom: 4px; }
.scenes-head p { font-size: 15px; color: var(--label-2); max-width: 520px; }
#scene-add[aria-busy="true"] { opacity: 0.4; }
.scenes-body { display: grid; gap: 24px; }
@media (min-width: 800px) {
  .scenes-body { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
  .scene-preview { position: sticky; top: 72px; }
}
.scene-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  max-height: 70vh;
  border-radius: var(--radius);
  background: var(--fill);
  overflow: hidden;
}
.scene-preview img { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-preview-bg { object-fit: cover; }
.scene-preview-me { object-fit: contain; object-position: center bottom; padding: 8% 8% 0; }
.scene-preview .slot-empty { position: relative; padding: 16px; text-align: center; }
.scene-preview img:not([hidden]) ~ .slot-empty { align-self: end; margin-bottom: 12px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--surface); color: var(--label-2); font-size: 13px; }
.scene-preview .slot-empty[hidden] { display: none; }

.scene-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 600px) { .scene-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 900px) { .scene-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.scene-pick {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.scene-pick img { aspect-ratio: 1; }
.scene-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.scene-card:has(.scene-pick[aria-pressed="true"]) { box-shadow: 0 0 0 2px var(--accent); }

/* Wardrobe: filter chips + item detail */
.filters { display: grid; gap: 8px; margin-bottom: 16px; }
.filters[hidden], .chip-strip[hidden] { display: none; }
.chip-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 4px 16px;
  -webkit-overflow-scrolling: touch;
}
.chip-strip::-webkit-scrollbar { display: none; }
.chip-strip .chip { flex: none; white-space: nowrap; }
#colour-filter .chip { font-size: 13px; min-height: 32px; padding: 0 12px; }
#colour-filter .chip::after { inset: -6px 0; }

.card-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.card-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.card-meta, .card-title, .card-sub { display: block; }
@media (hover: hover) { .card-open:hover img { filter: brightness(0.97); } }

.detail-photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-height: 46dvh;
  width: 100%;
  margin-bottom: 24px;
  border-radius: var(--radius);
  background: var(--fill);
  overflow: hidden;
}
.detail-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-photo .card-progress { z-index: 1; }
.detail-photo.is-cutout { background: var(--tile); }
.detail-photo.is-cutout img { object-fit: contain; padding: 16px; }
@media (min-width: 600px) { .sheet#detail { max-width: 560px; } .detail-photo { aspect-ratio: 4 / 3; max-height: 36dvh; } }

.row-action {
  width: 100%;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}
.row-action:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row-action:disabled { opacity: 0.4; cursor: default; }
.row-danger { color: var(--danger); }
.btn[hidden] { display: none; }
