/* "Design your logo" / "Upload your design" and the design studio (22 Nov 2026). Crazemart's maroon theme: the colours come
   from the variables in style.css (--brand, --navy, --pink...). Loaded on product pages and "Try your logo" only. */

/* --- the two choices on a product page --- */
.customize .btn-custom { width: 100%; font: inherit; border: 1.5px solid transparent; }
.btn-upload { background: #fff; color: var(--ink); border-color: var(--pink-line); box-shadow: none; }
.btn-upload:hover { background: var(--pink); border-color: var(--brand); }
.btn-upload > .ic { color: var(--brand); }
.btn-upload small { color: var(--muted); opacity: 1; }
.btn-custom.is-done::after { content: "✓"; margin-left: auto; flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--ok); font-weight: 800; font-size: 15px; box-shadow: 0 0 0 1.5px #b9e6c8; }
.btn-upload.is-done::after { background: #e9f8ef; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }

.up-panel { display: grid; gap: 10px; margin-top: -2px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; animation: fade-up .25s ease both; }
.up-drop, .dc-drop { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px dashed var(--pink-line); border-radius: 12px; background: var(--soft2); cursor: pointer; transition: border-color .2s, background .2s; }
.up-drop:hover, .dc-drop:hover, .up-drop.over { border-color: var(--brand); background: var(--pink); }
.up-drop > .ic { color: var(--brand); flex: none; }
.up-drop span, .dc-drop > span:not(.dc-drop-ic) { display: grid; min-width: 0; line-height: 1.35; }
.up-drop small, .dc-drop small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.up-drop input, .dc-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.up-file, .dc-logo { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 10px; border: 1px solid #b9e6c8; border-radius: 12px; background: #f3fbf6; }
.up-acts { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
@media (min-width: 480px) { .up-file, .dc-logo { grid-template-columns: 56px minmax(0, 1fr) auto; } .up-acts { grid-column: auto; } }
.up-thumb { grid-row: span 2; width: 56px; height: 56px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px;
  background: repeating-conic-gradient(#eef0f4 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
@media (min-width: 480px) { .up-thumb { grid-row: auto; } }
.up-thumb img, .up-thumb canvas { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.up-thumb b { font-size: 12px; color: var(--brand); letter-spacing: .04em; }
.up-info { display: grid; min-width: 0; line-height: 1.35; }
.up-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-info small { color: var(--muted); font-size: 12.5px; }
.up-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 13px; font-weight: 700; }
.up-ok::before { content: "✓"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 11px; }
.up-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.dc-error { margin: 0; font-size: 13px; font-weight: 600; color: #b42318; }

.dc-card { display: grid; gap: 10px; padding: 14px; border: 1px solid #b9e6c8; border-radius: 16px; background: #f6fcf8; animation: fade-up .3s ease both; }
.dc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dc-card-head .up-ok { font-size: 15px; }
.dc-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.dc-shots figure { margin: 0; display: grid; gap: 4px; }
.dc-shots img { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.dc-shots figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.dc-sum { margin: 0; font-size: 13px; color: var(--muted); }
.dc-remove { justify-self: start; font-size: 13px; }
.dc-wait { font-size: 13px; color: var(--muted); padding: 10px 0; }
.dc-pulse { animation: dc-pulse 1.1s ease 2; }
@keyframes dc-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 25%, transparent); } }

/* --- start panel and crop step: a dialog on a PC, a sheet from the bottom on a phone --- */
dialog.dc-dialog { width: min(460px, calc(100% - 32px)); max-width: none; padding: 0; border-radius: 20px; }
dialog.dc-crop { width: min(620px, calc(100% - 32px)); }
.dc-in { position: relative; display: grid; gap: 12px; padding: 22px; }
.dc-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--soft); color: var(--ink); font-size: 15px; cursor: pointer; }
.dc-x:hover { background: var(--pink); color: var(--brand); }
.dc-dialog h3 { margin: 0 44px 0 0; font-size: 21px; color: var(--navy); }
.dc-sub { margin: 0; font-size: 14px; color: var(--muted); }
.dc-drop-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: #fff; color: var(--brand); border: 1px solid var(--pink-line); }
.dc-drop-ic svg { width: 22px; height: 22px; }
.dc-drop b small { font-weight: 400; color: var(--muted); }
.dc-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.dc-field small { color: var(--muted); font-weight: 400; }
.dc-field input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-weight: 400; }
.dc-field input:focus { outline: none; border-color: var(--brand); }
.dc-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fff7e6; border: 1px solid #f5d9a0; font-size: 13px; }
.dc-go { width: 100%; }
.dc-ok { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ok); }
.dc-crop-area { height: min(46vh, 380px); overflow: hidden; border-radius: 12px; background: repeating-conic-gradient(#eef0f4 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.dc-crop-area img { display: block; max-width: 100%; }
.dc-crop-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-crop-tools button { padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.dc-crop-tools button:hover { border-color: var(--brand); color: var(--brand); }
.dc-label { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.dc-sugg { display: flex; flex-wrap: wrap; gap: 10px; }
.dc-sugg button { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.dc-sugg button.on { border-color: var(--brand); background: var(--pink); }
.dc-sugg canvas { width: 44px; height: 44px; border-radius: 8px; background: repeating-conic-gradient(#eef0f4 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.dc-sugg span { display: grid; line-height: 1.25; }
.dc-sugg b { font-size: 13.5px; }
.dc-sugg small { font-size: 12px; color: var(--brand); font-weight: 600; }
.dc-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
@media (max-width: 599px) {
  dialog.dc-dialog, dialog.dc-crop { width: 100%; margin: auto 0 0; max-height: 94dvh; border-radius: 20px 20px 0 0; }
  dialog.dc-dialog[open] { animation: dc-up .28s cubic-bezier(.2, .9, .3, 1) both; }
  .dc-in { padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); }
  .dc-actions { grid-template-columns: 1fr; }
  .dc-actions .btn-primary { order: -1; }
}
@keyframes dc-up { from { transform: translateY(40px); opacity: 0; } }

/* --- the studio --- */
html.st-lock, html.st-lock body { overflow: hidden; }
dialog.studio { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #f4f5f8; color: var(--ink); animation: fade .2s ease both; }
dialog.studio::backdrop { background: rgba(10, 12, 18, .4); }
.st-wrap { position: relative; height: 100%; display: grid; grid-template-columns: 76px 272px minmax(0, 1fr) 320px; grid-template-rows: 64px minmax(0, 1fr);
  grid-template-areas: "head head head head" "rail pane main edit"; font-family: var(--font); }
.st-wrap .ic { width: 20px; height: 20px; }
.st-head { grid-area: head; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); min-width: 0; }
.st-back { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px 0 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; flex: none; }
.st-back:hover { border-color: var(--ink); }
.st-title { display: grid; min-width: 0; line-height: 1.2; }
.st-title small { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); }
.st-title b { font-size: 16px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-price { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border: 1.5px solid var(--pink-line); border-radius: 12px; background: var(--pink); font: inherit; text-align: left; cursor: pointer; flex: none; }
.st-price:hover { border-color: var(--brand); }
.st-price > span { display: grid; line-height: 1.2; }
.st-price small { font-size: 12px; color: var(--muted); }
.st-price b { font-size: 16px; color: var(--navy); }
.st-price i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; }
.st-price i .ic { width: 15px; height: 15px; }
.st-done { flex: none; padding: 11px 18px; }

.st-rail { grid-area: rail; display: flex; flex-direction: column; gap: 6px; padding: 10px 6px; background: #fff; border-right: 1px solid var(--line); }
.st-rail button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border: 1.5px solid transparent; border-radius: 12px; background: none; font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.2; color: var(--muted); cursor: pointer; text-align: center; }
.st-rail button:hover { color: var(--brand); }
.st-rail button[aria-pressed="true"] { background: var(--pink); color: var(--brand); border-color: var(--pink-line); }
.st-rail .st-ph { display: none; }

.st-pane { min-height: 0; overflow-y: auto; padding: 16px; background: #fff; overscroll-behavior: contain; }
.st-product, .st-text { grid-area: pane; border-right: 1px solid var(--line); }
.st-wrap[data-tab="text"] .st-product, .st-wrap:not([data-tab="text"]) .st-text { display: none; }
.st-edit { grid-area: edit; border-left: 1px solid var(--line); }

.st-main { grid-area: main; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: linear-gradient(180deg, #f6f6f9, #eceef3); }
.st-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 0; }
.st-group, .st-sides { display: flex; gap: 2px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(20, 24, 40, .06); }
.st-group button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--ink); cursor: pointer; }
.st-group button:hover:not(:disabled) { background: var(--soft); }
.st-group button:disabled { opacity: .3; cursor: default; }
.st-group button[aria-pressed="true"] { background: var(--pink); color: var(--brand); }
.st-group .st-zl { width: auto; min-width: 52px; padding: 0 6px; font: inherit; font-size: 13px; font-weight: 600; }
.st-sides:empty { visibility: hidden; }
.st-sides button { position: relative; padding: 7px 16px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.st-sides button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.st-dot { position: absolute; top: 4px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 1.5px #fff; }
.st-stagewrap { flex: 1; min-height: 0; display: flex; overflow: hidden; padding: 4px; }
.st-stagewrap.is-zoomed { overflow: auto; }
.st-stage { position: relative; flex: none; margin: auto; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(20, 24, 40, .12); touch-action: none; user-select: none; -webkit-user-select: none; }
.st-stage:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.st-base, .st-art, .st-guide { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-base { border-radius: 16px; pointer-events: none; }
.st-guide { overflow: visible; pointer-events: none; }
.st-outline-bg { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 3; vector-effect: non-scaling-stroke; }
.st-outline { fill: color-mix(in srgb, var(--brand) 4%, transparent); stroke: #3a3f4d; stroke-width: 1.4; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.st-area-tag { position: absolute; transform: translateY(-100%); padding: 1px 6px; border-radius: 6px 6px 0 0; background: rgba(255, 255, 255, .88); font-size: 10.5px; font-weight: 700; color: #3a3f4d; white-space: nowrap; pointer-events: none; }
.st-empty { position: absolute; margin: 0; transform: translate(-50%, -50%); padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .9); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; pointer-events: none; }
.st-sel { position: absolute; outline: 1.5px solid var(--brand); pointer-events: none; transform-origin: center; }
.st-sel i { position: absolute; width: 16px; height: 16px; border: 2px solid var(--brand); border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); pointer-events: auto; touch-action: none; }
.st-sel [data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.st-sel [data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.st-sel [data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.st-sel [data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.st-sel .st-rot { left: calc(50% - 9px); top: -40px; cursor: grab; }
.st-sel .st-rot::after { content: ""; position: absolute; left: 5px; top: 14px; width: 2px; height: 22px; background: var(--brand); }
.st-sel.is-locked { outline-style: dashed; }
.st-sel.is-locked i { display: none; }
.st-snap { position: absolute; background: var(--brand); pointer-events: none; }
.st-snap-x { width: 1px; }
.st-snap-y { height: 1px; }
.st-wrap.is-preview .st-stage { box-shadow: 0 14px 40px rgba(20, 24, 40, .18); }
.st-places { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px 16px; }
.st-places:empty { padding: 8px; }
.st-places > span { font-size: 13px; color: var(--muted); }
.st-places button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.st-places button .ic { width: 15px; height: 15px; color: var(--brand); }
.st-places button:hover { border-color: var(--brand); }
.st-places button[aria-pressed="true"] { border-color: var(--brand); background: var(--pink); color: var(--brand); }

/* panels */
.st-cap { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.st-cap:not(:first-child) { margin-top: 22px; }
.st-h4 { margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--navy); }
.st-label { margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.st-label b { font-weight: 500; color: var(--muted); }
.st-label small { font-weight: 400; color: var(--muted); }
.st-label small.ok { color: var(--ok); font-weight: 600; } .st-label small.bad { color: #b45309; font-weight: 600; }
.st-info, .st-hint { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font-size: 13px; color: var(--muted); }
.st-info b, .st-hint b { font-size: 14px; color: var(--ink); }
.st-tip { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chips.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.st-chips.st-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.st-chip { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--ink); cursor: pointer; text-align: center; }
@media (hover: hover) { .st-chip:hover { border-color: var(--brand); } }
/* the preview's buttons stay on the screen, however tall the picture is */
.st-pv-shots img { max-height: min(54vh, 560px); object-fit: contain; }
.st-pv-warn { margin: 0 0 10px; padding: 10px 12px; border: 1px solid #f0c36d; border-radius: 10px; background: #fff7e6; color: #6b4300; font-size: 13px; font-weight: 600; }
/* M3: quick tools, shapes, eraser, product panels */
.st-piece { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.st-piece svg { flex: none; width: 54px; height: 54px; fill: #fff; stroke: #9aa0ab; stroke-width: 2; stroke-linejoin: round; }
.st-piece b { display: block; font-size: 14px; }
.st-piece small { display: block; font-size: 12px; line-height: 1.35; color: #5b606b; }
.st-sizeline { width: 100%; display: flex; justify-content: space-between; gap: 8px; text-align: left; }
.st-sizeline span { color: var(--brand); }
.st-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 10px; }
.st-quick button { display: grid; justify-items: center; align-content: center; gap: 5px; min-height: 64px; padding: 8px 4px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ink); cursor: pointer; }
.st-quick button[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: rgba(143, 12, 43, .06); }
.st-shapes .st-chip { display: inline-flex; align-items: center; gap: 6px; }
.st-shapes .st-chip svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.st-chip:disabled { opacity: .4; cursor: default; }
.st-erasebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 8px 10px 0; padding: 6px; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(20, 24, 40, .12); }
.st-erasebar[hidden] { display: none; }
.st-brush-size { display: flex; align-items: center; gap: 6px; flex: 1 1 110px; min-width: 110px; max-width: 220px; font-size: 12px; font-weight: 600; }
.st-brush-size input { flex: 1; min-width: 0; accent-color: var(--brand); }
@media (max-width: 599px) {
  .st-erasebar { flex-wrap: nowrap; gap: 4px; margin: 6px 6px 0; padding: 4px; }
  .st-erasebar .st-chip, .st-erasebar .btn { flex: none; padding: 8px 7px; font-size: 12px; white-space: nowrap; }
  .st-erasebar .st-brush-size { min-width: 44px; }
  .st-erasebar .st-brush-size span { display: none; }
}
.st-stage.is-erasing { cursor: none; }
.st-brush { position: absolute; z-index: 3; transform: translate(-50%, -50%); border: 1.5px solid #fff; border-radius: 50%; outline: 1.5px solid rgba(20, 24, 40, .7); pointer-events: none; }
.st-brush[hidden] { display: none; }
.st-chip[aria-pressed="true"] { border-color: var(--brand); background: var(--pink); color: var(--brand); }
.st-tight .st-chip { padding: 7px 11px; }
.st-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.st-sw { position: relative; width: 30px; height: 30px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; }
.st-sw[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--brand); }
.st-body-sw .st-sw { width: 34px; height: 34px; }
.st-custom { background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); overflow: hidden; }
.st-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.st-range { display: grid; gap: 4px; margin-top: 12px; font-size: 13px; font-weight: 600; }
.st-range > span { display: flex; justify-content: space-between; gap: 8px; }
.st-range output { font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.st-range input { width: 100%; accent-color: var(--brand); }
.st-switch { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.st-switch input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.st-field { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 600; }
.st-field input, .st-field select, .st-edit textarea { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; font-weight: 400; }
.st-edit textarea { resize: vertical; min-height: 64px; }
.st-field input:focus, .st-field select:focus, .st-edit textarea:focus { outline: none; border-color: var(--brand); }
.st-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.st-row .btn .ic { width: 16px; height: 16px; }
.st-layerhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-layerhead b { font-size: 15px; color: var(--navy); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-iconbar { display: flex; gap: 2px; flex: none; }
.st-iconbar button, .st-aligns button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; }
.st-iconbar button:hover, .st-aligns button:hover { border-color: var(--brand); color: var(--brand); }
.st-iconbar button[aria-pressed="true"] { background: var(--pink); color: var(--brand); border-color: var(--brand); }
.st-iconbar .st-danger:hover { color: #b42318; border-color: #f1b5ae; }
.st-iconbar .ic, .st-aligns .ic { width: 17px; height: 17px; }
.st-aligns { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.st-aligns button { width: auto; }
.st-measure { display: grid; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: 13px; }
.st-measure b { color: var(--ink); }
.st-measure label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.st-measure input { width: 84px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; }
.st-layers { display: grid; gap: 6px; }
.st-layers button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; min-width: 0; }
.st-layers button:hover { border-color: var(--brand); }
.st-layers span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-addtext { display: grid; width: 100%; margin-bottom: 8px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 15px; text-align: left; color: var(--ink); cursor: pointer; }
.st-addtext:hover { border-color: var(--brand); background: var(--pink); }
.st-addtext.is-h { font-size: 20px; font-weight: 700; }
.st-addtext.is-s { font-size: 13px; }
.st-addtext.is-preset b { font-size: 13.5px; letter-spacing: .02em; }
.st-addtext.is-preset small { color: var(--muted); font-size: 12px; }
.st-addgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-addbtn { position: relative; display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); text-align: center; cursor: pointer; }
.st-addbtn:hover { border-color: var(--brand); color: var(--brand); }
.st-addbtn .ic { width: 24px; height: 24px; color: var(--brand); }
.st-addbtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* preview screen and quantity sheet, over the studio */
.st-preview, .st-sheet { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(14, 28, 63, .55); animation: fade .2s ease both; }
.st-preview[hidden], .st-sheet[hidden] { display: none; }
.st-pv-in, .st-sheet-in { width: min(980px, 100%); max-height: 100%; overflow-y: auto; padding: 22px; border-radius: 20px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); animation: pop-in .28s cubic-bezier(.2, .9, .3, 1.2) both; }
.st-pv-in h3 { margin: 0 0 4px; font-size: 22px; color: var(--navy); }
.st-pv-note { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.st-pv-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.st-pv-shots figure { margin: 0; display: grid; gap: 6px; }
.st-pv-shots img { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.st-pv-shots figcaption { font-size: 13px; font-weight: 600; text-align: center; color: var(--muted); }
.st-pv-sum { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.st-pv-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.st-pv-acts .ic { width: 18px; height: 18px; }
.st-flip { transform: scaleX(-1); }
.st-sheet-in { width: min(560px, 100%); }
.st-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.st-sheet-head > div { display: grid; line-height: 1.25; }
.st-sheet-head small { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); }
.st-sheet-head b { font-size: 17px; color: var(--navy); }
.st-x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--soft); cursor: pointer; }
.st-slabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.st-slabs button { display: grid; gap: 2px; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; text-align: center; cursor: pointer; }
.st-slabs button[aria-pressed="true"] { border-color: var(--brand); background: var(--pink); }
.st-slabs b { font-size: 13.5px; }
.st-slabs small { font-size: 12px; color: var(--muted); }
.st-stepper { display: inline-flex; align-items: center; margin-top: 12px; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.st-stepper button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: #fff; cursor: pointer; }
.st-stepper button:hover { background: var(--pink); color: var(--brand); }
.st-stepper > b { min-width: 64px; text-align: center; font-size: 17px; }
.st-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.st-sizes > div { display: grid; justify-items: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.st-sizes span { display: flex; align-items: center; gap: 6px; }
.st-sizes button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--soft); cursor: pointer; }
.st-sizes em { min-width: 24px; text-align: center; font-style: normal; font-weight: 700; }
.st-sizes .ic { width: 15px; height: 15px; }
.st-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.st-sheet-foot span { display: grid; line-height: 1.25; }
.st-sheet-foot small { font-size: 12px; color: var(--muted); }
.st-sheet-foot b { font-size: 20px; color: var(--navy); }
.studio .cm-toast { position: absolute; left: 50%; top: 58px; z-index: 30; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px;
  opacity: 0; transform: translateX(-50%) translateY(-8px); pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.studio .cm-toast.show { opacity: 1; transform: translateX(-50%); }

/* the studio on a phone: stage on top, tabs, then one panel */
@media (max-width: 899px) {
  .st-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: 58px auto auto minmax(0, 1fr); grid-template-areas: "head" "main" "rail" "pane"; }
  .st-head { gap: 8px; padding: 0 10px; }
  .st-back { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .st-back span { display: none; }
  .st-title b { font-size: 14px; }
  .st-price { gap: 6px; padding: 4px 5px 4px 9px; }
  .st-price small { font-size: 10.5px; }
  .st-price b { font-size: 14px; }
  .st-price i { width: 24px; height: 24px; }
  .st-done { padding: 9px 12px; font-size: 14px; }
  .st-main { height: min(58vh, calc(100vw + 70px)); }
  .st-tools { padding: 8px 10px 0; }
  .st-zoom { display: none; }
  .st-group button { width: 32px; height: 32px; }
  .st-sides button { padding: 6px 12px; font-size: 13.5px; }
  .st-places { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 8px 10px 10px; scrollbar-width: none; }
  .st-places::-webkit-scrollbar { display: none; }
  .st-places > span { display: none; }
  .st-places button { flex: none; }
  .st-rail { grid-area: rail; flex-direction: row; gap: 8px; padding: 8px 10px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .st-rail button { flex: 1; grid-auto-flow: row; padding: 7px 4px; font-size: 12.5px; }
  .st-rail .st-ph { display: grid; }
  .st-product, .st-text, .st-edit { grid-area: pane; border: 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); }
  .st-wrap[data-tab="product"] .st-edit, .st-wrap[data-tab="text"] .st-edit, .st-wrap[data-tab="edit"] .st-product, .st-wrap[data-tab="edit"] .st-text { display: none; }
  .st-sel i { width: 22px; height: 22px; }
  .st-sel [data-h="nw"] { left: -12px; top: -12px; } .st-sel [data-h="ne"] { right: -12px; top: -12px; }
  .st-sel [data-h="sw"] { left: -12px; bottom: -12px; } .st-sel [data-h="se"] { right: -12px; bottom: -12px; }
  .st-sel .st-rot { left: calc(50% - 12px); top: -46px; }
  .st-sel .st-rot::after { left: 8px; top: 20px; height: 22px; }
  .st-preview, .st-sheet { align-items: end; padding: 0; }
  .st-pv-in, .st-sheet-in { border-radius: 20px 20px 0 0; max-height: 92%; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .st-pv-acts { display: grid; grid-template-columns: 1fr; }
  .st-pv-acts .btn-primary { order: -1; }
}
@media (max-width: 420px) { .st-title { display: none; } .st-price { margin-left: auto; } }

/* "Try your logo": the logo is drawn on a canvas over a plain photo or drawing */
.pv-media .pv-base { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-media canvas.pv-logo { position: absolute; inset: 0; width: 100%; height: 100% !important; pointer-events: none; }
.pv-card:hover .pv-media > .pv-base { transform: none; }

@media (prefers-reduced-motion: reduce) { .studio *, .dc-dialog, .dc-card, .up-panel { animation: none !important; transition: none !important; } }
.st-short { display: none; }
@media (max-width: 899px) { .st-long { display: none; } .st-short { display: inline; } }

/* review fixes (22 Nov) */
.dc-logo { grid-template-columns: 56px minmax(0, 1fr) !important; }
.dc-logo .up-thumb { grid-row: span 2; }
.dc-logo .up-acts { grid-column: 2; }
.st-sel.is-small i { width: 12px; height: 12px; border-width: 1.5px; }
.st-sel.is-small [data-h="nw"] { left: -7px; top: -7px; } .st-sel.is-small [data-h="ne"] { right: -7px; top: -7px; }
.st-sel.is-small [data-h="sw"] { left: -7px; bottom: -7px; } .st-sel.is-small [data-h="se"] { right: -7px; bottom: -7px; }
.st-sel.is-small .st-rot { left: calc(50% - 7px); top: -30px; }
.st-sel.is-small .st-rot::after { left: 4px; top: 10px; height: 18px; }
.st-ph-only { display: none !important; }
@media (max-width: 899px) { .st-ph-only { display: grid !important; } }

/* phone handles: smaller, so they do not cover what sits next to the selection */
@media (max-width: 899px) {
  .st-sel i { width: 18px; height: 18px; }
  .st-sel [data-h="nw"] { left: -10px; top: -10px; } .st-sel [data-h="ne"] { right: -10px; top: -10px; }
  .st-sel [data-h="sw"] { left: -10px; bottom: -10px; } .st-sel [data-h="se"] { right: -10px; bottom: -10px; }
  .studio .cm-toast { top: 48px; font-size: 13px; padding: 9px 14px; }
}
