﻿/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg:           #07080e;
  --surface:      #0c0d16;
  --card:         #0f1019;
  --border:       rgba(255,255,255,0.07);
  --border-glow:  rgba(139,92,246,0.35);
  --text:         #dde1f0;
  --muted:        #4a5068;
  --dim:          #272b3d;
  --blue:         #18b3ff;
  --purple:       #8b5cf6;
  --pink:         #f472b6;
  --gold:         #f4a535;
  --success:      #22c55e;
  --danger:       #ef4444;
  --r:            16px;
  --r-sm:         10px;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: "Sora", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 1.25rem 1rem 3rem;
  overflow-x: hidden;
}

/* ── Ambient glows ───────────────────────────────────────────────────────── */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
}
.glow-blue   { width: 26rem; height: 26rem; top: -8rem;  left: -10rem; background: rgba(24,179,255,.13); }
.glow-purple { width: 30rem; height: 30rem; top: 30%;    right: -14rem; background: rgba(139,92,246,.12); }
.glow-gold   { width: 22rem; height: 22rem; bottom: -6rem; left: 30%;   background: rgba(244,165,53,.08); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.header, .main { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r);
  backdrop-filter: blur(14px);
  margin-bottom: 2.5rem;
}

.brand { display: flex; align-items: center; gap: .6rem; }

.logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: brightness(1.1);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
}
.brand-x  { background: linear-gradient(135deg, var(--blue), var(--purple), var(--pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-ai { font-weight: 300; color: var(--muted); -webkit-text-fill-color: var(--muted); }

.header-right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }

.credits-pill {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(244,165,53,.1);
  border: 1px solid rgba(244,165,53,.25);
  border-radius: 99px;
  padding: .35rem .85rem;
}
.credits-pill svg { flex-shrink: 0; }

.btn-buy {
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border: none;
  border-radius: 99px;
  padding: .38rem .95rem;
  cursor: pointer;
  transition: opacity .18s, transform .12s;
}
.btn-buy:hover { opacity: .85; transform: translateY(-1px); }

/* ── Sign-in button (header) ────────────────────────────────────────────────── */
.btn-signin {
  padding: .38rem .95rem;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border: none;
  border-radius: 99px;
  color: #fff;
  font: 700 .78rem/1 "Sora", sans-serif;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn-signin:hover { opacity: .85; }

/* ── User chip (header) ──────────────────────────────────────────────────────── */
.user-chip {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .28rem .7rem .28rem .45rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 99px;
}
.user-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
}
.user-avatar.visible { display: block; }
.user-email {
  font-size: .73rem;
  color: var(--text);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-signout {
  background: none; border: none;
  color: var(--muted);
  font: 500 .7rem/1 "Sora", sans-serif;
  cursor: pointer;
  padding: .18rem .35rem;
  border-radius: 6px;
  transition: color .15s;
}
.btn-signout:hover { color: var(--danger); } ────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.eyebrow {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .75rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: .75rem;
}
.gradient-text {
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 45%, var(--pink) 80%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline { font-size: .9rem; color: var(--muted); }

/* ── Grid ────────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  padding: 1px;
  background: linear-gradient(135deg, rgba(24,179,255,.15), rgba(139,92,246,.15), rgba(244,165,53,.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Card eyebrow ────────────────────────────────────────────────────────── */
.card-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.eyebrow-tag {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.model-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: .65rem;
  color: var(--purple);
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 6px;
  padding: .2rem .55rem;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .3rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .25rem;
}
.tab {
  flex: 1;
  background: none;
  border: none;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  padding: .4rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab.active {
  background: rgba(139,92,246,.18);
  color: var(--text);
}
.tab-content        { display: none; }
.tab-content.active { display: block; }

/* ── Drop zone ───────────────────────────────────────────────────────────── */
.drop-zone {
  border: 1.5px dashed rgba(255,255,255,.1);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.02);
  cursor: pointer;
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color .18s, background .18s;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--purple);
  background: rgba(139,92,246,.06);
}
.drop-prompt { text-align: center; padding: 1.75rem 1rem; pointer-events: none; }
.drop-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 12px;
  color: var(--purple);
}
.dp-title { font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: .3rem; }
.dp-hint  { font-size: .72rem; color: var(--muted); }

.img-preview {
  width: 100%; max-height: 270px;
  object-fit: contain; display: block;
  border-radius: var(--r-sm);
}
.img-preview.hidden { display: none; }

.btn-clear {
  margin-top: .55rem;
  background: none; border: none;
  font-family: inherit; font-size: .75rem; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: color .15s;
}
.btn-clear:hover { color: var(--danger); }
.btn-clear.hidden { display: none; }

/* ── URL tab ─────────────────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: .75rem; font-weight: 600;
  color: var(--muted);
  margin-bottom: .4rem;
}
input[type="url"] {
  width: 100%;
  padding: .6rem .9rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit; font-size: .85rem;
  color: var(--text);
  outline: none;
  transition: border-color .18s;
}
input[type="url"]:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,.15); }

.url-preview-wrap { margin-top: .75rem; text-align: center; }
.url-preview-wrap img { max-width: 100%; max-height: 200px; border-radius: var(--r-sm); border: 1px solid var(--border); }
.url-preview-wrap.hidden { display: none; }

/* ── Generate row ────────────────────────────────────────────────────────── */
.gen-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}
.btn-generate {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.6rem;
  background: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
  color: #fff;
  border: none; border-radius: var(--r-sm);
  font-family: inherit; font-size: .9rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(139,92,246,.35);
  transition: opacity .18s, transform .12s, box-shadow .18s;
}
.btn-generate:hover:not(:disabled) { opacity: .88; transform: translateY(-1px); box-shadow: 0 8px 32px rgba(139,92,246,.5); }
.btn-generate:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.cost-note { font-size: .72rem; color: var(--muted); }

/* ── Status ──────────────────────────────────────────────────────────────── */
.status-line { font-size: .75rem; color: var(--muted); margin-top: .7rem; min-height: 1.1em; }
.status-ok    { color: var(--success) !important; font-weight: 600; }
.status-error { color: var(--danger)  !important; font-weight: 600; }

/* ── Progress ────────────────────────────────────────────────────────────── */
.prog-wrap        { margin-bottom: 1rem; }
.prog-wrap.hidden { display: none; }
.prog-track {
  height: 4px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--pink));
  border-radius: 99px;
  transition: width .4s ease;
}
.prog-label { font-size: .72rem; color: var(--muted); margin-top: .45rem; }

/* ── Result ──────────────────────────────────────────────────────────────── */
.result-card { display: flex; flex-direction: column; }

.result-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-height: 220px;
  border: 1px dashed rgba(255,255,255,.06);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: .8rem;
}

.result-media {
  width: 100%; max-height: 440px;
  object-fit: contain; display: block;
  border-radius: var(--r-sm);
}

.result-actions { display: flex; align-items: center; gap: .85rem; margin-top: .85rem; }
.result-actions.hidden { display: none; }

.btn-dl {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.25rem;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff; text-decoration: none;
  border-radius: var(--r-sm);
  font-size: .82rem; font-weight: 700;
  transition: opacity .18s;
}
.btn-dl:hover { opacity: .85; }

.btn-reset {
  background: none; border: none;
  font-family: inherit; font-size: .78rem; font-weight: 600;
  color: var(--muted); cursor: pointer;
  text-decoration: underline;
  transition: color .15s;
}
.btn-reset:hover { color: var(--text); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.overlay.hidden { display: none; }

.modal-box {
  background: var(--card);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  width: 100%; max-width: 360px;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 60px rgba(139,92,246,.15);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--muted); font-size: 1.1rem;
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: rgba(255,255,255,.1); color: var(--text); }

.modal-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(244,165,53,.2), rgba(139,92,246,.2));
  border: 1px solid rgba(244,165,53,.3);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: var(--gold);
}
.modal-title { font-size: 1.3rem; font-weight: 800; margin-bottom: .35rem; }
.modal-sub   { font-size: .8rem; color: var(--muted); margin-bottom: 1.5rem; }

.pricing-block {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.pricing-price { font-size: 2.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.pricing-qty   { font-size: 1rem; font-weight: 600; color: var(--muted); margin: .25rem 0 .1rem; }
.pricing-rate  { font-size: .72rem; color: var(--dim); }

.btn-purchase {
  width: 100%;
  padding: .75rem;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; border: none;
  border-radius: var(--r-sm);
  font-family: inherit; font-size: .9rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(139,92,246,.4);
  transition: opacity .18s, transform .12s;
}
.btn-purchase:hover { opacity: .88; transform: translateY(-1px); }

.modal-demo { font-size: .68rem; color: var(--dim); margin-top: .75rem; }

/* ── Util ────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Age Gate ────────────────────────────────────────────────────────────── */
.age-gate { z-index: 200; background: rgba(0,0,0,.92); backdrop-filter: blur(20px); }

.age-box {
  max-width: 440px;
  text-align: left;
}

.age-logo {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: 1.5rem;
}
.age-logo-img { width: 32px; height: 32px; object-fit: contain; mix-blend-mode: screen; }

.age-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.25rem;
}
.age-badge {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(239,68,68,.15);
  border: 1.5px solid rgba(239,68,68,.35);
  font-size: .95rem; font-weight: 800; color: #ef4444;
}

.terms-list {
  list-style: none;
  margin: 0 0 1.25rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.terms-list li {
  display: flex; align-items: flex-start; gap: .65rem;
  font-size: .82rem; color: var(--muted); line-height: 1.55;
}
.terms-icon {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(139,92,246,.15);
  border: 1px solid rgba(139,92,246,.3);
  color: var(--purple);
  font-size: .7rem; font-weight: 800;
  margin-top: 2px;
}
.terms-list li strong { color: var(--text); font-weight: 700; }

.terms-check {
  display: flex; align-items: center; gap: .65rem;
  font-size: .83rem; color: var(--text);
  margin-bottom: 1.25rem;
  cursor: pointer;
  padding: .8rem;
  background: rgba(139,92,246,.08);
  border: 1px solid rgba(139,92,246,.2);
  border-radius: var(--r-sm);
}
.terms-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 17px; height: 17px;
  accent-color: var(--purple);
  cursor: pointer;
}

.btn-exit {
  width: 100%; margin-top: .6rem;
  background: none; border: 1px solid var(--border);
  font-family: inherit; font-size: .8rem; font-weight: 600;
  color: var(--muted); border-radius: var(--r-sm);
  padding: .6rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-exit:hover { border-color: var(--danger); color: var(--danger); }

/* ── Before / After ──────────────────────────────────────────────────────── */
.baf-wrap {
  margin-bottom: 2.5rem;
  text-align: center;
}
.baf-eyebrow { margin-bottom: 1rem; }

.baf-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.baf-card {
  position: relative;
  width: 210px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.baf-card-after {
  border-color: rgba(139,92,246,.4);
  box-shadow: 0 8px 40px rgba(139,92,246,.2);
}

.baf-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.baf-label {
  position: absolute;
  bottom: .6rem; left: .6rem;
  display: flex; align-items: center; gap: .4rem;
  font-size: .7rem; font-weight: 700;
  padding: .28rem .65rem;
  border-radius: 99px;
  backdrop-filter: blur(8px);
}
.baf-label-before {
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.12);
}
.baf-label-after {
  background: rgba(139,92,246,.25);
  color: #fff;
  border: 1px solid rgba(139,92,246,.45);
}

.baf-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.baf-dot-before { background: rgba(255,255,255,.5); }
.baf-dot-after  { background: var(--purple); }

.baf-ai-badge {
  position: absolute;
  top: .6rem; right: .6rem;
  display: flex; align-items: center; gap: .35rem;
  font-size: .62rem; font-weight: 700;
  background: linear-gradient(135deg, rgba(139,92,246,.8), rgba(244,114,182,.8));
  color: #fff;
  padding: .25rem .6rem;
  border-radius: 99px;
}

.baf-arrow {
  color: var(--muted);
  flex-shrink: 0;
}

.baf-disclaimer {
  margin-top: .9rem;
  font-size: .7rem;
  color: var(--muted);
  opacity: .65;
}

@media (max-width: 520px) {
  .baf-card { width: 140px; }
}

/* ── Auth modal ─────────────────────────────────────────────────────────── */
.auth-box { max-width: 380px; }

/* Email input inside auth modal */
.auth-box input[type="email"] {
  width: 100%;
  padding: .65rem .9rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit; font-size: .875rem;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  margin-top: .35rem;
}
.auth-box input[type="email"]::placeholder { color: var(--muted); }
.auth-box input[type="email"]:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: 100%;
  padding: .7rem 1rem;
  background: #fff;
  border: none;
  border-radius: var(--r-sm);
  color: #1f2937;
  font: 600 .875rem/1 "Sora", sans-serif;
  cursor: pointer;
  transition: background .15s;
  margin-top: 1.25rem;
}
.btn-google:hover { background: #f3f4f6; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0 .5rem;
  color: var(--muted);
  font-size: .75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: ""; flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-error {
  color: var(--danger);
  font-size: .78rem;
  margin-top: .4rem;
  min-height: 1.1rem;
}

.auth-note {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: .8rem;
  padding: .6rem .85rem;
  margin-bottom: 1rem;
}

/* ── OTP inputs ────────────────────────────────────────────────────────────── */
.otp-row {
  display: flex;
  gap: .45rem;
  justify-content: center;
  margin: 1.25rem 0 .75rem;
}
.otp-digit {
  width: 42px; height: 54px;
  text-align: center;
  font: 700 1.5rem/1 "IBM Plex Mono", monospace;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  outline: none;
  caret-color: var(--purple);
  transition: border-color .15s, box-shadow .15s;
}
.otp-digit:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,.18);
}

/* ── Gallery nav link ─────────────────────────────────────────────────── */
.btn-gallery-nav {
  font-family: inherit; font-size: .78rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  padding: .38rem .8rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: color .15s, border-color .15s;
}
.btn-gallery-nav:hover { color: var(--text); border-color: var(--purple); }

/* ── Section divider ─────────────────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Gallery ─────────────────────────────────────────────────────────────── */
.gallery-section {
  max-width: 980px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
  position: relative; z-index: 1;
}

.gallery-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.gallery-title { font-size: 1.3rem; font-weight: 800; color: var(--text); margin-top: .25rem; }
.gallery-header-right { display: flex; align-items: center; gap: .75rem; }
.gallery-count {
  font-size: .72rem; font-weight: 600; color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 99px; padding: .3rem .8rem;
}
.btn-clear-gallery {
  background: none; border: 1px solid var(--border);
  font-family: inherit; font-size: .72rem; font-weight: 600;
  color: var(--muted); border-radius: 99px; padding: .3rem .8rem;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.btn-clear-gallery:hover { border-color: var(--danger); color: var(--danger); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .85rem;
}

.gallery-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .75rem; padding: 3rem 1rem;
  border: 1px dashed rgba(255,255,255,.06);
  border-radius: var(--r);
  color: var(--muted); font-size: .8rem; text-align: center;
}

.gallery-item {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.gallery-item:hover { transform: scale(1.03); box-shadow: 0 8px 32px rgba(139,92,246,.25); }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.gallery-item .item-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 50%);
  opacity: 0; transition: opacity .2s;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: .5rem;
}
.gallery-item:hover .item-overlay { opacity: 1; }
.gallery-item .item-dl {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: rgba(255,255,255,.15); border-radius: 8px;
  color: #fff; text-decoration: none;
}
.gallery-item .item-date {
  position: absolute; top: .45rem; left: .5rem;
  font-size: .6rem; font-weight: 600; color: rgba(255,255,255,.5);
  font-family: "IBM Plex Mono", monospace;
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.lightbox-inner {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .85rem;
  max-width: 90vw; max-height: 90vh;
}
.lightbox-img {
  max-width: 85vw; max-height: 80vh;
  object-fit: contain;
  border-radius: var(--r);
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
}
.lightbox-close {
  position: absolute; top: -2.5rem; right: 0;
}
.lightbox-dl { align-self: center; }
