/* ══════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════ */
:root {
  --bg:          #F7F4EF;
  --bg2:         #EDE8E0;
  --card-bg:     #FFFFFF;
  --text:        #1C1917;
  --text2:       #4A3F38;
  --hint:        #9C8E83;
  --accent:      #1C1917;
  --accent-text: #FFFFFF;
  --gold:        #B8956A;
  --gold-light:  #F0E6D6;
  --border:      rgba(28,25,23,.07);
  --border2:     rgba(28,25,23,.12);

  --shadow-sm:   0 1px 4px rgba(28,25,23,.06);
  --shadow:      0 2px 12px rgba(28,25,23,.08), 0 1px 3px rgba(28,25,23,.05);
  --shadow-md:   0 4px 20px rgba(28,25,23,.10), 0 2px 6px rgba(28,25,23,.06);
  --shadow-lg:   0 8px 32px rgba(28,25,23,.12), 0 2px 8px rgba(28,25,23,.07);

  --radius:      20px;
  --radius-md:   14px;
  --radius-sm:   10px;
  --radius-xs:   7px;

  --hdr-h:       56px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Prevent iOS auto-zoom on input focus (requires font-size >= 16px) */
input, select, textarea { font-size: 16px !important; }

/* Prevent all zoom gestures globally */
html {
  touch-action: pan-x pan-y;
  -ms-touch-action: pan-x pan-y;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

/* ══════════════════════════════════════════
   TOP NAV HEADER
══════════════════════════════════════════ */
#app-header {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: 12px;
  right: 12px;
  z-index: 100;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 8px;
  height: var(--hdr-h);
  gap: 0;
}

.hdr-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  min-width: 0;
  padding-left: 2px;
  overflow: hidden;
}

.hdr-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg2);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s;
  padding: 0;
}
.hdr-avatar-btn:active { opacity: .7; }
.hdr-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hdr-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.hdr-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  flex-shrink: 0;
}

.hdr-tab {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border-radius: 8px;
  border: none;
  background: var(--bg);
  color: var(--hint);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all .15s;
}
.hdr-tab-icon { width: 11px; height: 11px; flex-shrink: 0; opacity: .7; }

.hdr-tab.active {
  background: var(--text);
  color: #fff;
  box-shadow: 0 2px 8px rgba(28,25,23,.20);
}
.hdr-tab.active .hdr-tab-icon { opacity: 1; }
.hdr-tab:active { transform: scale(.93); }

.avatar-initials {
  font-size: 15px;
  font-weight: 700;
  color: var(--hint);
  line-height: 1;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════
   SCREEN AREA
══════════════════════════════════════════ */
#screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: calc(var(--hdr-h) + var(--safe-top) + 20px);
  padding-bottom: calc(32px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}
#screen.no-top-pad {
  padding-top: 0 !important;
}

/* ══════════════════════════════════════════
   PAGE HEADER (subpages)
══════════════════════════════════════════ */
.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 16px 16px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-header h1 {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
}
.page-header .back-btn {
  background: var(--card-bg);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  line-height: 1;
  padding-right: 2px;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  transition: opacity .15s, transform .1s;
  letter-spacing: .1px;
  font-family: inherit;
  white-space: nowrap;
}
.btn:active { opacity: .75; transform: scale(.96); }
.btn-primary   { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--bg2); color: var(--text); }
.btn-danger    { background: #DC2626; color: #fff; }
.btn-ghost     { background: none; color: var(--accent); }
.btn-gold      { background: var(--gold); color: #fff; }
.btn-full      { width: 100%; border-radius: var(--radius-md); }
.btn-sm        { padding: 8px 16px; font-size: 12px; }
.btn-icon      { padding: 0; border-radius: 50%; width: 38px; height: 38px; }

/* ══════════════════════════════════════════
   FAB
══════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: calc(28px + var(--safe-bottom));
  right: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(28,25,23,.28);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
.fab:active { transform: scale(.88); }

/* ══════════════════════════════════════════
   HOME SCREEN
══════════════════════════════════════════ */
.home-wrap { padding-bottom: 40px; }

.home-block { padding: 0 16px; margin-top: 24px; }

/* WTW hero card */
.home-wtw-section { padding: 0 16px; }

.home-hero-card {
  background: #F0EBE3;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s;
}
.home-hero-card:active { transform: scale(.985); }

.home-hero-card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text2);
  padding: 18px 18px 4px;
  text-align: center;
}
.home-hero-weather {
  font-size: 13px;
  color: var(--hint);
  padding: 0 18px 14px;
  text-align: center;
}
.home-hero-photo {
  margin: 0 12px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--bg2);
}

.home-hero-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 16px;
  background: var(--card-bg);
}
.home-hero-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--text);
}
.home-hero-arrow {
  font-size: 20px;
  color: var(--hint);
  line-height: 1;
  flex-shrink: 0;
}
.home-hero-actions {
  display: flex;
  gap: 10px;
  padding: 0 18px 18px;
  background: var(--card-bg);
}
.home-action-btn {
  flex: 1;
  padding: 11px 10px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s, opacity .12s;
  border: 1.5px solid var(--border2);
  background: var(--bg);
  color: var(--text);
}
.home-action-btn--save {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.home-action-btn:active { transform: scale(.96); opacity: .85; }

.home-hero-empty {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--hint);
  font-size: 14px;
  padding: 24px;
}

/* Section header */
.section-hdr {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.section-hdr-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
}
.section-hdr-more {
  background: none;
  border: none;
  color: var(--hint);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}

/* Situation grid */
.home-sit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.home-sit-btn {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .12s;
}
.home-sit-btn:active { transform: scale(.94); }
.sit-icon  { font-size: 26px; line-height: 1; }
.sit-label { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; }

/* Random outfit block */
.home-random-area { padding: 0 12px; }
.home-random-empty {
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
  color: var(--hint);
}
.home-random-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s;
}
.home-random-card:active { transform: scale(.98); }
.home-random-img {
  width: 110px;
  min-height: 130px;
  flex-shrink: 0;
  background: var(--bg2);
  overflow: hidden;
}
.home-random-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-random-info {
  flex: 1;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-random-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.home-random-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.home-random-tag {
  background: var(--bg2);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
}
.home-random-shuffle {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s;
  align-self: flex-start;
}
.home-random-shuffle:active { background: var(--bg2); }

/* AI block */
.home-ai-block { cursor: pointer; }
.ai-block-inner {
  background: linear-gradient(135deg, #1C1917 0%, #4A3228 100%);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  transition: opacity .15s;
}
.home-ai-block:active .ai-block-inner { opacity: .85; }
.ai-block-icon  { font-size: 32px; flex-shrink: 0; }
.ai-block-text  { flex: 1; }
.ai-block-title { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.ai-block-desc  { font-size: 12px; opacity: .7; }
.ai-block-arrow { font-size: 24px; opacity: .5; flex-shrink: 0; }

/* ══════════════════════════════════════════
   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: 4px;
  padding: 6px 12px;
  font-size: 12px;
  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: 14px;
  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);
}

/* ── 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); } }

.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); }

/* ══════════════════════════════════════════
   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;
}

/* ══════════════════════════════════════════
   OUTFIT DETAIL
══════════════════════════════════════════ */
.outfit-detail-body { padding: 20px 16px 16px; }
.outfit-detail-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
  margin-bottom: 8px;
}
.outfit-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

/* Подходит для */
.outfit-fit-block {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.outfit-fit-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}
.outfit-fit-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.outfit-fit-tag {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  box-shadow: var(--shadow-sm);
}

.outfit-detail-cta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.outfit-cta-btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border2);
  background: var(--card-bg);
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: opacity .12s, transform .12s;
  min-width: 80px;
}
.outfit-cta-btn:active { opacity: .7; transform: scale(.96); }
.outfit-cta-btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }

.outfit-items-section { margin-bottom: 24px; }
.outfit-items-section .section-hdr { padding: 0 0 12px; }
.outfit-items-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.outfit-item-thumb {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s;
  position: relative;
}
.outfit-item-thumb:active { transform: scale(.94); }
.outfit-item-thumb img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #fff; }
.outfit-item-thumb-name {
  padding: 5px 7px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-tags-section { margin-bottom: 24px; }
.outfit-tags-section .section-hdr { padding: 0 0 10px; }
.tags-edit-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-chip { background: var(--bg2); border-radius: 20px; padding: 5px 12px; font-size: 12px; color: var(--hint); font-weight: 500; }
.tag-chip.active, .tag-chip--active { background: var(--accent); color: #fff; }

.outfit-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

/* ══════════════════════════════════════════
   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;
}

/* ══════════════════════════════════════════
   PROFILE SCREEN
══════════════════════════════════════════ */
.profile-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 20px 16px;
  gap: 14px;
}
.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--hint);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.profile-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-city {
  font-size: 13px;
  color: var(--hint);
  display: flex;
  align-items: center;
  gap: 4px;
}
.profile-city--tap {
  cursor: pointer;
  padding: 2px 0;
  border-radius: 20px;
  transition: background .15s;
}
.profile-city--tap:active { opacity: .7; }
.profile-city-edit {
  font-size: 11px;
  opacity: .5;
  margin-left: 1px;
}
.profile-coins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  cursor: pointer;
  transition: opacity .15s;
}
.profile-coins-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.profile-coins-label {
  font-size: 12px;
  color: var(--hint);
}
.profile-coins:active { opacity: .7; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 12px 8px;
}
.profile-stat {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.profile-stat--tap { cursor: pointer; }
.profile-stat--tap:active { opacity: .7; }
.profile-stat-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
}
.profile-stat-label {
  font-size: 11px;
  color: var(--hint);
  font-weight: 500;
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   REFERRAL SCREEN
══════════════════════════════════════════ */
.referral-hero {
  background: linear-gradient(145deg, #1C1917 0%, #3D2B1F 100%);
  border-radius: var(--radius);
  margin: 0 12px;
  padding: 28px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.referral-hero::before {
  content: '🎁';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  opacity: .15;
}
.referral-hero-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
  margin-bottom: 8px;
}
.referral-hero-sub {
  font-size: 14px;
  opacity: .7;
  line-height: 1.4;
}

.referral-link-block {
  margin: 0 12px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}
.referral-link-text {
  flex: 1;
  font-size: 13px;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.referral-link-copy {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: opacity .12s;
}
.referral-link-copy:active { opacity: .7; }

.referral-counter {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 12px;
}
.referral-counter-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.referral-counter-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
}
.referral-counter-label {
  font-size: 12px;
  color: var(--hint);
  font-weight: 500;
  margin-top: 3px;
}

.referral-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.referral-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--hint);
  flex-shrink: 0;
}
.referral-user-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.referral-user-date { font-size: 12px; color: var(--hint); }
.referral-status {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.referral-status--active   { background: #D1FAE5; color: #065F46; }
.referral-status--pending  { background: #FEF3C7; color: #92400E; }
.referral-status--inactive { background: var(--bg2); color: var(--hint); }

/* ══════════════════════════════════════════
   BOTTOM SHEET
══════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,25,23,.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: overlay-in .2s ease-out;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 12px 16px calc(20px + var(--safe-bottom));
  animation: sheet-up .25s cubic-bezier(.32,.72,0,1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.sheet-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-bottom: 14px;
  color: var(--text);
}
.sheet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 2px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: opacity .12s;
}
.sheet-row:last-child { border-bottom: none; }
.sheet-row:active { opacity: .55; }
.sheet-row-icon  { font-size: 20px; width: 28px; text-align: center; }
.sheet-row-label { flex: 1; font-size: 15px; font-weight: 500; }
.sheet-row-arrow { color: var(--hint); font-size: 18px; }

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 11px;
  color: var(--hint);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 110px; }

/* ══════════════════════════════════════════
   FEEDBACK PAGE
══════════════════════════════════════════ */
.fb-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--hint);
  margin-bottom: 10px;
}
.fb-type-picker {
  display: flex;
  gap: 8px;
}
.fb-type-btn {
  flex: 1;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all .12s;
  box-shadow: var(--shadow-sm);
}
.fb-type-btn.active {
  border-color: var(--accent);
  background: var(--accent);
}
.fb-type-btn.active .fb-type-label { color: #fff; }
.fb-type-icon { font-size: 22px; }
.fb-type-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}
.fb-stars {
  display: flex;
  gap: 8px;
}
.fb-star {
  font-size: 34px;
  color: var(--bg2);
  cursor: pointer;
  transition: color .1s, transform .1s;
  line-height: 1;
  user-select: none;
}
.fb-star.active { color: var(--gold); }
.fb-star:active { transform: scale(1.2); }

/* Sheet subtitle */
.sheet-subtitle {
  font-size: 13px;
  color: var(--hint);
  padding: 0 20px 12px;
}
.sheet-list { padding: 0 0 8px; }

/* ══════════════════════════════════════════
   PHOTO UPLOAD
══════════════════════════════════════════ */
.photo-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 2px dashed var(--border2);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  color: var(--hint);
  font-size: 14px;
  min-height: 70px;
  background: var(--bg2);
  overflow: hidden;
  position: relative;
}
.photo-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-upload .upload-icon { font-size: 36px; }

/* AI classify */
.ai-analyzing {
  text-align: center; padding: 10px; font-size: 13px;
  color: var(--accent); font-weight: 500;
}
.ai-fields-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px;
  padding: 0 16px;
}
.ai-fields-grid .form-group--sm { margin-bottom: 10px; }
.ai-fields-grid .form-group--sm label { font-size: 11px; }
.ai-fields-grid .form-group--sm .form-input { padding: 7px 10px; font-size: 13px; }
.ai-filled { border-color: var(--accent) !important; }

/* ══════════════════════════════════════════
   LOADING & EMPTY
══════════════════════════════════════════ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 55vh;
  gap: 14px;
  color: var(--hint);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
  gap: 12px;
  text-align: center;
  color: var(--hint);
}
.empty-icon { font-size: 52px; line-height: 1; }
.empty-text { font-size: 15px; font-weight: 500; }

/* ══════════════════════════════════════════
   OUTFIT BUILDER
══════════════════════════════════════════ */
.builder-bar {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + var(--safe-bottom));
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 -4px 20px rgba(28,25,23,.08);
}
.builder-count { flex: 1; font-size: 13px; color: var(--hint); }
.builder-preview {
  display: none;
  flex-direction: row;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.builder-preview-item {
  position: relative;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.builder-preview-rm {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
}
.builder-canvas {
  display: none;
  position: relative;
  height: 320px;
  margin: 8px 12px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  touch-action: none;
}
.canvas-item {
  transition: box-shadow 0.15s;
}
.canvas-item:active {
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.builder-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px 12px 120px;
}

/* ══════════════════════════════════════════
   SNACKBAR
══════════════════════════════════════════ */
.snackbar {
  position: fixed;
  bottom: calc(28px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 13px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  text-align: center;
  animation: snack-in .2s cubic-bezier(.32,.72,0,1);
  pointer-events: none;
}
@keyframes snack-in { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ══════════════════════════════════════════
   MISC
══════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 0 16px; }
.section-title {
  padding: 14px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.screen-hint { padding: 8px 16px 4px; font-size: 13px; color: var(--hint); }
.screen-spacer { height: 32px; }

/* Tags */
.tags-section { margin: 12px; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2);
  border-radius: 50px;
  padding: 6px 10px 6px 14px;
  font-size: 13px;
}
.tag-item .del-tag { background: none; border: none; color: var(--hint); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }

/* Sizes */
.sizes-list { margin: 12px; background: var(--card-bg); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.size-row { display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); gap: 6px; overflow: hidden; }
.size-row:last-child { border-bottom: none; }
.size-name  { flex: 1; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.size-value {
  font-size: 14px; border: none; background: var(--bg2); border-radius: 8px;
  padding: 5px 10px; text-align: right; width: 80px; flex-shrink: 0; color: var(--text); font-family: inherit;
}
.size-value:focus { outline: 2px solid var(--accent); }

/* Categories */
.categories-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.category-row {
  background: var(--card-bg); border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: opacity .12s;
}
.category-row:active { opacity: .72; }
.category-row .cat-name  { font-weight: 500; }
.category-row .cat-count { font-size: 13px; color: var(--hint); }

/* WTW section stuff */
.wtw-section { padding: 0 12px 16px; }
.wtw-section-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }

/* WTW random card */
.wtw-random-card {
  margin: 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s;
}
.wtw-random-card:active { transform: scale(.98); }
.wtw-random-img {
  width: 100%;
  aspect-ratio: 4/5;
  background: var(--bg2);
  overflow: hidden;
}
.wtw-random-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wtw-random-info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wtw-random-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text);
}
.wtw-random-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.wtw-random-cnt { font-size: 12px; color: var(--hint); }
.wtw-random-actions { display: flex; gap: 8px; margin-top: 4px; }
.home-suggest-card { margin: 12px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
.hsc-body { padding: 14px 16px 16px; }
.hsc-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.hsc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.hsc-actions { display: flex; gap: 8px; }

/* Inventory */
.inventory-total-card {
  background: var(--accent); color: #fff; border-radius: var(--radius);
  padding: 28px; text-align: center; margin-bottom: 16px; box-shadow: var(--shadow-md);
}
.inventory-total-num   { font-size: 52px; font-weight: 800; letter-spacing: -2px; line-height: 1; }
.inventory-total-label { font-size: 14px; opacity: .7; margin-top: 6px; }

/* Inventory category detail */
.invcат-summary {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px 4px;
}
.invcat-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg2); border-radius: 20px;
  padding: 5px 12px; font-size: 13px;
}
.invcat-chip-color { color: var(--text); }
.invcat-chip-cnt   { color: var(--accent); font-weight: 700; }
.invcat-section    { margin-bottom: 20px; }
.invcat-section-label {
  font-size: 13px; font-weight: 600; color: var(--hint);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 14px 0 8px;
}

/* Viewing-as banner */
.viewing-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent); color: #fff;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0,0,0,.15);
  font-size: 14px;
}
.viewing-banner-text { font-weight: 500; }
.viewing-banner-exit {
  background: rgba(255,255,255,.25); border: none; color: #fff;
  border-radius: 20px; padding: 4px 12px; font-size: 12px;
  font-weight: 700; cursor: pointer; flex-shrink: 0;
}

/* Invite banner (home) */
.invite-banner {
  margin: 8px 12px 0;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  display: flex; flex-direction: column; gap: 10px;
}
.invite-banner-icon { font-size: 20px; }
.invite-banner-text { font-size: 14px; line-height: 1.4; }
.invite-banner-acts { display: flex; gap: 8px; }

/* Access screen */
.access-id-card {
  background: var(--card-bg); border-radius: var(--radius-md);
  padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.aic-label { font-size: 11px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.aic-id    { font-size: 22px; font-weight: 800; letter-spacing: .5px; margin-bottom: 4px; }
.aic-hint  { font-size: 12px; color: var(--hint); line-height: 1.4; }
.access-section-title { font-size: 13px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .5px; margin: 16px 0 6px; }
.access-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 12px;
}
.access-row:last-child { border-bottom: none; }
.access-row-info { flex: 1; min-width: 0; }
.access-row-name { font-size: 14px; font-weight: 500; }
.access-row-meta { font-size: 12px; color: var(--hint); margin-top: 2px; }
.access-row-acts { display: flex; gap: 6px; flex-shrink: 0; }
.access-form { padding-top: 4px; }

/* Avatar legacy */
.avatar-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  overflow: hidden; background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity .15s; padding: 0;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Wishlist */
.wishlist-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
.wish-card { background: var(--card-bg); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s; }
.wish-card:active { transform: scale(.96); }
.wish-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--bg2); }
/* Wishlist — redesigned */
.wishlist-wrap { padding-bottom: 40px; }

.wishlist-stats {
  padding: 14px 16px 4px;
  display: flex;
  align-items: center;
}
.wishlist-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
}

.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 8px 12px 24px;
}
.wish-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s;
}
.wish-card:active { transform: scale(.96); }

.wish-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg2);
}
.wish-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wish-del-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(28,25,23,.5);
  color: #fff;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .15s;
}
.wish-card:hover .wish-del-btn,
.wish-card:active .wish-del-btn { opacity: 1; }

.wish-info { padding: 10px 12px 12px; }
.wish-name { font-size: 13px; font-weight: 700; margin-bottom: 3px; color: var(--text); }
.wish-cat  { font-size: 11px; color: var(--hint); font-weight: 500; }

/* ══════════════════════════════════════════
   EMPTY FULL-SCREEN STATE
══════════════════════════════════════════ */
.empty-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 32px;
  text-align: center;
}
.empty-full-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 16px;
  filter: grayscale(.2);
}
.empty-full-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-full-sub {
  font-size: 14px;
  color: var(--hint);
  line-height: 1.5;
  max-width: 240px;
}

/* ══════════════════════════════════════════
   SKELETON LOADERS
══════════════════════════════════════════ */
@keyframes shimmer {
  0%   { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}
.skeleton-bar,
.skeleton-chip,
.skeleton-card-sq,
.skeleton-card-tall,
.skeleton-hero,
.skeleton-hcard,
.skeleton-sit {
  background: linear-gradient(90deg, var(--bg2) 25%, #E8E2D8 50%, var(--bg2) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
}

.skeleton-wrap { padding-bottom: 20px; }

.skeleton-bar {
  height: 14px;
  border-radius: 7px;
  display: block;
}

.skeleton-chips {
  display: flex;
  gap: 8px;
  padding: 0 12px 10px;
  overflow: hidden;
}
.skeleton-chip {
  height: 32px;
  border-radius: 50px;
  flex-shrink: 0;
}

.skeleton-grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 12px;
}
.skeleton-card-sq {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
}

.skeleton-grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 4px 12px;
}
.skeleton-card-tall {
  aspect-ratio: 3/4;
  border-radius: 18px;
}

.skeleton-hero {
  margin: 0 12px;
  height: 340px;
  border-radius: var(--radius);
}

.skeleton-hscroll {
  display: flex;
  gap: 10px;
  padding: 0 12px;
  overflow: hidden;
}
.skeleton-hcard {
  width: 120px;
  height: 145px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

.skeleton-sit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 12px;
}
.skeleton-sit {
  height: 80px;
  border-radius: var(--radius-md);
}

/* ══════════════════════════════════════════
   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(4, 1fr);
  gap: 8px;
  padding: 0 16px;
}
.imodal-item-thumb {
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: transform .12s;
}
.imodal-item-thumb:active { transform: scale(.93); }
.imodal-item-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg2);
}
.imodal-item-name {
  padding: 4px 6px 5px;
  font-size: 10px;
  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;
}

