/* ═══════════════════════════════════════════════════════
   Mix&Match — Design System
   Paleta: #1A1A2E (primary) | #E8D5C4 (secondary) | #C4A882 (accent)
   Fonts: Playfair Display (headings) | Inter (body)
═══════════════════════════════════════════════════════ */

:root {
  --primary: #1A1A2E;
  --secondary: #E8D5C4;
  --accent: #C4A882;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #1A1A2E;
  --text-muted: #7A7A8E;
  --error: #E74C3C;
  --success: #2ECC71;
  --border: #EAEAEA;
  --shadow: 0 2px 12px rgba(26,26,46,0.08);
  --shadow-lg: 0 8px 32px rgba(26,26,46,0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --nav-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --transition: 0.2s ease;
}

/* Dark mode */
[data-theme="dark"] {
  --primary: #E8D5C4;
  --secondary: #252540;
  --accent: #D4B896;
  --bg: #0F0F1A;
  --surface: #1A1A2E;
  --text: #F0EBE3;
  --text-muted: #9898B0;
  --border: #2A2A3E;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

/* Dark mode overrides para elementos específicos */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .btn-secondary {
  background: var(--secondary);
  color: var(--text);
}

[data-theme="dark"] .btn-ghost {
  color: var(--text-muted);
}

[data-theme="dark"] .look-card {
  background: var(--surface);
}

[data-theme="dark"] .community-avatar,
[data-theme="dark"] .comment-avatar {
  background: #2A2A3E;
  color: var(--text);
}

[data-theme="dark"] .roller-item {
  background: var(--surface);
}

[data-theme="dark"] .roller-item.selected {
  border-color: var(--accent);
}

[data-theme="dark"] .nav-item {
  color: var(--text-muted);
}

[data-theme="dark"] .nav-item.active {
  color: var(--primary);
}

[data-theme="dark"] .modal-sheet {
  background: var(--surface);
}

[data-theme="dark"] .upload-option {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .cat-tab {
  color: var(--text-muted);
}

[data-theme="dark"] .cat-tab.active {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .clothes-item {
  background: var(--surface);
}

[data-theme="dark"] .community-card {
  background: var(--surface);
}

[data-theme="dark"] .profile-form .form-group label,
[data-theme="dark"] .upload-form .form-group label,
[data-theme="dark"] .form-group label {
  color: var(--text);
}

[data-theme="dark"] .section-title {
  color: var(--text);
}

[data-theme="dark"] .pref-row {
  color: var(--text);
}

[data-theme="dark"] .page-footer-credit,
[data-theme="dark"] .profile-footer-credit {
  color: var(--text-muted);
}

[data-theme="dark"] .canvas-zone {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .zone-hint {
  color: var(--text-muted);
}

[data-theme="dark"] .picker-tab {
  color: var(--text-muted);
}

[data-theme="dark"] .picker-tab.active {
  color: var(--text);
  border-color: var(--accent);
}

[data-theme="dark"] .stats-card {
  background: var(--surface);
}

/* ── Reset ───────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ── App container ───────────────────────────────────── */

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}

/* ── Views ───────────────────────────────────────────── */

.view {
  display: none;
  min-height: 100dvh;
}
.view.active { display: flex; flex-direction: column; }

/* ── Pages (inside view-app) ─────────────────────────── */

.page {
  display: none;
  flex-direction: column;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 80px);
  min-height: 100dvh;
}
.page.active { display: flex; }

/* ── Page Header ─────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(20px, calc(var(--safe-top) + 8px)) 20px 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}

/* ── Buttons ─────────────────────────────────────────── */

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--secondary);
  color: var(--primary);
  border-radius: var(--radius);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  transition: opacity var(--transition);
  min-height: 48px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 14px 24px;
  font-size: 0.95rem;
  border-radius: var(--radius);
  min-height: 48px;
}

.btn-text {
  background: none;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
}

.btn-link {
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: inherit;
  text-decoration: underline;
}

.btn-full { width: 100%; }

.btn-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  transition: background var(--transition);
}
.btn-icon:hover { background: var(--border); }
.btn-icon svg { width: 22px; height: 22px; }

.btn-back {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.btn-back svg { width: 22px; height: 22px; }

.btn-danger {
  width: 100%;
  background: var(--error);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px;
  font-weight: 600;
  font-size: 1rem;
  min-height: 48px;
  margin-bottom: 12px;
}

.btn-danger-ghost {
  width: 100%;
  background: none;
  color: var(--error);
  border: 1.5px solid var(--error);
  border-radius: var(--radius);
  padding: 14px;
  font-weight: 600;
  font-size: 1rem;
  min-height: 48px;
}

/* ── Bottom Navigation ───────────────────────────────── */

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(26,26,46,0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: color var(--transition);
  min-height: 44px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--primary); }
[data-theme="dark"] .nav-item.active { color: var(--accent); }

/* ── FAB ─────────────────────────────────────────────── */

#fab-add {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  right: max(16px, calc(50vw - 240px + 16px));
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 99;
  transition: transform var(--transition), box-shadow var(--transition);
}
#fab-add:active { transform: scale(0.92); }
#fab-add svg { width: 26px; height: 26px; }

/* ── Onboarding ──────────────────────────────────────── */

.onboarding-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100dvh;
  padding: max(60px, calc(var(--safe-top) + 24px)) 32px max(48px, calc(var(--safe-bottom) + 20px));
  text-align: center;
}

.onboarding-slides { width: 100%; position: relative; }

.onboarding-slide { display: none; }
.onboarding-slide.active { display: block; }

.onboarding-illustration svg {
  width: 180px;
  height: 180px;
  margin: 0 auto 32px;
}

.onboarding-title {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}

.onboarding-text {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

.onboarding-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 32px 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--transition), width var(--transition);
  cursor: pointer;
}
.dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

.onboarding-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Auth ────────────────────────────────────────────── */

.auth-container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: max(60px, calc(var(--safe-top) + 24px)) 28px max(40px, calc(var(--safe-bottom) + 20px));
}

.auth-logo {
  text-align: center;
  margin-bottom: 48px;
}

.logo-text {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
}
.logo-text span { color: var(--accent); }

.logo-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.auth-form-section { display: none; }
.auth-form-section.active { display: block; }

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text);
}

.auth-form { display: flex; flex-direction: column; gap: 20px; }

.auth-switch {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Forms ───────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--text);
  min-height: 48px;
  transition: border-color var(--transition);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.label-optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.required { color: var(--error); }

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  padding: 10px 14px;
  background: rgba(231,76,60,0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--error);
}

.input-password-wrap {
  position: relative;
}
.input-password-wrap input { padding-right: 48px; }
.btn-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.btn-eye svg { width: 18px; height: 18px; }

/* ── Search bar ──────────────────────────────────────── */

.search-bar {
  padding: 0 16px 12px;
}
.search-bar input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 10px 16px;
  width: 100%;
  font-size: 0.95rem;
  color: var(--text);
}
.search-bar input:focus { outline: none; border-color: var(--accent); }

/* ── Category tabs ───────────────────────────────────── */

.category-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  min-height: 36px;
}
.cat-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Filter row ──────────────────────────────────────── */

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 16px;
}

.filter-row select {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text);
  height: 40px;
}
.filter-row select:focus { outline: none; border-color: var(--accent); }

.btn-filter-fav {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all var(--transition);
}
.btn-filter-fav.active { color: #e74c3c; border-color: #e74c3c; background: rgba(231,76,60,0.06); }
.btn-filter-fav svg { width: 18px; height: 18px; }

/* ── Clothes grid ────────────────────────────────────── */

.clothes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
}

@media (min-width: 400px) {
  .clothes-grid { grid-template-columns: repeat(3, 1fr); }
}

.clothing-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.clothing-card:active { transform: scale(0.97); }

.clothing-card-img-wrap {
  aspect-ratio: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.clothing-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.clothing-card-info {
  padding: 8px 10px;
}

.clothing-card-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clothing-card-brand {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-fav-card {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  color: var(--text-muted);
  transition: color var(--transition);
  z-index: 2;
}
.btn-fav-card svg { width: 16px; height: 16px; }
.btn-fav-card.active { color: #e74c3c; }
.btn-fav-card.active svg { fill: #e74c3c; }

/* ── Empty state ─────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 32px;
  color: var(--text-muted);
  gap: 12px;
  flex: 1;
}
.empty-state svg { width: 80px; height: 80px; opacity: 0.6; }
.empty-state p { font-size: 1rem; font-weight: 500; color: var(--text); }
.empty-state span { font-size: 0.9rem; }

/* ── Dress Me Roller ─────────────────────────────────── */

.btn-shuffle-random {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--secondary);
  color: var(--primary);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity var(--transition);
  min-height: 36px;
}
.btn-shuffle-random svg { width: 16px; height: 16px; }
.btn-shuffle-random:active { opacity: 0.75; }

.roller-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  padding-bottom: 8px;
}

.roller-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}

.roller-row-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 6px;
}

.roller-row-label > span:first-child {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.roller-selected-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* The scrollable track */
.roller-track {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 0 12px;
  /* Center the first and last items */
  padding-left: calc(50% - 72px);
  padding-right: calc(50% - 72px);
  gap: 10px;
}
.roller-track::-webkit-scrollbar { display: none; }

/* Each clothing card in the roller */
.roller-item {
  flex-shrink: 0;
  width: 144px;
  height: 160px;
  scroll-snap-align: center;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.25s ease, opacity 0.25s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  transform: scale(0.82);
  opacity: 0.5;
  position: relative;
  box-shadow: none;
}

.roller-item.selected {
  transform: scale(1);
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(196,168,130,0.3);
}

.roller-item-img-wrap {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}

.roller-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.roller-item-name {
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  background: var(--surface);
}

.roller-empty-row {
  padding: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
}

.roller-actions {
  padding: 16px 16px calc(16px + var(--safe-bottom));
}

/* ── Canvas ──────────────────────────────────────────── */

.canvas-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
  flex: 1;
}

.canvas-board {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 8px;
}

.canvas-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
  overflow: hidden;
}
.canvas-zone.has-item { border-style: solid; border-color: var(--accent); }
.canvas-zone.drag-over { background: rgba(196,168,130,0.1); border-color: var(--accent); }

.zone-hint {
  font-size: 0.72rem;
  color: var(--border);
  font-weight: 500;
  text-align: center;
}

.canvas-zone img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
  padding: 8px;
}

.canvas-zone .zone-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(231,76,60,0.85);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 3;
  display: none;
}
.canvas-zone.has-item .zone-remove { display: flex; }

.canvas-picker { flex-shrink: 0; }

.picker-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
}
.picker-tabs::-webkit-scrollbar { display: none; }

.picker-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  min-height: 34px;
}
.picker-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-bottom: 4px;
}

.picker-item {
  aspect-ratio: 1;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.picker-item:active { border-color: var(--accent); }
.picker-item img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.picker-item.selected { border-color: var(--accent); }

/* ── Lookbook ────────────────────────────────────────── */

.looks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
}

.look-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition);
}
.look-card:active { transform: scale(0.97); }

.look-card-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--bg);
  aspect-ratio: 1;
}

.look-card-images img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  background: var(--bg);
}

.look-card-single {
  aspect-ratio: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.look-card-info {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.look-card-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.look-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Planner ─────────────────────────────────────────── */

.planner-week {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 16px;
}

.planner-day {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background var(--transition);
}
.planner-day:active { background: var(--bg); }
.planner-day.today { border-left: 3px solid var(--accent); }

.planner-day-label {
  min-width: 48px;
  text-align: center;
}

.planner-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.planner-day-num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Playfair Display', serif;
}
.planner-day.today .planner-day-num { color: var(--accent); }

.planner-day-look {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.planner-look-thumb {
  display: flex;
  gap: 2px;
}
.planner-look-thumb img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg);
}

.planner-look-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.planner-empty {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Stats ───────────────────────────────────────────── */

.stats-content {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stats-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stats-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.stats-big-number {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Playfair Display', serif;
  line-height: 1;
}

.stats-big-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stats-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.stats-bar-label {
  font-size: 0.82rem;
  color: var(--text);
  min-width: 90px;
}

.stats-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.stats-bar-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 24px;
  text-align: right;
}

.stats-items-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.stats-items-row::-webkit-scrollbar { display: none; }

.stats-item-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.stats-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.stats-item-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px 0 4px 0;
}

/* ── Profile ─────────────────────────────────────────── */

.profile-content {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}

.avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  color: var(--text-muted);
}
.avatar-placeholder svg { width: 32px; height: 32px; }

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.avatar-edit-btn svg { width: 13px; height: 13px; }

.profile-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.profile-email { font-size: 0.85rem; color: var(--text-muted); }

.profile-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
}

.profile-form { display: flex; flex-direction: column; gap: 16px; }

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--text);
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 50px; height: 28px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 28px;
  transition: background var(--transition);
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ── Modals ──────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal.hidden { display: none; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,26,46,0.5);
  backdrop-filter: blur(2px);
}

.modal-sheet {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 8px 24px calc(24px + var(--safe-bottom));
  animation: slideUp 0.3s ease;
}

.modal-sheet-large { max-height: 80dvh; }
.modal-sheet-small { max-height: 50dvh; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 8px auto 20px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

/* ── Upload ──────────────────────────────────────────── */

.upload-step { display: none; }
.upload-step.active { display: block; }

.upload-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.upload-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  min-height: 44px;
}
.upload-option:active { background: var(--secondary); }
.upload-option svg { width: 28px; height: 28px; color: var(--accent); }

.upload-preview-wrap {
  position: relative;
  margin: 16px 0;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}

.upload-preview-img {
  max-height: 220px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: var(--radius);
}

.upload-processing {
  position: absolute;
  inset: 0;
  background: rgba(250,250,250,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius);
}

.upload-form { display: flex; flex-direction: column; gap: 16px; }

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 48px;
}
.color-input-wrap input[type="color"] {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: none;
  min-height: unset;
}
.color-input-wrap span { font-size: 0.9rem; color: var(--text-muted); font-family: monospace; }

/* ── Item detail modal ───────────────────────────────── */

.item-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-detail-img-wrap {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  padding: 12px;
}

.item-detail-img {
  max-height: 240px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.item-detail-info { display: flex; flex-direction: column; gap: 8px; }

.item-detail-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.item-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-badge {
  background: var(--secondary);
  color: var(--primary);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
}

.item-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* ── Spinner ─────────────────────────────────────────── */

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Toast ───────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  animation: fadeInUp 0.25s ease;
  pointer-events: none;
}
.toast.hidden { display: none; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Loading ─────────────────────────────────────────── */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 400;
}
.loading-overlay p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Utilities ───────────────────────────────────────── */

.hidden { display: none !important; }

.color-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.08);
  vertical-align: middle;
}

/* Desktop adjustments */
@media (min-width: 480px) {
  #bottom-nav, #fab-add { max-width: 480px; }
  .clothes-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Page entrance animation ─────────────────────────── */

.page.active {
  animation: pageEnter 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Clothing cards stagger in */
.clothing-card {
  animation: cardIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Nav item active pulse */
.nav-item.active span {
  animation: navPulse 0.3s ease;
}
@keyframes navPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ── Sub-tabs (Meus Looks / Comunidade) ──────────────── */

.sub-tabs {
  display: flex;
  padding: 0 16px 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 16px;
}

.sub-tab {
  flex: 1;
  padding: 12px 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color var(--transition), border-color var(--transition);
  text-align: center;
}
.sub-tab.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}
[data-theme="dark"] .sub-tab.active { color: var(--accent); }

.subtab-content { display: none; }
.subtab-content.active { display: block; animation: pageEnter 0.25s ease; }

/* ── Community feed ──────────────────────────────────── */

.community-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
}

.community-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: cardIn 0.3s ease both;
}

.community-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
}

.community-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  flex-shrink: 0;
}

.community-author {
  flex: 1;
}

.community-author-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.community-author-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.community-look-name {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 16px 8px;
}

.community-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: var(--bg);
  padding: 0 16px 12px;
}

.community-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.community-caption {
  font-size: 0.88rem;
  color: var(--text);
  padding: 0 16px 8px;
  line-height: 1.5;
}

.community-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 14px;
  border-top: 1px solid var(--border);
}

.community-btn-like {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition);
  min-height: 36px;
  padding: 0 4px;
}
.community-btn-like svg { width: 18px; height: 18px; }
.community-btn-like.liked { color: #e74c3c; }
.community-btn-like.liked svg { fill: #e74c3c; stroke: #e74c3c; }

.community-btn-publish {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  padding: 6px 14px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  transition: all var(--transition);
  min-height: 36px;
}
.community-btn-publish:active { background: var(--accent); color: #fff; }

/* ── "Powered by Ana" footer ─────────────────────────── */

.page-footer-credit,
.profile-footer-credit {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.08em;
  padding: 24px 0 8px;
  font-family: 'Inter', sans-serif;
}

.profile-footer-credit {
  padding: 32px 0 16px;
}

/* ── Profile extras ──────────────────────────────────── */

.profile-nickname {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

.section-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.body-photo-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.body-photo-preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
}

/* ── Occasions list ──────────────────────────────────── */

.occasions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.occasion-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--secondary);
  color: var(--primary);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
}

.occasion-tag-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(26,26,46,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

.occasions-add-row {
  display: flex;
  gap: 8px;
}

.occasions-add-row input {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text);
  min-height: 44px;
}
.occasions-add-row input:focus { outline: none; border-color: var(--accent); }

.occasions-add-row .btn-primary {
  padding: 10px 20px;
  min-height: 44px;
  flex-shrink: 0;
}

/* ── Stats mini in profile ───────────────────────────── */

.stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stats-mini-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}

.stats-mini-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Playfair Display', serif;
  line-height: 1;
}

.stats-mini-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Try-on modal ────────────────────────────────────── */

.try-on-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.try-on-body-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.try-on-body-img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius);
}

.try-on-upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 32px;
}

.try-on-clothes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.try-on-clothes-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.try-on-clothes-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.try-on-clothes-row::-webkit-scrollbar { display: none; }

.try-on-item {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
}
.try-on-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

/* ── Shuffle spin animation ──────────────────────────── */

@keyframes rollerSpin {
  0%   { filter: blur(0px); }
  30%  { filter: blur(1.5px); }
  70%  { filter: blur(1.5px); }
  100% { filter: blur(0px); }
}

.roller-track.spinning .roller-item {
  animation: rollerSpin 0.6s ease;
}

/* ── Improved modal animation ────────────────────────── */

.modal:not(.hidden) .modal-sheet {
  animation: sheetUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetUp {
  from { transform: translateY(60%); opacity: 0.6; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Look card publish button overlay ───────────────── */

.look-card {
  position: relative;
}

.look-card-publish-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 14px;
  z-index: 2;
  transition: all var(--transition);
}
.look-card-publish-btn:active { background: var(--accent); color: #fff; }
.look-card-publish-btn svg { width: 14px; height: 14px; }

/* ── PWA Install Banner ──────────────────────────────────────────────────── */
.pwa-install-banner {
  position: fixed;
  bottom: 72px;
  left: 12px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 900;
  overflow: hidden;
  animation: sheetUp .3s ease;
}
.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.pwa-install-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pwa-install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pwa-install-text strong { font-size: 0.9rem; color: var(--text); }
.pwa-install-text span { font-size: 0.78rem; color: var(--text-muted); }
.pwa-install-actions { display: flex; align-items: center; gap: 6px; }
.pwa-btn-install {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pwa-btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}
.pwa-ios-steps {
  padding: 0 14px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  margin-top: 0;
}
.pwa-ios-steps strong { color: var(--text); }

/* ── Community Expiry Badge & Feedback ──────────────────────────────────── */
.expiry-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(219, 112, 147, .12);
  color: #c45a7a;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}
[data-theme="dark"] .expiry-badge { background: rgba(219,112,147,.2); color: #e87da0; }

.community-btn-feedback {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 20px;
  transition: all var(--transition);
}
.community-btn-feedback:active, .community-btn-feedback:hover { background: var(--bg); color: var(--primary); }
.community-btn-feedback svg { width: 15px; height: 15px; }

.publish-story-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(219,112,147,.1);
  border: 1px solid rgba(219,112,147,.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}
.publish-story-notice strong { color: #c45a7a; }

/* ── Comments Modal ──────────────────────────────────────────────────────── */
.comments-list {
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
  min-height: 80px;
  padding: 4px 0;
  margin-bottom: 12px;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.comment-time {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 6px;
}
.comment-text {
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.4;
}
.comments-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px 0;
}
.comments-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.comments-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}
.comments-input-row input:focus { outline: none; border-color: var(--accent); }

/* ── Remember Me checkbox ────────────────────────────────────────────────── */
.remember-row {
  margin-bottom: 12px;
}
.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  user-select: none;
}
.remember-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Safe area extras (Dynamic Island / notch) ───────────────────────────── */
/* Toast fica acima do nav + safe area */
.toast {
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px) !important;
}
/* Banner PWA também considera safe area inferior */
.pwa-install-banner {
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
}

/* ── Avatar SVG Try-On ───────────────────────────────── */

.avatar-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0 16px;
}

.avatar-figure-wrap {
  position: relative;
  width: 180px;
  height: 420px;
  flex-shrink: 0;
}

.avatar-figure-wrap svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.avatar-cloth-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.avatar-cloth {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
  transition: opacity 0.3s ease;
}

.avatar-cloth.tops      { top: 22%; left: 9%; width: 82%; }
.avatar-cloth.outerwear { top: 19%; left: 4%; width: 92%; }
.avatar-cloth.dresses   { top: 22%; left: 8%; width: 84%; }
.avatar-cloth.bottoms   { top: 47%; left: 14%; width: 72%; }
.avatar-cloth.shoes     { top: 81%; left: 20%; width: 60%; }
.avatar-cloth.bags      { top: 38%; left: 65%; width: 34%; }
.avatar-cloth.accessories { top: 6%; left: 26%; width: 48%; }

.avatar-clothes-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 16px;
}

.avatar-cloth-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-cloth-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.avatar-tryon-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}

/* ── Admin Panel ─────────────────────────────────────── */

.admin-panel {
  padding: 0 16px 32px;
}

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.admin-stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.admin-stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.admin-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.admin-tab {
  flex: 1;
  padding: 8px 4px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--transition);
}

.admin-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.admin-user-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.admin-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
  flex-shrink: 0;
  overflow: hidden;
}

.admin-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent);
  color: white;
  flex-shrink: 0;
}

.admin-user-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  color: var(--text);
  background: var(--bg);
  transition: all var(--transition);
}

.admin-btn:active { opacity: 0.75; }
.admin-btn.danger { color: var(--error); border-color: var(--error); }
.admin-btn.promote { color: var(--accent); border-color: var(--accent); }

.admin-feedback-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.admin-feedback-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-feedback-cat {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--secondary);
  color: var(--primary);
}

.admin-feedback-author {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
}

.admin-feedback-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.admin-feedback-msg {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── Feedback Section (Profile) ──────────────────────── */

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-category-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.feedback-cat-btn {
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  text-align: center;
}

.feedback-cat-btn.selected {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--accent);
}

[data-theme="dark"] .feedback-cat-btn {
  background: var(--bg);
  color: var(--text-muted);
}

[data-theme="dark"] .feedback-cat-btn.selected {
  background: var(--secondary);
  color: var(--text);
}

.feedback-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Profile Admin Button ────────────────────────────── */

.admin-access-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1A1A2E, #2A2A4E);
  color: #E8D5C4;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  width: 100%;
  margin-bottom: 12px;
}

.admin-access-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

[data-theme="dark"] .admin-access-btn {
  background: linear-gradient(135deg, #2A2A4E, #3A3A6E);
  color: #F0EBE3;
}

/* ── Auth forgot / reset ────────────────────────────── */

.auth-forgot-row {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: -4px 0 16px;
}

.form-success {
  color: #2e7d32;
  font-size: 0.85rem;
  padding: 8px 12px;
  background: #e8f5e9;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

[data-theme="dark"] .form-success {
  color: #81c784;
  background: rgba(46,125,50,0.15);
}

/* ── Occasion multi-chips ───────────────────────────── */

.occasion-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.occ-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.occ-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

[data-theme="dark"] .occ-chip.selected {
  color: #1A1A2E;
}

/* ── Image edit toolbar ─────────────────────────────── */

.img-edit-toolbar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}

.btn-img-edit {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-img-edit:hover {
  background: var(--surface);
}

[data-theme="dark"] .btn-img-edit {
  background: var(--surface);
  border-color: var(--border);
}

