:root {
  --bg-deep: #0a0a12;
  --bg-surface: #12121e;
  --bg-card: #1a1a2e;
  --bg-elevated: #22223a;
  --accent-sun: #f7a825;
  --accent-flare: #ff5e3a;
  --accent-corona: #7b61ff;
  --accent-cool: #38bdf8;
  --text-primary: #eeeef6;
  --text-secondary: #9898b8;
  --text-dim: #5e5e80;
  --border: #2a2a44;
  --border-active: #7b61ff;
  --glow-sun: rgba(247,168,37,0.25);
  --glow-corona: rgba(123,97,255,0.2);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

html.dark {
  color-scheme: dark;
}

html:not(.dark) {
  --bg-deep: #f0eff5;
  --bg-surface: #faf9fe;
  --bg-card: #ffffff;
  --bg-elevated: #eeedf5;
  --text-primary: #1a1a2e;
  --text-secondary: #5e5e80;
  --text-dim: #9898b8;
  --border: #d8d8e8;
  --border-active: #7b61ff;
  --glow-sun: rgba(247,168,37,0.15);
  --glow-corona: rgba(123,97,255,0.1);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, var(--glow-sun) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, var(--glow-corona) 0%, transparent 50%);
  animation: bgDrift 20s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes bgDrift {
  0% { transform: translate(0,0) rotate(0deg); }
  100% { transform: translate(-5%,3%) rotate(3deg); }
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* Header */
.hero {
  text-align: center;
  padding: 32px 0 24px;
  animation: fadeInUp 0.8s ease-out;
}

.hero-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #ffe066, var(--accent-sun), var(--accent-flare));
  margin: 0 auto 16px;
  box-shadow: 0 0 40px var(--glow-sun), 0 0 80px rgba(255,94,58,0.15);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 40px var(--glow-sun), 0 0 80px rgba(255,94,58,0.15); transform: scale(1); }
  50% { box-shadow: 0 0 60px var(--glow-sun), 0 0 120px rgba(255,94,58,0.25); transform: scale(1.05); }
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-sun), var(--accent-flare), var(--accent-corona));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 6px;
  font-weight: 300;
}

/* Sections / Steps */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out both;
}

.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.step-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-corona), var(--accent-cool));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Controls */
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type="date"],
input[type="time"],
select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  -webkit-appearance: none;
}

input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--glow-corona);
}

/* Wavelength cards */
.wavelength-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

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

.filter-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}

.filter-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-opt:has(input:checked),
.filter-opt.active {
  background: var(--accent-corona);
  color: #fff;
  font-weight: bold;
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

/* Match option shows mode color (set in JS); when selected, .active provides outline and bold */

/* HQ RHEF option — matches sibling filter options. A subtle star cue in the
   label signals "premium/slow" without the old gold treatment that tested as
   intimidating to click. When selected, it uses the same accent-corona as
   the other filters. */
#hqRhefFilterOpt {
  color: var(--text-secondary);
}

.filter-opt input[type="radio"] {
  display: none;
}

/* ── Filter quality timeline ──
   Replaces the JPG/Raw/RHEF/HQ-RHEF radio row with a stepper that reads as
   "image quality progresses through these tiers": locked tiers show a small
   lock icon, loading tiers spin, ready tiers get a check, the active tier
   gets the accent treatment. Connectors between steps fill in as each tier
   becomes ready. Underlying radio inputs are kept hidden for a11y. */
.filter-timeline {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.filter-timeline-label {
  /* Own row so the four steps align vertically — beta tester noted the
     prior layout staggered "QUALITY" inline next to JPG which made the
     stages drift across rows. */
  flex: 0 0 100%;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 2px;
}
.filter-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, opacity 0.15s ease;
  color: var(--text-dim);
  user-select: none;
}
.filter-step input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.filter-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-dim);
  font-size: 0.7rem;
  flex-shrink: 0;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.filter-step-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.filter-step-name {
  font-size: 0.78rem;
  font-weight: 600;
}
.filter-step-status {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  margin-top: 1px;
  min-height: 1em;
}
.filter-step-status::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
}
.filter-step-status[data-status="locked"]::before {
  content: "\f023 Locked";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
  font-weight: 900;
  letter-spacing: 0.4em;
  color: var(--text-dim);
}
.filter-step-status[data-status="loading"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1.5px solid rgba(123, 97, 255, 0.35);
  border-top-color: var(--accent-corona, #7b61ff);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 4px;
}
.filter-step-status[data-status="loading"]::after {
  content: "Loading…";
  color: var(--accent-corona, #7b61ff);
}
.filter-step-status[data-status="ready"]::before {
  content: "\f00c Ready";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
  font-weight: 900;
  letter-spacing: 0.4em;
  color: #3ddc84;
}
.filter-step-status[data-status="active"]::before {
  content: "\f00c Active";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
  font-weight: 900;
  letter-spacing: 0.4em;
  color: #fff;
}

/* Locked steps are dimmed and not clickable (cursor stays default) — but
   we still allow the click so the existing handleFilterChange() can show
   the "starting fetch…" toast. The cursor cue communicates "not yet". */
.filter-step.locked {
  opacity: 0.55;
  cursor: progress;
}
.filter-step.ready:hover {
  background: rgba(123, 97, 255, 0.08);
  color: var(--text-primary);
}
.filter-step.ready .filter-step-num {
  background: rgba(61, 220, 132, 0.18);
  color: #3ddc84;
}
.filter-step.loading .filter-step-num {
  background: rgba(123, 97, 255, 0.18);
  color: var(--accent-corona, #7b61ff);
}
.filter-step.active {
  background: var(--accent-corona, #7b61ff);
  color: #fff;
  font-weight: 700;
}
.filter-step.active .filter-step-num {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Connector line between steps. Thicker + accent when both flanking steps
   are ready; muted otherwise. */
.filter-step-connector {
  flex: 0 0 18px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  transition: background-color 0.18s ease;
}
.filter-step-connector.completed {
  background: linear-gradient(90deg, #3ddc84, var(--accent-corona, #7b61ff));
}

/* Defensive: hide any leftover old-markup labels on caches that haven't
   reloaded. */
.filter-timeline .filter-opt { display: none; }

.filter-status-line {
  font-size: 0.7rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  padding: 3px 12px;
  margin-top: 4px;
  border-radius: 4px;
  line-height: 1.4;
  transition: opacity 0.3s ease;
}
.filter-status-line.loading {
  background: rgba(255, 165, 0, 0.12);
  color: var(--accent-sun, #ffa500);
}
.filter-status-line.success {
  background: rgba(61, 220, 132, 0.12);
  color: #3ddc84;
}
.filter-status-line.error {
  background: rgba(255, 87, 51, 0.12);
  color: var(--accent-flare, #ff5733);
}

.wl-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.wl-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
}

.wl-card[data-wl="94"]::before { background: #3ddc84; }
.wl-card[data-wl="131"]::before { background: #00bcd4; }
.wl-card[data-wl="171"]::before { background: #f7a825; }
.wl-card[data-wl="193"]::before { background: #e67e22; }
.wl-card[data-wl="211"]::before { background: #9b59b6; }
.wl-card[data-wl="304"]::before { background: #e74c3c; }
.wl-card[data-wl="335"]::before { background: #3498db; }
.wl-card[data-wl="1600"]::before { background: #f0c040; }
.wl-card[data-wl="1700"]::before { background: #f5deb3; }

.wl-card:hover {
  border-color: var(--text-dim);
  transform: translateY(-2px);
}

.wl-card.selected {
  border-color: var(--accent-corona);
  background: rgba(123,97,255,0.08);
  box-shadow: 0 0 16px var(--glow-corona);
}

.wl-thumb {
  width: 120px;
  height: 120px;
  margin: 0 auto 8px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.wl-thumb:not(.loaded) {
  opacity: 0.5;
}

.wl-thumb.loaded {
  opacity: 1;
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
}

.wl-thumb img,
.wl-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.wl-thumb-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-corona);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.wl-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 500;
}

.wl-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.3;
}

/* Preview Products Button */
.btn-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  margin-top: 14px;
  background: transparent;
  color: var(--accent-cool);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid var(--accent-cool);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.02em;
}
.btn-preview:hover:not(:disabled) {
  background: rgba(52,152,219,0.1);
  transform: translateY(-1px);
}
.btn-preview:disabled { opacity: 0.4; cursor: not-allowed; }

/* Generate Button */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--accent-sun), var(--accent-flare));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.02em;
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,94,58,0.35);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Progress bar */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  margin-top: 14px;
  overflow: hidden;
  display: none;
}

.progress-track.active { display: block; }

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-corona), var(--accent-cool));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.status-msg {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-msg .spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-corona);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Image Display.
   Sharp corners on the editor canvas — beta tester pointed out that the
   rounded image-stage corners weren't a faithful preview of the final
   physical product (acrylic / canvas / poster prints have square edges).
   Outer panel still has its own rounding via .section. */
.image-stage {
  position: relative;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #c8c8c8 25%, transparent 25%),
    linear-gradient(-45deg, #c8c8c8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c8c8c8 75%),
    linear-gradient(-45deg, transparent 75%, #c8c8c8 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 8px;
  border-radius: 0;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.dark .image-stage {
  background-color: #1a1a2e;
  background-image:
    linear-gradient(45deg, #2a2a44 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a44 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a44 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a44 75%);
}

.image-stage.empty {
  background: var(--bg-elevated) !important;
  background-image: none !important;
  border: 2px dashed var(--border);
}

.image-stage.empty::after {
  content: 'Your solar image will appear here';
  color: var(--text-dim);
  font-size: 0.9rem;
}

#solarCanvas {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  display: block;
  cursor: crosshair;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.15s ease;
}

#solarImg {
  display: none;
}

/* Edit Tools */
.edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.edit-toolbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.edit-toolbar-break {
  width: 100%;
  height: 0;
  flex-basis: 100%;
}

/* Tab bar */
.edit-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-basis: 100%;
  width: 100%;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-top: 4px;
}
/* Reset button lives in the tab bar, pushed to the far right */
.edit-btn-reset {
  margin-left: auto;
  padding: 4px 12px;
  font-size: 0.78rem;
  opacity: 0.75;
}
.edit-btn-reset:hover { opacity: 1; }

.edit-tab {
  padding: 5px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.edit-tab:hover { color: var(--text-primary); border-color: var(--border); }
.edit-tab.active {
  color: var(--accent-corona);
  border-color: var(--accent-corona);
  background: rgba(123,97,255,0.08);
  font-weight: 600;
}

/* Clock tab specific styling — when visible (wall_clock selected) the tab
   pulses gently so first-time users notice the clock-face customization
   controls. The pulse stops once the user activates the tab. */
.edit-tab-clock:not(.hidden):not(.active) {
  border-color: rgba(34, 197, 94, 0.45);
  color: #22c55e;
  font-weight: 600;
  animation: clock-tab-pulse 1.6s ease-in-out infinite;
}
@keyframes clock-tab-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }
}
.edit-tab-clock.active {
  color: #22c55e;
  border-color: #22c55e;
  background: rgba(34,197,94,0.08);
  animation: none;
}

/* Tab content panels */
.edit-tab-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-basis: 100%;
  width: 100%;
  padding-top: 8px;
}

.edit-tab-panel.hidden { display: none; }

.edit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.edit-btn:hover { border-color: var(--accent-corona); background: rgba(123,97,255,0.06); }
.edit-btn.active { border-color: var(--accent-corona); background: rgba(123,97,255,0.12); color: var(--accent-corona); }

.edit-btn i { font-size: 0.85rem; }

/* Clock button: more apparent when visible (wall clock product selected) */
.edit-btn-clock:not(.hidden) {
  background: rgba(34, 197, 94, 0.12);
  border-color: #22c55e;
  color: #16a34a;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}
.edit-btn-clock:not(.hidden):hover {
  background: rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}
.edit-btn-clock.active { border-color: #22c55e; background: rgba(34, 197, 94, 0.2); color: #16a34a; }

/* Timestamp position picker — 2×3 of small radio cells. Sits inline
   alongside the Tools-tab buttons; hidden until the user enables the
   timestamp so it doesn't crowd the panel for users who don't need it. */
.timestamp-pos {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.timestamp-pos.hidden { display: none; }
.timestamp-pos-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.timestamp-pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 22px);
  grid-template-rows: repeat(2, 22px);
  gap: 4px;
}
.timestamp-pos-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #9898b8);
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.timestamp-pos-cell input[type="radio"] { display: none; }
.timestamp-pos-cell:hover {
  color: var(--text-primary, #e9eaf5);
  background: rgba(123, 97, 255, 0.1);
}
.timestamp-pos-cell:has(input:checked) {
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.35), rgba(192, 107, 255, 0.35));
  border-color: rgba(123, 97, 255, 0.6);
  color: #fff;
}

/* Vertical-offset slider — sits to the right of the position grid so
   the user can nudge the caption inward from the chosen edge. */
.timestamp-pos-offset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 130px;
}
.timestamp-pos-offset input[type="range"] {
  width: 70px;
  height: 4px;
}
.timestamp-pos-offset .slider-val {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary, #9898b8);
  min-width: 18px;
  text-align: right;
}

/* Preset buttons row */
.preset-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  width: 100%;
}

.preset-row-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 2px;
  white-space: nowrap;
}

.preset-btn {
  font-size: 0.72rem !important;
  padding: 3px 8px !important;
  border-style: dashed !important;
  opacity: 0.85;
}

.preset-btn:hover {
  opacity: 1;
  border-style: solid !important;
}

/* Slider Row */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.slider-row label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 80px;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent-corona);
  height: 6px;
}

.slider-row .slider-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 40px;
  text-align: right;
}

.vignette-fade-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 8px;
}

.vignette-fade-toggle {
  flex-shrink: 0;
}

.vignette-fade-row .vignette-fade-color-label {
  margin-left: auto;
  margin-right: 0;
}

.vignette-fade-row .vignette-color-input {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-card);
  flex-shrink: 0;
}

/* Background toggle: Color option shows current color as face; picker opens on click */
.filter-opt-color {
  position: relative;
  min-width: 36px;
  padding-left: 10px;
  padding-right: 10px;
}
.filter-opt-color .vignette-fade-color-picker {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  border: none;
}
.filter-opt-color .filter-opt-color-label {
  position: relative;
  z-index: 0;
  pointer-events: none;
  color: inherit;
}

/* Non-blocking loading indicator pinned to the upper-right of the quality
   timeline, next to the "Quality" label, so it doesn't shift the step row. */
.filter-loading-indicator {
  position: absolute;
  top: 4px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-loading-indicator.hidden {
  display: none !important;
}
.filter-loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-corona);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Product Cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.product-card:hover {
  border-color: var(--accent-sun);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.product-card.selected {
  border-color: var(--accent-sun);
  box-shadow: 0 0 20px var(--glow-sun);
}

.product-preview {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-preview canvas {
  max-width: 70%;
  max-height: 70%;
}

.product-preview .product-icon {
  font-size: 3rem;
  color: var(--text-dim);
}

/* Tiny upper-left glyph that persists once the mockup loads. Beta testers
   asked for an at-a-glance product-type indicator so they can scan the grid
   without reading each name — this is the same fa-icon that renders pre-load,
   shrunk to a corner badge. The backdrop is semi-opaque for legibility on
   both light-product and dark-product mockups. */
.product-preview .product-icon-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 22, 0.72);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 24px;
  pointer-events: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 2;
}

.product-info {
  padding: 14px;
}

.product-name {
  font-weight: 600;
  font-size: 1rem;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.product-price {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--accent-sun);
  margin-top: 6px;
}

/* Order Button */
.btn-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--accent-corona), #5c4bbf);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
}

.btn-order:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow-corona);
}

.btn-order:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-secondary:hover { border-color: var(--accent-corona); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

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

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp { from { transform:translateY(20px); opacity:0; } to { transform:translateY(0); opacity:1; } }

.modal-box h3 { margin-bottom: 12px; font-size: 1.1rem; }

.modal-box p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; line-height: 1.5; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions button {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all var(--transition);
}

.modal-actions .btn-confirm {
  background: var(--accent-corona);
  border-color: var(--accent-corona);
  color: #fff;
}

/* Loading state for the modal's Create/Confirm button. While the Promise
   returned by onConfirm is pending the button shows a spinner + label so
   users see the click registered and compute is underway. Both buttons are
   disabled until the handler settles. */
.modal-actions .btn-confirm.is-loading {
  opacity: 0.88;
  cursor: progress;
  /* Keep background full-strength so "loading" reads as active, not inert. */
}
.modal-actions button:disabled {
  cursor: progress;
  opacity: 0.7;
}
.modal-actions .btn-confirm .btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.hidden { display: none !important; }

/* Info tip */
.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(123,97,255,0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-corona);
}

.info-row i { color: var(--accent-corona); }
.info-row span { font-size: 0.82rem; color: var(--text-secondary); }

/* Crop overlay */
.crop-overlay {
  position: absolute;
  border: 2px dashed rgba(255,255,255,0.7);
  background: rgba(123,97,255,0.1);
  pointer-events: none;
  z-index: 5;
}
.crop-overlay.circular {
  border-radius: 50%;
}

/* Backend status banner */
.backend-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease-out;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.backend-banner.checking {
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.25);
  color: var(--accent-cool);
}

.backend-banner.online {
  background: rgba(61,220,132,0.08);
  border: 1px solid rgba(61,220,132,0.25);
  color: #3ddc84;
}

.backend-banner.offline {
  background: rgba(255,94,58,0.08);
  border: 1px solid rgba(255,94,58,0.3);
  color: var(--accent-flare);
}

.backend-banner.waking {
  background: rgba(247,168,37,0.08);
  border: 1px solid rgba(247,168,37,0.3);
  color: var(--accent-sun);
}

.backend-banner .banner-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.backend-banner .banner-text {
  flex: 1;
  min-width: 0;
}

.backend-banner .banner-text strong {
  display: block;
  margin-bottom: 2px;
}

.backend-banner .banner-text small {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.backend-banner .banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.backend-banner .banner-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.backend-banner .banner-btn:hover {
  border-color: var(--accent-corona);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 30px 0 10px;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.app-footer a { color: var(--accent-cool); text-decoration: none; }

/* Notification toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  z-index: 200;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: #3ddc84; }
.toast.error { border-color: var(--accent-flare); }

/* HQ button */
.btn-hq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: linear-gradient(135deg, #3498db, var(--accent-corona));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
}

.btn-hq:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(52,152,219,0.3); }
.btn-hq:disabled { opacity: 0.4; cursor: not-allowed; }

/* Crop ratio buttons */
.crop-ratios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.crop-ratio-btn {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.crop-ratio-btn:hover, .crop-ratio-btn.active {
  border-color: var(--accent-corona);
  color: var(--accent-corona);
}

.product-crop-btn {
  background: rgba(255,150,50,0.1);
  border-color: var(--accent-sun);
  color: var(--accent-sun);
  font-size: 0.72rem;
}

.product-crop-btn.active {
  background: rgba(255,150,50,0.2);
  border-color: var(--accent-corona);
  color: var(--accent-corona);
}

/* Text tool panel */
.text-tool-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
}

.text-tool-panel .field-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.text-tool-panel input[type="text"],
.text-tool-panel input[type="number"],
.text-tool-panel select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.text-tool-panel input[type="color"] {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}

.text-tool-panel .field-label-sm {
  font-size: 0.78rem;
  color: var(--text-dim);
  min-width: 50px;
  flex-shrink: 0;
}

.text-effect-row {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 50px;
  white-space: nowrap;
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--accent-corona);
  width: 16px;
  height: 16px;
}

/* Overlay / guide-line checkboxes row inside Geometry tab */
.guide-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex-basis: 100%;
  width: 100%;
  padding: 4px 0 2px;
}

#textFontSelect optgroup {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 4px 0;
}

.text-tool-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.text-tool-hint i { color: var(--accent-cool); }

/* Dragging text cursor */
.text-dragging {
  cursor: move !important;
}

/* Catalog modal */
/* Catalog CSS removed — product creation handled on Printify's site */

/* Variant info panel on product cards */
.variant-panel {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.variant-loading {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.variant-summary {
  font-size: 0.75rem;
}

.variant-count {
  display: inline-block;
  background: var(--accent-corona);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.variant-group {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.variant-group-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.7rem;
  margin-right: 2px;
}

.variant-tag {
  display: inline-block;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.variant-color {
  background: rgba(123,97,255,0.08);
  border-color: rgba(123,97,255,0.2);
}

.variant-more {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-style: italic;
}

.variant-selected-msg {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cool);
  margin-top: 4px;
  margin-bottom: 6px;
}

.variant-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

/* Variant row in the inline pane is read-only: label left, price middle,
   optional "✓ Selected" badge on the active row. Selection happens only
   through the "Pick a variant" modal — these rows just summarise what's
   available so users can see the catalog without committing. */
.variant-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  color: var(--text-primary);
  background: var(--bg-deep);
}

.variant-list-readonly .variant-row { cursor: default; }
.variant-list-readonly .variant-row:hover { background: var(--bg-deep); }

.variant-row.confirmed {
  border-color: var(--accent-cool);
  background: rgba(123, 97, 255, 0.15);
  font-weight: 600;
}

.variant-row-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-price {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.variant-price-empty { min-width: 28px; }

/* Read-only "Selected" pill on the active variant row in the inline pane.
   Replaces the old per-row Select button now that selection lives in the
   modal — keeps the list informative without offering a hidden second
   commit path. */
.variant-row-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--accent-cool);
  color: #fff;
  white-space: nowrap;
}
.variant-row-badge i { font-size: 0.62rem; }
/* Defensive: hide any leftover Select buttons from older renders that
   haven't been re-rendered yet. */
.variant-select-btn { display: none !important; }

.variant-clock-note {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin: 6px 0 0;
  font-style: italic;
}

.variant-pick-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 8px 0 0;
  text-align: center;
}
.variant-pick-hint strong { color: var(--accent-cool); }

.mockup-status {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  min-height: 0;
  transition: min-height 0.3s ease;
}

.mockup-status:not(:empty) {
  min-height: 24px;
}

.product-preview img.mockup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Buy button on product cards */
.product-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent-sun), var(--accent-flare));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
}

.product-buy-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255,94,58,0.3);
}

.product-buy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-elevated);
  color: var(--text-dim);
}

/* Buy button in preview pane */
.btn-buy-in-editor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent-sun), var(--accent-flare));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
}

.btn-buy-in-editor:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 94, 58, 0.3);
}

.btn-buy-in-editor.hidden {
  display: none;
}

/* Locked state: shown until a real Printify mockup has been generated, so
   the user can verify their preview matches what they'll get on Shopify. */
.btn-buy-in-editor:disabled,
.btn-buy-in-editor.buy-locked {
  background: #333344;
  color: rgba(255, 255, 255, 0.55);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn-buy-in-editor:disabled:hover,
.btn-buy-in-editor.buy-locked:hover {
  transform: none;
  box-shadow: none;
}

/* Checkout progress overlay */
.checkout-progress {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  text-align: center;
}

.checkout-progress .checkout-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.checkout-progress .checkout-step.active {
  color: var(--accent-cool);
  font-weight: 500;
}

.checkout-progress .checkout-step.done {
  color: #3ddc84;
}

.checkout-progress .checkout-step i {
  width: 18px;
  text-align: center;
}

.btn-shopify-checkout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  margin-top: 14px;
  background: linear-gradient(135deg, #96bf48, #5a8a1c);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
  text-decoration: none;
}

.btn-shopify-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(150,191,72,0.35);
}

/* ── Side-by-side editor + product mockup preview ────────── */
.editor-with-preview {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.editor-with-preview .editor-main {
  flex: 1.4 1 0;
  min-width: 0;
}

.editor-with-preview .selected-product-preview {
  flex: 1 0 260px;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  /* sticky on scroll; also acts as containing block for the absolute close button */
  position: sticky;
  top: 20px;
}

/* ✕ close / deselect button in the product preview panel */
.preview-close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  z-index: 1;
}
.preview-close-btn:hover {
  color: var(--accent-flare);
  background: rgba(255,94,58,0.12);
}

/* Navigation-style edit-btn (Change Wavelength etc.) */
.edit-btn-nav {
  opacity: 0.7;
  font-size: 0.78rem;
}
.edit-btn-nav:hover { opacity: 1; }

.selected-product-preview .preview-product-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.selected-product-preview .preview-mockup {
  width: 100%;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

/* Canvas is always square 260×260; product shape is drawn inside. img fills when real mockup is shown */
.selected-product-preview .preview-mockup canvas.live-preview-canvas {
  max-width: 100%;
  height: auto;
  display: block;
}
.selected-product-preview .preview-mockup canvas.live-preview-canvas.circular {
  border-radius: 50%;
}

.selected-product-preview .preview-mockup > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.selected-product-preview .preview-product-ratio {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.selected-product-preview .preview-variant-wrap {
  margin-top: 6px;
}
.selected-product-preview .preview-variant-wrap label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}
/* Make the variant select look like a real dropdown — beta tester didn't
   realize it was clickable. Adds a chevron, hover/focus affordances, and
   purple accent border to match the editor's interactive controls. */
.selected-product-preview .preview-variant-wrap select {
  width: 100%;
  padding: 8px 32px 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  background-color: var(--bg-deep);
  /* Inline SVG chevron — no font-awesome dependency, scales cleanly. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  border: 1.5px solid var(--accent-corona, #7b61ff);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.selected-product-preview .preview-variant-wrap select:hover {
  background-color: rgba(123, 97, 255, 0.08);
}
.selected-product-preview .preview-variant-wrap select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.3);
}
.selected-product-preview .preview-variant-note {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin: 4px 0 0;
  font-style: italic;
}

.selected-product-preview .btn-preview-mockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.selected-product-preview .btn-preview-mockup:hover {
  background: var(--accent-sun);
  color: #fff;
  border-color: var(--accent-sun);
}

.selected-product-preview .preview-mockup img.preview-real-mockup {
  object-fit: contain;
  width: 100%;
  height: auto;
  display: block;
}

/* ── Mockup slideshow (preview pane) ── */
.mockup-slideshow {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  width: 28px;
  height: 48px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  transition: opacity 0.15s, background 0.15s;
  z-index: 2;
  padding: 0;
  user-select: none;
}

.slide-nav:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.82);
}

.slide-prev { left: 4px; }
.slide-next { right: 4px; }

.slide-counter {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* Loading overlay for the big selected-product preview pane's mockup
   slideshow. Shown while the next/prev Printify mockup image is fetching
   from the CDN, hidden when img load/error fires. Sized larger than the
   product-card variant since this pane is the hero preview. Nav buttons
   remain clickable (z-index:3 above this layer's z-index:2). */
.mockup-slideshow .slide-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 22, 0.55);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  z-index: 2;
  pointer-events: none;
  transition: opacity 140ms ease-out;
  border-radius: inherit;
}
.mockup-slideshow .slide-loader.hidden {
  opacity: 0;
}
.mockup-slideshow .slide-spinner {
  display: inline-block;
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  animation: mockup-slide-spin 0.75s linear infinite;
}
@keyframes mockup-slide-spin {
  to { transform: rotate(360deg); }
}
.mockup-slideshow .slide-nav { z-index: 3; }

/* ── Mockup slideshow (product card grid) ── */
.card-slide-counter {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 8px;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  z-index: 2;
}

.card-slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.52);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  width: 22px;
  height: 36px;
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
  padding: 0;
  user-select: none;
}

.product-preview:hover .card-slide-nav {
  opacity: 0.72;
}

.card-slide-nav:hover {
  opacity: 1 !important;
  background: rgba(0, 0, 0, 0.82);
}

.card-slide-prev { left: 2px; }
.card-slide-next { right: 2px; }

/* Loading overlay shown while the next/prev mockup image is fetching from
   Printify's CDN. Covers only the preview square (the nav buttons sit at
   z-index 3 so they stay clickable above the overlay). Kept deliberately
   subtle — thin translucent gray, small centered spinner — so it reads as
   "fetching" not "the app is broken." */
.card-slide-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 22, 0.52);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  z-index: 2;
  pointer-events: none;
  transition: opacity 120ms ease-out;
}
.card-slide-loader.hidden {
  opacity: 0;
}
.card-slide-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  animation: card-slide-spin 0.7s linear infinite;
}
@keyframes card-slide-spin {
  to { transform: rotate(360deg); }
}
/* Nav buttons must sit above the loader so users can re-click during load. */
.card-slide-nav { z-index: 3; }

@media (max-width: 740px) {
  .editor-with-preview {
    flex-direction: column;
  }
  .editor-with-preview .selected-product-preview {
    flex: none;
    width: 100%;
    position: static;
  }
}

/* ───────────────────────────────────────────────────────────────
   Feedback widget — floating action button + modal. Sits above all
   other app chrome (z-index above the catalog modal) so users can
   reach it from any state of the flow.
   ─────────────────────────────────────────────────────────────── */
/* Two-pill FAB group — Request on the left, Comment on the right.
   Stays bottom-right via the group container; each pill is a normal
   inline-flex button so they read as siblings rather than a stack. */
.feedback-fab-group {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feedback-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 0;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feedback-fab-request {
  /* Warmer gradient so the "request" CTA reads as the action-y one */
  background: linear-gradient(135deg, #ff8a3d, #c06bff);
}
.feedback-fab-comment {
  background: linear-gradient(135deg, var(--accent-corona, #7b61ff), #c06bff);
}
.feedback-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(123, 97, 255, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.feedback-fab:active { transform: translateY(0); }
.feedback-fab i { font-size: 1rem; }

@media (max-width: 600px) {
  /* On narrow screens, hide labels so the two pills stay icon-only and
     don't crowd each other — full label still appears in the title attr. */
  .feedback-fab-label { display: none; }
  .feedback-fab { padding: 12px; }
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.feedback-modal.hidden { display: none; }
.feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 20, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.feedback-modal-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #17192a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 28px 24px 24px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  color: var(--text-primary, #e9eaf5);
}
.feedback-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary, #9898b8);
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.feedback-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.feedback-modal-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
}
.feedback-modal-sub {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--text-secondary, #9898b8);
}

.feedback-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 18px;
}
.feedback-tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary, #9898b8);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.feedback-tab:hover { color: var(--text-primary, #e9eaf5); }
.feedback-tab.active {
  color: #fff;
  border-bottom-color: var(--accent-corona, #7b61ff);
}
.feedback-tab i { margin-right: 6px; }

.feedback-tab-panel { display: block; }
.feedback-tab-panel.hidden { display: none; }

.feedback-field-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #9898b8);
  letter-spacing: 0.02em;
}
.feedback-field-opt {
  font-weight: 400;
  color: var(--text-dim, #6a6a8a);
}

.feedback-modal textarea,
.feedback-modal input[type="text"],
.feedback-modal input[type="email"],
.feedback-modal select {
  width: 100%;
  box-sizing: border-box;
  background: #0f1120;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary, #e9eaf5);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.feedback-modal textarea { resize: vertical; min-height: 88px; }
.feedback-modal textarea:focus,
.feedback-modal input:focus,
.feedback-modal select:focus {
  border-color: var(--accent-corona, #7b61ff);
  background: #12152a;
}
.feedback-field-error {
  border-color: #ff5a5f !important;
  animation: feedback-shake 0.24s ease;
}
@keyframes feedback-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.feedback-context-note {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(123, 97, 255, 0.08);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-secondary, #9898b8);
  line-height: 1.4;
}
.feedback-context-note i { color: var(--accent-corona, #7b61ff); margin-top: 2px; }

.feedback-submit-btn {
  width: 100%;
  margin-top: 14px;
  padding: 11px 16px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-corona, #7b61ff), #c06bff);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}
.feedback-submit-btn:hover:not(:disabled) { transform: translateY(-1px); }
.feedback-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.feedback-submit-btn i { margin-right: 6px; }
.feedback-submit-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.feedback-product-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary, #9898b8);
}
.feedback-product-hint.hidden { display: none; }

/* Category chips — horizontal scroll on narrow modals so all categories
   stay reachable without wrapping into 4+ rows that crowd the search. */
.feedback-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.feedback-category-row.hidden { display: none; }
.feedback-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #9898b8);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.feedback-category-chip:hover {
  background: rgba(123, 97, 255, 0.08);
  color: var(--text-primary, #e9eaf5);
}
.feedback-category-chip.active {
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.18), rgba(192, 107, 255, 0.18));
  border-color: rgba(123, 97, 255, 0.5);
  color: #fff;
}
.feedback-category-chip i { font-size: 0.78rem; }
.feedback-category-chip-count {
  font-weight: 500;
  color: var(--text-dim, #6a6a8a);
  font-size: 0.7rem;
}
.feedback-category-chip.active .feedback-category-chip-count { color: rgba(255, 255, 255, 0.7); }

.feedback-product-results {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.feedback-product-placeholder {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-dim, #6a6a8a);
  text-align: center;
}
.feedback-product-hit {
  position: relative; /* anchor for the hover-mockup popover */
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #0f1120;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: var(--text-primary, #e9eaf5);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.feedback-product-hit:hover {
  background: #151832;
  border-color: rgba(123, 97, 255, 0.3);
}
.feedback-product-hit-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #08091a;
  object-fit: cover;
  flex: 0 0 auto;
}
.feedback-product-hit-thumb-empty {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #08091a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim, #6a6a8a);
  font-size: 0.9rem;
}
.feedback-product-hit-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.feedback-product-hit-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feedback-product-hit-brand {
  font-size: 0.72rem;
  color: var(--text-dim, #6a6a8a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feedback-product-hit-price {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-corona, #7b61ff);
  white-space: nowrap;
}
.feedback-product-hit-price-empty {
  font-size: 0.7rem;
  color: var(--text-dim, #6a6a8a);
  white-space: nowrap;
  font-style: italic;
}
/* Hover popover — JS-driven (appended to <body>) so it floats above
   the search-results container without getting clipped by its
   overflow:auto. Anchored next to the hovered row by JS. */
.feedback-hit-popover {
  position: fixed;
  width: 200px;
  height: 200px;
  background: #08091a;
  border: 1px solid rgba(123, 97, 255, 0.3);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  padding: 4px;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.feedback-hit-popover.visible {
  opacity: 1;
  transform: scale(1);
}
.feedback-hit-popover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 5px;
}

/* When a blueprint has a single print provider, we hide the dropdown
   and surface the picked provider as a small read-only line so the user
   still sees who'll fulfill the order without an extra interaction. */
.feedback-provider-row.hidden { display: none; }
.feedback-provider-auto {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(123, 97, 255, 0.06);
  border: 1px dashed rgba(123, 97, 255, 0.18);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary, #9898b8);
}
.feedback-provider-auto.hidden { display: none; }
.feedback-provider-auto strong { color: var(--text-primary, #e9eaf5); font-weight: 600; }

/* Print-area shape picker on the chosen-blueprint pane. Two radios laid
   out side-by-side; the active option highlights so the choice reads
   clearly. */
.feedback-shape-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.feedback-shape-row .feedback-field-label { margin: 0 8px 0 0; }
.feedback-shape-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #9898b8);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.feedback-shape-opt input[type="radio"] { display: none; }
.feedback-shape-opt:hover { color: var(--text-primary, #e9eaf5); }
.feedback-shape-opt:has(input:checked) {
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.18), rgba(192, 107, 255, 0.18));
  border-color: rgba(123, 97, 255, 0.5);
  color: #fff;
}
.feedback-shape-opt i { font-size: 0.72rem; opacity: 0.85; }

/* Big mockup on the chosen-blueprint pane — confirms which product was
   picked once the search list collapses. */
.feedback-chosen-mockup {
  width: 100%;
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #08091a;
  border-radius: 8px;
  margin: 10px 0;
  padding: 8px;
  box-sizing: border-box;
}
.feedback-chosen-mockup img {
  max-width: 100%;
  max-height: 184px;
  object-fit: contain;
  border-radius: 6px;
}
.feedback-chosen-mockup-empty {
  color: var(--text-dim, #6a6a8a);
  font-size: 0.78rem;
  padding: 24px 0;
}

.feedback-product-chosen {
  margin-top: 14px;
  padding: 12px;
  background: rgba(123, 97, 255, 0.06);
  border: 1px solid rgba(123, 97, 255, 0.2);
  border-radius: 8px;
}
.feedback-product-chosen.hidden { display: none; }
.feedback-chosen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.feedback-chosen-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.feedback-chosen-brand {
  font-size: 0.72rem;
  color: var(--text-dim, #6a6a8a);
  margin-top: 2px;
}
.feedback-chosen-clear {
  background: transparent;
  border: 0;
  color: var(--text-secondary, #9898b8);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 6px;
  border-radius: 4px;
}
.feedback-chosen-clear:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.feedback-thanks {
  text-align: center;
  padding: 20px 10px;
}
.feedback-thanks i {
  font-size: 2.6rem;
  color: #3ddc84;
  margin-bottom: 10px;
}
.feedback-thanks h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.feedback-thanks p {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-secondary, #9898b8);
}

/* ───────────────────────────────────────────────────────────────
   Pre-editor confirmation modal — previews the product & variant
   after the user clicks "Select this product" and before the editor
   loads. Smaller than the feedback modal since it's a single action
   with a compact metadata readout.
   ─────────────────────────────────────────────────────────────── */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 9994;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-modal.hidden { display: none; }
.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 20, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.confirm-modal-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  /* Cap to viewport height so the new variant picker grid (which can be tall
     for products with 78+ variants) doesn't push the Continue button below
     the fold. The picker has its own scroll inside. */
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #17192a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 26px 22px 20px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  color: var(--text-primary, #e9eaf5);
  overflow-y: auto;
}
.confirm-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary, #9898b8);
  border: 0;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.confirm-modal-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.confirm-modal-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
}
.confirm-modal-sub {
  margin: 0 0 16px;
  font-size: 0.78rem;
  color: var(--text-secondary, #9898b8);
}
/* Mock-mockup preview inside the "Ready to customize?" confirm modal.
   Renders the product silhouette + user's current solar image so the
   variant pick commits with visual context, not just a text summary. */
.confirm-mockup {
  margin: 0 auto 14px;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1120;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
}
.confirm-mockup.empty {
  display: none;
}
.confirm-mockup .confirm-mockup-canvas {
  width: 220px;
  height: 220px;
  image-rendering: -webkit-optimize-contrast;
}
.confirm-metadata {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #0f1120;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
}
.confirm-metadata dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim, #6a6a8a);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.confirm-metadata dd {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-primary, #e9eaf5);
  font-weight: 500;
}
.confirm-modal-note {
  margin: 0 0 14px;
  font-size: 0.75rem;
  color: var(--text-secondary, #9898b8);
  line-height: 1.4;
}
.confirm-modal-actions {
  display: flex;
  gap: 8px;
}
.confirm-modal-btn {
  flex: 1;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.confirm-modal-btn-primary {
  background: linear-gradient(135deg, var(--accent-corona, #7b61ff), #c06bff);
  color: #fff;
}
.confirm-modal-btn-primary:hover { transform: translateY(-1px); }
.confirm-modal-btn-secondary {
  background: transparent;
  color: var(--text-primary, #e9eaf5);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.confirm-modal-btn-secondary:hover { background: rgba(255, 255, 255, 0.06); }

/* ───────────────────────────────────────────────────────────────
   Variant picker inside the confirm modal (single-step selection).
   Replaces the older inline collapsible pane on product cards as the
   primary flow — testers found two-step "expand → row-Select → confirm"
   too cluttered.
   ─────────────────────────────────────────────────────────────── */
.confirm-variant-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary, #9898b8);
}
.confirm-variant-summary strong { color: var(--text-primary, #e9eaf5); font-weight: 600; }
.confirm-variant-summary .confirm-summary-dot { opacity: 0.5; }
.confirm-variant-summary .confirm-summary-price {
  color: var(--accent-corona, #7b61ff);
  font-weight: 600;
}

.confirm-variant-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin: 0 0 14px;
  padding: 4px 2px;
  /* Subtle inset so the scroll area reads as its own region. */
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.confirm-variant-picker::-webkit-scrollbar { width: 8px; }
.confirm-variant-picker::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.confirm-variant-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(20, 22, 36, 0.6);
  color: var(--text-primary, #e9eaf5);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.25;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}
.confirm-variant-tile:hover {
  border-color: rgba(123, 97, 255, 0.55);
  background: rgba(40, 30, 70, 0.55);
}
.confirm-variant-tile.active {
  border-color: var(--accent-corona, #7b61ff);
  background: rgba(123, 97, 255, 0.16);
  box-shadow: 0 0 0 1px var(--accent-corona, #7b61ff) inset;
}
.confirm-variant-tile:active { transform: scale(0.98); }
.confirm-variant-tile-label {
  font-weight: 600;
  /* Allow long labels to wrap to a second line rather than truncate — beta
     reported truncated labels (Athletic Heather / XL Long T → "Athletic He…")
     hid critical information. The tile grows in height; the grid flexes. */
  white-space: normal;
  overflow-wrap: anywhere;
}
.confirm-variant-tile-price {
  font-size: 0.74rem;
  color: var(--text-secondary, #9898b8);
  font-family: 'JetBrains Mono', monospace;
}
.confirm-variant-tile.active .confirm-variant-tile-price { color: var(--accent-corona, #7b61ff); }
.confirm-variant-tile-dims {
  font-size: 0.7rem;
  color: var(--text-dim, #6b6b85);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

.confirm-variant-loading,
.confirm-variant-empty {
  grid-column: 1 / -1;
  padding: 16px;
  text-align: center;
  color: var(--text-secondary, #9898b8);
  font-size: 0.85rem;
}

/* ───────────────────────────────────────────────────────────────
   Session-only "Your Requests" section — cards the user submitted
   via the feedback modal, visible immediately in their session
   before admin approval.
   ─────────────────────────────────────────────────────────────── */
.user-requests-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.user-requests-section.hidden { display: none; }
.user-requests-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.user-requests-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #e9eaf5);
}
.user-requests-sub {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--text-secondary, #9898b8);
}
.product-card.product-card-requested {
  border-color: rgba(123, 97, 255, 0.3);
}
.product-card-requested .product-name::before {
  content: "Requested";
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  background: rgba(123, 97, 255, 0.15);
  border: 1px solid rgba(123, 97, 255, 0.35);
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c0afff;
  vertical-align: middle;
}