/* The garment page (Wardro ItemDetailView, GarmentDetailSections, FactGrid,
   SeasonGrid, DressinessRangePicker; SPEC.md §2.3). */
.app {
  --gx-card: rgba(235, 235, 245, 0.075);   /* Color.secondary at 10% */
  --gx-caption: rgba(235, 235, 245, 0.6);  /* Palette.caption */
  --gx-hair: rgba(255, 255, 255, 0.1);     /* primary at 10% */
  --gx-tonal: rgba(235, 235, 245, 0.12);
  --gx-off: rgba(118, 118, 128, 0.24);     /* tertiarySystemFill */
  --gx-chip: rgba(255, 255, 255, 0.07);
  --gx-chip-rim: rgba(255, 255, 255, 0.08);
  --gx-switch-off: rgba(120, 120, 128, 0.32);
}
@media (prefers-color-scheme: light) {
  .app {
    --gx-card: rgba(60, 60, 67, 0.06);
    --gx-caption: #66666b;
    --gx-hair: rgba(0, 0, 0, 0.1);
    --gx-tonal: rgba(60, 60, 67, 0.09);
    --gx-off: rgba(118, 118, 128, 0.12);
    --gx-chip: rgba(0, 0, 0, 0.04);
    --gx-chip-rim: rgba(0, 0, 0, 0.08);
    --gx-switch-off: rgba(120, 120, 128, 0.16);
  }
}
[data-screen="garment"] .page-body { padding-top: calc(var(--safe-top) + var(--bar-h) + 16px); }

/* The photo, edge to edge, 400pt, the cut-out fitted with 8pt to spare */
.gx-hero { position: relative; height: 400px; margin: 0 -16px 16px; }
.gx-hero > img { position: absolute; left: 50%; top: 50%; width: calc((100% - 16px) * max(var(--x, 1), 0.5)); height: calc((100% - 16px) * max(var(--x, 1), 0.5)); transform: translate(-50%, -50%); object-fit: contain; }
.gx-hero > img:is([data-halo], [data-halo-l]) { filter: drop-shadow(0 0 14px rgba(var(--halo-rgb), var(--halo))); }

/* Name, the line under it, type and In Recommendations */
.gx-namebox { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 16px; text-align: center; }
.gx-name { font: 600 var(--t-large)/1.18 var(--serif); letter-spacing: 0; }
.gx-summary { color: var(--sub); font: 400 var(--t-sub)/1.3 var(--serif); }
.gx-headline { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 16px; }
.gx-kind { color: var(--sub); font-size: var(--t-sub); white-space: nowrap; }
.gx-rec { display: inline-flex; align-items: center; gap: 10px; color: var(--gx-caption); font-size: var(--t-cap); font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; white-space: nowrap; }
.app .gx-switch { position: relative; flex: none; width: 64px; height: 28px; border-radius: 14px; background: var(--gx-switch-off); transition: background-color 0.25s; }
.gx-switch i { position: absolute; left: 2px; top: 2px; width: 38px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); transition: transform 0.3s cubic-bezier(0.3, 1.3, 0.5, 1); }
.app .gx-switch.is-on { background: var(--acc); }
.gx-switch.is-on i { transform: translateX(22px); }
.app .gx-switch.is-pressed { opacity: 1; }

/* Style This Garment: the one primary, with its credit pill */
.app .gx-style { display: flex; align-items: center; gap: 10px; min-height: 50px; margin-bottom: 16px; padding: 0 16px; border-radius: var(--r-panel); background: var(--primary); color: var(--on-primary); font-weight: 600; transition: transform var(--press), opacity var(--press); }
.gx-style > .i { width: 21px; height: 21px; }
.gx-style > span:first-of-type { flex: 1; }
.app .gx-style.is-pressed { opacity: 0.8; transform: scale(0.985); }

/* Sections: fill secondary at 10%, radius 12, padding 16; New York small caps titles */
.gx-card { margin-bottom: 16px; padding: 16px; border-radius: var(--r-card); background: var(--gx-card); }
.gx-title { margin: 0 0 6px !important; font: 600 var(--t-body)/26px var(--serif); font-variant-caps: small-caps; letter-spacing: 0.4px; }
.gx-title span { margin-left: 8px; color: var(--sub); font-variant-caps: normal; font-weight: 400; }
.gx-cap { color: var(--gx-caption); font-size: var(--t-cap); font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; line-height: 16px; white-space: nowrap; }
.gx-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 8px 0 12px; border-top: 1px solid var(--gx-hair); }
.gx-pair:first-child { padding-top: 0; border-top: 0; }
.gx-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 44px; }
.gx-val { font-size: var(--t-body); line-height: 22px; overflow-wrap: anywhere; }
.gx-seasons { display: flex; gap: 4px; margin-top: 4px; }
.app .gx-sn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-badge); background: var(--gx-off); color: var(--sub); transition: background-color 0.18s, color 0.18s, transform var(--press); }
.gx-sn .i { width: 15px; height: 15px; }
.app .gx-sn.on.s { background: var(--spring); color: var(--on-spring); }
.app .gx-sn.on.u { background: var(--summer); color: var(--on-summer); }
.app .gx-sn.on.f { background: var(--fall); color: var(--on-fall); }
.app .gx-sn.on.w { background: var(--winter); color: var(--on-winter); }
.app .gx-sn.is-pressed { opacity: 1; transform: scale(0.92); }
.gx-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 4px 0; border-top: 1px solid var(--gx-hair); text-align: left; }
.gx-title + .gx-row { border-top: 0; }
.gx-facts .gx-tags { padding: 8px 0 0; min-height: 52px; }
.app .gx-add { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--gx-tonal); font-size: var(--t-sub); font-weight: 600; line-height: 20px; transition: opacity var(--press); }
.gx-add .i { width: 16px; height: 16px; stroke-width: 2.2; }

/* Outfits: tiles 84 × 112, the strip running to the card's edges */
.gx-strip { display: flex; gap: 8px; overflow-x: auto; margin: 6px -16px 0; padding: 0 16px; scrollbar-width: none; }
.gx-strip::-webkit-scrollbar { display: none; }
.app .gx-otile { position: relative; flex: 0 0 84px; height: 112px; }
.gx-opic { position: absolute; inset: 0; border-radius: var(--r-card); transition: transform var(--press); }
.app .gx-otile.is-pressed { opacity: 1; }
.gx-otile.is-pressed .gx-opic { transform: scale(0.96); }
.gx-tryon { position: absolute; inset: 4px; overflow: hidden; border-radius: 9px; }
.gx-tryon img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; display: block; }
.gx-lay { position: absolute; inset: 4px; }
.gx-note { position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; }
.gx-note .i { width: 12px; height: 12px; stroke-width: 2.1; }

/* Styling: dressiness, Reserved For, rules */
.gx-stack { display: flex; flex-direction: column; padding: 8px 0 14px; border-top: 1px solid var(--gx-hair); }
.gx-title + .gx-stack { border-top: 0; padding-top: 4px; }
.gx-dress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin-top: 10px; }
.app .gx-dl { display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-height: 44px; }
.gx-dl i { display: block; height: 18px; border-radius: 5px; background: var(--gx-tonal); transition: background-color 0.18s; }
.gx-dl span { color: var(--sub); font-size: 9px; letter-spacing: 0.2px; text-align: center; line-height: 11px; }
.gx-dl.in i { background: var(--acc); }
.gx-dl.in span { color: var(--acc-ink); font-weight: 600; }
.gx-res { display: flex; gap: 6px; margin: 10px -8px 0; }
/* One line at every phone width (OneLineChips): the chips tighten first, and wrap only past that. */
.gx-res.is-tight { gap: 4px; }
.app .gx-res.is-tight .gx-rchip { padding: 7px 8px; font-size: 14px; gap: 4px; }
.gx-res.is-wrap { flex-wrap: wrap; row-gap: 8px; }
.app .gx-rchip { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 999px; background: var(--gx-chip); box-shadow: inset 0 0 0 1px var(--gx-chip-rim); font-size: var(--t-sub); line-height: 20px; white-space: nowrap; transition: background var(--receipt), color var(--receipt), transform var(--press), opacity var(--press); }
.gx-rchip .i { width: 15px; height: 15px; }
.app .gx-rchip.is-on { background: var(--acc); box-shadow: none; color: var(--on-acc); font-weight: 600; }
.gx-link { justify-content: space-between; }
.gx-chev { width: 15px; height: 15px; color: var(--faint); stroke-width: 2.2; }

/* History: caption left, value right */
.gx-stat { justify-content: space-between; min-height: 48px; }
.gx-sv { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.gx-sv span { font-size: var(--t-body); font-variant-numeric: tabular-nums; }
.gx-sv small { color: var(--sub); font-size: var(--t-cap); }

/* Photo tools and Delete */
.gx-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.app .gx-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; padding: 10px 8px; border-radius: var(--r-card); background: var(--gx-tonal); font-size: var(--t-cap); font-weight: 600; text-align: center; transition: opacity var(--press); }
.gx-tool > .i { width: 22px; height: 22px; }
.gx-tool span { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.gx-kept { margin-top: 10px !important; color: var(--sub); font-size: var(--t-foot); }
.app .gx-delete { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-bottom: 8px; border-radius: var(--r-card); background: var(--gx-tonal); color: var(--red); font-size: var(--t-sub); font-weight: 600; transition: opacity var(--press); }
.gx-delete .i { width: 18px; height: 18px; }
