/* Style This Garment (StyleBriefForm, StyleItemLoadingView, StyleLookViews),
   its Add Garments picker, the looks and a look's page. */

/* ---------- The brief ---------- */
[data-screen="style"] .page-body { padding-bottom: 0; display: flex; flex-direction: column; }
[data-screen="style"].is-waiting .page-body { padding-bottom: calc(var(--safe-bottom) + 16px); }
.sb-brief { flex: 1; display: flex; flex-direction: column; gap: var(--s-l); padding-bottom: var(--s-l); }
.sb-hero { position: relative; flex: none; height: 332px; border-radius: var(--r-hero); }
.sb-hero-pic { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.sb-hero-pic:is([data-halo], [data-halo-l]) { filter: drop-shadow(0 0 14px rgba(var(--halo-rgb), var(--halo))); }
.sb-name { font: 600 var(--t-title)/1.2 var(--serif); letter-spacing: 0; }
.sb-sec { display: flex; flex-direction: column; gap: var(--s-s); }
.sb-sec-head { display: flex; align-items: center; gap: var(--s-m); min-height: 44px; }
.sb-sec-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-title { font: 600 var(--t-sub)/1.3 var(--text); color: var(--sub); letter-spacing: -0.01em; }
.sb-cap { font-size: var(--t-foot); line-height: 1.3; color: var(--sub); letter-spacing: -0.005em; }
.app .sb-add { flex: none; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 44px; padding: 0 12px; border-radius: 16px; background: var(--fill); font: 600 var(--t-sub)/1 var(--text); white-space: nowrap; transition: opacity var(--press); }
.sb-add::after { content: ""; position: absolute; inset: -6px 0; }
.sb-add .i { width: 16px; height: 16px; stroke-width: 2.3; }
.sb-picks { display: flex; flex-wrap: wrap; gap: var(--s-s); }
.sb-pick { position: relative; width: 72px; height: 72px; border-radius: var(--r-thumb); background: var(--ok-sec12); transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.05), opacity 0.22s ease-out; }
.sb-pick-pic { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.sb-pick-pic img { position: absolute; left: 50%; top: 50%; width: calc(89% * var(--x, 0.86)); height: calc(89% * var(--x, 0.86)); transform: translate(-50%, -50%); object-fit: contain; }
.sb-pick.is-leaving { transform: scale(0.9); opacity: 0; }
.app .sb-x { position: absolute; right: 0; top: 0; width: 44px; height: 44px; display: flex; align-items: flex-start; justify-content: flex-end; padding: 4px; color: var(--ok-x); --knock: #fff; }
.sb-x .i { width: 20px; height: 20px; }
.sb-x .i .k { stroke-width: 2.2; }
.sb-occ { display: flex; flex-wrap: wrap; gap: var(--s-s); }
.app .sb-chip { height: 31px; padding: 0 12px; border-radius: 16px; font-size: var(--t-sub); letter-spacing: -0.01em; white-space: nowrap; background: var(--ok-chip); box-shadow: inset 0 0 0 1px var(--ok-chip-line); transition: background var(--receipt), color var(--receipt), opacity var(--press), transform var(--press); }
.app .sb-chip.is-on { background: var(--acc); color: var(--on-acc); font-weight: 600; box-shadow: none; }
.app .sb-chip:disabled { opacity: 0.4; cursor: default; }
.app .sb-chip.is-pressed { opacity: 0.7; transform: scale(0.97); }
.sb-note { display: block; width: 100%; min-height: 90px; max-height: 200px; padding: var(--s-m); border: 0; border-radius: var(--r-card); background: var(--ok-sec12); color: var(--ink); font: var(--t-body)/1.29 var(--text); letter-spacing: -0.022em; resize: none; -webkit-appearance: none; appearance: none; }
.app .sb-note:focus, .app .sb-note:focus-visible { outline: none; }
/* The start bar: pinned to the sheet's foot on the bar material. */
.sb-start { position: sticky; bottom: 0; z-index: 4; margin: 0 calc(-1 * var(--s-l)); padding: var(--s-s) var(--s-l) calc(var(--safe-bottom) + var(--s-s)); background: var(--ok-bar); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); display: flex; flex-direction: column; gap: var(--s-s); }
.app .sb-go { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 var(--s-l); border-radius: var(--r-panel); background: var(--primary); color: var(--on-primary); font: 600 var(--t-body)/1 var(--text); transition: transform var(--press), opacity var(--press); }
.sb-go > span:first-of-type { flex: 1; text-align: left; }
.sb-go .i { width: 21px; height: 21px; }
.app .sb-go.is-pressed { opacity: 0.8; transform: scale(0.985); }
[data-screen="style"] .sb-brief > :not(.sb-hero), [data-screen="style"] .sb-start { transition: opacity 0.15s ease-in-out; }
[data-screen="style"].sb-fading .sb-brief > :not(.sb-hero), [data-screen="style"].sb-fading .sb-start { opacity: 0; }

/* ---------- The wait ---------- */
.sb-wait { display: flex; flex-direction: column; gap: var(--s-l); }
.sb-wait-words { display: flex; flex-direction: column; gap: var(--s-m); }
.sb-check { list-style: none; display: flex; flex-direction: column; gap: var(--s-s); }
.sb-row { display: flex; align-items: center; gap: 6px; font-size: var(--t-body); min-height: 22px; }
.sb-glyph { position: relative; flex: none; width: 22px; height: 22px; }
.sb-glyph .i { position: absolute; inset: 1px; width: 20px; height: 20px; opacity: 0; transition: opacity 0.25s ease-out, transform 0.25s ease-out; }
.sb-glyph .g-up { stroke-width: 1.5; color: var(--faint); }
.sb-glyph .g-now { color: var(--acc-ink); }
.sb-glyph .g-done { color: var(--sub); stroke-width: 2.2; transform: scale(0.6); }
.sb-row[data-s="up"] .g-up, .sb-row[data-s="now"] .g-now { opacity: 1; }
.sb-row[data-s="done"] .g-done { opacity: 1; transform: none; }
.sb-row[data-s="up"] .sb-words { color: var(--faint); }
.sb-row[data-s="done"] .sb-words { color: var(--sub); }
.sb-words { transition: color 0.25s ease-out; }
.sb-leave { font-size: var(--t-foot); line-height: 1.35; color: var(--sub); }
.sb-ghosts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-l) var(--s-m); }
.sb-ghost { display: flex; flex-direction: column; align-items: center; gap: var(--s-xs); }
.sb-ghost-pic { width: 100%; aspect-ratio: 1; border-radius: var(--r-card); display: grid; place-items: center; color: var(--faint); opacity: 0.6; }
.sb-ghost-pic .i { width: 30px; height: 30px; }
.sb-ghost i { width: 90px; height: 16px; border-radius: var(--r-badge); background: var(--sub); opacity: 0.3; }
.sb-wait.is-leaving > * { opacity: 0; transition: opacity 0.3s cubic-bezier(0.42, 0, 0.58, 1); }
@media (prefers-reduced-motion: no-preference) {
  @keyframes sb-breathe { from { transform: scale(0.97); } to { transform: scale(1); } }
  @keyframes sb-sparkle { 0%, 100% { transform: scale(0.9) rotate(-10deg); } 50% { transform: scale(1.05) rotate(10deg); } }
  @keyframes sb-sweep { from { background-position: 120% 0; } to { background-position: -20% 0; } }
  @keyframes sb-phrase { from { opacity: 0; transform: translateY(4px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
  @keyframes sb-in { from { opacity: 0; } to { opacity: 1; } }
  .sb-hero.is-breathing .sb-hero-pic { animation: sb-breathe 1.8s ease-in-out infinite alternate; }
  .sb-row[data-s="now"] .g-now { animation: sb-sparkle 1.6s ease-in-out infinite; }
  .sb-row[data-s="now"] .sb-words {
    background: linear-gradient(100deg, var(--sub) 35%, var(--ink) 50%, var(--sub) 65%) 0 0 / 250% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: sb-sweep 1.8s linear infinite;
  }
  .sb-row[data-s="now"] .sb-words.is-new { animation: sb-phrase 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) both, sb-sweep 1.8s linear infinite; }
  .sb-wait-words, .sb-ghosts { animation: sb-in 0.3s cubic-bezier(0.42, 0, 0.58, 1) both; }
}

/* ---------- Add Garments (ClosetItemPicker) ---------- */
[data-screen="stylepick"] .page-body { padding-bottom: calc(var(--safe-bottom) + 24px); }
.sp-group { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 0; font: 600 var(--t-body)/1.3 var(--text); }
.sp-group:first-child { margin-top: 0; }
.sp-group span { font: 400 var(--t-cap) var(--text); color: var(--sub); }
.sp-grid { margin-top: var(--s-s); }
.sp-tile .tile-pic { transition: box-shadow var(--receipt), transform var(--press); }
.sp-tile.is-on .tile-pic { box-shadow: inset 0 0 0 1.5px var(--sheet-page), inset 0 0 0 4px var(--acc); }
.sp-check { position: absolute; left: 6px; top: 6px; line-height: 0; color: var(--acc); --knock: var(--on-acc); opacity: 0; transform: scale(0.6); transition: opacity var(--receipt), transform var(--receipt); }
.sp-check .i { width: 20px; height: 20px; }
.sp-tile.is-on .sp-check { opacity: 1; transform: none; }
.sp-tile[aria-disabled="true"] { opacity: 0.4; }
.sp-foot { position: sticky; bottom: calc(var(--safe-bottom) + 12px); display: flex; justify-content: center; margin-top: 24px; pointer-events: none; }
.app .sp-add { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 50px; padding: 0 22px; border-radius: 25px; background: var(--primary); color: var(--on-primary); font-weight: 600; box-shadow: inset 0 0 0 0.5px var(--glass-rim), 0 3px 10px rgba(0, 0, 0, 0.22); transition: transform var(--press), opacity var(--press), background var(--receipt); }
.app .sp-add .i { width: 18px; height: 18px; stroke-width: 2.3; }
.app .sp-add:disabled { background: var(--card); color: var(--sub); box-shadow: none; cursor: default; }
.app .sp-add.is-pressed { opacity: 0.8; transform: scale(0.97); }
.sp-empty { display: grid; justify-items: center; gap: 8px; padding: 4rem 1rem; text-align: center; color: var(--sub); }
.sp-empty .i { width: 40px; height: 40px; }
.sp-empty h3 { color: var(--ink); font: 600 var(--t-body) var(--text); }

/* ---------- The looks ---------- */
.lk-title { display: block; width: 168px; margin: 0 auto; white-space: normal; line-height: 1.12; }
[data-screen="looks"] .bar-title { white-space: normal; overflow: visible; }
[data-screen="looks"] .page-bar { height: calc(var(--bar-h) + 34px); }
[data-screen="looks"] .page-body { padding-top: calc(var(--bar-h) + 38px); }
.lk-intro { margin-bottom: var(--s-l) !important; font-size: var(--t-sub); line-height: 1.35; letter-spacing: -0.01em; }
.lk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-l) var(--s-m); }
.app .lk-tile { display: flex; flex-direction: column; align-items: center; gap: var(--s-xs); min-width: 0; text-align: center; }
.lk-pic { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: var(--r-card); transition: transform var(--press), box-shadow var(--receipt); }
.lk-pic .lay { inset: 8px; }
.lk-pic.is-on { box-shadow: inset 0 0 0 1.5px var(--sheet-page), inset 0 0 0 4px var(--acc); }
.lk-check { position: absolute; left: 6px; top: 6px; line-height: 0; color: var(--sub); --knock: var(--on-acc); }
.lk-pic.is-on .lk-check { color: var(--acc); }
.lk-check .i { width: 22px; height: 22px; }
.app .lk-tile.is-pressed { opacity: 1; }
.app .lk-tile.is-pressed .lk-pic { transform: scale(0.96); }
.lk-name { font: 600 var(--t-body)/1.25 var(--text); letter-spacing: -0.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lk-saved { display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-cap); color: var(--sub); letter-spacing: 0; }
.lk-saved .i { width: 12px; height: 12px; stroke-width: 2.4; }
.lk-lane { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: center; gap: var(--s-s); margin: var(--s-l) calc(-1 * var(--s-l)) calc(-1 * (var(--safe-bottom) + 32px)); padding: var(--s-s) var(--s-l) calc(var(--safe-bottom) + var(--s-s)); background: var(--ok-bar); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
.app .lk-cancel, .app .lk-save { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--r-card); background: var(--fill); font: 600 var(--t-sub) var(--text); transition: opacity var(--press), transform var(--press); }
.app .lk-save { border-radius: 22px; background: var(--primary); color: var(--on-primary); font-size: var(--t-body); }
.app .lk-save:disabled { opacity: 0.4; }
.lk-save .i { width: 19px; height: 19px; }
.lk-receipt { position: sticky; bottom: calc(var(--safe-bottom) + 8px); z-index: 4; display: flex; align-items: center; gap: var(--s-s); min-height: 44px; margin-top: var(--s-l); padding: 0 4px 0 12px; border-radius: var(--r-card); background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); font-size: var(--t-sub); }
.lk-receipt > .i { width: 16px; height: 16px; color: var(--sub); stroke-width: 2.2; }
.lk-receipt span { flex: 1; }
.app .lk-receipt button { min-width: 44px; min-height: 44px; padding: 0 8px; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes lk-arrive { from { opacity: 0; } to { opacity: 1; } }
  [data-screen="looks"] .page-content { animation: lk-arrive 0.3s cubic-bezier(0.42, 0, 0.58, 1) both; }
  .lk-pic.is-fresh .lay { animation: lk-arrive 0.35s ease-out var(--d, 0.4s) both; }
  .lk-receipt { animation: v4-arrive 0.2s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
}

/* ---------- One look ---------- */
.lp-hero { position: relative; height: 420px; border-radius: var(--r-hero); }
.lp-hero .lay { inset: 8px; }
.lp-words { display: flex; flex-direction: column; gap: var(--s-s); margin-top: var(--s-l); }
.lp-count { font-size: var(--t-cap); color: var(--sub); letter-spacing: 0; }
.lp-why { display: flex; gap: 8px; font-size: var(--t-sub); line-height: 1.35; color: var(--sub); letter-spacing: -0.01em; }
.lp-why .i { width: 20px; height: 20px; margin-top: -1px; stroke-width: 1.5; }
.lp-ctl { display: flex; flex-direction: column; align-items: center; gap: var(--s-s); margin-top: var(--s-l); }
.app .lp-save { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--primary); color: var(--on-primary); font: 600 var(--t-body) var(--text); transition: opacity var(--press), transform var(--press); }
.app .lp-save.is-pressed { opacity: 0.8; transform: scale(0.985); }
.lp-save .i { width: 21px; height: 21px; }
.app .lp-wide { 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) var(--text); transition: opacity var(--press); }
.lp-wide .i { width: 20px; height: 20px; }
.lp-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-s); width: 100%; }
