:root {
  --mat: #1d3830;
  --mat-deep: #142a24;
  --mat-line: rgba(206, 232, 217, 0.07);
  --mat-line-inch: rgba(206, 232, 217, 0.17);
  --mat-text: #d3e6db;
  --mat-dim: #8db0a1;
  --paper: #f3f0e8;
  --paper-2: #e8e3d7;
  --ink: #16211d;
  --ink-2: #4e5b55;
  --rule: #d5cfc1;
  --accent: #d7157e;
  --warn: #9a5d00;
  --warn-bg: #fbefd8;
  --ok: #24603f;
  --radius: 10px;
  --ui: 'Spline Sans', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, monospace;
  --in: 96px;
  --gx: 0px;
  --gy: 0px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "bar panel" "stage panel";
  background: var(--mat);
  color: var(--ink);
  font: 400 15px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 0.8em; letter-spacing: 0.01em; }

/* Top bar, on the mat */
.bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  color: var(--mat-text);
  border-bottom: 1px solid var(--mat-line-inch);
}
.title { margin: 0 auto 0 0; font-size: 15px; font-weight: 500; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.title .mono { color: var(--mat-dim); }

.sides { display: flex; padding: 3px; border-radius: 999px; background: var(--mat-deep); }
.sides button {
  min-height: 48px; min-width: 76px; padding: 0 16px; border: 0; border-radius: 999px;
  background: none; color: var(--mat-dim); font-weight: 500; text-align: center;
}
.sides button[aria-selected="true"] { background: var(--paper); color: var(--ink); }

.hist { display: flex; gap: 4px; }
.icon {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 999px; background: none; color: inherit;
}
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon:hover:not(:disabled) { background: rgba(206, 232, 217, 0.1); }
.icon:disabled { opacity: 0.35; cursor: default; }

.make {
  min-height: 48px; padding: 0 20px; white-space: nowrap; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-weight: 600; text-align: center;
}
.make:hover { background: #fff; }
.make .short { display: none; }

/* The mat: a quarter-inch grid at the card's own scale, inch lines brighter */
.stage {
  grid-area: stage;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 40px 32px 24px;
  min-height: 0;
  background-color: var(--mat);
  background-image:
    linear-gradient(var(--mat-line-inch) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line-inch) 1px, transparent 1px),
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: var(--in) var(--in), var(--in) var(--in), calc(var(--in) / 4) calc(var(--in) / 4), calc(var(--in) / 4) calc(var(--in) / 4);
  background-position: var(--gx) var(--gy);
  overflow: hidden;
}

.fit { min-height: 0; min-width: 0; container-type: size; display: grid; place-items: center; }
/* The piece fits its area whatever its shape, from a sticker to an 8 ft banner. */
#card {
  width: min(100cqw, 100cqh * var(--aspect, 1.6667), 860px);
  height: auto;
  aspect-ratio: var(--aspect, 1.6667);
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)) drop-shadow(0 18px 28px rgba(5, 15, 12, 0.45));
  overflow: visible;
}

.ruler { position: absolute; inset: 0; pointer-events: none; }
.ruler i {
  position: absolute; transform: translate(-50%, -50%);
  font: 500 10px/1 var(--mono); font-style: normal; color: var(--mat-dim);
}
.ruler i::before { content: attr(data-n); }

.caption {
  margin: 0; min-height: 44px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
  color: var(--mat-dim); text-align: center;
}
.status {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--mat-line-inch); border-radius: 999px;
  background: none; color: var(--mat-text); font-size: 13px; text-align: center;
}
.status.warn { border-color: rgba(240, 180, 80, 0.5); color: #f3cf8f; }
.status:empty { display: none; }
.loading { position: absolute; margin: 0; color: var(--mat-dim); font-size: 14px; }
.loading[hidden] { display: none; }

/* The panel: paper */
.panel {
  grid-area: panel;
  background: var(--paper);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 32px;
  border-left: 1px solid var(--rule);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.done {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--rule); border-radius: 999px;
  background: #fff; font-size: 14px; font-weight: 500; text-align: center;
}
.group { padding: 16px 0; border-top: 1px solid var(--rule); }
.group:first-of-type { border-top: 0; }
.group h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: center; }
.note { margin: 0; font-size: 13px; color: var(--ink-2); text-align: center; }

.flag {
  margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--warn-bg); color: var(--warn); font-size: 13px; text-align: center;
}
.flag.error { background: #fbe3e3; color: #9b1c1c; }

textarea {
  width: 100%; min-height: 92px; resize: vertical; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; line-height: 1.4;
}

.fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fonts button {
  display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 58px; padding: 6px 8px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; font-size: 17px; line-height: 1.1; text-align: center;
}
.fonts button small { font-size: 12px; color: var(--ink-2); }
.fonts button[aria-busy="true"] { opacity: 0.5; }
.steppers .seg.caps button { font-size: 13px; font-weight: 500; }
.fonts button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
.stepper { display: grid; gap: 6px; justify-items: center; }
.stepper label { font-size: 12px; color: var(--ink-2); }
.stepper > div {
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; width: 100%;
  border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; overflow: hidden;
}
.stepper button { height: 48px; border: 0; background: none; font-size: 20px; line-height: 1; text-align: center; }
.stepper button:hover { background: var(--paper-2); }
.stepper input {
  width: 100%; min-width: 0; height: 48px; border: 0; text-align: center; font-family: var(--mono); font-size: 14px; background: none;
}

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg button { display: grid; place-items: center; min-height: 48px; border: 0; border-left: 1px solid var(--rule); background: none; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatches button {
  aspect-ratio: 1; min-height: 44px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, 0.18);
  background: var(--sw); padding: 0;
}
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch-name { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--ink-2); }
.swatch-name .mono { color: var(--ink-2); }

.row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.btn {
  min-height: 48px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: #fff; font-size: 14px; font-weight: 500; text-align: center;
}
.btn:hover { border-color: var(--ink-2); }
.btn.danger { color: #9b1c1c; }

.templates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.templates button {
  display: grid; gap: 8px; justify-items: center; padding: 10px; border: 1px solid var(--rule);
  border-radius: var(--radius); background: var(--paper-2); font-size: 13px; font-weight: 500; text-align: center;
}
.templates svg { width: 100%; height: auto; display: block; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 6px 14px rgba(0, 0, 0, 0.1); }

.pieces { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pieces button {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 6px 12px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; text-align: center; font-size: 14px;
}
.pieces .dot { flex: none; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.2); background: var(--sw); }
.pieces .warn-dot { flex: none; width: 8px; height: 8px; border-radius: 999px; background: #d98a00; }
.pieces span.label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.legend { display: grid; gap: 10px; margin: 0; }
.legend div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.legend dt { display: grid; place-items: center; }
.legend dd { margin: 0; }
.legend svg { width: 34px; height: 14px; }

.toggle { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font-size: 14px; cursor: pointer; }
.toggle input {
  appearance: none; -webkit-appearance: none; width: 48px; height: 48px; margin: 0 -12px; cursor: pointer;
  background: center / 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Crect x='1' y='1' width='20' height='20' rx='5' fill='%23fff' stroke='%234e5b55' stroke-width='1.5'/%3E%3C/svg%3E");
}
.toggle input:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Crect x='1' y='1' width='20' height='20' rx='5' fill='%2316211d' stroke='%2316211d' stroke-width='1.5'/%3E%3Cpath d='m6 11.5 3.5 3.5L16 8' fill='none' stroke='%23f3f0e8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.toggle input:focus-visible { outline-offset: -10px; }

/* Print check */
dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 0; border-radius: 16px; background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
dialog::backdrop { background: rgba(10, 22, 18, 0.62); }
.sheet { padding: 20px 22px 22px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { margin: 0 0 0 4px; font-size: 18px; font-weight: 600; }
.close { color: var(--ink); }
.close:hover { background: var(--paper-2); }

.checks { margin: 0; padding: 0; list-style: none; }
.checks li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.checks li:first-child { border-top: 0; }
.checks svg { width: 22px; height: 22px; margin-top: 1px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.checks .pass svg { stroke: var(--ok); }
.checks .warn svg { stroke: #c27a00; }
.checks .fail svg { stroke: #b42318; }
.checks strong { display: block; font-size: 14px; font-weight: 600; }
.checks span { display: block; font-size: 14px; color: var(--ink-2); }

.working { display: grid; justify-items: center; gap: 14px; padding: 34px 0 26px; color: var(--ink-2); text-align: center; }
.working i {
  width: 28px; height: 28px; border-radius: 999px; border: 3px solid var(--rule); border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sheet-foot { display: grid; gap: 12px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--rule); }
.download {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; text-align: center;
}
.download[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.fine { margin: 0; font-size: 12.5px; color: var(--ink-2); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .working i { animation-duration: 2.4s; }
}

@media (max-width: 1180px) {
  .title .mono { display: none; }
  body { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1000px) and (min-width: 861px) {
  .title { display: none; }
  .sides { margin-right: auto; }
}

/* Phone: card on top, the panel becomes the lower sheet */
@media (max-width: 860px) {
  body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(220px, 40dvh) minmax(0, 1fr);
    grid-template-areas: "bar" "stage" "panel";
  }
  .bar { gap: 6px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .title { display: none; }
  .sides { margin-right: auto; }
  .sides button { min-width: 60px; padding: 0 11px; }
  .hist { gap: 0; }
  .make { padding: 0 15px; }
  .make .long { display: none; }
  .make .short { display: inline; }
  .stage { padding: 26px 16px 12px; gap: 12px; }
  .panel {
    border-left: 0; border-top: 1px solid var(--rule); border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
  }
  .panel-head { justify-content: center; position: relative; min-height: 40px; }
  .panel-head .done { position: absolute; right: 0; }
  .caption { font-size: 12px; }
}
.stepper > .seg.caps { grid-template-columns: 1fr 1fr; border-radius: var(--radius); }

/* Logo, brand color, details */
.dropzone {
  width: 100%; display: grid; justify-items: center; gap: 6px; padding: 24px 16px;
  border: 1.5px dashed #b6ad9b; border-radius: 14px; background: #fbfaf6; color: var(--ink); text-align: center;
}
.dropzone:hover { border-color: var(--accent); background: #fff; }
.dropzone svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dropzone strong { font-size: 16px; font-weight: 600; }
.dropzone span { font-size: 13px; color: var(--ink-2); }
.dropzone .spin, .spin {
  width: 26px; height: 26px; border-radius: 999px; border: 3px solid var(--rule); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.logo-card { display: grid; justify-items: center; gap: 10px; padding: 14px; border: 1px solid var(--rule); border-radius: 14px; background: #fff; text-align: center; }
.logo-thumb {
  display: grid; place-items: center; width: 160px; height: 84px; border-radius: 10px;
  background: repeating-conic-gradient(#efece5 0 25%, #fff 0 50%) 0 0 / 14px 14px;
}
.logo-thumb img { max-width: 140px; max-height: 68px; object-fit: contain; }
.logo-meta { display: grid; gap: 2px; min-width: 0; }
.logo-meta strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.logo-meta .mono { color: var(--ink-2); }
.brand-inks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brand-inks button {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 10px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; font-size: 12px; text-align: center;
}
.brand-inks button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.brand-inks i { flex: none; width: 22px; height: 22px; border-radius: 999px; background: var(--sw); border: 1px solid rgba(0, 0, 0, 0.15); }
.brand-inks i.none { background: conic-gradient(#1b2e51 0 25%, #ad312f 0 50%, #dca92b 0 75%, #1e6e7c 0); }
.details { display: grid; gap: 10px; }
.details label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); text-align: center; }
.details input {
  width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: #fff; font-size: 16px; color: var(--ink);
}
textarea { font-size: 16px; }
.btn.wide { width: 100%; margin-top: 14px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.wide:hover { background: #24342e; }
.templates { grid-template-columns: 1fr 1fr; }
.templates button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fff; }
.status.lit { min-height: 48px; padding: 0 20px; background: var(--paper); color: var(--ink); border-color: transparent; font-weight: 600; }
.status.lit:hover { background: #fff; }

.drop-veil {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(16, 36, 30, 0.8); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.drop-veil.on { opacity: 1; }
.drop-veil div {
  display: grid; justify-items: center; gap: 8px; padding: 48px 64px; border: 2px dashed rgba(243, 240, 232, 0.7);
  border-radius: 22px; color: var(--paper); text-align: center;
}
.drop-veil strong { font-size: 24px; font-weight: 600; }
.drop-veil span { color: var(--mat-text); }

/* The printed card, in the hand */
dialog.preview {
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .34 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border-radius: 0;
  background: radial-gradient(130% 95% at 50% 16%, #f4f0e8 0%, #ded6c7 60%, #c7bdab 100%);
  color: var(--ink); grid-template-rows: minmax(0, 1fr) auto; box-shadow: none; overflow: hidden;
}
dialog.preview[open] { display: grid; }
dialog.preview::backdrop { background: #1d3830; }
dialog.preview::before {
  content: ""; position: absolute; inset: 0; background-image: var(--noise); opacity: 0.35; mix-blend-mode: multiply; pointer-events: none;
}
.preview-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 3; color: var(--ink); background: rgba(255, 255, 255, 0.55); }
.preview-close:hover { background: #fff; }
.scene { position: relative; display: grid; place-items: center; perspective: 1500px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.scene:active { cursor: grabbing; }
.lift { position: relative; width: min(580px, 84vw); aspect-ratio: 252 / 144; }
.card3d { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.face, .core { position: absolute; inset: 0; overflow: hidden; }
.face { backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.1); }
.face.front { transform: translateZ(1.5px); }
.face.back { transform: rotateY(180deg) translateZ(1.5px); }
.core { background: #e8e1d3; }
.preview[data-corners="round"] .face, .preview[data-corners="round"] .core { border-radius: 3.57% / 6.25%; }
.face .art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.face .grain, .face .sheen { position: absolute; inset: 0; pointer-events: none; }
.face .grain { background-image: var(--noise); background-size: 140px; mix-blend-mode: multiply; opacity: 0.14; }
.face .sheen {
  background: radial-gradient(circle at var(--lx, 28%) var(--ly, 18%), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 58%);
  mix-blend-mode: soft-light; opacity: 0.5;
}
.preview[data-stock="uncoated"] .face .grain { opacity: 0.34; background-size: 110px; }
.preview[data-stock="uncoated"] .face .sheen { opacity: 0.12; }
.preview[data-stock="soft-touch"] .face .grain { opacity: 0.06; }
.preview[data-stock="soft-touch"] .face .sheen { opacity: 0.32; background: radial-gradient(circle at var(--lx, 28%) var(--ly, 18%), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 80%); }
.cast {
  position: absolute; left: 4%; right: 4%; bottom: -18%; height: 30%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(52, 40, 26, 0.42), rgba(52, 40, 26, 0));
  filter: blur(12px); transform: scaleX(calc(0.55 + 0.45 * var(--turn, 1))); opacity: calc(1 - 0.35 * var(--tilt, 0));
}
.hint { position: absolute; bottom: 18px; margin: 0; font-size: 13px; color: var(--ink-2); transition: opacity 0.4s; }
.hint.gone { opacity: 0; }
.preview-bar {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(246, 243, 236, 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.preview-bar .seg { min-width: 250px; }
.preview-bar .seg button { padding: 0 12px; font-size: 14px; font-weight: 500; }
.preview-bar .btn.flip { min-width: 100px; }
.preview-bar .make { background: var(--ink); color: var(--paper); }
.preview-bar .make:hover { background: #24342e; }
@media (max-width: 860px) {
  .preview-bar .seg { flex: 1 1 100%; min-width: 0; }
  .preview-bar .btn.flip, .preview-bar .make { flex: 1 1 0; }
  .lift { width: 88vw; }
}
@media (prefers-reduced-motion: reduce) {
  .drop-veil { transition: none; }
}

/* Product and size */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.products button {
  display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 76px; padding: 6px 4px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; font-size: 12px; line-height: 1.2; text-align: center;
}
.products button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.products svg { width: 34px; height: 34px; }
.products svg rect, .products svg circle { fill: #f6f3ec; stroke: var(--ink-2); stroke-width: 1.2; }
.products button[aria-pressed="true"] svg rect, .products button[aria-pressed="true"] svg circle:not(.hole) { fill: #dff0ea; stroke: var(--ink); }
.products svg .fold { stroke: var(--ink-2); stroke-width: 0.9; stroke-dasharray: 2 1.5; }
.products svg .hole { fill: #fff; }
.sizes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.sizes button { min-height: 48px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; font-size: 13px; text-align: center; }
.sizes button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.row.add4 { grid-template-columns: repeat(4, 1fr); grid-auto-flow: row; }
.row.add4 .btn { padding: 0 6px; font-size: 13px; }
.sides[hidden] { display: none; }
.sides[hidden] + .hist { margin-left: auto; }
