/* Closet (Garments · Wishlist · Outfits), its Filter and Sort panel and the
   Add chooser. Values from Wardro ClosetChrome, GarmentSortMenu,
   ClothingItemCard, ClosetFilterSheet, FilterChrome, OutfitGridTile,
   SelectionChrome, AddGarmentsChooser (docs/screens/demo-1to1-2026-11-23/app/SPEC.md §2.2). */
.app {
  /* Tonal fill: Color.secondary at 15% (secondary label is 60% already). */
  --cl-tonal: rgba(235, 235, 245, 0.12);
  --cl-warn: #ff9f0a;
  --cl-chooser-bg: #000;
  --cl-chooser-card: #1c1c1e;
  --cl-chooser-stage: #2c2c2e;
  --cl-fp-glass: var(--mat-sheet);
  --cl-quaternary: rgba(235, 235, 245, 0.18);
}
@media (prefers-color-scheme: light) {
  .app {
    --cl-tonal: rgba(60, 60, 67, 0.09);
    --cl-warn: #c93400;
    --cl-chooser-bg: #f2f2f7;
    --cl-chooser-card: #fff;
    --cl-chooser-stage: #f2f2f7;
    --cl-quaternary: rgba(60, 60, 67, 0.18);
  }
}

/* ---------- Search, segments, chips ---------- */
/* Pinned under the bar while the grid scrolls beneath, on the page's own colour with a hard edge
   (ClosetChrome; app 04-closet-all-scrolled, motion 08-scroll-under-bars). The ::before fills the
   strip above it and the side margins, so nothing shows between the bar and the chips. */
.cl-top { position: sticky; top: calc(var(--safe-top) + var(--bar-h) + 10px); z-index: 4; }
.cl-top::before { content: ""; position: absolute; z-index: -1; left: calc(-1 * var(--s-l)); right: calc(-1 * var(--s-l)); top: calc(-1 * (var(--safe-top) + var(--bar-h) + 10px)); bottom: 0; background: var(--bg); pointer-events: none; }
[data-screen="closet"] .page-body { transition: transform 0.36s cubic-bezier(0.2, 0.9, 0.3, 1); }
.cl-searchrow { position: relative; margin: 0 0 16px; }
.app .cl-search { margin: 0; transition: margin-right 0.32s cubic-bezier(0.2, 0.9, 0.3, 1); }
.cl-search input { padding-right: 40px; }
.app .cl-search input:focus-visible { outline: none; }
.app .cl-q-clear { position: absolute; right: 8px; top: 9px; display: grid; place-items: center; width: 26px; height: 26px; color: var(--sub); }
.cl-q-clear[hidden] { display: none; }
.cl-q-clear .i { position: static; width: 20px; height: 20px; --knock: var(--field); }
.app .cl-q-x { position: absolute; right: 0; top: 0; color: var(--ink); opacity: 0; transform: scale(0.6); pointer-events: none; transition: opacity 0.22s, transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.cl-q-x .i { stroke-width: 2.1; }
[data-screen="closet"].cl-searching .page-body { transform: translate3d(0, -47px, 0); }
[data-screen="closet"].cl-searching .cl-search { margin-right: 56px; }
[data-screen="closet"].cl-searching .cl-q-x { opacity: 1; transform: none; pointer-events: auto; }
[data-screen="closet"].cl-searching .cl-filters { display: none; }
[data-screen="closet"] .page-bar > * { transition: opacity 0.2s; }
[data-screen="closet"].cl-searching .page-bar > * { opacity: 0; pointer-events: none; }
[data-screen="closet"].cl-searching .page-bar::before { opacity: 0; }
[data-screen="closet"] .seg { height: 32px; margin: 0 0 8px; }
/* The title sits between the two groups of buttons, as the toolbar places it. */
[data-screen="closet"] .page-bar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; }

.cl-chiprow { display: flex; align-items: center; margin: 0 -16px; }
.app .cl-chips { flex: 1; min-width: 0; margin: 0; padding: 8px 20px 8px 16px; gap: 8px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); }
.app .cl-chips.is-plain { -webkit-mask-image: none; mask-image: none; padding-right: 16px; }
.app .cl-types { margin: 0 -16px; padding: 0 16px 8px; -webkit-mask-image: none; mask-image: none; }
.app .cl-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px; background: var(--cl-tonal); color: var(--ink); font-size: var(--t-sub); font-weight: 500; line-height: 20px; white-space: nowrap; letter-spacing: -0.01em; transition: background var(--receipt), color var(--receipt), transform var(--press), opacity var(--press); }
.cl-chip-n { font-size: var(--t-cap); font-weight: 600; color: var(--sub); letter-spacing: 0; }
.cl-chip .i { width: 11px; height: 11px; stroke-width: 3.2; }
.app .cl-chip.is-on { background: var(--acc); color: var(--on-acc); }
.cl-chip.is-on .cl-chip-n { color: var(--on-acc); }
.app .cl-sort { flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-right: 16px; border-radius: 50%; background: var(--cl-tonal); color: var(--ink); transition: background var(--receipt), color var(--receipt), transform var(--press), opacity var(--press); }
.cl-sort .i { width: 18px; height: 18px; }
.app .cl-sort.is-on { background: var(--acc); color: var(--on-acc); }
.app .cl-chip.is-pressed, .app .cl-sort.is-pressed { opacity: 0.7; transform: scale(0.97); }

/* The chosen values as pills: a narrowing in accent, an order in grey (ActiveFilterPill) */
.cl-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 6px; }
.cl-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--acc-tint); box-shadow: inset 0 0 0 1px var(--acc-tint-strong); color: var(--acc-ink); font-size: var(--t-sub); font-weight: 500; line-height: 20px; white-space: nowrap; }
.cl-pill .cl-pill-dot { width: 11px; height: 11px; }
.app .cl-pill button { display: grid; place-items: center; width: 22px; height: 22px; margin: -4px 0; color: inherit; opacity: 0.7; }
.cl-pill button .i { width: 16px; height: 16px; --knock: var(--bg); }
.cl-pill.is-order { background: var(--fill); box-shadow: inset 0 0 0 1px var(--fill-strong); color: var(--sub); }

/* ---------- Garment grid (16 margins, 12 gutters; the caption slot always two lines high) ---------- */
.cl-head { display: flex; align-items: baseline; gap: 6px; margin: 0 !important; padding: 6px 0 2px; font: 600 var(--t-body)/22px var(--text); letter-spacing: -0.02em; }
.cl-head span { font-size: var(--t-cap); font-weight: 400; color: var(--sub); letter-spacing: 0; }
.app .cl-grid { gap: 12px; margin: 16px 0 0; }
.app .cl-grid + .cl-head { margin-top: 14px !important; }
.app .closet-grid > .cl-grid:first-child { margin-top: 4px; }
.app .cl-tile { align-items: stretch; }
.cl-cap { display: flex; flex-direction: column; align-items: center; height: 32px; margin-top: 4px; }
.cl-cap .tile-name { margin: 0; max-width: 100%; line-height: 15px; }
.cl-cap .tile-name.one, .cl-dense .cl-cap .tile-name { -webkit-line-clamp: 1; }
.cl-cap .tile-sub { margin-top: 4px; line-height: 13px; }
.cl-star { position: absolute; z-index: 2; top: 4px; right: 4px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px var(--cl-quaternary); color: var(--acc-ink); }
.cl-star .i { width: 11px; height: 11px; }
.cl-pick { position: absolute; z-index: 3; top: 6px; left: 6px; width: 22px; height: 22px; color: var(--acc); opacity: 0; transform: scale(0.6); transition: opacity var(--receipt), transform var(--receipt); --knock: var(--on-acc); }
.cl-pick .i { width: 22px; height: 22px; }
.cl-tile.is-picked .cl-pick, .cl-otile.is-picked .cl-pick { opacity: 1; transform: none; }
.cl-tile .tile-pic::after, .cl-otile .cl-opic::after { content: ""; position: absolute; z-index: 2; inset: 1.5px; border-radius: 10.5px; border: 2.5px solid var(--acc); box-shadow: inset 0 0 0 3px var(--bg); opacity: 0; transform: scale(1.04); transition: opacity var(--receipt), transform var(--receipt); pointer-events: none; }
.cl-tile.is-picked .tile-pic::after, .cl-otile.is-picked .cl-opic::after { opacity: 1; transform: none; }

/* ---------- Outfits grid (gutter 8, three across, two rows and a fifth of the next) ---------- */
.cl-ogrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 0; }
.cl-ogrid.c1 { grid-template-columns: minmax(0, 1fr); }
.cl-ogrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cl-ogrid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cl-ogrid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.app .cl-otile { display: block; }
.app .cl-opic { position: relative; display: block; width: 100%; height: var(--oh, 194px); aspect-ratio: auto; border-radius: var(--r-card); }
.cl-tryon { position: absolute; inset: 4px; overflow: hidden; border-radius: var(--r-card); }
.cl-tryon img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.cl-lay { position: absolute; inset: 4px; }
.cl-note { position: absolute; z-index: 2; right: 4px; bottom: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; }
.cl-note .i { width: 13px; height: 13px; stroke-width: 2.1; }
[data-screen="closet"] .demo-line { margin-top: 4px; }

/* ---------- Empty and no-result states (ContentUnavailableView) ---------- */
.cu { display: flex; flex-direction: column; align-items: center; padding: 72px 8px 24px; text-align: center; }
.cu .cu-i { width: 50px; height: 50px; color: var(--sub); stroke-width: 1.4; margin-bottom: 14px; }
.cu-title { font: 700 var(--t-title)/1.2 var(--text); letter-spacing: -0.02em; }
.cu-text { max-width: 330px; margin-top: 8px !important; color: var(--sub); font-size: var(--t-sub); line-height: 1.35; }
.cu-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; margin-top: 18px; }
.app .cl-cu-btn { width: auto; min-width: 220px; max-width: 320px; }
.app .cl-cu-link { min-height: 44px; padding: 0 12px; color: var(--acc-ink); font-size: var(--t-body); }

/* ---------- Select mode: the Style button and the action bar over the tab bar ---------- */
[data-screen="closet"].cl-selecting .page-body { padding-bottom: calc(var(--tabbar-h) + var(--tabbar-gap) + 150px); }
.cl-lane { position: absolute; z-index: 6; left: 0; right: 0; bottom: calc(var(--tabbar-gap) + var(--tabbar-h) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transform: scale(0.97); transition: opacity var(--receipt), transform var(--receipt); pointer-events: none; }
.cl-lane.is-in { opacity: 1; transform: none; pointer-events: auto; }
.app .cl-style-n { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--primary); color: var(--on-primary); font-weight: 600; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22); transition: transform var(--press), opacity var(--press); }
.cl-style-n .i { width: 18px; height: 18px; }
.app .cl-style-n:disabled { opacity: 0.4; }
.cl-bar { align-self: stretch; display: flex; margin: 0 16px; padding: 0 4px; border-radius: 26px; background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: inset 0 0 0 0.5px var(--glass-rim), var(--glass-shadow); }
.app .cl-part { flex: 1 1 auto; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 8px 4px; color: var(--ink); font-size: var(--t-cap); font-weight: 500; letter-spacing: 0; white-space: nowrap; transition: opacity var(--press); }
.cl-part .i { width: 22px; height: 24px; stroke-width: 1.6; }
.cl-part span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.app .cl-part.is-red { color: var(--red); }
.app .cl-part:disabled { opacity: 0.35; }

/* ---------- Add to Your Closet (sized to its content) ---------- */
.cl-add .sheet { background: var(--cl-chooser-bg); }
.cl-mini-title { margin-bottom: 16px !important; font: 600 var(--t-title)/1.2 var(--serif); text-align: center; letter-spacing: 0; }
.cl-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.app .cl-choice { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 8px 12px; border-radius: var(--r-panel); background: var(--cl-chooser-card); box-shadow: inset 0 0 0 1px var(--fill); transition: transform var(--press), opacity var(--press); }
.app .cl-choice.is-pressed { transform: scale(0.97); opacity: 0.85; }
.cl-choice-pic { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; border-radius: var(--r-card); background: var(--cl-chooser-stage); color: var(--sub); }
.cl-choice-pic { position: relative; overflow: hidden; }
.cl-art { position: absolute; display: block; }
.cl-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cl-art.one { left: 16%; right: 16%; top: 22%; bottom: 22%; }
.cl-art.b1 { left: 8%; width: 52%; top: 14%; height: 40%; transform: rotate(-8deg); }
.cl-art.b2 { right: 6%; width: 52%; top: 30%; height: 40%; transform: rotate(7deg); }
.cl-art.b3 { left: 22%; width: 56%; bottom: 8%; height: 40%; }
.cl-art.fit { inset: 0; }
.cl-art.fit img { object-fit: cover; object-position: 50% 15%; }
.cl-art img:is([data-halo], [data-halo-l]) { filter: drop-shadow(0 0 4px rgba(var(--halo-rgb), var(--halo))); }
.cl-choice-name { font: 600 var(--t-body)/1.2 var(--serif); letter-spacing: 0; white-space: nowrap; }

/* ---------- Filter and Sort: 240pt, medium, large; glass until large ---------- */
.cl-fp:not(.is-large) .sheet { background: var(--cl-fp-glass); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6); }
.cl-fp .page-content { background: transparent; }
[data-screen="filters"] .page-scroll { top: 56px; }
.app [data-screen="filters"] .page-body { min-height: 0; padding: 0 16px calc(var(--safe-bottom) + 32px); }
.fp-head { position: absolute; z-index: 6; left: 0; right: 0; top: 0; padding: 9px 16px 8px; touch-action: none; cursor: grab; }
.fp-row { display: flex; align-items: center; gap: 16px; }
.fp-title { flex: 1; min-width: 0; font: 600 var(--t-body)/22px var(--text); letter-spacing: -0.02em; }
.app .fp-clear { color: var(--acc-ink); font-size: var(--t-sub); line-height: 22px; padding: 8px 0; margin: -8px 0; }
.app .fp-clear:disabled { opacity: 0.4; }
.app .fp-done { color: var(--acc-ink); font-size: var(--t-sub); font-weight: 600; line-height: 22px; padding: 8px 0; margin: -8px 0; }
.fp-line { margin-top: 2px !important; color: var(--sub); font-size: var(--t-foot); line-height: 18px; }
.fp-line.is-warn { display: flex; align-items: flex-start; gap: 5px; color: var(--cl-warn); }
.fp-line.is-warn .i { width: 15px; height: 15px; margin-top: 1px; }
.fp-group + .fp-group, .fp-none + .fp-group { margin-top: 20px; }
.fp-gt { display: flex; align-items: center; gap: 6px; margin: 0 0 8px !important; color: var(--sub); font: 600 var(--t-sub)/20px var(--text); letter-spacing: -0.01em; }
.fp-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--acc); color: var(--on-acc); font-size: var(--t-cap); font-weight: 700; font-variant-numeric: tabular-nums; }
.fp-flow { display: flex; flex-wrap: wrap; gap: 8px; }
.app .fchip { display: inline-grid; padding: 8px 10px; border-radius: 999px; background: var(--cl-tonal); color: var(--ink); font-size: var(--t-sub); font-weight: 500; line-height: 20px; letter-spacing: -0.01em; white-space: nowrap; transition: background var(--receipt), color var(--receipt), transform var(--press), opacity var(--press); }
.fc-w, .fc-v { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.fc-w { visibility: hidden; }
.fc-n { font-size: var(--t-cap); font-weight: 600; color: var(--sub); letter-spacing: 0; }
.fchip .i { width: 11px; height: 11px; stroke-width: 3.2; }
.fchip .dot { width: 12px; height: 12px; }
.app .fchip.is-on { background: var(--acc); color: var(--on-acc); }
.fchip.is-on .fc-n { color: var(--on-acc); }
.app .fchip.is-pressed { opacity: 0.7; transform: scale(0.97); }
.fp-none h3 { font: 600 var(--t-sub)/20px var(--text); }
.fp-none p { margin-top: 4px !important; color: var(--sub); font-size: var(--t-foot); line-height: 1.35; }
