/* ═══════════════════════════════════════════════════════════════════════
   Nirmeka Model Photography — Enterprise Dark Theme
   Design ref: Vercel / Linear / Raycast
   ═══════════════════════════════════════════════════════════════════════ */

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

/* --- Design Tokens --- */
:root {
  /* Palette */
  --bg:              #09090b;
  --bg-card:         #18181b;
  --bg-elevated:     #27272a;
  --border:          #3f3f46;
  --border-hover:    #52525b;
  --text-primary:    #fafafa;
  --text-secondary:  #a1a1aa;
  --text-muted:      #71717a;
  --accent:          #8b5cf6;
  --accent-hover:    #a78bfa;
  --accent-dim:      rgba(139, 92, 246, 0.10);
  --accent-glow:     rgba(139, 92, 246, 0.15);
  --success:         #22c55e;
  --success-dim:     rgba(34, 197, 94, 0.12);
  --error:           #ef4444;
  --error-dim:       rgba(239, 68, 68, 0.12);
  --warning:         #f59e0b;
  --warning-dim:     rgba(245, 158, 11, 0.12);

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Legacy aliases (used in HTML inline styles / JS) */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-2xl: 24px;

  /* Shadows — layered for depth */
  --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:    0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg:    0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl:    0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 24px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(63, 63, 70, 0.5);
  --shadow-glow:  0 0 24px var(--accent-glow), 0 0 48px rgba(139, 92, 246, 0.08);

  /* Motion */
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.55, 0, 1, 0.45);
  --ease-out:  cubic-bezier(0, 0.55, 0.45, 1);
  --dur-fast:  120ms;
  --dur-norm:  200ms;
  --dur-slow:  300ms;

  /* Legacy aliases */
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --shadow-card:     var(--shadow-sm);
  --shadow-elevated: var(--shadow-lg);
  --bg-primary:      var(--bg);
}


/* ═══════════════════════════════════════
   BASE
   ═══════════════════════════════════════ */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle noise texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover {
  color: var(--accent-hover);
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(139, 92, 246, 0.3);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

[hidden] {
  display: none !important;
}


/* ═══════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}


/* ═══════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════ */

h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1 { font-size: clamp(1.375rem, 2vw, 1.75rem); }
h2 { font-size: clamp(1.125rem, 1.5vw, 1.375rem); }
h3 { font-size: clamp(0.9375rem, 1.2vw, 1.125rem); }
h4 { font-size: 0.875rem; }

.section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success); }
.text-error     { color: var(--error); }


/* ═══════════════════════════════════════
   NAV
   ═══════════════════════════════════════ */

.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px) saturate(1.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  border-bottom: 1px solid rgba(63, 63, 70, 0.4);
}

.nav-gradient {
  position: sticky;
  top: 56px;
  z-index: 99;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), #c084fc, var(--accent));
  background-size: 200% 100%;
  animation: navGradientShift 6s ease infinite;
  opacity: 0.8;
}

@keyframes navGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}


/* ═══════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════ */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.section {
  min-height: calc(100vh - 58px);
}

.upload-layout {
  display: grid;
  grid-template-columns: 30% 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 768px) {
  .upload-layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}


/* ═══════════════════════════════════════
   APP HEADER (section headers)
   ═══════════════════════════════════════ */

.app-header {
  padding: var(--space-10) 0 var(--space-8);
  max-width: 1400px;
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.app-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.title-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-weight: 400;
}

.app-logo {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.app-logo h1 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.app-logo .badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}


/* ═══════════════════════════════════════
   UPLOAD CONTAINERS
   ═══════════════════════════════════════ */

.upload-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}


/* ═══════════════════════════════════════
   UPLOAD STEPS
   ═══════════════════════════════════════ */

.upload-step {
  margin-bottom: var(--space-10);
}

.step-label {
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.step-label h2 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.step-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  width: 100%;
  padding-left: 40px;
  margin-top: -2px;
}


/* ═══════════════════════════════════════
   DROP ZONE
   ═══════════════════════════════════════ */

.drop-zone,
.upload-zone {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-norm) var(--ease);
  background: var(--bg-card);
}

.drop-zone:hover,
.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.04);
  box-shadow: var(--shadow-glow);
}

.drop-zone.drag-over,
.upload-zone.drag-over {
  border-color: var(--accent-hover);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: var(--shadow-glow), inset 0 0 40px rgba(139, 92, 246, 0.06);
  transform: scale(1.005);
}

.drop-zone.has-files,
.upload-zone.has-files {
  border-style: solid;
  border-color: var(--border);
  padding: var(--space-6);
}

.drop-icon,
.upload-zone-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-4);
  color: var(--text-muted);
  display: block;
  transition: all var(--dur-norm) var(--ease);
  opacity: 0.6;
}

.drop-zone:hover .drop-icon,
.upload-zone:hover .upload-zone-icon {
  color: var(--accent);
  opacity: 1;
  transform: translateY(-2px);
}

.drop-zone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.drop-text,
.upload-zone-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.drop-text strong {
  color: var(--accent);
  font-weight: 600;
}

.drop-hint,
.upload-zone-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.drop-zone-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.btn-remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}

.btn-remove:hover {
  background: var(--error);
  border-color: var(--error);
  transform: scale(1.1);
}

.drop-zone input[type="file"],
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}


/* ═══════════════════════════════════════
   THUMBNAILS
   ═══════════════════════════════════════ */

.thumbs-area {
  margin-top: var(--space-4);
}

.thumbs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.thumbs-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-2);
}

.thumb-item {
  position: relative;
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--dur-fast) var(--ease);
  background: var(--bg-card);
}

.thumb-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-item-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 0.625rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.thumb-item:hover .thumb-item-remove {
  opacity: 1;
}

.thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.btn-add-more {
  margin-top: var(--space-3);
}


/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  letter-spacing: -0.01em;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — violet gradient */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: all var(--dur-fast) var(--ease);
}
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.08) 50%, transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow: var(--shadow-glow), 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Secondary — outline */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  transition: all var(--dur-fast) var(--ease);
}
.btn-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* WhatsApp share button */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  background: #25D366;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-norm) var(--ease);
}
.btn-whatsapp .btn-icon {
  width: 18px;
  height: 18px;
}
.btn-whatsapp:hover {
  background: #1ebe5d;
  box-shadow: 0 0 16px rgba(37, 211, 102, 0.25);
}
.btn-whatsapp:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-whatsapp:disabled:hover {
  box-shadow: none;
}

/* Ghost / text button */
.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease);
}

.btn-text:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error-dim);
  border-color: var(--error);
}

/* Download */
.btn-download {
  background: transparent;
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-download:hover:not(:disabled) {
  background: var(--success-dim);
  border-color: var(--success);
}

/* Generate — hero CTA */
.btn-generate {
  width: 100%;
  max-width: 480px;
  height: 52px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-lg);
  gap: var(--space-3);
}

/* Download all */
.btn-download-all {
  height: 44px;
  gap: var(--space-2);
  padding: 0 var(--space-6);
}

/* Size variants */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
  height: 32px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  height: 48px;
}

/* Icon button */
.btn-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}

.btn-icon-only:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-icon-only svg {
  width: 16px;
  height: 16px;
}


/* ═══════════════════════════════════════
   GENERATE AREA
   ═══════════════════════════════════════ */

/* --- Login Page --- */
.login-container {
  max-width: 380px;
  margin: 80px auto 0;
  text-align: center;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: var(--space-3);
}

.login-logo svg {
  width: 48px;
  height: 48px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: left;
}

.login-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-input {
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn-login {
  margin-top: var(--space-2);
  padding: 11px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 150ms ease, transform 100ms ease;
}

.btn-login:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  font-size: 0.8125rem;
  color: var(--error);
  text-align: center;
  margin: 0;
}

.login-footer {
  margin-top: var(--space-8);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Options Panel --- */
.options-panel {
  margin-top: var(--space-8);
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-5);
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 160px;
  flex: 1;
}

.option-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.option-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

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

/* Pill Toggle */
.pill-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
}

.pill-btn {
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

.pill-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.pill-btn--active {
  color: var(--text-primary);
  background: var(--accent);
}

.pill-btn--active:hover {
  background: var(--accent-hover);
}

/* Select Dropdown */
.option-select {
  padding: 7px 12px;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 150ms ease;
  appearance: auto;
}

.option-select:hover {
  border-color: var(--border-hover);
}

.option-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Detail photo attachment on thumbnails */
.detail-attach-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 3px 6px;
  font-size: 0.6875rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 150ms ease;
}

.detail-attach-btn:hover {
  background: var(--accent-glow);
  color: var(--accent-hover);
}

.detail-attach-btn.has-detail {
  color: var(--success);
  background: var(--success-dim);
  border-color: var(--success);
  border-style: solid;
}

.color-attach-btn {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
}

.color-attach-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.color-attach-btn.has-detail {
  color: var(--success);
  background: var(--success-dim);
  border-color: var(--success);
}

/* Detail area under each product thumb */
.detail-area {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 3px;
}

.item-id-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 4px 4px;
}

.item-id-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.item-id-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.item-id-input::placeholder {
  color: var(--text-muted);
}

.item-id-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Client-facing "Show product image (bottom-right)" toggle — above Generate */
.product-image-toggle-row {
  margin-bottom: 14px;
}

.detail-previews {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.mini-thumb-wrap {
  position: relative;
  display: inline-block;
}

.detail-mini-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
}

/* "Add angle" thumbnails (saree-mannequin mode) — bigger so reviewers can
   see what was uploaded without clicking through. Scoped to the mannequin
   previews container so close-up and color-variant thumbs stay compact. */
.saree-mannequin-previews .detail-mini-thumb {
  width: 64px;
  height: 64px;
  border-radius: 4px;
}

.saree-mannequin-previews {
  gap: 6px;
}

.mini-thumb-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: var(--error);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 0.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 100ms ease;
  padding: 0;
}

.mini-thumb-wrap:hover .mini-thumb-remove {
  opacity: 1;
}

/* ── Component Grid (5-component upload system) ──────────────── */
.component-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-top: 2px;
}

.component-slot {
  border: 1.5px dashed var(--border);
  border-radius: 4px;
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
  position: relative;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
}

.component-slot:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.05);
}

.component-slot.filled {
  border-style: solid;
  border-color: var(--success, #22c55e);
  background: rgba(34, 197, 94, 0.06);
}

.component-slot.uploading {
  opacity: 0.6;
  pointer-events: none;
}

.component-slot-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 1;
}

.component-slot.filled .component-slot-label {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.component-slot-hint {
  font-size: 0.55rem;
  color: var(--text-muted, #999);
  line-height: 1.2;
  z-index: 1;
}

.component-slot.filled .component-slot-hint {
  display: none;
}

.component-slot-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  z-index: 0;
}

.component-slot-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: var(--error);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 100ms ease;
  z-index: 2;
  padding: 0;
}

.component-slot:hover .component-slot-remove {
  opacity: 1;
}

/* Always show remove button on touch devices (no hover) */
.component-slot.filled .component-slot-remove,
.saree-component-slot.filled .component-slot-remove {
  opacity: 0.7;
}
.component-slot.filled:hover .component-slot-remove,
.saree-component-slot.filled:hover .component-slot-remove,
.saree-component-slot:hover .component-slot-remove {
  opacity: 1;
}

/* Locked options for basic tier */
.option-group.locked {
  opacity: 0.4;
  pointer-events: none;
}

.admin-toggles {
  margin-top: var(--space-6);
  padding: 0 var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-secondary, #aaa);
  user-select: none;
}
.toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary, #C9A84C);
  cursor: pointer;
}
.toggle-label {
  font-weight: 500;
}

/* Client-facing saree-input toggle (Half saree / Mannequin) — shown above the
   saree cards for clients opted in via clientSareeToggle (e.g. Ayan). Reuses
   the .segmented-control styling below. */
.client-saree-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: 0 0 var(--space-4);
}
.client-saree-toggle-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted, #9a9a9a);
}

/* One-click test rig button (admin/demo only — Nikhaar saree-9 test set) */
.btn-test-run {
  background: linear-gradient(135deg, #C9A84C 0%, #B8941D 100%);
  color: #1a1a1a;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 100ms ease;
}
.btn-test-run:hover { filter: brightness(1.1); }
.btn-test-run:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.5); }

/* Segmented control — used inside .admin-toggles for prompt variant / model */
.segmented-control {
  display: inline-flex;
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}
.segmented-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-secondary, #aaa);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  letter-spacing: 0.02em;
}
.segmented-btn + .segmented-btn {
  border-left: 1px solid rgba(201, 168, 76, 0.25);
}
.segmented-btn:hover:not(.is-active) {
  background: rgba(201, 168, 76, 0.08);
  color: var(--text-primary, #eee);
}
.segmented-btn.is-active {
  background: var(--primary, #C9A84C);
  color: #1a1a1a;
}

.generate-area {
  margin-top: var(--space-10);
  text-align: center;
  padding: 0 var(--space-6);
}

.generate-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-3);
}


/* ═══════════════════════════════════════
   CARDS (generic)
   ═══════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-body {
  padding: var(--space-4);
}

.card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ═══════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════ */

.progress-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
}

.progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  font-size: 0.8125rem;
}

.progress-label {
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.progress-eta {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.progress-bar-track {
  width: 100%;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 300ms var(--ease);
  position: relative;
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: progressShimmer 1.8s ease-in-out infinite;
}

@keyframes progressShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Legacy progress bar classes */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 300ms var(--ease);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: progressShimmer 1.8s ease-in-out infinite;
}

.progress-label-text { color: var(--text-secondary); }
.progress-label-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}


/* ═══════════════════════════════════════
   PROGRESS ACTIONS
   ═══════════════════════════════════════ */

.progress-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0 var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.progress-stats {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}


/* ═══════════════════════════════════════
   GENERATION GRID (progress section)
   ═══════════════════════════════════════ */

.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.gen-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-norm) var(--ease),
              box-shadow var(--dur-norm) var(--ease),
              border-color var(--dur-fast) var(--ease);
  animation: cardFadeIn 0.4s var(--ease) both;
}

.gen-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

/* Staggered entrance */
.gen-card:nth-child(1)  { animation-delay: 0ms; }
.gen-card:nth-child(2)  { animation-delay: 40ms; }
.gen-card:nth-child(3)  { animation-delay: 80ms; }
.gen-card:nth-child(4)  { animation-delay: 120ms; }
.gen-card:nth-child(5)  { animation-delay: 160ms; }
.gen-card:nth-child(6)  { animation-delay: 200ms; }
.gen-card:nth-child(7)  { animation-delay: 240ms; }
.gen-card:nth-child(8)  { animation-delay: 280ms; }
.gen-card:nth-child(9)  { animation-delay: 320ms; }
.gen-card:nth-child(10) { animation-delay: 360ms; }
.gen-card:nth-child(11) { animation-delay: 400ms; }
.gen-card:nth-child(12) { animation-delay: 440ms; }

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gen-card-image {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg);
  overflow: hidden;
}

.gen-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform var(--dur-slow) var(--ease);
}

.gen-card-image img:hover {
  transform: scale(1.03);
}

.gen-card-thumbnail {
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.gen-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gen-card-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.gen-card-badge.success {
  background: rgba(34, 197, 94, 0.9);
  color: #fff;
}

.gen-card-badge.failed {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

/* Pending state */
.gen-card.pending .gen-card-image {
  animation: pendingPulse 2s ease-in-out infinite;
}

/* Generating state */
.gen-card.generating .gen-card-image::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid rgba(63, 63, 70, 0.5);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.gen-card-info {
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  border-top: 1px solid rgba(63, 63, 70, 0.3);
}

.gen-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.gen-card-actions {
  display: flex;
  gap: var(--space-1);
}

/* gen-card inside gen-grid original/arrow/result layout */
.gen-card-original {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg);
}
.gen-card-original img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gen-card-arrow {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-1);
  font-size: 0.875rem;
}
.gen-card-result {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}
.gen-card-result img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gen-card-meta {
  padding: var(--space-2) var(--space-3);
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(63, 63, 70, 0.3);
}

/* Spinner inside gen-card-result */
.gen-card-result .spinner,
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(63, 63, 70, 0.5);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}


/* ═══════════════════════════════════════
   RESULT THUMB STATES
   ═══════════════════════════════════════ */

.result-thumb-pending {
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pendingPulse 2s ease-in-out infinite;
}

.result-thumb-generating {
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-thumb-error {
  background: rgba(239, 68, 68, 0.08);
}

.result-error-icon {
  font-size: 1.5rem;
  color: var(--error);
  font-weight: bold;
  opacity: 0.7;
}

.pending-spinner,
.generating-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(63, 63, 70, 0.5);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.generating-spinner {
  border-top-color: var(--accent-hover);
}

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

@keyframes pendingPulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.6; }
}


/* ═══════════════════════════════════════
   RESULTS SECTION
   ═══════════════════════════════════════ */

.results-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
}

.results-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.results-stats {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  font-variant-numeric: tabular-nums;
}

.results-bottom {
  margin-top: var(--space-10);
  text-align: center;
  padding-bottom: var(--space-8);
}


/* ═══════════════════════════════════════
   RESULTS GRID
   ═══════════════════════════════════════ */

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: var(--space-4);
}

.result-card {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 150ms var(--ease),
              box-shadow 150ms var(--ease),
              border-color 150ms var(--ease);
  position: relative;
  background: var(--bg-card);
}

.result-card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2), 0 0 0 1px var(--accent);
  border-color: var(--accent);
  z-index: 2;
}

.result-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}

.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-2);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}

.result-card:hover .result-actions {
  opacity: 1;
}


/* ═══════════════════════════════════════
   IMAGE MODAL
   ═══════════════════════════════════════ */

.image-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  animation: fadeIn 200ms var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.image-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-modal);
  animation: modalSlideUp 250ms var(--ease);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.image-modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all var(--dur-fast) var(--ease);
}

.image-modal-close:hover {
  background: var(--error);
  border-color: var(--error);
  transform: scale(1.1);
}

.image-modal-img {
  width: 100%;
}

.image-modal-img img {
  width: 100%;
  display: block;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.image-modal-error {
  padding: var(--space-12);
  text-align: center;
  color: var(--text-muted);
}

.image-modal-info {
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-modal-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.image-modal-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.image-modal-actions {
  padding: 0 var(--space-6) var(--space-6);
  display: flex;
  gap: var(--space-2);
}

.image-modal-actions .btn-primary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Crop & download (image modal; My Catalog lays .cat-crop-layer over its photo) */
.cat-detail-stage > .cat-crop-layer, .cat-detail-stage > .cat-crop-layer.cropping { position: absolute; z-index: 2; flex: none; }
.cat-crop-controls { display: flex; flex-direction: column; gap: var(--space-3); flex-shrink: 0; }
.cat-crop-controls[hidden] { display: none; }
/* While cropping, the side panel shows only the crop controls. */
.cat-detail.is-cropping .cat-detail-side > :not(.cat-detail-head):not(.cat-crop-controls) { display: none !important; }
.cat-detail.is-cropping .cat-detail-nav { display: none; }
.image-modal-img.cropping, .cat-crop-layer.cropping {
  position: relative;
  overflow: hidden; /* clips the dimming shadow to the image */
  user-select: none;
}

.crop-box {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  outline: 2px solid #fff;
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.crop-nw { left: -2px;  top: -2px;    cursor: nwse-resize; }
.crop-ne { right: -2px; top: -2px;    cursor: nesw-resize; }
.crop-sw { left: -2px;  bottom: -2px; cursor: nesw-resize; }
.crop-se { right: -2px; bottom: -2px; cursor: nwse-resize; }

.image-modal-actions.crop-actions {
  flex-direction: column;
  gap: var(--space-3);
}

.crop-ratios {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.crop-ratio {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
}
.crop-ratio small {
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.crop-ratio.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.crop-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.crop-buttons {
  display: flex;
  gap: var(--space-2);
}
.crop-buttons .btn-primary { flex: 1; }


/* ═══════════════════════════════════════
   LIGHTBOX (legacy)
   ═══════════════════════════════════════ */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-norm) var(--ease),
              visibility var(--dur-norm);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  transform: scale(0.96);
  transition: transform var(--dur-norm) var(--ease);
}

.lightbox-overlay.active .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}

.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}

.lightbox-close:hover {
  background: var(--error);
  border-color: var(--error);
}

.lightbox-caption {
  text-align: center;
  margin-top: var(--space-4);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}

.lightbox-nav:hover {
  background: var(--border);
}

.lightbox-nav.prev { left: -56px; }
.lightbox-nav.next { right: -56px; }

/* Simple lightbox (used in HTML) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}


/* ═══════════════════════════════════════
   GENERIC MODAL
   ═══════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-norm) var(--ease),
              visibility var(--dur-norm);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform var(--dur-norm) var(--ease);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.125rem;
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}


/* ═══════════════════════════════════════
   STATS BAR
   ═══════════════════════════════════════ */

.stats-bar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.stat-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}


/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}


/* ═══════════════════════════════════════
   CONFIG PANEL
   ═══════════════════════════════════════ */

.config-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.config-panel h3 {
  margin-bottom: var(--space-4);
}

.config-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.config-row .form-group {
  flex: 1;
  min-width: 180px;
  margin-bottom: 0;
}


/* ═══════════════════════════════════════
   TWO-COLUMN LAYOUT
   ═══════════════════════════════════════ */

.layout-split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 900px) {
  .layout-split {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  position: sticky;
  top: var(--space-6);
}


/* ═══════════════════════════════════════
   IMAGE GRID
   ═══════════════════════════════════════ */

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}


/* ═══════════════════════════════════════
   TAGS / CHIPS
   ═══════════════════════════════════════ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg);
}

.tag.tag-success {
  color: var(--success);
  background: var(--success-dim);
  border-color: transparent;
}

.tag.tag-error {
  color: var(--error);
  background: var(--error-dim);
  border-color: transparent;
}

.tag.tag-accent {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: transparent;
}


/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  opacity: 0.3;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.empty-state-text {
  font-size: 0.875rem;
}


/* ═══════════════════════════════════════
   TOAST / NOTIFICATION
   ═══════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  animation: toastIn 0.3s var(--ease);
  max-width: 360px;
  backdrop-filter: blur(8px);
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--error); }
.toast.toast-info    { border-left: 3px solid var(--accent); }

.toast-exit {
  animation: toastOut 0.2s var(--ease) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}


/* ═══════════════════════════════════════
   SKELETON LOADER
   ═══════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ═══════════════════════════════════════
   BATCH TOOLBAR
   ═══════════════════════════════════════ */

.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.batch-toolbar-left,
.batch-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}


/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 1200px) {
  .image-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .app {
    padding: var(--space-4);
  }

  .app-header {
    padding: var(--space-6) var(--space-4) var(--space-6);
  }

  .upload-container {
    padding: 0 var(--space-4);
  }

  .generate-area {
    padding: 0 var(--space-4);
  }

  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-bar {
    gap: var(--space-4);
    padding: var(--space-4);
  }

  .stat-divider {
    display: none;
  }

  .batch-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .lightbox-nav.prev { left: var(--space-2); }
  .lightbox-nav.next { right: var(--space-2); }

  .drop-zone,
  .upload-zone {
    padding: var(--space-8) var(--space-4);
  }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

@media (max-width: 480px) {
  .image-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .config-row {
    flex-direction: column;
  }

  .config-row .form-group {
    width: 100%;
  }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }

  .image-modal {
    max-width: 95vw;
    border-radius: var(--radius-lg);
  }

  .image-modal-img img {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .btn-generate {
    max-width: 100%;
  }
}


/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */

.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm          { gap: var(--space-2); }
.gap-md          { gap: var(--space-4); }
.gap-lg          { gap: var(--space-6); }
.w-full          { width: 100%; }
.mt-sm           { margin-top: var(--space-2); }
.mt-md           { margin-top: var(--space-4); }
.mt-lg           { margin-top: var(--space-6); }
.mb-md           { margin-bottom: var(--space-4); }
.mb-lg           { margin-bottom: var(--space-6); }
.hidden          { display: none !important; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Nav Bar
   ═══════════════════════════════════════ */

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(12px) saturate(1.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  border-bottom: 1px solid rgba(63, 63, 70, 0.4);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
}
.nav-logo-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.nav-wordmark {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.nav-wordmark-accent {
  color: var(--accent);
}
.nav-badge {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
}
.nav-gen-counter {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.nav-counter-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.nav-accent-line {
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), #c084fc, var(--accent));
  background-size: 200% 100%;
  animation: navGradientShift 6s ease infinite;
  opacity: 0.7;
}

/* Settings button — now uses .nav-action-btn in nav group */

/* Selfie column slide transition for user mode */
.upload-col--selfie {
  transition: all var(--dur-slow) var(--ease);
  overflow: hidden;
}
.upload-col--selfie.collapsed {
  display: none;
}
/* Single-column mode when selfie is collapsed */
.upload-columns.single-column {
  grid-template-columns: 1fr;
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Section Layout
   ═══════════════════════════════════════ */

.section-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-6) var(--space-8);
}
.section-header {
  margin-bottom: var(--space-8);
}
.section-header .section-title {
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  text-transform: none;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.section-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Upload Columns
   ═══════════════════════════════════════ */

.upload-columns {
  display: grid;
  grid-template-columns: minmax(240px, 30%) 1fr;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 768px) {
  .upload-columns {
    grid-template-columns: 1fr;
  }
}

.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}
.upload-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.upload-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.upload-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.step-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

/* Selfie drop zone — shorter/portrait */
.drop-zone--selfie {
  padding: var(--space-8) var(--space-6);
}
.drop-zone--selfie .drop-zone-preview img {
  max-height: 220px;
}

/* Drop zone icon (SVG) */
.drop-zone-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-3);
  color: var(--text-muted);
  display: block;
  opacity: 0.6;
  transition: all var(--dur-norm) var(--ease);
}
.drop-zone:hover .drop-zone-icon {
  color: var(--accent);
  opacity: 1;
  transform: translateY(-2px);
}
.drop-zone-text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.drop-zone-text strong {
  color: var(--accent);
}
.drop-zone-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Product Thumbs
   ═══════════════════════════════════════ */

.thumbs-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.btn-text--danger {
  color: var(--error);
  opacity: 0.7;
}
.btn-text--danger:hover {
  color: var(--error);
  opacity: 1;
  background: var(--error-dim);
}
.btn-text svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 2px;
}

/* JS-created product thumbnails */
.product-thumb {
  position: relative;
  width: 100px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  overflow: visible;
}
.product-thumb img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.product-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.product-thumb:hover .product-thumb-remove {
  opacity: 1;
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Generate Button
   ═══════════════════════════════════════ */

.btn-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  max-width: 480px;
  height: 52px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.01em;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all var(--dur-fast) var(--ease);
}
.btn-generate:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow: var(--shadow-glow), 0 2px 4px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
.btn-generate:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-generate-icon {
  width: 20px;
  height: 20px;
}

.btn-remove svg {
  width: 12px;
  height: 12px;
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Progress Section
   ═══════════════════════════════════════ */

.progress-header {
  margin-bottom: var(--space-4);
}
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  font-size: 0.8125rem;
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Results Bar
   ═══════════════════════════════════════ */

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.results-bar .results-stats {
  margin-bottom: 0;
}
.results-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.btn-celebrate-sound {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  opacity: 0.7;
}
.btn-celebrate-sound:hover {
  opacity: 1;
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Lightbox Backdrop
   ═══════════════════════════════════════ */

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.92);
}
.lightbox .lightbox-img {
  position: relative;
  z-index: 1;
}
.lightbox .lightbox-close {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  width: 36px;
  height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox .lightbox-close svg {
  width: 16px;
  height: 16px;
}
.lightbox .lightbox-close:hover {
  background: var(--error);
  border-color: var(--error);
}


/* ═══════════════════════════════════════
   HTML-SPECIFIC: Error Toast (dynamic)
   ═══════════════════════════════════════ */

.error-toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--error);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transform: translateX(120%);
  transition: transform 300ms var(--ease);
}
.error-toast--visible {
  transform: translateX(0);
}
.error-toast-msg {
  flex: 1;
}
.error-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.error-toast-close:hover {
  color: var(--text-primary);
}

/* Info toast (non-error, for progress messages) */
.info-toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid #a855f7;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transform: translateX(120%);
  transition: transform 300ms var(--ease);
}
.info-toast--visible { transform: translateX(0); }
.info-toast-msg { flex: 1; }
.info-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.info-toast-close:hover { color: var(--text-primary); }


/* ═══════════════════════════════════════
   LANDING PAGE — Mode Selection
   ═══════════════════════════════════════ */

.landing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: var(--space-10) var(--space-6);
  gap: var(--space-12);
}

.landing-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.landing-logo-icon {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.3));
}

.landing-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.landing-title-accent {
  color: var(--accent);
}

.landing-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* Card container */
.landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  max-width: 680px;
  width: 100%;
}

@media (max-width: 600px) {
  .landing-cards {
    grid-template-columns: 1fr;
    max-width: 340px;
  }
}

/* Individual card */
.landing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--dur-norm) var(--ease);
  text-align: center;
  outline: none;
  font-family: inherit;
  color: inherit;
}

.landing-card:hover,
.landing-card:focus-visible {
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.landing-card:active {
  transform: translateY(-1px);
}

.landing-card-icon {
  width: 80px;
  height: 80px;
}

.landing-card-icon svg {
  width: 100%;
  height: 100%;
}

.landing-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.landing-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.landing-card-arrow {
  position: absolute;
  top: var(--space-4);
  right: var(--space-5);
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease);
}

.landing-card:hover .landing-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ── Flag button ───────────────────────────────────────────────────────── */
/* PDF-select checkbox — top-left of each generated result card */
.result-select-wrap {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.result-select {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.btn-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
  padding: 4px;
}
.btn-flag svg { width: 14px; height: 14px; }
.gen-card:hover .btn-flag,
.result-card:hover .btn-flag,
.btn-flag.flagged { opacity: 1; }
.btn-flag.flagged { background: #ef4444; color: #fff; }
.btn-flag:hover { background: rgba(0,0,0,0.7); }
.btn-flag.flagged:hover { background: #dc2626; }

/* Flagged card indicator */
.gen-card.flagged,
.result-card.flagged { outline: 2px solid #ef4444; outline-offset: -2px; }

/* ═══════════════════════════════════════════════════════════════
   Usage Counter (nav bar)
   ═══════════════════════════════════════════════════════════════ */
/* One button: reads "See credits information", and swaps its own text for the usage line
   while it is pressed and held (JS sets .open on pointerdown, clears it on release). */
.nav-usage-wrap {
  display: inline-flex;
}
.nav-usage-wrap[hidden] { display: none; }
.nav-usage-toggle {
  font: inherit;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full, 9999px);
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  /* Long press must not select text or open the iOS callout */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
/* The counter is plain text inside the button. pointer-events: none so releasing a hold never
   fires the WhatsApp onclick that updateUsageDisplay puts on the counter. */
.nav-usage-counter {
  display: none;
  pointer-events: none;
}
.nav-usage-wrap.open .nav-usage-label { display: none; }
.nav-usage-wrap.open .nav-usage-counter { display: inline; }
/* 75-99% of the limit — warning amber */
.nav-usage-toggle.usage-warning {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}
/* 100% / expired — red */
.nav-usage-toggle.usage-cap {
  color: #fff;
  border-color: #dc2626;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   Batch Gate (Rating + Cooldown)
   ═══════════════════════════════════════════════════════════════ */
.batch-gate {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.batch-gate-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

/* Star rating */
.star-rating {
  display: inline-flex;
  gap: 8px;
}
.star-rating .star {
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--border);
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
  padding: 0;
  line-height: 1;
}
.star-rating .star:hover,
.star-rating .star.active {
  color: #f59e0b;
  transform: scale(1.15);
}
.star-rating .star:hover ~ .star {
  color: var(--border);
}

/* Cooldown timer */
.cooldown-timer {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  margin-top: 0.5rem;
  letter-spacing: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   My Batches / History
   ═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   Client Dashboard Cards
   ═══════════════════════════════════════════════════════════════ */
/* ── Catalog: link out to the Quality & Rating Guidelines modal ──────────
   The policy is one click from the Fidelity number it explains, rather than a
   permanent banner — a standing term, not an incident to warn about. */
.cat-guidelines-row {
  display: flex;
  justify-content: flex-end;
  margin: calc(-1 * var(--space-3)) 0 var(--space-4);
}
.cat-guidelines-row .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-guidelines-row svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* ── Quality & Rating Guidelines modal body ──────────────────────────────── */
.qg-block { margin-bottom: var(--space-5); }
.qg-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}
.qg-text {
  margin: 0 0 var(--space-2);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.qg-text:last-child { margin-bottom: 0; }
.qg-text strong { color: var(--text-primary); font-weight: 600; }
.qg-text em     { font-style: normal; color: var(--text-primary); }
.qg-foot {
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.client-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-5, 24px);
}

.client-stat-card {
  background: var(--card, #18181b);
  border: 1px solid var(--border, #3f3f46);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-4, 16px);
  text-align: center;
}

.client-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #71717a);
  margin-bottom: var(--space-1, 4px);
}

.client-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary, #fafafa);
  font-variant-numeric: tabular-nums;
}

.client-stat-sub {
  font-size: 0.75rem;
  color: var(--text-secondary, #a1a1aa);
  margin-top: 2px;
}

.client-stat-bar {
  height: 6px;
  background: var(--bg, #09090b);
  border-radius: 3px;
  margin-top: var(--space-2, 8px);
  overflow: hidden;
}

.client-stat-bar-fill {
  height: 100%;
  background: var(--accent, #8b5cf6);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.client-stat-bar-fill.bar-warning { background: var(--warning, #f59e0b); }
.client-stat-bar-fill.bar-danger { background: var(--error, #ef4444); }

@media (max-width: 700px) {
  .client-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .client-stats { grid-template-columns: 1fr; }
}

/* Nav action buttons (My Batches, Model) — grouped, distinct from counter */
.nav-btn-group {
  display: flex;
  gap: 1px;
  background: var(--border, #3f3f46);
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
}

.nav-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary, #a1a1aa);
  background: var(--bg-elevated, #27272a);
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 150ms ease;
}
.nav-action-btn:hover {
  color: var(--text-primary, #fafafa);
  background: var(--accent, #8b5cf6);
}
.nav-action-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.history-actions {
  display: flex;
  gap: var(--space-3, 12px);
  align-items: center;
  margin-bottom: var(--space-4, 16px);
}

.history-batch-card {
  background: var(--card, #18181b);
  border: 1px solid var(--border, #3f3f46);
  border-radius: var(--radius-lg, 12px);
  margin-bottom: var(--space-3, 12px);
  overflow: hidden;
}

.history-batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3, 12px) var(--space-4, 16px);
  gap: var(--space-3, 12px);
}

.history-batch-info {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  flex-wrap: wrap;
}

.history-batch-date {
  font-weight: 600;
  color: var(--text-primary, #fafafa);
  font-size: 0.9rem;
}

.history-batch-mode {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent, #8b5cf6);
  background: rgba(139, 92, 246, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
}

.history-batch-count {
  font-size: 0.8rem;
  color: var(--text-secondary, #a1a1aa);
}

.history-batch-rating {
  color: #f59e0b;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.history-batch-actions {
  display: flex;
  gap: var(--space-2, 8px);
  align-items: center;
  flex-shrink: 0;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}
.btn-icon-sm {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 2px;
}

.btn-toggle-batch {
  background: none;
  border: 1px solid var(--border, #3f3f46);
  color: var(--text-secondary);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px 8px;
}
.btn-toggle-batch:hover { color: var(--text-primary); }

.history-batch-images {
  padding: 0 var(--space-4, 16px) var(--space-4, 16px);
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
  border-top: 1px solid var(--border, #3f3f46);
  padding-top: var(--space-3, 12px);
}

.history-image-pair {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  background: var(--bg, #09090b);
  border-radius: var(--radius-md, 10px);
  padding: var(--space-2, 8px);
}

.history-img-wrap {
  flex: 1;
  position: relative;
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  aspect-ratio: 3/4;
  max-height: 320px;
}
/* "Select for catalog" checkbox on each batch output image (My Batches) */
.batch-select-wrap {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.batch-select {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.history-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}
.history-img-wrap img.draggable {
  object-fit: none;
  object-position: center center;
  cursor: grab;
}
.history-img-wrap img.draggable.dragging {
  cursor: grabbing;
}

.history-img-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 2px 0;
}

.history-img-arrow {
  font-size: 1.2rem;
  color: var(--text-muted, #71717a);
  flex-shrink: 0;
}

.history-img-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--card, #18181b);
  color: var(--text-muted, #71717a);
  font-size: 0.7rem;
}

.history-dl-single {
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text-muted, #71717a);
  flex-shrink: 0;
  padding: 4px;
}
.history-dl-single:hover { color: var(--accent, #8b5cf6); }

.history-failed-note {
  font-size: 0.8rem;
  color: var(--error, #ef4444);
  text-align: center;
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted, #71717a);
  font-size: 0.9rem;
}

/* ─── Flag UI ─────────────────────────────────────────────── */
.history-batch-num {
  font-weight: 700;
  color: var(--primary, #a855f7);
  font-size: 0.85rem;
}
.history-item-num {
  font-weight: 600;
  color: var(--text-muted, #71717a);
  font-size: 0.75rem;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.history-item-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.flag-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.35;
  transition: opacity 0.15s;
  padding: 4px;
}
.flag-btn:hover { opacity: 0.7; }
.flag-btn.flagged { opacity: 1; filter: none; }
.flag-reason-tag {
  font-size: 0.6rem;
  color: #f97316;
  background: rgba(249,115,22,0.1);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.history-image-pair.flagged {
  border-left: 3px solid #f97316;
  padding-left: 8px;
}
.history-batch-flag-count {
  font-size: 0.75rem;
  color: #f97316;
  background: rgba(249,115,22,0.12);
  padding: 2px 8px;
  border-radius: 10px;
}
.btn-flag-batch {
  font-size: 0.75rem !important;
}
.flag-dropdown {
  background: var(--surface, #27272a);
  border: 1px solid var(--border, #3f3f46);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.flag-dropdown-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text, #e4e4e7);
  padding: 8px 14px;
  text-align: left;
  font-size: 0.82rem;
  cursor: pointer;
}
.flag-dropdown-item:hover {
  background: var(--primary, #a855f7);
  color: #fff;
}
/* ─── Feedback UI ─────────────────────────────────────────── */
.feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.35;
  transition: opacity 0.15s;
  padding: 4px;
}
.feedback-btn:hover { opacity: 0.7; }
.feedback-btn.has-feedback { opacity: 1; }
.feedback-bubble {
  width: 100%;
  margin-top: 4px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: #a3e635;
  background: rgba(163,230,53,0.08);
  border-left: 2px solid rgba(163,230,53,0.3);
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
}
.btn-feedback-batch {
  font-size: 0.75rem !important;
}

@media (max-width: 600px) {
  .history-image-pair { flex-direction: column; }
  .history-img-arrow { transform: rotate(90deg); }
  .history-img-wrap { max-height: 120px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Saree Card Stack (one saree at a time upload)
   ═══════════════════════════════════════════════════════════════════════ */
.saree-batch-counter {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  white-space: nowrap;
}
.saree-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Individual saree card */
/* ── Multi-outfit slot cards (Unstitched Suit on Model) ──────────────
   One card per outfit, each with its own slot set and Item ID. Mirrors
   .saree-card's chrome so the two card flows read as the same product. */
.slot-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.875rem;
  margin-bottom: 0.875rem;
  transition: border-color 0.2s;
}
.slot-card:hover { border-color: var(--border-hover); }
.slot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.slot-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.slot-card-remove {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.slot-card-remove:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.slot-card .item-id-area { margin-top: 0.75rem; }
.slot-add-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.slot-card-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.saree-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.saree-card:hover {
  border-color: var(--border-hover);
}
.saree-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.saree-card-number {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #f59e0b;
}
.saree-card-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.saree-card-remove:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Per-suit arrangement picker — a footer band that brackets the card. Shows a grid
   of small template thumbnails (image + name) so the client sees each look before
   picking. Selected cell gets a gold border. */
.flatlay-arrangement {
  display: block;
  padding: 0.625rem 0.875rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.flatlay-arrangement__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.flatlay-arrangement__hint {
  font-weight: 400;
  color: var(--text-muted);
}
.flatlay-arrangement__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.55rem;
}
.arr-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.arr-thumb:hover { transform: translateY(-1px); }
.arr-thumb.selected { border-color: #C9A84C; }
.arr-thumb__img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #f1ece4;
}
.arr-thumb__name {
  font-size: 0.75rem;
  line-height: 1.15;
  text-align: center;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.arr-thumb.selected .arr-thumb__name {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Flat-lay upload area (inside card) */
.saree-flatlay-zone {
  padding: 1rem;
}
.saree-flatlay-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.saree-flatlay-dropzone:hover,
.saree-flatlay-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
/* Ghost placeholder for flat-lay */
.saree-flatlay-dropzone {
  position: relative;
  overflow: hidden;
}
.saree-flatlay-dropzone .flatlay-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.12;
  border-radius: 8px;
  pointer-events: none;
  transition: opacity 0.2s;
}
.saree-flatlay-dropzone:hover .flatlay-ghost {
  opacity: 0.25;
}
.saree-flatlay-dropzone .flatlay-ghost-overlay {
  position: relative;
  z-index: 1;
}
.saree-flatlay-dropzone .drop-zone-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  margin: 0 auto 0.5rem;
  display: block;
}
.saree-flatlay-dropzone .drop-zone-text {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.saree-flatlay-dropzone .drop-zone-hint {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Flat-lay preview (after upload) */
.saree-flatlay-preview {
  position: relative;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.saree-flatlay-preview img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}
.saree-flatlay-replace {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s;
}
.saree-flatlay-replace:hover {
  color: var(--text-primary);
}

/* Component slots grid (2x2) */
.saree-components {
  padding: 0 0.75rem 0.75rem;
}
.saree-components-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-align: center;
}
.saree-component-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}
.saree-component-grid:only-child,
.saree-component-grid[data-cols="1"] {
  grid-template-columns: 1fr;
}
.saree-component-grid[data-cols="3"] {
  /* minmax(0,1fr) forces exactly-equal columns regardless of label length
     (plain 1fr = minmax(auto,1fr) lets a longer label widen its track). */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.saree-component-grid[data-cols="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
/* Mannequin close-up slots — clean, equal, consistent cards. */
.saree-mannequin-slots .saree-component-slot {
  min-width: 0;
  min-height: 104px;
  border-radius: var(--radius-md, 10px);
  padding: 0.75rem 0.5rem;
}
.saree-mannequin-slots .slot-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Mutual exclusion for the admin overlay-slot trio (mannequin mode):
   ProductOverlay (`complete`) <-> bubble slots (`topBubble`/`bottomBubble`).
   Filling either group greys out and disables the other. */
.saree-overlay-slots:has([data-component-type="complete"].filled) [data-component-type="topBubble"],
.saree-overlay-slots:has([data-component-type="complete"].filled) [data-component-type="bottomBubble"],
.saree-overlay-slots:has([data-component-type="topBubble"].filled) [data-component-type="complete"],
.saree-overlay-slots:has([data-component-type="bottomBubble"].filled) [data-component-type="complete"] {
  opacity: 0.32;
  pointer-events: none;
  filter: grayscale(0.6);
}

/* ── Unified admin mannequin photo-list UI (multi-upload + drag-reorder + overlay mode) ── */
.saree-photolist-area { display: flex; flex-direction: column; gap: 0.85rem; width: 100%; }
.saree-photolist-dropzone {
  border: 2px dashed rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 1.75rem 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; min-height: 180px; cursor: pointer; user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.saree-photolist-dropzone:hover,
.saree-photolist-dropzone.dragover { border-color: #C9A84C; background: rgba(201,168,76,0.06); }
.saree-photolist-dropzone.uploading { opacity: 0.6; pointer-events: none; }
.saree-photolist-dropzone .drop-zone-icon { width: 32px; height: 32px; opacity: 0.6; }
.saree-photolist-dropzone .drop-zone-text { font-size: 0.95rem; color: #f5f5f5; }
.saree-photolist-dropzone .drop-zone-hint { font-size: 0.78rem; color: rgba(255,255,255,0.55); text-align: center; }
.saree-photolist-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
}
.photolist-thumb-wrapper {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;  /* allow grid item to shrink past content width */
}
.photolist-thumb-header {
  font-size: 0.7rem; line-height: 1.3;
  color: rgba(255,255,255,0.7); font-weight: 600;
  text-align: center;
  text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photolist-thumb {
  position: relative; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.12); cursor: grab; background: #0a0a0a;
}
.photolist-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photolist-thumb.is-overlay { border-color: #C9A84C; box-shadow: 0 0 0 1px rgba(201,168,76,0.45); }
.photolist-thumb.is-dragging { opacity: 0.4; cursor: grabbing; }
.photolist-thumb.is-drop-target { border-color: #ffffff; transform: scale(1.03); }
.photolist-thumb-index {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.65); color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 1px 6px; border-radius: 3px; line-height: 1.4;
}
.photolist-thumb-role {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  background: #C9A84C; color: #1a1300; font-size: 0.6rem; font-weight: 700;
  padding: 2px 5px; border-radius: 3px; text-align: center;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.photolist-thumb-remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.7); color: #fff; border: none;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.photolist-thumb-remove:hover { background: #ef4444; }
.saree-photolist-add-btn {
  align-self: flex-start; padding: 0.5rem 0.9rem;
  background: rgba(255,255,255,0.06); border: 1px dashed rgba(255,255,255,0.25);
  color: #f5f5f5; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
}
.saree-photolist-add-btn:hover { background: rgba(255,255,255,0.1); border-color: #C9A84C; color: #C9A84C; }
.saree-overlay-mode-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 0.2rem;
}
.overlay-mode-label { font-size: 0.85rem; color: rgba(255,255,255,0.7); font-weight: 500; }

/* ── Photo cropper / repositioner modal ── */
.photo-cropper-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.photo-cropper-modal {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex; flex-direction: column;
  max-width: 95vw; max-height: 95vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.photo-cropper-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1rem; gap: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.photo-cropper-title {
  color: rgba(255,255,255,0.7); font-size: 0.82rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.photo-cropper-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.photo-cropper-btn {
  padding: 0.45rem 0.95rem; border: none; border-radius: 6px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.photo-cropper-btn:disabled { opacity: 0.5; cursor: wait; }
.photo-cropper-btn-cancel {
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85);
}
.photo-cropper-btn-cancel:hover:not(:disabled) { background: rgba(255,255,255,0.15); }
.photo-cropper-btn-save {
  background: #C9A84C; color: #1a1300;
}
.photo-cropper-btn-save:hover:not(:disabled) { background: #d8b85c; }
.photo-cropper-stage {
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: #0a0a0a; min-height: 0; flex: 1;
}
.photo-cropper-image-wrap {
  position: relative; display: inline-block;
  max-width: 100%; max-height: 100%;
  line-height: 0;  /* eliminates inline-image baseline gap */
}
.photo-cropper-image {
  display: block;
  max-width: 90vw; max-height: calc(95vh - 150px);
  width: auto; height: auto;
  user-select: none; -webkit-user-drag: none;
}
.photo-cropper-rect {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);  /* dim everything outside */
  cursor: move;
  box-sizing: border-box;
}
.photo-cropper-rect[hidden] { display: none; }
.photo-cropper-handle {
  position: absolute; width: 14px; height: 14px;
  background: #fff; border: 1px solid rgba(0,0,0,0.5);
  border-radius: 2px;
}
.photo-cropper-handle[data-corner="nw"] { top: -8px; left: -8px; cursor: nwse-resize; }
.photo-cropper-handle[data-corner="ne"] { top: -8px; right: -8px; cursor: nesw-resize; }
.photo-cropper-handle[data-corner="sw"] { bottom: -8px; left: -8px; cursor: nesw-resize; }
.photo-cropper-handle[data-corner="se"] { bottom: -8px; right: -8px; cursor: nwse-resize; }
.photo-cropper-footer {
  padding: 0.6rem 1rem;
  font-size: 0.75rem; color: rgba(255,255,255,0.55);
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.photolist-thumb { cursor: pointer; }  /* upgrade from `grab` — click opens cropper, drag still reorders */
.photolist-thumb:hover { border-color: rgba(201,168,76,0.7); }
.photolist-thumb.is-dragging { cursor: grabbing; }

/* Tag pills (Top / Bottom) — Double mode only. Sit at the bottom of the thumb,
   above the role-label slot. Click to assign that role to this photo. */
.photolist-thumb-tags {
  position: absolute; left: 4px; right: 4px; bottom: 4px;
  display: flex; gap: 4px; justify-content: center;
}
.photolist-tag-pill {
  flex: 1; padding: 3px 0;
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; line-height: 1;
  background: rgba(0,0,0,0.65); color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 3px;
  cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.photolist-tag-pill:hover { background: rgba(0,0,0,0.85); border-color: rgba(201,168,76,0.6); }
.photolist-tag-pill.is-active {
  background: #C9A84C; color: #1a1300; border-color: #C9A84C;
}
.saree-component-grid[data-cols="5"] {
  grid-template-columns: repeat(5, 1fr);
}
.saree-component-grid[data-cols="5"] .saree-component-slot {
  min-height: 288px;
}
.saree-component-grid[data-cols="5"] .slot-with-title {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.saree-component-grid[data-cols="5"] .slot-title {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.saree-component-grid[data-cols="6"] {
  grid-template-columns: repeat(6, 1fr);
}
.saree-component-grid[data-cols="6"] .saree-component-slot {
  min-height: 240px;
}
.saree-component-grid[data-cols="6"] .slot-with-title {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.saree-component-grid[data-cols="6"] .slot-title {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
@media (max-width: 768px) {
  .saree-component-grid[data-cols="5"] {
    grid-template-columns: repeat(3, 1fr);
  }
  .saree-component-grid[data-cols="6"] {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Locked state for unified suit slots (disabled until kameez is uploaded) */
.saree-component-slot.locked {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.saree-component-slot.locked:hover {
  border-color: var(--border);
  background: transparent;
}
.saree-component-slot {
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.saree-component-slot:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.saree-component-slot.filled {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-dim);
  padding: 0.25rem;
}
/* Ghost placeholder image */
.saree-component-slot .slot-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.15;
  pointer-events: none;
  transition: opacity 0.2s;
}
.saree-component-slot:hover .slot-ghost {
  opacity: 0.3;
}
.saree-component-slot.filled .slot-ghost {
  display: none;
}
/* Overlay text on top of ghost */
.saree-component-slot .slot-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.saree-component-slot .slot-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.saree-component-slot .slot-plus {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1;
}
.saree-component-slot.filled .slot-overlay {
  display: none;
}
.saree-component-slot .slot-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.saree-component-slot .slot-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(9, 9, 11, 0.8);
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.saree-component-slot .slot-remove:hover {
  color: var(--error);
}

/* Color variants area in saree card */
.saree-color-area {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.saree-color-previews {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.saree-color-btn {
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.saree-color-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Add saree button */
.saree-add-area {
  margin-top: 0.75rem;
}
.btn-add-saree {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem;
  background: none;
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.btn-add-saree:hover {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}
.btn-add-saree:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-add-saree:disabled:hover {
  border-color: var(--border);
  color: var(--text-secondary);
  background: none;
}
.btn-add-saree svg {
  width: 20px;
  height: 20px;
}



/* ═══════════════════════════════════════════════════════════════════════
   HERO / PUBLIC LANDING PAGE
   ═══════════════════════════════════════════════════════════════════════ */

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-12);
}

/* --- Hero Top (above the fold) --- */
.hero-top {
  text-align: center;
  margin-bottom: var(--space-16);
}
.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.hero-logo-icon {
  width: 56px;
  height: 56px;
}
.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.hero-title-accent {
  color: var(--accent);
}
.hero-headline {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-4);
}
.hero-subtext {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto var(--space-8);
}
.hero-buttons {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-3);
}
.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.3);
}
.btn-hero-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 32px rgba(139, 92, 246, 0.45);
}
.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-hero-secondary:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
}
.hero-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Section Headings --- */
.hero-section-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-8);
  letter-spacing: -0.02em;
}

/* --- Showcase (Before/After) --- */
.hero-showcase {
  margin-bottom: var(--space-16);
}
.showcase-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.showcase-card {
  width: 260px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.showcase-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  padding: var(--space-2);
}
.showcase-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 160px;
  gap: var(--space-2);
  color: var(--text-muted);
}
.showcase-placeholder--result {
  background: var(--accent-dim);
  color: var(--accent-hover);
}
.showcase-icon {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}
.showcase-label {
  font-size: 0.75rem;
  font-weight: 500;
}
.showcase-tag {
  display: block;
  text-align: center;
  padding: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.showcase-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* --- Showcase carousel: one before → after pair per slide --- */
.showcase-carousel {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.showcase-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.showcase-track::-webkit-scrollbar {
  display: none;
}
.showcase-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin-bottom: 0;
  padding: 0 var(--space-10);
}
.showcase-slide .showcase-card {
  flex: 1 1 0;
  width: auto;
  max-width: 260px;
}
/* Fixed 3:4 frame so every slide is the same height. Outputs fill it;
   mannequin photos are letterboxed so the whole garment stays visible. */
.showcase-slide .showcase-img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  padding: 0;
}
.showcase-slide .showcase-card--before .showcase-img {
  object-fit: contain;
  background: #111113;
}
.showcase-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 24, 27, 0.85);
  color: var(--text-primary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.showcase-nav:hover {
  border-color: var(--accent);
}
.showcase-nav:disabled {
  opacity: 0.3;
  cursor: default;
}
.showcase-nav--prev { left: 0; }
.showcase-nav--next { right: 0; }
.showcase-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.showcase-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}
.showcase-dot[aria-selected="true"] {
  background: var(--accent);
  width: 20px;
  border-radius: 4px;
}
.showcase-caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-3);
}
.showcase-ai-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.4);
}

/* --- How It Works Steps --- */
.hero-steps {
  margin-bottom: var(--space-16);
}
.hero-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
.hero-step-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: var(--space-6);
  text-align: center;
  position: relative;
}
.hero-step-number {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
}
.hero-step-icon {
  margin: 0 auto var(--space-4);
  width: 40px;
  height: 40px;
  color: var(--accent-hover);
}
.hero-step-icon svg {
  width: 100%;
  height: 100%;
}
.hero-step-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f4f4f5;
  margin-bottom: var(--space-2);
}
.hero-step-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Pricing --- */
.hero-pricing {
  margin-bottom: var(--space-16);
}
.hero-pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  max-width: 520px;
  margin: 0 auto var(--space-4);
}
.hero-pricing-grid--single {
  grid-template-columns: 1fr;
  max-width: 320px;
}
.hero-pricing-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: var(--space-6);
  text-align: center;
}
.hero-pricing-card--highlight {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.06);
}
.hero-pricing-tier {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.hero-pricing-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.hero-pricing-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.hero-pricing-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: var(--space-1) 0;
}
.hero-pricing-use {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}
.hero-pricing-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Final CTA --- */
.hero-cta {
  text-align: center;
  padding-bottom: var(--space-8);
}
.hero-cta-login {
  margin-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hero-cta-login a {
  color: var(--accent-hover);
  text-decoration: none;
}
.hero-cta-login a:hover {
  text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════════════════════
   NAV CREDITS PILL
   ═══════════════════════════════════════════════════════════════════════ */

.nav-credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 24px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.nav-credits-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.4);
}
.credits-icon {
  font-size: 0.65rem;
  opacity: 0.85;
}
.credits-amount {
  font-weight: 700;
}
.credits-label {
  opacity: 0.85;
}
.nav-credits-pill.low {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.nav-credits-pill.low:hover {
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.4);
}
.nav-credits-pill.empty {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.nav-credits-pill.empty:hover {
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.4);
}


/* ═══════════════════════════════════════════════════════════════════════
   MODALS (shared)
   ═══════════════════════════════════════════════════════════════════════ */

/* Base .modal-overlay is animated via an .active class (opacity/visibility).
   The modals below are instead driven by the `hidden` attribute through
   openModal()/closeModal(), so they need these two rules to be visible at all.
   ADD ANY NEW hidden-attribute MODAL TO BOTH LISTS — leaving it out means
   openModal() clears `hidden` and nothing appears on screen. */
.modal-overlay#modal-register,
.modal-overlay#modal-login,
.modal-overlay#modal-buy-credits,
.modal-overlay#modal-catalog-name,
.modal-overlay#modal-one-pager,
.modal-overlay#modal-quality-guidelines,
.modal-overlay#modal-garment-note {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: var(--space-4);
  opacity: 1;
  visibility: visible;
  transition: none;
}
.modal-overlay#modal-register[hidden],
.modal-overlay#modal-login[hidden],
.modal-overlay#modal-buy-credits[hidden],
.modal-overlay#modal-catalog-name[hidden],
.modal-overlay#modal-one-pager[hidden],
.modal-overlay#modal-quality-guidelines[hidden],
.modal-overlay#modal-garment-note[hidden] {
  display: none;
}
/* Sits above the catalog detail dialog (z-index 1000), which is where a
   Garment Changed tap most often comes from. */
.modal-overlay#modal-garment-note { z-index: 1100; }

/* "What changed?" note box */
.modal-field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  min-height: 84px;
  transition: border-color 0.15s;
}
.modal-field textarea::placeholder { color: var(--text-muted); }
.modal-field textarea:focus { border-color: var(--accent); }

.garment-note-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.garment-note-head img {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.garment-note-head p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.garment-note-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-4);
}
.garment-note-actions .btn-modal-primary { margin-top: 0; flex: 1 1 auto; }
.modal-content {
  width: 100%;
  max-width: 420px;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: var(--space-8);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content--wide {
  max-width: 560px;
}
.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.modal-header {
  text-align: center;
  margin-bottom: var(--space-6);
}
.modal-logo-icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-3);
}
.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Modal Form --- */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.modal-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.modal-field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.modal-field input::placeholder {
  color: var(--text-muted);
}
.modal-field input:focus {
  border-color: var(--accent);
}
.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.password-field {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.password-field input {
  flex: 1;
}
.btn-show-password {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-show-password:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}
.modal-error {
  font-size: 0.8rem;
  color: var(--error);
  background: var(--error-dim);
  padding: 8px 12px;
  border-radius: 8px;
}
.modal-error[hidden] {
  display: none;
}
.btn-modal-primary {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-modal-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}
.modal-footer {
  text-align: center;
  margin-top: var(--space-4);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.modal-footer a {
  color: var(--accent-hover);
  text-decoration: none;
}
.modal-footer a:hover {
  text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════════════════════
   BUY CREDITS MODAL
   ═══════════════════════════════════════════════════════════════════════ */

.credit-packs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.credit-pack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.credit-pack:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.credit-pack--best {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.06);
}
.pack-badge {
  position: absolute;
  top: -8px;
  right: -4px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.pack-amount {
  font-size: 1.1rem;
  font-weight: 700;
}
.pack-images {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Custom Amount --- */
.credit-custom {
  margin-bottom: var(--space-5);
}
.credit-custom label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.custom-amount-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.custom-amount-prefix {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.custom-amount-row input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.custom-amount-row input:focus {
  border-color: var(--accent);
}
.custom-amount-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.buy-note {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: var(--space-3);
}


/* ═══════════════════════════════════════════════════════════════════════
   CREDITS CONFIRM BAR
   ═══════════════════════════════════════════════════════════════════════ */

.credits-confirm {
  margin-bottom: var(--space-4);
}
.credits-confirm[hidden] {
  display: none;
}
.credits-confirm-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  font-size: 0.82rem;
}
.credits-confirm-cost {
  font-weight: 600;
  color: #e4e4e7;
}
.credits-confirm-balance {
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
  padding: 12px 16px;
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e4e4e7;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.3s ease-out;
}
.toast--success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}
.toast--error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}
.toast--exiting {
  animation: toast-out 0.25s ease-in forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}


/* ═══════════════════════════════════════════════════════════════════════
   HERO — MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .hero-inner {
    padding: var(--space-10) var(--space-4) var(--space-8);
  }
  .hero-headline {
    font-size: 1.5rem;
  }
  .hero-subtext {
    font-size: 1rem;
  }
  .hero-buttons {
    flex-direction: column;
  }
  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
  }
  .showcase-row {
    flex-direction: row;
    gap: var(--space-2);
  }
  .showcase-card {
    width: 140px;
  }
  .showcase-slide {
    padding: 0;
  }
  .showcase-nav {
    display: none;
  }
  .showcase-img {
    max-height: none;
  }
  .showcase-placeholder {
    height: 120px;
  }
  .showcase-ai-badge {
    width: 32px;
    height: 32px;
    font-size: 0.65rem;
  }
  .hero-steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .hero-pricing-grid {
    grid-template-columns: 1fr;
  }
  .credit-packs {
    grid-template-columns: 1fr 1fr;
  }
  .credits-confirm-inner {
    flex-direction: column;
    gap: var(--space-1);
    text-align: center;
  }
  .modal-content {
    border-radius: 0;
    max-height: 100vh;
    height: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .toast-container {
    right: var(--space-3);
    left: var(--space-3);
    bottom: var(--space-3);
  }
  .toast {
    max-width: none;
  }
}

/* ── Catalog logo picker (clients with 2+ brand logos, e.g. Bahubali) ── */
.logo-picker {
  margin: var(--space-5) 0;
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.logo-picker-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-3);
}
.logo-picker-title { font-weight: 600; color: var(--text-primary); }
.logo-picker-hint { font-size: 0.8rem; color: var(--text-muted); }
.logo-picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.logo-option {
  flex: 1 1 160px;
  max-width: 240px;
  cursor: pointer;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1c1c1f;
  transition: border-color 0.15s, transform 0.1s;
}
.logo-option:hover { transform: translateY(-1px); }
.logo-option.is-active { border-color: var(--accent); }
/* White logos need a dark swatch to be visible */
.logo-option-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  padding: var(--space-3);
  background: #2a1518; /* deep maroon, close to a saree backdrop */
}
.logo-option-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
  color: var(--text-primary);
  border-top: 1px solid var(--border);
}
.logo-option-radio {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
}
.logo-option.is-active .logo-option-radio {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 40%, transparent 45%);
}

/* ── Catalog cover picker (inside the "Name your catalog" modal) ── */
.modal-field-hint { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }
.catalog-cover-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.catalog-cover-opt {
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background: #1c1c1f;
  flex: 0 0 auto;
  transition: border-color 0.15s, transform 0.1s;
}
.catalog-cover-opt:hover { transform: translateY(-1px); }
.catalog-cover-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.catalog-cover-opt.is-cover { border-color: var(--accent); }
.catalog-cover-opt .cover-badge {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  letter-spacing: 0.03em;
  opacity: 0;
  transition: opacity 0.15s;
}
.catalog-cover-opt.is-cover .cover-badge { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   MY CATALOG
   ═══════════════════════════════════════════════════════════════════════════
   A workspace, not a showcase: chrome stays visible, controls never hide behind
   hover, and status is the loudest signal on a card.

   One rule governs everything here — the garments carry all the colour. The
   app's violet sits beside the magenta/maroon family that dominates Indian
   ethnic wear and shifts how those colours read, and wrong_color is already the
   most common complaint we get. So no violet, no gradient and no glow touches a
   photograph: images sit on a dedicated achromatic plate, and the only chroma
   allowed on a frame is the 3px status rail, because state is the one thing a
   workspace must show at a glance. */

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.cat-toolbar {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}
.cat-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.cat-toolbar-spacer { flex: 1 1 auto; }
.cat-search {
  flex: 1 1 240px; min-width: 180px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 9px 12px; font-size: 0.9rem; font-family: inherit;
}
.cat-search:focus { outline: none; border-color: var(--accent); }
.cat-select {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 9px 10px; font-size: 0.85rem; font-family: inherit; cursor: pointer;
}
.cat-select-sm { padding: 6px 8px; font-size: 0.8rem; }
.cat-group-label { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); }
.cat-count { font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cat-segmented { display: flex; flex-wrap: wrap; gap: 4px; }
.cat-seg {
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-secondary);
  padding: 6px 13px; font-size: 0.82rem; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.cat-seg:hover { border-color: var(--border-hover); color: var(--text-primary); }
/* Selected reads inverted and achromatic, deliberately not violet — this row
   sits directly above the first row of garment images. */
.cat-seg.is-active { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg); font-weight: 600; }
.cat-seg-n { font-variant-numeric: tabular-nums; opacity: 0.65; font-size: 0.75rem; }

/* ── Grid ────────────────────────────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-3);
  align-items: start;
}
.cat-group-header {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-1);
  font-size: 0.8rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.cat-group-header::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.cat-group-header:first-child { margin-top: 0; }

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid #3f3f46;      /* status rail: the loudest signal here */
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color var(--dur-fast) var(--ease);
}
.cat-card:hover { border-color: var(--border-hover); }
.cat-card.is-pass { border-left-color: var(--success); }
/* Amber, not red — "set aside", not "we broke it". */
.cat-card.is-fail { border-left-color: var(--warning); }
.cat-card.is-starred { border-top-color: #d6b45c; }

.cat-card-media {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #131316;
  display: flex; align-items: center; justify-content: center;
}
/* Never crop: the pallu, border and hem ARE the product. */
.cat-card-img {
  width: 100%; height: 100%;
  object-fit: contain;
  cursor: zoom-in; display: block;
}
.cat-card-media.is-missing .cat-card-img,
.cat-card-media.is-missing .cat-card-pip { display: none; }
.cat-card-missing { display: none; color: var(--text-muted); font-size: 0.78rem; padding: 0 12px; text-align: center; }
.cat-card-media.is-missing .cat-card-missing { display: block; }

.cat-card-pip {
  position: absolute; left: 8px; bottom: 8px;
  width: 30%; max-width: 74px; aspect-ratio: 3 / 4;
  padding: 0; border: 2px solid var(--bg-card); border-radius: 6px;
  overflow: hidden; cursor: pointer; background: #131316;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.cat-card-pip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-card-select { position: absolute; top: 8px; left: 8px; cursor: pointer; }
.cat-card-select input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--accent); }
.cat-card-star {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,.45); border: 0; border-radius: 5px;
  color: rgba(255,255,255,.55); font-size: 0.95rem; line-height: 1;
  padding: 4px 6px; cursor: pointer;
}
.cat-card-star:hover { color: #fff; }
.cat-card-star.on { color: #d6b45c; }

.cat-card-verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.cat-vbtn {
  background: var(--bg-card); border: 0; cursor: pointer;
  /* Sized for the longest label ("Garment Changed") at the 210px minimum card
     width — nowrap so a tight fit never wraps and makes cards uneven height. */
  color: var(--text-secondary); font-family: inherit; font-size: 0.72rem;
  white-space: nowrap;
  padding: 9px 3px; display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.cat-vbtn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.cat-vbtn-pass.on { background: var(--success-dim); color: var(--success); font-weight: 600; }
.cat-vbtn-fail.on { background: var(--warning-dim); color: var(--warning); font-weight: 600; }
@media (max-width: 420px) { .cat-vbtn span { display: none; } }

.cat-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; font-size: 0.75rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.cat-card-id { color: var(--text-secondary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-card-n { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Flat neutral fill holding exact geometry — no shimmer sweep across a grid of
   saturated garments. */
.cat-skeleton-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--space-3); }
.cat-skeleton { aspect-ratio: 3 / 4; background: var(--bg-elevated); border-radius: var(--radius-sm); opacity: .55; }
.cat-error { grid-column: 1 / -1; color: var(--error); text-align: center; padding: var(--space-8); }
.cat-loadmore-wrap { display: flex; justify-content: center; padding: var(--space-6) 0; }

/* ── Detail view ─────────────────────────────────────────────────────────── */
.cat-detail { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.cat-detail[hidden] { display: none; }
.cat-detail-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.82); }
.cat-detail-panel {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0,1fr) 330px;
  width: min(1180px, 94vw); height: min(88vh, 900px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}
/* min-height:0 is load-bearing, not tidiness. A grid item defaults to
   min-height:auto, so without it the stage cannot shrink below the image's
   intrinsic height: a tall portrait pushed the stage past the panel and the
   panel's overflow:hidden cut the bottom off the garment. */
.cat-detail-stage {
  position: relative; background: #131316;
  display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 0;
  overflow: auto;
}
.cat-detail-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
  cursor: zoom-in;
}
/* Click to inspect at full size — this is a fabric-fidelity product, so being
   able to pixel-peep the weave matters more than a tidy frame. The stage
   scrolls in both axes while zoomed. */
.cat-detail-img.is-zoomed {
  max-width: none; max-height: none;
  width: auto; height: auto;
  cursor: zoom-out;
  margin: auto;
}
.cat-detail-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5); border: 0; color: #fff;
  font-size: 1.8rem; line-height: 1; padding: 10px 14px; cursor: pointer; border-radius: 6px;
}
.cat-detail-nav:disabled { opacity: .25; cursor: default; }
.cat-detail-prev { left: 10px; }
.cat-detail-next { right: 10px; }
.cat-detail-counter { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 0.75rem; color: var(--text-muted); background: rgba(0,0,0,.5); padding: 3px 9px; border-radius: 999px; }
.cat-detail-close { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(0,0,0,.5); border: 0; color: #fff; font-size: 1.5rem; line-height: 1; padding: 4px 11px; border-radius: 6px; cursor: pointer; }
.cat-detail-side { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); border-left: 1px solid var(--border); overflow-y: auto; }
.cat-detail-head h3 { margin: 0 0 4px; font-size: 1.02rem; color: var(--text-primary); }
.cat-detail-meta { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.cat-detail-uploads-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: var(--space-2); }
.cat-detail-uploads-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.cat-up { margin: 0; }
.cat-up img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); cursor: pointer; display: block; }
.cat-up figcaption { font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; line-height: 1.3; }
.cat-up-none { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.cat-detail-verdict { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.cat-detail-verdict .cat-vbtn { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 6px; font-size: 0.82rem; }
.cat-detail-actions { display: flex; gap: var(--space-3); align-items: center; }
.cat-detail-regen { width: 100%; min-height: 44px; flex-shrink: 0; }
/* Generate Poses in the catalog detail (2026-10-23): pose tile + go button. */
.cat-poses-panel { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.cat-poses-panel[hidden] { display: none; }
.cat-poses-note { margin: 0; font-size: 0.75rem; color: var(--text-muted); text-align: center; }
/* The picker's tile row is laid out for the Look bar; here it holds one tile, full width. */
.cat-poses-host .pbl2-tiles { grid-template-columns: 1fr !important; }
.cat-poses-dialog { position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 16px; }
.cat-poses-dialog[hidden] { display: none; }
.cat-poses-dialog-panel { position: relative; width: 100%; max-width: 420px; background: #17171c; border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.cat-poses-dialog-title { font-weight: 600; font-size: 1.05rem; padding-right: 28px; }
.cat-poses-dialog-sub { margin: 0; font-size: 0.85rem; color: var(--text-secondary); }
.cat-poses-dialog-close { position: absolute; top: 12px; right: 14px; background: transparent; border: 0; color: var(--text-muted); font-size: 16px; cursor: pointer; }
/* Regenerate from My Catalog: the notice on the progress and results pages. */
.regen-note { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-md, 10px); background: var(--bg-elevated); border-left: 3px solid #a855f7; color: var(--text-primary); font-size: 13px; line-height: 1.45; }
.regen-note .btn-text { margin-left: 4px; }

@media (max-width: 860px) {
  .cat-detail-panel { grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr) auto; height: 94vh; width: 96vw; }
  .cat-detail-side { border-left: 0; border-top: 1px solid var(--border); max-height: 46vh; }
}

/* ── Undo toast ──────────────────────────────────────────────────────────── */
.cat-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 1200; display: flex; align-items: center; gap: var(--space-4);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 16px;
  font-size: 0.86rem; color: var(--text-primary);
  box-shadow: 0 8px 26px rgba(0,0,0,.45);
}
.cat-toast-undo { background: none; border: 0; color: var(--accent-hover); font-family: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; padding: 0; }

@media (max-width: 640px) {
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2); }
  .cat-toolbar-row { gap: 6px; }
  .cat-search { flex-basis: 100%; }
  .cat-toast { left: 12px; right: 12px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cat-card, .cat-seg, .cat-vbtn { transition: none; }
}

/* Regenerate: spinner card shown next to the original while the new image renders */
.result-thumb-generating { flex-direction: column; gap: 8px; }
.regen-label { font-size: 0.75rem; color: var(--text-secondary, #a1a1aa); }

/* One-Pager modal: the 1-2 photos going on the page, main first */
.one-pager-photos { display: flex; gap: 10px; align-items: flex-end; }
.one-pager-photo { position: relative; width: 84px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; border: 2px solid var(--accent); }
.one-pager-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.one-pager-photo span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 0.7rem; text-align: center; color: #fff; background: rgba(0, 0, 0, 0.55); padding: 2px 0; }
#modal-one-pager .modal-content { max-height: 92vh; overflow-y: auto; }
#modal-one-pager .modal-header { display: block; }

/* ── Bulk Magic Mode (2026-10-14) ───────────────────────────────────
   One GLOBAL look (Model · Pose · Background) above up to 20 garment cards.
   The look is the only tinted surface; garments are plain numbered cards;
   the Generate button stays in reach (sticky) however many are added. */
#client-pose-bg-picker.look-global {
  background: #1a1625;
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.18);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 18px !important;
  /* Scrolls with the page (Rohan, 2026-10-14: not sticky). */
  position: static;
  transition: padding .2s ease;
}
/* A grid item defaults to min-width:auto and would refuse to shrink below its
   widest content, pushing the page sideways on a phone. */
body.magic-bulk .upload-col { min-width: 0; }
.look-head { display: none; }
#client-pose-bg-picker.look-global .look-head { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; }
.look-head-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #c4b5fd; }
/* Condensed strip once the garments scroll beneath it. */
#client-pose-bg-picker.look-condensed { padding: 8px 10px; }
#client-pose-bg-picker.look-condensed .look-head { margin-bottom: 6px; }
#client-pose-bg-picker.look-condensed .pbl2-tile { padding: 5px 8px; gap: 8px; }
#client-pose-bg-picker.look-condensed .pbl2-thumb { width: 28px; height: 36px; }
#client-pose-bg-picker.look-condensed .pbl2-eyebrow, #client-pose-bg-picker.look-condensed .pbl2-chev { display: none; }
#client-pose-bg-picker.look-condensed .pbl2-name { font-size: 13px; margin-top: 0; }
#client-pose-bg-picker.look-condensed .pbl2-bgmode, #client-pose-bg-picker.look-condensed #kid-age-row { display: none; }
/* Magic Mode needs no card header: the title and step badge are hidden and the
   old one-outfit counter (0 / 4) has nothing to count — garments have their own. */
body.magic-bulk .upload-col--products .upload-card-header { display: none; }
.garment-cards { display: flex; flex-direction: column; gap: 12px; }
.garment-card {
  background: #17171c;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.garment-card.garment-empty { border-left: 3px solid #ef4444; }
.garment-card.collapsed { padding-block: 8px; }
.garment-card.collapsed .garment-slots { display: none !important; }
.garment-card.collapsed .garment-head { cursor: pointer; }
.garment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.garment-head .garment-item-id { width: 180px; max-width: 45%; padding: 6px 10px; font-size: 0.8125rem; }
.garment-card.drop-hover, .garment-addzone.drop-hover, #garment-cards.drop-hover .garment-card:last-child { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139, 92, 246, .35); }
.garment-slots .generic-slot { position: relative; }
.garment-slots .generic-slot[draggable="true"] .generic-drop { cursor: grab; }
.garment-slots .generic-slot.slot-dragging { opacity: .4; }
.garment-minis { display: none; gap: 4px; }
.garment-card.collapsed .garment-minis { display: flex; }
.garment-minis img { width: 24px; height: 32px; object-fit: cover; border-radius: 5px; }
/* Per-garment approval (2026-10-16) */
.garment-approve {
  align-self: flex-start; padding: 8px 14px; border-radius: 10px;
  background: var(--accent); color: #fff; border: 0;
  font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.garment-approve:hover { background: var(--accent-hover); }
.garment-approve:disabled { opacity: .5; cursor: wait; }
.garment-card.approved .garment-approve { background: transparent; color: var(--success); border: 1px solid var(--success); }
.garment-card.collapsed .garment-approve { display: none; }
.garment-card.approved { border-left: 3px solid var(--success); }
.garment-approved-badge { display: none; color: var(--success); font-size: 0.75rem; font-weight: 600; }
.garment-card.approved.collapsed .garment-approved-badge { display: inline; }
.garment-toggle, .garment-remove {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
}
.garment-toggle { margin-left: auto; }
.garment-toggle:hover, .garment-remove:hover { border-color: var(--border); color: var(--text-primary, #fafafa); }
.garment-slots { display: flex !important; flex-direction: row !important; flex-wrap: wrap; gap: 10px !important; }
.garment-slots .generic-slot { flex-direction: column !important; width: 112px; gap: 6px !important; }
.garment-slots .generic-drop { flex: 0 0 auto !important; width: 112px !important; height: 150px !important; }
.garment-slots .generic-note-wrap { flex: none !important; }
.garment-slots .generic-note { font-size: 12px !important; padding: 6px 8px !important; }
.garment-addzone {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  margin-top: 12px; padding: 16px;
  border: 1.5px dashed var(--border); border-radius: 16px;
  color: var(--text-muted); font-size: 13px;
}
.addzone-btn {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary, #fafafa);
  border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.addzone-btn:disabled { opacity: .4; cursor: not-allowed; }
.garment-addzone .garment-counter { margin-left: 0; }
.garment-counter { margin-left: auto; color: var(--text-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.garment-many-choice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 10px; padding: 10px 12px;
  border: 1px dashed rgba(139, 92, 246, 0.5);
  border-radius: 12px;
}
.garment-many-count { font-weight: 600; margin-right: 4px; }
.garment-many-cancel { margin-left: auto; background: transparent; border: 0; color: var(--text-muted); cursor: pointer; font-size: 14px; }
/* Footer bar: summary on the left, a compact Generate pill on the right.
   Not sticky (Rohan, 2026-10-14): it sits under the garments. */
body.magic-bulk .generate-area {
  position: static;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #121217;
  border-top: 1px solid var(--border);
}
.gen-summary { font-size: 0.875rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 0; }
.gen-summary.is-warn { color: #f59e0b; }
body.magic-bulk .generate-area .btn-generate {
  margin-left: auto; width: auto; min-width: 0;
  padding: 11px 22px; border-radius: 999px; font-size: 0.9375rem;
}
body.magic-bulk .generate-area .generate-hint { display: none; }
@media (max-width: 560px) {
  .garment-slots .generic-slot { width: 96px; }
  .garment-slots .generic-drop { width: 96px !important; height: 128px !important; }
  .garment-head { flex-wrap: nowrap; gap: 8px; }
  .garment-head .garment-item-id { width: auto; flex: 1 1 90px; min-width: 0; max-width: none; }
  .garment-minis { max-width: 76px; overflow: hidden; }
}

/* Per-garment PDF (2026-10-14): a header per garment in the results grid, and a
   small PDF button on each finished progress card. */
.garment-result-head {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 8px 4px 2px;
  border-top: 1px solid var(--border);
}
.garment-result-head:first-child { margin-top: 0; border-top: 0; }
.garment-result-name { font-weight: 600; font-size: 0.875rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.garment-result-count { color: var(--text-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.garment-result-head .garment-pdf-btn { margin-left: auto; padding: 6px 12px; font-size: 0.8125rem; }
.result-card { position: relative; }
.garment-pdf-mini {
  position: absolute; left: 6px; bottom: 6px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(139, 92, 246, 0.92); color: #fff;
  border: 0; font-size: 11px; font-weight: 700; cursor: pointer;
}

/* Chained multi-pose approval (2026-10-14) */
.garment-result-head.is-awaiting .garment-result-count { color: #c4b5fd; font-weight: 600; }
.garment-result-head .chain-continue { margin-left: auto; padding: 6px 14px; font-size: 0.8125rem; }
.garment-result-head .chain-discard { padding: 6px 12px; font-size: 0.8125rem; }
.result-card.awaiting-card { outline: 2px solid var(--accent); outline-offset: 2px; cursor: pointer; }
.awaiting-tag {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  white-space: nowrap; padding: 3px 10px; border-radius: 999px;
  background: rgba(139, 92, 246, 0.95); color: #fff; font-size: 11px; font-weight: 700; pointer-events: none;
}
.chain-approval {
  position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.72);
  display: grid; place-items: center; padding: 16px;
}
.chain-approval-panel {
  position: relative; display: flex; gap: 18px; align-items: stretch; max-width: 820px; width: 100%;
  background: #17171c; border: 1px solid var(--border); border-radius: 18px; padding: 16px;
}
.chain-approval-photo { position: relative; width: 46%; flex-shrink: 0; border-radius: 12px; }
.chain-approval-panel img { display: block; width: 100%; max-height: 78vh; object-fit: contain; border-radius: 12px; background: #000; }
.chain-approval-side { display: flex; flex-direction: column; gap: 12px; justify-content: center; min-width: 0; }
.chain-approval-title { font-weight: 700; font-size: 1.05rem; }
.chain-approval-side p { color: var(--text-secondary); font-size: 0.9rem; margin: 0; }
.chain-approval-close { position: absolute; top: 10px; right: 12px; background: transparent; border: 0; color: var(--text-muted); font-size: 16px; cursor: pointer; }
@media (max-width: 560px) {
  .chain-approval-panel { flex-direction: column; }
  .chain-approval-photo { width: 100%; }
  .chain-approval-panel img { max-height: 55vh; }
}
/* Approval box: download + Regenerate (2026-10-14). */
.chain-approval-tools { display: flex; gap: 10px; }
.chain-approval-tools .chain-approval-dl { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; }
.chain-approval-tools [data-act="regenerate"] { flex: 1; }
.chain-approval-panel { overflow: hidden; }
.chain-approval-photo .awaiting-regen { display: none; }
.chain-approval.is-regenerating .chain-approval-photo .awaiting-regen { display: grid; }
.chain-approval-photo .generating-spinner { width: 36px; height: 36px; border-width: 3px; }
.chain-approval.is-regenerating .chain-approval-side button:not(.chain-approval-close),
.chain-approval.is-regenerating .chain-approval-dl { opacity: 0.45; pointer-events: none; }
.chain-approval.is-regenerating [data-act="regenerate"]::after { content: '…'; }
.awaiting-regen { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); border-radius: inherit; }
/* ✕ on an uploaded photo (2026-10-14): remove it. */
.generic-slot { position: relative; }
.slot-remove-btn {
  position: absolute; left: 70px; top: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, .7); color: #fff; border: 0;
  font-size: 11px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.slot-remove-btn:hover { background: #ef4444; }
.garment-slots .slot-remove-btn { left: auto; right: 6px; }
/* Outfit type as a Look-bar tile after Background (2026-10-14). */
#client-pose-bg-picker .pbl2-tiles.has-outfit { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.outfit-type-thumb { display: grid; place-items: center; font-size: 20px; background: var(--bg, #18181b); }
.outfit-type-select {
  display: block; width: 100%; margin-top: 2px; padding: 0; border: 0; background: transparent;
  color: var(--text-primary, #fafafa); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; outline: none;
}
.outfit-type-select option { background: #18181b; color: #fafafa; }
/* Jewellery mode: the piece-type and variant selects on each piece card. */
.jw-select option, .jw-select optgroup { background: #18181b; color: #fafafa; }
#client-pose-bg-picker.look-condensed .outfit-type-select { font-size: 13px; margin-top: 0; }
@media (max-width: 560px) {
  #client-pose-bg-picker .pbl2-tiles.has-outfit { gap: 6px; }
  .outfit-type-select { font-size: 12px; text-align: center; text-align-last: center; }
}

/* Pose Generator: original photo from My Catalog (2026-10-14). */
.posegen-from-catalog { margin-top: 10px; padding: 8px 14px; font-size: 0.875rem; }
.catpick { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 16px; }
.catpick-panel { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 860px; max-height: 88vh; background: #17171c; border: 1px solid var(--border); border-radius: 18px; padding: 16px; }
.catpick-head { display: flex; align-items: center; gap: 12px; }
.catpick-search { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-primary); font: inherit; font-size: 14px; }
.catpick-close { background: transparent; border: 0; color: var(--text-muted); font-size: 16px; cursor: pointer; }
.catpick-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.catpick-item { display: flex; flex-direction: column; gap: 4px; padding: 0; background: transparent; border: 2px solid transparent; border-radius: 10px; cursor: pointer; color: var(--text-secondary); font: inherit; font-size: 12px; text-align: center; }
.catpick-item:hover, .catpick-item:focus-visible { border-color: var(--accent); outline: none; }
.catpick-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: #000; }
.catpick-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px 4px; }
.catpick-msg { grid-column: 1 / -1; color: var(--text-muted); text-align: center; padding: 24px 0; }
.catpick-more { align-self: center; }
@media (max-width: 560px) {
  .catpick { padding: 0; place-items: end stretch; }
  .catpick-panel { max-height: 92vh; border-radius: 18px 18px 0 0; }
  .catpick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
}
/* Retry failed poses (2026-10-14). */
.garment-result-head .garment-retry-poses { margin-left: auto; padding: 6px 12px; font-size: 0.8125rem; }
.garment-result-head .garment-retry-poses + .garment-pdf-btn { margin-left: 8px; }
/* Collapsible Look bar (2026-10-14). */
.look-summary { display: none; flex: 1; min-width: 0; font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.look-toggle { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-muted); font-size: 14px; cursor: pointer; flex: none; }
.look-toggle:hover { border-color: var(--border); color: var(--text-primary, #fafafa); }
#client-pose-bg-picker.look-global.look-collapsed .look-summary { display: block; }
#client-pose-bg-picker.look-global.look-collapsed .look-toggle { margin-left: 0; }
#client-pose-bg-picker.look-global.look-collapsed .look-head { margin-bottom: 0 !important; cursor: pointer; }
#client-pose-bg-picker.look-global.look-collapsed #pbl-picker-host,
#client-pose-bg-picker.look-global.look-collapsed #client-pose-bg-help { display: none !important; }
/* Compact settings cards in the Look bar (2026-10-14). */
#client-pose-bg-picker.look-global .pbl2-tiles { gap: 8px; }
#client-pose-bg-picker.look-global .pbl2-tile { padding: 7px 9px; gap: 9px; border-radius: 11px; }
#client-pose-bg-picker.look-global .pbl2-thumb { width: 34px; height: 44px; border-radius: 7px; font-size: 14px; }
#client-pose-bg-picker.look-global .pbl2-eyebrow { font-size: 9.5px; }
#client-pose-bg-picker.look-global .pbl2-name { font-size: 13px; margin-top: 1px; }
#client-pose-bg-picker.look-global .outfit-type-select { font-size: 13px; }
#client-pose-bg-picker.look-global .pbl2-chev { font-size: 12px; }
@media (max-width: 560px) {
  #client-pose-bg-picker.look-global .pbl2-tiles { gap: 6px; }
  #client-pose-bg-picker.look-global .pbl2-tile { padding: 6px 4px; gap: 4px; }
  #client-pose-bg-picker.look-global .pbl2-thumb { width: 32px; height: 42px; }
  #client-pose-bg-picker.look-global .pbl2-name, #client-pose-bg-picker.look-global .outfit-type-select { font-size: 11px; }
}
/* Settings cards at half size (2026-10-14): one slim line each, more per row. */
#client-pose-bg-picker.look-global .pbl2-tiles.pbl2-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
#client-pose-bg-picker.look-global .pbl2-tile { padding: 3px 8px 3px 4px; gap: 7px; border-radius: 8px; }
#client-pose-bg-picker.look-global .pbl2-thumb { width: 18px; height: 24px; border-radius: 4px; font-size: 10px; }
#client-pose-bg-picker.look-global .pbl2-eyebrow { font-size: 8.5px; line-height: 1.1; letter-spacing: .06em; }
#client-pose-bg-picker.look-global .pbl2-name,
#client-pose-bg-picker.look-global .outfit-type-select { font-size: 12px; line-height: 1.2; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#client-pose-bg-picker.look-global .pbl2-chev { font-size: 10px; }
#client-pose-bg-picker.look-global .look-head { margin-bottom: 6px; }
@media (max-width: 560px) {
  #client-pose-bg-picker.look-global .pbl2-tiles.pbl2-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  #client-pose-bg-picker.look-global .pbl2-tile { flex-direction: row; align-items: center; text-align: left; padding: 3px 5px; gap: 5px; }
  #client-pose-bg-picker.look-global .pbl2-thumb { width: 16px; height: 22px; }
  #client-pose-bg-picker.look-global .pbl2-txt { width: auto; min-width: 0; }
  #client-pose-bg-picker.look-global .pbl2-name, #client-pose-bg-picker.look-global .outfit-type-select { font-size: 11px; }
}
/* Settings as a LEFT SIDEBAR on laptop/desktop (2026-10-14): the Look sits in a
   sticky column beside the garments, its cards stacked one per row. Phones keep
   the bar on top (no room for a column). */
@media (min-width: 1024px) {
  body.magic-bulk .upload-card { display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: 20px; align-items: start; }
  body.magic-bulk .upload-card > * { grid-column: 2; }
  body.magic-bulk .upload-card > #client-pose-bg-picker {
    grid-column: 1; grid-row: 1 / span 40; align-self: start;
    margin: 0 !important; padding: 12px 10px;
  }
  body.magic-bulk #client-pose-bg-picker .pbl2-tiles.pbl2-tiles { grid-template-columns: 1fr; gap: 6px; }
  body.magic-bulk #client-pose-bg-picker .pbl2-tile { padding: 6px 8px; gap: 9px; }
  body.magic-bulk #client-pose-bg-picker .pbl2-thumb { width: 28px; height: 36px; border-radius: 6px; }
  body.magic-bulk #client-pose-bg-picker .pbl2-name,
  body.magic-bulk #client-pose-bg-picker .outfit-type-select { font-size: 13px; }
  body.magic-bulk #client-pose-bg-picker .pbl2-chev { display: inline; }
  /* No title: the sidebar head holds only the (hidden) fold controls. */
  body.magic-bulk #client-pose-bg-picker .look-head { display: none !important; }
  /* A sidebar never folds or condenses: it is always there, always whole. */
  body.magic-bulk #client-pose-bg-picker .look-toggle,
  body.magic-bulk #client-pose-bg-picker .look-summary { display: none !important; }
  body.magic-bulk #client-pose-bg-picker.look-global.look-collapsed #pbl-picker-host { display: block !important; }
  body.magic-bulk #client-pose-bg-picker .pbl2-eyebrow { display: block !important; }
}
/* Item ID behind an "ID" button on the garment's first photo (2026-10-14).
   An Item ID already typed stays visible. */
.garment-card:not(.show-id) .garment-head .garment-item-id:placeholder-shown { display: none; }
.slot-id-btn {
  position: absolute; left: 6px; top: 120px; z-index: 2;
  height: 24px; padding: 0 7px; border-radius: 7px;
  background: rgba(0, 0, 0, .65); color: #fff; border: 0;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; cursor: pointer;
}
.slot-id-btn.has-id { background: var(--accent); }
@media (max-width: 560px) { .slot-id-btn { top: 98px; } }
/* No empty header row (2026-10-14): an open garment's header holds only the
   fold + remove buttons, so it floats in the card's top-right corner and the
   photos start at the top. It takes its own row again when it has something to
   show: an Item ID being typed / already typed, or a folded garment. */
.garment-card { position: relative; }
.garment-card:not(.collapsed):not(.show-id):not(:has(.garment-item-id:not(:placeholder-shown))) .garment-head {
  position: absolute; top: 8px; right: 8px; z-index: 3; gap: 4px;
}
.garment-card:not(.collapsed):not(.show-id):not(:has(.garment-item-id:not(:placeholder-shown))) .garment-slots { padding-right: 64px; }
/* Empty state (2026-10-14): before any photo, one big box replaces the
   garment cards and the "+ Add garment" area. */
.garment-empty-state { display: none; }
#saree-cards.garments-pristine .garment-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 220px; padding: 28px 16px;
  border: 2px dashed var(--border); border-radius: 18px; background: #15151a;
  color: var(--text-primary, #fafafa); font: inherit; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
#saree-cards.garments-pristine .garment-empty-state:hover,
#saree-cards.garments-pristine .garment-empty-state.drop-hover { border-color: var(--accent); background: rgba(139, 92, 246, .08); }
.garment-empty-state .ges-plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(139, 92, 246, .18); color: #c4b5fd; font-size: 26px; line-height: 1; }
.garment-empty-state strong { font-size: 1rem; }
.garment-empty-state .ges-sub { font-size: 13px; color: var(--text-muted); }
#saree-cards.garments-pristine #garment-cards,
#saree-cards.garments-pristine #garment-addzone { display: none !important; }
/* Settings on phones/tablets (2026-10-15): no ☰, no drawer — the block sits
 in the page above the garments with its cards stacked one per row. Laptops
 keep the left sidebar (always shown). The in-bar fold is gone. */
body.magic-bulk #client-pose-bg-picker .look-head { display: none !important; }
body.magic-bulk #client-pose-bg-picker.look-global.look-collapsed #pbl-picker-host { display: block !important; }
@media (max-width: 1023.98px) {
  body.magic-bulk #client-pose-bg-picker.look-global .pbl2-tiles.pbl2-tiles { grid-template-columns: 1fr; gap: 6px; }
  body.magic-bulk #client-pose-bg-picker.look-global .pbl2-tile { flex-direction: row; align-items: center; text-align: left; padding: 8px 10px; gap: 10px; }
  body.magic-bulk #client-pose-bg-picker.look-global .pbl2-thumb { width: 30px; height: 40px; border-radius: 6px; }
  body.magic-bulk #client-pose-bg-picker.look-global .pbl2-txt { width: auto; min-width: 0; }
  body.magic-bulk #client-pose-bg-picker.look-global .pbl2-name,
  body.magic-bulk #client-pose-bg-picker.look-global .outfit-type-select { font-size: 14px; text-align: left; text-align-last: left; }
  body.magic-bulk #client-pose-bg-picker.look-global .pbl2-eyebrow { font-size: 10px; }
  body.magic-bulk #client-pose-bg-picker.look-global .pbl2-chev { display: inline; }
}
/* Generate stands on its own under the card (2026-10-14): just the button,
   bottom right — no strip, no border, no section around it. */
body.magic-bulk .generate-area {
  background: transparent; border-top: 0;
  margin-top: 14px; padding: 0 2px calc(8px + env(safe-area-inset-bottom, 0px));
  justify-content: flex-end;
}
/* Phones (2026-10-15): no "drop photos" wording and no garment counter — a
   phone can't drag files in; the add zone is just "+ Add garment". */
@media (max-width: 1023.98px) {
  body.magic-bulk .garment-addzone .addzone-hint,
  body.magic-bulk .garment-addzone .garment-counter,
  body.magic-bulk .garment-empty-state .ges-drop { display: none !important; }
}
/* Note inside the Discard button, under its label (2026-10-15). */
.chain-approval-discard { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.chain-approval-discard .chain-approval-note { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* Regenerate with a fix (2026-10-15): "What should we fix?" box. */
.fix-modal { position: fixed; inset: 0; z-index: 10050; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 16px; }
.fix-modal-panel { width: 100%; max-width: 440px; background: #17171c; border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.fix-modal-title { font-weight: 600; font-size: 1.05rem; color: #fff; }
.fix-modal-text { width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px; background: #0f0f13; border: 1px solid var(--border); border-radius: 10px; color: #fff; padding: 10px 12px; font: inherit; font-size: 14px; }
.fix-modal-text:focus { outline: none; border-color: var(--accent); }
.fix-modal-hint { margin: 0; font-size: 12.5px; color: #a1a1aa; line-height: 1.4; }
.fix-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* Two-step Regenerate (2026-11-05): start fresh, or a small fix. */
.fix-step { display: flex; flex-direction: column; gap: 10px; }
.fix-step[hidden] { display: none; }
.fix-choice { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; padding: 12px 14px; background: #0f0f13; border: 1px solid var(--border); border-radius: 12px; color: #fff; font: inherit; cursor: pointer; }
.fix-choice:hover, .fix-choice:focus-visible { border-color: var(--accent); outline: none; }
.fix-choice-title { font-weight: 600; font-size: 0.95rem; }
.fix-choice-sub { font-size: 12.5px; color: #a1a1aa; line-height: 1.4; }
.fix-modal-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* "Generate a Video" reel panel — results modal + My Catalog (video-reel.js) */
.reel-panel { display: flex; flex-direction: column; gap: 10px; margin: 12px auto 0; width: 100%; max-width: 420px; }
.reel-video { width: 100%; max-height: 60vh; border-radius: 8px; background: #000; }
.reel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--text-secondary, #a1a1aa); }
.reel-tool { display: inline-flex; align-items: center; gap: 6px; }
.reel-tool input[type="number"] { width: 58px; padding: 4px 6px; border: 1px solid var(--border, #3f3f46); border-radius: 6px; background: transparent; color: inherit; font: inherit; }
.reel-tool select { padding: 4px 6px; border: 1px solid var(--border, #3f3f46); border-radius: 6px; background: transparent; color: inherit; font: inherit; }
.reel-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
