/* inkpod — customizer (templates/customizer/editor.html + js/customizer*.js). Tokens only. */

/* ---------- app shell ---------- */
.cz [hidden], .cz-modal[hidden] { display: none !important; }
body.is-app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.is-app .announce { display: none; }
body.is-app main { display: flex; flex-direction: column; min-height: 0; flex: 1; }
body.is-app .site-header { border-bottom-color: var(--line); }

.cz { --cz-panel-w: 420px; --cz-amber: #8a5a00; --cz-amber-bg: #fff3d6;
  flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--cz-panel-w); }

/* ---------- stage ---------- */
.cz-stage { position: relative; min-height: 0; min-width: 0; overflow: hidden; background: #e9e2d6;
  background-image: radial-gradient(rgba(21, 19, 17, .07) 1px, transparent 1.2px); background-size: 22px 22px; }
.cz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; outline: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.cz-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--red); }
.cz-stage.is-skin { background: #2a2420; }

.cz-stage__top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; gap: .5rem; pointer-events: none; z-index: 3; }
.cz-stage__top > * { pointer-events: auto; }
.cz-iconrow { display: flex; gap: .4rem; }

.cz-seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); }
.cz-seg button { min-height: 38px; padding: 0 1.05rem; border: 0; border-radius: var(--r-pill); background: transparent; cursor: pointer; font: 400 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); transition: background .2s, color .2s; }
.cz-seg button[aria-checked="true"] { background: var(--ink); color: var(--bone); }
.cz-seg--sm button { min-height: 40px; width: 44px; padding: 0; display: grid; place-items: center; }
.cz-seg--sm svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.cz-ibtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; transition: background .2s, opacity .2s, transform .2s var(--ease); -webkit-tap-highlight-color: transparent; }
.cz-ibtn svg { width: 19px; height: 19px; }
.cz-ibtn:hover:not([disabled]) { background: #fff; transform: translateY(-1px); }
.cz-ibtn[disabled] { opacity: .38; cursor: default; }
.cz-ibtn--danger:hover:not([disabled]) { color: var(--danger); }

.cz-stage__bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: .55rem; pointer-events: none; z-index: 3; }
.cz-stage__bottom > * { pointer-events: auto; }
.cz-ctx { display: flex; gap: .3rem; padding: 4px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); animation: cz-pop .25s var(--ease); }
.cz-ctx .cz-ibtn { border-color: transparent; background: transparent; }
.cz-ctx .cz-ibtn:hover:not([disabled]) { background: var(--bone); }
.cz-sizeinfo { margin: 0; font: 400 .66rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); background: rgba(243, 238, 230, .78); padding: .35rem .7rem; border-radius: var(--r-pill); pointer-events: none !important; }
.cz-stage.is-skin .cz-sizeinfo { background: rgba(21, 19, 17, .55); color: rgba(243, 238, 230, .85); }
@keyframes cz-pop { from { opacity: 0; transform: translateY(6px); } }

/* skin bar */
.cz-skinbar { display: flex; flex-direction: column; align-items: center; gap: .5rem; max-width: 100%; }
.cz-chips { display: flex; gap: .35rem; overflow-x: auto; max-width: 100%; padding: 2px; scrollbar-width: none; }
.cz-chips::-webkit-scrollbar { display: none; }
.cz-chips button { flex: none; min-height: 38px; padding: 0 .95rem; border-radius: var(--r-pill); border: 1px solid rgba(243, 238, 230, .35); background: rgba(21, 19, 17, .5); color: var(--bone); cursor: pointer; font: 400 .68rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .12em; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s, color .2s; }
.cz-chips button[aria-checked="true"] { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.cz-tones { display: flex; gap: .35rem; padding: 5px; border-radius: var(--r-pill); background: rgba(21, 19, 17, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cz-tones button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: transform .2s var(--ease); }
.cz-tones button[aria-checked="true"] { border-color: var(--bone); transform: scale(1.08); }
.cz-tones .cz-tone-photo { background: conic-gradient(var(--skin-1) 0 25%, var(--skin-3) 0 50%, var(--skin-5) 0 75%, var(--skin-2) 0); font-size: 0; }

/* empty state, drop zone, busy */
.cz-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; padding: 4.5rem 1rem 3.5rem; }
.cz-empty__card { pointer-events: auto; text-align: center; max-width: 330px; padding: 1.4rem 1.4rem 1.5rem; animation: cz-pop .4s var(--ease); }
.cz-empty__glyph { display: block; color: var(--red); font-size: 1.1rem; margin-bottom: .5rem; }
.cz-empty__title { font: 400 clamp(1.6rem, 2.6vw, 2.1rem)/1.05 var(--f-display); margin: 0 0 .5rem; letter-spacing: -.01em; }
.cz-empty__title em { color: var(--red); }
.cz-empty__sub { font-size: .85rem; color: var(--muted); margin: 0 0 1.1rem; }
.cz-empty__btns { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }

.cz-drop { position: absolute; inset: 12px; z-index: 6; display: grid; place-items: center; border: 1.5px dashed var(--ink); border-radius: var(--r-lg); background: rgba(243, 238, 230, .82); font: 400 1.8rem/1 var(--f-display); pointer-events: none; }
.cz-busy { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; background: rgba(243, 238, 230, .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font: 400 .72rem/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; }
.cz-progress { width: 160px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.cz-progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.cz-spinner { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); border-top-color: var(--ink); animation: cz-spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.cz-spinner--sm { width: 14px; height: 14px; margin-right: .35rem; }
@keyframes cz-spin { to { transform: rotate(360deg); } }

.cz-note { position: absolute; z-index: 3; top: 66px; left: 14px; display: inline-flex; align-items: center; gap: .45rem; min-height: 34px; padding: 0 .85rem; border-radius: var(--r-pill); border: 1px solid rgba(138, 90, 0, .25); background: var(--cz-amber-bg); color: var(--cz-amber); font: 400 .66rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; cursor: pointer; animation: cz-pop .3s var(--ease); }
.cz-note__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mustard); }

/* ---------- panel ---------- */
.cz-panel { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--bone); border-left: 1px solid var(--line); }
.cz-grab { display: none; }
.cz-panel__head { padding: 1.3rem 1.5rem .2rem; }
.cz-panel__head .label { margin: 0 0 .3rem; }
.cz-title { font: 400 1.9rem/1.02 var(--f-display); margin: 0; letter-spacing: -.01em; }

.cz-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); padding: 0 .75rem; margin-top: .7rem; }
.cz-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-height: 60px; padding: .4rem .2rem; border: 0; background: none; cursor: pointer; color: var(--muted); font: 400 .62rem/1.15 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; text-align: center; transition: color .2s; -webkit-tap-highlight-color: transparent; }
.cz-tabs button svg { width: 21px; height: 21px; }
.cz-tabs button::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transition: transform .3s var(--ease); }
.cz-tabs button[aria-selected="true"] { color: var(--ink); }
.cz-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.cz-tabs button:hover { color: var(--ink); }
.cz-tabs .cz-tab-dot { position: absolute; top: 9px; right: calc(50% - 18px); width: 7px; height: 7px; border-radius: 50%; background: var(--mustard); }

.cz-panes { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1.5rem 1.5rem; scrollbar-width: thin; }
.cz-pane[hidden] { display: none; }
.cz-pane { animation: cz-fade .25s var(--ease); }
@keyframes cz-fade { from { opacity: 0; transform: translateY(4px); } }
.cz-alert { font-size: .85rem; margin-bottom: 1rem; }
.cz-link { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }

.cz-legend { font: 400 var(--t-label)/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .6rem; padding: 0; }
.cz-legend .muted { text-transform: none; letter-spacing: 0; font-family: var(--f-body); }
.cz-fs { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.cz-hint { font-size: .84rem; color: var(--muted); margin: 1rem 0 0; line-height: 1.5; }
.cz-tools { display: block; }
.cz-tools[hidden] { display: none; }
.cz-tool { padding: .85rem 0; border-top: 1px solid var(--line); }
.cz-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.1rem; }
.cz-row--between { justify-content: space-between; margin: .4rem 0 0; }
.cz-row .btn svg { margin-left: -.2rem; }

/* upload */
.cz-dropbtn { display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.1rem; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--paper); cursor: pointer; transition: border-color .2s, background .2s; margin-bottom: 1.1rem; }
.cz-dropbtn:hover, .cz-file-focus .cz-dropbtn { border-color: var(--ink); background: #fff; }
.cz-dropbtn svg { width: 30px; height: 30px; flex: none; }
.cz-dropbtn span { display: grid; gap: .15rem; }
.cz-dropbtn strong { font-weight: 500; }
.cz-dropbtn small { font-size: .78rem; color: var(--muted); }
input[data-file]:focus-visible + .cz-dropbtn { outline: 2px solid var(--red); outline-offset: 3px; }
.cz-recent { margin-bottom: 1.2rem; }
.cz-recent__list { display: flex; gap: .5rem; flex-wrap: wrap; }
.cz-recent__list button { width: 60px; height: 60px; padding: 0; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sand) center/cover no-repeat; cursor: pointer; transition: transform .2s var(--ease), border-color .2s; }
.cz-recent__list button:hover { transform: translateY(-2px); border-color: var(--ink); }

.cz-shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.cz-shapes button { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-height: 62px; padding: .5rem .2rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--paper); cursor: pointer; font-size: .74rem; transition: border-color .2s, background .2s, color .2s; }
.cz-shapes svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.cz-shapes button[aria-checked="true"] { background: var(--ink); color: var(--bone); border-color: var(--ink); }

.cz-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.cz-styles button { display: flex; flex-direction: column; align-items: stretch; gap: .35rem; padding: 4px 4px .45rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); cursor: pointer; font-size: .74rem; text-align: center; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.cz-styles button:hover { border-color: var(--line-strong); }
.cz-styles button[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cz-style__thumb { display: block; aspect-ratio: 1; border-radius: 10px; background-color: #f1ebe1; background-image: linear-gradient(45deg, #ebe4d8 25%, transparent 25%, transparent 75%, #ebe4d8 75%), linear-gradient(45deg, #ebe4d8 25%, transparent 25%, transparent 75%, #ebe4d8 75%); background-size: 10px 10px; background-position: 0 0, 5px 5px; overflow: hidden; }
.cz-style__thumb canvas { display: block; width: 100%; height: 100%; object-fit: cover; }

.cz-more { border-top: 1px solid var(--line); margin-top: -.25rem; }
.cz-more summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 46px; font-size: .9rem; font-weight: 500; }
.cz-more summary::-webkit-details-marker { display: none; }
.cz-more summary::after { content: "+"; font: 300 1.3rem/1 var(--f-body); transition: transform .3s var(--ease); }
.cz-more[open] summary::after { transform: rotate(45deg); }
.cz-more[open] { padding-bottom: .4rem; }

/* switch */
.cz-switch { display: flex; align-items: center; gap: .75rem; cursor: pointer; min-height: 44px; position: relative; }
.cz-switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.cz-switch__track { position: relative; flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line-strong); transition: background .25s var(--ease); }
.cz-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.cz-switch input:checked + .cz-switch__track { background: var(--ink); }
.cz-switch input:checked + .cz-switch__track::after { transform: translateX(18px); }
.cz-switch input:focus-visible + .cz-switch__track { outline: 2px solid var(--red); outline-offset: 2px; }
.cz-switch__text { display: grid; font-size: .92rem; font-weight: 500; line-height: 1.3; }
.cz-switch__text small { font-weight: 400; font-size: .78rem; color: var(--muted); }
[data-when][hidden] { display: none; }

/* sliders */
.cz-slider { margin: .35rem 0 .9rem; }
.cz-slider label { display: flex; justify-content: space-between; align-items: baseline; font-size: .86rem; font-weight: 500; color: var(--ink-2); margin-bottom: .15rem; }
.cz-slider output { font: 400 .72rem/1 var(--f-mono); color: var(--muted); letter-spacing: .04em; }
.cz-slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; cursor: pointer; }
.cz-slider input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(var(--ink), var(--ink)) 0 / var(--fill, 50%) 100% no-repeat, var(--line-strong); border-radius: 2px; }
.cz-slider input[type="range"]::-moz-range-track { height: 2px; background: var(--line-strong); border-radius: 2px; }
.cz-slider input[type="range"]::-moz-range-progress { height: 2px; background: var(--ink); }
.cz-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); transition: transform .15s; }
.cz-slider input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); }
.cz-slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.cz-slider input[type="range"]:focus-visible { outline: none; }
.cz-slider input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--red); outline-offset: 2px; }

/* text tools */
.cz-textarea { min-height: 64px; font-size: 1.05rem; }
.cz-daterow { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.cz-daterow .field { margin-bottom: .9rem; }
.cz-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.cz-fonts button { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-height: 64px; padding: .55rem .75rem .5rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); cursor: pointer; text-align: left; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.cz-fonts button:hover { border-color: var(--line-strong); }
.cz-fonts button[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cz-fonts .cz-font__sample { font-size: 1.45rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; color: var(--ink); }
.cz-fonts .cz-font__name { font: 400 .6rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.cz-swatches { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.cz-swatches button, .cz-swatch-custom { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .2s var(--ease); }
.cz-swatches button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bone), 0 0 0 3.5px var(--ink); }
.cz-swatches button:hover { transform: scale(1.06); }
.cz-swatch-custom { display: inline-grid; place-items: center; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); overflow: hidden; }
.cz-swatch-custom svg { width: 16px; height: 16px; pointer-events: none; }
.cz-swatch-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.cz-swatch-custom.is-on { box-shadow: 0 0 0 2px var(--bone), 0 0 0 3.5px var(--ink); }

/* adjust */
.cz-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .2rem 0 1.4rem; }
.cz-tbtn { min-height: 44px; padding: 0 .3rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--paper); cursor: pointer; font-size: .82rem; transition: border-color .2s, color .2s; }
.cz-tbtn:hover { border-color: var(--ink); }
.cz-tbtn--danger:hover { border-color: var(--danger); color: var(--danger); }
.cz-layers { list-style: none; margin: 0 0 1.2rem; padding: 0; border-top: 1px solid var(--line); }
.cz-layers li { display: flex; align-items: center; gap: .6rem; padding: .45rem .2rem; border-bottom: 1px solid var(--line); }
.cz-layers li.is-sel { background: var(--paper); }
.cz-layer__pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: .7rem; min-height: 44px; border: 0; background: none; padding: 0 .3rem; cursor: pointer; text-align: left; font-size: .9rem; }
.cz-layer__thumb { flex: none; width: 38px; height: 38px; border-radius: 8px; background: var(--sand) center/cover no-repeat; display: grid; place-items: center; overflow: hidden; font: 400 1.1rem/1 var(--f-display); border: 1px solid var(--line); }
.cz-layer__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-layers .cz-ibtn { width: 36px; height: 36px; border-color: transparent; background: transparent; }
.cz-layers .cz-ibtn svg { width: 17px; height: 17px; }
.cz-layers:empty::after { content: "Nothing here yet."; display: block; padding: .8rem .2rem; color: var(--muted); font-size: .88rem; }

/* order */
.cz-opts .opt span { min-height: 52px; }
.cz-opts { gap: .45rem; }
.cz-quality { display: grid; gap: .45rem; margin: .2rem 0 1.1rem; }
.cz-q { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .85rem; border-radius: var(--r-md); font-size: .86rem; line-height: 1.4; }
.cz-q::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: .38rem; }
.cz-q--ok { background: var(--olive-soft); color: var(--olive); }
.cz-q--ok::before { background: var(--olive); }
.cz-q--warn { background: var(--cz-amber-bg); color: var(--cz-amber); }
.cz-q--warn::before { background: var(--mustard); }
.cz-rights { padding: .85rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--paper); margin-bottom: .5rem; }
.cz-rights.is-error { border-color: var(--danger); animation: cz-shake .4s; }
.cz-rights[hidden] { display: none; }
@keyframes cz-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
[data-rights-err] { margin: 0 0 .8rem; }
.cz-notes { min-height: 70px; }
.cz-fine { margin: 1rem 0 0; font-size: .8rem; color: var(--muted); line-height: 1.5; }

/* sticky bar */
.cz-bar { display: flex; align-items: center; justify-content: space-between; gap: .9rem; padding: .85rem 1.5rem calc(.85rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.cz-bar__sum { display: grid; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; min-height: 44px; align-content: center; }
.cz-bar__total { font: 400 1.25rem/1.1 var(--f-mono); letter-spacing: .01em; }
.cz-bar__meta { font-size: .76rem; color: var(--muted); }
.cz-cta { flex: none; }
.cz-cta.is-loading { opacity: .6; }

/* added modal */
.cz-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1rem; }
.cz-modal[hidden] { display: none; }
.cz-modal__scrim { position: absolute; inset: 0; background: rgba(21, 19, 17, .45); animation: cz-fade .3s; }
.cz-modal__card { position: relative; width: min(420px, 100%); background: var(--bone); border-radius: var(--r-lg); padding: 1rem 1rem 1.3rem; text-align: center; animation: cz-pop .35s var(--ease); }
.cz-modal__media { border-radius: 16px; overflow: hidden; background: var(--sand); aspect-ratio: 4 / 3; margin-bottom: 1rem; }
.cz-modal__media img { width: 100%; height: 100%; object-fit: cover; }
.cz-modal__card .label { margin: 0 0 .3rem; }
.cz-modal__card .h3 { margin: 0 0 .35rem; }
.cz-modal__btns { display: grid; gap: .5rem; margin-top: 1rem; }

/* ---------- tablet / phone: stage on top, bottom sheet ---------- */
@media (max-width: 960px) {
  .cz { --sheet: 45dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .cz.is-expanded { --sheet: 74dvh; }
  .cz-panel { height: var(--sheet); margin-top: -18px; border-left: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; border-top: 1px solid var(--line); z-index: 5; transition: height .35s var(--ease); }
  .cz-grab { display: grid; place-items: center; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 88px; height: 22px; border: 0; background: none; cursor: pointer; z-index: 2; }
  .cz-grab span { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); }
  .cz-panel__head { display: none; }
  .cz-tabs { margin-top: 14px; padding: 0 .4rem; }
  .cz-tabs button { min-height: 54px; gap: .22rem; font-size: .58rem; letter-spacing: .08em; }
  .cz-tabs button svg { width: 19px; height: 19px; }
  .cz-panes { padding: 1rem 1.1rem 1.2rem; }
  .cz-bar { padding: .6rem 1.1rem calc(.6rem + env(safe-area-inset-bottom)); }
  .cz-cta { min-height: 48px; padding: 0 1.3rem; }
  .cz-stage__bottom { bottom: 26px; }
  .cz-stage.has-sel .cz-sizeinfo { display: none; }  /* the layer toolbar takes its place */
  .cz-stage__top { top: 10px; left: 10px; right: 10px; }
  .cz-note { top: 58px; left: 10px; }
  .cz-empty { padding-bottom: 2.5rem; }
  /* compact chat launcher so it never covers the tools (desktop rule is below this block) */
  body.is-app .chat-launcher { padding: 0; width: 44px; min-height: 44px; justify-content: center; }
  body.is-app .chat-launcher > span:not(.chat-launcher__glyph) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  /* the sheet can be dragged up over the stage, so anchor the launcher to the top of the stage (under undo/redo) */
  body.is-app .chat-launcher { top: calc(var(--header-h, 64px) + 64px); bottom: auto; right: 12px; }
}
/* desktop: park the chat launcher over the stage's bottom-right corner, clear of the panel + Add to cart */
@media (min-width: 961px) {
  body.is-app .chat { --chat-gap: calc(var(--cz-panel-w, 420px) + 16px); --chat-bottom: 16px; }
  body.is-app .chat-launcher { padding: 0; width: 44px; min-height: 44px; justify-content: center; }
  body.is-app .chat-launcher > span:not(.chat-launcher__glyph) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 960px) and (max-height: 640px) {
  .cz { --sheet: 52dvh; }
}
@media (max-width: 420px) {
  .cz-seg button { padding: 0 .8rem; }
  .cz-bar__total { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cz-pane, .cz-ctx, .cz-empty__card, .cz-modal__card, .cz-note { animation: none; }
  .cz-panel { transition: none; }
}
