/* Unfoldy Studio: monochrome, white, square. Black, plus one orange-red focus colour (--accent) on Order and Find a designer. */
:root {
  --bg: #ffffff;
  --line: #e6e6e6;
  --line-2: #cfcfcf;
  --ink: #000000;
  --text: #111111;
  --muted: #666666; /* 5.7:1 on white (AA for small hint text); was #777 at 4.48:1 */
  --soft: #f5f5f5;
  --danger: #e00000;
  --accent: #d63f00; /* the one focus colour, deeper than the Unfoldy Line #ff4d00 so white text passes 4.5:1: Order + Find a designer only */
  --rail: 72px;
  --drawer: 300px;
  --inspector: 360px;
  --top: 52px;
  font-family: 'Inter', 'Manrope', system-ui, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; border-radius: 0 !important; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body { font-size: 13px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1 { font-family: 'Space Grotesk', 'Manrope', 'Inter', sans-serif; font-size: 40px; letter-spacing: -.03em; font-weight: 700; margin: 0; }
h2 { font-size: 15px; margin: 0 0 6px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink); margin: 24px 0 10px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h3::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.count { color: var(--muted); font-weight: 500; letter-spacing: 0; }
.hint { color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.hint.small { font-size: 11px; margin-top: 10px; }
.muted { color: var(--muted); margin-left: 8px; font-size: 12px; }
.ico { display: block; flex: none; }
.link { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); font-weight: 600; }

/* ---------- logo ---------- */
.logo { width: 30px; height: 30px; display: inline-block; flex: none; }
.logo svg { width: 100%; height: 100%; display: block; }

/* ---------- controls ---------- */
.btn { height: 34px; padding: 0 14px; border: 1px solid var(--ink); background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; transition: background .1s, color .1s; white-space: nowrap; }
.btn:hover { background: var(--ink); color: #fff; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #fff; color: var(--ink); }
#orderBtn, .intro-top .intro-designer { background: var(--accent); border-color: var(--accent); color: #fff; }
#orderBtn:hover, .intro-top .intro-designer:hover { background: #fff; color: var(--accent); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.block { width: 100%; margin-top: 8px; height: 38px; }
.btn.big { height: 50px; font-size: 15px; padding: 0 28px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; border-color: transparent; }
.toggle { height: 30px; padding: 0 12px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 12px; }
.toggle.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.btn-row { display: flex; gap: 6px; margin: 8px 0; }
.btn-row .btn { flex: 1; }
.btn-col { display: grid; gap: 6px; }
.btn-col .btn { justify-content: flex-start; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-weight: 500; cursor: pointer; }
.check input { accent-color: #000; }
.search { width: 100%; height: 36px; border: 1px solid var(--ink); padding: 0 12px; background: #fff; margin-bottom: 10px; }
.search:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.field { margin-bottom: 12px; }
.field > label { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.part-row { display: flex; align-items: center; gap: 10px; }
.part-row input[type=range] { flex: 1; min-width: 0; }
.part-seg { flex: 1; }
.part-r { font-size: 11px; color: var(--muted); }
.field.row { display: flex; align-items: center; gap: 10px; }
.field.row > label { margin: 0; }
.field.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.row2 label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.num-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.num-row .num { display: block; }
.num-row .num span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.num-group:not(:has(> label)) .num-row { grid-template-columns: 1fr; }
input[type=text], input[type=number], input[type=password], select, textarea { width: 100%; border: 1px solid var(--line-2); background: #fff; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
textarea { resize: vertical; line-height: 1.45; }
input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line-2); padding: 2px; background: #fff; cursor: pointer; flex: none; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } input[type=color]::-webkit-color-swatch { border: 0; }
input[type=range] { width: 100%; accent-color: #000; }
.seg { display: flex; border: 1px solid var(--ink); }
.seg button { flex: 1; height: 30px; border: 0; border-right: 1px solid var(--ink); background: #fff; font-weight: 600; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #fff; }
.seg.wide { margin-bottom: 10px; }
.seg[data-bgk="type"] button { min-width: 0; padding: 0 2px; font-size: 11px; white-space: nowrap; }
.seg.tabs button { font-size: 10.5px; flex: 1 1 0; min-width: 0; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.chip { height: 26px; padding: 0 10px; border: 1px solid var(--line-2); background: #fff; font-size: 12px; font-weight: 500; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--ink); padding: 2px 6px; font-weight: 700; }
.pill.live { background: var(--ink); color: #fff; }

/* ---------- top bar ---------- */
.topbar { height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 0 14px; background: #fff; border-bottom: 1px solid var(--ink); position: relative; z-index: 20;
  /* narrow windows: nothing is hidden, the bar scrolls sideways (wheel, drag on the thin bar, or touch) */
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #000 transparent; }
.topbar::-webkit-scrollbar { height: 4px; }
.topbar::-webkit-scrollbar-thumb { background: #000; }
.topbar > * { flex: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.top-center .toggle, .top-right .btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.top-center .toggle .ico, .top-right .btn .ico { flex: none; }
/* "Share with a customer" only for designers, print shops and Unfoldy; "Files" only when the role has print or .unfoldy files */
body:not(.can-share) .share-pro { display: none !important; }
body.print-files-locked.unfoldy-file-locked .pro-files { display: none; }
.topbar .menu { position: fixed; top: auto; right: auto; z-index: 60; }
.brand-name { font-family: 'Space Grotesk', 'Manrope', sans-serif; font-size: 16px; letter-spacing: -.02em; }
.product-switch { margin-left: 8px; border: 1px solid var(--line-2); background: #fff; height: 30px; padding: 0 10px; font-weight: 600; display: flex; align-items: center; }
.product-switch:hover { border-color: var(--ink); }
.top-center, .top-right { display: flex; align-items: center; gap: 6px; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 40px; min-width: 220px; background: #fff; border: 1px solid var(--ink); box-shadow: 4px 4px 0 #000; padding: 4px; display: none; }
.menu.open { display: block; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; font-weight: 500; }
.menu button:hover { background: var(--ink); color: #fff; }

/* ---------- layout ---------- */
.workspace { display: grid; grid-template-columns: var(--rail) var(--drawer) 1fr var(--inspector); height: calc(100% - var(--top)); transition: grid-template-columns .25s; }
.workspace.wide-flat { --inspector: 46vw; }
.rail { border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 6px 0; background: #fff; }
.rail-btn { border: 0; background: none; padding: 10px 0 9px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--muted); border-left: 2px solid transparent; }
.rail-btn:hover { color: var(--ink); }
.rail-btn.active { color: var(--ink); border-left-color: var(--ink); }
.drawer { border-right: 1px solid var(--line); overflow-y: auto; background: #fff; }
.panel { display: none; padding: 16px 16px 40px; }
.panel.active { display: block; }

/* ---------- package panel ---------- */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.product-card { border: 1px solid var(--line); background: #fff; padding: 8px 8px 10px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.product-card:hover { border-color: var(--ink); }
.product-card.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.product-card .pkg-art { width: 100%; height: 74px; }
.product-card b { font-size: 12.5px; }
.product-card span { font-size: 11px; color: var(--muted); }
.custom-dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.custom-dims label { font-size: 10.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- line art ---------- */
.pkg-art { overflow: visible; }
.pkg-art .p-floor { fill: #000; opacity: .08; }

/* ---------- AI ---------- */
.ai-status { margin: 10px 0 0; color: var(--muted); line-height: 1.5; font-size: 12px; display: block; }
.ai-status a { color: var(--ink); font-weight: 600; }
.ai-status.err { color: var(--danger); }
.ai-results { display: grid; gap: 8px; margin-top: 10px; }
.ai-card { border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; padding: 0; display: block; width: 100%; }
.ai-card:hover { border-color: var(--ink); box-shadow: 4px 4px 0 #000; transform: translate(-2px, -2px); }
.ai-card img { display: block; width: 100%; aspect-ratio: 2.3; object-fit: cover; background: var(--soft); border-bottom: 1px solid var(--line); }
.ai-card div { display: flex; justify-content: space-between; padding: 8px 10px; font-weight: 600; font-size: 12px; gap: 8px; }
.ai-card div span { color: var(--muted); font-weight: 500; white-space: nowrap; }
.skeleton { height: 150px; background: linear-gradient(90deg, #f3f3f3, #fafafa, #f3f3f3); background-size: 200% 100%; animation: sk 1.1s linear infinite; border: 1px solid var(--line); }
@keyframes sk { to { background-position: -200% 0; } }
.example-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.example-list button { border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; padding: 9px 2px; font-size: 12px; line-height: 1.4; display: flex; gap: 8px; }
.example-list button b { flex: none; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding-top: 2px; width: 62px; color: var(--muted); }
.example-list button:hover { background: var(--soft); }
.dots i { display: inline-block; width: 5px; height: 5px; background: #000; margin-right: 3px; animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- text ---------- */
.text-presets { display: grid; gap: 4px; }
.text-preset { border: 1px solid var(--line); background: #fff; padding: 12px; text-align: left; line-height: 1.15; }
.text-preset:hover { border-color: var(--ink); }
.font-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.font-item { border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 9px 4px; text-align: left; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.font-item:hover { background: var(--soft); }
.font-item span { font: 600 10px Inter, sans-serif; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.font-item { justify-content: flex-start; gap: 8px; }
.font-item b { font-weight: 400; font-size: 19px; line-height: 1.15; white-space: nowrap; }
.font-item span { margin-left: auto; text-align: right; }
.font-item .abg { font: 700 9px Inter, sans-serif; font-style: normal; border: 1px solid var(--ink); padding: 2px 3px; letter-spacing: .04em; flex: none; width: 30px; text-align: center; }
.font-item .abg[hidden] { display: inline-block; visibility: hidden; }
#fontUploadBtn { white-space: normal; height: auto; min-height: 38px; padding: 6px 10px; line-height: 1.3; text-align: center; }
.art-colours { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.art-colours label { position: relative; width: 30px; height: 30px; border: 1px solid var(--ink); cursor: pointer; }
.art-colours input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.art-colours i { position: absolute; inset: 3px; pointer-events: none; }

/* ---------- library ---------- */
.lib-meta { font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.lib-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.lib-grid button { aspect-ratio: 1; border: 1px solid var(--line); background: #fff; padding: 10px; display: grid; place-items: center; }
.lib-grid button:hover { border-color: var(--ink); }
.lib-grid img, .lib-grid svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.lib-sets { display: grid; grid-template-columns: repeat(3, 1fr); border-right: 0; border-bottom: 0; }
.lib-sets button, .seg.tabs.lib-sets button { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-size: 11.5px; overflow: visible; text-overflow: clip; }
.lib-sec { border-top: 1px solid var(--line); padding: 2px 0 8px; }
.lib-sec summary { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; list-style: none; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.lib-sec summary::-webkit-details-marker { display: none; }
.lib-sec summary::after { content: '+'; margin-left: auto; font-size: 16px; line-height: 1; }
.lib-sec[open] summary::after { content: '\2013'; }
.lib-sec summary .count { color: var(--muted); font-weight: 400; }
.lib-sec .lib-more { height: 32px; margin-top: 6px; }
.lib-credit { margin: 6px 0 0; }
.lib-note { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0 0 10px; }
.lib-chips span { font-size: 11px; color: var(--muted); margin-right: 2px; }
.lib-chips button { border: 1px solid var(--line); background: #fff; padding: 3px 8px; font-size: 12px; }
.lib-chips button:hover { border-color: var(--ink); }

/* ---------- uploads ---------- */
.dropzone { border: 1px dashed var(--ink); padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); }
.dropzone b { color: var(--ink); }
.dropzone.over { background: var(--soft); }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; }
.upload-grid button { aspect-ratio: 1; border: 1px solid var(--line); background: #fff; padding: 6px; }
.upload-grid img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- pattern / background editor ---------- */
.bg-editor .colors { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.bg-editor .colors label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.swatches { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0; border: 1px solid var(--line); margin-bottom: 12px; }
.swatches button { aspect-ratio: 1; border: 0; padding: 0; }
.swatches button:hover { outline: 2px solid #000; outline-offset: -2px; position: relative; }
.swatches .sw-clear { background: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%) 0 0 / 10px 10px; box-shadow: inset 0 0 0 1px #c8c8c8; }
.swatches .sw-clear.on { outline: 2px solid #000; outline-offset: -2px; }
.pattern-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 12px; }
.pattern-grid button { border: 1px solid var(--line); background: #fff; padding: 0; text-align: left; }
.pattern-grid button canvas { width: 100%; display: block; aspect-ratio: 2; }
.pattern-grid button span { display: block; padding: 4px 6px; font-size: 11px; font-weight: 600; border-top: 1px solid var(--line); }
.pattern-grid button.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.radial-pad { position: relative; height: 110px; border: 1px solid var(--line-2); margin-bottom: 10px; cursor: crosshair; overflow: hidden; }
.radial-pad i { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #000; background: #fff; pointer-events: none; }
.radial-pad em { position: absolute; border: 1px dashed #000; pointer-events: none; border-radius: 50% !important; }

/* ---------- palette ---------- */
.pal-list { display: grid; gap: 4px; margin-top: 8px; }
.pal { border: 1px solid var(--line); background: #fff; padding: 0; text-align: left; display: grid; grid-template-columns: 1fr auto; align-items: stretch; }
.pal:hover { border-color: var(--ink); }
.pal .strip { display: flex; height: 34px; }
.pal .strip i { flex: 1; }
.pal span { font-size: 11.5px; font-weight: 600; padding: 0 10px; display: flex; align-items: center; border-left: 1px solid var(--line); min-width: 96px; }

/* ---------- layers ---------- */
.layer-list { display: grid; gap: 0; margin-top: 10px; border-top: 1px solid var(--line); }
.layer { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 5px 4px 5px 8px; background: #fff; cursor: pointer; user-select: none; }
.layer:hover { background: var(--soft); }
.layer.on { background: var(--ink); color: #fff; }
.layer.on .mini { color: #fff; }
.layer.in-folder { padding-left: 26px; }
.layer .sw { width: 20px; height: 20px; flex: none; border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; background: #fff; }
.layer .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer .mini { width: 24px; height: 24px; border: 0; background: none; display: grid; place-items: center; color: #555; opacity: .75; }
.layer .mini:hover { opacity: 1; }
.layer.hidden .nm { opacity: .4; text-decoration: line-through; }
.folder { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding: 7px 4px; font-weight: 700; font-size: 12px; cursor: pointer; user-select: none; background: #fafafa; }
.folder:hover { background: var(--soft); }
.folder.on { box-shadow: inset 3px 0 0 #000; }
.folder .nm { flex: 1; }
.folder .n { color: var(--muted); font-weight: 500; }
.folder .mini { width: 24px; height: 24px; border: 0; background: none; display: grid; place-items: center; }
.folder input { border: 1px solid #000; padding: 2px 4px; font-weight: 700; }
.empty { color: var(--muted); padding: 18px 4px; }

/* ---------- stage ---------- */
.stage { position: relative; overflow: hidden; background: #fff; }
#viewport { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#viewport.grab { cursor: grab; } #viewport.grabbing { cursor: grabbing; } #viewport.move { cursor: move; } #viewport.pointer { cursor: pointer; }
.gizmo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.gizmo .g-box { fill: none; stroke: #000; stroke-width: 1.5; }
.gizmo .g-box2 { fill: none; stroke: #fff; stroke-width: 3.5; opacity: .9; }
.gizmo .g-h { fill: #fff; stroke: #000; stroke-width: 1.5; pointer-events: all; cursor: nwse-resize; }
.gizmo .g-rot { fill: #000; stroke: #fff; stroke-width: 1.5; pointer-events: all; cursor: grab; }
.gizmo .g-stem { stroke: #000; stroke-width: 1.5; }
.gizmo .g-snap { stroke: #ff2d55; stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.gizmo .g-hover { fill: none; stroke: #000; stroke-width: 1; stroke-dasharray: 3 3; }
.gizmo .g-axis-x { stroke: #000; stroke-width: 2; } .gizmo .g-axis-y { stroke: #000; stroke-width: 2; }
.gizmo .g-label { font: 600 11px Inter, sans-serif; fill: #000; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.stage-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--ink); padding: 6px 12px; font-size: 12px; width: max-content; max-width: calc(100% - 32px); text-align: center; transition: opacity .6s; pointer-events: none; }
.stage-toolbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--ink); padding: 4px; box-shadow: 4px 4px 0 #000; }
.tool-btn, .stage-toolbar .toggle { white-space: nowrap; }
.tool-btn { height: 30px; padding: 0 10px; border: 0; background: none; font-weight: 600; font-size: 12px; display: grid; place-items: center; }
.tool-btn:hover { background: var(--ink); color: #fff; }
.tool-btn.icon { width: 30px; padding: 0; }
.stage-toolbar .tb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted, #777); padding: 0 6px 0 8px; align-self: center; }
.view-seg { display: flex; border: 1px solid var(--ink); }
.view-seg .tool-btn + .tool-btn { border-left: 1px solid var(--ink); }
.stage-toolbar .toggle { border-color: transparent; }
.stage-toolbar .toggle.on { border-color: var(--ink); }

/* ---------- inspector ---------- */
.inspector { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.flat-card { border-bottom: 1px solid var(--ink); padding: 10px 12px; display: flex; flex-direction: column; flex: 0 0 auto; height: 40%; min-height: 220px; }
.workspace.wide-flat .flat-card { height: 58%; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.head-tools { display: flex; align-items: center; gap: 8px; }
#layoutInfo { display: none; }
.flat-host { flex: 1; min-height: 0; display: grid; place-items: center; background: #f2f2f2; border: 1px solid var(--line); overflow: hidden; }
.flat-host.zoomed { overflow: auto; place-items: start; }
.flat-host.zoomed .flat-wrap { margin: 12px; }
.zoom-ctl { display: inline-flex; align-items: center; border: 1px solid #000; margin-right: 6px; }
.zoom-ctl .icon-sm { width: 24px; height: 24px; border: 0; font-size: 15px; line-height: 1; }
.zoom-val { border: 0; background: none; font: 600 11px 'Space Mono', monospace; min-width: 44px; height: 24px; border-left: 1px solid #000; border-right: 1px solid #000; cursor: pointer; }
.flat-wrap { position: relative; box-shadow: 3px 3px 0 #000; outline: 1px solid #000; }
.flat-wrap .canvas-container { position: absolute !important; left: 0; top: 0; }
.switch { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch span { width: 26px; height: 14px; border: 1px solid #000; position: relative; background: #fff; }
.switch span::after { content: ''; position: absolute; width: 8px; height: 8px; background: #000; top: 2px; left: 2px; transition: .12s; }
.switch input:checked + span { background: #000; }
.switch input:checked + span::after { left: 14px; background: #fff; }
.props { padding: 14px 14px 30px; overflow-y: auto; flex: 1; }
.props-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.props-head h2 { margin: 0; }
.props-actions { display: flex; gap: 2px; }
.icon-sm { width: 30px; height: 30px; border: 1px solid transparent; background: none; display: grid; place-items: center; }
.icon-sm:hover { border-color: var(--ink); }
.icon-sm.danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-row { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.icon-row .icon-sm { border-color: var(--line); }
.icon-row .icon-sm:hover { border-color: var(--ink); }
.icon-row .icon-sm.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-field { display: flex; gap: 6px; align-items: center; }
.color-field input[type=text] { font-family: 'Space Mono', monospace; font-size: 12px; }
.mini-swatches { display: flex; gap: 0; margin-top: 6px; border: 1px solid var(--line); }
.mini-swatches button { flex: 1; height: 18px; border: 0; padding: 0; }
.mini-swatches button:hover { outline: 2px solid #000; outline-offset: -2px; }
.props-sub { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }
.props .bg-editor { margin-top: 4px; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(255, 255, 255, .8); display: none; place-items: center; z-index: 50; }
.modal.open { display: grid; }
.modal-card { width: min(480px, 92vw); background: #fff; border: 1px solid var(--ink); box-shadow: 8px 8px 0 #000; padding: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; background: #fff; z-index: 100; display: flex; flex-direction: column; overflow: auto; transition: opacity .4s; }
.intro.hide { opacity: 0; pointer-events: none; }
.intro-top { display: flex; align-items: center; gap: 10px; padding: 18px 28px; border-bottom: 1px solid var(--ink); font-family: 'Space Grotesk', 'Manrope', sans-serif; font-size: 17px; }
.intro-top .logo { width: 34px; height: 34px; }
.intro-sub { color: var(--muted); font-family: Inter, sans-serif; font-size: 13px; margin-left: 6px; }
.intro-step { display: none; padding: 48px 28px 40px; max-width: 1180px; width: 100%; margin: 0 auto; animation: rise .45s cubic-bezier(.2, .8, .2, 1); }
.intro-step.on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.intro-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 34px; }
.intro-head .link { margin-left: auto; }
.step-no { font-family: 'Space Mono', monospace; font-size: 13px; border: 1px solid #000; padding: 3px 7px; transform: translateY(-8px); }
.intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid #000; border-left: 1px solid #000; }
.intro-card { border: 0; border-right: 1px solid #000; border-bottom: 1px solid #000; background: #fff; padding: 22px 22px 18px; text-align: left; display: flex; flex-direction: column; gap: 4px; position: relative; }
.intro-card .pkg-art { width: 100%; height: 190px; margin-bottom: 10px; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.intro-card b { font-family: 'Space Grotesk', 'Manrope', sans-serif; font-size: 20px; letter-spacing: -.01em; }
.intro-card span { color: var(--muted); }
.intro-card em { position: absolute; top: 14px; right: 16px; font: 600 11px 'Space Mono', monospace; color: var(--muted); font-style: normal; }
.intro-card:hover { background: #fafafa; }
.intro-card:hover .pkg-art { transform: translateY(-6px) rotate(-2deg); }
.size-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
.size-art { border: 1px solid #000; height: 420px; display: grid; place-items: center; background: #fff; position: relative; }
.size-art .pkg-art { width: 72%; height: 72%; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.size-art .dim { position: absolute; bottom: 14px; left: 16px; font: 600 12px 'Space Mono', monospace; }
.size-row { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #000; border-left: 1px solid #000; margin-bottom: 18px; }
.size-card { border: 0; border-right: 1px solid #000; border-bottom: 1px solid #000; background: #fff; padding: 18px 16px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.size-card b { font-family: 'Space Grotesk', 'Manrope', sans-serif; font-size: 34px; line-height: 1; }
.size-card strong { font-size: 13px; }
.size-card span { color: var(--muted); font-size: 12px; font-family: 'Space Mono', monospace; }
.size-card:hover { background: #fafafa; }
.size-card.on { background: #000; color: #fff; }
.size-card.on span { color: #bbb; }
.custom-size { margin-bottom: 22px; }
.custom-size .custom-dims input { height: 38px; }
.custom-size > b { display: block; margin-bottom: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.size-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.size-pick .size-row, .size-pick .custom-size { width: 100%; }
.size-pick .link { margin-top: 12px; }

/* ---------- loader ---------- */
.sel-preview { height: 110px; border: 1px solid #000; margin: 0 0 12px; display: grid; place-items: center; padding: 8px;
  background: #fff conic-gradient(#ececec 25%, #fff 0 50%, #ececec 0 75%, #fff 0) 0 0 / 14px 14px; }
.sel-preview img { max-width: 100%; max-height: 94px; object-fit: contain; image-rendering: auto; }
.start-card { position: absolute; left: 0; right: 0; margin: 0 auto; top: 18px; z-index: 6; width: min(460px, calc(100% - 32px)); box-sizing: border-box; background: #fff; border: 1px solid #000; box-shadow: 6px 6px 0 #000; padding: 14px 16px; display: grid; gap: 8px; animation: rise .35s ease both; }
[hidden] { display: none !important; }
.start-card:not([hidden]) ~ .stage-hint { opacity: 0 !important; }
.start-card b { font-size: 14px; }
.start-card span { font-size: 13px; color: var(--muted, #555); line-height: 1.45; }
.start-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.loader { position: fixed; inset: 0; z-index: 90; background: #fff; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 22px; transition: opacity .5s; }
.loader.on { display: flex; }
.loader.hide { opacity: 0; pointer-events: none; }
.loader-art { width: 260px; height: 260px; will-change: transform; animation: loaderFloat 2.6s ease-in-out infinite; }
@keyframes loaderFloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.loader.on .loader-art, .loader.on .loader-meta, .loader.on .loader-bar { animation-fill-mode: both; }
.loader.on .loader-meta { animation: rise .5s ease both; }
.loader-art .pkg-art { width: 100%; height: 100%; }
.loader-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.loader-meta b { font-family: 'Space Grotesk', 'Manrope', sans-serif; font-size: 22px; }
.loader-meta span { color: var(--muted); font-family: 'Space Mono', monospace; font-size: 12px; }
.loader-bar { width: 260px; height: 6px; border: 1px solid #000; }
.loader-bar { overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 100%; background: #000; transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
body.booting .topbar, body.booting .workspace { visibility: hidden; }

/* product motion (loader + hover) */
.anim .p-lid, .anim .p-handle, .anim .p-sway, .anim .p-body, .anim .p-steam, .anim .p-fill { transform-box: fill-box; }
.anim { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.anim[data-art=foodbox] .p-lid { transform-origin: 0% 100%; animation: lid 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes lid { 0%, 15%, 85%, 100% { transform: none; } 40%, 60% { transform: translate(-4px, -22px) rotate(-14deg); } }
.anim[data-art=paperbag] .p-handle { transform-origin: 50% 100%; animation: swing 1.6s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.anim[data-art=tote] .p-sway { transform-origin: 50% 0%; animation: swing 2s ease-in-out infinite alternate; }
.anim[data-art=jar] .p-lid { transform-origin: 50% 50%; animation: twist 2.4s ease-in-out infinite; }
@keyframes twist { 0%, 20%, 80%, 100% { transform: none; } 45%, 55% { transform: translateY(-18px) rotate(8deg); } }
.anim[data-art=glass] .p-fill { transform-origin: 50% 100%; animation: fill 2.4s ease-in-out infinite; }
@keyframes fill { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.anim[data-art=coffeecup] .p-lid { animation: pop 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes pop { 0%, 20%, 80%, 100% { transform: none; } 45%, 55% { transform: translateY(-14px); } }
.anim[data-art=coffeecup] .p-steam { animation: steam 2.4s ease-in-out infinite; }
@keyframes steam { 0%, 100% { opacity: 0; transform: translateY(6px); } 50% { opacity: 1; transform: none; } }
.anim[data-art=custom] .p-body { transform-origin: 50% 50%; animation: twist 2.4s ease-in-out infinite; }
.draw path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (max-width: 1200px) { :root { --drawer: 270px; --inspector: 320px; } .intro-grid { grid-template-columns: repeat(2, 1fr); } .size-layout { grid-template-columns: 1fr; } .size-art { height: 280px; } }

/* language switch */
.lang-switch { display: flex; border: 1px solid #000; margin-left: auto; }
.topbar .lang-switch { margin: 0 4px; }
.lang-switch button { border: 0; background: #fff; height: 26px; padding: 0 8px; font: 700 11px 'Space Mono', monospace; letter-spacing: .05em; }
.lang-switch button.on { background: #000; color: #fff; }

/* dropdown sections (Templates, Adjust) */
details.drop { border: 1px solid var(--ink); margin: 14px 0 0; background: #fff; }
details.drop > summary { list-style: none; cursor: pointer; height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; user-select: none; }
details.drop > summary::-webkit-details-marker { display: none; }
details.drop > summary::after { content: '+'; font-size: 18px; font-weight: 400; }
details.drop[open] > summary { border-bottom: 1px solid var(--ink); }
details.drop[open] > summary::after { content: '−'; }
details.drop > summary:hover { background: #f4f4f4; }
.drop-body { padding: 4px 12px 12px; }
.drop-body > h3:first-child { margin-top: 10px; }
#palPrompt { margin-bottom: 8px; }
.pattern-box { border: 1px solid var(--ink); padding: 10px 12px; margin-top: 10px; }

/* round 4 */
.layer, .folder { min-width: 0; }
.layer .nm, .folder .nm { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.layer-list, .drawer .panel { overflow-x: hidden; }
.top-right #settingsBtn { margin-left: 4px; }
.warn-box { display: flex; gap: 8px; align-items: flex-start; border: 1px solid #111; padding: 8px 10px; margin: -2px 0 12px; font-size: 12px; line-height: 1.4; background: repeating-linear-gradient(135deg, #fff 0 6px, #f3f3f3 6px 12px); }
.warn-box svg { flex: none; margin-top: 1px; }
.warn-box .btn { margin-top: 6px; }
.modal-card.wide { width: min(620px, 94vw); max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }
#setTabs { margin-bottom: 14px; }
.set-pane { display: none; }
.set-pane.on { display: block; }
.env-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.env-grid button { border: 1px solid var(--ink); background: #fff; padding: 0; text-align: left; font-weight: 600; font-size: 12px; }
.env-grid button i { display: block; height: 46px; border-bottom: 1px solid var(--ink); }
.env-grid button span { display: block; padding: 5px 7px; }
.env-grid button.on { box-shadow: 4px 4px 0 #000; transform: translate(-2px, -2px); }
.stage-toolbar .tool-btn.on { background: var(--ink); color: #fff; }
.intro-material { margin: 4px 0 18px; }
.intro-material h4 { font: 700 11px 'Space Mono', monospace; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 8px; }
.mat-row { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid #000; border-left: 1px solid #000; }
.mat-row button { border: 0; border-right: 1px solid #000; border-bottom: 1px solid #000; background: #fff; padding: 12px; display: flex; align-items: center; gap: 10px; text-align: left; font-weight: 600; }
.mat-row button i { width: 34px; height: 34px; border: 1px solid #000; flex: none; }
.mat-row button span { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.mat-row button.on { background: #000; color: #fff; }
.mat-row button.on span { color: #ccc; }
.surface-seg { margin-bottom: 8px; }
.plate-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.plate-list span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #000; padding: 3px 8px; font-size: 12px; }
.plate-list i { width: 12px; height: 12px; border: 1px solid #000; display: inline-block; }
.progress { position: relative; height: 26px; border: 1px solid #000; margin: 10px 0 0; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #000; transition: width .2s; }
.progress span { position: relative; z-index: 1; padding-left: 8px; line-height: 24px; font-size: 12px; mix-blend-mode: difference; color: #fff; }
#exportMenu b { font-weight: 700; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
/* round 5: two product groups in the intro */
.intro-grid { grid-template-columns: repeat(4, 1fr); }
.intro-card .pkg-art { height: 140px; }
.intro-group { grid-column: 1 / -1; margin: 0; padding: 10px 14px; border-right: 1px solid #000; border-bottom: 1px solid #000; font: 600 11px 'Space Mono', monospace; text-transform: uppercase; letter-spacing: .08em; background: #fff; }

/* Illustrator import, client dialog */
.menu-sep { display: block; height: 1px; background: var(--line-2); margin: 4px 6px; }
/* print files (PDF, print PNG, layered SVG) only for print shops and Unfoldy; everyone else orders through Unfoldy */
body.print-files-locked [data-printfile], body.unfoldy-file-locked [data-unfoldyfile] { display: none !important; }
.menu-note { display: none; margin: 4px 10px 6px; font-size: 12px; line-height: 1.4; color: var(--muted, #666); max-width: 240px; }
body.print-files-locked .menu-note { display: block; }
.import-zone { margin-top: 12px; }
.import-report { margin-top: 12px; border: 1px solid var(--ink); padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.import-report b { display: block; margin-bottom: 4px; }
.import-report .warn { color: #b42318; }
.import-report .sw { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--ink); margin: 0 3px -3px 0; }
input[type=email], input[type=tel] { width: 100%; border: 1px solid var(--line-2); background: #fff; padding: 8px 10px; }
#clientForm input:not([type]) { width: 100%; border: 1px solid var(--line-2); background: #fff; padding: 8px 10px; }
.wl-badge { font-size: 12px; border: 1px solid var(--ink); padding: 4px 8px; margin-left: 8px; white-space: nowrap; }

/* toast with an action */
.toast.has-act { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast button { background: #fff; color: var(--ink); border: 0; height: 26px; padding: 0 10px; font-weight: 700; cursor: pointer; }
/* keyboard shortcuts */
.keys-btn { font-weight: 700; font-size: 15px; }
.keys-card { width: min(860px, 94vw); }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 26px; }
.keys-grid h3 { margin: 14px 0 6px; }
.key-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px solid #eee; font-size: 13px; }
.key-row .keys { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 3px; white-space: nowrap; }
.key-row .keys i { font-style: normal; color: #888; margin: 0 3px; }
kbd { font-family: inherit; font-size: 11px; font-weight: 700; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border: 1px solid var(--ink); box-shadow: 2px 2px 0 #000; background: #fff; }
/* background removal */
.bgr-card { width: min(1040px, 96vw); max-height: 94vh; overflow: auto; }
.bgr-body { display: grid; grid-template-columns: 1fr 290px; gap: 18px; }
.bgr-stage { position: relative; display: grid; place-items: center; min-height: 360px; max-height: 72vh; border: 1px solid var(--ink); padding: 12px;
  background: repeating-conic-gradient(#e9e9e9 0 25%, #fff 0 50%) 0 0 / 18px 18px; touch-action: none; }
.bgr-stage canvas { max-width: 100%; max-height: calc(72vh - 26px); display: block; }
.bgr-busy { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; padding: 4px 10px; font-size: 12px; font-weight: 600; display: none; }
.bgr-busy.on { display: block; }
.bgr-side .seg button { flex: 1; }
.bgr-sw { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bgr-sw button { width: 28px; height: 28px; border: 1px solid var(--ink); cursor: pointer; }
.bgr-side .check { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0; }
.bgr-side .modal-actions { flex-wrap: wrap; }
@media (max-width: 760px) { .bgr-body { grid-template-columns: 1fr; } }
.key-row .combo { display: inline-flex; gap: 3px; white-space: nowrap; }
.key-row > span:first-child { flex: 1; }
.keys-card { width: min(980px, 96vw); }
/* AR preview (read-only) */
.ar-modal { position: fixed; inset: 0; z-index: 70; background: #fff; display: none; flex-direction: column; }
.ar-modal.open { display: flex; }
.ar-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--ink); }
.ar-top b { font-size: 16px; }
.ar-note { flex: 1; font-size: 13px; color: #555; }
.ar-stage { flex: 1; position: relative; background: radial-gradient(circle at 50% 40%, #fff, #ececec); }
.ar-stage model-viewer { width: 100%; height: 100%; --poster-color: transparent; }
.ar-go { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); height: 48px; padding: 0 26px; background: var(--ink); color: #fff; border: 0; font-weight: 700; font-size: 15px; box-shadow: 5px 5px 0 #000; cursor: pointer; }
.ar-btn { font-weight: 700; }

/* ---------- phones: full-screen 3D, guided steps, tools in a bottom sheet (js/mobile.js) ---------- */
.m-nav, .m-head, .m-finish, .m-edit-chip { display: none; }
body.mobile { --nav: calc(60px + env(safe-area-inset-bottom)); --sheet: min(40vh, 380px); --mhead: 72px; --top: 48px; }
body.mobile .topbar { padding: 0 8px; gap: 6px; overflow: hidden; }
body.mobile .brand-name, body.mobile .top-center .sep, body.mobile #snapBtn,
body.mobile #keysBtn, body.mobile #settingsBtn, body.mobile .topbar .lang-switch,
body.mobile .topbar .menu-wrap, body.mobile #designerReqBtn, body.mobile #shareBtn, body.mobile #accountBtn { display: none; }
body.mobile .brand { flex: 1 1 auto; min-width: 0; }
body.mobile .top-right { flex: none; }
body.mobile #orderBtn { height: 34px; padding: 0 12px; }
body.mobile .icon-btn { width: 34px; height: 34px; }
@media (max-width: 360px) { body.mobile #redoBtn { display: none; } }
body.mobile .brand { gap: 8px; }
body.mobile .product-switch { margin-left: 0; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; gap: 6px; }
body.mobile .product-switch #productTitle { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.mobile .product-switch .muted { flex: none; }
body.mobile .top-center { gap: 0; }
body.mobile #exportBtn { height: 34px; padding: 0 12px; }
body.mobile .workspace { display: block; height: calc(100% - var(--top)); position: relative; }
body.mobile .rail { display: none; }
body.mobile .stage { position: fixed; left: 0; right: 0; top: var(--top); bottom: var(--nav); transition: bottom .25s; }
body.mobile.m-open .stage { bottom: calc(var(--nav) + var(--sheet) + var(--mhead)); }
body.mobile .stage-hint { display: none; }
body.mobile .stage-bottom { bottom: 10px; left: 10px; right: 10px; }
body.mobile .stage-toolbar { bottom: 10px; box-shadow: 3px 3px 0 #000; padding: 3px; max-width: calc(100% - 20px); overflow-x: auto; scrollbar-width: none; }
body.mobile .stage-toolbar .tb-label, body.mobile #shotBtn, body.mobile #spinBtn, body.mobile #focusBtn, body.mobile .stage-toolbar .sep { display: none; }
body.mobile .stage-toolbar .tool-btn { height: 34px; padding: 0 10px; }
body.mobile.m-open .stage-toolbar { display: none; }
body.mobile .start-card { top: 10px; width: calc(100% - 20px); padding: 12px; box-shadow: 4px 4px 0 #000; }
body.mobile .start-actions .btn { flex: 1 1 140px; }

/* the sheet: one of drawer / inspector / finish list, under a shared header */
body.mobile .drawer, body.mobile .inspector, body.mobile .m-finish { position: fixed; left: 0; right: 0; bottom: var(--nav); height: var(--sheet); z-index: 30; background: #fff; border: 0; display: none; }
body.mobile.m-open[data-msheet="drawer"] .drawer { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
body.mobile.m-open[data-msheet="inspector"] .inspector { display: flex; }
body.mobile.m-open[data-msheet="finish"] .m-finish { display: grid; }
body.mobile .drawer .panel { padding: 12px 14px 24px; }
body.mobile .drawer .panel > h2 { display: none; }
body.mobile .inspector .flat-card { height: 100%; min-height: 0; border: 0; }
body.mobile[data-minsp="layout"] .inspector .props { display: none; }
body.mobile[data-minsp="props"] .inspector .flat-card { display: none; }
body.mobile .inspector .props { padding: 12px 14px 24px; }
body.mobile .m-head { display: none; position: fixed; left: 0; right: 0; bottom: calc(var(--nav) + var(--sheet)); height: var(--mhead); z-index: 31; background: #fff; border-top: 1px solid #000; padding: 8px 10px 0 14px; flex-direction: column; gap: 6px; }
body.mobile.m-open .m-head { display: flex; }
body.mobile.m-nosub { --mhead: 48px; }
.m-head-top { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.m-step { font: 700 11px 'Space Mono', monospace; background: #000; color: #fff; padding: 3px 6px; flex: none; }
.m-hint { flex: 1; min-width: 0; font-size: 12px; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-next { height: 30px; padding: 0 12px; border: 1px solid #000; background: #000; color: #fff; font-weight: 700; flex: none; }
.m-next::after { content: ' →'; }
.m-close { width: 32px; height: 30px; border: 1px solid #000; background: #fff; display: grid; place-items: center; flex: none; }
.m-sub { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin: 0 -10px 0 -14px; padding: 0 14px; }
.m-sub button { border: 0; background: none; padding: 8px 12px 9px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.m-sub button.on { color: #000; border-bottom-color: #000; }
.m-sub:empty { display: none; }
body.mobile .m-finish { padding: 14px; gap: 8px; align-content: start; overflow-y: auto; }
.m-big { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid #000; background: #fff; }
.m-big:first-child { background: #000; color: #fff; }
.m-big[data-mf="order"], .m-big[data-mf="designer"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.m-big b { font-size: 15px; }
.m-big span { font-size: 12px; opacity: .7; }
.m-row { display: flex; gap: 6px; }
.m-row .btn { flex: 1; height: 40px; padding: 0 8px; }
.m-lang { display: flex; flex: none; }
.m-lang button { width: 42px; height: 40px; border: 1px solid #000; background: #fff; font: 700 12px 'Space Mono', monospace; }
.m-lang button + button { border-left: 0; }
.m-lang button.on { background: #000; color: #fff; }

/* bottom step bar */
body.mobile .m-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid #000; z-index: 32; }
.m-nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; padding: 0; }
.m-nav button i { position: absolute; top: 6px; left: calc(50% + 9px); font: 700 9px 'Space Mono', monospace; font-style: normal; }
.m-nav button.on { color: #fff; background: #000; }
.m-nav button.done { color: #000; }
.m-nav .m-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
body.mobile .m-edit-chip { display: block; position: fixed; right: 10px; bottom: calc(var(--nav) + 58px); z-index: 25; height: 38px; padding: 0 14px; border: 1px solid #000; background: #000; color: #fff; font-weight: 700; box-shadow: 3px 3px 0 #fff, 3px 3px 0 1px #000; }
body.mobile .m-edit-chip[hidden] { display: none; }

/* touch: bigger targets inside the sheet */
body.mobile .seg button, body.mobile .btn { min-height: 38px; }
body.mobile .toast { bottom: calc(var(--nav) + 12px); max-width: calc(100% - 24px); }
body.mobile.m-open .toast { bottom: calc(var(--nav) + var(--sheet) + var(--mhead) + 12px); }
body.mobile .modal-card { width: calc(100vw - 20px); max-height: calc(100vh - 20px); overflow: auto; padding: 16px; box-shadow: 4px 4px 0 #000; }
body.mobile .menu { right: 0; }

/* intro on phones */
@media (max-width: 820px) {
  .intro-top { padding: 12px 14px; font-size: 15px; }
  .intro-sub { display: none; }
  .intro-top .lang-switch { margin-left: auto; }
  .intro-step { padding: 22px 14px 30px; }
  .intro-head { gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
  .intro-head h1 { font-size: 26px; }
  .intro-grid { grid-template-columns: repeat(2, 1fr); }
  .intro-card { padding: 12px 12px 12px; }
  .intro-card .pkg-art { height: 96px; margin-bottom: 4px; }
  .intro-card b { font-size: 15px; }
  .intro-card span { font-size: 11.5px; }
  .size-layout { gap: 16px; }
  .size-art { height: 200px; }
  .btn.big { width: 100%; }
}

/* ---------- picker: audience switch, other group, coming soon, gift welcome ---------- */
.intro-head .aud-switch { margin-left: auto; align-self: center; display: inline-flex; border: 1px solid #000; }
.aud-switch button { border: 0; background: #fff; padding: 8px 14px; font: 600 13px Inter, sans-serif; cursor: pointer; color: #000; }
.aud-switch button + button { border-left: 1px solid #000; }
.aud-switch button.on { background: #000; color: #fff; }
.intro-more { font: 600 20px 'Space Grotesk', 'Manrope', sans-serif; margin: 40px 0 14px; letter-spacing: -.01em; text-transform: none; }
.intro-more::after { background: #000; }
.intro-more-note { color: var(--muted); margin: -6px 0 12px; font-size: 13px; }
.intro-grid.soon-grid { grid-template-columns: repeat(6, 1fr); }
.intro-card.soon { cursor: default; color: #8a8a8a; padding: 16px 14px 14px; align-items: flex-start; }
.intro-card.soon:hover { background: #fff; }
.intro-card.soon b { font-size: 15px; color: #555; }
.intro-card.soon span { font: 600 10.5px 'Space Mono', monospace; text-transform: uppercase; letter-spacing: .06em; }
.soon-ico { width: 46px; height: 46px; margin-bottom: 8px; color: #9a9a9a; }
.welcome { position: fixed; inset: 0; z-index: 120; background: rgba(255,255,255,.86); display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.wcard { position: relative; width: min(820px, 100%); background: #fff; border: 3px solid #000; box-shadow: 14px 14px 0 #000; padding: 40px 44px 36px; }
.wclose { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 18px; cursor: pointer; padding: 6px; color: #000; }
.wcard .wk { font: 400 13px 'Space Mono', monospace; text-transform: uppercase; letter-spacing: .08em; }
.wcard h2 { display: block; font: 700 42px/1.05 'Space Grotesk', 'Manrope', sans-serif; letter-spacing: -.02em; margin: 12px 0; }
.wcard .mk { background: #000; color: #fff; padding: 0 8px; }
.wcard p { font-size: 17px; margin: 0 0 24px; color: #333; }
.wtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; }
.wtile { position: relative; border: 2px solid #000; background: #fff; padding: 12px 6px 10px; text-align: center; font: 700 14px Inter, sans-serif; cursor: pointer; color: #000; }
.wtile:hover { background: #000; color: #fff; }
.wtile .soon-ico { display: block; width: 50px; height: 50px; margin: 0 auto 6px; color: inherit; }
.wtile.soon { border-color: #bbb; color: #999; cursor: default; }
.wtile.soon:hover { background: #fff; color: #999; }
.wtile.soon em { position: absolute; top: 4px; right: 5px; font: 600 9.5px 'Space Mono', monospace; text-transform: uppercase; font-style: normal; }
.wtile.all { border-style: dashed; }
.wsteps { display: flex; gap: 22px; margin-bottom: 26px; font-size: 14px; flex-wrap: wrap; }
.wsteps b { display: inline-flex; width: 24px; height: 24px; border: 2px solid #000; align-items: center; justify-content: center; margin-right: 8px; font: 700 12px 'Space Mono', monospace; }
.wcta { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 1200px) { .intro-grid.soon-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 820px) {
  .intro-head .aud-switch { margin-left: 0; width: 100%; } .aud-switch button { flex: 1; }
  .intro-grid.soon-grid { grid-template-columns: repeat(3, 1fr); }
  .intro-card.soon { padding: 10px 8px; } .intro-card.soon b { font-size: 12.5px; } .soon-ico { width: 34px; height: 34px; margin-bottom: 4px; }
  .intro-more { font-size: 16px; margin-top: 24px; }
  .welcome { align-items: flex-start; padding: 0; }
  .wcard { margin-top: auto; box-shadow: none; border-width: 3px 0 0; padding: 22px 16px 18px; }
  .wcard h2 { font-size: 27px; margin: 8px 0; } .wcard p { font-size: 14px; margin-bottom: 14px; }
  .wtiles { gap: 6px; margin-bottom: 14px; } .wtile { font-size: 11px; padding: 8px 3px 6px; } .wtile .soon-ico { width: 32px; height: 32px; margin-bottom: 3px; }
  .wsteps { flex-direction: column; gap: 6px; font-size: 13px; margin-bottom: 14px; }
  .wtile.soon em { position: static; display: block; margin-top: 2px; font-size: 8.5px; }
  .wcta .btn { flex: 1 1 100%; }
}

/* ---------- account / saved designs ---------- */
.intro-top .intro-account { margin-left: auto; }
.intro-top .intro-account + .lang-switch { margin-left: 10px; }
.acc-lead { margin: 0 0 14px; color: #333; }
.acc-form { display: grid; gap: 10px; margin-bottom: 12px; }
.acc-form label { display: grid; gap: 6px; font-weight: 600; }
.acc-form input, .acc-save input { border: 1px solid #000; padding: 10px 12px; font: inherit; border-radius: 0; }
.acc-small { color: var(--muted); font-size: 12px; }
.acc-sent { margin: 0; }
.acc-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #000; margin-bottom: 12px; }
.acc-save { display: flex; gap: 8px; margin-bottom: 14px; } .acc-save input { flex: 1; min-width: 0; }
.acc-list { display: grid; gap: 0; border-top: 1px solid #000; }
.acc-item { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #ddd; }
.acc-item.on { background: #fafafa; }
.acc-thumb { width: 64px; height: 48px; border: 1px solid #ddd; background: #f5f5f3; overflow: hidden; }
.acc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-meta { display: grid; gap: 2px; min-width: 0; } .acc-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .acc-meta span { color: var(--muted); font-size: 12px; }
@media (max-width: 820px) { .intro-top .intro-account { padding: 6px 10px; font-size: 12px; } .acc-save { flex-direction: column; } }
#accountModal { z-index: 130; }
.acc-small a { color: #000; }

/* order / checkout */
#orderModal { z-index: 130; }
#orderDone, #dreqModal, #accountModal { z-index: 400; }
.ord-form fieldset { border: 0; border-top: 1px solid #000; margin: 0 0 16px; padding: 12px 0 0; }
.ord-form legend { font-weight: 700; padding: 0 8px 0 0; }
.ord-qty { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ord-qty button { border: 1px solid #000; background: #fff; padding: 8px 12px; font: inherit; cursor: pointer; border-radius: 0; }
.ord-qty button.on { background: #000; color: #fff; }
.ord-qty input { width: 100px; border: 1px solid #000; padding: 8px 10px; font: inherit; border-radius: 0; }
.ord-price { margin-top: 12px; display: grid; gap: 4px; }
.ord-price > div { display: flex; justify-content: space-between; }
.ord-price .tot { border-top: 1px solid #000; padding-top: 6px; font-size: 1.1em; }
.ord-price small, .ord-note { color: var(--muted); font-size: 12px; }
.ord-none { color: #000; }
.ord-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.ord-grid label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.ord-grid .w2 { grid-column: 1 / -1; }
.ord-grid input { border: 1px solid #000; padding: 9px 10px; font: inherit; font-weight: 400; border-radius: 0; }
.ord-inv { display: flex; gap: 18px; }
.choice-inline { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.qt-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.qt-head img { width: 132px; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #000; flex: none; }
.qt-head b { display: block; margin-bottom: 4px; }
.qt-head small { color: var(--muted); font-size: 12px; }
@media (max-width: 520px) { .qt-head img { width: 96px; } }
.ord-terms { display: block; margin: 4px 0 14px; font-size: 13px; }
.ord-terms a { color: #000; }
#orderModal .modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
@media (max-width: 560px) { .ord-grid { grid-template-columns: 1fr; } }
/* order: sample option, reorder list */
.ord-sample { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 13px; }
.ord-qty.off { opacity: .35; pointer-events: none; }
/* delivery: courier or BOX NOW locker */
.ord-ship { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 4px; }
.ord-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border: 1px solid #000; padding: 12px; cursor: pointer; }
.ord-opt:has(input:checked) { background: #000; color: #fff; }
.ord-opt:has(input:checked) small { color: #ccc; }
.ord-opt input { accent-color: #000; margin: 0; }
.ord-opt:has(input:checked) input { accent-color: #fff; }
.ord-opt span { display: grid; gap: 2px; }
.ord-opt small { color: var(--muted); font-size: 12px; }
.ord-opt em { font-style: normal; font-weight: 700; white-space: nowrap; }
.ord-opt.off { opacity: .4; cursor: not-allowed; }
.ord-locker { margin-top: 10px; }
.ord-lk-search { display: flex; gap: 8px; }
.ord-lk-search input { flex: 1; border: 1px solid #000; padding: 9px 10px; min-width: 0; }
.ord-lk-list { display: grid; margin-top: 8px; max-height: 240px; overflow: auto; border-top: 1px solid #000; }
.ord-lk-list:empty { display: none; }
.ord-lk-list button { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 10px; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 10px 4px; }
.ord-lk-list button:hover, .ord-lk-list button.on { background: var(--soft); }
.ord-lk-list button span { grid-column: 1; color: var(--muted); font-size: 12px; }
.ord-lk-list button i { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; font-weight: 700; font-size: 12px; }
.ord-lk-list .ord-note, .ord-lk-list .ord-none { padding: 10px 0; margin: 0; }
.ord-lk-pick { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 2px solid #000; padding: 12px; }
.ord-lk-pick div { display: grid; gap: 2px; }
.ord-lk-pick small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ord-lk-pick span { color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { .ord-ship { grid-template-columns: 1fr; } }
.acc-tabs { display: flex; border-bottom: 1px solid #000; margin-bottom: 12px; }
.acc-tabs button { border: 0; background: none; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.acc-tabs button.on { color: #000; border-bottom-color: #000; }
.acc-order { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #ddd; }
.acc-order .st { font-size: 12px; border: 1px solid #000; padding: 1px 6px; margin-left: 6px; font-weight: 600; }
.acc-order .acc-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.acc-claim { grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px 0 0; }
.acc-claim label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.acc-claim textarea { font: inherit; border: 1px solid #000; border-radius: 0; padding: 8px; resize: vertical; }
@media (max-width: 560px) { .acc-order { grid-template-columns: 1fr; } .acc-order .acc-acts { justify-content: flex-start; } }
.intro-top .intro-designer { margin-left: auto; margin-right: 8px; }
.intro-top .intro-designer + .intro-account { margin-left: 0; }
@media (max-width: 820px) { .intro-top .intro-designer { padding: 6px 10px; font-size: 12px; } }
@media (max-width: 480px) { .intro-top .intro-designer { display: none; } }

/* greeting cards: paper choice with many stocks, inside message panel */
.seg.many { display: grid; grid-template-columns: repeat(3, 1fr); border-right: 0; border-bottom: 0; }
.seg.many button { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
#cardPanel { margin-top: 18px; }
#cardPanel h3 { margin-bottom: 6px; }
#cardPanel textarea { width: 100%; resize: vertical; font: 15px/1.35 'Playpen Sans', 'Inter', sans-serif; padding: 8px; border: 1px solid var(--ink); border-radius: 0; background: #fff; }
.card-wishes { display: flex; flex-wrap: wrap; gap: 6px; }
.card-wishes button { border: 1px solid var(--ink); background: #fff; padding: 4px 8px; font-size: 12px; font-weight: 600; border-radius: 0; }
.card-wishes button:hover { background: var(--ink); color: #fff; }
#cardFont button { font-size: 13px; font-weight: 400; }
.card-actions { display: flex; gap: 8px; }
.card-actions .btn { flex: 1; }

/* ---------- touch screens (js/mobile.js adds body.touch) ---------- */
.touch-only { display: none; }
body.touch .touch-only { display: inline-flex; }
body.touch .btn.block.touch-only { display: flex; }
.upload-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
body.touch .upload-btns .btn { flex: 1 1 140px; min-height: 44px; }
body.touch #uploadBtn { background: #000; color: #fff; }
#multiBtn { margin-bottom: 8px; }
#multiBtn.on { background: #000; color: #fff; }
body.mobile .start-card { gap: 4px; }
body.mobile .start-card span { font-size: 12px; line-height: 1.35; }
body.mobile .start-actions { flex-wrap: nowrap; }
body.mobile .start-actions .btn { flex: 1 1 0; min-width: 0; }
body.mobile.m-open .start-card { display: none; }
body.mobile .stage-hint.m-show { display: block; top: 10px; max-width: calc(100% - 20px); width: auto; white-space: normal; text-align: center; font-size: 12px; line-height: 1.4; }

/* ---------- guided gift creator (js/gift-wizard.js) ---------- */
.gw-entry { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; width: 100%; text-align: left; border: 1px solid #000; background: #000; color: #fff; padding: 14px 16px; margin: 0 0 18px; box-shadow: 4px 4px 0 #ffd23f; }
.gw-entry[hidden] { display: none; }
.gw-entry .gw-entry-k { grid-column: 1; font: 700 10px 'Space Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: #ffd23f; }
.gw-entry b { grid-column: 1; font-size: 18px; line-height: 1.2; margin: 2px 0; }
.gw-entry span:not(.gw-entry-k) { grid-column: 1; font-size: 13px; opacity: .8; }
.gw-entry i { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-style: normal; font-size: 26px; }

.gw { position: fixed; inset: 0; z-index: 125; background: #fff; color: #000; display: flex; flex-direction: column; font-size: 15px; }
.gw[hidden] { display: none; }
.gw-top { flex: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: env(safe-area-inset-top) 4px 0 14px; border-bottom: 1px solid #000; }
.gw-top .logo { width: 26px; height: 26px; display: inline-flex; }
.gw-top .logo svg { width: 100%; height: 100%; }
.gw-k { flex: 1; font: 700 11px 'Space Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.gw-x { width: 46px; height: 46px; border: 0; background: none; display: grid; place-items: center; }
.gw-bar { flex: none; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 4px; padding: 10px 16px 0; }
.gw-bar i { height: 4px; background: #e6e6e6; }
.gw-bar i.on { background: #000; }
.gw-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 28px; }
.gw-step-no { font: 700 11px 'Space Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: #777; }
.gw h2 { font-family: 'Space Grotesk', 'Manrope', 'Inter', sans-serif; font-size: 27px; line-height: 1.12; letter-spacing: -.02em; margin: 6px 0 6px; }
.gw h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 10px; }
.gw-lead { color: #555; margin: 0 0 16px; line-height: 1.45; font-size: 15px; }
.gw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gw-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; border: 1px solid #000; background: #fff; padding: 10px 12px 12px; min-height: 160px; position: relative; color: #000; }
.gw-tile .pkg-art { width: 100%; height: 92px; margin-bottom: 4px; }
.gw-tile b { font-size: 16px; }
.gw-tile span { font-size: 12px; color: #666; line-height: 1.35; }
.gw-tile.on { box-shadow: inset 0 0 0 3px #000; background: #fafafa; }
.gw-tile.on::after { content: '✓'; position: absolute; top: 0; right: 0; width: 28px; height: 28px; display: grid; place-items: center; background: #000; color: #fff; font-weight: 700; }
.gw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gw-chip { min-height: 44px; padding: 6px 14px; border: 1px solid #000; background: #fff; color: #000; font-weight: 600; font-size: 14px; display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; }
.gw-chip small { font-size: 11px; font-weight: 400; opacity: .7; }
.gw-chip.on { background: #000; color: #fff; }
.gw-mat { flex-direction: row; align-items: center; gap: 8px; }
.gw-mat i { width: 18px; height: 18px; border: 1px solid #000; flex: none; }
.gw-soon { display: flex; flex-wrap: wrap; gap: 6px; }
.gw-soon span { font-size: 12px; color: var(--muted); border: 1px dashed #bbb; padding: 5px 9px; }
.gw-full { display: block; margin: 24px 0 0; font-size: 13px; color: #555; text-decoration: underline; background: none; border: 0; padding: 0; text-align: left; }
.gw-big { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; border: 1px solid #000; background: #fff; color: #000; padding: 12px 16px; text-align: left; margin-bottom: 10px; }
.gw-big span { display: grid; gap: 2px; }
.gw-big b { font-size: 17px; }
.gw-big small { font-size: 13px; opacity: .7; }
.gw-big.primary { background: #000; color: #fff; }
.gw-photo { border: 1px solid #000; }
.gw-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.gw-photo-actions { display: flex; border-top: 1px solid #000; }
.gw-photo-actions .btn { flex: 1; height: 48px; border: 0; }
.gw-photo-actions .btn + .btn { border-left: 1px solid #000; }
.gw-tip { font-size: 13px; color: #666; margin: 14px 0 0; line-height: 1.45; }
.gw-field { display: grid; gap: 6px; margin-top: 18px; }
.gw-field span { font-size: 13px; font-weight: 700; }
.gw-field input { height: 54px; border: 1px solid #000; padding: 0 14px; font-size: 18px; font-family: inherit; background: #fff; color: #000; border-radius: 0; -webkit-appearance: none; }
.gw-field input:focus { outline: none; box-shadow: inset 0 0 0 2px #000; }
.gw-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gw-style { border: 1px solid #000; background: #fff; padding: 0; display: flex; flex-direction: column; text-align: left; color: #000; position: relative; }
.gw-style.on { box-shadow: 0 0 0 3px #000; }
.gw-style.on::after { content: '✓'; position: absolute; top: 0; right: 0; width: 26px; height: 26px; display: grid; place-items: center; background: #000; color: #fff; font-weight: 700; }
.gw-style > b { border-top: 1px solid #000; padding: 8px 10px; font-size: 14px; }
.gw-sw { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10%; overflow: hidden; text-align: center; }
.gw-sw em { font-style: normal; font-size: 17px; line-height: 1.1; overflow-wrap: anywhere; }
.gw-sw small { font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; }
.gw-ph { width: 50%; aspect-ratio: 1; background: center / cover no-repeat; flex: none; }
.gw-ph.circle { border-radius: 50%; }
.gw-ph.polaroid { outline: 4px solid #fff; box-shadow: 0 0 0 5px #151515; }
.gw-deco { font-size: 30px; line-height: 1; }
.gw-foot { flex: none; display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #000; background: #fff; }
.gw-foot .btn { flex: 1; height: 52px; font-size: 16px; }
.gw-foot .btn.primary { flex: 1.6; }
.gw-foot .btn:disabled { opacity: .35; }
body.gw-on { overflow: hidden; }

.gw-ready { position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav, 0px) + 10px); z-index: 33; background: #fff; border: 1px solid #000; box-shadow: 4px 4px 0 #000; padding: 12px 12px 12px 14px; display: grid; gap: 4px; }
.gw-ready[hidden] { display: none; }
.gw-ready b { font-size: 16px; padding-right: 36px; }
.gw-ready > span { font-size: 13px; color: #555; }
.gw-ready-row { display: flex; gap: 8px; margin-top: 6px; }
.gw-ready-row .btn { flex: 1 1 0; min-width: 0; height: 44px; padding: 0 8px; white-space: normal; line-height: 1.15; font-size: 13px; }
.gw-ready-x { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center; }
body.mobile.gw-done .stage { bottom: calc(var(--nav) + 168px); }
body.mobile.gw-done .stage-toolbar, body.mobile.gw-done .m-edit-chip { display: none; }
body.gw-on .toast { z-index: 126; bottom: calc(84px + env(safe-area-inset-bottom)); }
.gw-photo img { max-height: 46vh; }
.upload-btns .btn { color: #000; }
body.touch .upload-btns #uploadBtn { color: #fff; }

/* ---------- design links (js/share.js): Share window, links I sent, customer bar ---------- */
.sh-form textarea { border: 1px solid #000; padding: 10px 12px; font: inherit; border-radius: 0; resize: vertical; }
.sh-mode { display: grid; gap: 6px; border: 1px solid #000; padding: 10px 12px; }
.sh-mode label { display: block; font-weight: 600; }
.sh-mode .acc-small { display: block; margin: 2px 0 0 22px; font-weight: 400; }
.sh-days { display: grid; gap: 6px; font-weight: 600; }
.sh-days .seg button { height: 34px; }
.sh-points { margin: 2px 0 4px; padding: 0 0 0 18px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.sh-link { display: grid; grid-template-columns: 1fr auto; margin: 4px 0 10px; }
.sh-link input { border: 1px solid #000; border-right: 0; padding: 0 12px; height: 42px; font: 600 14px/1 inherit; min-width: 0; border-radius: 0; }
.sh-link .btn { height: 42px; }
.sh-send { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sh-send .btn { text-decoration: none; color: inherit; }
.sh-send .btn:hover { color: #fff; }
.sh-done a:not(.btn) { color: #000; font-weight: 600; }
.sh-item { grid-template-columns: 64px 1fr auto; }
.sh-item.dead { opacity: .55; }
.sh-item .st { font-size: 11px; border: 1px solid #000; padding: 1px 6px; margin-left: 6px; font-weight: 600; }
.sh-item .st.sh-approved { background: #000; color: #fff; }
.sh-item .st.sh-changes { border-width: 2px; }
.sh-note { display: block; color: #000 !important; font-size: 12.5px !important; border-left: 2px solid #000; padding-left: 8px; margin-top: 4px; white-space: pre-wrap; }
.sh-actions { display: flex; gap: 6px; align-items: center; }
.share-bar { position: absolute; z-index: 6; top: 12px; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 24px));
  background: #fff; border: 1px solid #000; box-shadow: 4px 4px 0 #000; padding: 12px 14px; }
.share-bar[hidden] { display: none; }
.share-bar .sb-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; justify-content: space-between; }
.share-bar .sb-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 300px; }
.share-bar .sb-from { font-size: 12px; color: var(--muted); }
.share-bar .sb-from b { color: #000; }
.share-bar .sb-title { font-size: 16px; line-height: 1.25; }
.share-bar .sb-msg { margin: 4px 0 0; white-space: pre-wrap; line-height: 1.45; max-height: 6.2em; overflow: auto; }
.share-bar .sb-help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.share-bar .sh-state { font-size: 12px; font-weight: 700; border: 1px solid #000; padding: 1px 6px; justify-self: start; margin-top: 2px; }
.share-bar .sb-btns { display: flex; gap: 6px; align-items: center; flex: none; }
.share-bar .sb-answer { display: grid; gap: 8px; margin-top: 12px; border-top: 1px solid #000; padding-top: 12px; }
.share-bar .sb-answer label { display: grid; gap: 5px; font-weight: 600; }
.share-bar .sb-answer textarea, .share-bar .sb-answer input { border: 1px solid #000; padding: 8px 10px; font: inherit; border-radius: 0; }
.share-bar .sb-answer .sb-btns { justify-content: flex-end; }
.share-bar.min { width: auto; padding: 8px 10px; cursor: pointer; }
body.share-view .stage-hint { display: none; }
.share-bar.min .sb-msg, .share-bar.min .sb-help, .share-bar.min .sb-answer, .share-bar.min .sb-btns .btn, .share-bar.min .sb-title, .share-bar.min .sh-state, .share-bar.min .sb-text > span:not(.sb-from), .share-bar.min .sb-text > b:not(.sb-title) { display: none; }
.share-bar.min .sb-row { align-items: center; }
body.share-view #startCard { display: none !important; }
@media (max-width: 760px) {
  .share-bar .sb-btns { width: 100%; }
  .share-bar .sb-btns .btn { flex: 1; padding: 0 8px; }
  .share-bar.min .sb-btns { width: auto; }
  .sh-item { grid-template-columns: 52px 1fr; }
  .sh-item .acc-thumb { width: 52px; }
  .sh-item .sh-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
body.mobile .share-bar { top: 8px; width: calc(100% - 16px); padding: 10px; }
body.mobile .share-bar .sb-help { display: none; }
body.mobile .share-bar .sb-msg { max-height: 3.2em; }

/* ---------- product set: same design on more products (js/product-set.js) ---------- */
.set-entry { margin: 4px 0 6px; }
.set-entry .hint.small { margin-top: 6px; }
.set-card { width: min(780px, 95vw); }
.set-card h3 { margin-top: 18px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.set-prod { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-2); padding: 10px; }
.set-prod-art { width: 46px; height: 46px; flex: none; }
.set-prod-art svg { width: 100%; height: 100%; display: block; }
.set-prod-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.set-sizes { display: flex; flex-wrap: wrap; gap: 4px; }
.set-size { border: 1px solid #000; background: #fff; padding: 5px 8px; display: grid; text-align: left; line-height: 1.25; min-width: 52px; }
.set-size small { color: var(--muted); font-size: 10.5px; }
.set-size i { font-style: normal; font-size: 10px; }
.set-size:hover:not([disabled]) { background: var(--soft); }
.set-size.on { background: #000; color: #fff; }
.set-size.on small { color: #ddd; }
.set-size.in { border-color: var(--line-2); color: var(--muted); cursor: default; }
.set-actions { align-items: center; position: sticky; bottom: -22px; background: #fff; padding: 12px 0 0; margin-bottom: -6px; }
.set-actions .ord-note { margin-right: auto; }

.set-bar { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; background: #fff; border: 1px solid #000; box-shadow: 4px 4px 0 #000; padding: 6px; }
.set-bar[hidden] { display: none; }
.set-bar.busy .set-items { opacity: .55; pointer-events: none; }
.set-lbl { display: flex; align-items: baseline; gap: 8px; line-height: 1.2; padding: 0 4px; flex: 1; min-width: 0; }
.set-lbl span { color: var(--muted); font-size: 11px; }
.set-items { order: 2; flex-basis: 100%; display: flex; gap: 6px; overflow-x: auto; min-width: 0; scrollbar-width: thin; }
.set-item { position: relative; flex: none; display: flex; border: 1px solid var(--line-2); }
.set-item.on { border-color: #000; box-shadow: inset 0 0 0 1px #000; }
.set-go { display: flex; align-items: center; gap: 6px; border: 0; background: #fff; padding: 3px 4px 3px 3px; text-align: left; }
.set-go:hover { background: var(--soft); }
.set-thumb { width: 38px; height: 38px; flex: none; display: grid; place-items: center; background: #fff; overflow: hidden; }
.set-thumb img { width: 100%; height: 100%; object-fit: cover; }
.set-thumb svg { width: 34px; height: 34px; }
.set-name { display: grid; line-height: 1.2; max-width: 120px; }
.set-name b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-name small { color: var(--muted); font-size: 10.5px; }
.set-dot { width: 7px; height: 7px; background: #000; border-radius: 50% !important; flex: none; margin-left: 2px; }
.set-flag { font-style: normal; font-weight: 700; width: 16px; height: 16px; display: grid; place-items: center; background: #000; color: #fff; font-size: 11px; flex: none; }
.set-x { border: 0; border-left: 1px solid var(--line); background: #fff; width: 22px; font-size: 10px; color: var(--muted); }
.set-x:hover { background: #000; color: #fff; }
.set-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.set-order { height: 34px; margin-left: 4px; }
body.has-set .start-card { top: 116px; }

/* set order rows */
.ord-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.ord-row { display: grid; grid-template-columns: 44px 1fr auto 92px 30px; gap: 10px; align-items: center; border: 1px solid var(--line-2); padding: 6px; }
.ord-row-th { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; }
.ord-row-th img { width: 100%; height: 100%; object-fit: cover; }
.ord-row-th svg { width: 40px; height: 40px; }
.ord-row-name { display: grid; line-height: 1.3; min-width: 0; }
.ord-row-name small { color: var(--muted); }
.ord-row-name em { font-style: normal; font-size: 11px; font-weight: 600; }
.ord-row-name em.soft { font-weight: 400; color: var(--muted); }
.ord-row-qty { display: flex; gap: 4px; }
.ord-row-qty select, .ord-row-qty input { border: 1px solid #000; padding: 6px 8px; background: #fff; border-radius: 0; height: 34px; }
.ord-row-qty input { width: 80px; }
.ord-row-price { text-align: right; display: grid; line-height: 1.25; }
.ord-row-price small { color: var(--muted); font-size: 10.5px; }
.ord-row-price.bad { color: var(--danger); font-weight: 600; font-size: 12px; }

body.mobile .set-bar { top: 8px; left: 8px; right: 8px; padding: 4px; gap: 4px; box-shadow: 3px 3px 0 #000; flex-wrap: wrap; }
body.mobile .set-lbl span { display: none; }
body.mobile .set-lbl { flex: none; }
body.mobile .set-tools { flex: 1; justify-content: flex-end; }
body.mobile .set-name { max-width: 92px; }
body.mobile .set-x { width: 30px; }
body.mobile .set-go { min-height: 44px; }
body.mobile .set-tools .tool-btn { height: 34px; padding: 0 8px; }
body.mobile #setSync { order: 3; flex-basis: 100%; }
body.mobile.m-open .set-bar { display: none; }
body.mobile.has-set .start-card { top: 120px; }
body.mobile .set-grid { grid-template-columns: 1fr; }
body.mobile .set-size { min-height: 44px; min-width: 64px; }
body.mobile .ord-row { grid-template-columns: 40px 1fr auto; grid-template-areas: 'th name x' 'qty qty price'; row-gap: 8px; }
body.mobile .ord-row-th { grid-area: th; width: 40px; height: 40px; }
body.mobile .ord-row-name { grid-area: name; }
body.mobile .ord-row-x { grid-area: x; }
body.mobile .ord-row-qty { grid-area: qty; }
body.mobile .ord-row-price { grid-area: price; align-self: center; }

/* ---------- Studio cleanup 2026-11-21: toolbar icons, "Want a designer?" corner, view status, sign-in nudge ---------- */
.stage-toolbar .tool-btn[data-icon-left] { display: inline-flex; align-items: center; gap: 5px; }
.stage-toolbar .tool-btn .ico { width: 15px; height: 15px; flex: none; }
.stage-bottom { position: absolute; left: 12px; right: 12px; bottom: 14px; display: flex; justify-content: center; align-items: stretch; gap: 12px; pointer-events: none; }
.stage-bottom > * { pointer-events: auto; }
.stage-bottom .stage-toolbar { position: static; transform: none; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.designer-cta { position: relative; flex: none; display: flex; align-items: center; gap: 10px; background: var(--accent); color: #fff; border: 1px solid var(--accent); box-shadow: 4px 4px 0 #fff, 4px 4px 0 1px #000; padding: 4px 14px 4px 6px; text-align: left; cursor: pointer; max-width: 300px; white-space: nowrap; }
.designer-cta:hover { background: #fff; color: var(--accent); }
.designer-cta .dc-ico { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid currentColor; flex: none; }
.designer-cta .dc-txt { display: grid; gap: 2px; line-height: 1.2; }
.designer-cta b { font-size: 13px; }
.designer-cta small { font-size: 11px; opacity: .75; }
.designer-cta.wiggle .dc-ico { animation: dcWiggle 1.1s ease-in-out; }
.designer-cta.wiggle { animation: dcPop 1.1s ease-in-out; }
@keyframes dcWiggle { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-8deg); } 60% { transform: rotate(5deg); } 75% { transform: rotate(-2deg); } }
@keyframes dcPop { 0%, 100% { transform: translateY(0); } 20% { transform: translateY(-4px); } 40% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .designer-cta.wiggle, .designer-cta.wiggle .dc-ico { animation: none; } }
body.mobile .designer-cta, body.share-view .designer-cta { display: none; }
.view-status { position: absolute; left: 12px; bottom: 70px; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.92); border: 1px solid #000; padding: 3px 8px; font-size: 11px; font-weight: 600; pointer-events: none; }
.view-status .vs-spin { width: 10px; height: 10px; border: 2px solid #000; border-right-color: transparent; animation: vsSpin .7s linear infinite; }
.view-status.lowonly .vs-spin { animation: none; border-color: #000; width: 8px; height: 8px; background: repeating-linear-gradient(45deg, #000 0 2px, #fff 2px 4px); }
@keyframes vsSpin { to { transform: rotate(360deg); } }
body.mobile .view-status { bottom: auto; top: 10px; }
.login-nudge { position: absolute; right: 14px; top: 14px; width: 300px; background: #fff; border: 1px solid #000; box-shadow: 4px 4px 0 #000; padding: 14px; display: grid; gap: 6px; font-size: 13px; line-height: 1.4; z-index: 5; animation: lnIn .3s ease-out; }
.login-nudge .ln-acts { display: flex; gap: 8px; margin-top: 4px; }
@keyframes lnIn { from { transform: translateY(-8px); opacity: 0; } }
.dreq-files { display: grid; gap: 8px; border: 1px solid #000; padding: 10px; }
.dreq-empty { grid-column: 1 / -1; }
.dreq-hint, .dreq-empty { font-size: 12px; font-weight: 400; color: var(--muted, #666); }
.dreq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.dreq-grid figure { margin: 0; border: 1px solid var(--line-2, #ccc); display: grid; }
.dreq-grid img { width: 100%; height: 64px; object-fit: contain; background: #f4f4f4; }
.dreq-grid figcaption { font-size: 10px; padding: 2px 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dreq-files .btn { justify-self: start; }
.my-files-h { margin-top: 18px; }
/* long Greek labels never get cut: finish / relief buttons wrap into a grid, button rows wrap */
.seg.surface-seg { display: grid; grid-template-columns: repeat(3, 1fr); border-right: 0; border-bottom: 0; }
.seg.surface-seg button { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); min-width: 0; height: auto; min-height: 30px; padding: 4px; line-height: 1.15; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.seg.surface-seg button:last-child { border-right: 1px solid var(--ink); }
.btn-row { flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; min-width: 0; white-space: normal; height: auto; min-height: 34px; padding-top: 6px; padding-bottom: 6px; line-height: 1.2; }
.bgr-stage canvas { touch-action: none; }
.bgr-brush { position: absolute; pointer-events: none; border: 1.5px solid #000; outline: 1px solid #fff; border-radius: 50%; z-index: 2; }
.bgr-brush.erase { background: rgba(255,255,255,.25); }
.bgr-brush.restore { background: rgba(0,0,0,.12); }
.ar-qr { position: absolute; right: 20px; top: 76px; width: 250px; background: #fff; border: 1px solid #000; box-shadow: 4px 4px 0 #000; padding: 14px; display: grid; gap: 8px; font-size: 13px; line-height: 1.4; z-index: 2; }
.ar-qr[hidden] { display: none; }
.ar-qr p { margin: 0; }
.ar-qr-code { display: grid; place-items: center; min-height: 120px; }
.ar-qr-code svg { width: 200px; height: 200px; display: block; }
/* ---------- opening: the Unfoldy logo builds itself, then the package picker shows (pure CSS, ~2 s) ---------- */
.logo-intro { position: fixed; inset: 0; z-index: 200; background: #fff; display: grid; place-items: center; pointer-events: none; animation: liOut .55s cubic-bezier(.7,0,.3,1) 1.85s forwards; }
.li-mark { display: flex; align-items: center; gap: 18px; }
.li-mark svg { overflow: visible; }
.li-box { transform-box: fill-box; transform-origin: 50% 100%; animation: liBox .6s cubic-bezier(.2,.9,.3,1.2) .1s both; }
.li-cup { transform-box: fill-box; transform-origin: 50% 100%; animation: liCup .55s cubic-bezier(.2,.9,.3,1.25) .45s both; }
.li-up, .li-side { stroke-dasharray: 20; stroke-dashoffset: 20; animation: liDraw .4s ease-out .85s forwards; }
.li-tip, .li-sq { transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; animation: liPop .25s ease-out 1.15s forwards; }
.li-word { display: grid; line-height: 1; clip-path: inset(0 100% 0 0); animation: liWord .55s cubic-bezier(.6,0,.2,1) 1s forwards; }
.li-word b { font-family: 'Space Grotesk', 'Manrope', sans-serif; font-size: 52px; letter-spacing: -.03em; }
.li-word span { font-size: 13px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; margin-top: 6px; }
@keyframes liBox { from { transform: scaleY(0) skewY(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes liCup { from { transform: translateY(-60%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes liDraw { to { stroke-dashoffset: 0; } }
@keyframes liPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes liWord { to { clip-path: inset(0 0 0 0); } }
@keyframes liOut { to { opacity: 0; transform: translateY(-24px); visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .logo-intro { animation-duration: .2s; animation-delay: .6s; } .li-box, .li-cup, .li-up, .li-side, .li-tip, .li-sq, .li-word { animation: none; opacity: 1; stroke-dashoffset: 0; clip-path: none; } }
@media (max-width: 520px) { .li-mark svg { width: 76px; height: 76px; } .li-word b { font-size: 36px; } }
/* the guide's "take a tour" card never covers an open window (it hid the Apply button of background removal) */
body:has(.modal.open) .ut-nudge, body:has(.ar-modal.open) .ut-nudge { display: none; }
/* the 3D view's bottom bar fits narrow views: first the labels go, then the camera buttons show icons only */
.stage { container-type: inline-size; }
@container (max-width: 980px) { .stage-toolbar .tb-label { display: none; } .designer-cta .dc-txt small { display: none; } }
@container (max-width: 860px) { .stage-toolbar .tb-txt { display: none; } .stage-toolbar .tool-btn[data-icon-left] { padding: 0 8px; } }
@container (max-width: 700px) { .designer-cta .dc-txt { display: none; } .designer-cta { padding: 4px; } }
@container (max-width: 560px) { .stage-bottom { gap: 6px; } .view-seg .tool-btn { padding: 0 6px; font-size: 11px; } .stage-toolbar .tool-btn[data-icon-left] { padding: 0 5px; } }
/* price per quantity on the Package panel (js/price-table.js) */
.price-box .price-what { margin: -4px 0 8px; }
.price-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.price-table th { text-align: right; font-weight: 500; color: var(--muted); font-size: 10.5px; padding: 0 0 6px; border-bottom: 1px solid #000; }
.price-table td { text-align: right; padding: 6px 0; border-bottom: 1px solid var(--line); }
.price-table th:first-child, .price-table td:first-child { text-align: left; }
.price-table tr[data-q] { cursor: pointer; }
.price-table tr[data-q]:hover td, .price-table tr[data-q]:focus td { background: #f4f4f4; }
.price-table tr[data-q]:focus { outline: none; }

/* ---------- backdrop colour of the 3D view (top right of the stage, app.js backdrop modes) ---------- */
.bg-pick { position: absolute; top: 12px; right: 12px; z-index: 5; }
.bg-pick-btn { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 6px; background: #fff; border: 1px solid #000; font-weight: 600; font-size: 12px; cursor: pointer; }
.bg-pick-btn i, .bg-pick-menu i { width: 18px; height: 18px; border: 1px solid #000; display: block; flex: none; }
.bg-pick-menu { position: absolute; right: 0; top: 38px; width: 200px; background: #fff; border: 1px solid #000; box-shadow: 4px 4px 0 #000; display: grid; }
.bg-pick-menu[hidden] { display: none; }
.bg-pick-menu > * { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; background: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer; position: relative; }
.bg-pick-menu > * + * { border-top: 1px solid var(--line); }
.bg-pick-menu > .on { font-weight: 700; }
.bg-pick-menu > .on::after { content: ''; position: absolute; right: 10px; width: 6px; height: 6px; background: #000; }
.bg-pick-menu input[type=color] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
body.mobile .bg-pick { top: 10px; right: 10px; }
body.mobile .bg-pick-btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
body.mobile .bg-pick-btn span { display: none; }
body:has(#startCard:not([hidden])) .bg-pick { display: none; }

/* ---------- AR (js/ar.js): computer = QR banner; phone = straight into AR, one button when a fresh tap is needed ---------- */
.ar-banner { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 260px; background: #fff; border: 1px solid #000; box-shadow: 5px 5px 0 #000; padding: 14px; display: none; gap: 8px; font-size: 13px; line-height: 1.4; }
.ar-banner.open { display: grid; }
.ar-banner #arBannerBody { display: grid; gap: 8px; }
.ar-banner p { margin: 0; }
.ar-banner-x { position: absolute; top: 8px; right: 8px; }
.ar-banner .ar-qr-code { display: grid; place-items: center; min-height: 120px; }
.ar-banner .ar-qr-code svg { width: 180px; height: 180px; display: block; }
.ar-hidden-viewer { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; z-index: -1; }
.ar-hidden-viewer.presenting { inset: 0; width: 100%; height: 100%; opacity: 1; pointer-events: auto; z-index: 100; }
.ar-go-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav, 0px) + 12px); z-index: 80; display: none; gap: 6px; }
.ar-go-bar.open { display: flex; }
.ar-go-bar .btn { flex: 1; height: 48px; font-size: 15px; box-shadow: 4px 4px 0 #000; }
.ar-go-bar .icon-sm { width: 48px; height: 48px; background: #fff; border: 1px solid #000; }

/* phones, 25/11 review: no product title in the top bar (Snap takes its place), less text in the sheets */
body.mobile .product-switch { display: none; }
body.mobile #snapBtn { display: inline-flex; height: 34px; padding: 0 10px; }
body.mobile .brand { flex: 0 0 auto; }
body.mobile .top-center { flex: 1 1 auto; justify-content: flex-start; }
body.mobile .m-hint, body.mobile .m-big span { display: none; }
body.mobile .m-head-top { justify-content: flex-end; }
body.mobile .m-head-top .m-step { margin-right: auto; }
body.mobile .drawer .panel > p.hint, body.mobile .drawer .drop-body > p.hint { display: none; }
.m-row .btn.m-ico { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.stage-hint { max-width: calc(100% - 280px); }

/* AI designer: the customer's logo and brand colours */
.ai-brand { display: grid; gap: 6px; margin: 10px 0 4px; }
.ai-brand .field { margin: 0; }
.ai-logo { display: flex; align-items: center; gap: 8px; }
.ai-logo .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ai-logo-img { width: 56px; height: 40px; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.ai-logo-img[hidden] { display: none; }
.ai-logo-img img { max-width: 50px; max-height: 34px; display: block; }
.ai-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-col { position: relative; display: block; }
.ai-col label, .ai-col-add { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #000; cursor: pointer; }
.ai-col-add { background: #fff; font-weight: 700; font-size: 16px; }
.ai-col input, .ai-col-add input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.ai-col-x { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; padding: 0; border: 1px solid #000; background: #fff; font-size: 9px; line-height: 1; cursor: pointer; }
body.mobile .m-finish { overflow-x: hidden; grid-template-columns: minmax(0, 1fr); }
body.mobile .m-big { min-width: 0; }
body.mobile .m-big b { overflow-wrap: anywhere; }
body.mobile .m-row { flex-wrap: wrap; min-width: 0; }
body.mobile .m-row .btn { min-width: 0; flex: 1 1 30%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- motion and interaction cues (js/motion.js). Black only, short, all off with reduced motion. ----------
   press: every button answers the finger/mouse within one frame (Doherty: feedback well under 400 ms)
   pulse: a choice that sticks (size, material, finish, language...) confirms with one outline ring
   mask reveal: the product list, size cards, panels and opened sections wipe in, staged one after another
   crossfade: icons that change meaning (play / reverse, + / -) blur across instead of jumping */
.btn, .icon-btn, .icon-sm, .tool-btn, .toggle, .seg button, .size-card, .intro-card, .rail-btn, .m-big, .m-next, .m-close,
.m-nav button, .aud-switch button, .lang-switch button, .mat-row button, .designer-cta, .ufb-btn-open { transition: background-color .1s, color .1s, border-color .1s, translate .08s; }
.btn:active:not(:disabled), .icon-btn:active:not(:disabled), .icon-sm:active, .tool-btn:active, .toggle:active, .seg button:active,
.size-card:active, .intro-card:active, .rail-btn:active, .m-big:active, .m-next:active, .m-close:active, .m-nav button:active,
.aud-switch button:active, .lang-switch button:active, .mat-row button:active, .designer-cta:active, .ufb-btn-open:active { translate: 0 1px; }
:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.btn.primary:focus-visible, #orderBtn:focus-visible, .designer-cta:focus-visible { outline-offset: 3px; }

.pd-pulse { animation: pdPulse .42s cubic-bezier(.2, .7, .3, 1); }
.pd-pulse.pd-accent { animation-name: pdPulseAccent; }
@keyframes pdPulse { from { outline: 2px solid rgba(0, 0, 0, .55); outline-offset: 0; } to { outline: 2px solid rgba(0, 0, 0, 0); outline-offset: 7px; } }
@keyframes pdPulseAccent { from { outline: 2px solid rgba(214, 63, 0, .7); outline-offset: 0; } to { outline: 2px solid rgba(214, 63, 0, 0); outline-offset: 7px; } }

@keyframes pdMask { from { clip-path: inset(0 0 100% 0); opacity: .2; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes pdMaskUp { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pdIn { from { opacity: 0; translate: 0 4px; } }
/* product list: waits for the logo intro on the first open, then 35 ms per card (staged, not all at once) */
.intro-step.on .intro-card { animation: pdMask .5s cubic-bezier(.2, .7, 0, 1) both; animation-delay: calc(1.9s + var(--i, 0) * 35ms); }
body.pd-warm .intro-step.on .intro-card { animation-delay: calc(var(--i, 0) * 35ms); }
.intro-step.on .size-card { animation: pdMask .4s cubic-bezier(.2, .7, 0, 1) both; animation-delay: calc(120ms + var(--i, 0) * 50ms); }
.intro-step.on .intro-material, .intro-step.on #introStart { animation: pdIn .3s ease both .3s; }
.intro-card:nth-child(2), .size-card:nth-child(2) { --i: 1; } .intro-card:nth-child(3), .size-card:nth-child(3) { --i: 2; }
.intro-card:nth-child(4), .size-card:nth-child(4) { --i: 3; } .intro-card:nth-child(5) { --i: 4; } .intro-card:nth-child(6) { --i: 5; }
.intro-card:nth-child(7) { --i: 6; } .intro-card:nth-child(8) { --i: 7; } .intro-card:nth-child(9) { --i: 8; } .intro-card:nth-child(10) { --i: 9; }
.intro-card:nth-child(11) { --i: 10; } .intro-card:nth-child(n+12) { --i: 11; }
/* drawer panels and opened sections */
.panel.active { animation: pdIn .18s ease both; }
details.drop[open] > :not(summary) { animation: pdMask .26s cubic-bezier(.2, .7, 0, 1) both; }
details.drop > summary::after { display: inline-block; animation: pdIcoA .22s ease; }
details.drop[open] > summary::after { animation-name: pdIcoB; }
@keyframes pdIcoA { from { opacity: 0; filter: blur(3px); transform: rotate(-90deg) scale(.6); } }
@keyframes pdIcoB { from { opacity: 0; filter: blur(3px); transform: rotate(90deg) scale(.6); } }
/* icon swap (PD.motion.swap): old icon blurs out while the new one blurs in, on the same spot */
.pd-swap { position: relative; }
.pd-swap > .ico { animation: pdIcoIn .2s ease both; }
.pd-swap > .ico.pd-old { position: absolute; left: 50%; top: 50%; translate: -50% -50%; animation: pdIcoOut .2s ease both; pointer-events: none; }
@keyframes pdIcoIn { from { opacity: 0; filter: blur(4px); scale: .7; } }
@keyframes pdIcoOut { to { opacity: 0; filter: blur(4px); scale: 1.3; } }
/* phone sheet: wipes up from the tab bar; the header can be pulled (down closes, up stretches and springs back) */
body.mobile.m-open .m-head { animation: pdMaskUp .24s cubic-bezier(.2, .7, 0, 1) both; touch-action: none; }
body.mobile.m-open[data-msheet="drawer"] .drawer, body.mobile.m-open[data-msheet="inspector"] .inspector, body.mobile.m-open[data-msheet="finish"] .m-finish { animation: pdMaskUp .24s cubic-bezier(.2, .7, 0, 1) both; }
body.mobile .m-head::before { content: ''; position: absolute; top: 3px; left: 50%; width: 36px; height: 3px; margin-left: -18px; background: var(--line-2); }
body.pd-drag .m-head, body.pd-drag[data-msheet="drawer"] .drawer, body.pd-drag[data-msheet="inspector"] .inspector, body.pd-drag[data-msheet="finish"] .m-finish { animation: none; }
body.pd-spring .m-head, body.pd-spring .drawer, body.pd-spring .inspector, body.pd-spring .m-finish { transition: translate .32s cubic-bezier(.2, 1.4, .4, 1); }
/* busy: a long job (AI designs) shows a running line on its button at once, not a dead grey button */
#aiGenerate:disabled { opacity: 1; position: relative; overflow: hidden; }
#aiGenerate:disabled::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 32%; background: #fff; animation: pdBusy .9s linear infinite; }
@keyframes pdBusy { from { translate: -100% 0; } to { translate: 320% 0; } }
/* Fitts: small icon buttons keep their look but get a bigger hit area on touch screens */
@media (pointer: coarse) {
  .icon-sm, .m-close, .icon-btn { position: relative; }
  .icon-sm::after, .m-close::after, .icon-btn::after { content: ''; position: absolute; inset: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-pulse, .intro-step.on .intro-card, .intro-step.on .size-card, .intro-step.on .intro-material, .intro-step.on #introStart, .panel.active,
  details.drop[open] > :not(summary), details.drop > summary::after, .pd-swap > .ico, body.mobile.m-open .m-head,
  body.mobile.m-open .drawer, body.mobile.m-open .inspector, body.mobile.m-open .m-finish, #aiGenerate:disabled::after { animation: none !important; }
  .pd-swap > .ico.pd-old { display: none; }
}

/* ---------- size step: price per piece range (js/price-table.js intro) ---------- */
.intro-price { margin: -4px 0 18px; }
.intro-price h4 { font: 700 11px 'Space Mono', monospace; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 6px; }
.ip-val { display: inline-flex; align-items: baseline; gap: 8px; }
.ip-val b { font: 700 30px/1.05 'Space Grotesk', 'Manrope', sans-serif; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.intro-price.up .ip-val::after, .intro-price.down .ip-val::after { font: 700 12px 'Space Mono', monospace; animation: ipFlag 1.1s ease both; }
.intro-price.up .ip-val::after { content: '▲'; }
.intro-price.down .ip-val::after { content: '▼'; }
@keyframes ipFlag { 0% { opacity: 0; translate: 0 4px; } 20% { opacity: 1; translate: 0 0; } 75% { opacity: 1; } 100% { opacity: 0; } }
.ip-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

/* size step art: the drawing and its shadow stay inside the frame and clear of the size label */
.size-art { overflow: hidden; }
@media (max-width: 820px) {
  .size-art { height: 230px; }
  .size-art .pkg-art { position: absolute; left: 14px; top: 12px; width: calc(100% - 28px); height: calc(100% - 52px); transform-origin: 50% 100%; }
  .custom-size:empty { display: none; }
  .size-art .dim { bottom: 12px; left: 14px; }
  .size-card { padding: 14px 12px; }
  .size-card b { font-size: 28px; }
  .size-card span { font-size: 11px; }
  .ip-val b { font-size: 26px; }
}

/* ---------- toasts on phones: full width above the step bar, tap or swipe to close, timer line ---------- */
body.mobile .toast { left: 12px; right: 12px; max-width: none; transform: translateY(20px); pointer-events: auto; padding: 12px 14px 14px; font-size: 14px; line-height: 1.35; touch-action: none; user-select: none; -webkit-user-select: none; }
body.mobile .toast.show { transform: translateY(0); }
body.mobile:not(.m-open):not(.gw-on) .toast { bottom: calc(var(--nav) + 62px); } /* above the 3D view buttons */
body.mobile .toast.has-act { justify-content: space-between; }
body.mobile .toast button { flex: none; height: 32px; }
body.mobile .toast::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: #fff; opacity: .5; transform-origin: 0 50%; transform: scaleX(0); }
body.mobile .toast.show::after { animation: toastTime var(--toast-ms, 3000ms) linear both; }
body.mobile .toast.held::after { animation-play-state: paused; }
body.mobile .toast.drag { transition: none; }
@keyframes toastTime { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- 3D view while the phone sheet opens/closes: soft veil instead of a cleared (black) canvas ---------- */
.stage::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 2; }
.stage.resizing::after { opacity: 1; transition: none; }
.stage.gl-lost::after { opacity: 1; background: rgba(255,255,255,.85); }
@media (prefers-reduced-motion: reduce) { .intro-price.up .ip-val::after, .intro-price.down .ip-val::after { animation: none; content: none; } }
