/* Clothes, one piece, my list, closet, plans. Tokens and shared parts are in base.css. */
.shop-page { padding-top: 24px; }
.shop-narrow { max-width: 760px; }
.shop-gap { margin-top: 18px; }
.shop-count { margin-top: 6px; }
.shop-under { margin-top: 8px; }
.shop-wait { margin-top: 14px; }
.shop-done { margin-block: 4px 16px; }
.shop-h2 { font-size: 1.375rem; margin-bottom: 14px; }
.shop-saved { margin-block: 10px 14px; }
.shop-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.shop-vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
span.photo { display: block; }

/* Loading: a still outline of what's coming. */
.skel { display: grid; gap: 12px; margin-top: 14px; }
.skel span { display: block; height: 96px; border-radius: var(--r-in); background: var(--soft); }

/* A photo framed on one part of the man. Sized here, with no transform, so reduced motion keeps the framing. */
.crop-upper img, .crop-bottom img, .crop-shoe img { position: absolute; max-width: none; }
/* From the top of the photo: his whole head, then the jacket or top. */
.crop-upper img { width: 135%; height: 135%; left: -17.5%; top: 0; }
/* These two start at 43% and 60% of the photo's height, far below any chin. */
.crop-bottom img { width: 185%; height: 185%; left: -42%; top: -80%; }
.crop-shoe img { width: 250%; height: 250%; left: -80%; top: -150%; }

/* A piece no photo shows clearly: its color fills the tile and its name sits on it. */
.photo.swatch-tile { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; color: var(--ink); }
.swatch-tile .icon { width: 28px; height: 28px; margin-bottom: auto; }
.swatch-name { font-size: 1.0625rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.ctile .swatch-name { font-size: .9375rem; }
.item-img.swatch-tile { padding: 0; }
.item-img .swatch-name, .item-img .icon { display: none; }

/* Filters */
.shop-tools { display: grid; gap: 8px; margin-block: 14px 20px; min-width: 0; }
.shop-tools .chips { margin-block: 0; margin-inline: -16px; padding: 6px 16px; }
.tool { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); align-items: center; gap: 8px; }
.tool label { font-weight: 600; font-size: 1rem; }
.tool input, .tool select { min-height: 48px; }
#c-sort { font-size: 1.125rem; }
@media (min-width: 700px) {
  .shop-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: center; }
  .shop-tools .seg, .shop-tools .chips { grid-column: 1 / -1; }
  .shop-tools .chips { margin-inline: -6px; padding-inline: 6px; }
}
@media (min-width: 1040px) {
  .shop-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-tools .seg { grid-column: auto; }
}

/* The shelf: the photo carries the tile, no box around it. */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
@media (min-width: 700px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; } }
@media (min-width: 1040px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shelf-more { margin-top: 24px; }
.psimilar { display: block; }
.ptile { display: flex; flex-direction: column; min-width: 0; }
.ptile-link { display: block; text-decoration: none; margin-bottom: 8px; transition: transform 160ms var(--out); }
.ptile-link:active { transform: scale(.98); }
.pname { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 10px; font-size: 1.0625rem; font-weight: 700; line-height: 1.25; min-height: 2.5em; }
.pprice { display: block; margin-top: 2px; font-size: 1.125rem; font-weight: 800; line-height: 1.3; }
.padd { width: 100%; min-height: 44px; margin-top: auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-in); background: transparent; font-weight: 600; font-size: 1rem; line-height: 1.2; cursor: pointer; transition: transform 160ms var(--out); }
.padd.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.padd:active { transform: scale(.97); }
.powned { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; margin-top: auto; font-weight: 700; font-size: 1rem; line-height: 1.2; color: var(--good); text-align: center; }
@media (hover: hover) and (pointer: fine) {
  .ptile-link:hover .pname { text-decoration: underline; text-underline-offset: 3px; }
  .padd:hover { border-color: var(--ink); }
  .ctile:hover .ctile-name { text-decoration: underline; text-underline-offset: 3px; }
  .plan-row:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
  .tier-row:hover { border-color: var(--ink); }
}

/* The bar above the tabs: what's gathered, and the next step. */
.buybar { position: sticky; bottom: calc(61px + env(safe-area-inset-bottom, 0px)); z-index: 15; margin-top: 24px; background: var(--surface); border-top: 1px solid var(--line); }
.buybar-in { padding-block: 12px; }
.buybar-part { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.buybar-text { flex: 1; min-width: 0; line-height: 1.3; }
.buybar-text > * { display: block; }
.buybar-text > strong { font-size: 1.0625rem; font-weight: 800; }
.buybar-text > span { font-size: .9375rem; color: var(--ink2); }
.buybar .btn { flex: none; min-height: 48px; padding: 8px 16px; font-size: 1rem; }
.buybar-add .buybar-text > strong { font-size: 1.25rem; }
.buybar-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.buybar-total > span { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.buybar-total > strong { font-size: 1.5rem; letter-spacing: -0.01em; }
.buybar-list.wide-only { display: none; }
@media (min-width: 900px) {
  .buybar { bottom: 0; }
  .buybar.phone-only, .buybar-add { display: none; }
  .buybar-list.wide-only { display: flex; }
  .buybar-part { justify-content: flex-end; gap: 24px; }
  .buybar-text { flex: none; text-align: right; }
}
/* Nothing hides behind the bar: the toast rides above it and a focused control scrolls clear of it. */
body:has(.buybar) .toast { bottom: calc(146px + env(safe-area-inset-bottom, 0px)); }
html:has(.buybar) { scroll-padding-bottom: 150px; }
@media (min-width: 900px) {
  body:has(.buybar) .toast { bottom: 96px; }
  html:has(.buybar) { scroll-padding-bottom: 90px; }
}

/* One piece */
.piece-page .look-media .big { aspect-ratio: 3 / 4; }
.piece-page .look-media .swatch-tile { aspect-ratio: 2 / 1; padding: 20px; }
.piece-page .look-media .swatch-name { font-size: clamp(1.5rem, 3.4vw, 2.25rem); font-weight: 800; }
.store-rows { display: grid; gap: 8px; }
.store-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-in); text-decoration: none; transition: transform 160ms var(--out); }
.store-row:active { transform: scale(.98); }
.store-text, .store-price { display: grid; gap: 2px; min-width: 0; }
.store-text strong { font-weight: 700; line-height: 1.25; text-decoration: underline; text-underline-offset: 3px; }
.store-price { flex: none; text-align: right; }
.store-price strong { font-size: 1.125rem; font-weight: 800; line-height: 1.2; }
.shop-shown { margin-top: 8px; }
.p-price { margin-top: 8px; font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.p-add { display: none; }
@media (min-width: 900px) { .p-add { display: inline-flex; } }
.tier-rows { display: grid; gap: 8px; }
.tier-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 1px solid var(--hair); border-radius: var(--r-in); background: transparent; text-align: left; line-height: 1.3; cursor: pointer; transition: transform 160ms var(--out); }
.tier-row:active { transform: scale(.98); }
.tier-row[aria-pressed="true"] { border: 2px solid var(--ink); padding: 9px 13px; }
.tier-name { min-width: 0; }
.tier-name .small { display: block; }
.tier-here { display: inline-block; margin-left: 8px; font-size: .9375rem; font-weight: 700; }
.tier-price { flex: none; font-weight: 800; }

/* My list */
.list-seg { margin-block: 14px 24px; max-width: 480px; }
.list-cols { display: grid; gap: 24px; min-width: 0; }
.list-cols > * { min-width: 0; }
@media (min-width: 900px) { .list-cols { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; } .lsum { position: sticky; top: 84px; } }
.shop-hint { margin-top: -6px; margin-bottom: 4px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.group-head .h-group { margin-bottom: 0; }
.litem { display: flex; align-items: flex-start; gap: 10px; min-height: 88px; padding-block: 12px; border-top: 1px solid var(--hair); }
.litem:first-child { border-top: 0; }
.litem .tick { flex: none; }
.litem-photo { flex: none; display: block; }
.item-img { width: 64px; height: 80px; }
.litem-text { flex: 1; min-width: 0; }
.litem-text .pn { display: flex; font-weight: 700; line-height: 1.25; }
.litem-price { margin-top: 2px; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.litem-state { font-size: .9375rem; font-weight: 700; color: var(--good); }
.item-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.item-acts .link { font-size: 1rem; justify-content: flex-start; text-align: left; }
.item-acts .text-btn { padding-inline: 0; }
.litem.bought .pn, .litem.bought .litem-price { text-decoration: line-through; color: var(--ink2); }
.litem.bought .litem-photo { opacity: .6; }
.lsum { padding-top: 14px; border-top: 2px solid var(--ink); display: grid; gap: 8px; }
.lsum ul { display: grid; gap: 6px; }
.lsum li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 1.0625rem; }
.lsum .lsum-total { align-items: baseline; font-weight: 700; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--hair); }
.lsum-total strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
/* On phones the bar under it is the total line. */
@media (max-width: 899px) { .lsum .lsum-total { display: none; } }

/* Closet */
.count-line { font-weight: 700; font-size: 1.125rem; }
.closet-chips { margin-block: 18px 4px; }
.closet-chips .chips { margin-inline: -16px; padding-inline: 16px; }
.closet-sec { padding-top: 22px; }
.cgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; align-items: start; }
@media (min-width: 700px) { .cgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 14px; } .closet-chips .chips { margin-inline: -6px; padding-inline: 6px; } }
@media (min-width: 1040px) { .cgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ctile { position: relative; display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: none; border-radius: var(--r-in); text-align: left; cursor: pointer; transition: transform 160ms var(--out); }
.ctile:active { transform: scale(.97); }
.ctile[aria-pressed="true"] .photo { outline: 3px solid var(--good); outline-offset: 0; }
.ctile-badge { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--good); color: var(--surface); font-size: 1rem; font-weight: 800; line-height: 1; }
.ctile-name { display: block; margin-top: 6px; font-size: .9375rem; font-weight: 600; line-height: 1.25; }
.ctile-own { display: block; font-size: .9375rem; font-weight: 700; line-height: 1.3; color: var(--good); }

/* Plans */
.plan-column { max-width: 760px; }
.plan-page { padding-block: 16px 48px; }
.plan-page > * { max-width: 760px; }
.plan-page > a.link { display: inline-flex; }
.plan-page .lead { margin-top: 8px; color: var(--ink2); font-size: 1.1875rem; }
.plan-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.plan-rows { display: grid; }
.plan-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding-block: 14px; border-top: 1px solid var(--hair); text-decoration: none; }
.plan-rows > .plan-row:first-child { border-top: 0; padding-top: 0; }
.plan-row-count { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.plan-row h3 { margin-top: 2px; }
.plan-row-line { font-size: 1.0625rem; line-height: 1.35; margin-top: 4px; }
.plan-row .small + .plan-row-line { margin-top: 6px; }
.plan-row .photo img, .plan-head-img img { object-position: top; }
.shop-past { margin-top: 28px; }
.plans-looks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-head { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 16px; align-items: start; margin-top: 8px; }
@media (min-width: 640px) { .plan-head { grid-template-columns: minmax(0, 1fr) 160px; } }
.plan-head h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
.plan-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 10px; }
.count { font-size: clamp(3rem, 12vw, 5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.count-label { font-weight: 700; }
.plan-progress { margin-top: 20px; }
.plan-progress-text { font-size: 1.125rem; font-weight: 700; margin-bottom: 6px; }
.pbar { height: 10px; border-radius: 5px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--good); transform-origin: left; transition: transform 200ms var(--out); }
.steps-head { display: flex; justify-content: flex-end; margin-top: 6px; }
.steps-head .text-btn { padding-inline: 0; }
.steps { position: relative; display: grid; gap: 0; margin-top: 10px; }
.pstep { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding-block: 12px; }
.pstep::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.pstep:first-child::before { top: 12px; }
.pstep:last-child::before { bottom: auto; height: 12px; }
.pstep:only-child::before { display: none; }
.tick { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; font-weight: 800; font-size: 1.125rem; }
.tick[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: var(--surface); }
.when-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; line-height: 1.4; }
.pstep .when { font-size: 1rem; font-weight: 700; }
.ptag { display: inline-block; padding: 1px 7px; border: 1px solid currentColor; border-radius: 6px; font-size: .875rem; font-weight: 700; line-height: 1.4; }
.ptag.late { color: var(--bad); }
.ptag.done-tag { color: var(--good); }
.ptitle { font-weight: 700; line-height: 1.3; display: block; margin-top: 2px; }
.psub { display: block; font-size: 1.125rem; }
.pstep.done .ptitle { text-decoration: line-through; color: var(--ink2); }
.plan-buy-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; line-height: 1.25; }
.plan-price { white-space: nowrap; line-height: 44px; }
.rows > .total-row { align-items: baseline; flex-wrap: wrap; padding-top: 12px; border-top: 2px solid var(--ink); font-weight: 700; }
.total-row strong { font-size: 1.25rem; font-weight: 800; }
.plan-cal { margin-top: 20px; }
.shop-end { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  .ptile-link:active, .padd:active, .ctile:active, .tier-row:active { transform: none; }
  .pbar i { transition: none; }
}
