/* ─────────────────────────────────────────────────────────
   STR Photos — Dashboard
   Cream + serif design system, extended for app surfaces
   ───────────────────────────────────────────────────────── */

:root {
  --cream: #faf6ef;
  --cream-2: #f3ece0;
  --cream-3: #ebe3d2;
  --ink: #1a1a1a;
  --ink-2: #2c2925;
  --muted: rgba(26, 26, 26, 0.6);
  --muted-2: rgba(26, 26, 26, 0.42);
  --line: rgba(26, 26, 26, 0.1);
  --line-soft: rgba(26, 26, 26, 0.06);
  --accent: #c8553d;
  --accent-deep: #a83f29;
  --accent-soft: rgba(200, 85, 61, 0.08);
  --gold: #c89b3c;
  --green: #3d7a52;
  --green-soft: rgba(61, 122, 82, 0.1);
  --amber: #c89b3c;
  --amber-soft: rgba(200, 155, 60, 0.12);
  --shadow-sm: 0 2px 8px rgba(40, 24, 12, 0.06);
  --shadow-md: 0 12px 30px rgba(40, 24, 12, 0.08);
  --shadow-lg: 0 28px 60px rgba(40, 24, 12, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: 220ms cubic-bezier(0.2, 0.7, 0.2, 1);

  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; }
body { background: var(--cream); overflow-x: hidden; }
body.modal-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* Backdrop */
.grain {
  pointer-events: none; position: fixed; inset: 0; z-index: 1;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.ambient { pointer-events: none; position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.ambient-blob { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.45; }
.ambient-1 { width: 580px; height: 580px; top: -200px; right: -160px; background: radial-gradient(circle, rgba(200, 85, 61, 0.3), transparent 60%); animation: drift 32s ease-in-out infinite alternate; }
.ambient-2 { width: 460px; height: 460px; bottom: -180px; left: -120px; background: radial-gradient(circle, rgba(200, 155, 60, 0.22), transparent 60%); animation: drift 40s ease-in-out infinite alternate-reverse; }
@keyframes drift {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(80px, -60px, 0) scale(1.1); }
}

.app { position: relative; z-index: 2; min-height: 100vh; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  --pad-y: 11px; --pad-x: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: var(--pad-y) var(--pad-x); border-radius: var(--radius-pill);
  font: 600 0.9rem/1 var(--sans); letter-spacing: 0.01em;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  background: transparent; color: inherit;
  transition: transform var(--ease), background var(--ease), color var(--ease), box-shadow var(--ease), border-color var(--ease);
  white-space: nowrap;
}
.btn-sm { --pad-y: 8px; --pad-x: 14px; font-size: 0.82rem; }
.btn-lg { --pad-y: 15px; --pad-x: 24px; font-size: 0.98rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--ink); color: var(--cream); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: rgba(26, 26, 26, 0.04); border-color: rgba(26, 26, 26, 0.18); }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; border-color: var(--line); font-size: 1.2rem; }
.btn-icon:hover { background: rgba(26, 26, 26, 0.04); }
.btn-link { background: none; border: none; color: var(--muted); padding: 8px 0; font-size: 0.88rem; cursor: pointer; }
.btn-link:hover { color: var(--ink); }
.btn-danger { color: rgba(180, 50, 30, 0.85); }
.btn-danger:hover { color: rgba(140, 30, 20, 1); }
.btn-danger-solid { background: var(--accent-deep); color: var(--cream); box-shadow: var(--shadow-sm); }
.btn-danger-solid:hover { background: #862d1d; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-success { background: var(--green); color: var(--cream); cursor: default; opacity: 0.85; }
.btn[disabled] { cursor: default; }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 246, 239, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.crumbs { display: flex; gap: 10px; align-items: center; font-size: 0.88rem; color: var(--muted); flex: 1; min-width: 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumb-sep { color: var(--muted-2); }

/* Credits pill */
.credits-pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid rgba(200, 85, 61, 0.18); cursor: pointer;
  font-family: var(--serif); transition: background var(--ease), transform var(--ease);
}
.credits-pill:hover { background: rgba(200, 85, 61, 0.14); transform: translateY(-1px); }
.credits-num { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.credits-label { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; }

/* Account menu */
.account-menu { position: relative; }
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--cream); border: none; cursor: pointer;
  font-family: var(--serif); font-weight: 600; font-size: 1rem;
}
.account-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px; background: var(--cream);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 8px; z-index: 50;
}
.account-email { padding: 10px 12px; font-size: 0.82rem; color: var(--muted); border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.account-dropdown a, .account-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  font: 500 0.9rem var(--sans); color: var(--ink); text-decoration: none;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--cream-2); }

/* ── Main / pages ─────────────────────────────────────── */
.main { position: relative; z-index: 2; }
.page { max-width: 1240px; margin: 0 auto; padding: 48px 24px 96px; }
.page-narrow { max-width: 720px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 32px;
}
.page h1, .page-head h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.85rem, 3.6vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em;
  margin: 12px 0 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ── Auth ─────────────────────────────────────────────── */
.auth-shell {
  position: relative; z-index: 2;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--cream); border: 1px solid var(--line-soft);
  border-radius: 22px; padding: 44px 38px;
  box-shadow: var(--shadow-lg);
}
.brand-center { justify-content: center; margin-bottom: 28px; }
.auth-title {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em;
  font-size: 1.85rem; margin: 0 0 8px;
}
.auth-sub { color: var(--muted); margin: 0 0 28px; line-height: 1.55; font-size: 0.96rem; }
.auth-foot { color: var(--muted-2); font-size: 0.78rem; margin-top: 14px; text-align: center; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 13px 14px;
  font: 500 1rem var(--sans); color: var(--ink);
  background: var(--cream); border: 1px solid var(--line);
  border-radius: 12px; transition: border-color var(--ease), box-shadow var(--ease);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card .btn-block { margin-top: 4px; margin-bottom: 8px; }

/* ── Modal ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(26, 20, 14, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-card {
  position: relative; width: min(100%, 500px);
  background: var(--cream);
  border: 1px solid rgba(26, 26, 26, 0.12);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-family: var(--serif); font-weight: 600;
  font-size: 1.55rem; letter-spacing: -0.02em;
  margin: 0 34px 18px 0;
}
.modal-body .field:last-child { margin-bottom: 0; }
.field small { font-size: 0.72rem; color: var(--muted-2); font-weight: 500; }
.modal-copy { color: var(--muted); line-height: 1.55; margin: 0; }
.modal-error {
  margin: 12px 0 0;
  color: var(--accent-deep);
  font-size: 0.86rem;
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 24px;
}
.modal-x {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.modal-x:hover { background: var(--cream-2); color: var(--ink); border-color: rgba(26, 26, 26, 0.18); }

/* Reveal */
.reveal-in { animation: revealIn 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes revealIn {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ── Welcome (empty dashboard) ────────────────────────── */
.welcome {
  text-align: center; padding: 60px 0 48px;
}
.welcome h1 em { font-style: italic; color: var(--accent-deep); }
.welcome .lede { color: var(--muted); font-size: 1.05rem; margin: 18px auto 28px; max-width: 540px; }
.welcome .btn { font-size: 1rem; }

.mini-steps {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.mini-steps li {
  background: var(--cream); border: 1px solid var(--line-soft);
  padding: 18px; border-radius: var(--radius); font-size: 0.92rem; color: var(--muted);
}
.mini-steps li span {
  display: inline-flex; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  align-items: center; justify-content: center; font-weight: 600; margin-right: 8px;
  font-family: var(--serif);
}

/* ── Listings grid ────────────────────────────────────── */
.listings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.listing-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--cream); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform var(--ease), box-shadow var(--ease);
}
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.listing-cover { aspect-ratio: 4 / 3; background: var(--cream-3); position: relative; }
.listing-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cream-2), var(--cream-3));
  font-size: 2.5rem; opacity: 0.4;
}
.listing-meta { padding: 18px 20px 20px; }
.listing-meta h3 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.listing-sub { color: var(--muted); font-size: 0.85rem; margin: 0 0 12px; }
.progress { height: 4px; background: var(--cream-3); border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width var(--ease); }

.listing-card-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex-direction: column; min-height: 240px;
  background: transparent; border: 2px dashed var(--line);
  cursor: pointer; color: var(--muted); font-family: var(--serif); font-size: 1rem;
}
.listing-card-add:hover { border-color: var(--accent); color: var(--accent-deep); transform: none; }
.listing-card-add span:first-child { font-size: 2rem; line-height: 1; }

/* ── Listing detail ───────────────────────────────────── */
.listing-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 28px;
}
.listing-title {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em;
  font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0; cursor: pointer;
  border-radius: 6px; padding: 0 4px; transition: background var(--ease);
}
.listing-title:hover { background: var(--accent-soft); }
.listing-stats { color: var(--muted); margin: 6px 0 0; font-size: 0.92rem; }
.listing-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.batch-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  padding: 14px 16px;
  margin: -12px 0 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--cream);
  box-shadow: var(--shadow-sm);
}
.batch-bar strong { font-size: 0.95rem; }
.batch-bar .muted { color: var(--muted); margin: 4px 0 0; font-size: 0.84rem; }
.batch-style-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.batch-progress {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--accent-deep);
  font-size: 0.86rem;
  font-weight: 700;
}

.approved-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.approved-toolbar h3 {
  margin: 0;
  font-size: 1rem;
}
.approved-toolbar .muted {
  margin: 3px 0 0;
  font-size: 0.86rem;
}
.approved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.listing-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line-soft);
}
.listing-tab {
  appearance: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 700 0.82rem var(--sans);
  letter-spacing: 0.04em;
  margin-bottom: -1px;
  padding: 10px 14px;
  text-transform: uppercase;
}
.listing-tab:hover { color: var(--ink); }
.listing-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent-deep);
}
.listing-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.7rem;
}

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.photo-tile {
  position: relative; display: block; aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--cream-3); cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), box-shadow var(--ease);
}
.photo-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile-wrap {
  position: relative;
  min-width: 0;
}
.photo-tile-wrap .photo-tile { width: 100%; }
.photo-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.62);
  border-radius: 50%;
  background: rgba(36, 27, 23, 0.76);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}
.photo-delete-btn:hover,
.photo-delete-btn:focus-visible {
  background: var(--accent-deep);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.photo-delete-btn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}
.photo-select-tile {
  width: 100%;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
.photo-tile-selected {
  box-shadow: 0 0 0 3px var(--accent), var(--shadow-md);
}
.photo-select-tile[disabled] { cursor: wait; opacity: 0.78; }
.select-mark {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.38);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.photo-tile-selected .select-mark { background: var(--accent); border-color: var(--cream); }

.cover-badge {
  position: absolute; top: 8px; left: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--cream); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; box-shadow: var(--shadow-sm);
}
.photo-select-tile .cover-badge { left: 42px; }
.status-badge {
  position: absolute; bottom: 8px; right: 8px;
  padding: 3px 8px; border-radius: var(--radius-pill);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(0,0,0,0.55); color: white; backdrop-filter: blur(4px);
}
.status-original { background: rgba(60, 50, 40, 0.55); }
.status-preview { background: var(--amber); color: var(--ink); }
.status-approved { background: var(--green); }
.status-rejected { background: rgba(80, 80, 80, 0.6); }

.generation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.generation-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--cream);
  box-shadow: var(--shadow-sm);
}
.generation-card-img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: none;
  padding: 0;
  background: var(--cream-3);
  color: inherit;
  cursor: pointer;
}
div.generation-card-img { cursor: default; }
.generation-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
button.generation-card-img:hover img { filter: saturate(1.04) contrast(1.03); }
.generation-pending .generation-card-img img { opacity: 0.68; }
.generation-pending .generation-card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36, 27, 23, 0.08), rgba(36, 27, 23, 0.28));
}
.generation-failed .generation-card-img img { filter: grayscale(0.6); }
.generation-card-body {
  padding: 13px 14px 14px;
}
.generation-card-body h3 {
  margin: 0 0 5px;
  font: 700 0.94rem var(--sans);
  letter-spacing: 0;
}
.generation-card-body .muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.generation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.generation-error {
  margin: 8px 0 0;
  color: var(--accent-deep);
  font-size: 0.82rem;
  line-height: 1.4;
}
.empty-panel {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  padding: 44px 18px;
  text-align: center;
}
.empty-panel h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}
.empty-panel .muted { margin: 0; color: var(--muted); }

.share-dialog {
  display: grid;
  gap: 14px;
}
.share-url-field {
  display: grid;
  gap: 6px;
}
.share-url-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.share-url-field input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream-2);
  color: var(--ink);
  font: 600 0.9rem var(--sans);
}
.share-url-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.share-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Dropzone */
.dropzone-empty {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 80px 24px; text-align: center;
  background: var(--cream); cursor: pointer;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.dropzone-empty:hover, .dropzone-over { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.dropzone-icon { font-size: 2.4rem; margin-bottom: 12px; opacity: 0.6; }
.dropzone-empty h3 { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.dropzone-empty p { color: var(--muted); margin: 0 0 20px; }

.upload-progress {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--cream);
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-size: 0.9rem; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 50;
}

/* ── Photo detail ─────────────────────────────────────── */
.photo-page {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 360px);
  gap: 32px; align-items: flex-start;
}
.photo-stage { min-width: 0; }
.variant-tabs {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.variant-tab {
  background: var(--cream); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: var(--radius-pill);
  font: 500 0.85rem var(--sans); color: var(--muted); cursor: pointer;
  transition: all var(--ease);
}
.variant-tab:hover { border-color: rgba(26,26,26,0.18); color: var(--ink); }
.variant-tab.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.ba-frame, .single-frame {
  position: relative; aspect-ratio: 3 / 2;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg); background: #1a1410;
  cursor: ew-resize; user-select: none;
}
.single-frame { cursor: default; }
.ba-frame img, .single-frame img { width: 100%; height: 100%; object-fit: cover; }
.ba-after, .ba-before { position: absolute; inset: 0; }
.ba-before { clip-path: inset(0 50% 0 0); }
.ba-divider {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: rgba(255,255,255,0.85); transform: translateX(-50%);
  box-shadow: 0 0 20px rgba(0,0,0,0.25); pointer-events: none;
}
.ba-handle {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--cream); color: var(--ink); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: ew-resize; pointer-events: auto;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35), 0 0 0 2px var(--cream);
}
.ba-tag {
  position: absolute; top: 14px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: white; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
}
.ba-tag-before { left: 14px; }
.ba-tag-after { right: 14px; }

.variant-gallery {
  margin-top: 18px;
}
.variant-gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.variant-gallery-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.variant-gallery-head .muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.variant-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.variant-thumb {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.variant-thumb:hover {
  transform: translateY(-1px);
  border-color: rgba(200, 85, 61, 0.28);
  box-shadow: var(--shadow-md);
}
.variant-thumb-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 85, 61, 0.18), var(--shadow-md);
}
.variant-thumb-img {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--cream-3);
}
.variant-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.variant-thumb-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.variant-thumb-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px 2px;
}
.variant-thumb-title {
  font-size: 0.84rem;
  font-weight: 700;
}
.variant-thumb-sub {
  color: var(--muted);
  font-size: 0.72rem;
}

.photo-rail { position: sticky; top: 88px; }
.decision-card {
  background: var(--cream); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.decision-card h3 {
  font-family: var(--serif); font-weight: 600; font-size: 1.2rem;
  margin: 0 0 6px; letter-spacing: -0.01em;
}
.decision-card .muted { color: var(--muted); font-size: 0.86rem; margin: 0 0 16px; }
.decision-head { margin-bottom: 14px; }

.try-again-callout {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 12px;
  margin-bottom: 18px;
}
.try-again-callout h3 { font-size: 1rem; margin-bottom: 4px; }
.try-again-callout .muted { margin-bottom: 0; }
.try-again-callout .btn { margin-top: 12px; }

.generation-progress {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(200, 85, 61, 0.2);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.generation-progress h3 {
  font-family: var(--sans);
  font-size: 0.92rem;
  margin: 0 0 4px;
}
.generation-progress .muted { margin-bottom: 0; }
.generation-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(200, 85, 61, 0.22);
  border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.style-picker-label {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.style-picker { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.style-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--cream-2); border: 1px solid transparent;
  font: 500 0.92rem var(--sans); color: var(--ink); cursor: pointer; text-align: left;
  transition: all var(--ease);
}
.style-chip:hover { background: var(--accent-soft); border-color: rgba(200, 85, 61, 0.2); }
.style-chip-done { background: var(--green-soft); }
.style-chip-loading { background: var(--accent-soft); border-color: rgba(200, 85, 61, 0.2); }
.style-chip[disabled] { cursor: wait; opacity: 0.72; }
.chip-icon { font-size: 1rem; }
.chip-check { margin-left: auto; color: var(--green); font-weight: 700; }

.variant-downloads {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.variant-downloads-title {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.divider { border: none; border-top: 1px solid var(--line-soft); margin: 16px 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.pill-soft { background: var(--amber-soft); color: #8a6a25; }

.photo-nav { display: flex; gap: 8px; }
.photo-nav .btn { flex: 1; }

/* ── Account ──────────────────────────────────────────── */
.settings-card {
  background: var(--cream); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 24px; margin-top: 18px;
  box-shadow: var(--shadow-sm);
}
.settings-card h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 12px; letter-spacing: -0.01em; }
.settings-card p { margin: 0 0 12px; color: var(--ink); }
.settings-card .muted { color: var(--muted); }
.big-num { font-family: var(--serif); font-size: 3rem; font-weight: 500; letter-spacing: -0.03em; line-height: 1; margin: 8px 0 6px; }
.danger-card { border-color: rgba(180, 50, 30, 0.18); }

/* ── Buy ──────────────────────────────────────────────── */
.buy-card {
  background: var(--cream); border-radius: 22px;
  padding: 36px 32px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-soft); margin-top: 28px;
  position: relative;
}
.buy-card::before {
  content: ""; position: absolute; inset: -1px;
  border-radius: 22px; padding: 1px;
  background: linear-gradient(140deg, rgba(200, 85, 61, 0.4), transparent 40%, rgba(200, 155, 60, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.buy-head h3 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; margin: 0 0 4px; }
.qty {
  display: flex; align-items: center; gap: 16px;
  margin: 28px 0;
}
.qty-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--cream);
  font-size: 1.2rem; cursor: pointer; transition: all var(--ease);
}
.qty-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.qty-val { font-family: var(--serif); font-size: 2rem; font-weight: 500; min-width: 40px; text-align: center; letter-spacing: -0.02em; }
.buy-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  margin-bottom: 22px; color: var(--muted);
}
.buy-price { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; color: var(--ink); letter-spacing: -0.03em; }
.muted.small { font-size: 0.78rem; margin-top: 14px; text-align: center; }
.lede { color: var(--muted); margin: 14px 0 0; line-height: 1.55; }
.page-narrow .eyebrow { margin-bottom: 14px; }
.page-narrow h1 em { font-style: italic; color: var(--accent-deep); }

/* ── Toast ────────────────────────────────────────────── */
#toast {
  position: fixed; top: 80px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 11px 18px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--cream);
  font: 500 0.88rem var(--sans);
  box-shadow: var(--shadow-md);
  animation: toastIn 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.toast-success { background: var(--green); }
.toast-error { background: var(--accent-deep); }
.toast-out { animation: toastOut 240ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .photo-page { grid-template-columns: 1fr; }
  .photo-rail { position: static; }
}

@media (max-width: 640px) {
  .topbar-inner { padding: 0 16px; height: 56px; gap: 12px; }
  .crumbs { display: none; }
  .credits-pill { padding: 7px 12px; }
  .credits-num { font-size: 0.92rem; }
  .credits-label { display: none; }
  .brand-name { font-size: 1.05rem; }

  .page { padding: 28px 16px 80px; }
  .page-head { margin-bottom: 22px; }
  .listings-grid { grid-template-columns: 1fr; gap: 14px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .listing-head { margin-bottom: 18px; }
  .listing-actions .btn { padding: 9px 14px; font-size: 0.82rem; }
  .batch-bar { grid-template-columns: 1fr; margin-top: -4px; }
  .batch-style-actions { justify-content: stretch; }
  .batch-style-actions .btn { width: 100%; }
  .approved-toolbar { align-items: stretch; flex-direction: column; }
  .approved-toolbar .btn, .approved-actions, .share-dialog-actions .btn { width: 100%; }
  .listing-tabs { overflow-x: auto; margin-bottom: 14px; }
  .listing-tab { padding: 10px 12px; white-space: nowrap; }
  .generation-grid { grid-template-columns: 1fr; gap: 10px; }
  .mini-steps { grid-template-columns: 1fr; }
  .variant-gallery-head { display: block; }
  .variant-gallery-head .muted { margin-top: 3px; }
  .variant-thumb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-card { padding: 32px 24px; }
  .photo-rail { margin-top: 16px; }
  .modal-backdrop { align-items: flex-end; padding: 12px; }
  .modal-card { padding: 26px 20px 20px; border-radius: 18px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  #toast { top: 68px; right: 12px; left: 12px; }
  .toast { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Misc ─────────────────────────────────────────────── */
.error-state { padding: 80px 0; text-align: center; }
.error-state h2 { font-family: var(--serif); font-weight: 500; margin: 0 0 8px; }
.error-state p { color: var(--muted); }
.muted { color: var(--muted); }
