/* Lenci · Wardrobe (/wardrobe). Builds on studio.css tokens (canvas, panels, energy gradient, Sora / Inter / Cairo).
   Top bar → one column: header, the stylist, a category filter, the garment grid. Logical properties, so Arabic mirrors by itself. */
:root { --wd: linear-gradient(135deg, #d946ef 0%, #8b5cf6 55%, #f5b041 100%); --wd-h: linear-gradient(90deg, #f5c2ff 0%, #c9b8ff 55%, #fde3b0 100%); --glass: linear-gradient(180deg, rgba(23,23,35,.9), rgba(14,14,22,.94)); --ok: #86efac; --bad: #fca5a5; }
html, body { height: auto; min-height: 100%; }
body { overflow: auto; overflow-x: hidden; background: radial-gradient(1100px 650px at 85% -10%, rgba(217,70,239,.10), transparent 60%), radial-gradient(900px 600px at -10% 100%, rgba(245,176,65,.07), transparent 60%), var(--canvas); }
.wd-app { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-height: 100vh; height: auto; }
.wd-app .muted, .wd-app .muted * { color: var(--muted); }
.wd-app a.ghost { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.wd-app .ghost.danger { color: #fecaca; border-color: rgba(248,113,113,.5); }
button.busy { opacity: .55; cursor: progress; }

/* top bar */
.wd-brand { text-decoration: none; color: inherit; }
.wd-sep { color: var(--muted); font-size: 18px; line-height: 1; margin-top: -2px; }
.wd-wordmark { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; line-height: 1; background: var(--wd-h); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wd-pro { color: #fbd0f6; border-color: rgba(217,70,239,.5); background: linear-gradient(180deg, rgba(217,70,239,.14), rgba(139,92,246,.08)); }
.wd-back::before { content: ""; width: 7px; height: 7px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-inline-end: 2px; flex: none; }
[dir="rtl"] .wd-back::before { transform: rotate(-135deg); }
.wd-hint { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: none; }

/* main */
.wd-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 24px 70px; min-width: 0; display: grid; gap: 16px; align-content: start; }
.wd-page { display: grid; gap: 16px; min-width: 0; animation: wdIn .35s var(--ease) both; }
@keyframes wdIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.wd-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.wd-h1 { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.wd-sub { margin: 6px 0 0; max-width: 70ch; font-size: 13.5px; }
.wd-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wd-card { min-width: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--glass); box-shadow: var(--edge), 0 14px 34px rgba(0,0,0,.3); padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.wd-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wd-card h2 { margin: 0; font-family: var(--display); font-size: 15.5px; letter-spacing: -.01em; }
.wd-card-head p { margin: 4px 0 0; font-size: 12.5px; }
.wd-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wd-filter .chip { text-transform: none; letter-spacing: 0; font-size: 11px; padding: 6px 11px; }
.wd-selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.wd-status { margin: 0; min-height: 18px; font-size: 12.5px; color: var(--muted); flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.wd-status.err { color: var(--bad); } .wd-status.ok { color: var(--ok); }

/* gate + empty */
.wd-gate, .wd-empty { position: relative; display: grid; justify-items: center; text-align: center; gap: 10px; padding: 46px 22px; border: 1px solid var(--line); border-radius: 24px; background: var(--glass); overflow: hidden; }
.wd-gate h1, .wd-empty h2 { margin: 0; font-family: var(--display); letter-spacing: -.02em; }
.wd-gate h1 { font-size: 28px; } .wd-empty h2 { font-size: 19px; }
.wd-gate p, .wd-empty p { margin: 0; max-width: 56ch; }
.wd-loaderr { padding: 30px 22px; border-color: rgba(248,113,113,.35); }   /* the list could not be loaded: Retry, never the empty state */
.wd-orb { width: 74px; height: 74px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6, transparent 40%), var(--wd); box-shadow: 0 0 40px rgba(217,70,239,.45), 0 0 90px rgba(245,176,65,.2); margin-bottom: 6px; }
.wd-orb.small { width: 52px; height: 52px; opacity: .85; }

/* fields */
.wd-field { display: grid; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.wd-field > span { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
[dir="rtl"] .wd-field > span { letter-spacing: 0; text-transform: none; font-size: 12px; }
.wd-field input, .wd-field textarea, .wd-field select { width: 100%; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(8,8,14,.7); color: var(--ink); font: inherit; font-size: 13px; }
.wd-field textarea { resize: vertical; min-height: 56px; }
.wd-field input:focus, .wd-field textarea:focus, .wd-field select:focus { outline: none; border-color: rgba(139,92,246,.7); box-shadow: 0 0 0 3px rgba(139,92,246,.2); }
.wd-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.wd-grow { flex: 1 1 220px; }
.wd-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wd-fields .wide { grid-column: 1 / -1; }
.wd-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-cats .chip { text-transform: none; letter-spacing: 0; font-size: 11px; padding: 6px 11px; }
.wd-cats .chip:disabled { opacity: .4; cursor: not-allowed; }   /* the Cut a one-sex category (abaya, thobe…) fixes */
.wd-photo-pick { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; }
.wd-pick { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #15151d; border: 1.5px dashed rgba(255,255,255,.2); cursor: pointer; padding: 0; width: 100%; display: block; }
.wd-pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wd-pick .plus { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); pointer-events: none; }
.wd-pick.has { border-style: solid; border-color: rgba(52,211,153,.5); } .wd-pick.has .plus { display: none; }
.wd-pick input { position: absolute; inset: 0; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.wd-pick:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }

/* the garment grid */
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.wd-grid:empty { display: none; }
.wd-item { position: relative; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--glass); box-shadow: var(--edge), 0 12px 30px rgba(0,0,0,.3); transition: border-color var(--t), transform var(--t) var(--ease), box-shadow var(--t); min-width: 0; }
.wd-item:hover { border-color: rgba(255,255,255,.18); transform: translateY(-2px); }
.wd-item.sel { border-color: transparent; box-shadow: 0 0 0 2px #d946ef, 0 0 22px rgba(139,92,246,.4); }
.wd-item.hide { display: none; }
.wd-item-pic { position: relative; aspect-ratio: 1; background: #15151d; overflow: hidden; border: 0; padding: 0; width: 100%; cursor: pointer; display: block; }
.wd-item-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.wd-item:hover .wd-item-pic img { transform: scale(1.04); }
.wd-item-pic:focus-visible { outline: 2px solid #a78bfa; outline-offset: -3px; }
.wd-sel { position: absolute; top: 8px; inset-inline-start: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: rgba(10,10,15,.55); display: grid; place-items: center; color: #fff; font-size: 13px; pointer-events: none; }
.wd-item.sel .wd-sel { background: var(--active); border-color: transparent; }
.wd-cat { position: absolute; bottom: 8px; inset-inline-start: 8px; font-family: var(--display); font-weight: 700; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: rgba(10,10,15,.72); color: #e9e4ff; border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); pointer-events: none; }
[dir="rtl"] .wd-cat { letter-spacing: 0; text-transform: none; }
.wd-body { display: grid; gap: 4px; padding: 10px 12px 10px; min-width: 0; }
.wd-name { margin: 0; font-family: var(--display); font-size: 13.5px; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-meta { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.wd-acts .ghost { padding: 5px 9px; font-size: 10.5px; letter-spacing: .02em; border-radius: 9px; }

/* outfits */
.wd-outfits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.wd-outfits:empty { display: none; }
.wd-outfit { display: grid; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.025); min-width: 0; }
.wd-outfit h3 { margin: 0; font-family: var(--display); font-size: 14px; overflow-wrap: anywhere; }
.wd-outfit-pics { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-outfit-pics img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: #15151d; border: 1px solid var(--line-2); }
.wd-outfit p { margin: 0; font-size: 12.5px; overflow-wrap: anywhere; }
.wd-outfit .lab { font-family: var(--display); font-weight: 600; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .wd-outfit .lab { letter-spacing: 0; text-transform: none; }
.wd-outfit .primary { justify-self: start; padding: 8px 14px; font-size: 11px; text-transform: none; }

/* sheet + toast */
.wd-sheet-card { width: min(100%, 640px); padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.wd-sheet-card .modal-x { z-index: 2; background: rgba(10,10,15,.45); }
.wd-sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 22px 24px 14px; padding-inline-end: 56px; background: radial-gradient(90% 120% at 20% -20%, rgba(217,70,239,.25), transparent 70%); border-bottom: 1px solid var(--line); }
.wd-sheet-head h2 { margin: 0; font-size: 19px; font-family: var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.wd-sheet-body { padding: 18px 24px; overflow: auto; display: grid; gap: 14px; min-height: 100px; }
.wd-sheet-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.wd-toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 12px; max-width: min(calc(100vw - 24px), 560px); padding: 10px 16px; border-radius: 14px; background: rgba(18,18,28,.97); border: 1px solid var(--line-2); color: var(--ink); font-size: 13px; box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.wd-toast.show { animation: wdToast .3s var(--ease) both; }
@keyframes wdToast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.wd-toast span { min-width: 0; overflow-wrap: anywhere; }

/* responsive */
@media (max-width: 900px) {
  .wd-main { padding: 14px 14px 60px; }
  .wd-h1 { font-size: 22px; }
}
@media (max-width: 560px) {
  .wd-pro, .wd-back span, .wd-nav span, .wd-app .arabic { display: none; }
  .wd-back, .wd-nav { padding: 7px 9px; }
  #models-link::before { content: "✦"; }
  .wd-card { padding: 14px; border-radius: 16px; }
  .wd-fields { grid-template-columns: minmax(0, 1fr); }
  .wd-photo-pick { grid-template-columns: 96px minmax(0, 1fr); }
  .wd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wd-outfits { grid-template-columns: minmax(0, 1fr); }
  .modal { padding: 10px; }
  .wd-sheet-head { padding: 18px 16px 12px; padding-inline-end: 52px; }
  .wd-sheet-body, .wd-sheet-foot { padding-inline: 16px; }
  .wd-actions { width: 100%; } .wd-actions .primary, .wd-actions .ghost { flex: 1 1 auto; justify-content: center; }
  .wd-selbar { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .wd-page, .wd-toast.show { animation: none !important; } }
