/* Qulture Rocks palette — #5A0048 · #FF5482 · #92E9FF */
:root {
  --qr-rose: #ff5482;
  --qr-rose-light: #ff80a2;
  --qr-cyan: #92e9ff;
  --qr-cyan-light: #ccf5ff;
  --qr-wine: #5a0048;
  --bg: #5a0048;
  --bg-elevated: #6b1458;
  --fg: #ffffff;
  --card: rgba(255, 255, 255, 0.08);
  --border: rgba(146, 233, 255, 0.22);
  --muted-dim: rgba(204, 245, 255, 0.75);
  --font-brand: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-brand);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 80% at 10% 0%, rgba(255, 84, 130, 0.25), transparent 55%),
    radial-gradient(ellipse 80% 60% at 90% 100%, rgba(146, 233, 255, 0.12), transparent 50%),
    linear-gradient(180deg, #5a0048 0%, #4a003b 100%);
  color: var(--fg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.ambient-1 { width: 560px; height: 560px; top: -200px; right: -100px; background: rgba(255, 84, 130, 0.18); }
.ambient-2 { width: 500px; height: 500px; bottom: -140px; left: -80px; background: rgba(146, 233, 255, 0.1); }
.ambient-3 { width: 280px; height: 280px; top: 42%; left: 50%; background: rgba(204, 245, 255, 0.06); }
.home-error {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 2px solid rgba(255, 84, 130, 0.85);
  background: rgba(255, 84, 130, 0.14);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(255, 84, 130, 0.12);
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
  animation: home-error-in 0.25s ease-out;
}
.home-error:not(.hidden) {
  display: flex;
}
.home-error.hidden {
  display: none !important;
}
@keyframes home-error-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.home-error-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 84, 130, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-error-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffb3c9;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}
.home-error-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}
.upload-zone.upload-zone--error {
  border-color: #ff5482 !important;
  background: rgba(255, 84, 130, 0.1) !important;
  animation: upload-zone-shake 0.5s ease;
}
@keyframes upload-zone-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
.hidden { display: none !important; }
.hero-editor { margin-bottom: 2.5rem; }
.steps-editor-top { margin-bottom: 2rem; }
.wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
main {
  flex: 1;
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}
@media (min-width: 768px) { main { padding: 4rem 2rem; } }
.text-gradient {
  color: #fff;
}
.hero { text-align: center; margin-bottom: 2.5rem; }
.hero h2 { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1rem; }
@media (min-width: 768px) { .hero h2 { font-size: 3rem; } }
.hero p { max-width: 28rem; margin: 0 auto; color: var(--muted-dim); font-size: 1rem; }
.hero p strong { color: var(--fg); font-weight: 700; }

.upload-zone {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  border: 2px dashed rgba(146, 233, 255, 0.35);
  border-radius: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: rgba(146, 233, 255, 0.06);
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 12px 12px;
}
.upload-zone:hover, .upload-zone.drag {
  border-color: var(--qr-rose);
  background-color: rgba(255, 84, 130, 0.08);
}
.upload-zone input,
.file-input-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.upload-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: rgba(146, 233, 255, 0.15);
  color: var(--qr-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-zone p { color: var(--muted-dim); font-size: 0.9rem; margin-top: 0.25rem; }
.upload-zone .lead { font-weight: 700; color: var(--fg); font-size: 1rem; }
.mono-hint { font-family: var(--font-mono); font-size: 11px; margin-top: 0.75rem; }

.steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 3rem 0 2rem;
}
.step-item { display: flex; align-items: center; gap: 0.5rem; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.step-num.on {
  background: #ff5482;
  color: #fff;
}
.step-num.off { background: rgba(255, 255, 255, 0.12); color: var(--muted-dim); }
.step-label { font-size: 14px; font-weight: 600; }
.step-label.on { color: var(--fg); }
.step-label.off { color: var(--muted-dim); }
.step-line { width: 2rem; height: 1px; background: var(--border); }
@media (min-width: 768px) { .step-line { width: 3rem; } }
.step-line.active { background: rgba(255, 84, 130, 0.5); }

.steps-above-upload {
  margin: 1.25rem auto 1.5rem;
  max-width: 42rem;
}

.specs { max-width: 42rem; margin: 2rem auto 0; }
.specs-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-dim);
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
  text-align: center;
}
.specs-editor-block .specs-section-title { text-align: left; }
.spec-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}
.spec-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.spec-btn:hover { background: rgba(146, 233, 255, 0.06); }
.spec-btn h4 { font-size: 14px; font-weight: 700; }
.spec-btn .sum { font-family: var(--font-mono); font-size: 11px; color: var(--muted-dim); }
.spec-body { display: none; padding: 0 1rem 1rem; font-size: 12px; color: var(--muted-dim); border-top: 1px solid var(--border); }
.spec-row.open .spec-body { display: block; padding-top: 0.75rem; }
.spec-row.open .chev { transform: rotate(180deg); }
.chev { transition: transform 0.2s; color: var(--muted-dim); }

.spec-note { font-size: 11px; color: var(--muted-dim); margin-bottom: 0.75rem; line-height: 1.45; }
.spec-note code { font-size: 10px; }
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: var(--font-mono);
}
.spec-table th,
.spec-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.spec-table th {
  color: var(--qr-cyan);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.spec-table tbody tr:last-child td { border-bottom: none; }
.spec-table code {
  font-size: 10px;
  word-break: break-all;
  color: var(--fg);
}
@media (max-width: 520px) {
  .spec-table th:nth-child(3),
  .spec-table td:nth-child(3) { font-size: 9px; }
}

.editor-grid { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) { .editor-grid { grid-template-columns: 2fr 3fr; align-items: start; } }

.panel {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
}
.panel-flush { padding: 0; overflow: hidden; }
.panel h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qr-cyan-light);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.flush-title { border: none !important; margin: 0 !important; padding: 0 !important; }
.inner-pad { padding: 1rem 1.25rem !important; margin: 0 !important; border-bottom: 1px solid var(--border) !important; }
.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 2.25rem;
}
.preview-head .flush-title,
.preview-head .preview-meta {
  line-height: 1.2;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
}
.preview-head .preview-meta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.preview-area {
  padding: 1.25rem;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse 90% 70% at 20% 20%, rgba(255, 84, 130, 0.15), transparent 50%),
    radial-gradient(ellipse 70% 60% at 85% 80%, rgba(146, 233, 255, 0.12), transparent 45%),
    rgba(43, 43, 43, 0.5);
  background-size: 12px 12px, auto, auto, auto;
  border-radius: 0 0 1rem 1rem;
}
.preview-cards { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .preview-cards { grid-template-columns: repeat(3, 1fr); } }
.p-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  background: rgba(90, 0, 72, 0.35);
  transition: transform 0.15s;
}
.p-card:hover { transform: scale(1.02); border-color: var(--qr-rose); }
.p-card canvas { display: block; margin: 0 auto 0.5rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); border-radius: 8px; }
.p-card .t { font-size: 12px; font-weight: 700; }
.p-card .s { font-size: 10px; color: var(--muted-dim); }
.specs-editor-block { margin-top: 1rem; }

.file-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  background: rgba(90, 0, 72, 0.4);
}
.file-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.file-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 84, 130, 0.2);
  color: var(--qr-rose-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-name { font-size: 14px; font-weight: 600; word-break: break-all; }
.file-sub { font-size: 12px; color: var(--muted-dim); }
.btn-secondary {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-brand);
}
.btn-secondary:hover { background: rgba(146, 233, 255, 0.1); color: var(--fg); }
label.lbl { display: block; font-size: 12px; color: var(--muted-dim); margin-bottom: 0.5rem; font-weight: 600; }
.lbl-small { font-size: 10px; color: var(--muted-dim); margin-top: 4px; }
.scale-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.scale-row input[type="range"] { flex: 1; accent-color: var(--qr-rose); }
.scale-row input[type="number"] {
  width: 4rem;
  padding: 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}
.pct-muted { font-size: 12px; color: var(--muted-dim); }
.lbl-muted { margin: 0 0 0.35rem; opacity: 0.85; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.swatches-art { margin-top: 0; }
.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  padding: 0;
}
.swatch.on { border-color: var(--qr-cyan); box-shadow: 0 0 0 2px rgba(146, 233, 255, 0.45); }
.color-row { display: flex; gap: 0.5rem; align-items: center; }
.color-row input[type="color"] { width: 48px; height: 36px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.color-row input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}
.btn-export {
  width: 100%;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 1rem;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: var(--font-brand);
  background: linear-gradient(145deg, var(--qr-rose), #cc2954);
  box-shadow: 0 8px 28px rgba(255, 84, 130, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}
.btn-export:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-export .shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.status-line { text-align: center; font-size: 12px; color: var(--muted-dim); margin-top: 0.75rem; min-height: 1em; }
.status-line--error {
  color: #ffb3c9 !important;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 84, 130, 0.12);
  border: 1px solid rgba(255, 84, 130, 0.45);
}

.export-panel {
  max-width: 42rem;
  margin: 0 auto 2rem;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}
.load-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #ff5482;
  animation: load-spin 0.9s linear infinite;
}
@keyframes load-spin {
  to { transform: rotate(360deg); }
}
.load-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
}
.load-msg {
  font-size: 0.9rem;
  color: var(--muted-dim);
  margin-bottom: 1.25rem;
  min-height: 1.35em;
}
.load-msg-done { margin-bottom: 1.5rem; }
.load-bar-wrap {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  max-width: 20rem;
  margin: 0 auto 0.5rem;
}
.load-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5482, #92e9ff);
  transition: width 0.35s ease-out;
}
.load-pct { margin-top: 0; margin-bottom: 0; }
.load-done-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(146, 233, 255, 0.12);
  color: var(--qr-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}
.load-err-title { color: var(--qr-rose-light); }
.btn-export-back { margin-top: 0.5rem; }

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  margin-top: auto;
  background: rgba(0, 0, 0, 0.2);
}
.footer-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-dim);
  text-align: center;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: center; text-align: center; }
}
.footer-brand { color: var(--qr-cyan-light); }
.footer-tour-link {
  background: none;
  border: none;
  color: var(--qr-cyan);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem 0;
}
.footer-tour-link:hover { color: var(--qr-cyan-light); }

/* ---------- Onboarding ---------- */
body.onboarding-open {
  overflow: hidden !important;
}
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  pointer-events: none;
}
.onboarding-overlay.active {
  display: block;
  pointer-events: auto;
}
.onboarding-backdrop {
  position: fixed;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: auto;
  transition: opacity 0.2s;
}
.onboarding-overlay.active .onboarding-backdrop {
  animation: onboarding-fade-in 0.25s ease-out;
}
.onboarding-backdrop-top { top: 0; left: 0; right: 0; height: 0; }
.onboarding-backdrop-left { top: 0; left: 0; width: 0; height: 0; }
.onboarding-backdrop-right { top: 0; left: 0; width: 0; height: 0; }
.onboarding-backdrop-bottom { top: 0; left: 0; right: 0; height: 0; }
@keyframes onboarding-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.onboarding-highlight-ring {
  position: fixed;
  pointer-events: none;
  border: 3px solid rgba(255, 84, 130, 0.95);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s;
}
.onboarding-overlay.active .onboarding-highlight-ring.visible {
  opacity: 1;
}
.onboarding-popup {
  position: fixed;
  z-index: 10001;
  min-width: 280px;
  max-width: 360px;
  padding: 1.25rem 1.35rem;
  background: var(--bg, #1a0d14);
  border: 1px solid rgba(255, 84, 130, 0.4);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-family: var(--font-sans);
  transition: opacity 0.2s, transform 0.2s;
}
.onboarding-popup::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--bg, #1a0d14);
  border-left: 1px solid rgba(255, 84, 130, 0.4);
  border-bottom: 1px solid rgba(255, 84, 130, 0.4);
  transform: rotate(-45deg);
}
.onboarding-popup.arrow-top::before {
  top: -8px;
  left: 50%;
  margin-left: -7px;
  transform: rotate(-45deg);
}
.onboarding-popup.arrow-bottom::before {
  bottom: -8px;
  left: 50%;
  margin-left: -7px;
  top: auto;
  transform: rotate(135deg);
}
.onboarding-popup.arrow-left::before {
  left: -8px;
  top: 50%;
  margin-top: -7px;
  transform: rotate(-135deg);
}
.onboarding-popup.arrow-right::before {
  right: -8px;
  left: auto;
  top: 50%;
  margin-top: -7px;
  transform: rotate(45deg);
}

.onboarding-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.onboarding-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  flex: 1;
  min-width: 0;
}
.onboarding-step-indicator {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 84, 130, 0.35);
  border-radius: 6px;
  border: 1px solid rgba(255, 84, 130, 0.5);
}
.onboarding-body {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted-dim);
}
.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.onboarding-nav {
  display: flex;
  gap: 0.5rem;
}
.onboarding-btn {
  padding: 0.45rem 0.85rem;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.onboarding-skip {
  background: transparent;
  color: var(--muted-dim);
}
.onboarding-skip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.onboarding-prev {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
}
.onboarding-prev:hover {
  background: rgba(255, 255, 255, 0.15);
}
.onboarding-next {
  background: #ff5482;
  color: #fff;
}
.onboarding-next:hover {
  background: #e54570;
}
