:root {
  --ink: #090909;
  --paper: #fffaf0;
  --panel: #ffffff;
  --line: #090909;
  --yellow: #ffd21f;
  --red: #f04438;
  --blue: #18bfe8;
  --green: #24c06a;
  --shadow: 8px 8px 0 #090909;
  --radius: 10px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input { font: inherit; }

button { cursor: pointer; }

.editor {
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.topbar {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 4px solid var(--line);
  position: relative;
  z-index: 5;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-bolt {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 3px solid var(--line);
  background: var(--yellow);
  clip-path: polygon(42% 0, 88% 0, 60% 38%, 92% 38%, 30% 100%, 46% 56%, 12% 56%);
}

h1,
h2,
h3,
p { margin: 0; }

h1 {
  font-size: clamp(24px, 3vw, 42px);
  line-height: .94;
  letter-spacing: 0;
}

h2 { font-size: 18px; line-height: 1.12; }

h3 { font-size: 17px; line-height: 1.15; }

.kicker {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted-copy, #4a4a4a);
}

.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.step,
.chip,
.pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.step.is-active,
.chip.is-ready { background: var(--yellow); }

.status-chip {
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 8px 12px;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--line);
}

.status-chip span:first-child {
  font-size: 11px;
  font-weight: 950;
  color: var(--accent-copy, var(--red));
}

.status-chip strong {
  font-size: 14px;
  line-height: 1.1;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 350px;
  gap: 16px;
  padding: 16px;
  min-height: 0;
  isolation: isolate;
}

.panel,
.canvas,
.bottom-mobile,
.dialog,
.toast {
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
  overflow: auto;
}

.left-panel {
  position: relative;
  z-index: 8;
}

.right-panel {
  position: relative;
  z-index: 12;
  overflow: visible;
}

.section {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}

.section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.right-panel .section:last-child {
  position: sticky;
  bottom: 0;
  margin: 0 -14px -14px;
  padding: 14px;
  border-top: 3px solid var(--line);
  background: var(--panel);
  z-index: 4;
}

.right-panel .order-actions {
  gap: 10px;
}

.right-panel .order-actions.cart-added {
  grid-template-columns: 1fr;
}

.cart-added-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cart-added-actions[hidden] {
  display: none;
}

.cart-added-actions .button.small {
  min-height: 44px;
  padding: 10px 12px;
  font-size: 13px;
}

.cart-added-actions.is-animating {
  animation: cart-added-pop .46s cubic-bezier(.2, 1.15, .25, 1);
}

@keyframes cart-added-pop {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(.94);
  }
  60% {
    opacity: 1;
    transform: translateY(-3px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mobile-order-summary {
  display: none;
}

.label {
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.copy {
  color: var(--muted-copy, #4a4a4a);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.upload-zone {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 11px;
  border: 2px dashed var(--line);
  background: var(--upload-bg, #fff2a6);
}

.upload-zone h2 {
  font-size: 16px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 2px solid var(--line);
  background: var(--button-bg, #fff);
  color: var(--button-color, var(--ink));
  font-weight: 950;
  box-shadow: 4px 4px 0 var(--line);
}

.button.primary {
  background: var(--yellow);
  color: var(--ink);
}

.button.danger {
  background: var(--red);
  color: #fff;
}

.button.dark {
  background: var(--ink);
  color: #fff;
}

.button:disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.segmented,
.mode-toggle,
.choice-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 2px solid var(--line);
}

.print-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 2px solid var(--line);
  background: var(--panel);
}

.segmented button,
.mode-toggle button,
.choice-toggle button,
.print-switch button {
  min-height: 42px;
  border: 0;
  border-right: 2px solid var(--line);
  background: var(--panel);
  font-weight: 950;
  border-radius: 0;
}

.segmented button:last-child,
.mode-toggle button:last-child,
.choice-toggle button:last-child,
.print-switch button:last-child { border-right: 0; }
.segmented button.is-active,
.mode-toggle button.is-active,
.choice-toggle button.is-active,
.print-switch button.is-active { background: var(--yellow); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool,
.option {
  min-height: 48px;
  border: 2px solid var(--line);
  background: var(--panel);
  font-weight: 900;
}

.tool-wide {
  grid-column: 1 / -1;
}

.tool.is-active,
.option.is-active {
  background: var(--yellow);
}

.tool.danger-soft {
  background: #ffecf0;
}

.bg-toggle {
  white-space: nowrap;
}

.bg-toggle.is-active {
  background: var(--yellow);
}

.tool.bg-toggle {
  min-width: 0;
  padding: 0 10px;
  font-size: 13px;
}

.tool[data-action="start-over"] {
  background: var(--red);
  color: #fff;
}

.action-grid .tool[data-action="start-over"] {
  grid-column: 1 / -1;
}

@media (min-width: 781px) {
  .action-grid .tool[data-action="export"] {
    display: none;
  }
}

.node-edit-panel {
  display: grid;
  gap: 8px;
}

.node-edit-panel[hidden] {
  display: none;
}

.node-help {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--line);
  background: #fff6bf;
  font-size: 12px;
  font-weight: 850;
}

.node-help strong {
  font-size: 14px;
}

.node-help-list {
  display: grid;
  gap: 5px;
  list-style: decimal;
  margin: 0;
  padding-left: 18px;
  line-height: 1.45;
}

.node-help-list li::marker {
  font-weight: 1000;
}

.node-help-list li {
  padding-left: 2px;
}

.confirm-node {
  background: var(--yellow);
}

.settings-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.gear-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--line);
  font-weight: 950;
}

.gear-button.bg-toggle {
  width: auto;
  min-width: 104px;
  padding: 0 12px;
  font-size: 12px;
}

.mobile-bg-toggle {
  display: none;
}

.range-row {
  display: grid;
  gap: 7px;
}

.range-row input { accent-color: var(--red); }

.checks {
  display: grid;
  gap: 8px;
}

.check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 13px;
}

.dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--panel);
  font-size: 12px;
  font-weight: 950;
}

.check.is-ready .dot { background: var(--yellow); }

.canvas {
  min-width: 0;
  align-self: start;
  height: calc(100vh - 32px);
  min-height: 680px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: relative;
  z-index: 1;
}

.canvas-head,
.canvas-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 3px solid var(--line);
  background: var(--canvas-head, var(--yellow));
}

.canvas-head {
  position: relative;
}

.canvas-head > div:first-child {
  min-width: 0;
}

.canvas-foot {
  border-top: 3px solid var(--line);
  border-bottom: 0;
  background: var(--canvas-foot, var(--panel));
}

.canvas-foot {
  display: none;
}

.canvas-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 2px solid var(--line);
  background: var(--panel);
}

.mobile-print-switch,
.canvas-side-switch {
  display: none;
}

.canvas-tabs button {
  min-height: 34px;
  min-width: 76px;
  border: 0;
  border-right: 2px solid var(--line);
  background: transparent;
  font-weight: 950;
}

.canvas-tabs button:last-child { border-right: 0; }
.canvas-tabs button.is-active { background: var(--ink); color: #fff; }

.product-menu {
  position: relative;
  z-index: 24;
  flex: 0 0 auto;
}

.product-menu-trigger {
  position: relative;
  width: clamp(190px, 18vw, 246px);
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 38px 0 14px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
  font-size: 16px;
  font-weight: 1000;
  white-space: nowrap;
}

.product-menu-trigger::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  background:
    linear-gradient(90deg, transparent 44%, currentColor 44% 56%, transparent 56%),
    linear-gradient(0deg, transparent 44%, currentColor 44% 56%, transparent 56%),
    var(--yellow);
  box-sizing: border-box;
}

.product-menu-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}

.product-menu-trigger:hover,
.product-menu-trigger[aria-expanded="true"] {
  background: var(--yellow);
  color: var(--ink);
}

.product-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: min(292px, calc(100vw - 32px));
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: 5px 5px 0 var(--line);
  transform: none;
  z-index: 90;
}

.product-menu-panel[hidden] {
  display: none !important;
}

.product-menu-panel button {
  min-width: 0;
  min-height: 68px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 12px 14px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.product-menu-panel button.is-active {
  background: var(--yellow);
}

.product-menu-panel strong {
  font-size: 18px;
  line-height: 1.05;
}

.product-menu-panel span {
  color: var(--muted-copy, #4a4a4a);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
}

.mobile-product-menu {
  display: none;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--stage-bg, #fff);
}

.canvas.has-locked-cutline .stage {
  cursor: grab;
  touch-action: none;
}

.canvas.has-locked-cutline .stage:active {
  cursor: grabbing;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.artboard {
  position: relative;
  width: min(60vh, 506px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  z-index: 2;
  transform: matrix(1, 0, 0, 1, 0, 0);
  transition: none;
  transform-origin: center;
  will-change: transform;
  user-select: none;
}

.canvas.is-canvas-focused .artboard {
  outline: 3px solid var(--yellow);
  outline-offset: 10px;
}

.acrylic-glow,
.design-surface,
.cutline-svg,
.hole,
.sample-cat { position: absolute; }

.acrylic-glow {
  inset: 30px;
  border: 12px solid rgba(255,255,255,.32);
  border-radius: 48% 52% 55% 45%;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.22));
}

.canvas:not(.has-locked-cutline) .cutline-svg,
.canvas:not(.has-locked-cutline) .hole {
  display: none;
}

.design-surface {
  left: 50%;
  top: 50%;
  width: var(--surface-width, 320px);
  height: var(--surface-height, 320px);
  z-index: 3;
  transform: translate(-50%, -50%) rotate(var(--art-rotation, 0deg));
  transform-origin: center;
  transition: transform .12s ease;
}

.artwork-image {
  position: absolute;
  left: var(--art-left, 0);
  top: var(--art-top, 0);
  width: var(--art-width, 100%);
  height: var(--art-height, 100%);
  max-width: none;
  max-height: none;
  object-fit: fill;
  object-position: left top;
  background: transparent;
  transform: scaleX(var(--art-mirror, 1));
  transform-origin: var(--art-origin-x, center) center;
  pointer-events: none;
  user-select: none;
}

.cutline-svg {
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: scaleX(var(--cutline-mirror, 1));
  transform-origin: center;
  z-index: 3;
  pointer-events: none;
}

.cutline-path,
.safe-margin-path {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.cutline-path {
  stroke: var(--red);
  stroke-width: 3;
  stroke-dasharray: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-product-type="standee"] .cutline-path {
  stroke-linecap: butt;
  stroke-linejoin: miter;
}

.safe-margin-path {
  display: none;
}

.hole {
  top: var(--hole-top, 8%);
  left: var(--hole-left, 50%);
  width: var(--hole-outer-size, 30px);
  height: var(--hole-outer-size, 30px);
  padding: 0;
  transform: translate(-50%, -50%) scaleX(var(--cutline-mirror, 1));
  border: 0;
  border-radius: 50%;
  background: transparent;
  z-index: 6;
  cursor: grab;
  touch-action: none;
}

.hole::before,
.hole::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}

.hole::before {
  width: 100%;
  height: 100%;
  border: 2px solid var(--red);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.96);
}

.hole::after {
  width: var(--hole-inner-size, 14px);
  height: var(--hole-inner-size, 14px);
  border: 2px solid var(--red);
  background: rgba(255,255,255,.72);
}

.hole.is-dragging {
  background: rgba(240, 68, 56, .08);
}

.hole.is-dragging::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.hole.is-base-tab {
  width: var(--hole-outer-size, 72px);
  height: var(--hole-inner-size, 18px);
  box-sizing: border-box;
  border: 2px dashed var(--red);
  border-radius: 0;
  background: transparent;
  opacity: 1;
}

.hole.is-base-tab::before,
.hole.is-base-tab::after {
  display: none;
}

.hole.is-base-tab.is-merged:not(.is-dragging) {
  opacity: 0;
}

.hole.is-base-tab.is-dragging {
  background: rgba(240, 68, 56, .08);
}

.hole.is-base-tab.is-dragging::before,
.hole.is-base-tab.is-dragging::after {
  display: none;
}

.hole:active { cursor: grabbing; }

.sample-cat {
  width: 258px;
  height: 284px;
  z-index: 3;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
  display: grid;
  place-items: center;
  transform: rotate(var(--art-rotation, 0deg)) scaleX(var(--art-mirror, 1));
  transition: transform .18s ease;
}

.artboard:not(.has-uploaded-art) .sample-cat {
  cursor: pointer;
}

.artboard:not(.has-uploaded-art) .sample-cat:hover {
  transform: translateY(-4px) rotate(var(--art-rotation, 0deg)) scaleX(var(--art-mirror, 1));
  filter: drop-shadow(0 10px 0 rgba(0,0,0,.18));
}

.artboard.has-uploaded-art .sample-cat {
  display: none;
}

.artboard.is-empty-back .sample-cat {
  opacity: .14;
}

.artboard.has-uploaded-art .mascot-graphic,
.artboard.has-uploaded-art .sample-cat-label {
  display: none;
}

.canvas.is-node-editing .cutline-svg {
  filter: none;
}

.canvas.is-node-editing .cutline-path {
  stroke-dasharray: none;
}

.cut-node {
  position: absolute;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%) scaleX(var(--cutline-mirror, 1));
  z-index: 7;
  cursor: grab;
  touch-action: none;
}

.cut-node::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  transform: translate(-50%, -50%);
}

.cut-node.is-selected::after {
  background: var(--red);
}

.sample-cat-label {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 4;
  min-width: 244px;
  transform: translate(-50%, -70%);
  padding: 11px 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--line);
  font-size: 20px;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.mascot-graphic {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  overflow: visible;
  pointer-events: none;
}

.mobile-replace-button {
  display: none;
}

.mascot-shadow {
  fill: rgba(7, 7, 7, .18);
}

.mascot-body,
.mascot-ear,
.mascot-eye {
  fill: #070707;
}

.mascot-body {
  stroke: #070707;
  stroke-width: 7;
  stroke-linejoin: round;
}

.mascot-face {
  fill: #ffd21f;
  stroke: #070707;
  stroke-width: 6;
  stroke-linejoin: round;
}

.mascot-bolt {
  fill: #ff2f4f;
  stroke: #070707;
  stroke-width: 5;
  stroke-linejoin: round;
}

.mascot-smile,
.mascot-paw {
  fill: none;
  stroke: #070707;
  stroke-width: 6;
  stroke-linecap: round;
}

.callout {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: min(330px, 42%);
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 3px solid var(--line);
  background: var(--callout-bg, var(--yellow));
  box-shadow: 5px 5px 0 var(--line);
  z-index: 3;
}

.callout[hidden] {
  display: none;
}

.callout-close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: 2px 2px 0 var(--line);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
  cursor: pointer;
}

.callout-close:hover,
.callout-close:focus-visible {
  background: var(--red);
  color: #fff;
}

.options {
  display: grid;
  gap: 8px;
}

.option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
}

.config-stack,
.config-field {
  display: grid;
  gap: 8px;
}

.config-field {
  position: relative;
  z-index: 1;
}

.config-field:has(.select-popover.is-open),
.config-field:has(.choice-card:hover),
.config-field:has(.choice-card:focus-visible) {
  z-index: 60;
}

.select-popover {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 2px solid var(--line);
  background: #fff6bf;
  box-shadow: 5px 5px 0 var(--line);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: min(520px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 96px));
  overflow: visible;
  z-index: 70;
}

.select-popover.is-open {
  display: grid;
}

.settings-popover {
  left: 0;
  right: auto;
  width: min(270px, calc(100vw - 32px));
  grid-template-columns: 1fr;
  top: auto;
  bottom: calc(100% + 8px);
}

.catalog-popover {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(690px, calc(100vw - 32px));
}

.size-popover {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.size-popover .detail-preview {
  display: none !important;
}

.material-popover {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(570px, calc(100vw - 32px));
}

.choice-card {
  position: relative;
  min-height: 66px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 9px 10px;
  border: 2px solid var(--line);
  background: var(--panel);
  text-align: left;
  font-weight: 900;
}

.choice-card strong {
  font-size: 14px;
  line-height: 1.05;
}

.choice-card > span:not(.detail-preview) {
  color: var(--muted-copy, #4a4a4a);
  font-size: 11px;
  line-height: 1.2;
}

.choice-card.is-active {
  background: var(--yellow);
}

.choice-card:hover,
.choice-card:focus-visible {
  z-index: 90;
}

.shape-choice {
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
}

.shape-choice .shape-icon {
  grid-row: 1 / span 2;
  width: 42px;
  height: 32px;
  display: grid;
  place-items: center;
}

.shape-icon svg,
.mobile-sheet-shape-icon svg {
  width: 40px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
}

.detail-preview {
  position: absolute;
  right: calc(100% + 16px);
  left: auto;
  top: 50%;
  width: 244px;
  min-height: 138px;
  display: none;
  transform: translateY(-50%);
  padding: 14px;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 8px 8px 0 rgba(255,47,79,.88);
  font-weight: 900;
  pointer-events: auto;
  z-index: 120;
}

.choice-card:nth-child(odd) .detail-preview {
  top: 0;
  transform: none;
}

.choice-card:hover .detail-preview,
.choice-card:focus-visible .detail-preview {
  display: grid;
  align-content: end;
  gap: 8px;
}

.detail-preview::before {
  content: "";
  display: block;
  height: 72px;
  border: 2px solid var(--line);
  background:
    radial-gradient(circle at 50% 22%, #fff 0 10px, transparent 11px),
    radial-gradient(circle at 50% 58%, var(--yellow) 0 34px, transparent 35px),
    linear-gradient(135deg, rgba(25,200,255,.2), rgba(255,47,79,.18));
}

.image-choice {
  min-height: 110px;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
}

.image-choice strong,
.image-choice > span:not(.detail-preview):not(.choice-thumb) {
  grid-column: 2;
}

.choice-thumb {
  grid-row: 1 / span 2;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.image-choice {
  grid-template-columns: 60px minmax(0, 1fr);
}

.choice-thumb img,
.image-detail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.image-detail {
  min-height: 250px;
  align-content: start;
}

.image-detail::before {
  display: none;
}

.image-detail img {
  height: 178px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}

.material-popover .image-choice,
.catalog-popover .image-choice {
  min-height: 110px;
  padding-right: 8px;
}

.material-popover .detail-preview,
.catalog-popover .detail-preview {
  right: auto;
  left: calc(100% + 20px);
  width: 260px;
}

.material-popover .choice-card:nth-child(3n + 2) .detail-preview,
.material-popover .choice-card:nth-child(3n) .detail-preview,
.catalog-popover .choice-card:nth-child(3n + 2) .detail-preview,
.catalog-popover .choice-card:nth-child(3n) .detail-preview {
  right: calc(100% + 20px);
  left: auto;
}

.detail-preview b {
  font-size: 17px;
}

.detail-preview small {
  color: var(--muted-copy, #4a4a4a);
  font-size: 12px;
  line-height: 1.35;
}

.material-preview::before {
  background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(25,200,255,.18)), #fff;
}

.material-holo::before {
  background: linear-gradient(135deg, #ffd21f, #19c8ff 45%, #ff2f4f), #fff;
}

.material-glitter::before {
  background:
    radial-gradient(circle at 20% 25%, #fff 0 4px, transparent 5px),
    radial-gradient(circle at 70% 36%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 42% 72%, #fff 0 4px, transparent 5px),
    linear-gradient(135deg, #ffecf0, #fff6bf);
}

.hardware-star::before {
  clip-path: polygon(50% 0, 62% 34%, 98% 34%, 68% 54%, 80% 90%, 50% 68%, 20% 90%, 32% 54%, 2% 34%, 38% 34%);
}

.hardware-heart::before {
  border-radius: 50% 50% 42% 42%;
  clip-path: polygon(50% 90%, 8% 48%, 8% 20%, 30% 4%, 50% 20%, 70% 4%, 92% 20%, 92% 48%);
}

.hardware-lobster::before {
  border-radius: 999px;
}

.hardware-moon::before {
  border-radius: 50%;
  box-shadow: inset 22px 0 0 #fffdf4;
}

.color-choice {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
}

.color-choice > span:not(.detail-preview) {
  grid-column: 2;
}

.swatch-dot {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.swatch-dot.gold,
.color-detail.gold::before { background: #dcb75b; }
.swatch-dot.silver,
.color-detail.silver::before { background: linear-gradient(135deg, #fff, #aaa); }
.swatch-dot.rose,
.color-detail.rose::before { background: #d79f96; }
.swatch-dot.black,
.color-detail.black::before { background: #111; }

.mini {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 11px;
  font-weight: 950;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.swatch {
  min-height: 44px;
  border: 2px solid var(--line);
}

.swatch.is-active { outline: 4px solid var(--yellow); }
.swatch.silver { background: linear-gradient(135deg, #fff, #aaa); }
.swatch.gold { background: #d5a526; }
.swatch.red { background: var(--red); }
.swatch.black { background: #111; }

.price-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 2px solid var(--line);
  background: var(--price-bg, var(--yellow));
}

.price {
  font-size: 34px;
  font-weight: 1000;
  line-height: 1;
}

.quantity {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  border: 2px solid var(--line);
  background: var(--panel);
}

.quantity button,
.quantity input {
  min-height: 42px;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 950;
}

.quantity button:first-child { border-right: 2px solid var(--line); }
.quantity button:last-child { border-left: 2px solid var(--line); }

.tier-ladder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tier {
  min-height: 48px;
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border: 2px solid var(--line);
  background: var(--panel);
  text-align: left;
  font-weight: 950;
}

.tier span {
  color: var(--accent-copy, var(--red));
  font-size: 12px;
}

.tier.is-active {
  background: var(--yellow);
}

.toast {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  width: min(700px, calc(100% - 28px));
  display: none;
  transform: translateX(-50%);
  align-items: flex-start;
  justify-content: start;
  grid-template-columns: 22px auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  min-height: 44px;
  max-height: 92px;
  padding: 10px 16px 10px 12px;
  color: var(--ink);
  text-align: left;
  white-space: normal;
  pointer-events: none;
  z-index: 30;
  overflow: auto;
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.toast.is-visible { display: grid; }
.toast::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 3px solid var(--line);
  border-top-color: var(--yellow);
  border-radius: 999px;
  background: #fffdf4;
  box-shadow: 3px 3px 0 var(--line);
}
.toast.is-info::before {
  content: "i";
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-color: var(--line);
  box-shadow: 3px 3px 0 var(--line);
  font-family: ui-serif, Georgia, serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 1000;
  line-height: 1;
  transform: none;
}
.toast.is-loading::before {
  content: "";
  border-top-color: var(--red);
  animation: toast-spin .72s linear infinite, toast-bob 1.15s ease-in-out infinite;
}
.toast.is-success {
  border-color: #168044;
}
.toast.is-success::before {
  content: "✓";
  display: grid;
  place-items: center;
  color: #fff;
  background: #1fc36a;
  border-color: #168044;
  box-shadow: 3px 3px 0 #168044;
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
  animation: toast-check-pop .42s cubic-bezier(.2, 1.55, .3, 1);
}
.toast.is-error {
  border-color: #c71f3d;
}
.toast.is-error::before {
  content: "!";
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-color: #c71f3d;
  box-shadow: 3px 3px 0 #c71f3d;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1;
}
.toast strong {
  margin-bottom: 0;
  line-height: 1.22;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.toast span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.32;
}

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

@keyframes toast-bob {
  0%, 100% { box-shadow: 3px 3px 0 var(--line); }
  50% { box-shadow: 5px 5px 0 var(--line); }
}

@keyframes toast-check-pop {
  0% { transform: scale(.62) rotate(-18deg); }
  60% { transform: scale(1.18) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (max-width: 560px) {
  .toast {
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 9px;
    top: calc(100% + 6px);
    width: min(360px, calc(100vw - 28px));
    max-height: 68px;
    padding: 8px 11px 8px 10px;
    row-gap: 0;
    font-size: 12px;
  }

  .toast::before {
    grid-row: 1 / span 2;
    width: 18px;
    height: 18px;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--line);
  }

  .toast strong,
  .toast span {
    grid-column: 2;
  }

  .toast strong {
    font-size: 12px;
  }

  .toast span {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.24;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.58);
  z-index: 40;
}

.dialog-backdrop.is-open { display: grid; }

.dialog {
  width: min(580px, 100%);
  padding: 18px;
  display: grid;
  gap: 14px;
}

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

.mobile-sheet-backdrop {
  display: none;
}

.bottom-mobile { display: none; }

.mobile-canvas-tools,
.mobile-node-panel {
  display: none;
}

/* C: Gen Z glossy sticker club */
.theme-a-pro {
  --paper: #fbf6e8;
  --panel: rgba(255, 253, 244, .92);
  --yellow: #ffd21f;
  --red: #ff3f36;
  --blue: #24bde8;
  --green: #35c66b;
  --muted-copy: #403a2d;
  --accent-copy: #ff3f36;
  --upload-bg:
    linear-gradient(135deg, rgba(255,210,31,.36), rgba(255,255,255,.88) 52%, rgba(36,189,232,.18)),
    #fffdf4;
  --canvas-head: linear-gradient(90deg, #fffdf4, #ffd21f 58%, #fff7b7);
  --canvas-foot: rgba(255,253,244,.94);
  --stage-bg:
    radial-gradient(circle at 18% 28%, rgba(255,210,31,.22) 0 11%, transparent 12%),
    radial-gradient(circle at 82% 68%, rgba(36,189,232,.16) 0 14%, transparent 15%),
    linear-gradient(135deg, #fffdf4, #fff7df 56%, #eefaff);
  --callout-bg: rgba(255,253,244,.94);
  --price-bg: linear-gradient(135deg, #ffd21f, #fff1a8);
  --shadow: 0 18px 38px rgba(0,0,0,.18);
  background:
    linear-gradient(120deg, rgba(255,63,54,.08) 0 18%, transparent 18% 100%),
    linear-gradient(90deg, rgba(16,16,16,.05) 1px, transparent 1px),
    linear-gradient(rgba(16,16,16,.05) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 34px 34px, 34px 34px, auto;
}

.theme-a-pro .topbar {
  background: rgba(255,253,244,.94);
  backdrop-filter: blur(18px);
}

.theme-a-pro .panel,
.theme-a-pro .canvas,
.theme-a-pro .dialog,
.theme-a-pro .toast {
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(0,0,0,.16);
}

.theme-a-pro .button,
.theme-a-pro .tool,
.theme-a-pro .option,
.theme-a-pro .step,
.theme-a-pro .chip,
.theme-a-pro .status-chip {
  border-radius: 12px;
}

.theme-a-pro .button {
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 9px 0 rgba(0,0,0,.88);
}

.theme-a-pro .button:active {
  transform: translateY(3px);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.16), 0 4px 0 rgba(0,0,0,.88);
}

.theme-a-pro .stage::before {
  background:
    linear-gradient(90deg, rgba(0,0,0,.08) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,.08) 1px, transparent 1px);
  background-size: 34px 34px;
}

.theme-a-pro .callout {
  border-radius: 18px 18px 18px 4px;
}

.theme-b-pro {
  --ink: #070707;
  --line: #070707;
  --panel: #fffdf4;
  --yellow: #ffd21f;
  --red: #ff2f4f;
  --blue: #19c8ff;
  --green: #65ff9a;
  --muted-copy: #332f2a;
  --accent-copy: #ff2f4f;
  --upload-bg:
    radial-gradient(circle at 22% 24%, rgba(255,47,79,.2), transparent 25%),
    linear-gradient(135deg, #fffdf4, #fff1c2);
  --canvas-head: #070707;
  --canvas-foot: #fffdf4;
  --stage-bg:
    linear-gradient(120deg, rgba(255,47,79,.16) 0 18%, transparent 18% 100%),
    linear-gradient(300deg, rgba(25,200,255,.2) 0 20%, transparent 20% 100%),
    #fffdf4;
  --callout-bg: #ffecf0;
  --price-bg: #070707;
  --shadow: 10px 12px 0 rgba(255,47,79,.88);
  background:
    radial-gradient(circle at 16px 16px, rgba(255,47,79,.2) 0 4px, transparent 4px) 0 0 / 32px 32px,
    #fff8dc;
}

.theme-b-pro .topbar {
  background: #ffd21f;
}

.theme-b-pro .panel,
.theme-b-pro .canvas,
.theme-b-pro .dialog,
.theme-b-pro .toast {
  border-radius: 24px 6px 24px 6px;
}

.theme-b-pro .canvas-head {
  color: #fffdf4;
}

.theme-b-pro .canvas-tabs {
  border-color: #fffdf4;
}

.theme-b-pro .canvas-tabs button {
  color: #fffdf4;
  border-color: #fffdf4;
}

.theme-b-pro .canvas-tabs button.is-active {
  background: #ffd21f;
  color: #070707;
}

.theme-b-pro .price-box,
.theme-b-pro .price-box .copy {
  color: #fffdf4;
}

.theme-b-pro .button {
  border-radius: 999px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.2), 0 7px 0 #070707;
}

.theme-b-pro .tool,
.theme-b-pro .option,
.theme-b-pro .step,
.theme-b-pro .mode-toggle button,
.theme-b-pro .choice-toggle button,
.theme-b-pro .choice-card,
.theme-b-pro .tier {
  border-radius: 999px;
}

.theme-b-pro .select-popover,
.theme-b-pro .detail-preview {
  border-radius: 20px 6px 20px 6px;
}

.theme-b-pro .stage::before {
  background:
    linear-gradient(90deg, rgba(0,0,0,.06) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

.theme-c-pro {
  --ink: #0c0c0c;
  --line: #0c0c0c;
  --panel: #fffdf4;
  --yellow: #ffe033;
  --red: #ff3b30;
  --blue: #0a78ff;
  --green: #2ed573;
  --muted-copy: #3c392f;
  --accent-copy: #0a78ff;
  --upload-bg: #ffe033;
  --canvas-head: #fffdf4;
  --canvas-foot: #fffdf4;
  --stage-bg:
    linear-gradient(90deg, #0c0c0c 0 4px, transparent 4px 100%),
    linear-gradient(#0c0c0c 0 4px, transparent 4px 100%),
    #fffdf4;
  --callout-bg: #ffe033;
  --price-bg: #0a78ff;
  --shadow: 0 16px 0 #0c0c0c, 0 30px 42px rgba(0,0,0,.2);
  background:
    linear-gradient(90deg, transparent 0 58%, #ff3b30 58% 68%, transparent 68%),
    linear-gradient(#fffdf4 0 18%, #ffe033 18% 34%, #fffdf4 34% 100%);
}

.theme-c-pro .panel,
.theme-c-pro .canvas,
.theme-c-pro .dialog,
.theme-c-pro .toast,
.theme-c-pro .button,
.theme-c-pro .option,
.theme-c-pro .tool,
.theme-c-pro .step,
.theme-c-pro .status-chip {
  border-radius: 0;
}

.theme-c-pro .topbar {
  background: #fffdf4;
}

.theme-c-pro .stage {
  background-size: 92px 92px;
}

.theme-c-pro .stage::before {
  background:
    linear-gradient(90deg, #ff3b30 0 22%, transparent 22% 100%),
    linear-gradient(#0a78ff 0 18%, transparent 18% 100%),
    linear-gradient(90deg, transparent 0 70%, #ffe033 70% 84%, transparent 84%);
  opacity: .18;
}

.theme-c-pro .price-box,
.theme-c-pro .price-box .copy {
  color: #fffdf4;
}

.theme-c-pro .button {
  box-shadow: 5px 5px 0 #0c0c0c;
}

.theme-c {
  --paper: #f7f0ff;
  --panel: #fff9ec;
  --yellow: #ffe22e;
  --red: #ff3355;
  --blue: #00d1ff;
  --green: #67ff93;
  --muted-copy: #443b4e;
  --accent-copy: #ff3355;
  --upload-bg: linear-gradient(135deg, #fff6b8, #ffebf4 46%, #ccf6ff);
  --canvas-head: linear-gradient(90deg, #ffe22e, #ff78b7, #00d1ff);
  --canvas-foot: #fff9ec;
  --stage-bg:
    radial-gradient(circle at 18% 22%, rgba(255,51,85,.22) 0 12%, transparent 13%),
    linear-gradient(135deg, #fbf2ff, #fef7df 48%, #e8fbff);
  --callout-bg: #fff2a6;
  --price-bg: linear-gradient(135deg, #ffe22e, #fff6b8);
  background:
    linear-gradient(135deg, rgba(255,51,85,.12) 25%, transparent 25%) 0 0 / 28px 28px,
    var(--paper);
}

.theme-c .topbar { background: #fff9ec; }
.theme-c .panel,
.theme-c .canvas,
.theme-c .dialog,
.theme-c .toast { border-radius: 18px 6px 18px 6px; }
.theme-c .button,
.theme-c .step,
.theme-c .chip,
.theme-c .option,
.theme-c .tool { border-radius: 999px; }
.theme-c .stage::before {
  background:
    linear-gradient(90deg, rgba(0,0,0,.08) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,.08) 1px, transparent 1px);
  background-size: 34px 34px;
}
.theme-c .stage::after {
  background:
    linear-gradient(45deg, transparent 0 45%, rgba(255,51,85,.32) 45% 48%, transparent 48%),
    linear-gradient(-45deg, transparent 0 48%, rgba(0,209,255,.28) 48% 51%, transparent 51%);
}
.theme-c .artboard { transform: rotate(-2deg); }

/* D: Neon creator console */
.theme-d {
  --ink: #050505;
  --line: #ffe22e;
  --panel: #141414;
  --yellow: #ffe22e;
  --red: #ff3b30;
  --blue: #21d4ff;
  --green: #50ff85;
  --muted-copy: #c9c0a6;
  --accent-copy: #21d4ff;
  --button-bg: #050505;
  --button-color: #ffe22e;
  --upload-bg: #050505;
  --canvas-head: #1d1d1d;
  --canvas-foot: #141414;
  --stage-bg:
    linear-gradient(90deg, rgba(255,226,46,.14) 1px, transparent 1px),
    linear-gradient(rgba(255,226,46,.14) 1px, transparent 1px),
    #080808;
  --callout-bg: #280d0c;
  --price-bg: #ffe22e;
  --shadow: 8px 8px 0 #ff3b30;
  background:
    linear-gradient(135deg, #050505 0 62%, #180908 62% 74%, #050505 74%);
  color: #fffdf2;
}

.theme-d .topbar {
  background: #0d0d0d;
  color: #fffdf2;
}
.theme-d .step,
.theme-d .chip,
.theme-d .status-chip,
.theme-d .segmented button,
.theme-d .tool,
.theme-d .option,
.theme-d .mini,
.theme-d .quantity input,
.theme-d .quantity button { color: #fffdf2; }
.theme-d .step.is-active,
.theme-d .chip.is-ready,
.theme-d .tool.is-active,
.theme-d .option.is-active,
.theme-d .segmented button.is-active {
  color: #050505;
}
.theme-d .canvas-tabs button { color: #ffe22e; }
.theme-d .canvas-tabs button.is-active {
  background: #ffe22e;
  color: #050505;
}
.theme-d .callout {
  border-color: var(--red);
  color: #fffdf2;
}
.theme-d .stage::after {
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255,59,48,.2) 35% 37%, transparent 37%),
    linear-gradient(65deg, transparent 0 58%, rgba(33,212,255,.18) 58% 60%, transparent 60%);
}
.theme-d .acrylic-glow {
  border-color: rgba(255,255,255,.18);
  filter: drop-shadow(0 0 22px rgba(255,226,46,.28));
}
.theme-d .hole { background: #080808; }

/* E: Mondrian pop grid */
.theme-e {
  --paper: #f5f1e8;
  --panel: #fffdf4;
  --yellow: #ffd21f;
  --red: #f33b2f;
  --blue: #0c73d9;
  --green: #24c06a;
  --muted-copy: #383838;
  --accent-copy: #0c73d9;
  --upload-bg: #ffd21f;
  --canvas-head: #fffdf4;
  --canvas-foot: #fffdf4;
  --stage-bg:
    linear-gradient(90deg, #090909 0 4px, transparent 4px 100%),
    linear-gradient(#090909 0 4px, transparent 4px 100%),
    #fffdf4;
  --callout-bg: #ffd21f;
  --price-bg: #f33b2f;
  --shadow: 10px 10px 0 #090909;
  background:
    linear-gradient(90deg, transparent 0 70%, #f33b2f 70% 78%, transparent 78%),
    linear-gradient(#fffdf4 0 18%, #090909 18% 19%, #ffd21f 19% 36%, #fffdf4 36% 100%);
}

.theme-e .workspace {
  grid-template-columns: 310px minmax(0, 1fr) 340px;
}
.theme-e .panel,
.theme-e .canvas,
.theme-e .dialog,
.theme-e .toast,
.theme-e .status-chip,
.theme-e .button,
.theme-e .option,
.theme-e .tool,
.theme-e .step,
.theme-e .chip { border-radius: 0; }
.theme-e .topbar { background: #fffdf4; }
.theme-e .stage { background-size: 88px 88px; }
.theme-e .stage::before {
  background:
    linear-gradient(90deg, #f33b2f 0 24%, transparent 24% 100%),
    linear-gradient(#0c73d9 0 18%, transparent 18% 100%),
    linear-gradient(90deg, transparent 0 66%, #ffd21f 66% 82%, transparent 82%);
  opacity: .22;
}
.theme-e .price-box { color: #fff; }
.theme-e .price-box .copy { color: #fff; }

/* F: Pop art comic board */
.theme-f {
  --paper: #fff4d8;
  --panel: #fffdf4;
  --yellow: #ffd21f;
  --red: #ff2d2d;
  --blue: #1677ff;
  --green: #35c66b;
  --muted-copy: #333;
  --accent-copy: #ff2d2d;
  --upload-bg:
    radial-gradient(circle, rgba(255,45,45,.34) 0 3px, transparent 3px) 0 0 / 16px 16px,
    #fffdf4;
  --canvas-head: #ffd21f;
  --canvas-foot: #fffdf4;
  --stage-bg:
    radial-gradient(circle, rgba(9,9,9,.16) 0 2px, transparent 2px) 0 0 / 13px 13px,
    #fff4d8;
  --callout-bg: #fffdf4;
  --price-bg: #1677ff;
  --shadow: 7px 7px 0 #1677ff;
  background:
    radial-gradient(circle, rgba(255,45,45,.22) 0 3px, transparent 3px) 0 0 / 18px 18px,
    #fff4d8;
}

.theme-f .topbar { background: #ffd21f; }
.theme-f .brand-lockup h1,
.theme-f h2,
.theme-f .price {
  text-transform: uppercase;
}
.theme-f .panel,
.theme-f .canvas,
.theme-f .dialog,
.theme-f .toast {
  border-radius: 6px;
}
.theme-f .button {
  transform: skew(-4deg);
}

.theme-f .bottom-mobile .button {
  transform: none;
}
.theme-f .button span,
.theme-f .button { text-transform: none; }
.theme-f .callout {
  border-radius: 50% 46% 52% 44%;
  padding: 22px 18px;
}
.theme-f .callout::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -18px;
  width: 28px;
  height: 28px;
  border-left: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  background: inherit;
  transform: rotate(-28deg);
}
.theme-f .price-box { color: #fff; }
.theme-f .price-box .copy { color: #fff; }

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .right-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (max-width: 820px) {
  html,
  body,
  .editor {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    overflow: hidden;
  }

  .brand-lockup,
  .brand-lockup > div,
  .kicker {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .steps {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .step {
    min-width: 78px;
    padding: 0 8px;
    font-size: 12px;
  }

  .status-chip { min-width: 0; }

  .workspace {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 8px 10px 20px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .left-panel {
    display: block;
    padding: 10px;
    overflow: visible;
  }

  body.is-node-editing .left-panel {
    display: none;
  }

  .left-panel > .section {
    display: none;
  }

  .left-panel > .section:nth-child(3) {
    display: block;
    padding: 0;
    border: 0;
  }

  .left-panel > .section:nth-child(3) > .label,
  .left-panel > .section:nth-child(3) > .tool-grid,
  .left-panel > .section:nth-child(3) > .node-edit-panel,
  .left-panel > .section:nth-child(3) > .action-grid {
    display: none;
  }

  .left-panel .settings-field {
    display: flex;
    justify-self: stretch;
    width: 100%;
    justify-content: flex-start;
  }

  .left-panel .settings-field .mobile-bg-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 96px;
    max-width: 118px;
    min-width: 92px;
    padding: 0 10px;
    font-size: 11px;
  }

  .canvas {
    order: -1;
    height: min(590px, calc(100svh - 16px));
    min-height: 540px;
    max-height: 590px;
    width: 100%;
    max-width: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-width: 2px;
    border-radius: 18px 6px 18px 6px;
    box-shadow: 6px 8px 0 rgba(255,47,79,.88);
    overflow: hidden;
  }

  .canvas-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border-bottom-width: 2px;
  }

  .canvas-head > div:first-child {
    display: none;
  }

  .canvas-foot {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    border-top-width: 2px;
  }

  .canvas-tabs {
    display: none;
  }

  .canvas-head .product-menu {
    display: none;
  }

  .mobile-print-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 2px solid #fffdf4;
    background: #070707;
  }

  .mobile-print-switch button {
    min-height: 40px;
    border: 0;
    border-right: 2px solid #fffdf4;
    background: transparent;
    color: #fffdf4;
    font-weight: 950;
  }

  .mobile-print-switch button:last-child {
    border-right: 0;
  }

  .mobile-print-switch button.is-active {
    background: var(--yellow);
    color: var(--ink);
  }

  .stage {
    place-items: start center;
    padding: 54px 10px 66px;
  }

  .canvas-side-switch {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 9;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100% - 20px);
    border: 2px solid var(--line);
    background: var(--panel);
    box-shadow: 3px 3px 0 var(--line);
  }

  .canvas-side-switch button {
    min-height: 34px;
    border: 0;
    border-right: 2px solid var(--line);
    background: transparent;
    font-size: 13px;
    font-weight: 950;
  }

  .canvas-side-switch button.is-active {
    background: var(--yellow);
  }

  .canvas-side-switch button:last-child {
    border-right: 0;
  }

  .mobile-product-menu {
    position: absolute;
    right: 12px;
    bottom: 10px;
    left: calc(50% + 4px);
    z-index: 12;
    display: block;
    width: calc(50% - 16px);
    max-width: none;
    min-width: 0;
  }

  .mobile-product-trigger {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 28px 0 10px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: var(--yellow);
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    font-size: 12px;
    font-weight: 1000;
    line-height: 1.05;
    overflow: visible;
    text-align: center;
    text-overflow: clip;
    white-space: normal;
  }

  .mobile-product-trigger::after {
    content: "";
    position: absolute;
    right: 11px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
  }

  .mobile-product-trigger[aria-expanded="true"] {
    background: #fffdf4;
  }

  .mobile-product-panel {
    top: auto;
    bottom: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(178px, calc((100vw - 32px) / 2));
    gap: 4px;
    padding: 5px;
    transform: none;
  }

  .mobile-product-panel button {
    min-height: 42px;
    gap: 1px;
    padding: 7px 9px;
  }

  .mobile-product-panel strong {
    font-size: 15px;
  }

  .mobile-product-panel span {
    font-size: 11px;
    line-height: 1.05;
  }

  .artboard {
    width: min(86vw, 360px);
    margin-top: 12px;
  }

  .sample-cat {
    width: min(62vw, 226px);
    height: min(62vw, 226px);
  }

  .mobile-replace-button {
    position: absolute;
    right: auto;
    left: 12px;
    bottom: 10px;
    z-index: 11;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(50% - 16px);
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: var(--yellow);
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    font-size: 12px;
    font-weight: 1000;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
  }

  .mobile-replace-button[hidden] {
    display: none;
  }

  .right-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .right-panel .section:first-child,
  .right-panel .section:nth-child(2),
  .right-panel .section:nth-child(3) {
    display: none;
  }

  .right-panel .section:last-child {
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .right-panel .mobile-order-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0;
    border: 0;
  }

  .mobile-summary-cell {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 9px 8px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #fffdf4;
    text-align: left;
  }

  .mobile-summary-cell span {
    font-size: 10px;
    font-weight: 1000;
    color: var(--red);
    line-height: 1;
    white-space: nowrap;
  }

  .mobile-summary-cell strong {
    min-width: 0;
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
  }

  .mobile-summary-cell:active,
  .mobile-summary-cell.is-active {
    background: var(--yellow);
  }

  body.mobile-sheet-open {
    overflow: hidden;
  }

  .mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: end;
    padding: 0;
    background: rgba(7,7,7,.5);
  }

  .mobile-sheet-backdrop.is-open {
    display: grid;
  }

  .mobile-config-sheet {
    width: 100%;
    max-height: min(72svh, 620px);
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 10px;
    padding: 9px 10px 14px;
    border: 3px solid var(--line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: #fffdf4;
    box-shadow: 0 -16px 0 rgba(255,47,79,.82);
    overflow: hidden;
  }

  .mobile-sheet-handle {
    justify-self: center;
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: var(--line);
  }

  .mobile-sheet-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 10px;
    align-items: center;
  }

  .mobile-sheet-head h2 {
    margin-top: 2px;
    font-size: 19px;
  }

  .mobile-sheet-close {
    width: 38px;
    height: 38px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--yellow);
    color: var(--ink);
    font-size: 24px;
    font-weight: 1000;
    line-height: 1;
  }

  .mobile-sheet-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 2px solid var(--line);
    background: #fff;
  }

  .mobile-sheet-tabs.is-two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-sheet-tabs button {
    min-height: 38px;
    min-width: 0;
    border: 0;
    border-right: 2px solid var(--line);
    background: transparent;
    font-size: 12px;
    font-weight: 1000;
    white-space: nowrap;
  }

  .mobile-sheet-tabs button:last-child {
    border-right: 0;
  }

  .mobile-sheet-tabs button[hidden] {
    display: none;
  }

  .mobile-sheet-tabs button.is-active {
    background: var(--yellow);
  }

  .mobile-sheet-body {
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }

  .mobile-sheet-panel {
    display: grid;
    gap: 8px;
  }

  .mobile-sheet-label {
    margin-top: 4px;
    color: var(--red);
    font-size: 11px;
    font-weight: 1000;
    line-height: 1;
  }

  .mobile-sheet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-size-grid,
  .mobile-tier-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-hardware-grid,
  .mobile-color-grid {
    max-height: 184px;
    overflow: auto;
    padding-right: 2px;
  }

  .mobile-sheet-choice {
    min-width: 0;
    min-height: 42px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 8px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    text-align: left;
  }

  .mobile-sheet-choice strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-choice span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted-copy);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-choice.is-active {
    background: var(--yellow);
    box-shadow: inset 0 0 0 2px var(--line);
  }

  .mobile-sheet-choice.has-thumb {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    align-content: center;
  }

  .mobile-sheet-choice.has-icon {
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    align-content: center;
  }

  .mobile-sheet-thumb {
    grid-row: 1 / span 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
  }

  .mobile-sheet-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
  }

  .mobile-sheet-shape-icon {
    grid-row: 1 / span 2;
    width: 46px;
    height: 34px;
    display: grid;
    place-items: center;
  }

  .mobile-sheet-price {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--yellow);
  }

  .mobile-sheet-price span,
  .mobile-sheet-price small {
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-sheet-price strong {
    font-size: 28px;
    line-height: 1;
  }

  .mobile-sheet-quantity {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
  }

  .mobile-sheet-quantity button,
  .mobile-sheet-quantity input {
    min-height: 42px;
    border: 0;
    background: transparent;
    text-align: center;
    font-weight: 1000;
  }

  .mobile-sheet-quantity button:first-child {
    border-right: 2px solid var(--line);
  }

  .mobile-sheet-quantity button:last-child {
    border-left: 2px solid var(--line);
  }

  .right-panel .order-actions {
    gap: 8px;
  }

  .right-panel .order-actions .button {
    min-height: 38px;
  }

  .select-popover {
    grid-template-columns: 1fr;
    position: relative;
    top: auto;
    bottom: auto;
    right: auto;
    width: 100%;
    max-height: none;
  }

  .detail-preview {
    right: auto;
    left: 0;
    top: calc(100% + 8px);
    width: min(280px, 86vw);
    transform: none;
  }

  .mobile-canvas-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-canvas-tools .tool,
  .mobile-node-panel .tool {
    min-height: 44px;
    min-width: 0;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-node-panel {
    display: grid;
    gap: 8px;
  }

  .mobile-node-panel[hidden] {
    display: none;
  }

  .mobile-node-panel .node-help {
    padding: 9px 10px;
    gap: 6px;
    max-height: 156px;
    overflow: auto;
  }

  .mobile-node-panel .node-help-list {
    gap: 3px;
    line-height: 1.3;
  }

  .toast {
    top: calc(100% + 6px);
    color: var(--ink);
    background: var(--panel);
  }
}

@media (max-width: 430px) {
  .topbar,
  .workspace { padding-left: 8px; padding-right: 8px; }

  .workspace {
    padding-top: 4px;
    padding-bottom: 12px;
  }

  h1 { font-size: 26px; }

  .button-row { grid-template-columns: 1fr; }

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

  .tier-ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .canvas {
    height: min(525px, calc(100svh - 8px));
    min-height: 510px;
    max-height: 525px;
  }

  .stage {
    padding-top: 52px;
  }

  .canvas-side-switch {
    width: calc(100% - 20px);
  }

  .canvas-side-switch button {
    font-size: 12px;
  }

  .mobile-product-trigger,
  .mobile-replace-button {
    font-size: 11px;
  }

  .artboard {
    width: min(76vw, 296px);
    margin-top: 10px;
  }

  .mobile-canvas-tools {
    gap: 7px;
  }

  .mobile-canvas-tools .tool,
  .mobile-node-panel .tool {
    min-height: 42px;
    font-size: 11px;
  }

  .sample-cat-label {
    min-width: 210px;
    padding: 10px 14px;
    font-size: 18px;
  }

}
