:root {
  --bg: #ebe5d6;
  --bg-2: #ddd4bf;
  --paper: #f5f1e8;
  --paper-2: #ece6d4;
  --ink: #1a1814;
  --ink-2: #3a342a;
  --ink-3: #6b6356;
  --rule: #c8bfa8;
  --accent: #b8442a;
  --accent-2: #8a3520;
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.4) 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(0,0,0,0.04) 0%, transparent 50%);
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

button:disabled { cursor: not-allowed; opacity: 0.5; }

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─────────────── HEADER ─────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  position: relative;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--ink);
}

.brand {
  display: flex;
  align-items: stretch;
  gap: 14px;
}
.brand-meta { display: flex; flex-direction: column; justify-content: center; }
.brand-mark {
  display: flex;
  align-self: stretch;
  gap: 5px;
}
.brand-mark span {
  width: 7px;
  background: var(--accent);
}
.brand-name {
  font-family: "Special Elite", monospace;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--ink);
}
.brand-tag {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-top: 2px;
}

.topbar-meta {
  display: flex;
  gap: 0;
  border: 1px solid var(--ink);
}
.meta-cell {
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 6px 12px;
  border-right: 1px solid var(--ink);
  background: var(--paper-2);
}
.meta-cell:last-child { border-right: none; }

.photo-status { display: inline-flex; align-items: center; gap: 6px; cursor: help; }
.photo-status .status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-3);
  border: 1px solid var(--ink);
}
.photo-status.all .status-dot  { background: #3d6e3d; }
.photo-status.some .status-dot { background: #d97706; }
.photo-status.none .status-dot { background: var(--ink-3); }

.meta-toggle {
  font-family: "Special Elite", monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 6px 12px;
  border-right: 1px solid var(--ink) !important;
  background: var(--paper-2);
  border: none;
  border-left: 1px solid var(--ink);
  cursor: pointer;
}
.meta-toggle:hover { background: var(--paper); }
.meta-toggle.off { background: var(--ink); color: var(--paper); }

/* photo-mockup overlay */
.photo-mockup {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-mockup-img {
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.photo-mockup-overlay {
  position: absolute;
  pointer-events: none;
}
.mockup-mode-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: "Special Elite", monospace;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 3px 8px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.mockup-wrap { position: relative; }

/* photo-ready dot on swatches */
.tee-swatch .photo-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
}

/* ─────────────── WORKSPACE ─────────────── */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr) minmax(0, 280px);
  overflow: hidden;
  min-height: 0;
}

.panel {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.panel-left  { border-right: 1px solid var(--ink); }
.panel-right { border-left:  1px solid var(--ink); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
  font-family: "Special Elite", monospace;
  letter-spacing: 2px;
  font-size: 11px;
}
.panel-title { color: var(--ink); }
.panel-count {
  font-family: "Courier Prime", monospace;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--paper);
  padding: 2px 8px;
  border: 1px solid var(--rule);
}

/* ─────────────── PHRASES ─────────────── */
.cat-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  flex-shrink: 0;
}
.cat-tab {
  padding: 7px 4px;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--ink-3);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-transform: uppercase;
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-tab:hover { color: var(--ink); background: var(--paper-2); }
.cat-tab.active {
  background: var(--ink);
  color: var(--paper);
}

.phrase-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.phrase-list::-webkit-scrollbar { width: 8px; }
.phrase-list::-webkit-scrollbar-thumb { background: var(--rule); }

.phrase-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  text-align: left;
  border-bottom: 1px dashed var(--rule);
  transition: background 0.12s;
}
.phrase-item:hover { background: var(--paper-2); }
.phrase-item.active {
  background: var(--ink);
  color: var(--paper);
}
.phrase-item.active .phrase-num { color: var(--paper); opacity: 0.6; }

.phrase-num {
  font-size: 10px;
  color: var(--ink-3);
  min-width: 22px;
}
.phrase-text {
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  flex: 1;
  line-height: 1.3;
}

.custom-input {
  border-top: 1px solid var(--ink);
  padding: 12px 16px;
  background: var(--paper-2);
}
.input-label {
  display: block;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.text-input {
  width: 100%;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
  letter-spacing: 0.5px;
}
.text-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ─────────────── STAGE ─────────────── */
.stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 23px,
      rgba(0,0,0,0.03) 23px,
      rgba(0,0,0,0.03) 24px
    );
}

.stage-tabs {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
  font-size: 10px;
  letter-spacing: 2px;
}
.stage-tab {
  font-family: "Special Elite", monospace;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--paper);
  margin-right: 8px;
}
.stage-spacer { flex: 1; }
.stage-meta { color: var(--ink-3); }

.stage-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  overflow: auto;
  min-height: 0;
  min-width: 0;
}
@media (max-width: 1280px) {
  .stage-grid { grid-template-columns: minmax(0, 1fr); }
}

.preview-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--ink);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.preview-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
}
.card-label {
  font-family: "Special Elite", monospace;
  font-size: 11px;
  letter-spacing: 2px;
}
.card-meta {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink-3);
}

.mockup-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 480px;
  min-width: 0;
}
.tee-svg {
  width: auto;
  height: 100%;
  max-height: 460px;
  max-width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
}

.blank-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 12px;
  flex-wrap: wrap;
  background: var(--paper-2);
  border-bottom: 2px solid var(--ink);
}
.blank-row-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  padding-right: 4px;
}
.blank-pill {
  flex: 1 1 220px;
  min-width: 180px;
  background: var(--paper) !important;
  border: 1.5px solid var(--ink) !important;
  padding: 10px 14px !important;
  text-align: left;
  cursor: pointer;
  font-family: var(--mono);
  display: flex !important;
  flex-direction: column !important;
  gap: 3px;
  transition: background 0.12s, transform 0.08s;
}
.blank-pill:hover { background: var(--paper-2); }
.blank-pill.active { background: var(--ink); color: var(--paper); }
.blank-pill-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.blank-pill-sub { font-size: 9px; opacity: 0.7; letter-spacing: 0.04em; }

.tee-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--ink);
}
.tee-swatch {
  flex: 1 1 12.5%;
  min-width: 28px;
  height: 32px;
  border-right: 1px solid var(--ink);
  position: relative;
  transition: transform 0.12s;
}
.tee-swatch:last-child { border-right: none; }
.tee-swatch:hover { transform: scaleY(1.15); z-index: 1; }
.tee-swatch.active::after {
  content: "▲";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%) translateY(50%);
  color: var(--accent);
  font-size: 10px;
}

.print-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 0;
  min-width: 0;
  background: var(--paper);
  overflow: hidden;
}
.print-canvas {
  border: 1px solid var(--ink-3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
}
.print-canvas > * { max-width: 100%; max-height: 100%; }

/* ─────────────── EXPORT BAR ─────────────── */
.export-bar {
  display: flex;
  gap: 0;
  padding: 12px 24px;
  border-top: 1px solid var(--ink);
  background: var(--paper);
}
.btn {
  flex: 1;
  padding: 12px 16px;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: 2px;
  border: 1px solid var(--ink);
  transition: all 0.12s;
}
.btn + .btn { margin-left: -1px; }
.btn-ghost {
  background: var(--paper);
  color: var(--ink);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--paper-2);
}
.btn-push {
  background: var(--accent);
  border-color: var(--accent) !important;
  color: var(--paper);
}
.btn-push:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink) !important;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

/* ─────────────── RIGHT PANEL ─────────────── */
.panel-right {
  overflow-y: auto;
}

.section {
  border-bottom: 1px solid var(--rule);
}
.section-head {
  font-family: "Special Elite", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 10px 16px 6px;
  color: var(--ink-3);
  background: var(--paper-2);
  border-bottom: 1px dashed var(--rule);
}
.section-body {
  padding: 12px 16px;
}

.grid-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.opt-btn {
  padding: 8px 6px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.12s;
  font-family: "Courier Prime", monospace;
}
.opt-btn:hover { background: var(--paper-2); border-color: var(--ink); }
.opt-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.opt-btn.font-btn {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: none;
}

.slider-row {
  margin-bottom: 12px;
}
.slider-row:last-child { margin-bottom: 0; }
.slider-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 1.5px;
}
.slider-label { color: var(--ink-3); }
.slider-val   { color: var(--ink); font-family: "Courier Prime", monospace; }

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 32px;            /* bigger hit target */
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--rule);
  border: 1px solid var(--ink);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--rule);
  border: 1px solid var(--ink);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;             /* much bigger thumb */
  height: 24px;
  background: var(--ink);
  border-radius: 0;
  margin-top: -11px;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink), 1px 1px 0 var(--ink);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--ink);
  border-radius: 0;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink), 1px 1px 0 var(--ink);
  cursor: pointer;
}

/* Stepper — − / range / + with big tap targets */
.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stepper input[type="range"] { flex: 1; min-width: 0; }
.stepper-btn {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  font-family: "Special Elite", monospace;
  font-size: 22px;
  line-height: 1;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.stepper-btn:hover { background: var(--paper); }
.stepper-btn:active { transform: translate(1px, 1px); }

.ink-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.ink-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: transform 0.12s;
}
.ink-swatch:hover { transform: scale(1.1); }
.ink-swatch.active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ink-picker {
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  background: none;
  cursor: pointer;
  padding: 0;
}

.footer-note {
  padding: 14px 16px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-3);
  line-height: 1.6;
  text-align: center;
  background: var(--paper-2);
}

/* ─────────────── TOAST ─────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--accent);
  z-index: 1000;
  animation: toast-in 0.3s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─────────────── MOBILE / TABLET ─────────────── */
@media (max-width: 900px) {
  /* Allow the app to scroll vertically — desktop locks to viewport height */
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .workspace { grid-template-columns: 1fr; overflow: visible; }
  .panel-left, .panel-right { border-left: none; border-right: none; border-top: 1px solid var(--ink); }

  /* Header — stack brand + meta vertically, smaller fonts */
  .topbar { flex-direction: column; align-items: flex-start; padding: 12px 14px; gap: 10px; }
  .topbar::after { display: none; }
  .topbar-meta { flex-wrap: wrap; max-width: 100%; }
  .meta-cell, .meta-toggle { font-size: 9px; padding: 5px 8px; letter-spacing: 1px; }
  .brand-mark { font-size: 18px; }
  .brand-name { font-size: 16px; letter-spacing: 1.5px; }
  .brand-tag { font-size: 9px; }

  /* Phrase library — fixed height list so it doesn't dominate */
  .panel-left { max-height: 360px; }
  .cat-tabs { grid-template-columns: repeat(2, 1fr); }
  .cat-tab { font-size: 10px; padding: 8px 6px; }
  .phrase-item { padding: 10px 14px; }
  .phrase-text { font-size: 13px; }

  /* Stage — single-column preview cards */
  .stage-grid { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .stage-tabs { padding: 8px 14px; font-size: 9px; }
  .preview-card { min-width: 0; max-width: 100%; }
  .mockup-wrap { min-height: 320px; max-height: 70vh; padding: 12px; overflow: hidden; }
  .mockup-wrap svg { max-width: 100%; max-height: 100%; }
  .mockup-wrap .photo-mockup, .mockup-wrap .photo-mockup-img { max-height: 60vh; }
  .blank-row { gap: 6px; padding: 10px; }
  .blank-row-label { font-size: 9px; }
  .blank-pill { flex: 1 1 100%; min-width: 0; padding: 8px 12px !important; }
  .blank-pill-label { font-size: 10px; }
  .blank-pill-sub { font-size: 8px; }
  .tee-swatch { height: 30px; min-width: 24px; flex: 1 1 12.5%; }
  .print-wrap { min-height: 0; padding: 12px; }

  /* Right-side controls panel */
  .panel-right { padding-bottom: 80px; }  /* room above sticky cart button */
  .section-body { padding: 10px 14px; }
  .grid-options { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .opt-btn { padding: 10px 6px; font-size: 11px; }

  /* Export bar — sticky at bottom on mobile, full-width buttons */
  .export-bar {
    position: sticky; bottom: 0; z-index: 50;
    flex-wrap: wrap; gap: 6px; padding: 10px 12px;
    background: var(--paper);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  }
  .export-bar .btn {
    flex: 1 1 calc(50% - 6px);
    margin-left: 0 !important;
    font-size: 11px;
    letter-spacing: 1.5px;
    padding: 12px 8px;
  }
  .export-bar .btn.btn-push {
    flex: 1 1 100%;
    font-size: 13px !important;
    letter-spacing: 2px !important;
    padding: 14px 12px !important;
  }
}

@media (max-width: 540px) {
  /* On tight phones, brand and meta stack tighter */
  .brand-name { font-size: 14px; letter-spacing: 1px; }
  .topbar-meta { gap: 4px; width: 100%; }
  .meta-cell, .meta-toggle { font-size: 8px; padding: 4px 7px; }
  .stage-grid { padding: 10px; gap: 12px; }
  .preview-card-head { padding: 6px 10px; }
  .card-label { font-size: 10px; letter-spacing: 1.5px; }
  .card-meta { font-size: 9px; letter-spacing: 1px; }
  .phrase-list { max-height: 240px; }
}

/* ═══════════════════════════════════════════════════════════════════
   CUSTOMER WIZARD (.cw) — clean dedicated UI for /pages/custom-no-cap
   Renders ONLY when ?customer=1 is in the URL.
   ═══════════════════════════════════════════════════════════════════ */

.cw {
  background: var(--bg);
  color: var(--ink);
  font-family: "Courier Prime", monospace;
  min-height: 100vh;
  padding-bottom: 100px;
  background-image: repeating-linear-gradient(
    0deg, transparent 0, transparent 23px,
    rgba(0,0,0,0.025) 23px, rgba(0,0,0,0.025) 24px);
}

/* sticky preview at top */
.cw-preview {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, #f4efe6 0%, #e6dfd1 100%);
  border-bottom: 2px solid var(--ink);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  max-height: 56vh;
}
.cw-preview > div:not(.cw-quality) {
  width: 100%;
  height: 100%;
  max-width: 380px;
  max-height: 50vh;
}
.cw-preview svg {
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: 0 auto;
}

/* step dots */
.cw-steps {
  display: flex;
  gap: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  padding: 14px 12px;
  position: sticky;
  top: 0;          /* override desktop where preview is bigger; stays stuck under preview */
  z-index: 4;
}
.cw-step {
  flex: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
.cw-step::after {
  content: "";
  position: absolute;
  top: 14px; left: calc(50% + 14px); right: calc(-50% + 14px);
  height: 2px;
  background: var(--rule);
  z-index: 0;
}
.cw-step:last-child::after { display: none; }
.cw-step.done::after { background: var(--accent); }
.cw-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: var(--paper);
  font-family: "Special Elite", monospace;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  font-weight: 700;
}
.cw-step.done .cw-step-num { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.cw-step.active .cw-step-num { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: scale(1.15); }
.cw-step-label {
  font-family: "Special Elite", monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--ink-3);
  text-transform: uppercase;
}
.cw-step.active .cw-step-label { color: var(--ink); font-weight: 700; }

/* content card */
.cw-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
}
.cw-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 20px;
}
.cw-h2 {
  font-family: "Special Elite", monospace;
  font-size: 22px;
  letter-spacing: 1.5px;
  margin: 0 0 16px;
  text-align: center;
  text-transform: uppercase;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 14px;
}
.cw-label {
  display: block;
  font-family: "Special Elite", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 16px 0 6px;
}

/* style tiles (step 1) */
.cw-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cw-tile {
  background: var(--paper);
  border: 2px solid var(--ink);
  cursor: pointer;
  padding: 16px 12px;
  text-align: left;
  font-family: "Courier Prime", monospace;
  transition: transform 0.1s, background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cw-tile:hover { background: var(--paper-2); }
.cw-tile.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--accent);
  box-shadow: 4px 4px 0 var(--accent);
  transform: translate(-2px, -2px);
}
.cw-tile-label {
  font-family: "Special Elite", monospace;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}
.cw-tile-sub {
  font-size: 11px;
  letter-spacing: 0.5px;
  opacity: 0.75;
}

/* color tiles (step 2) */
.cw-colors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cw-color {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--ink);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.1s;
  box-shadow: 2px 2px 0 var(--ink);
}
.cw-color:hover { transform: translate(-1px, -1px); }
.cw-color.active {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.cw-color.active::after {
  content: "✓";
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: "Special Elite", monospace;
  font-size: 28px;
  color: #fff;
  text-shadow: 0 0 4px rgba(0,0,0,0.9), 1px 1px 0 rgba(0,0,0,0.7);
}
.cw-color-name {
  font-family: "Special Elite", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 2px 5px;
  margin-bottom: 4px;
}

/* design step */
.cw-textarea {
  width: 100%;
  font-family: "Special Elite", monospace;
  font-size: 16px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  resize: vertical;
  letter-spacing: 0.5px;
  box-sizing: border-box;
}
.cw-textarea:focus { outline: 3px solid var(--accent); outline-offset: -3px; }
.cw-file {
  width: 100%;
  font-family: "Courier Prime", monospace;
  font-size: 13px;
  padding: 10px;
  border: 2px dashed var(--ink);
  background: var(--paper-2);
}
.cw-divider {
  text-align: center;
  font-family: "Special Elite", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ink-3);
  margin: 16px 0;
}

/* generic pill */
.cw-pill {
  background: var(--paper-2);
  border: 2px solid var(--ink);
  cursor: pointer;
  padding: 12px 14px;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  flex: 1;
  min-width: 0;
}
.cw-pill:hover { background: var(--paper); }
.cw-pill.active { background: var(--ink); color: var(--paper); border-color: var(--accent); }
.cw-row { display: flex; gap: 6px; margin-top: 10px; }
.cw-row-wrap { flex-wrap: wrap; }
.cw-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ink swatches */
.cw-ink {
  width: 44px; height: 44px;
  border: 2px solid var(--ink);
  cursor: pointer;
  flex: 0 0 44px;
  padding: 0;
  box-shadow: 2px 2px 0 var(--ink);
}
.cw-ink:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.cw-ink.active { outline: 3px solid var(--accent); outline-offset: 2px; }
.cw-ink-picker { padding: 0; }

/* size buttons */
.cw-sizes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.cw-size {
  background: var(--paper);
  border: 2px solid var(--ink);
  cursor: pointer;
  padding: 18px 0;
  font-family: "Special Elite", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}
.cw-size.active {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--accent);
}

.cw-summary {
  margin-top: 20px;
  padding: 14px;
  background: var(--paper-2);
  border: 1px dashed var(--rule);
  font-size: 13px;
  display: grid;
  gap: 8px;
}
.cw-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.cw-summary .cw-label { margin: 0; }

/* stepper inside step 4 */
.cw-stepper {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-2); border: 2px solid var(--ink);
  padding: 4px;
}
.cw-stepper-btn {
  flex: 0 0 44px; width: 44px; height: 44px;
  font-size: 22px; font-weight: 700;
  background: var(--paper); border: 1px solid var(--ink);
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.cw-stepper-btn:hover { background: var(--ink); color: var(--paper); }
.cw-stepper-val {
  flex: 1; text-align: center;
  font-family: "Special Elite", monospace;
  font-size: 18px; letter-spacing: 1px;
}
.cw-stepper-stack { display: grid; gap: 8px; }

/* generic buttons */
.cw-btn {
  background: var(--paper);
  border: 2px solid var(--ink);
  cursor: pointer;
  padding: 14px 20px;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  width: 100%;
  margin-top: 12px;
  box-sizing: border-box;
}
.cw-btn-primary { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--accent); }
.cw-btn-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); box-shadow: 4px 4px 0 var(--ink); }
.cw-btn-accent { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.cw-btn-ghost { background: var(--paper); }
.cw-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* nav bar — fixed at the bottom */
.cw-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  gap: 0;
  padding: 12px 16px;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  box-shadow: 0 -6px 16px rgba(0,0,0,0.10);
}
.cw-nav .cw-btn { margin: 0; width: auto; flex: 1 1 0; min-width: 0; }
.cw-nav .cw-btn + .cw-btn { margin-left: -2px; }
.cw-nav .cw-btn-primary { flex: 2 1 0; }              /* primary button is twice as wide as BACK */
.cw-nav .cw-btn-cart { font-size: 15px; padding: 16px 20px; white-space: nowrap; }
.cw-nav .cw-btn-checkout { font-size: 15px; padding: 16px 20px; white-space: nowrap; background: var(--accent); color: var(--paper); border-color: var(--accent); }
.cw-nav .cw-btn-checkout:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); }

/* Category pill row for the Random Saying picker (Step 3) */
.cw-cat-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 6px 0 12px;
  max-height: 180px; overflow-y: auto;
  padding: 8px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
}
.cw-cat-pill {
  background: var(--paper);
  border: 2px solid var(--ink);
  font-family: "Special Elite", monospace;
  font-size: 11px; letter-spacing: 1px;
  padding: 6px 10px;
  cursor: pointer;
  text-transform: uppercase;
}
.cw-cat-pill:hover { background: var(--paper-2); }
.cw-cat-pill.active { background: var(--ink); color: var(--paper); }

/* Print-quality badge — overlaid on the preview */
.cw-quality {
  position: absolute;
  top: 10px; right: 10px;
  font-family: "Special Elite", monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  background: #cdebc2;       /* default green for OK */
  color: var(--ink);
  text-transform: uppercase;
  z-index: 5;
  box-shadow: 2px 2px 0 var(--ink);
}
.cw-quality-ok   { background: #cdebc2; }
.cw-quality-mid  { background: #fff0a8; }
.cw-quality-warn { background: #ffd1a8; }
/* .cw-preview already has position: sticky which acts as a containing block for the absolute badge */

@media (min-width: 720px) {
  .cw-tiles { grid-template-columns: repeat(5, 1fr); }
  .cw-colors { grid-template-columns: repeat(8, 1fr); }
  .cw-preview { min-height: 400px; max-height: 50vh; }
  .cw-content { padding: 28px 24px; }
}

/* ─────────────── WIZARD UI ─────────────── */
.wizard-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  padding: 14px 16px 10px;
}
.wizard-steps {
  display: flex;
  gap: 4px;
  max-width: 760px;
  margin: 0 auto;
}
.wizard-dot {
  flex: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  position: relative;
}
.wizard-dot::after {
  content: "";
  position: absolute;
  top: 14px; left: calc(50% + 14px); right: calc(-50% + 14px);
  height: 2px;
  background: var(--rule);
  z-index: 0;
}
.wizard-dot:last-child::after { display: none; }
.wizard-dot.done::after { background: var(--accent); }
.wizard-dot-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: var(--paper);
  font-family: "Special Elite", monospace;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.wizard-dot.done .wizard-dot-num { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.wizard-dot.active .wizard-dot-num { border-color: var(--ink); background: var(--ink); color: var(--paper); transform: scale(1.1); }
.wizard-dot-label {
  font-family: "Special Elite", monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--ink-3);
}
.wizard-dot.active .wizard-dot-label { color: var(--ink); }

/* Wizard step gating — hide everything not on the current step.
   Sections without data-wstep are always visible (preview, etc.). */
body.customer-mode [data-wstep] { display: none !important; }
body.customer-mode.step-1 [data-wstep="1"] { display: flex !important; }
body.customer-mode.step-2 [data-wstep="2"] { display: flex !important; }
body.customer-mode.step-3 [data-wstep="3"] { display: block !important; }
body.customer-mode.step-4 [data-wstep="4"] { display: block !important; }
body.customer-mode.step-5 [data-wstep="5"] { display: block !important; }
/* Step 4 sections wrap, Section is .section { display:block } so override carefully */

/* ─────────────── CUSTOMER MODE — applies on ALL viewports ─────────────── */
/* Strip the admin chrome and use a single-column "phone-style" layout
   even on desktop, since customers don't need the phrase library or
   admin diagnostics. */
body.customer-mode .topbar,
body.customer-mode .topbar-meta,
body.customer-mode .photo-status,
body.customer-mode .meta-toggle,
body.customer-mode .mockup-mode-badge,
body.customer-mode .panel-left .panel-head,
body.customer-mode .panel-left .cat-tabs,
body.customer-mode .panel-left .phrase-list,
body.customer-mode .panel-right .panel-head,
body.customer-mode .stage-tabs,
body.customer-mode .stage-grid > .preview-card:nth-child(2) {
  display: none !important;
}

body.customer-mode .app { height: auto; min-height: 100vh; overflow: visible; display: block; }
body.customer-mode .workspace {
  display: block !important;       /* break out of grid AND flex */
  grid-template-columns: 1fr !important;
  overflow: visible;
  width: 100%;
}
/* Stack everything vertically — phrase input → preview → controls */
body.customer-mode .panel-left  { display: block; width: 100%; max-height: none; border: 0; border-bottom: 1px solid var(--ink); }
body.customer-mode .stage       { display: flex; flex-direction: column; width: 100%; }
body.customer-mode .panel-right { display: block; width: 100%; padding-bottom: 100px; border: 0; border-top: 1px solid var(--ink); overflow: visible; max-width: 760px; margin: 0 auto; }

body.customer-mode .panel        { overflow: visible; }
body.customer-mode .custom-input { padding: 14px 18px; border-top: 0; }
body.customer-mode .stage-grid   { grid-template-columns: 1fr !important; padding: 16px; gap: 16px; max-width: 760px; margin: 0 auto; width: 100%; box-sizing: border-box; }
body.customer-mode .preview-card { border: 1px solid var(--ink); }

/* STICKY PREVIEW — keep the shirt visible while scrolling controls below */
body.customer-mode .stage {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--ink);
}
/* Make the shirt mockup BIG and prominent */
body.customer-mode .mockup-wrap {
  min-height: 360px;
  max-height: 50vh;
  padding: 12px;
  background: linear-gradient(180deg, #f4efe6 0%, #e6dfd1 100%);
}
body.customer-mode .mockup-wrap > div { width: 100%; height: 100%; }
body.customer-mode .tee-svg { max-height: 60vh; max-width: 100%; }

/* Color picker — make it obvious + scrollable */
body.customer-mode .tee-color-row {
  border-top: 1px solid var(--ink);
  background: var(--paper-2);
  padding: 6px;
  gap: 4px;
  flex-wrap: wrap;
}
body.customer-mode .tee-swatch {
  flex: 0 0 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--ink);
  border-radius: 0;
}
body.customer-mode .tee-swatch.active {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Blank picker chips */
body.customer-mode .blank-row { padding: 10px; flex-wrap: wrap; gap: 6px; }
body.customer-mode .blank-row-label { font-size: 10px; }
body.customer-mode .blank-pill { flex: 1 1 140px; padding: 8px 12px !important; }

/* Sticky ADD TO CART always at bottom */
body.customer-mode .export-bar {
  position: sticky;
  bottom: 0;
  z-index: 100;
  border-top: 2px solid var(--ink);
  background: var(--paper);
  padding: 12px 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
body.customer-mode .export-bar .btn { font-size: 14px; padding: 16px; letter-spacing: 2px; }

/* ─────────────── CUSTOMER MODE — MOBILE-FIRST SIMPLIFICATION ─────────────── */
/* Activated when ?customer=1 is in URL (body.customer-mode class set by JS). */
@media (max-width: 760px) {
  body.customer-mode .topbar { padding: 8px 12px; gap: 6px; }
  body.customer-mode .topbar-meta { display: none; }    /* hide admin photo-status etc */
  body.customer-mode .brand-tag  { display: none; }
  body.customer-mode .brand-name { font-size: 14px; letter-spacing: 1px; }

  /* CUSTOMER MOBILE: hide the phrase list/category tabs (overwhelming on small
     screens) but KEEP the custom-text input + random-saying button visible. */
  body.customer-mode .panel-left .panel-head,
  body.customer-mode .panel-left .cat-tabs,
  body.customer-mode .panel-left .phrase-list { display: none; }
  body.customer-mode .panel-left { max-height: none; border-top: 0; }
  body.customer-mode .workspace  { grid-template-columns: 1fr; }
  /* Move custom-input section ABOVE the preview using flex order */
  body.customer-mode .workspace { display: flex; flex-direction: column; }
  body.customer-mode .panel-left  { order: 1; }   /* custom text + random first */
  body.customer-mode .stage       { order: 2; }   /* big shirt preview */
  body.customer-mode .panel-right { order: 3; }   /* controls below */
  body.customer-mode .custom-input {
    border-top: 0;
    padding: 12px 14px;
  }
  body.customer-mode .custom-input .input-label { font-size: 10px; }

  /* Preview gets MAJORITY of screen real estate */
  body.customer-mode .stage-grid {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }
  /* Hide the print-area card on mobile customer view — only show the shirt mockup */
  body.customer-mode .stage-grid > .preview-card:nth-child(2) { display: none; }

  body.customer-mode .preview-card { border: 0; }
  body.customer-mode .preview-card-head {
    background: var(--paper);
    padding: 8px 14px;
    border-bottom: 1px dashed var(--rule);
  }

  body.customer-mode .mockup-wrap {
    min-height: 56vh;
    max-height: 60vh;
    padding: 8px;
  }
  body.customer-mode .blank-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    gap: 6px;
  }
  body.customer-mode .blank-row-label { display: none; }
  body.customer-mode .blank-pill {
    flex: 0 0 auto !important;
    min-width: 130px !important;
    padding: 8px 12px !important;
  }
  body.customer-mode .blank-pill-label { font-size: 10px; }
  body.customer-mode .blank-pill-sub   { font-size: 8px; }

  body.customer-mode .tee-color-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  body.customer-mode .tee-swatch {
    flex: 0 0 36px;
    min-width: 36px;
    height: 36px;
  }

  /* The right-controls panel becomes a vertical stack of compact rows */
  body.customer-mode .panel-right {
    overflow-y: visible;
    padding-bottom: 90px;
  }
  body.customer-mode .panel-right .panel-head { display: none; }
  body.customer-mode .section { border-bottom: 1px dashed var(--rule); }
  body.customer-mode .section-head { font-size: 9px; padding: 8px 14px 4px; letter-spacing: 1.5px; }
  body.customer-mode .section-body { padding: 8px 14px; }
  body.customer-mode .grid-options { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  body.customer-mode .opt-btn { padding: 8px 4px; font-size: 10px; letter-spacing: 1px; }

  /* Slider rows tighter */
  body.customer-mode .slider-row { margin-bottom: 8px; }
  body.customer-mode .slider-meta { font-size: 9px; }

  body.customer-mode .ink-row { gap: 6px; }
  body.customer-mode .ink-swatch, body.customer-mode .ink-picker {
    width: 32px; height: 32px;
  }

  body.customer-mode .custom-input {
    padding: 12px 14px;
    background: var(--paper);
  }

  /* Sticky ADD TO CART always visible at bottom on mobile */
  body.customer-mode .export-bar {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    z-index: 100;
    padding: 10px 12px;
    background: var(--paper);
    border-top: 2px solid var(--ink);
    box-shadow: 0 -6px 20px rgba(0,0,0,0.12);
  }
}
