/* ───────── Tokens ───────── */
:root {
  --bg: #f9f9f9;
  --surface: #ffffff;
  --low: #f3f3f3;
  --mid: #eaeaea;
  --line: #e4e4e4;
  --ink: #1a1c1c;
  --ink-2: #4c4546;
  --ink-3: #7e7576;
  --accent: #0266ff;
  --accent-ink: #0050cc;
  --good: #0a7f3f;   --good-bg: #e4f4ea;
  --warn: #9a5b00;   --warn-bg: #fff1d6;
  --bad: #ba1a1a;    --bad-bg: #ffdad6;
  --r: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 400 14px/20px var(--font);
  color: var(--ink);
  background: var(--low);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
p, h2, dl, dd { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.material-symbols-outlined { font-size: 20px; line-height: 1; flex: none; user-select: none; }

/* ───────── App grid ───────── */
.app {
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 56px var(--stage-h, 54dvh) minmax(0, 1fr);
  background: var(--low);
}
.topbar { grid-row: 1; }
.stage  { grid-row: 2; }
.panel  { grid-row: 3; }

@media (min-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr) 460px; grid-template-rows: 60px minmax(0, 1fr); }
  .topbar { grid-column: 1 / -1; }
  .stage  { grid-row: 2; grid-column: 1; }
  .panel  { grid-row: 2; grid-column: 2; border-radius: 0; border-left: 1px solid var(--line); }
}
@media (max-width: 480px) { .hide-sm { display: none !important; } }
@media (max-width: 959px) and (min-width: 481px) { .stage-foot { display: none; } }

/* ───────── Top bar ───────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
  z-index: 10;
}
@media (min-width: 960px) { .topbar { padding-left: 24px; padding-right: 20px; } }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 22px; height: 22px; border: 4px solid #111; border-radius: 2px; position: relative;
}
.brand-mark::after { content: ""; position: absolute; inset: 2px; background: var(--accent); }
.brand-name { font-weight: 700; letter-spacing: -.01em; font-size: 16px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px;
  border-radius: 10px; font-weight: 500; font-size: 13px; color: var(--ink);
}
.btn-ghost:hover { background: var(--low); }
.btn-ghost.icon-only { width: 40px; padding: 0; justify-content: center; }
.cart-btn { position: relative; width: 40px; padding: 0; justify-content: center; }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}

/* ───────── Stage ───────── */
.stage { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--low); }
.stage-bar {
  position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px; min-width: 0;
}
@media (min-width: 960px) { .stage-bar { padding: 16px 24px; } }
.spec-pill {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; height: 32px; padding: 0 12px;
  border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 1px 2px rgba(0,0,0,.06);
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.spec-pill > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.stage-tools { display: flex; align-items: center; gap: 8px; flex: none; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--mid); }
.seg button {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.seg button .material-symbols-outlined { font-size: 16px; }
.seg button.is-active { background: #111; color: #fff; }
.seg-glass { background: rgba(255,255,255,.92); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg-glass button:not(.is-active):hover { color: var(--ink); }

.zoom { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 4px; border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.zoom button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.zoom button:hover { background: var(--low); color: var(--ink); }
.zoom button .material-symbols-outlined { font-size: 18px; }
.zoom output { min-width: 44px; text-align: center; font: 500 12px/1 var(--mono); }

.stage-canvas { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.stage-canvas::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(rgba(0,0,0,.07) 1px, transparent 1px) 0 0 / 22px 22px;
  transition: opacity .4s;
}
.stage[data-mode="room"] .stage-canvas::before { opacity: 0; }
.stage-foot {
  position: relative; z-index: 4; text-align: center; padding: 10px 16px 14px;
  font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: .02em;
}

/* Room scene — everything here is sized from --s (px per cm) */
.room { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .45s; }
.stage[data-mode="room"] .room { opacity: 1; }
.wall {
  position: absolute; inset: 0;
  background:
    radial-gradient(110% 80% at 15% 0%, rgba(255,255,255,.65), transparent 60%),
    linear-gradient(#e7e1d7, #ddd6cb);
}
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(20 * var(--s));
  background: linear-gradient(#b9a184, #a48a6c);
}
.floor::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: calc(7 * var(--s));
  background: #f6f3ec; box-shadow: 0 -1px 0 rgba(0,0,0,.08);
}
.furniture {
  position: absolute; left: 50%; bottom: calc(14 * var(--s));
  width: calc(320 * var(--s)); height: calc(130 * var(--s)); margin-left: calc(-160 * var(--s));
}

/* The frame rig */
.rig {
  position: absolute; left: 0; top: 0; transform-origin: 50% 50%;
  transition: left .45s cubic-bezier(.2,.7,.2,1), top .45s cubic-bezier(.2,.7,.2,1), transform .3s ease;
}
.rig.no-anim, .rig.no-anim * { transition: none !important; }
.frame {
  position: relative; border-style: solid;
  border-width: var(--ft);
  border-color: var(--f-t) var(--f-r) var(--f-b) var(--f-l);
  box-shadow:
    0 calc(1.6 * var(--s)) calc(4 * var(--s)) rgba(0,0,0,.26),
    0 calc(.4 * var(--s)) calc(1 * var(--s)) rgba(0,0,0,.22),
    inset 0 0 0 1px rgba(0,0,0,.28);
  transition: border-width .3s, border-color .3s;
}
.mat {
  padding: calc(var(--mw) * var(--s)); background: var(--mat);
  box-shadow: inset 0 calc(.3 * var(--s)) calc(.8 * var(--s)) rgba(0,0,0,.22);
  transition: padding .3s, background-color .3s;
}
.poster {
  container-type: inline-size; position: relative; overflow: hidden;
  width: calc(var(--w) * var(--s)); height: calc(var(--h) * var(--s));
  background: #fff;
  transition: width .3s, height .3s;
}
.mat[data-has-mat="true"] .poster {
  box-shadow: 0 0 0 max(1px, calc(.25 * var(--s))) #fff, 0 0 calc(.6 * var(--s)) calc(.3 * var(--s)) rgba(0,0,0,.3);
}
.glare {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 34%, rgba(255,255,255,.16) 47%, transparent 60%);
}

/* Dimension lines */
.dim { position: absolute; pointer-events: none; border: 1px solid var(--ink-3); transition: opacity .3s; }
.dim span { position: absolute; background: var(--low); padding: 0 6px; font: 500 11px/1 var(--mono); color: var(--ink-2); white-space: nowrap; }
.dim-w { left: 0; right: 0; top: -20px; height: 8px; border-bottom: 0; }
.dim-w span { left: 50%; top: -6px; transform: translateX(-50%); }
.dim-h { top: 0; bottom: 0; right: -20px; width: 8px; border-left: 0; }
.dim-h span { top: 50%; left: 4px; transform: translate(-50%, -50%) rotate(90deg); }
.stage[data-mode="room"] .dim { opacity: 0; }

/* ───────── Panel ───────── */
.panel {
  display: flex; flex-direction: column; min-height: 0; background: var(--surface);
  border-radius: 20px 20px 0 0; box-shadow: 0 -8px 28px rgba(0,0,0,.06); position: relative; z-index: 5;
}
@media (min-width: 960px) { .panel { box-shadow: none; } }

.tabs { display: flex; gap: 2px; margin: 14px 16px 6px; padding: 3px; border-radius: 999px; background: var(--low); flex: none; }
.tabs button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px;
  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.tabs .step {
  width: 20px; height: 20px; border-radius: 50%; background: var(--mid); display: grid; place-items: center;
  font-size: 11px; letter-spacing: 0; color: var(--ink-2);
}
.tabs button[aria-selected="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); color: var(--ink); }
.tabs button[aria-selected="true"] .step { background: #111; color: #fff; }

.panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 24px; scrollbar-width: thin; }
@media (min-width: 960px) { .panel-body { padding: 18px 24px 28px; } .tabs { margin: 16px 24px 6px; } }
.pane { display: none; flex-direction: column; gap: 26px; }
.pane.is-active { display: flex; }

.group { display: flex; flex-direction: column; gap: 10px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.value { font-size: 12px; font-weight: 600; text-align: right; }
.count { font: 500 11px/1 var(--mono); color: var(--ink-3); }
.hint { font-size: 12px; line-height: 17px; color: var(--ink-3); }

.grid { display: grid; gap: 8px; }
.cols-1 { grid-template-columns: minmax(0, 1fr); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 360px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Option card (shared by frames, mats, sizes, fonts, orientation) */
.opt {
  position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left;
  padding: 10px 12px; min-height: 56px; border-radius: var(--r); background: var(--low);
  border: 2px solid transparent; transition: background-color .15s, border-color .15s;
}
.opt:hover { background: var(--mid); }
.opt[aria-pressed="true"] { background: var(--surface); border-color: var(--accent); box-shadow: 0 1px 4px rgba(2,102,255,.14); }
.opt-body { min-width: 0; flex: 1; }
.opt-title, .opt-sub { display: block; }
.opt-title { font-weight: 600; font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-sub { font-size: 11px; line-height: 15px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-price { font: 600 12px/1 var(--mono); flex: none; color: var(--ink-2); }
.opt-price.plus { color: var(--accent-ink); }
.opt.stack { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; padding: 10px 12px; }
.opt.center { align-items: center; text-align: center; }
.opt.center .opt-title, .opt.center .opt-sub { text-align: center; width: 100%; }
.popular {
  position: absolute; top: -8px; right: 10px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.size-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.tag { display: inline-block; margin-top: 2px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.tag.ok { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }

.font-sample { font-size: 24px; line-height: 1; width: 34px; text-align: center; flex: none; }
.mini-frame { width: 40px; height: 40px; flex: none; border: 7px solid; background: #f4f2ee; box-shadow: 0 1px 3px rgba(0,0,0,.25); }

/* Swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 12px 14px; padding: 12px; border-radius: var(--r); background: var(--low); }
.sw { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 58px; }
.sw-dot {
  width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  display: grid; place-items: center; transition: box-shadow .15s;
}
.sw-dot .material-symbols-outlined { font-size: 18px; opacity: 0; color: var(--ink); }
.sw[data-dark="true"] .sw-dot .material-symbols-outlined { color: #fff; }
.sw[aria-pressed="true"] .sw-dot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.sw[aria-pressed="true"] .sw-dot .material-symbols-outlined { opacity: 1; }
.sw-name { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.sw[aria-pressed="true"] .sw-name { color: var(--ink); }

/* Upload card */
.upload {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); background: var(--low);
  border: 2px dashed transparent; transition: border-color .15s, background-color .15s;
}
.upload.is-over { border-color: var(--accent); background: #eef4ff; }
.thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--mid); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-meta { min-width: 0; flex: 1; }
.upload-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-soft {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.1), inset 0 0 0 1px var(--line);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; flex: none;
}
.btn-soft:hover { background: var(--bg); }
.btn-soft.big { height: 48px; padding: 0 18px; }
.chip { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.chip.ok { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip:empty { display: none; }

/* Inputs */
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%; height: 46px; padding: 0 40px 0 14px; border: 0; border-radius: 10px; background: var(--low);
  font-size: 15px; transition: background-color .15s, box-shadow .15s;
}
.input-wrap.sub input { height: 42px; font-size: 14px; padding-right: 14px; }
.input-wrap input::placeholder { color: var(--ink-3); }
.input-wrap input:focus { outline: 0; background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.input-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink-3); border-radius: 50%; }
.input-clear:hover { color: var(--ink); }
.input-clear .material-symbols-outlined { font-size: 18px; }

/* Switches */
.switches { display: flex; flex-direction: column; gap: 8px; }
.switch-row {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 8px 14px; border-radius: var(--r); background: var(--low); cursor: pointer; font-weight: 500; font-size: 13px;
}
.switch-row > span { display: inline-flex; align-items: center; gap: 10px; }
.switch-row .material-symbols-outlined { color: var(--ink-3); font-size: 20px; }
.switch-row input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch { position: relative; width: 40px; height: 24px; border-radius: 999px; background: #c9c9c9; flex: none; transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s; }
.switch-row input:checked ~ .switch { background: var(--accent); }
.switch-row input:checked ~ .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible ~ .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.note { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--low); color: var(--ink-2); font-size: 12px; line-height: 17px; }
.note .material-symbols-outlined { color: var(--accent-ink); }

/* Footer / CTA */
.panel-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface);
}
@media (min-width: 960px) { .panel-foot { padding: 16px 24px; } }
.price { min-width: 0; }
.price strong { display: block; font-size: 24px; line-height: 28px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price small { display: block; font-size: 11px; line-height: 15px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; flex: none;
  border-radius: 12px; background: #111; color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  transition: transform .1s, background-color .15s;
}
.cta:hover { background: #2a2a2a; }
.cta:active { transform: scale(.97); }
@media (min-width: 960px) { .cta { padding: 0 28px; } }

/* ───────── Review sheet ───────── */
.sheet { border: 0; padding: 0; border-radius: 18px; width: min(440px, calc(100% - 32px)); color: var(--ink); background: var(--surface); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.sheet::backdrop { background: rgba(10,10,10,.45); }
.sheet-in { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -.01em; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; padding: 14px; border-radius: var(--r); background: var(--low); font-size: 13px; }
.spec dt { color: var(--ink-3); }
.spec dd { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.spec-total { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.spec-total span { color: var(--ink-2); font-weight: 500; }
.spec-total strong { font-size: 24px; letter-spacing: -.02em; }
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .cta { flex: 1; }
@media (max-width: 600px) {
  .sheet { margin: auto 0 0; width: 100%; max-width: none; border-radius: 20px 20px 0 0; }
  .sheet-actions .btn-soft { display: none; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 50; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; background: #111; color: #fff; font-size: 13px; font-weight: 500;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ───────── Poster blueprints (drawn by poster.js) ───────── */
.bp { position: absolute; inset: 0; overflow: hidden; transition: background-color .25s, color .25s; letter-spacing: normal; } /* posters measure their own text; page-level spacing would push lyrics out of their shape */
.bp > * { position: absolute; }
.bp .t { display: flex; align-items: center; overflow: hidden; }
.bp .t > span { display: block; width: 100%; white-space: nowrap; }
.bp .t.multi > span { white-space: pre-line; }
.bp .ph { overflow: hidden; background: rgba(0,0,0,.08); }
.bp .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp .line, .bp .deco { background: var(--accent); }

/* Photo shapes (shared by the poster, the shape picker and the heart decoration) */
.shp-heart  { clip-path: url(#c-heart); }
.shp-hex    { clip-path: url(#c-hex); }
.shp-star   { clip-path: url(#c-star); }
.shp-circle { border-radius: 50%; }
.shp-arch   { border-radius: 9999px 9999px 0 0; }
.shp-rounded{ border-radius: 12%; }

/* ───────── Design picker ───────── */
.templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tpl {
  display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--r); background: var(--low);
  border: 2px solid transparent; text-align: left; transition: background-color .15s, border-color .15s;
}
.tpl:hover { background: var(--mid); }
.tpl[aria-pressed="true"] { background: var(--surface); border-color: var(--accent); box-shadow: 0 1px 4px rgba(2,102,255,.14); }
.tpl-thumb { display: block; aspect-ratio: 5 / 7; border-radius: 3px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.25); background: #fff; }
.poster-mini { display: block; position: relative; width: 100%; height: 100%; container-type: inline-size; }
.tpl-name { font-size: 12px; font-weight: 600; line-height: 16px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-tag { font-size: 10px; line-height: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── Editor cards ───────── */
.editor { display: flex; flex-direction: column; gap: 10px; }
.ed-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--low); }
.ed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; }
.ed-title { font-size: 13px; font-weight: 600; }
.ed-body { display: flex; flex-direction: column; gap: 10px; }
.ed-card.is-off .ed-body { opacity: .4; pointer-events: none; }
.ed-card input[type="text"], .ed-card input[type="date"], .ed-card textarea, .ed-card select {
  width: 100%; border: 0; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  padding: 0 12px; height: 42px; font-size: 14px; color: var(--ink); transition: box-shadow .15s;
}
.ed-card textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 21px; font-family: var(--font); }
.ed-card input:focus, .ed-card textarea:focus, .ed-card select:focus { outline: 0; box-shadow: 0 0 0 2px var(--accent); }
.select-wrap { position: relative; min-width: 0; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 34px; text-overflow: ellipsis; }
.select-wrap .material-symbols-outlined { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-3); }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.mini-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

.typo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  min-width: 40px; height: 36px; padding: 0 8px; border-radius: 8px; background: var(--surface); font-size: 19px; line-height: 1;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line);
}
.fchip[aria-pressed="true"] { border-color: var(--accent); box-shadow: none; }
.stepper { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 2px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--ink-2); }
.stepper button:hover { background: var(--low); color: var(--ink); }
.stepper button .material-symbols-outlined { font-size: 20px; }
.size-val { min-width: 40px; text-align: center; font: 500 12px/1 var(--mono); }

.shapes { display: flex; flex-wrap: wrap; gap: 6px; }
.shape-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line); }
.shape-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: none; }
.shape-icon { display: block; width: 22px; height: 22px; background: var(--ink-2); }
.shape-btn[aria-pressed="true"] .shape-icon { background: var(--accent); }

.range { display: grid; grid-template-columns: 88px 1fr 44px; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); }
.range input { width: 100%; accent-color: var(--accent); margin: 0; height: 24px; }
.range output { text-align: right; font: 500 11px/1 var(--mono); color: var(--ink-3); }

.switch-row.compact { min-height: 44px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.mini-switch { position: relative; display: inline-flex; cursor: pointer; }
.mini-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.mini-switch input:checked ~ .switch { background: var(--accent); }
.mini-switch input:checked ~ .switch::after { transform: translateX(16px); }
.mini-switch input:focus-visible ~ .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Colour rows */
.color-row { gap: 10px; }
.cdots { display: flex; flex-wrap: wrap; gap: 10px; }
.cdot {
  position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); transition: box-shadow .15s;
}
.cdot .material-symbols-outlined { font-size: 18px; opacity: 0; color: #fff; mix-blend-mode: difference; }
.cdot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--low), 0 0 0 4px var(--accent); }
.cdot[aria-pressed="true"] .material-symbols-outlined { opacity: 1; }
.cdot.custom { background: conic-gradient(#f66, #fc6, #6c6, #6cf, #96f, #f6c, #f66); }
.cdot.custom .material-symbols-outlined { opacity: 1; color: #fff; mix-blend-mode: normal; font-size: 16px; text-shadow: 0 0 3px rgba(0,0,0,.6); }
.cdot.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.ed-card .upload { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* ───────── Categories, shape picker, segmented controls ───────── */
.cats { display: flex; gap: 6px; flex-wrap: wrap; }
.cat { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--low); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cat:hover { background: var(--mid); }
.cat[aria-pressed="true"] { background: #111; color: #fff; }

.bp svg { overflow: hidden; display: block; }

.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.shape-btn.big { width: auto; height: 52px; --cut: var(--surface); color: var(--ink-2); }
.shape-btn.big[aria-pressed="true"] { color: var(--accent); }
.shape-btn.big .shape-svg { width: 30px; height: 30px; display: block; }
.shape-btn.big .shape-img { width: 30px; height: 30px; display: block; object-fit: contain; }
.shape-btn.upload-tile { border: 2px dashed var(--line); box-shadow: none; color: var(--ink-3); }
.shape-btn.upload-tile:hover { color: var(--accent); border-color: var(--accent); }

.segmented { display: flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.segbtn { flex: 1; height: 34px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.segbtn[aria-pressed="true"] { background: #111; color: #fff; }

.palettes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pal { display: flex; height: 34px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line); padding: 0; }
.pal i { flex: 1; display: block; }
.pal[aria-pressed="true"] { border-color: var(--accent); box-shadow: none; }

.two.even { grid-template-columns: 1fr 1fr; }
.btn-soft.wide { width: 100%; justify-content: center; }
.range[hidden], .switch-row[hidden] { display: none; }
.ed-card .hint { margin: -2px 0 0; }

/* ───────── Photo effects, collage, busy indicator ───────── */
.fx-busy {
  position: absolute; z-index: 6; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: 999px;
  background: rgba(17,17,17,.88); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none;
}
.fx-busy[hidden] { display: none; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fx-btn {
  display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; border-radius: 10px; background: var(--surface);
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line); text-align: left; font-size: 12px; font-weight: 600; line-height: 15px;
}
.fx-btn .material-symbols-outlined { font-size: 20px; color: var(--ink-3); }
.fx-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: none; }
.fx-btn[aria-pressed="true"] .material-symbols-outlined { color: var(--accent); }
.edge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 4px; }
.edge-grid .segbtn { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.edge-grid .segbtn[aria-pressed="true"] { background: #111; color: #fff; box-shadow: none; }
.btn-soft[hidden], .ed-sub[hidden] { display: none; }
.ed-sub { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: var(--low); }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.slot { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--mid); box-shadow: inset 0 0 0 1px var(--line); }
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot:hover { outline: 2px solid var(--accent); }
.slot-n { position: absolute; left: 4px; top: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: rgba(17,17,17,.75); color: #fff; font: 600 10px/18px var(--font); text-align: center; }

/* ───────── Current poster card + gallery pop-up ───────── */
.design-current { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); background: var(--low); }
.design-current .tpl-thumb { width: 54px; flex: none; }
.dc-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.dc-meta b { font-size: 14px; line-height: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-meta small { font-size: 12px; line-height: 16px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gallery {
  border: 0; padding: 0; border-radius: 18px; width: min(1040px, 94vw); height: min(86vh, 780px); max-width: none; max-height: none;
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.35); overflow: hidden;
}
.gallery[open] { display: flex; }
.gallery::backdrop { background: rgba(10,10,10,.5); }
.gallery-in { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 6px 22px; }
.gallery-title h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.01em; }
.gallery-title p { margin: 0; font-size: 12px; color: var(--ink-3); }
.gallery-tools { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 22px 14px; border-bottom: 1px solid var(--line); }
.gallery-tools .select-wrap { flex: 1; min-width: 190px; max-width: 320px; }
.gallery select {
  width: 100%; height: 44px; border: 0; border-radius: 10px; background: var(--low); padding: 0 36px 0 14px;
  font: 600 14px var(--font); color: var(--ink); appearance: none; -webkit-appearance: none; cursor: pointer;
}
.gallery select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gallery-tools .btn-soft { height: 44px; }
.gallery-grid {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 26px; display: grid; align-content: start; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); scrollbar-width: thin;
}
.gallery-grid .tpl { padding: 10px; }
.gallery-grid .tpl-name { font-size: 13px; }
@media (max-width: 600px) {
  .gallery { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .gallery-head { padding-left: 16px; }
  .gallery-tools { padding: 6px 16px 12px; }
  .gallery-tools .select-wrap { max-width: none; flex-basis: 100%; }
  .gallery-tools .btn-soft { flex: 1; justify-content: center; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 16px 24px; }
}

/* ───────── Maps & country posters ───────── */
.ed-card.is-collapsed > .ed-body { display: none; }
.ed-head.clickable { cursor: pointer; user-select: none; }
.ed-head .chev { font-size: 20px; color: var(--ink-3); transition: transform .15s; margin-right: 4px; }
.ed-card:not(.is-collapsed) .ed-head .chev { transform: rotate(180deg); }
.ed-head.clickable .ed-title { flex: 1; }

.combo { position: relative; }
.combo-input { width: 100%; height: 44px; padding: 0 12px 0 38px !important; }
.combo-ico { position: absolute; left: 11px; top: 11px; font-size: 20px; color: var(--ink-3); pointer-events: none; }
.combo-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 240px; overflow-y: auto;
  background: var(--surface); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18), 0 0 0 1px var(--line);
}
.combo-list li { padding: 9px 10px; border-radius: 8px; font-size: 13px; line-height: 18px; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--low); }
.combo-list li.combo-empty { color: var(--ink-3); cursor: default; }
.combo-list li.combo-empty:hover { background: none; }

.place-chip { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; line-height: 18px; }
.place-chip .material-symbols-outlined { color: var(--accent); font-size: 20px; }
.place-chip .place-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-chip small { font: 500 10px/14px var(--mono); color: var(--ink-3); flex: none; }

.inline-field { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.inline-field.is-off .inline-body { opacity: .4; pointer-events: none; }
.inline-body { display: flex; flex-direction: column; gap: 8px; }
.inline-body input[type="text"], .inline-body input[type="date"], .inline-body select { background: var(--low) !important; box-shadow: none !important; height: 38px; }

.mstyles { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.mstyle { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface); border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line); font-size: 10px; font-weight: 600; text-align: center; color: var(--ink-2); }
.mstyle svg { width: 100%; height: auto; border-radius: 6px; display: block; }
.mstyle[aria-pressed="true"] { border-color: var(--accent); box-shadow: none; color: var(--ink); }

.nudges { display: flex; align-items: center; gap: 6px; }
.nudges .mini-label { flex: 1; }
.nudge { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nudge:hover { background: var(--mid); }
.markers { display: flex; flex-wrap: wrap; gap: 6px; }
.marker-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.marker-btn svg { width: 24px; height: 24px; }
.marker-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: none; color: var(--accent); }

.adv { border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); padding: 10px 12px; }
.adv > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.adv > summary::after { content: "expand_more"; font-family: 'Material Symbols Outlined'; font-size: 20px; color: var(--ink-3); transition: transform .15s; }
.adv[open] > summary::after { transform: rotate(180deg); }
.adv[open] > summary { margin-bottom: 12px; }
.adv > * + * { margin-top: 10px; }
.cdot.auto { background: var(--surface); }
.cdot.auto .material-symbols-outlined { opacity: 1; color: var(--ink-3); mix-blend-mode: normal; font-size: 18px; }
.ed-card .hint a { color: var(--accent-ink); }

/* ───────── Bigger preview: resizable sheet + full-screen viewer ───────── */
.icon-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.icon-btn:hover { background: #fff; }
.icon-btn .material-symbols-outlined { font-size: 22px; }

.grip { display: none; width: 100%; height: 26px; flex: none; place-items: center; touch-action: none; cursor: ns-resize; }
.grip span { width: 44px; height: 5px; border-radius: 3px; background: #d4d4d4; transition: background-color .15s; }
.grip:hover span, .grip:active span { background: #a8a8a8; }
@media (max-width: 959px) {
  .grip { display: grid; }
  .panel .tabs { margin-top: 0; }
  .stage-canvas { cursor: zoom-in; }
}

.rig.dragging { transition: none !important; }
.stage.is-full { position: fixed; inset: 0; z-index: 60; background: var(--low); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.stage.is-full .stage-canvas { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.stage.is-full .stage-canvas:active { cursor: grabbing; }
.stage.is-full .zoom.hide-sm { display: inline-flex !important; }
.stage.is-full .stage-foot { display: block !important; }
@media (max-width: 600px) {
  .stage.is-full .spec-pill { display: none; }
  .stage.is-full .stage-bar { justify-content: flex-end; }
  .stage.is-full .stage-tools { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
}

/* ───────── Size dropdown, frame material / category / finishes ───────── */
.field-select { position: relative; }
.field-select select {
  width: 100%; height: 48px; border: 0; border-radius: 12px; background: var(--low); padding: 0 42px 0 14px;
  font: 600 14px var(--font); color: var(--ink); appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis;
}
.field-select select:hover { background: var(--mid); }
.field-select select:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.field-select .material-symbols-outlined { position: absolute; right: 12px; top: 12px; pointer-events: none; color: var(--ink-3); }
#size-group .grid { margin-top: 2px; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-3 .opt.stack { padding: 10px 6px; }
.cols-3 .opt-title { white-space: normal; text-align: center; font-size: 12px; line-height: 15px; }
.cols-3 .opt-sub { white-space: normal; text-align: center; font-size: 10px; line-height: 13px; }

.hscroll { position: relative; }
.finishes { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.fin { flex: none; width: 76px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.fin-icon {
  width: 72px; height: 72px; border-radius: 18px; background: var(--low); display: grid; place-items: center;
  border: 2px solid transparent; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.fin:hover .fin-icon { background: var(--mid); }
.fin .mini-frame { width: 44px; height: 44px; border-width: 9px; border-radius: 4px; }
.fin[aria-pressed="true"] .fin-icon { background: var(--surface); border-color: var(--accent); box-shadow: 0 2px 8px rgba(2,102,255,.2); }
.fin-name { font-size: 11px; line-height: 14px; font-weight: 600; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.fin[aria-pressed="true"] .fin-name { color: var(--ink); }
.fin-price { font: 600 10px/12px var(--mono); color: var(--accent-ink); margin-top: -3px; }
.hs-btn { position: absolute; top: 20px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.22); display: none; place-items: center; z-index: 2; }
.hs-btn.prev { left: -10px; } .hs-btn.next { right: -10px; }
.hs-btn .material-symbols-outlined { font-size: 22px; }
@media (hover: hover) and (min-width: 700px) {
  .hscroll.can-scroll .hs-btn { display: grid; }
  .hscroll.can-scroll.at-start .hs-btn.prev, .hscroll.can-scroll.at-end .hs-btn.next { display: none; }
}

/* Frame profiles: how the moulding is drawn */
.frame[data-profile="step"]::before, .frame[data-profile="double"]::before, .frame[data-profile="double"]::after {
  content: ""; position: absolute; pointer-events: none; border: max(1px, calc(.16 * var(--s))) solid rgba(0,0,0,.3);
}
.frame[data-profile="step"]::before { inset: calc(var(--ft) * -0.5); }
.frame[data-profile="double"]::before { inset: calc(var(--ft) * -0.68); }
.frame[data-profile="double"]::after { inset: calc(var(--ft) * -0.32); }
.frame[data-profile="round"] { border-radius: calc(.5 * var(--s)); }

/* ───────── Mount swatches, auto-compact preview on phones ───────── */
.sw-dot.sw-none { background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); }
.sw[aria-pressed="true"] .sw-dot.sw-none { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent), inset 0 0 0 2px var(--line); }
#mounts { gap: 14px 22px; }
@media (max-width: 959px) {
  .app { transition: grid-template-rows .32s ease; }
  .app.is-compact { grid-template-rows: 56px var(--stage-small, 27dvh) minmax(0, 1fr); }
}

/* ───────── Store links in the designer ───────── */
.brand-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.back { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--ink); text-decoration: none; margin-left: -8px; }
.back:hover { background: var(--low); }
a.cart-btn { text-decoration: none; color: var(--ink); }
.sheet-in[hidden], .sheet-done[hidden] { display: none; }
.sheet-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 12px 4px 4px; }
.sheet-done h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; }
.sheet-done p { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 19px; max-width: 320px; }
.done-ico { font-size: 44px; color: #0a7f3f; }
.sheet-stack { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 10px; }
.sheet-stack .cta, .sheet-stack .btn-soft { justify-content: center; text-decoration: none; width: 100%; }

/* Real moulding: photographed corner + edge pieces, mirrored into place (sizes follow --fw and --s, so every size stays crisp) */
.pcs { display: none; }
.frame[data-profile="pieces"] { border-color: transparent; box-shadow: 0 calc(1.6 * var(--s)) calc(4 * var(--s)) rgba(0,0,0,.26), 0 calc(.4 * var(--s)) calc(1 * var(--s)) rgba(0,0,0,.22); }
.frame[data-profile="pieces"] .pcs { display: block; position: absolute; inset: calc(var(--ft) * -1); pointer-events: none; --t: var(--ft); }
.pc { position: absolute; display: block; }
.pc.c1, .pc.c2, .pc.c3, .pc.c4 { width: var(--t); height: var(--t); background: var(--pc) 0 0 / 100% 100% no-repeat; }
.pc.c1 { left: 0; top: 0; } .pc.c2 { right: 0; top: 0; transform: scaleX(-1); } .pc.c3 { left: 0; bottom: 0; transform: scaleY(-1); } .pc.c4 { right: 0; bottom: 0; transform: scale(-1, -1); }
.pc.e1, .pc.e2 { left: var(--t); right: var(--t); height: var(--t); background: var(--pe) 0 0 / auto var(--t) repeat-x; }
.pc.e1 { top: 0; } .pc.e2 { bottom: 0; transform: scaleY(-1); }
.pc.v1, .pc.v2 { top: var(--t); bottom: var(--t); width: var(--t); background: var(--pv) 0 0 / var(--t) auto repeat-y; }
.pc.v1 { left: 0; } .pc.v2 { right: 0; transform: scaleX(-1); }


/* ═════════ Posterize brand (matches the storefront: green accent, square corners, Playfair + Geist) ═════════ */
:root {
  --accent: #3e7462; --accent-ink: #2e5a4b; --bg: #f9f9f9; --low: #f4f3f3; --mid: #eeeeee; --line: #e2e2e2;
  --ink: #1a1c1c; --ink-2: #5d5f5d; --ink-3: #8a8c8b; --r: 2px;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body { letter-spacing: .01em; }
/* header: links left, logo centred, actions right */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
.tb-l { display: flex; align-items: center; gap: 4px; min-width: 0; }
.tb-nav { display: none; gap: 24px; margin-left: 12px; }
.tb-nav a { font: 500 11px var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.tb-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
@media (min-width: 1100px) { .tb-nav { display: flex; } }
.brand { justify-content: center; } .brand-mark { display: none; }
.brand-name { font: 400 22px/1 "Playfair Display", Georgia, serif; letter-spacing: .04em; text-transform: uppercase; }
.top-actions { justify-content: flex-end; }
.btn-ghost, .back { border-radius: 0; } .badge { background: var(--accent); }
/* square, quiet controls */
.seg, .seg button, .zoom, .tabs, .tabs button, .opt, .tag, .popular, .swatches, .upload, .thumb, .btn-soft, .chip, .input-wrap input,
.switch-row, .note, .cta, .sheet, .spec, .toast, .tpl, .tpl-thumb, .ed-card, .ed-card input[type="text"], .ed-card input[type="date"], .ed-card textarea, .ed-card select,
.fchip, .stepper, .stepper button, .shape-btn, .cat, .segmented, .segbtn, .pal, .fx-busy, .fx-btn, .ed-sub, .slot, .design-current, .gallery, .gallery select,
.combo-list, .combo-list li, .place-chip, .inline-field, .mstyle, .nudge, .marker-btn, .adv, .field-select select, .fin-icon, .spec-pill { border-radius: 2px; }
.panel { border-radius: 0; }
@media (max-width: 959px) { .sheet { border-radius: 0; } }
.tabs button { letter-spacing: .16em; font-size: 11px; }
.cta { background: var(--accent); letter-spacing: .16em; font-size: 12px; } .cta:hover { background: var(--accent-ink); }
.cat[aria-pressed="true"], .tabs button[aria-selected="true"] .step { background: var(--accent); }
.tpl[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 1px 4px rgba(62,116,98,.2); }
.fin[aria-pressed="true"] .fin-icon { box-shadow: 0 2px 8px rgba(62,116,98,.25); }
h2, .sheet h2, .gallery h2 { font-family: "Playfair Display", Georgia, serif; font-weight: 400; }

.no-dims .dim { display: none !important; }

/* ───────── Mounting styles, tones and formats (Millhouse parity) ───────── */
#fulfil.cols-3 .opt-title, #fulfil.cols-2 .opt-title { text-align: center; }
#fulfil .opt { justify-content: center; min-height: 44px; }
.mst { display: block; width: 34px; height: 42px; margin: 0 auto 6px; background: #2b2b2b; padding: 4px; }
.mst i { display: block; width: 100%; height: 100%; background: #f4f1ea; position: relative; }
.mst i::after { content: ""; position: absolute; inset: 6px; background: var(--accent, #3e7462); opacity: .55; }
.mst[data-type="DOUBLE"] i::before { content: ""; position: absolute; inset: 4px; border: 2px solid #1b1b1b; }
.mst[data-type="DOUBLE"] i::after { inset: 7px; }
.mst[data-type="FLOAT"] i::after { inset: 7px; box-shadow: 1px 2px 3px rgba(0,0,0,.45); opacity: .75; }
.mst[data-type="NONE"] i { background: transparent; }
.mst[data-type="NONE"] i::after { inset: 0; }
#mstyles .opt.stack { padding: 12px 6px 10px; }
#mstyles .opt-title { text-align: center; white-space: normal; font-size: 12.5px; }
#mstyles .opt-sub { text-align: center; font-size: 11px; }
.profile-photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.profile-photos a { flex: 0 0 auto; width: 76px; height: 76px; border: 1px solid var(--line, #e2e2e2); background: #fafafa; }
.profile-photos a:hover { border-color: var(--ink, #111); }
.profile-photos img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* double mount: the inner board shows as a thin band around the poster, each board with its white bevel */
.mat[data-has-mat="true"][data-mount="DOUBLE"] .poster {
  box-shadow:
    0 0 0 max(1px, calc(.2 * var(--s))) #fff,
    0 0 0 calc(var(--mr) * var(--s)) var(--mat2),
    0 0 0 calc(var(--mr) * var(--s) + max(1px, calc(.25 * var(--s)))) #fff,
    0 0 calc(.6 * var(--s)) calc(var(--mr) * var(--s) + .3 * var(--s)) rgba(0,0,0,.3);
}
/* float mount: the poster sits on top of the board and casts a shadow */
.mat[data-has-mat="true"][data-mount="FLOAT"] .poster {
  box-shadow: 0 calc(.35 * var(--s)) calc(1.1 * var(--s)) rgba(0,0,0,.34), 0 calc(.08 * var(--s)) calc(.25 * var(--s)) rgba(0,0,0,.25);
}
/* print only and digital file: no frame, no mount */
/* print only / digital: the frame stays in the preview, in black and white and a little faded */
#canvas:not([data-fulfil="framed"]) .pcs { filter: grayscale(1) contrast(.5) brightness(1.6); opacity: .55; }
#canvas:not([data-fulfil="framed"]) .frame { transition: filter .3s; }
#canvas:not([data-fulfil="framed"]) .glare { opacity: .4; }
#canvas[data-fulfil="digital"] .poster::after { content: "PDF"; position: absolute; right: 8px; top: 8px; font: 600 10px/1 var(--mono, monospace); letter-spacing: .08em; padding: 5px 7px; background: rgba(17,17,17,.82); color: #fff; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* "Digital poster only" / "Print only" switches under the size */
.ful-toggles { display: grid; gap: 8px; margin-top: 12px; }
.tgl { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, background-color .15s; }
.tgl:hover { border-color: var(--ink-3); }
.tgl.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl-ui { flex: none; width: 36px; height: 20px; border-radius: 99px; background: #d5d5d5; position: relative; transition: background-color .2s; }
.tgl-ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.tgl.on .tgl-ui { background: var(--accent); }
.tgl.on .tgl-ui::after { transform: translateX(16px); }
.tgl input:focus-visible + .tgl-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.tgl-txt { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; min-width: 0; flex: 1; }
.tgl-txt b { font-size: 13px; font-weight: 600; color: var(--ink); }
.tgl-txt .tgl-sub { grid-row: 1; grid-column: 2; font-size: 13px; font-weight: 600; color: var(--ink); }
.tgl-txt small:last-child { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.ful-note { margin-top: 8px; }
/* Frame tab while a poster has no frame: options greyed out and locked */
#pane-frame.is-off .frame-only { filter: grayscale(1); opacity: .45; pointer-events: none; user-select: none; }
.frame-off { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; background: var(--low); border: 1px solid var(--line); }
.frame-off .material-symbols-outlined { color: var(--ink-2); font-size: 20px; }
.frame-off p { margin: 0; flex: 1; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.frame-off b { color: var(--ink); }
.frame-off .btn-soft { flex: none; }
