/* The outfit page (OutfitDetailView), and the small pieces the style,
   outfit and try-on screens share (screens/outfit-kit.js: .ok-*). */

/* Values the shell's tokens lack, from the app (dark, then light). */
.app {
  --ok-bar: rgba(37, 37, 39, 0.96);            /* the .bar material over a sheet */
  --ok-chip: rgba(255, 255, 255, 0.07);       /* ItemFormChip: primary @7% */
  --ok-chip-line: rgba(255, 255, 255, 0.08);  /*               + 1pt primary @8% */
  --ok-x: rgba(0, 0, 0, 0.55);                /* xmark.circle.fill palette: white on black 55% */
  --ok-wait: #424242;                         /* TryOnPlaceholder.surface: white 0.26 / 0.62 */
  --ok-stroke: rgba(255, 255, 255, 0.12);     /* garment thumbnail: 1pt primary @12% */
  --ok-hair: rgba(255, 255, 255, 0.1);        /* card hairline: primary @10% */
  --ok-sec12: rgba(235, 235, 245, 0.072);     /* Color.secondary @12% (secondary is label @60%) */
  --ok-card: rgba(235, 235, 245, 0.06);       /* Color.secondary @10%: the outfit page's cards */
  --ok-tfill: rgba(118, 118, 128, 0.24);      /* tertiarySystemFill: an unlit season square */
}
@media (prefers-color-scheme: light) {
  .app {
    --ok-bar: rgba(249, 249, 249, 0.96);
    --ok-chip: rgba(0, 0, 0, 0.07);
    --ok-chip-line: rgba(0, 0, 0, 0.08);
    --ok-wait: #9e9e9e;
    --ok-stroke: rgba(0, 0, 0, 0.12);
    --ok-hair: rgba(0, 0, 0, 0.1);
    --ok-sec12: rgba(60, 60, 67, 0.072);
    --ok-card: rgba(60, 60, 67, 0.06);
    --ok-tfill: rgba(118, 118, 128, 0.12);
  }
}

/* ---------- Shared (outfit-kit.js) ---------- */
/* CostChip: "✦ 1", quaternary of the button's own label colour. */
/* The try-on wait: grey panel, the mannequin breathing, three dots, the light sweep. */
.ok-wait { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-l); border-radius: var(--r-panel); background: var(--ok-wait); }
.ok-wait-fig { height: min(200px, 55%); width: auto; filter: grayscale(1) blur(6px); opacity: 0.85; }
.ok-wait-dots { display: flex; gap: 6px; }
.ok-wait-dots i { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0.85; }
.ok-wait-sweep { position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.16) 50%, transparent 60%); transform: translateX(-100%); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes ok-breathe { from { opacity: 0.8; transform: scale(0.98); } to { opacity: 0.95; transform: scale(1); } }
  @keyframes ok-dot { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
  @keyframes ok-sweep { 0% { transform: translateX(-100%); } 58%, 100% { transform: translateX(100%); } }
  .ok-wait-fig { animation: ok-breathe 1.8s ease-in-out infinite alternate; }
  .ok-wait-dots i { animation: ok-dot 1.2s ease-in-out infinite; }
  .ok-wait-dots i:nth-child(2) { animation-delay: 0.24s; }
  .ok-wait-dots i:nth-child(3) { animation-delay: 0.48s; }
  .ok-wait-sweep { animation: ok-sweep 2.4s ease-in-out infinite; }
}

/* ---------- The outfit page ---------- */
[data-screen="outfit"] .page-body { display: flex; flex-direction: column; gap: var(--s-l); padding-top: calc(var(--safe-top) + var(--bar-h) + 26px); }
[data-screen="outfit"] .bar-side.end { gap: var(--s-m); }
.of-lead { display: flex; flex-direction: column; gap: var(--s-m); height: var(--of-lead, 485px); }
.of-try { position: relative; display: block; flex: 1; min-height: 200px; max-width: 100%; aspect-ratio: 3 / 4; margin: 0 auto; border-radius: var(--r-hero); overflow: hidden; background: var(--card); transition: transform var(--press); }
.of-try-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.of-try .ok-wait { border-radius: inherit; transition: opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1); }
.of-try.is-ready .ok-wait { opacity: 0; }
.app .of-try.is-pressed { opacity: 1; transform: scale(0.985); }
.app .of-wide { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 var(--s-l); border-radius: var(--r-card); background: var(--fill); font: 600 var(--t-sub)/1.2 var(--text); letter-spacing: -0.01em; transition: opacity var(--press); }
.of-wide .i { width: 20px; height: 20px; }
.of-tryon { min-height: 43px; }
/* The cards: secondary @10%, radius 12, padding 16, hairlines between rows. */
.of-card { padding: var(--s-l); border-radius: var(--r-card); background: var(--ok-card); }
.of-title { margin: 0 0 var(--s-xs) !important; font: 600 var(--t-body)/1.3 var(--serif); font-variant: small-caps; letter-spacing: 0.4px; }
.of-arr.is-lead { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--s-m); }
.of-arr.is-lead .of-title { margin: 0 !important; }
.of-arr-box { position: relative; display: flex; align-items: center; justify-content: center; }
.of-arr.is-lead .of-arr-box { flex: 1; min-height: 160px; padding: var(--s-m) 0; }
.of-arr:not(.is-lead) .of-arr-box { height: 300px; margin: var(--s-m) 0; }
.of-arr-pic { position: relative; height: 100%; max-width: 100%; aspect-ratio: var(--ar, 1); border-radius: var(--r-hero); background: var(--bg); }
.of-arr-pic .lay { inset: 10px; }
.of-arr:not(.is-lead) .of-wide { margin-bottom: 0; }
/* Name and its chips. */
.of-name { display: flex; flex-direction: column; align-items: center; gap: var(--s-l); text-align: center; }
.of-name h2 { font: 600 24px/1.2 var(--serif); letter-spacing: 0; text-wrap: balance; }
.of-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-s); }
.app .of-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 12px; border-radius: 16px; background: var(--fill); font: 600 var(--t-sub)/1 var(--text); white-space: nowrap; transition: opacity var(--press); }
.of-chip::after { content: ""; position: absolute; inset: -7px 0; }
.of-chip .i { width: 18px; height: 18px; }
/* Wearing This | Ask the Stylist (wardroPrimaryHalf) and the meter. */
.of-acts { display: flex; flex-direction: column; gap: var(--s-s); }
.of-halves { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-s); }
.app .of-half { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 50px; padding: 0 var(--s-s); border-radius: var(--r-panel); background: var(--primary); color: var(--on-primary); font: 600 var(--t-sub)/1.1 var(--text); letter-spacing: -0.01em; white-space: nowrap; transition: transform var(--press), opacity var(--press); }
.of-half .i { width: 19px; height: 19px; }
.app .of-half.is-pressed { opacity: 0.8; transform: scale(0.985); }
.of-worn { display: flex; align-items: center; justify-content: space-between; gap: var(--s-xs); min-height: 50px; padding-left: var(--s-s); }
.of-worn > span { display: inline-flex; align-items: center; gap: 6px; color: var(--acc-ink); font: 600 var(--t-sub) var(--text); white-space: nowrap; }
.of-worn .i { width: 19px; height: 19px; }
.app .of-undo { min-height: 44px; padding: 0 12px; color: var(--sub); font-size: var(--t-sub); }
.app .of-undo.is-pressed { opacity: 0.5; }
/* Rows inside a card. */
.of-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-m); min-height: 52px; padding: 8px 0; border-top: 1px solid var(--ok-hair); }
.of-card > .of-title + .of-row, .of-card > .of-row-top, .of-title + .of-stack { border-top: 0; }
.of-row-top { min-height: 44px; padding: 4px 0 0; }
.of-row-tags { justify-content: flex-start; flex-wrap: wrap; }
.of-cap { font: 500 var(--t-cap)/1.2 var(--text); letter-spacing: 0.6px; text-transform: uppercase; color: var(--sub); }
.app .of-cap-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--sub); }
.of-cap-link .i { width: 13px; height: 13px; stroke-width: 2.4; }
.app .of-add { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 29px; padding: 0 12px; border-radius: 15px; background: var(--fill); font: 600 var(--t-sub)/1 var(--text); transition: opacity var(--press); }
.of-add::after { content: ""; position: absolute; inset: -8px 0; }
.of-add .i { width: 16px; height: 16px; stroke-width: 2.3; }
.of-tag { display: inline-flex; align-items: center; height: 29px; padding: 0 12px; border-radius: 15px; background: var(--fill); font-size: var(--t-sub); }
/* Garments: 84pt tiles in an adaptive grid (min 92, gap 12), names caption. */
.of-garments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-m); margin-top: var(--s-s); }
.app .of-g { display: flex; flex-direction: column; align-items: center; gap: var(--s-xs); min-width: 0; text-align: center; }
.of-g-pic { position: relative; display: block; width: 84px; height: 84px; border-radius: var(--r-thumb); background: var(--bg); box-shadow: inset 0 0 0 1px var(--ok-stroke); transition: transform var(--press); }
.of-g-pic img { position: absolute; left: 50%; top: 50%; width: calc(86% * var(--x, 0.86)); height: calc(86% * var(--x, 0.86)); transform: translate(-50%, -50%); object-fit: contain; }
.of-g-pic img:is([data-halo], [data-halo-l]) { filter: drop-shadow(0 0 4px rgba(var(--halo-rgb), var(--halo))); }
.of-g-add { display: grid; place-items: center; }
.of-g-add .i { width: 26px; height: 26px; stroke-width: 1.6; }
.of-g-name { max-width: 92px; font-size: var(--t-cap); line-height: 1.25; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app .of-g.is-pressed { opacity: 1; }
.app .of-g.is-pressed .of-g-pic { transform: scale(0.96); }
.of-edit { margin: var(--s-m) 0 var(--s-m); }
/* Seasons: four 32pt squares. */
.of-seasons { display: flex; gap: var(--s-xs); }
.app .of-season { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-badge); background: var(--ok-tfill); color: var(--sub); transition: background 0.18s ease-out, color 0.18s ease-out, transform var(--press); }
.of-season .i { width: 15px; height: 15px; }
.app .of-season.of-spring { background: var(--spring); color: var(--on-spring); }
.app .of-season.of-summer { background: var(--summer); color: var(--on-summer); }
.app .of-season.of-fall { background: var(--fall); color: var(--on-fall); }
.app .of-season.of-winter { background: var(--winter); color: var(--on-winter); }
.app .of-season.is-pressed { opacity: 1; transform: scale(0.92); }
/* Dressiness: five bars over their words. */
.of-stack { display: flex; flex-direction: column; gap: var(--s-m); padding: 12px 0 14px; }
.of-dress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.of-band { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10px; color: var(--sub); letter-spacing: 0.2px; }
.of-band i { display: block; width: 100%; height: 18px; border-radius: 5px; background: var(--fill); }
.of-band.is-on { color: var(--acc-ink); font-weight: 600; }
.of-band.is-on i { background: var(--acc); }
/* History rows: caption left, value right. */
.of-stat { min-height: 52px; }
.of-val { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: var(--t-body); font-variant-numeric: tabular-nums; }
.of-val small { font-size: var(--t-cap); color: var(--sub); }
.of-notes { display: block; width: 100%; min-height: 26px; margin-top: var(--s-s); padding: 0; border: 0; background: none; color: var(--ink); font: var(--t-body)/1.29 var(--text); letter-spacing: -0.022em; resize: none; -webkit-appearance: none; appearance: none; }
.of-notes::placeholder { color: var(--faint); }
.app .of-notes:focus, .app .of-notes:focus-visible { outline: none; }
.of-photos { display: flex; flex-direction: column; gap: var(--s-s); padding: var(--s-m) 0 0; }
.app .of-quiet { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px; color: var(--red); font-size: var(--t-sub); transition: opacity var(--press); }
.of-quiet .i { width: 18px; height: 18px; }
.app .of-quiet.is-pressed { opacity: 0.5; }
.of-delete { align-self: center; margin-top: var(--s-s); }
[data-screen="outfit"] .demo-line { margin-top: 0 !important; }
/* The compact cost chip on a half-width button (CostChip .compact). */
.of-half .cost { height: 20px; padding: 0 6px; gap: 2px; font-size: var(--t-cap); }
.of-half .cost .i { width: 11px; height: 11px; }
