:root {
  --ink: #2b2b2b;
  --ink-2: #444444;
  --muted: #767676;
  --teal: #b4252d;
  --teal-dark: #8d1b23;
  --coral: #c75a60;
  --paper: #f6f6f6;
  --panel: #ffffff;
  --line: #dfdfdf;
  --soft: #fbf0f0;
  --shadow: 0 18px 50px rgba(43, 43, 43, 0.11);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 4% 0%, rgba(245, 130, 32, 0.10), transparent 27rem),
    var(--paper);
}

button, input, select { font: inherit; }
button { color: inherit; }

.topbar {
  min-height: 78px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand > span:last-child { display: grid; }
.brand strong { font-size: 28px; letter-spacing: -1.6px; line-height: 0.9; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; }

.brand-mark { position: relative; width: 37px; height: 37px; display: block; }
.brand-mark i { position: absolute; width: 18px; height: 18px; border-radius: 5px; transform: rotate(45deg); }
.brand-mark i:nth-child(1) { left: 1px; top: 9px; background: var(--teal); }
.brand-mark i:nth-child(2) { right: 1px; top: 2px; background: var(--ink); }
.brand-mark i:nth-child(3) { right: 1px; bottom: 1px; background: var(--coral); }

.topbar-actions, .prototype-pill { display: flex; align-items: center; gap: 10px; }
.prototype-pill { color: var(--muted); font-size: 13px; }
.prototype-pill span { width: 8px; height: 8px; border-radius: 50%; background: #38b878; box-shadow: 0 0 0 4px rgba(56, 184, 120, 0.12); }

.ghost-button, .icon-button, .save-button, .quantity-control button {
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}

.ghost-button { padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.ghost-button:hover, .icon-button:hover, .save-button:hover { border-color: var(--teal); color: var(--teal-dark); }

main { padding: 0 clamp(16px, 3vw, 50px) 28px; }
.intro-bar { max-width: 1640px; margin: 0 auto; padding: 40px 0 28px; display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.eyebrow { margin: 0 0 9px; color: var(--teal-dark); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
h1 { margin: 0; max-width: 720px; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(30px, 3.4vw, 52px); line-height: 1.02; letter-spacing: -1.6px; }

.progress { list-style: none; padding: 0; margin: 0 0 4px; display: flex; align-items: center; gap: 28px; counter-reset: steps; }
.progress li { position: relative; display: flex; align-items: center; gap: 7px; color: #96a3a8; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; }
.progress li:not(:last-child)::after { content: ""; position: absolute; left: calc(100% + 8px); width: 12px; height: 1px; background: var(--line); }
.progress span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 10px; }
.progress .active { color: var(--ink); }
.progress .active span { border-color: var(--teal); background: var(--teal); color: white; }

.creator-shell {
  max-width: 1640px;
  min-height: 710px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px minmax(420px, 1fr) 360px;
  background: var(--panel);
  border: 1px solid rgba(20, 68, 80, 0.1);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.product-rail, .settings-panel { padding: 24px; }
.product-rail { background: #f0f5f3; border-right: 1px solid var(--line); }
.settings-panel {
  position: relative;
  max-height: none;
  overflow: visible;
  border-left: 1px solid var(--line);
}
.settings-nav {
  margin: 16px -12px 0;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5f8f7;
  box-shadow: 0 8px 20px rgba(43,43,43,.08);
}
.settings-nav button { min-width: 0; padding: 8px 3px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 7.5px; font-weight: 900; cursor: pointer; }
.settings-nav button:hover, .settings-nav button:focus-visible { border-color: var(--teal); color: var(--teal-dark); outline: none; }
.settings-nav button[aria-selected="true"] { border-color: rgba(245,130,32,.3); background: white; color: var(--teal-dark); box-shadow: 0 3px 10px rgba(43,43,43,.08); }
.settings-group { margin-top: 16px; }
.settings-group[hidden] { display: none !important; }
.settings-photos[hidden] { display: none !important; }

.panel-heading, .preview-toolbar > div:first-child { display: flex; align-items: center; gap: 11px; }
.panel-heading div, .preview-toolbar > div:first-child > div { display: grid; gap: 2px; }
.panel-heading small, .preview-toolbar small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.9px; }
.panel-heading strong, .preview-toolbar strong { font-size: 16px; }
.panel-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: white; background: var(--ink); font-size: 11px; font-weight: 900; }

.product-list { display: grid; gap: 8px; margin-top: 22px; }
.product-button {
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 37px 1fr 15px;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.product-button:hover { background: rgba(255,255,255,.68); }
.product-button:disabled { cursor: default; opacity: 1; }
.product-button:disabled b { display: none; }
.product-button.active { border-color: rgba(245,130,32,.28); background: white; box-shadow: 0 8px 25px rgba(43,43,43,.07); }
.product-button .product-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: rgba(255,255,255,.7); font-size: 19px; }
.product-button .product-icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; object-position: top center; }
.product-button.active .product-icon { color: white; background: var(--teal); }
.product-button strong { display: block; font-size: 13px; }
.product-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.product-button b { color: #9aacb1; font-size: 15px; }
.product-button.active b { color: var(--teal); }

.rail-note { margin-top: 22px; padding: 15px; display: grid; gap: 5px; border: 1px dashed #b8cac8; border-radius: 13px; }
.rail-note strong { font-size: 12px; }
.rail-note span { color: var(--muted); font-size: 10px; line-height: 1.45; }

.preview-panel { min-width: 0; padding: 24px 28px; background: white; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.preview-actions { display: flex; gap: 7px; }
.icon-button { width: 35px; height: 35px; border-radius: 10px; font-size: 18px; }

.canvas-stage {
  position: relative;
  min-height: 490px;
  margin-top: 17px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfe8e8;
  border-radius: 20px;
  background:
    linear-gradient(45deg, rgba(21,59,73,.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(21,59,73,.025) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(21,59,73,.025) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(21,59,73,.025) 75%),
    #f7faf9;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}
#designCanvas { display: block; width: min(100%, 900px); height: auto; touch-action: none; cursor: grab; }
#designCanvas:active { cursor: grabbing; }
#designCanvas.dragging { cursor: grabbing; }
.canvas-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 7px 12px; border-radius: 99px; background: rgba(43,43,43,.82); color: white; font-size: 10px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.canvas-stage.has-image .canvas-hint { opacity: 1; }
.drop-overlay { position: absolute; inset: 16px; display: none; place-items: center; border: 2px dashed var(--teal); border-radius: 15px; background: rgba(237,250,249,.88); color: var(--teal-dark); font-weight: 800; pointer-events: none; }
.canvas-stage.dragging .drop-overlay { display: grid; }

.asset-strip { min-height: 52px; margin-top: 11px; display: flex; align-items: center; gap: 7px; overflow-x: auto; }
.asset-item { position: relative; flex: 0 0 auto; width: 48px; height: 48px; }
.asset-chip { position: relative; width: 44px; height: 44px; margin-top: 4px; border: 2px solid transparent; border-radius: 10px; padding: 0; overflow: hidden; background: #eef3f2; cursor: pointer; }
.asset-chip.active { border-color: var(--teal); }
.asset-chip { cursor: grab; touch-action: none; user-select: none; }
.asset-chip img { pointer-events: none; -webkit-user-drag: none; }
.photo-drag-ghost { position: fixed; z-index: 1000; width: 68px; height: 68px; object-fit: cover; border: 3px solid var(--teal); border-radius: 12px; box-shadow: 0 6px 24px #102f3d44; pointer-events: none; transform: translate(-50%, -50%); opacity: .9; }
.photo-drag-ghost.invalid { border-color: #b76557; }
.photo-placement { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; color: var(--muted); font-size: 11px; }
.photo-placement span { flex-basis: 100%; line-height: 1.5; }
.photo-placement[hidden], .mug-rotation-controls[hidden] { display: none; }
.photo-placement button, .mug-rotation-controls button { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: white; color: var(--teal-dark); font: inherit; font-weight: 700; cursor: pointer; }
.photo-placement button:disabled { opacity: .45; cursor: default; }
.mug-rotation-controls { padding: 12px 14px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; font-size: 11px; }
.mug-rotation-controls label { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-weight: 700; }
.mug-rotation-controls input { grid-column: 1 / -1; }
.mug-rotation-controls > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.mug-rotation-controls p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.mug-view-switch { flex-wrap: wrap; }
.asset-chip img { width: 100%; height: 100%; object-fit: cover; }
.asset-chip span { position: absolute; left: 2px; top: 1px; width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: rgba(43,43,43,.78); color: white; font-size: 9px; }
.asset-remove { position: absolute; z-index: 2; right: 0; top: 0; width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; padding: 0 0 2px; background: #d94747; color: white; font: 800 15px/1 system-ui; cursor: pointer; box-shadow: 0 2px 6px rgba(43,43,43,.2); }
.asset-remove:hover { background: #b92f2f; transform: scale(1.06); }
.asset-remove:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.asset-page-label { padding: 0 7px; color: var(--muted); font-size: 10px; }

.editor-controls { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr 170px; gap: 16px; align-items: center; }
.editor-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.editor-controls label > span { display: flex; justify-content: space-between; gap: 8px; }
.editor-controls label output { color: var(--teal-dark); font-weight: 900; }
.editor-controls label > small { font-size: 8px; line-height: 1.35; font-weight: 600; }
input[type="range"] { width: 100%; accent-color: var(--teal); }
.zoom-control { min-width: 0; display: grid; gap: 5px; }
.text-position-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.text-position-controls p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.text-position-controls label { display: grid; gap: 5px; font-size: 10px; font-weight: 700; color: var(--muted); }
.text-position-controls input { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.text-position-controls button { grid-column: 1 / -1; min-height: 40px; }
.zoom-control > small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.zoom-steps { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.zoom-steps button { min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--teal-dark); font: 800 22px system-ui; cursor: pointer; touch-action: manipulation; }
.zoom-steps button:disabled { opacity: .4; cursor: default; }
@media (pointer: coarse) {
  input[type="range"] { min-height: 44px; touch-action: none; }
}
.quality-card { min-height: 46px; padding: 8px 11px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; }
.quality-card > div { display: grid; }
.quality-card small { color: var(--muted); font-size: 9px; }
.quality-card strong { font-size: 11px; }
.quality-dot { width: 9px; height: 9px; border-radius: 50%; background: #a8b3b6; box-shadow: 0 0 0 4px rgba(168,179,182,.14); }
.quality-card.good .quality-dot { background: #35b477; box-shadow: 0 0 0 4px rgba(53,180,119,.14); }
.quality-card.medium .quality-dot { background: #e7a936; box-shadow: 0 0 0 4px rgba(231,169,54,.14); }
.quality-card.low .quality-dot { background: #e46756; box-shadow: 0 0 0 4px rgba(228,103,86,.14); }

.position-controls { margin-top: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr minmax(190px, .8fr); align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fafafa; }
.position-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.position-controls label span { display: flex; justify-content: space-between; gap: 8px; }
.position-controls output { min-width: 38px; color: var(--teal-dark); font-weight: 900; text-align: right; }
.position-controls p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.position-controls p strong { color: var(--ink); }
.position-controls:has(input:disabled) { opacity: .62; }
.shirt-print-controls { margin-top: 10px; padding: 12px 14px; display: grid; grid-template-columns: minmax(180px, .8fr) 1fr 1fr auto; align-items: center; gap: 14px; border: 1px solid rgba(245,130,32,.35); border-radius: 13px; background: #fff7f0; }
.shirt-print-controls[hidden] { display: none; }
.shirt-print-controls > div { display: grid; gap: 3px; }
.shirt-print-controls > div strong { font-size: 10px; }
.shirt-print-controls > div span { color: var(--muted); font-size: 8px; }
.shirt-print-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.shirt-print-controls label span { display: flex; justify-content: space-between; gap: 8px; }
.shirt-print-controls output { color: var(--teal-dark); }
.shirt-print-controls button { min-height: 34px; padding: 0 11px; border: 1px solid #e8b37f; border-radius: 9px; background: white; color: var(--teal-dark); font-size: 9px; font-weight: 900; cursor: pointer; }

.settings-heading { margin-bottom: 19px; }
.selected-product { padding: 13px; display: grid; grid-template-columns: 45px 1fr; align-items: center; gap: 11px; border-radius: 13px; background: var(--soft); }
.selected-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 11px; background: white; font-size: 22px; }
.selected-icon { overflow: hidden; }
.selected-icon img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.selected-product > div:last-child { display: grid; gap: 3px; }
.selected-product strong { font-size: 14px; }
.selected-product span { color: var(--muted); font-size: 10px; line-height: 1.35; }

.option-stack { margin-top: 17px; display: grid; gap: 12px; }
.option-field { display: grid; gap: 6px; }
.option-field label, .section-label { display: flex; justify-content: space-between; color: var(--ink); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
.option-field select, .text-editor > textarea, .typography-field select {
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  outline: none;
}
.option-field select, .typography-field select { height: 42px; }
.text-editor > textarea { min-height: 70px; padding-top: 10px; padding-bottom: 10px; resize: vertical; line-height: 1.35; }
.option-field select:focus, .text-editor > textarea:focus, .typography-field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(245,130,32,.1); }

.product-card-picker { display: grid; gap: 7px; }
.real-product-card {
  position: relative;
  width: 100%;
  min-height: 67px;
  padding: 6px 32px 6px 6px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  text-align: left;
  cursor: pointer;
}
.real-product-card:hover { border-color: #e8b37f; }
.real-product-card.selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(245,130,32,.09); }
.real-product-card img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; object-position: top center; background: #f3f5f4; }
.real-product-card span { min-width: 0; display: grid; gap: 3px; }
.real-product-card strong { font-size: 11px; }
.real-product-card small { color: var(--muted); font-size: 8px; line-height: 1.35; }
.real-product-card .product-card-price { margin-top: 2px; color: var(--teal-dark); font-size: 10px; font-style: normal; font-weight: 900; }
.real-product-card .product-card-badge { position: absolute; right: 8px; top: 6px; max-width: 88px; padding: 3px 6px; border-radius: 999px; background: #fff1e3; color: var(--teal-dark); font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .35px; text-transform: uppercase; }
.real-product-card:has(.product-card-badge) { padding-right: 96px; }
.real-product-card b { position: absolute; right: 10px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); display: none; place-items: center; border-radius: 50%; background: var(--teal); color: white; font-size: 10px; }
.real-product-card.selected b { display: grid; }

.sellable-product-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sellable-product-tile {
  position: relative;
  min-height: 48px;
  padding: 7px 25px 7px 9px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.sellable-product-tile:hover { border-color: #e8b37f; }
.sellable-product-tile.selected { border-color: var(--teal); background: #fff7f0; box-shadow: 0 0 0 3px rgba(245,130,32,.08); }
.sellable-product-tile strong { font-size: 9px; }
.sellable-product-tile small { color: var(--muted); font-size: 7px; }
.sellable-product-tile b { position: absolute; right: 8px; top: 50%; display: none; color: var(--teal-dark); transform: translateY(-50%); }
.sellable-product-tile.selected b { display: block; }

.segment-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.segment-button { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 10px; font-weight: 900; cursor: pointer; }
.segment-button.selected { border-color: var(--ink); background: var(--ink); color: white; }

.swatch-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.swatch-button { min-height: 40px; padding: 6px 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; }
.swatch-button:hover { border-color: #e8b37f; }
.swatch-button.selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(245,130,32,.09); }
.swatch-button i { width: 22px; height: 22px; flex: 0 0 auto; border: 1px solid #b9c4c5; border-radius: 50%; background: var(--swatch); }
.swatch-button span { font-size: 9px; font-weight: 800; }
.color-palette-current { margin: 0; color: var(--muted); font-size: 9px; }
.color-palette { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.color-chip { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 2px solid white; border-radius: 50%; background: var(--swatch); cursor: pointer; box-shadow: 0 0 0 1px #bcc8c8; }
.color-chip:hover, .color-chip:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.color-chip.selected { box-shadow: 0 0 0 2px var(--ink); }
.color-chip.selected::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--check); font-size: 9px; font-weight: 1000; text-shadow: 0 1px 2px rgba(0,0,0,.24); }

.upload-card { margin-top: 17px; padding: 13px; display: grid; grid-template-columns: 36px 1fr; gap: 9px; border: 1px dashed #d0b394; border-radius: 13px; background: #fffaf6; cursor: pointer; }
.upload-card.dragging { border-color: var(--teal); background: #fff1e3; box-shadow: inset 0 0 0 1px var(--teal); }
.upload-card.loading { opacity: .72; cursor: progress; }
.upload-icon { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--teal); color: white; font-size: 20px; }
.upload-card > div:nth-child(2) { display: grid; gap: 3px; }
.upload-card strong { font-size: 11px; }
.upload-card span { color: var(--muted); font-size: 9px; }
.upload-button { grid-column: 1 / -1; padding: 9px; border-radius: 9px; background: white; border: 1px solid #d9d9d9; color: var(--teal-dark); text-align: center; font-size: 10px; font-weight: 800; cursor: pointer; }
.upload-button:hover { border-color: var(--teal); }
.upload-card.loading .upload-button { pointer-events: none; }
.native-file-input { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; opacity: 0; }

.collage-editor, .decoration-editor { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.single-layout-button { width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 9px; font-weight: 800; cursor: pointer; }
.single-layout-button.active { border-color: var(--teal); background: #fff7f0; color: var(--teal-dark); box-shadow: 0 0 0 3px rgba(245,130,32,.08); }
.collage-layout-picker { margin-top: 8px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.collage-layout-card { min-width: 0; padding: 5px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.collage-layout-card:hover { border-color: #e8b37f; }
.collage-layout-card.active { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(245,130,32,.1); }
.collage-layout-card small { color: var(--ink); font-size: 11px; line-height: 1.25; text-align: center; white-space: normal; }
.layout-miniature { position: relative; width: 100%; aspect-ratio: 1.45; overflow: hidden; border-radius: 5px; background: #f1f1f1; }
.layout-miniature i { position: absolute; border: 1px solid white; background: #edb67d; }
.collage-controls { margin-top: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.collage-controls[hidden],
.decoration-controls[hidden] { display: none; }
.collage-global-controls { display: grid; gap: 8px; }
.collage-global-controls label, .slot-geometry-grid label { display: grid; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 800; }
.collage-global-controls select { width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 12px; }
.slot-geometry-grid { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-action-button { width: 100%; min-height: 32px; margin-top: 9px; border: 1px solid #d9d9d9; border-radius: 8px; background: white; color: var(--teal-dark); font-size: 8px; font-weight: 900; cursor: pointer; }
.mini-action-button:hover { border-color: var(--teal); }
.mini-action-button.danger { border-color: #ecc8c1; color: #c45443; }

.decoration-subtitle { margin: 8px 0 5px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.decoration-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.decoration-button { min-width: 0; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 17px; cursor: pointer; }
.decoration-button:hover { border-color: var(--teal); color: var(--teal-dark); }
.shape-picker { grid-template-columns: repeat(4, 1fr); }
.shape-picker .decoration-button { min-height: 54px; aspect-ratio: auto; padding: 5px 2px; display: grid; gap: 2px; font-size: 18px; font-weight: 900; }
.shape-picker .decoration-button small { overflow: hidden; width: 100%; font-size: 7px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.photo-frame-picker { grid-template-columns: repeat(3, 1fr); }
.photo-frame-picker .decoration-button { min-height: 42px; aspect-ratio: auto; padding: 4px; gap: 3px; font-size: 8px; font-weight: 900; }
.photo-frame-picker .decoration-button::before { content: "▧"; display: block; color: var(--teal-dark); font-size: 16px; line-height: 1; }
.decoration-controls { margin-top: 9px; padding: 9px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.decoration-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 8px; font-weight: 800; }
.decoration-controls label:first-child { grid-template-columns: 1fr auto; align-items: center; }
.decoration-controls input[type="color"] { width: 38px; height: 28px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.frame-photo-controls { padding: 8px; display: grid; gap: 4px; border: 1px solid #e2e2e2; border-radius: 9px; background: white; }
.frame-photo-controls[hidden] { display: none; }
.frame-photo-controls strong { overflow: hidden; color: var(--teal-dark); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.frame-photo-controls .mini-action-button { margin-top: 2px; }
.shape-crop-controls { margin-top: 7px; padding-top: 9px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.shape-crop-controls[hidden] { display: none; }
.shape-crop-controls .section-label { margin-bottom: 0; }
.shape-crop-controls label { display: grid; gap: 4px; }
.shape-crop-controls label > span { display: flex; justify-content: space-between; gap: 8px; }
.shape-crop-controls output { color: var(--teal-dark); font-weight: 900; }
.layer-editor { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.layer-list { display: grid; gap: 5px; }
.layer-item { position: relative; width: 100%; min-height: 32px; padding: 6px 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 8px; font-weight: 800; text-align: left; cursor: grab; }
.layer-item:active { cursor: grabbing; }
.layer-item.dragging { opacity: .42; }
.layer-item.drop-before::after, .layer-item.drop-after::after { content: ""; position: absolute; right: 3px; left: 3px; height: 3px; border-radius: 3px; background: var(--teal); box-shadow: 0 0 0 2px white; }
.layer-item.drop-before::after { top: -5px; }
.layer-item.drop-after::after { bottom: -5px; }
.layer-item::before { content: "⋮⋮"; color: #a5b5b8; letter-spacing: -3px; }
.layer-item[aria-pressed="true"] { border-color: var(--teal); background: #fff7f0; color: var(--teal-dark); box-shadow: 0 0 0 2px rgba(245,130,32,.08); }
.layer-item span { margin-left: auto; color: var(--muted); font-size: 7px; font-weight: 700; }
.layer-actions { margin-top: 7px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.layer-actions button { min-width: 0; min-height: 30px; padding: 4px 2px; border: 1px solid #d9d9d9; border-radius: 7px; background: white; color: var(--teal-dark); font-size: 7px; font-weight: 900; cursor: pointer; }
.layer-actions button:disabled { opacity: .38; cursor: not-allowed; }

.text-editor { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.settings-group.decoration-editor, .settings-group.text-editor, .settings-group.summary-card { margin-top: 16px; padding-top: 0; border-top: 0; }
.section-label { margin-bottom: 7px; }
.section-label small { color: var(--muted); font-size: 8px; font-weight: 600; }
.typography-grid { margin-top: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.typography-field { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .55px; }
.typography-field select { height: 37px; padding: 0 9px; font-size: 10px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.typography-wide { grid-column: 1 / -1; }
.uppercase-toggle { margin-top: 9px; min-height: 32px; padding: 7px 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 9px; font-weight: 900; cursor: pointer; }
.uppercase-toggle input { accent-color: var(--teal); }
.text-paint-options { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.text-paint-options label { min-height: 34px; padding: 7px 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; color: var(--ink); font-size: 8px; font-weight: 850; cursor: pointer; }
.text-paint-options input { accent-color: var(--teal); }
.typography-ranges label.is-disabled, .typography-colors label.is-disabled { opacity: .42; }
.typography-ranges { margin-top: 9px; display: grid; gap: 8px; }
.typography-ranges label { display: grid; gap: 4px; color: var(--muted); font-size: 8px; font-weight: 700; }
.typography-ranges label > span { display: flex; justify-content: space-between; gap: 8px; }
.typography-ranges output { color: var(--teal-dark); font-weight: 900; }
.typography-colors { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.typography-colors label { min-height: 38px; padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 8px; font-weight: 800; }
.typography-colors input[type="color"] { width: 36px; height: 26px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.typography-note { display: block; margin-top: 8px; color: var(--muted); font-size: 8px; line-height: 1.45; }

.summary-card { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.quantity-control { display: flex; align-items: center; gap: 8px; }
.quantity-control span { margin-right: auto; color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: .7px; }
.quantity-control button { width: 28px; height: 28px; border-radius: 8px; }
.quantity-control strong { min-width: 20px; text-align: center; font-size: 12px; }
.price-row { margin: 14px 0; display: flex; align-items: end; justify-content: space-between; }
.price-row > div { min-width: 0; display: grid; }
.price-row span { overflow: hidden; font-size: 12px; font-weight: 800; text-overflow: ellipsis; }
.price-row small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.price-row > strong { font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.primary-button { width: 100%; min-height: 46px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 11px; background: var(--teal); color: white; font-weight: 800; cursor: pointer; box-shadow: 0 9px 22px rgba(245,130,32,.24); }
.primary-button:hover { background: var(--teal-dark); }
.primary-button b { font-size: 19px; }
.save-button { width: 100%; min-height: 38px; margin-top: 8px; border-radius: 10px; color: var(--muted); font-size: 10px; font-weight: 800; }
.save-status { display: block; min-height: 16px; margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.4; text-align: center; }
.save-status.saving { color: var(--teal-dark); }
.save-status.error { color: #b34839; }

footer { max-width: 1640px; margin: 0 auto; padding: 2px clamp(20px, 4vw, 60px) 28px; display: flex; justify-content: space-between; color: #849399; font-size: 10px; }

.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 0; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 28px 80px rgba(43,43,43,.26); }
.modal::backdrop { background: rgba(43,43,43,.58); backdrop-filter: blur(3px); }
.modal form { position: relative; padding: 32px; }
.modal-close { position: absolute; right: 16px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--soft); cursor: pointer; font-size: 20px; }
.modal-icon { width: 50px; height: 50px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 50%; background: rgba(53,180,119,.12); color: #24935c; font-size: 24px; }
.modal h2 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.modal p:not(.eyebrow) { color: var(--muted); line-height: 1.55; font-size: 13px; }
.modal-summary { margin: 20px 0; padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; border-radius: 12px; background: var(--soft); font-size: 11px; }
.modal-summary dt { color: var(--muted); }
.modal-summary dd { margin: 0; font-weight: 800; text-align: right; }
.modal details { margin-bottom: 17px; }
.modal summary { cursor: pointer; color: var(--teal-dark); font-size: 11px; font-weight: 800; }
.modal pre { max-height: 190px; overflow: auto; padding: 12px; border-radius: 10px; background: #102f3d; color: #d7efec; font: 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.checkout-fields { margin: 18px 0 12px; display: grid; gap: 11px; }
.checkout-fields label { display: grid; grid-template-columns: 1fr auto; gap: 5px; color: var(--ink); font-size: 11px; font-weight: 800; }
.checkout-fields label small { color: var(--muted); font-size: 9px; font-weight: 600; }
.checkout-fields input { grid-column: 1 / -1; width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); outline: none; }
.checkout-fields input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(245,130,32,.1); }
.checkout-fields input[aria-invalid="true"] { border-color: #d76755; }
.form-error { margin: 0 0 10px; padding: 10px 12px; border-radius: 9px; background: #fff1ee; color: #a43f30 !important; font-size: 11px !important; }
.checkout-submit { margin-bottom: 10px; }
.order-confirmation[hidden], #checkoutContent[hidden] { display: none; }
.order-confirmation .modal-summary { margin-bottom: 18px; }
.order-confirmation-preview { margin: 14px 0; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #f5f9f8; }
.order-confirmation-preview img { display: block; width: 100%; max-height: 260px; border-radius: 9px; object-fit: contain; background: white; }
.order-confirmation-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.order-confirmation-actions .primary-button { flex: 1 1 260px; }
.order-confirmation-actions .secondary-button { flex: 0 1 auto; }
.help-modal ol { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 13px; }
.help-modal li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.help-modal li > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); color: var(--teal-dark); font-weight: 900; }
.help-modal li div { display: grid; gap: 2px; }
.help-modal li p { margin: 0; }

.toast { position: fixed; left: 50%; bottom: 26px; z-index: 20; transform: translate(-50%, 24px); padding: 11px 16px; border-radius: 999px; background: var(--ink); color: white; font-size: 11px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

body { padding-bottom: 106px; }
.mug-view-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.mug-view-switch[hidden], .review-modal [hidden] { display: none; }
.mug-view-switch button { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.mug-view-switch button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: white; }
.mug-view-switch .edit-photo-button { border-color: var(--coral); background: var(--coral); color: white; }
.mug-view-switch .edit-photo-button:hover { filter: brightness(.96); }
.mug-view-switch span { color: var(--muted); font-size: 10px; }
.workflow-bar { position: fixed; z-index: 20; bottom: 14px; left: 50%; transform: translateX(-50%); width: min(960px, calc(100% - 28px)); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 36px rgba(43,43,43,.2); }
.workflow-bar > div { display: grid; gap: 4px; }
.workflow-bar strong { font-size: 14px; }
.workflow-bar span { color: var(--muted); font-size: 12px; }
#nextButton, #nextButtonLabel { color: #fff; }
.workflow-bar .primary-button { width: 220px; margin: 0; flex-shrink: 0; }
.toast { z-index: 30; bottom: 110px; }
.review-modal { width: min(1020px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.review-modal form { display: block; max-height: none; overflow: visible; }
.review-modal form > * { flex-shrink: 0; }
.review-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: start; }
.review-modal form > .review-grid { min-height: 0; overflow: visible; margin-bottom: 14px; }
.review-grid figure { margin: 12px 0; }
.review-grid img { width: 100%; display: block; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.review-grid figcaption { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.review-grid .modal-summary { margin: 12px 0; }
.review-approval { display: flex; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 12px; background: var(--soft); font-size: 13px; line-height: 1.5; }
.review-approval input { flex-shrink: 0; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--teal); }
.review-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; position: sticky; bottom: 0; z-index: 1; padding: 10px 0; background: #fff; }
.review-actions .primary-button { width: auto; margin: 0; }
.secondary-button { border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; background: white; color: var(--ink); font-weight: 800; cursor: pointer; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.review-prototype-note { margin-bottom: 0; font-size: 11px !important; }
@media (max-width: 640px) {
  .workflow-bar { gap: 10px; padding: 12px; bottom: max(8px, env(safe-area-inset-bottom)); }
  .workflow-bar span { display: none; }
  .workflow-bar .primary-button { width: 140px; }
  .review-modal form { padding: 24px 16px; }
  .review-grid { grid-template-columns: 1fr; gap: 4px; }
  .review-actions { flex-direction: column-reverse; }
  .review-actions button { width: 100% !important; }
}

@media (max-width: 1180px) {
  .creator-shell { grid-template-columns: 170px minmax(390px, 1fr) 330px; }
  .product-rail, .settings-panel { padding: 18px; }
  .product-button small, .rail-note { display: none; }
  .preview-panel { padding: 20px; }
  .canvas-stage { min-height: 420px; }
}

@media (max-width: 940px) {
  .intro-bar { align-items: start; }
  .progress { display: none; }
  .creator-shell { grid-template-columns: 1fr; overflow: visible; }
  .product-rail { border: 0; border-bottom: 1px solid var(--line); }
  .product-list { grid-template-columns: repeat(4, 1fr); }
  .product-button { grid-template-columns: 36px 1fr; }
  .product-button b { display: none; }
  .preview-panel { border-bottom: 1px solid var(--line); }
  .settings-panel { max-height: none; overflow: visible; border-left: 0; }
  .option-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-panel .upload-card, .settings-panel .text-editor, .settings-panel .summary-card { max-width: 650px; }
  .position-controls { grid-template-columns: 1fr 1fr; }
  .position-controls p { grid-column: 1 / -1; }
  .shirt-print-controls { grid-template-columns: 1fr 1fr; }
  .shirt-print-controls > div, .shirt-print-controls button { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .topbar { min-height: 65px; padding: 0 16px; }
  .brand strong { font-size: 24px; }
  .prototype-pill, .ghost-button { display: none; }
  main { padding: 0 8px 18px; }
  .intro-bar { padding: 25px 10px 18px; }
  h1 { font-size: 34px; }
  .creator-shell { border-radius: 18px; }
  .product-list { grid-template-columns: repeat(2, 1fr); }
  .preview-panel { padding: 16px 10px; }
  .canvas-stage { min-height: 330px; border-radius: 14px; }
  .editor-controls { grid-template-columns: 1fr 1fr; }
  .quality-card { grid-column: 1 / -1; }
  .position-controls { grid-template-columns: 1fr; }
  .position-controls p { grid-column: auto; }
  .shirt-print-controls { grid-template-columns: 1fr; }
  .shirt-print-controls > div, .shirt-print-controls button { grid-column: auto; }
  .option-stack { grid-template-columns: 1fr; }
  footer { display: grid; gap: 4px; }
}

/* Mug editing viewport: keep the 900 x 620 design coordinates unchanged. */
body[data-product="mug"] .product-rail,
body[data-product="mug"] .quantity-control { display: none; }
body[data-product="mug"] .creator-shell { grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
body[data-product="mug"] .intro-bar { padding: 20px 0; }
body[data-product="mug"] #pageTitle { font-size: 28px; }
body[data-product="mug"] .canvas-stage { min-height: 0; aspect-ratio: 900 / 620; }
body[data-product="mug"] .canvas-stage:has(#designCanvas[data-view="wrap360"]) { aspect-ratio: 667 / 337; }
body[data-product="mug"] #designCanvas[data-view="wrap360"] { position: absolute; width: 134.932534%; max-width: none; left: -17.466267%; top: -76.557864%; }
body[data-product="mug"] .canvas-hint { display: none; }
body[data-product="mug"] .settings-nav { position: sticky; top: 0; z-index: 3; }
body[data-product="mug"] .settings-nav button { font-size: 12px; min-height: 44px; }
body[data-product="mug"] .workflow-bar .primary-button span { display: inline; }
@media (max-width: 940px) {
  body[data-product="mug"] .creator-shell { grid-template-columns: minmax(0, 1fr); }
  body[data-product="mug"] .intro-bar { padding: 12px 8px; }
  body[data-product="mug"] .preview-panel { padding: 12px; }
  body[data-product="mug"] .mug-view-switch { margin-top: 10px; }
  body[data-product="mug"] .mug-view-switch > span { display: none; }
  body[data-product="mug"] #mugDimensionsNote { display: none; }
}
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1100px) {
  body[data-product="mug"] { overflow: hidden; }
  body[data-product="mug"] .topbar,
  body[data-product="mug"] .intro-bar .eyebrow,
  body[data-product="mug"] .progress,
  body[data-product="mug"] footer,
  body[data-product="mug"] .settings-heading { display: none; }
  body[data-product="mug"] main { padding: 0 6px; }
  body[data-product="mug"] .intro-bar { padding: 6px 8px; }
  body[data-product="mug"] #pageTitle { font-size: 18px; margin: 0; }
  body[data-product="mug"] .creator-shell { grid-template-columns: minmax(0, 1fr) 280px; height: calc(100dvh - 108px); border-radius: 12px; }
  body[data-product="mug"] .preview-panel,
  body[data-product="mug"] .settings-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
  body[data-product="mug"] .preview-toolbar { gap: 6px; }
  body[data-product="mug"] .preview-toolbar .panel-number { display: none; }
  body[data-product="mug"] .mug-view-switch { gap: 4px; margin-top: 6px; }
  body[data-product="mug"] .mug-view-switch button { padding: 8px; }
  body[data-product="mug"] .canvas-stage { margin-top: 6px; border-radius: 8px; }
  body[data-product="mug"] .settings-nav { margin: 0; }
  body[data-product="mug"] .editor-controls { grid-template-columns: 1fr 1fr; gap: 8px; }
  body[data-product="mug"] .position-controls { grid-template-columns: 1fr; }
  body[data-product="mug"] .workflow-bar { bottom: 4px; padding: 6px 10px; }
  body[data-product="mug"] .workflow-bar span { display: none; }
  body[data-product="mug"] .workflow-bar .primary-button { min-height: 44px; width: 180px; }
}

/* Mobile editing controls, 2026-09-09 */
.position-controls, label:has(#shapeCropX), label:has(#shapeCropY) { display:none !important; }
#reviewMockup { touch-action:none; user-select:none; -webkit-user-drag:none; cursor:grab; }
.mobile-tools { display:none; }
@media(max-width:940px) {
  .mobile-tools { display:flex; position:fixed; bottom:80px; left:8px; right:8px; z-index:21; gap:6px; padding:6px; background:white; border:1px solid #dddddd; border-radius:12px; }
  .mobile-tools button { flex:1; min-height:44px; border:1px solid #8d1b23; border-radius:8px; background:white; color:#8f470d; font-weight:700; }
  body { padding-bottom:170px; }
  .settings-panel { display:flex; flex-direction:column; }
  .settings-heading { order:0; }
  .settings-nav { order:1; }
  #settingsLayers { order:2; margin:8px 0; padding:8px; background:#fafafa; }
  .settings-group,.settings-photos { order:3; }
  .layer-list { max-height:180px; overflow:auto; }
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px) {
  body[data-product="mug"] .creator-shell { height:calc(100dvh - 96px); }
  .mobile-tools { bottom:8px; right:220px; }
  body[data-product="mug"] .workflow-bar { left:auto; right:8px; bottom:8px; transform:none; width:200px; padding:6px; }
  .workflow-bar > div { display:none; }
  body[data-product="mug"] .canvas-stage:has(#designCanvas[data-view="rotate"]) { height:calc(100dvh - 210px); aspect-ratio:auto; }
  body[data-product="mug"] #designCanvas[data-view="rotate"] { position:absolute; inset:0; height:100%; width:100%; object-fit:contain; }
}

/* Photo fit, touch controls and font samples */
.entero-logo{width:185px;height:auto;object-fit:contain}
.fit-controls,.range-buttons{display:flex;gap:8px}
.fit-controls[hidden]{display:none}
.fit-controls button,.range-buttons button{min-height:44px;min-width:44px;padding:8px 12px;border:1px solid #8d1b23;border-radius:8px;background:white;color:#8f470d;font-weight:700}
.fit-controls button[aria-pressed="true"]{background:#8d1b23;color:white}
.range-buttons{display:contents}
.range-buttons button{display:none}
.font-samples{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.font-samples button{min-height:48px;padding:8px;border:1px solid #dddddd;border-radius:8px;background:white;color:#102f3d;font-size:19px;font-weight:400;overflow-wrap:anywhere}
.font-samples button[aria-pressed="true"]{border:2px solid #8d1b23;background:#ffead7}
.typography-field:has(#fontFamily){grid-column:1/-1}
#fontFamily[hidden]{display:none}
.text-palette{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;grid-column:1/-1}
.text-palette button{min-height:36px;border:1px solid #87979c;border-radius:6px}
#mugDimensionsNote{display:none!important}
@media(max-width:940px){
 input[type="range"]{display:block!important;touch-action:pan-y;min-height:36px}
 .range-buttons{display:flex;align-items:center;gap:10px}
 .range-buttons button{display:block;flex:none}
 .collage-controls>small,.zoom-control>small{display:none}
 .collage-editor small:not(#collageStatus):not(.collage-layout-card small){display:none}
}
.range-track{display:block;position:relative;min-width:0;flex:1;width:100%}
.range-track input{width:100%}
.range-touch-surface{display:none}
@media(max-width:940px){.range-touch-surface{display:block;position:absolute;inset:0;touch-action:pan-y}.range-buttons .range-track{width:0}}





.advanced-editor-card { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fafafa; overflow: hidden; }
.advanced-editor-card > summary { list-style: none; cursor: pointer; padding: 13px 16px; font-weight: 800; color: var(--teal-dark); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.advanced-editor-card > summary::-webkit-details-marker { display: none; }
.advanced-editor-card > summary::after { content: "▾"; color: #6d8185; font-size: 14px; transition: transform .2s; }
.advanced-editor-card[open] > summary::after { transform: rotate(180deg); }
.advanced-editor-card .position-controls { margin-top: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.advanced-editor-card .section-label { padding: 0 16px; margin-top: 0; }
.advanced-editor-card .layer-list, .advanced-editor-card .layer-actions { margin-left: 16px; margin-right: 16px; }
.advanced-editor-card .layer-actions { margin-bottom: 16px; }
.advanced-editor-card .photo-corrections { border-top: 1px solid var(--line); }
.product-card-price { display: block; margin-top: 6px; color: var(--teal-dark); font-style: normal; font-weight: 800; }


/* v30 — simple first, advanced later */
.advanced-tab-entry[hidden] { display: none !important; }
.simple-editor-tip { margin: 10px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.settings-nav { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.more-options-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fafafa; overflow: hidden; }
.more-options-panel > summary { list-style: none; cursor: pointer; padding: 14px 15px; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; color: var(--teal-dark); font-weight: 900; }
.more-options-panel > summary::-webkit-details-marker { display: none; }
.more-options-panel > summary::after { content: "＋"; grid-row: 1 / 3; grid-column: 2; font-size: 18px; color: var(--teal); }
.more-options-panel[open] > summary::after { content: "−"; }
.more-options-panel > summary small { color: var(--muted); font-size: 9px; font-weight: 700; }
.more-options-content { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.more-options-content > :first-child { margin-top: 12px; }
.advanced-subsection { padding: 4px 0 10px; border-bottom: 1px solid var(--line); }
.advanced-subsection > summary { display: none; }
.advanced-action-block { margin-top: 14px; padding: 12px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.advanced-action-block strong { font-size: 12px; }
.advanced-action-block span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.advanced-action-block button { margin-top: 5px; }
.advanced-back-button { margin: 0 0 14px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; color: var(--teal-dark); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.text-editor > textarea { min-height: 96px; font-size: 16px; }
.text-editor .text-more-options { margin-top: 12px; }
.settings-persistent.layer-editor { margin-top: 14px; }
#settingsMoreContent > .layer-editor > .advanced-editor-card { margin-top: 0; }
.editor-controls { grid-template-columns: minmax(0,1fr) 170px !important; }
#positionCard .position-controls { grid-template-columns: 1fr 1fr 1fr !important; }
#positionCard .position-controls p { grid-column: 1 / -1; }
@media (max-width: 820px) {
  .settings-nav { position: sticky; top: 0; z-index: 4; background: white; padding-top: 4px; }
  .mobile-tools { grid-template-columns: repeat(5,1fr) !important; }
  .mobile-tools button { min-width: 0; padding-left: 6px; padding-right: 6px; font-size: 10px; }
  .editor-controls { grid-template-columns: 1fr !important; }
  #positionCard .position-controls { grid-template-columns: 1fr !important; }
  .more-options-panel > summary { padding: 14px 13px; }
}

#settingsMoreContent > #positionCard { margin-top: 14px; background: white; }
#settingsMoreContent > #positionCard > summary { font-size: 12px; }


/* v34 — real More Options tab */
.more-options-tab-panel { padding-top: 4px; }
.advanced-section-heading { display: grid; gap: 4px; margin-bottom: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.advanced-section-heading strong { color: var(--teal-dark); font-size: 13px; }
.advanced-section-heading span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.photo-correction-card { margin-top: 0; padding: 12px 0 14px; }
.photo-correction-card p { margin: 6px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.photo-correction-card label { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; margin: 10px 0; color: var(--muted); font-size: 10px; font-weight: 800; }
.photo-correction-card label input { grid-column: 1 / -1; }
.photo-correction-card output { color: var(--teal-dark); font-weight: 900; }
.settings-more-content { margin-top: 14px; display: grid; gap: 12px; }
#settingsMore .collage-editor { margin-top: 14px; }
#settingsMore .advanced-action-block { margin-bottom: 4px; }
@media (max-width: 820px) {
  .settings-nav button { font-size: 9px !important; padding-left: 4px; padding-right: 4px; }
  #settingsTabMore { line-height: 1.15; }
}


/* v35 — persistent mug selector + gallery-first upload action */
.mug-only-tab { display: none; }
body[data-product="mug"] .mug-only-tab { display: block; }
.mug-model-tab-panel { padding-top: 4px; }
.mug-option-stack { display: grid; gap: 10px; }
.mug-tab-heading { margin-bottom: 12px; }
.change-mug-button { margin-top: 5px; padding: 0; border: 0; background: transparent; color: var(--teal-dark); font: inherit; font-size: 10px; font-weight: 900; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.change-mug-button:hover, .change-mug-button:focus-visible { color: var(--teal); outline: none; }
@media (max-width: 820px) {
  .settings-nav { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .mobile-tools { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .mobile-tools button { font-size: 9px; }
}

/* v36: product-photo mug preview + platform picker note */
#positionCard[hidden] { display: none !important; }
.photo-picker-note { grid-column: 1 / -1; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.photo-picker-note.is-warning { color: #74551a; }

/* v41 — dwa tryby: Szybki projekt / Projekt własny */
.design-mode-switch {
  max-width: 1640px;
  margin: -6px auto 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.design-mode-card {
  min-height: 78px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  text-align: left;
  cursor: pointer;
}
.design-mode-card:hover,
.design-mode-card:focus-visible { border-color: rgba(245,130,32,.55); outline: none; }
.design-mode-card.selected { border-color: var(--teal); background: #fff7f0; box-shadow: 0 8px 24px rgba(245,130,32,.09); }
.design-mode-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--soft); color: var(--teal-dark); font-size: 20px; }
.design-mode-card.selected .design-mode-icon { background: var(--teal); color: white; }
.design-mode-card strong { display: block; font-size: 14px; }
.design-mode-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.design-mode-card > b { padding: 5px 8px; border-radius: 999px; background: #ffead7; color: var(--teal-dark); font-size: 9px; }

.quick-designer { display: grid; gap: 12px; }
.quick-designer-heading { display: grid; gap: 4px; margin-bottom: 2px; }
.quick-designer-heading small { color: var(--teal-dark); font-size: 10px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; }
.quick-designer-heading strong { font-size: 16px; line-height: 1.25; }
.quick-step {
  padding: 14px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}
.quick-step-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: white; font-size: 11px; font-weight: 900; }
.quick-step strong { font-size: 13px; }
.quick-step p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.quick-step-wide { min-width: 0; }
.quick-primary-action { grid-column: 2; width: 100%; min-height: 44px; margin-top: 3px; border: 0; border-radius: 10px; background: var(--teal); color: white; font-weight: 900; cursor: pointer; }
.quick-toggle { margin-top: 10px; min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 11px; font-weight: 800; cursor: pointer; }
.quick-toggle input { width: 18px; height: 18px; accent-color: var(--teal); }
.quick-text-fields { margin-top: 9px; display: grid; gap: 6px; }
.quick-text-fields[hidden] { display: none !important; }
.quick-text-fields label { color: var(--muted); font-size: 9px; font-weight: 800; }
.quick-text-fields input { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; }
.quick-text-fields small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.quick-mug-option-stack { margin-top: 10px; display: grid; gap: 8px; }
.quick-mug-card { width: 100%; min-height: 66px; padding: 7px; display: grid; grid-template-columns: 54px minmax(0,1fr) 20px; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; cursor: pointer; }
.quick-mug-card img { width: 54px; height: 54px; object-fit: cover; border-radius: 9px; }
.quick-mug-card span { min-width: 0; }
.quick-mug-card strong { display: block; font-size: 11px; }
.quick-mug-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.quick-mug-card b { opacity: 0; color: var(--teal); }
.quick-mug-card.selected { border-color: var(--teal); background: #fff7f0; }
.quick-mug-card.selected b { opacity: 1; }
.quick-auto-status { padding: 11px 12px; display: flex; gap: 9px; align-items: center; border-radius: 12px; background: #fff7f0; }
.quick-auto-status > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: white; font-size: 12px; font-weight: 900; }
.quick-auto-status div { display: grid; gap: 2px; }
.quick-auto-status strong { font-size: 11px; }
.quick-auto-status small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.quick-manual-link { border: 0; padding: 4px 0; background: transparent; color: var(--teal-dark); font: inherit; font-size: 10px; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

body[data-editor-mode="quick"] .manual-only { display: none !important; }
body[data-editor-mode="manual"] .quick-designer { display: none !important; }
body[data-editor-mode="quick"] .preview-actions,
body[data-editor-mode="quick"] .mug-view-switch,
body[data-editor-mode="quick"] .editor-controls,
body[data-editor-mode="quick"] .photo-placement { display: none !important; }
body[data-editor-mode="quick"] #mugRotationControls {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  background: #fafafa;
}
body[data-editor-mode="quick"] #mugRotationControls label { font-size: 10px; }
body[data-editor-mode="quick"] #mugRotationControls p { margin-top: 6px; font-size: 9px; }
body[data-editor-mode="quick"] .canvas-stage { margin-top: 0; }
body[data-editor-mode="quick"] .settings-panel { padding-top: 22px; }
body[data-editor-mode="quick"] .asset-strip { margin-top: 8px; }
body[data-editor-mode="quick"] .canvas-hint { display: none !important; }
body[data-editor-mode="manual"] .design-mode-card[data-editor-mode="manual"] > b { display: none; }

@media (max-width: 940px) {
  .design-mode-switch { margin: 0 8px 12px; grid-template-columns: 1fr; }
  .design-mode-card { min-height: 68px; padding: 11px 12px; grid-template-columns: 36px minmax(0,1fr) auto; }
  .design-mode-icon { width: 36px; height: 36px; }
  body[data-editor-mode="quick"] .creator-shell { grid-template-columns: 1fr; }
  body[data-editor-mode="quick"] .settings-panel { order: 2; }
}

@media (max-width: 640px) {
  .design-mode-card small { font-size: 9px; }
  .design-mode-card > b { display: none; }
  .quick-step { padding: 12px; }
  .quick-mug-card { grid-template-columns: 50px minmax(0,1fr) 18px; }
  .quick-mug-card img { width: 50px; height: 50px; }
}

.crop-mode-bar {
  position: relative;
  margin: 10px 0;
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(245,130,32,.35);
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 30px rgba(43,43,43,.16);
  backdrop-filter: blur(10px);
}
.crop-mode-bar[hidden] { display: none !important; }
.crop-mode-bar > div:first-child { display: grid; gap: 2px; min-width: 0; }
.crop-mode-bar strong { font-size: 12px; }
.crop-mode-bar span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.crop-mode-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.crop-mode-actions button {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.crop-mode-actions button:first-child,
.crop-mode-actions button:nth-child(2) { width: 40px; padding: 0; font-size: 20px; }
.crop-mode-actions .crop-mode-done { border-color: var(--teal); background: var(--teal); color: white; }
.crop-edit-trigger.is-active { border-color: var(--teal); background: #fff1e3; color: var(--teal-dark); }
.canvas-stage.photo-crop-active #designCanvas { cursor: move; }
.canvas-stage.photo-crop-active .canvas-hint { opacity: 0 !important; }

@media (max-width: 720px) {
  .crop-mode-bar { align-items: stretch; flex-direction: column; }
  .crop-mode-actions { display: grid; grid-template-columns: 44px 44px 1fr 1fr; }
  .crop-mode-actions button { min-width: 0; padding-left: 7px; padding-right: 7px; }
}

.canvas-stage.photo-crop-active { touch-action: none; }
.canvas-stage.photo-crop-active #designCanvas { cursor: grab; }
.canvas-stage.crop-panning #designCanvas { cursor: grabbing; }

/* v52: live RedCart/Entero pricing */
.price-values{display:grid;justify-items:end;align-content:center;gap:1px}
.price-values del{color:var(--muted);font-size:13px;font-weight:650}
.price-values strong.is-promo{color:var(--teal-dark)}
.live-price del{margin-right:4px;color:var(--muted);font-weight:600}
.live-price>span{font-weight:850;color:var(--ink)}
.price-fallback{display:block;margin-top:2px;color:var(--muted);font-size:9px;font-style:normal;font-weight:600}
.quick-mug-card.unavailable{opacity:.5;cursor:not-allowed}

/* v53: isolated crop gesture surface */
.crop-gesture-surface {
  position: absolute;
  z-index: 7;
  box-sizing: border-box;
  border: 2px solid rgba(245,130,32,.95);
  border-radius: 7px;
  background: rgba(245,130,32,.025);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: contain;
}
.crop-gesture-surface[hidden] { display: none !important; }
.crop-gesture-surface.is-panning { cursor: grabbing; }
.crop-gesture-surface > span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(43,43,43,.76);
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  pointer-events: none;
  opacity: .82;
}
.canvas-stage.photo-crop-active #designCanvas { cursor: default; }

/* v57: one shared upload entry and explicit photo/frame interaction. */
.photo-upload-entry {
  max-width: 1640px;
  margin: 0 auto 18px;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.photo-upload-entry .upload-button {
  min-height: 48px;
  background: #8d1b23;
  color: #fff;
  border: 0;
  font-size: 14px;
}
.photo-upload-entry .upload-button:hover { background: #b95500; }
.photo-upload-entry .photo-picker-note { margin-top: 0; font-size: 13px; }
.photo-upload-entry > span { font-size: 11px; }
.photo-interaction-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.photo-interaction-bar[hidden] { display: none !important; }
.photo-interaction-bar button {
  min-height: 44px;
  padding: 8px;
  border: 1px solid #d7c2b0;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.photo-interaction-bar button[aria-pressed="true"] { background: #8d1b23; border-color: #8d1b23; color: #fff; }
.photo-interaction-bar small { grid-column: 1 / -1; font-size: 12px; line-height: 1.45; color: var(--muted); }
.crop-gesture-surface { pointer-events: none; }
.canvas-stage.photo-crop-default { touch-action: none; }
.canvas-stage.photo-crop-default #designCanvas { cursor: grab; }
.canvas-stage.photo-crop-default:has(.is-panning) #designCanvas { cursor: grabbing; }
@media (max-width: 940px) {
  .photo-upload-entry { margin: 0 8px 12px; }
}

.text-layer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.text-layer-actions button { padding: 10px 14px; border: 1px solid #d9d9d9; border-radius: 8px; background: #fff; color: #292929; cursor: pointer; font: inherit; }
#addTextLayerButton { background: #b4252d; color: #fff; border-color: #b4252d; }
#textLayerSelect { width: 100%; min-height: 42px; }

.text-layer-label { margin: 10px 0 6px; font-size: 13px; font-weight: 700; }
.text-layer-picker { display: grid; gap: 8px; margin-bottom: 12px; }
.text-layer-choice { width: 100%; padding: 12px 14px; border: 2px solid #ddd; border-radius: 10px; background: #fff; color: #292929; font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.text-layer-choice[aria-pressed="true"] { border-color: #b4252d; background: #fff1e6; font-weight: 700; }
.text-layer-choice:focus-visible { outline: 3px solid #292929; outline-offset: 2px; }
