/* style-wardrobe.css — Wardrobe, items, outfits grid, filters, modal sheets */

/* ══════════════════════════════════════════
   WARDROBE TOOLBAR
══════════════════════════════════════════ */
.wardrobe-wrap { padding-bottom: 40px; }
.outfits-wrap  { padding-bottom: 40px; }

/* ── Compact limit ── */
.wlimit-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 0;
}
.wlimit-compact-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--hint);
  white-space: nowrap;
  flex-shrink: 0;
}
.wlimit-compact-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.wlimit-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width .3s ease;
}
.wlimit-fill--warn {
  background: var(--danger);
}

/* ── Search + filter row ── */
.wardrobe-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 0;
}
.wardrobe-search-row .search-bar-wrap {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 14px;
}

/* ── Active filter chips row ── */
.filter-active-chips-row {
  display: flex;
  gap: 6px;
  padding: 6px 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-active-chips-row::-webkit-scrollbar { display: none; }
.filter-active-chips-row:empty { display: none; }

.wardrobe-filter-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wardrobe-filter-row::-webkit-scrollbar { display: none; }

.filter-pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 50px;
  background: var(--bg2);
  color: var(--text);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.filter-pill-btn--active {
  background: var(--accent);
  color: var(--accent-text);
}
.filter-active-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}
.filter-active-chips::-webkit-scrollbar { display: none; }
.filter-active-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 50px;
  background: var(--bg2);
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-active-chip-x {
  font-size: 12px;
  color: var(--hint);
  cursor: pointer;
  line-height: 1;
}
.filter-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 8px;
}
.filter-sheet-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.filter-select {
  padding: 8px 30px 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 50px;
  background: var(--bg2);
  color: var(--text);
  border: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239C8E83' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.filter-select:focus {
  outline: none;
}

.filter-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--bg2);
  color: var(--hint);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.filter-clear-btn:active { transform: scale(.9); }

.outfits-counter {
  padding: 6px 12px 0;
  font-size: 12px;
  color: var(--hint);
}

.imodal-tag-group {
  padding: 6px 16px 8px;
}
.imodal-tag-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--hint);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.imodal-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.imodal-tag-chip {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 50px;
  border: none;
  background: var(--bg2);
  color: var(--text2);
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.imodal-tag-chip.active {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 2px 8px rgba(28,25,23,.15);
}
.imodal-tag-chip:active { transform: scale(.95); }

/* ── AI Tryon ── */
.tryon-photo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40vh;
  border-radius: 16px;
  background: var(--bg2);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tryon-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.tryon-photo-change {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.5));
}
.tryon-selected-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.tryon-selected-strip::-webkit-scrollbar { display: none; }
.tryon-selected-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: var(--bg2);
}
.tryon-selected-del {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tryon-selected-add {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--hint);
  border: 2px dashed var(--border);
}

/* ── Tryon CTA top button ── */
.tryon-cta-top {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 50px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.tryon-cta-top:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── Try-on results ── */
.tryon-results {
  margin-top: 20px;
}
.tryon-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.tryon-result-card {
  background: var(--bg2);
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  transition: transform .15s;
}
.tryon-result-card:active { transform: scale(0.97); }

/* ── Look Canvas ── */
.look-canvas-wrap {
  position: relative;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.look-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  transition: aspect-ratio .3s ease;
}
.look-canvas--edit {
  aspect-ratio: 3/4;
}
.look-canvas-item {
  position: absolute;
  cursor: grab;
  touch-action: none;
  transition: box-shadow .15s;
  border-radius: 4px;
  z-index: 1;
}
.look-canvas-item:active { cursor: grabbing; }
.look-canvas-item--selected {
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 5;
}
.look-canvas-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  padding: 4px 8px;
  width: auto !important;
}
.look-canvas-emoji {
  font-size: 32px;
  width: auto !important;
  padding: 2px;
}
.look-item-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.look-toolbar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.look-toolbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  cursor: pointer;
  min-width: 52px;
}
.look-toolbar-btn:active { transform: scale(.95); }
.look-tb-icon { font-size: 18px; line-height: 1; }
.look-tb-label { font-size: 10px; color: var(--hint); line-height: 1; }

.look-info-panel {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  z-index: 20;
}
.look-emoji-picker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 10px;
  z-index: 20;
  max-height: 50%;
  overflow-y: auto;
}
.look-emoji-btn {
  background: none;
  border: none;
  font-size: 24px;
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  line-height: 1;
}
.look-emoji-btn:active { background: var(--bg2); }

/* ── Tryon category type chips ── */
.tryon-type-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 50px;
  background: var(--bg2);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
}
.tryon-type-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Photo slider (Instagram-style) ── */
.photo-slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}
.photo-slider-slide {
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}
.photo-slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.photo-slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.2s;
}
.photo-slider-dot.active {
  background: #fff;
}

/* ── Background task pill ── */
.bg-task-pill {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow-lg, 0 4px 20px rgba(0,0,0,0.15));
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.bg-task-pill.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.bg-task-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AI Chat messages ── */
.ai-chat-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 85%;
  align-self: flex-start;
  background: var(--bg2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.ai-chat-msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}

.photo-hint {
  font-size: 12px;
  color: var(--hint);
  background: var(--bg2);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 16px 10px;
  line-height: 1.4;
}

/* ══════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════ */
.search-bar-wrap {
  display: flex;
  align-items: center;
  margin: 12px 12px 0;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
}
.search-icon { color: var(--hint); display: flex; align-items: center; flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.search-input::placeholder { color: var(--hint); }
.search-clear {
  background: var(--bg2);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

/* ══════════════════════════════════════════
   CATEGORY FILTER CHIPS
══════════════════════════════════════════ */
.cat-filter-bar {
  display: flex;
  gap: 8px;
  padding: 12px 12px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-filter-bar::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--hint);
  transition: all .15s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.cat-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(28,25,23,.22);
}

/* ══════════════════════════════════════════
   3-COL ITEM GRID
══════════════════════════════════════════ */
.items-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 12px 8px;
}
.item-thumb {
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg2);
  box-shadow: var(--shadow-sm);
  transition: transform .12s;
  position: relative;
}
.item-thumb:active { transform: scale(.96); }
.item-thumb-img {
  width: 100%;
  aspect-ratio: 3/4;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.item-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.item-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 8px 8px;
  background: linear-gradient(to top, rgba(28,25,23,.62) 0%, transparent 100%);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .01em;
}
/* legacy fallback used in renderItems / renderWardrobeAll etc */
.item-thumb > img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: var(--bg2);
}
.item-thumb-name {
  padding: 6px 8px 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text2);
}

/* ══════════════════════════════════════════
   2-COL OUTFIT GRID
══════════════════════════════════════════ */
.outfits-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 12px 24px;
}
.outfit-card-v2 {
  background: var(--card-bg);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.outfit-card-v2:active {
  transform: scale(.96);
  box-shadow: var(--shadow-sm);
}
.oc-body { padding: 10px 12px 12px; }
.oc-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.15px;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.oc-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 7px; }
.oc-tag {
  font-size: 10px;
  background: var(--bg);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--hint);
  font-weight: 500;
}
.oc-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
}
.oc-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--hint);
}
.outfit-stats-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.outfit-stat-chip {
  font-size: 13px; color: var(--text);
  background: var(--bg2); border-radius: 20px;
  padding: 4px 10px;
}
.outfit-stat-chip--muted { color: var(--hint); }
.oc-actions { display: flex; gap: 5px; }
.oc-fav-btn {
  background: var(--bg);
  border: none;
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  transition: transform .12s;
}
.oc-fav-btn:active { transform: scale(.82); }
.oc-wear-btn {
  background: var(--bg);
  border: none;
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  transition: transform .12s;
}
.oc-wear-btn:active { transform: scale(.82); }
.oc-last-worn {
  font-size: 11px;
  color: var(--hint);
  padding: 2px 0 0;
}

/* ══════════════════════════════════════════
   ITEM CARD (builder)
══════════════════════════════════════════ */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
}
.item-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s;
  position: relative;
}
.item-card:active { transform: scale(.96); }
.item-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #fff; }
.item-card .item-info { padding: 8px 10px; }
.item-card .item-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card .item-meta { font-size: 11px; color: var(--hint); margin-top: 1px; }
.item-card.selectable .item-check {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.item-card.selected { outline: 2.5px solid var(--accent); }

/* ══════════════════════════════════════════
   ITEM DETAIL
══════════════════════════════════════════ */
.item-detail-photo-wrap { overflow: hidden; }
.item-detail-body { padding: 20px 16px 8px; }

.item-detail-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
  margin-bottom: 6px;
}
.item-detail-meta {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 20px;
}

.item-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.item-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border2);
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: opacity .12s, transform .12s;
}
.item-action-btn:active { opacity: .7; transform: scale(.95); }
.item-action-btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.item-action-btn--danger  { color: #DC2626; border-color: rgba(220,38,38,.2); }

.item-outfits-section { margin-bottom: 24px; }
.item-no-outfits {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--hint);
  font-size: 14px;
  text-align: center;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

/* ══════════════════════════════════════════
   HORIZONTAL SCROLL (favorites)
══════════════════════════════════════════ */
.outfits-hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.outfits-hscroll::-webkit-scrollbar { display: none; }
.outfit-hcard {
  flex-shrink: 0;
  width: 120px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s;
}
.outfit-hcard:active { transform: scale(.94); }
.ohc-name {
  padding: 6px 8px 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text2);
}

/* ══════════════════════════════════════════
   FILTER CHIPS
══════════════════════════════════════════ */
.filter-bar {
  padding: 8px 12px 10px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--hint);
  transition: all .12s;
  box-shadow: var(--shadow-sm);
}
.filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ══════════════════════════════════════════
   WTW FILTERS
══════════════════════════════════════════ */
.wtw-filters { padding: 0 12px 8px; }
.wtw-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 12px 0 7px 2px;
}
.wtw-chips { display: flex; gap: 7px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.wtw-chips::-webkit-scrollbar { display: none; }
.wtw-chip {
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--hint);
  transition: all .12s;
}
.wtw-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.wtw-results-count {
  padding: 4px 14px 0;
  font-size: 12px;
  color: var(--hint);
  font-weight: 500;
  min-height: 20px;
}

/* ══════════════════════════════════════════
   CATEGORIES LIST
══════════════════════════════════════════ */
.settings-list { background: var(--card-bg); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.settings-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:active { background: var(--bg2); }
.settings-item .s-icon  { font-size: 18px; width: 28px; text-align: center; }
.settings-item .s-label { flex: 1; font-size: 15px; }
.settings-item .s-arrow { color: var(--hint); font-size: 18px; }

/* Settings groups */
.settings-group { margin: 0 12px; background: var(--card-bg); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.settings-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 16px 16px 6px;
}

/* ══════════════════════════════════════════
   ITEM / OUTFIT MODAL SHEET
══════════════════════════════════════════ */
.overlay--closing { animation: overlay-out .22s ease-in forwards; }
.sheet--closing   { animation: sheet-down .22s cubic-bezier(.32,.72,0,1) forwards; }
@keyframes overlay-out { to { opacity: 0; } }
@keyframes sheet-down  { to { transform: translateY(100%); } }

.sheet--item,
.sheet--outfit {
  padding: 0 0 calc(24px + var(--safe-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--bg);
}

/* Photo block at top of modal */
.imodal-photo {
  width: 100%;
  height: 380px;
  position: relative;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  flex-shrink: 0;
}
.imodal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg2);
}
.imodal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(28,25,23,.45);
  color: #fff;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

/* Content inside modal */
.imodal-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text);
  padding: 4px 16px 8px;
}

.imodal-description {
  font-size: 14px;
  color: var(--hint);
  padding: 0 16px 10px;
  line-height: 1.4;
}

.imodal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}
.imodal-chip {
  background: var(--bg2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

/* Actions row */
.imodal-actions {
  display: flex;
  gap: 8px;
  padding: 4px 16px 16px;
  flex-wrap: wrap;
}
.imodal-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border2);
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: opacity .12s, transform .1s;
  white-space: nowrap;
}
.imodal-btn:active { opacity: .65; transform: scale(.95); }
.imodal-btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  flex: 1;
}
.imodal-btn--danger { color: #DC2626; border-color: rgba(220,38,38,.18); }

/* Section inside modal */
.imodal-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 16px 10px;
}

/* Related outfits hscroll */
.sheet--item .outfits-hscroll,
.sheet--outfit .outfits-hscroll {
  padding: 0 16px 4px;
}

/* Items grid inside outfit modal */
.imodal-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px;
}
.imodal-items-grid--two { grid-template-columns: repeat(2, 1fr); }
.imodal-item-thumb {
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  transition: transform .12s;
}
.imodal-item-thumb:active { transform: scale(.93); }
.imodal-item-thumb img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  display: block;
  background: var(--bg2);
}
.imodal-item-name {
  padding: 5px 6px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text2);
}

.imodal-no-outfits {
  padding: 16px;
  font-size: 13px;
  color: var(--hint);
  text-align: center;
}

/* Collage grid */
.collage-grid {
  display: grid;
  grid-template-columns: repeat(var(--cg-cols, 2), 1fr);
  grid-template-rows: repeat(var(--cg-rows, 1), 1fr);
  gap: 2px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg2);
  border-radius: inherit;
}
.collage-cell {
  overflow: hidden;
  background: #fff;
  min-height: 0;
  min-width: 0;
}

/* ── AI Stylist: limit bar ── */
.stylist-limit-bar {
  margin: 8px 16px 4px;
  padding: 10px 14px;
  background: var(--bg2);
  border-radius: 12px;
  flex-shrink: 0;
}
.stylist-limit-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--hint);
  margin-bottom: 6px;
}
.stylist-limit-coins { font-weight: 600; }
.stylist-limit-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.stylist-limit-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s;
}
.stylist-limit-fill--warn { background: var(--danger, #e53935); }

/* ── AI Stylist: history toggle ── */
.stylist-history-toggle {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.stylist-history-card {
  background: var(--bg2);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.stylist-history-prompt {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stylist-history-date {
  font-size: 11px;
  color: var(--hint);
  margin-top: 2px;
}
.stylist-history-thumbs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  overflow-x: auto;
}
.stylist-history-thumb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
}

/* ── AI Stylist: result cards ── */
.stylist-result-card {
  background: var(--bg2);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: transform .15s;
}
.stylist-result-card:active { transform: scale(0.98); }
.stylist-result-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.stylist-result-desc {
  font-size: 12px;
  color: var(--hint);
  margin-bottom: 8px;
  line-height: 1.4;
}
.stylist-result-thumbs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.stylist-result-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  border: 1.5px solid var(--border);
}
.stylist-result-thumb:active { opacity: 0.7; }

/* ── Stylist item info overlay ── */
.stylist-item-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  padding: 16px;
  overflow-y: auto;
  animation: slideUp .2s ease;
}
.stylist-item-overlay-back {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--accent);
  cursor: pointer;
  padding: 0 0 12px;
  font-weight: 600;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Admin PnL ── */
.pnl-card {
  background: var(--bg2);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}
.pnl-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pnl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.pnl-row:last-child { border-bottom: none; }
.pnl-row-label { color: var(--text); }
.pnl-row-value { font-weight: 600; color: var(--text); }
.pnl-row-value--accent { color: var(--accent); }
.pnl-row-value--danger { color: var(--danger, #e53935); }
.pnl-total {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 12px 0;
  color: var(--accent);
}

/* ── Style profile (Распаковка) ── */
.style-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin: 8px 0;
}
.style-profile-badge b { color: var(--accent); }

/* ── Wardrobe / Outfit filter slide ── */
.wardrobe-filters-slide {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}
.wardrobe-filters-slide.open {
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom-color: var(--border);
}
.filter-pill-btn--open {
  background: var(--accent) !important;
  color: #fff !important;
}
.filter-pill-btn--open svg { stroke: #fff; }

/* ── AI Generate button (gradient shimmer) ── */
.ai-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 12px 0;
  padding: 7px 12px;
  border: none;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  animation: aiShimmer 12s ease infinite;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ai-generate-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}
@keyframes aiShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
