/* ── Mevix — light, friendly redesign ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg:        #FFFFFF;
  --surface:   #FAFAF7;
  --surface-2: #F4F3EE;
  --border:    #ECEAE3;
  --border-2:  #E2DFD6;
  --text:      #0E0E10;
  --muted:     #6B6B70;
  --muted-2:   #9A9A9F;
  --accent:    oklch(0.70 0.20 27);   /* vermillion light */
  --accent-ink:#2E0E08;
  --accent-soft: oklch(0.96 0.04 27);
  --accent-line: oklch(0.87 0.10 27);
  --good:      oklch(0.72 0.14 155);
  --warn:      oklch(0.78 0.14 75);
  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --pad: 16px;
  --safe-b: max(16px, env(safe-area-inset-bottom));
  --safe-t: env(safe-area-inset-top, 0px);
  --shadow-1: 0 1px 0 rgba(20,18,12,.02), 0 2px 8px rgba(20,18,12,.04);
  --shadow-2: 0 12px 40px -12px rgba(20,18,12,.12), 0 2px 8px rgba(20,18,12,.04);
  --serif: 'Instrument Serif', 'Times New Roman', serif;
}

[data-theme="dark"] {
  --bg: #0F0F10;
  --surface: #161617;
  --surface-2: #1F1F21;
  --border: #2A2A2C;
  --border-2: #353537;
  --text: #F4F3EE;
  --muted: #9A9A9F;
  --muted-2: #6B6B70;
  --accent-soft: rgba(210,60,30,.08);
  --accent-line: rgba(210,60,30,.30);
  --shadow-1: 0 1px 0 rgba(0,0,0,.2), 0 2px 8px rgba(0,0,0,.3);
  --shadow-2: 0 12px 40px -12px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.3);
}

html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

html, body { min-height: 100%; background: var(--bg); color: var(--text);
  font-family: 'Inter Tight', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'ss01','cv11'; overflow-x: hidden;
  letter-spacing: -0.01em;
}
body { padding-bottom: 96px; }
.app { max-width: 440px; margin: 0 auto; position: relative; }

.screen { display: none; }
.screen.active { display: block; animation: fadeUp .25s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── Topbar ───────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + var(--safe-t)) 18px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 11px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--text); color: var(--bg);
  display: grid; place-items: center; flex-shrink: 0;
  font-weight: 700; letter-spacing: -0.04em; font-size: 19px;
  position: relative;
}
.logo-mark::after {
  content: ""; position: absolute; right: -3px; top: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.logo-title { font-size: 17px; font-weight: 600; letter-spacing: -0.025em; }
.logo-title em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--accent); letter-spacing: 0; }
.logo-sub   { font-size: 12px; color: var(--muted); margin-top: 1px; }

.topbar-spacer { flex: 1; }
.topbar-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background .15s, transform .1s;
}
.topbar-pill:active { transform: scale(.96); }
.topbar-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ── Bottom nav ───────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  width: calc(100% - 24px); max-width: 380px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border); border-radius: 999px;
  display: flex; align-items: stretch;
  padding: 6px;
  box-shadow: var(--shadow-2);
}
.nav-item {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 10px; cursor: pointer; border: none;
  background: transparent; color: var(--muted); font-family: inherit;
  font-size: 13px; font-weight: 600; border-radius: 999px;
  transition: color .15s, background .15s;
}
.nav-item.active { color: var(--text); background: var(--surface-2); }
.nav-item.nav-create { color: var(--bg); background: var(--text); }
.nav-item.nav-create.active { background: var(--accent); color: var(--accent-ink); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Content ─────────────────────────────────────────────────── */
.content { padding: 16px 16px 24px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 4px 10px; }
.section-head:first-child { margin-top: 8px; }
.section-head h3 {
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.section-head .hint { font-size: 12px; color: var(--muted-2); }

/* ── Hero prompt ─────────────────────────────────────────────── */
.hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 18px 18px 14px;
  box-shadow: var(--shadow-1);
  position: relative;
}
.hero-greet {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 26px; line-height: 1.1; letter-spacing: -0.01em;
  color: var(--text); margin-bottom: 12px;
}
.hero-greet b { font-family: 'Inter Tight'; font-style: normal; font-weight: 600; letter-spacing: -0.025em; }
.hero textarea {
  width: 100%; min-height: 96px; border: none; outline: none;
  background: transparent; color: var(--text); -webkit-text-fill-color: var(--text);
  caret-color: var(--text); resize: none;
  font: 500 16px/1.45 'Inter Tight', system-ui, sans-serif; font-family: inherit;
  letter-spacing: -0.01em;
}
.hero textarea::placeholder { color: var(--muted-2); -webkit-text-fill-color: var(--muted-2); }
.hero-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.char-counter { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.hero-clear {
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); font: 600 12px 'Inter Tight';
  padding: 4px 8px; border-radius: 8px;
}
.hero-clear:hover { background: var(--surface-2); color: var(--text); }

/* ── Suggestion chips ────────────────────────────────────────── */
.suggest-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 4px; margin-top: 12px;
}
.suggest {
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font: 600 12px 'Inter Tight'; font-family: inherit;
  padding: 7px 11px 7px 9px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s ease;
}
.suggest:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.suggest:active { transform: scale(.96); }
.suggest svg { width: 13px; height: 13px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 16px;
  margin-bottom: 10px; box-shadow: var(--shadow-1);
}
.card-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.card-row:active { transform: scale(.99); transition: transform .12s; }
.card-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: var(--surface-2); color: var(--text);
}
.card-info { flex: 1; min-width: 0; }
.card-info .card-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.card-info .card-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-arrow {
  color: var(--muted-2); flex-shrink: 0;
  width: 20px; height: 20px; display: grid; place-items: center;
}

/* ── Chip rows (format / quality) ────────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font: 600 13px 'Inter Tight'; font-family: inherit;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  transition: all .15s ease;
  display: inline-flex; align-items: center; gap: 7px;
  letter-spacing: -0.005em;
}
.chip:hover { border-color: var(--border-2); }
.chip.active {
  border-color: var(--text); background: var(--text); color: var(--bg);
}
.chip:active { transform: scale(.96); }
.fmt-icon { border: 1.5px solid currentColor; border-radius: 2px; flex-shrink: 0; opacity: 0.55; }
.chip.active .fmt-icon { opacity: 0.9; }
.chip .price { color: var(--muted); font-weight: 500; font-size: 12px; }
.chip.active .price { color: color-mix(in srgb, var(--bg) 75%, transparent); }

/* ── Format preview pane ────────────────────────────────────── */
.fmt-block { display: flex; align-items: center; gap: 14px; }
.fmt-preview {
  width: 78px; height: 78px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  flex-shrink: 0; display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.fmt-preview-rect {
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 6px, transparent 6px 12px),
              var(--accent);
  border: 1px solid var(--accent-line); border-radius: 4px;
  transition: width .25s cubic-bezier(.2,.8,.2,1), height .25s cubic-bezier(.2,.8,.2,1);
}
.fmt-block-list { flex: 1; min-width: 0; }
.fmt-block-list .chip-row { gap: 6px; }

/* ── Photo upload ────────────────────────────────────────────── */
.file-hidden { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.upload-area {
  min-height: 64px; border-radius: var(--r-md);
  border: 1.5px dashed var(--border-2); background: var(--surface);
  cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; transition: all .15s ease;
}
.upload-area:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.upload-area.has-files { border-style: solid; border-color: var(--good); background: color-mix(in srgb, var(--good) 8%, var(--bg)); }
.upload-plus {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted);
}
.upload-area.has-files .upload-plus { color: var(--good); border-color: var(--good); }
.upload-text { font-size: 13px; font-weight: 600; }
.upload-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.thumbs-row  { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-del {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(14,14,16,0.8); border: none; color: #fff;
  font-size: 11px; cursor: pointer; display: grid; place-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.primary-btn {
  width: 100%; border: none; border-radius: var(--r-md);
  padding: 16px 18px; background: var(--text); color: var(--bg);
  font: 600 15px 'Inter Tight', system-ui; font-family: inherit;
  letter-spacing: -0.015em; cursor: pointer;
  transition: transform .12s ease, opacity .15s ease, background .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 8px;
}
.primary-btn .pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 18%, transparent);
  font-size: 12px; font-weight: 600;
}
.primary-btn:disabled { opacity: .35; cursor: not-allowed; }
.primary-btn:not(:disabled):hover { background: var(--accent); color: var(--accent-ink); }
.primary-btn:not(:disabled):active { transform: scale(.985); }
.secondary-btn {
  border-radius: var(--r-md); padding: 13px 16px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: 600 14px 'Inter Tight'; font-family: inherit; cursor: pointer;
  transition: all .15s;
}
.secondary-btn:hover { background: var(--surface-2); }
.secondary-btn:active { transform: scale(.985); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(20,18,12,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; align-items: flex-end;
}
.modal-backdrop.open { display: flex; }
.modal-sheet {
  width: 100%; max-width: 440px; margin: 0 auto;
  background: var(--bg);
  border-radius: 28px 28px 0 0; border-top: 1px solid var(--border);
  padding: 0 0 calc(16px + var(--safe-b));
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.2,.85,.2,1);
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 -16px 60px rgba(20,18,12,.18);
}
.modal-backdrop.open .modal-sheet { transform: translateY(0); }
.modal-handle {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--border-2); margin: 12px auto 14px;
}
.modal-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; padding: 0 20px 4px; }
.modal-title em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }
.modal-sub { font-size: 13px; color: var(--muted); padding: 0 20px 14px; }
.modal-list { padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.modal-model-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg);
  cursor: pointer; transition: all .15s ease;
}
.modal-model-card:hover { border-color: var(--border-2); background: var(--surface); }
.modal-model-card.active {
  border-color: var(--text); background: var(--surface);
}
.modal-model-card:active { transform: scale(.99); }
.modal-model-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
  font-weight: 700; font-size: 16px;
}
.modal-model-info { flex: 1; min-width: 0; }
.modal-model-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.modal-model-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.model-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0;
}
.badge-best { background: var(--text); color: var(--bg); }
.badge-popular { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.badge-new { background: color-mix(in srgb, var(--good) 14%, var(--bg)); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.check-icon { color: var(--text); flex-shrink: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); }

/* ── Gallery (Ideas) ─────────────────────────────────────────── */
.tag-pills {
  display: flex; gap: 6px; padding: 14px 16px 8px;
  overflow-x: auto; scrollbar-width: none; flex-shrink: 0;
}
.tag-pills::-webkit-scrollbar { display: none; }
.tag-pill {
  flex-shrink: 0; border-radius: 999px; padding: 7px 14px;
  font: 600 13px 'Inter Tight'; font-family: inherit;
  border: 1px solid var(--border); background: var(--bg); color: var(--muted);
  cursor: pointer; transition: all .15s; white-space: nowrap;
  letter-spacing: -0.005em;
}
.tag-pill:hover { color: var(--text); border-color: var(--border-2); }
.tag-pill.active { background: var(--text); border-color: var(--text); color: var(--bg); }

.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px 12px 0; }
.gallery-col  { display: flex; flex-direction: column; gap: 6px; }
.gallery-card {
  position: relative; overflow: hidden; cursor: pointer;
  border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s;
}
.gallery-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.gallery-card img { width: 100%; height: auto; display: block; }
.gallery-card.skeleton {
  aspect-ratio: 1;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.gallery-card-inner { position: absolute; inset: 0; display: grid; place-items: end start; padding: 14px; color: rgba(255,255,255,0.95); font: 600 14px 'Inter Tight'; }
.g1 { background: linear-gradient(155deg,#FFE9D6 0%,#FFB084 60%,#E76F3D 100%); color: #3A1B0E; }
.g2 { background: linear-gradient(135deg,#E8F2FF 0%,#A8C8E8 60%,#5B7FA8 100%); color: #1A2B3C; }
.g3 { background: linear-gradient(135deg,#FAF6E8 0%,#E8D8A0 60%,#A88840 100%); color: #3C2D10; }
.g4 { background: linear-gradient(155deg,#F0E8FA 0%,#C0A8E8 60%,#7A5AD8 100%); color: #2D1A4C; }
.g5 { background: linear-gradient(135deg,#E8F8EE 0%,#A0D8B8 60%,#3F7C58 100%); color: #102818; }
.g6 { background: linear-gradient(155deg,#FFE0E8 0%,#F0A0B8 60%,#B83F60 100%); color: #3C0E1C; }
.gallery-card-prompt { font-size: 12px; line-height: 1.3; max-width: 90%; }
.gallery-empty { text-align: center; padding: 60px 24px; color: var(--muted); font-size: 14px; }
.gallery-empty .big { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--text); margin-bottom: 6px; }

/* ── Lightbox ────────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 450; background: rgba(14,14,16,0.94); display: none; flex-direction: column; }
.lightbox.open { display: flex; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
.lightbox-close {
  position: absolute; top: calc(14px + var(--safe-t)); right: 14px; z-index: 10;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(8px);
  border: none; color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.lightbox-img-wrap { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 0; padding: 56px 14px 14px; }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; border-radius: 14px; }
.lightbox-bottom {
  flex: none; background: var(--bg); color: var(--text);
  border-top: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(18px + var(--safe-b));
}
.lightbox-prompt {
  font-size: 14px; line-height: 1.5; color: var(--text); margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  letter-spacing: -0.005em;
}
.lightbox-prompt.expanded { display: block; -webkit-line-clamp: unset; }
.lightbox-expand { font-size: 12px; color: var(--accent); font-weight: 600; cursor: pointer; margin-bottom: 12px; }
.lightbox-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.meta-chip {
  border-radius: 999px; padding: 5px 11px;
  background: var(--surface-2); color: var(--text);
  font-size: 12px; font-weight: 600;
}
.lightbox-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lightbox-actions .primary-btn { margin: 0; padding: 13px 16px; font-size: 13px; }

/* ── Profile ─────────────────────────────────────────────────── */
.profile-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 22px 20px;
  margin-bottom: 12px; box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
}
.profile-hero::before {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--text); color: var(--bg);
  display: grid; place-items: center;
  font-size: 24px; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 14px; position: relative;
}
.profile-avatar::after {
  content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface);
}
.profile-name     { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 2px; }
.profile-name em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }
.profile-username { font-size: 13px; color: var(--muted); }

.balance-card {
  background: var(--text); color: var(--bg);
  border-radius: var(--r-xl); padding: 22px;
  margin-bottom: 12px; position: relative; overflow: hidden;
}
.balance-card::after {
  content: ""; position: absolute; right: -50px; bottom: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 65%);
  opacity: 0.5;
}
.balance-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: color-mix(in srgb, var(--bg) 60%, transparent); margin-bottom: 6px;
  position: relative;
}
.balance-value { font-size: 44px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; position: relative; }
.balance-value .unit { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); margin-left: 6px; font-size: 28px; }
.balance-sub { font-size: 13px; color: color-mix(in srgb, var(--bg) 60%, transparent); margin-top: 8px; position: relative; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px;
}
.stat-num { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.menu-list {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px;
}
.menu-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.menu-row:last-child { border-bottom: none; }
.menu-row:hover { background: var(--surface); }
.menu-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.menu-text { flex: 1; font-size: 14px; font-weight: 500; }
.menu-arrow { color: var(--muted-2); }

.profile-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; }
.profile-actions .primary-btn,
.profile-actions .secondary-btn { margin: 0; }

/* ── Toast / overlay ─────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 96px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 11px 20px;
  font-size: 13px; font-weight: 600;
  pointer-events: none; opacity: 0;
  transition: opacity .2s, transform .2s;
  white-space: nowrap; z-index: 500;
  box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.upload-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-text { font-size: 14px; font-weight: 600; color: var(--muted); }

/* ── Dark theme tweaks ──────────────────────────────────────── */
[data-theme="dark"] .gallery-card-inner { color: rgba(255,255,255,0.95); }
[data-theme="dark"] .lightbox-bottom { background: var(--surface); }

/* ── Density ─────────────────────────────────────────────────── */
[data-density="compact"] { --pad: 12px; }
[data-density="compact"] .content { padding: 12px 12px 20px; }
[data-density="compact"] .card { padding: 12px 14px; }
[data-density="compact"] .hero { padding: 14px 14px 12px; }
[data-density="compact"] .hero-greet { font-size: 22px; margin-bottom: 8px; }
[data-density="compact"] .hero textarea { min-height: 76px; font-size: 15px; }

[data-density="comfy"] .content { padding: 20px 18px 28px; }
[data-density="comfy"] .card { padding: 18px 18px; }
[data-density="comfy"] .hero { padding: 22px 22px 18px; }
[data-density="comfy"] .hero-greet { font-size: 30px; margin-bottom: 16px; }
[data-density="comfy"] .hero textarea { min-height: 110px; }
