/* ───────────────────────────────────────────────────────────────
   Proxy Forge — Main Stylesheet
   Aesthetic: Dark arcane forge. Deep charcoal, ember gold, ink black.
   Fonts: Cinzel (headings, display), Crimson Pro (body, flavor)
──────────────────────────────────────────────────────────────── */

:root {
  --bg:          #0e0c0a;
  --bg-panel:    #15120e;
  --bg-card:     #1c1812;
  --bg-input:    #211d17;
  --border:      rgba(180,140,60,0.18);
  --border-hover:rgba(200,160,70,0.4);
  --gold:        #c8a84a;
  --gold-bright: #e8c96a;
  --gold-dim:    #8a6e30;
  --text:        #e8dcc8;
  --text-muted:  #8a7a62;
  --text-dim:    #4a4030;
  --ember:       #e06030;
  --radius:      10px;
  --radius-sm:   6px;
  --transition:  0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ember particle background ──────────────────────────────── */
.ember-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
@keyframes rise {
  0%   { transform: translateX(0) translateY(100vh) scale(1); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.3; }
  100% { transform: translateX(calc(var(--x) * 0.3 - 5%)) translateY(-60px) scale(0.4); opacity: 0; }
}
.ember {
  position: absolute;
  bottom: 0;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  background: var(--ember);
  border-radius: 50%;
  animation: rise var(--d) ease-in infinite;
  animation-delay: calc(var(--d) * -0.5);
}

/* ── Site header ────────────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}
.header-inner { max-width: 640px; margin: 0 auto; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.logo-sigil {
  width: 36px;
  height: 36px;
  color: var(--gold);
  flex-shrink: 0;
}
.header-tagline {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
  margin: 0;
}

/* ── Forge layout ───────────────────────────────────────────── */
.forge-layout {
  position: relative;
  z-index: 10;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  grid-template-rows: auto;
  gap: 1.5rem;
  align-items: start;
}

#panel-key {
  grid-column: 1 / -1;
}

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

/* ── Panel ──────────────────────────────────────────────────── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  position: relative;
  transition: border-color var(--transition);
}
.panel:hover { border-color: var(--border-hover); }
.panel--dim { opacity: 0.55; pointer-events: none; transition: opacity var(--transition); }
.panel--dim.active { opacity: 1; pointer-events: auto; }

.panel-label {
  position: absolute;
  top: -1px;
  left: 1.75rem;
  transform: translateY(-50%);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gold-dim);
  background: var(--bg-panel);
  padding: 0 0.5rem;
}
.panel-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
}

/* ── Search ─────────────────────────────────────────────────── */
.search-wrap {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
}
.search-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text);
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { border-color: var(--gold-dim); }

.btn-search {
  background: var(--gold-dim);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--bg);
  cursor: pointer;
  padding: 0 0.9rem;
  transition: background var(--transition);
  display: flex; align-items: center;
}
.btn-search svg { width: 18px; height: 18px; }
.btn-search:hover { background: var(--gold); }

/* ── Card grid ──────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.card-grid:empty { display: none; }

.card-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.card-result:hover { border-color: var(--gold-dim); background: #221e16; }
.card-result.selected { border-color: var(--gold); background: #2a2318; }

.card-result-name {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: var(--gold-bright);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-result-type {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-result-mana {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.card-type-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Cinzel', serif;
}
.badge-creature   { background: rgba(80,140,80,0.25); color: #80c880; border: 1px solid rgba(80,180,80,0.2); }
.badge-instant_sorcery { background: rgba(60,80,180,0.25); color: #8090e0; border: 1px solid rgba(60,80,200,0.2); }
.badge-land       { background: rgba(120,80,40,0.25); color: #c09060; border: 1px solid rgba(140,100,40,0.2); }
.badge-planeswalker { background: rgba(160,60,160,0.25); color: #c080c0; border: 1px solid rgba(160,60,180,0.2); }
.dfc-badge { font-size: 0.65rem; letter-spacing: 0.06em; color: var(--gold-dim); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; white-space: nowrap; }

/* ── DFC face toggle ─────────────────────────────────────────── */
.dfc-toggle {
  display: flex;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  width: fit-content;
}
.dfc-btn {
  background: transparent;
  border: none;
  color: var(--gold-dim);
  font-size: 0.75rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
  padding: 3px 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.dfc-btn:not(:last-child) { border-right: 1px solid var(--border); }
.dfc-btn.active { background: var(--gold-dim); color: var(--bg); }
.dfc-btn:not(.active):hover { background: var(--bg-card); color: var(--gold); }

/* ── DFC flip button in project gallery ──────────────────────── */
.dfc-flip-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(14,12,10,0.82);
  border: 1px solid rgba(200,168,74,0.35);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition), border-color var(--transition);
  backdrop-filter: blur(4px);
}
.proxy-tile:hover .dfc-flip-btn { opacity: 1; }
.dfc-flip-btn:hover { background: rgba(200,168,74,0.15); border-color: var(--gold); }
.dfc-flip-btn svg { width: 11px; height: 9px; transition: transform var(--transition); }
.dfc-flip-btn.flipped svg { transform: rotate(180deg); }
.proxy-tile.dfc .proxy-tile-name { padding-left: 36px; }

/* ── Selected card preview ───────────────────────────────────── */
.selected-preview {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.selected-preview.hidden { display: none; }

.selected-thumb-wrap {
  flex-shrink: 0;
  width: 60px;
  height: 44px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg);
}
.selected-thumb { width: 100%; height: 100%; object-fit: cover; }

.selected-name {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: var(--gold-bright);
  font-weight: 600;
  line-height: 1.3;
}
.selected-type { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.selected-set  { font-size: 0.72rem; color: var(--text-dim); }

/* ── Prompt ─────────────────────────────────────────────────── */
.prompt-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.prompt-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Crimson Pro', serif;
  font-size: 0.98rem;
  line-height: 1.55;
  padding: 0.75rem 0.9rem;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
  min-height: 110px;
}
.prompt-textarea::placeholder { color: var(--text-dim); font-style: italic; }
.prompt-textarea:focus { border-color: var(--gold-dim); }
.prompt-textarea:disabled { cursor: not-allowed; }

.prompt-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.hint-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.6rem;
}

/* ── API key modal ──────────────────────────────────────────── */
.key-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.key-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  width: min(480px, 90vw);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.key-modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.key-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ── API key shared styles ──────────────────────────────────── */
.key-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}
.key-note a {
  color: var(--gold-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.key-note a:hover { color: var(--gold); }
.key-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.key-wrap .search-input { flex: 1; }
.btn-show-key {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), color var(--transition);
}
.btn-show-key:hover { border-color: var(--border-hover); color: var(--text); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--gold-dim);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  color: var(--bg);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.55rem 1.2rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--transition), border-color var(--transition);
}
.btn-primary:hover:not(:disabled) { background: var(--gold); border-color: var(--gold); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.55rem 1rem;
  transition: border-color var(--transition), color var(--transition);
  text-decoration: none;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--gold-dim); color: var(--gold); }
.btn-secondary:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Loader spinner ─────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loader {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-loader.hidden { display: none; }

/* ── Output area ────────────────────────────────────────────── */
.output-area {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
  margin-bottom: 1rem;
}
.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.9rem;
  padding: 2rem;
}
.card-ghost { width: 60px; height: 84px; color: var(--text-dim); }
.output-area img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}
.output-actions { display: flex; gap: 0.75rem; }
.output-actions.hidden { display: none; }

/* ── Error toast ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #3a1010;
  border: 1px solid #8a2020;
  color: #f0a0a0;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  z-index: 100;
  transition: transform 0.3s ease;
  max-width: 90vw;
  text-align: center;
}
.toast.visible { transform: translateX(-50%) translateY(0); }

/* ── Loading state ──────────────────────────────────────────── */
.card-grid .loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  padding: 1rem 0;
  font-size: 0.9rem;
}

/* ── Printings ──────────────────────────────────────────────── */
.printings-section {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 0.75rem;
}
.printings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.printings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.printings-loading {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.5rem;
}
.printing-item {
  cursor: pointer;
  border-radius: 4px;
  border: 2px solid transparent;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.printing-item:hover { border-color: var(--gold-dim); transform: scale(1.03); }
.printing-item.selected { border-color: var(--gold); }
.printing-item img { display: block; width: 140px; height: auto; }

/* ── Art mode toggle ────────────────────────────────────────── */
.art-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.mode-btn:not(:last-child) { border-right: 1px solid var(--border); }
.mode-btn.active { background: var(--gold-dim); color: var(--bg); }
.mode-btn:not(.active):hover { background: var(--bg-card); color: var(--gold); }

.art-upload-label {
  display: flex;
  width: 100%;
  margin-bottom: 0.75rem;
}
.art-upload-preview-img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Reference image upload ─────────────────────────────────── */
.ref-upload {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}
.ref-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), color var(--transition);
}
.ref-upload-label:hover { border-color: var(--gold-dim); color: var(--gold); }
.ref-optional { font-style: italic; color: var(--text-dim); }
.ref-file-input { display: none; }

.ref-preview-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.ref-preview-wrap.hidden { display: none; }
.ref-preview-img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.ref-clear-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  transition: border-color var(--transition), color var(--transition);
}
.ref-clear-btn:hover { border-color: var(--ember); color: var(--ember); }

/* ── Shift art ──────────────────────────────────────────────── */
.shift-section {
  margin-bottom: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.shift-section.hidden { display: none; }
.shift-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.shift-label {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  width: 44px;
  flex-shrink: 0;
}
.shift-slider {
  flex: 1;
  accent-color: var(--gold-dim);
  cursor: pointer;
}
.shift-val {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Refine art ─────────────────────────────────────────────── */
.refine-section {
  margin-bottom: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.refine-section.hidden { display: none; }

.refine-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.refine-textarea {
  flex: 1;
  min-height: 68px;
}

/* ── Transform image ────────────────────────────────────────── */
.transform-section {
  margin-bottom: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.transform-section.hidden { display: none; }
.transform-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.transform-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.tx-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1300;
  backdrop-filter: blur(4px);
}
.tx-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(400px, 92vw);
  max-height: 95vh;
  overflow: visible;
}
.tx-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 745 / 1040;
  overflow: visible;
  user-select: none;
}
.tx-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
}
.tx-art-wrap {
  position: absolute;
  top: 0; left: 0;
  outline: 2px dashed rgba(200, 168, 74, 0.7);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.tx-art-wrap:active { cursor: grabbing; }
.tx-art-wrap.mode-locked { overflow: hidden; }
.tx-art-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  opacity: 0.88;
}
.tx-art-wrap.mode-locked .tx-art-img {
  position: absolute;
  width: auto;
  height: auto;
}
.tx-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border: 2px solid var(--bg);
  border-radius: 2px;
  touch-action: none;
}
.tx-handle[data-handle="nw"] { top: -5px;              left: -5px;              cursor: nw-resize; }
.tx-handle[data-handle="n"]  { top: -5px;              left: calc(50% - 5px);   cursor: n-resize;  }
.tx-handle[data-handle="ne"] { top: -5px;              right: -5px;             cursor: ne-resize; }
.tx-handle[data-handle="e"]  { top: calc(50% - 5px);  right: -5px;             cursor: e-resize;  }
.tx-handle[data-handle="se"] { bottom: -5px;           right: -5px;             cursor: se-resize; }
.tx-handle[data-handle="s"]  { bottom: -5px;           left: calc(50% - 5px);  cursor: s-resize;  }
.tx-handle[data-handle="sw"] { bottom: -5px;           left: -5px;              cursor: sw-resize; }
.tx-handle[data-handle="w"]  { top: calc(50% - 5px);  left: -5px;              cursor: w-resize;  }
.tx-sliders {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0 0.25rem;
}
.tx-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.tx-mode-hint {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.tx-slider-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.tx-slider-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}
.tx-slider-val-input {
  width: 3.5rem;
  flex-shrink: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  text-align: right;
  -moz-appearance: textfield;
}
.tx-slider-val-input::-webkit-outer-spin-button,
.tx-slider-val-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.tx-slider-val-input:focus { outline: none; border-color: var(--gold-dim); }
.tx-slider-row .shift-slider { flex: 1; }

.tx-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-style: italic;
}

/* ── Export cart badge ──────────────────────────────────────── */
.export-cart-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  background: var(--gold-dim);
  border: none;
  border-radius: 50px;
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: background var(--transition), transform var(--transition);
}
.export-cart-btn:hover { background: var(--gold); transform: scale(1.04); }
.export-cart-count {
  background: var(--bg);
  color: var(--gold);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

/* ── Export modal ───────────────────────────────────────────── */
.export-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  backdrop-filter: blur(4px);
}
.export-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: min(520px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.export-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
}

/* Drive status row */
.export-drive-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.drive-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.drive-dot--ok      { background: #4caf50; }
.drive-dot--warn    { background: var(--gold-dim); }
.drive-dot--error   { background: var(--ember); }
.drive-dot--unknown { background: var(--text-dim); }

.export-setup-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(200, 80, 40, 0.08);
  border: 1px solid rgba(200, 80, 40, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
}
.export-setup-note a { color: var(--gold-dim); text-decoration: underline; }
.export-setup-note code { font-size: 0.8rem; color: var(--text-muted); }

/* Cart list */
.export-cart-section { display: flex; flex-direction: column; gap: 0.5rem; }
.export-cart-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.export-cart-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
}
.export-cart-thumb {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.export-cart-name {
  flex: 1;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.export-cart-remove { flex-shrink: 0; }

/* Input fields */
.export-field { display: flex; flex-direction: column; gap: 0.35rem; }
.export-input {
  border-radius: var(--radius-sm);
  width: 100%;
  font-size: 0.88rem;
}

/* Stock picker */
.stock-picker {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stock-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.stock-option input[type="radio"] { accent-color: var(--gold); }
.stock-option:has(input:checked) { color: var(--gold); }

/* Cardback picker */
.cardback-picker {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.cardback-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color var(--transition);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-family: 'Cinzel', serif;
}
.cardback-option img {
  width: 60px;
  height: 84px;
  object-fit: cover;
  border-radius: 3px;
}
.cardback-option:hover { border-color: var(--gold-dim); }
.cardback-option.selected { border-color: var(--gold); color: var(--gold); }

/* Export progress bar */
.export-progress-wrap {
  margin-top: 1rem;
}
.export-progress-bar {
  height: 6px;
  background: var(--border, #333);
  border-radius: 3px;
  overflow: hidden;
}
.export-progress-fill {
  height: 100%;
  background: var(--gold, #c9a84c);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.export-progress-label {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, #888);
}

/* Modal actions */
.export-modal-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

/* ── Print Order button ─────────────────────────────────────── */
.btn-print-order {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-print-order:hover { background: var(--gold); color: var(--bg); }

/* ── Print Order modal ──────────────────────────────────────── */
.print-order-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  backdrop-filter: blur(4px);
}
.print-order-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: min(500px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.print-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.print-order-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.print-order-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
}
.print-order-close:hover { color: var(--text); }

/* Pricing tiers */
.print-pricing-tiers {
  display: flex;
  gap: 0.5rem;
}
.print-tier {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  transition: border-color 0.2s, background 0.2s;
}
.print-tier.active {
  border-color: var(--gold);
  background: rgba(200,168,74,0.08);
}
.print-tier-range {
  font-family: 'Crimson Pro', serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}
.print-tier-price {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}
.print-tier.active .print-tier-price { color: var(--gold); }
.print-tier.active .print-tier-range { color: var(--text-muted); }

/* Order summary */
.print-summary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.print-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: var(--gold-bright);
}
.print-summary-note {
  font-family: 'Crimson Pro', serif;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

/* Actions */
.print-order-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

/* Error */
.print-error {
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: #e57373;
  text-align: center;
  margin: 0;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ── Header nav ─────────────────────────────────────────────── */
.header-nav { margin-top: 0.75rem; }
.nav-link {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color var(--transition), border-color var(--transition);
}
.nav-link:hover { color: var(--gold); border-color: var(--border-hover); }

/* ── Projects list ──────────────────────────────────────────── */
.projects-layout {
  position: relative;
  z-index: 10;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.projects-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.25rem;
}
.new-project-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.new-project-bar .search-input {
  flex: 1;
  border-radius: var(--radius-sm);
  border-right: 1px solid var(--border);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.project-card {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color var(--transition), transform var(--transition);
}
.project-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.project-thumb {
  aspect-ratio: 3 / 4;
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb-empty { color: var(--text-dim); font-size: 0.82rem; font-style: italic; }
.project-info { padding: 0.75rem 1rem; }
.project-name {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-count { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }
.btn-delete-project {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(14,12,10,0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition), border-color var(--transition);
}
.project-card:hover .btn-delete-project { opacity: 1; }
.btn-delete-project:hover { color: var(--ember); border-color: var(--ember); }
.projects-empty { color: var(--text-dim); font-style: italic; grid-column: 1/-1; padding: 2rem 0; }

/* ── Project detail ─────────────────────────────────────────── */
.project-detail-layout {
  position: relative;
  z-index: 10;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.project-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.project-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.project-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  transition: color var(--transition), border-color var(--transition);
  align-self: flex-start;
}
.project-back-link:hover {
  color: var(--gold-bright);
  border-color: var(--gold-dim);
}
.project-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--gold-bright);
  font-weight: 700;
  margin: 0;
}
.project-header-actions { display: flex; gap: 0.75rem; align-items: center; }
.proxy-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}
.proxy-tile {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  aspect-ratio: 745 / 1040;
  transition: border-color var(--transition);
}
.proxy-tile:hover { border-color: var(--border-hover); }
.proxy-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proxy-tile-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(6,5,4,0.92) 0%, transparent 28%, transparent 50%, rgba(6,5,4,0.98) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.proxy-tile:hover .proxy-tile-overlay { opacity: 1; }
.proxy-tile-name {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.proxy-tile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  pointer-events: auto;
}
.proxy-tile-actions .btn-secondary {
  font-size: 0.62rem;
  padding: 0.3rem 0.6rem;
  color: #fff;
  border-color: rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.75);
  width: 100%;
  text-align: center;
  white-space: nowrap;
}
.proxy-tile-actions .btn-secondary:hover {
  color: var(--gold-bright);
  border-color: var(--gold-dim);
  background: rgba(0,0,0,0.6);
}
.gallery-empty { color: var(--text-dim); font-style: italic; grid-column: 1/-1; padding: 2rem 0; }
.gallery-empty a { color: var(--gold-dim); text-decoration: underline; text-underline-offset: 2px; }

/* ── Add-to-project output action ───────────────────────────── */
.project-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.project-context-name {
  font-size: 0.82rem;
  color: var(--gold-dim);
  font-style: italic;
}

/* ── Collection picker modal ────────────────────────────────── */
.collection-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.collection-option {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  padding: 0.55rem 0.9rem;
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}
.collection-option:hover { border-color: var(--gold-dim); background: #221e16; color: var(--gold); }
.collection-loading, .collection-empty {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}
.new-collection-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.new-collection-row .search-input { flex: 1; border-radius: var(--radius-sm); border-right: 1px solid var(--border); }

/* ── Success toast ──────────────────────────────────────────── */
.toast-success {
  background: #0d2218;
  border: 1px solid #206040;
  color: #80d0a0;
}

/* ── Export dropdown ────────────────────────────────────────── */
.export-dropdown-wrap {
  position: relative;
}
.export-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 150px;
  z-index: 200;
  overflow: hidden;
}
.export-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.export-dropdown-item:last-child { border-bottom: none; }
.export-dropdown-item:hover { background: var(--bg-input); color: var(--gold); }

/* ── Copy-to-collection picker ──────────────────────────────── */
.copy-picker {
  position: absolute;
  z-index: 9999;
  background: var(--surface-2, #1a1a2e);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
  min-width: 160px;
  max-width: 240px;
  padding: 0.35rem 0;
  display: flex;
  flex-direction: column;
}
.copy-picker-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #888);
  padding: 0.3rem 0.75rem 0.2rem;
  margin: 0;
}
.copy-picker-loading,
.copy-picker-empty {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  padding: 0.5rem 0.75rem;
  margin: 0;
}
.copy-picker-item {
  background: none;
  border: none;
  text-align: left;
  color: var(--text, #ddd);
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--transition), color var(--transition);
}
.copy-picker-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--gold-bright, #f0d060);
}

/* ── Auth slot (fixed top-left) ─────────────────────────────── */
.auth-slot {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.auth-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-auth {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--gold-dim);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.65rem;
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-auth:hover { border-color: var(--gold); color: var(--gold); }

/* ── Sign-in prompt (collections page) ─────────────────────── */
.signin-prompt {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 3rem 1rem;
}
.signin-prompt-text {
  color: var(--text-muted);
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-style: italic;
}

/* ── Collection picker sign-in prompt ───────────────────────── */
.collection-signin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   HERO PAGE
   ═══════════════════════════════════════════════════════════════ */

.hero-section {
  max-width: 680px;
  margin: 5rem auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0 0 0.75rem;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--gold-bright);
  margin: 0 0 1rem;
  line-height: 1.15;
}

.hero-subtitle {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.9rem 2.8rem;
  background: var(--gold);
  color: #0e0c0a;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
}
.hero-cta:hover { background: var(--gold-bright); transform: translateY(-1px); }
.hero-cta:active { transform: translateY(0); }

.hero-signin {
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
}
.hero-signin:hover { color: var(--gold); }

.hero-new-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-new-name .search-input { width: 260px; }

/* ── Recent collections strip ───────────────────────────────── */
.recent-section {
  width: 100%;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
  box-sizing: border-box;
  text-align: center;
}

.recent-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.recent-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

.recent-collections {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.recent-card {
  flex: 0 0 200px;
  width: 200px;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--transition), transform 0.15s;
}
.recent-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.recent-thumb {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
}
.recent-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.recent-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  color: var(--gold-dim);
}

.recent-info {
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
}
.recent-name {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-count {
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   COLLECTION WORKSPACE (project.html overhaul)
   ═══════════════════════════════════════════════════════════════ */

/* ── Guest banner ───────────────────────────────────────────── */
.guest-banner {
  background: rgba(200,168,74,0.1);
  border-bottom: 1px solid rgba(200,168,74,0.25);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  color: var(--gold-dim);
}
.guest-banner-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── Add Card(s) modal ──────────────────────────────────────── */
.add-card-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.add-card-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.add-card-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.add-card-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.add-card-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
  transition: color var(--transition);
}
.add-card-modal-close:hover { color: var(--text); }
.add-card-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.add-card-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 1rem 0.5rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}
.add-card-tab:hover { color: var(--text); }
.add-card-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.add-card-modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.add-card-modal-actions .btn-primary { flex: 1; }
.add-card-modal-actions .btn-secondary { flex: 1; }

/* ── Search wrap (inside add modal) ─────────────────────────── */
.collection-search-wrap { position: relative; width: 100%; }
.collection-search-wrap .search-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover, .search-dropdown-item.selected { background: var(--bg-input); }
.search-dropdown-item img { width: 28px; height: 39px; object-fit: cover; border-radius: 2px; }
.search-dropdown-name { font-family: 'Cinzel', serif; font-size: 0.8rem; color: var(--text); }
.search-dropdown-type { font-family: 'Crimson Pro', serif; font-size: 0.78rem; color: var(--text-muted); }

/* ── Proxy tile — customize button ─────────────────────────── */
.proxy-tile { position: relative; }

/* ── Art picker modal ───────────────────────────────────────── */
.art-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(3px);
  z-index: 1100;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4vh 1rem 4vh;
}
.art-picker-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  width: min(960px, 96vw);
  display: flex;
  flex-direction: column;
}
.art-picker-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: -4vh;
  background: var(--bg-panel);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 1;
}
.art-picker-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0;
}
.art-picker-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.art-picker-close:hover { color: var(--text); }

.art-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 146px);
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.5rem;
  justify-content: start;
}
.printing-thumb {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), transform 0.15s;
  background: var(--bg-card);
}
.printing-thumb:hover { border-color: var(--gold-dim); transform: scale(1.01); }
.printing-thumb.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.printing-thumb img { width: 146px; height: 204px; display: block; object-fit: cover; }
.printing-thumb-info {
  padding: 0.35rem 0.5rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* ── Confirm / warning modal ────────────────────────────────── */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1400;
  backdrop-filter: blur(4px);
}
.confirm-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.2rem 1.6rem;
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.confirm-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--gold);
  margin: 0;
}
.confirm-modal-body {
  font-family: 'Crimson Pro', serif;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
}
.confirm-modal-hint {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
}
.confirm-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.4rem;
}
.btn-danger {
  padding: 0.45rem 1.1rem;
  background: transparent;
  border: 1px solid #c0392b;
  color: #e74c3c;
  border-radius: var(--radius);
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-danger:hover {
  background: #c0392b;
  color: #fff;
}

/* ── Customize modal (full-screen 2-col) ────────────────────── */
.customize-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  z-index: 1150;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}
.customize-modal {
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  width: min(1100px, 100vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.customize-modal-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
/* DFC face toggle in the customize modal header */
.cust-face-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.cust-face-btn {
  padding: 0.3rem 0.85rem;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.cust-face-btn:last-child { border-right: none; }
.cust-face-btn:hover  { background: var(--bg-input); color: var(--text); }
.cust-face-btn.active { background: var(--gold); color: #0e0c0a; }
.customize-modal-title {
  flex: 1;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0;
}
.customize-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.customize-modal-close:hover { color: var(--text); }

.customize-modal-body {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  overflow: hidden;
}

.customize-left {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.customize-left .mode-tabs {
  flex-shrink: 0;
  padding: 1.25rem 1.25rem 0;
}
.customize-left-body {
  overflow-y: auto;
  flex: 1;
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.customize-right {
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.customize-modal-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Mode tabs (Upload / AI) */
.mode-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.mode-tab {
  flex: 1;
  padding: 0.5rem;
  background: none;
  border: none;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.mode-tab:hover { background: var(--bg-input); color: var(--text); }
.mode-tab.active { background: var(--gold); color: #0e0c0a; }

/* Customize preview area */
.customize-preview-wrap {
  aspect-ratio: 745/1040;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.customize-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.customize-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: 'Crimson Pro', serif;
  font-style: italic;
}

/* Reference image upload (AI mode) */
.ref-upload-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}
.ref-upload-label:hover { color: var(--text); }
.ref-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Customize section dividers */
.customize-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

/* Key guide link */
.key-guide-link {
  color: var(--gold-dim);
  text-decoration: none;
  white-space: nowrap;
}
.key-guide-link:hover { color: var(--gold); text-decoration: underline; }

/* Change key button (bottom of AI content) */
.btn-change-key {
  display: block;
  width: fit-content;
  margin: 1rem auto 0;
  padding: 0.45rem 0.75rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.btn-change-key:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-input);
}

/* Key change popup */
.key-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.key-popup {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: min(400px, 90vw);
}
.key-popup-title {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 0.75rem;
}

/* API key row inside customize modal */
.api-key-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.api-key-row .search-input { flex: 1; font-size: 0.8rem; padding: 0.4rem 0.6rem; }

@media (max-width: 700px) {
  .customize-modal-body { grid-template-columns: 1fr; }
  .customize-left { border-right: none; border-bottom: 1px solid var(--border); }
  .hero-section { margin-top: 3rem; }
}
