/* JP Studio – designer (v1.3) */

/* ------------------------------------------------------------ Launcher */
.jps-launch { margin: 0 0 1.2em; width: 100%; }
.jps-launch-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; cursor: pointer; }
.jps-launch.is-loading .jps-launch-btn { opacity: .6; pointer-events: none; }
.jps-launch-note { display: flex; align-items: center; gap: .75em; margin-top: .8em; font-size: .9em; }
.jps-launch-note[hidden] { display: none; }
.jps-launch-note img { width: 56px; height: auto; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .1); background: #fff; }

/* -------------------------------------------------------------- Shell */
.jps-modal {
  --jps-accent: #e6007e;
  --jps-accent-rgb: 230, 0, 126;
  --jps-ink: #0f172a;
  --jps-mut: #64748b;
  --jps-line: #e5e7eb;
  --jps-soft: #f6f7f9;
  --jps-stage: #eef1f5;
  --jps-surface: #ffffff;
  --jps-shadow: 0 10px 30px rgba(15, 23, 42, .10);
  position: fixed; inset: 0; z-index: 999999; display: none; flex-direction: column;
  background: var(--jps-surface); color: var(--jps-ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
.jps-modal.is-open { display: flex; }
.jps-modal *, .jps-modal *::before, .jps-modal *::after { box-sizing: border-box; }
.jps-modal button { font: inherit; cursor: pointer; color: inherit; text-transform: none; letter-spacing: normal; margin: 0; min-height: 0; }
.jps-modal button:focus-visible, .jps-modal input:focus-visible, .jps-modal select:focus-visible, .jps-modal textarea:focus-visible, .jps-drop:focus-within {
  outline: 2px solid var(--jps-accent); outline-offset: 2px;
}
body.jps-lock { overflow: hidden; }
.jps-ico { display: inline-flex; line-height: 0; }

/* ------------------------------------------------------------- Header */
.jps-top { flex: none; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 16px; background: var(--jps-surface); border-bottom: 1px solid var(--jps-line); }
.jps-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.jps-title strong { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jps-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--jps-accent); }
.jps-top-actions { display: flex; align-items: center; gap: 10px; }
.jps-history { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--jps-soft); }

.jps-ib { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--jps-ink); transition: background .15s, color .15s; }
.jps-ib:hover:not(:disabled) { background: rgba(15, 23, 42, .07); }
.jps-ib:disabled { opacity: .3; cursor: default; }
.jps-ib.is-danger { color: #dc2626; }
.jps-ib.is-danger:hover:not(:disabled) { background: #fee2e2; }
.jps-close { background: var(--jps-soft); }

.jps-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid var(--jps-line); border-radius: 999px; background: var(--jps-surface); color: var(--jps-ink); font-weight: 600; transition: border-color .15s, background .15s, box-shadow .15s, transform .05s; }
.jps-btn:hover { border-color: #cbd5e1; background: var(--jps-soft); }
.jps-btn:active { transform: translateY(1px); }
.jps-btn-primary { background: var(--jps-accent); border-color: var(--jps-accent); color: #fff !important; }
.jps-btn-primary:hover { background: var(--jps-accent); border-color: var(--jps-accent); filter: brightness(.95); }
.jps-btn-ghost { background: transparent; }
.jps-modal.is-previewing .jps-btn-ghost { background: var(--jps-ink); border-color: var(--jps-ink); color: #fff; }
.jps-btn-block { width: 100%; height: 46px; border-radius: 14px; }

/* --------------------------------------------------------------- Body */
.jps-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 84px 320px minmax(0, 1fr) 300px; }

.jps-rail { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 10px; background: var(--jps-surface); border-right: 1px solid var(--jps-line); overflow-y: auto; }
.jps-tool { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 8px; border: 0; border-radius: 14px; background: transparent; color: var(--jps-mut); font-size: 11.5px; font-weight: 600; }
.jps-tool .jps-ico { display: grid; place-items: center; width: 46px; height: 34px; border-radius: 12px; transition: background .15s, color .15s; }
.jps-tool:hover { color: var(--jps-ink); }
.jps-tool:hover .jps-ico { background: var(--jps-soft); }
.jps-tool.is-on { color: var(--jps-accent); }
.jps-tool.is-on .jps-ico { background: rgba(var(--jps-accent-rgb), .12); }

.jps-drawer, .jps-inspector { padding: 22px 20px; overflow-y: auto; background: var(--jps-surface); }
.jps-drawer { border-right: 1px solid var(--jps-line); }
.jps-inspector { border-left: 1px solid var(--jps-line); background: var(--jps-surface); }

.jps-h { margin: 0 0 14px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.jps-h:not(:first-child) { margin-top: 26px; }
.jps-sub { margin: 24px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--jps-mut); }
.jps-hint { margin: 12px 0 0; color: var(--jps-mut); font-size: 13px; }
.jps-status { min-height: 1.4em; margin: 8px 0 0; color: var(--jps-mut); }

/* -------------------------------------------------------------- Stage */
.jps-stage { position: relative; overflow: hidden; display: flex; flex-direction: column; min-width: 0; min-height: 0; background-color: var(--jps-stage);
  background-image: radial-gradient(circle, #cbd2dc 1.1px, transparent 1.3px); background-size: 22px 22px; }
.jps-stage-inner { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; touch-action: none; }
.jps-stage-inner.is-zoomed, .jps-stage-inner.is-grab { cursor: grab; }
.jps-stage-inner.is-panning { cursor: grabbing; }
.jps-stagebar { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; align-self: center; margin: 0 12px 18px; padding: 6px 8px 6px 6px; max-width: calc(100% - 24px);
  background: rgba(255, 255, 255, .94); border: 1px solid var(--jps-line); border-radius: 999px; box-shadow: var(--jps-shadow); backdrop-filter: blur(8px); }
.jps-note { padding: 0 10px 0 4px; color: var(--jps-mut); font-size: 12.5px; }

.jps-view { position: relative; isolation: isolate; flex: none; }
.jps-tint { position: absolute; inset: 0; z-index: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; background: #fff; }
.jps-mock { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.jps-mock.is-multiply { mix-blend-mode: multiply; }
.jps-view .canvas-container { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; z-index: 2; }
.jps-view .canvas-container canvas { width: 100% !important; height: 100% !important; }
.jps-view .upper-canvas { touch-action: none; }

.jps-guides { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.jps-guide { position: absolute; border: 1.5px dashed rgba(15, 23, 42, .32); border-radius: 4px; transition: border-color .15s, background .15s; }
.jps-guide.is-active { border-color: var(--jps-accent); background: rgba(var(--jps-accent-rgb), .05); }
.jps-guide-label { position: absolute; left: 0; bottom: calc(100% + 6px); transform-origin: left bottom; transform: scale(calc(1 / var(--jps-zs, 1))); display: none; padding: 2px 9px; border-radius: 999px; background: var(--jps-accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.jps-guide.is-active .jps-guide-label { display: block; }
.jps-modal.is-previewing .jps-guides { display: none; }

/* ---------------------------------------------------------- Segmented */
.jps-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--jps-soft); }
.jps-seg button { height: 32px; min-width: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--jps-mut); font-weight: 600; white-space: nowrap; }
.jps-seg button:hover { color: var(--jps-ink); }
.jps-seg button.is-on { background: var(--jps-surface); color: var(--jps-ink); box-shadow: 0 1px 4px rgba(15, 23, 42, .16); }
.jps-seg-sm button { height: 32px; padding: 0 10px; }
.jps-seg .jps-b { font-weight: 800; }
.jps-seg .jps-i { font-style: italic; font-family: Georgia, serif; }
.jps-seg .jps-u { text-decoration: underline; }
.jps-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

/* ---------------------------------------------------- Swatches, sizes */
.jps-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jps-sw { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid rgba(15, 23, 42, .18); transition: transform .12s; }
.jps-sw:hover { transform: scale(1.1); }
.jps-swatches-lg { gap: 10px; }
.jps-swatches-lg .jps-sw { width: 38px; height: 38px; }
.jps-sw.is-on { box-shadow: 0 0 0 2px var(--jps-surface), 0 0 0 4px var(--jps-accent); }
.jps-color { width: 30px; height: 30px; padding: 0; border: 1px solid var(--jps-line); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.jps-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.jps-size { min-width: 52px; height: 42px; padding: 0 14px; border: 1px solid var(--jps-line); border-radius: 12px; background: var(--jps-surface); font-weight: 700; transition: border-color .15s, background .15s; }
.jps-size:hover { border-color: #cbd5e1; }
.jps-size.is-on { background: var(--jps-ink); border-color: var(--jps-ink); color: #fff; }

/* ------------------------------------------------------------- Fields */
.jps-field { margin: 18px 0; }
.jps-label { display: block; margin: 0 0 8px; color: var(--jps-mut); font-size: 12px; font-weight: 600; }
.jps-input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--jps-line); border-radius: 12px; background: var(--jps-surface); color: var(--jps-ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
.jps-input:focus { outline: 0; border-color: var(--jps-accent); box-shadow: 0 0 0 3px rgba(var(--jps-accent-rgb), .16); }
.jps-textarea { height: auto; padding: 10px 12px; min-height: 76px; resize: vertical; }
select.jps-input { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }

.jps-range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; margin: 10px 0; border-radius: 4px; background: #e2e8f0; outline: none; }
.jps-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--jps-accent); box-shadow: 0 2px 6px rgba(15, 23, 42, .25); cursor: pointer; }
.jps-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--jps-accent); box-shadow: 0 2px 6px rgba(15, 23, 42, .25); cursor: pointer; }

.jps-actions { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 12px; padding: 4px; border-radius: 14px; background: var(--jps-soft); }
.jps-checks { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.jps-check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.jps-check input { width: 18px; height: 18px; accent-color: var(--jps-accent); }
.jps-dpi { min-height: 1.4em; padding: 0; font-size: 12.5px; }
.jps-dpi.is-low { padding: 10px 12px; border-radius: 12px; background: #fef2f2; color: #b91c1c; font-weight: 600; }
.jps-dpi.is-ok { color: var(--jps-mut); }

.jps-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 40px; padding: 0 12px; text-align: center; color: var(--jps-mut); }
.jps-empty .jps-ico { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 4px; border-radius: 50%; background: var(--jps-soft); }
.jps-empty strong { color: var(--jps-ink); font-size: 14px; }
.jps-empty span:last-child { font-size: 13px; }

/* -------------------------------------------------------------- Upload */
.jps-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 16px; border: 1.5px dashed rgba(var(--jps-accent-rgb), .45); border-radius: 18px; background: rgba(var(--jps-accent-rgb), .04); text-align: center; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.jps-drop .jps-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(var(--jps-accent-rgb), .12); color: var(--jps-accent); }
.jps-drop:hover, .jps-drop.is-over { background: rgba(var(--jps-accent-rgb), .09); border-color: var(--jps-accent); }
.jps-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* --------------------------------------------- Clipart, shapes, fonts */
.jps-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.jps-chip { height: 30px; padding: 0 14px; border: 1px solid var(--jps-line); border-radius: 999px; background: var(--jps-surface); font-weight: 600; font-size: 12.5px; }
.jps-chip.is-on { background: var(--jps-ink); border-color: var(--jps-ink); color: #fff; }
.jps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.jps-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 8px; border: 1px solid transparent; border-radius: 14px; background: var(--jps-soft); color: var(--jps-ink); transition: border-color .15s, transform .12s, background .15s; }
.jps-thumb:hover { border-color: var(--jps-accent); background: rgba(var(--jps-accent-rgb), .06); transform: translateY(-1px); }
.jps-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }

.jps-fontlist { display: flex; flex-direction: column; gap: 8px; }
.jps-fontrow { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 10px 14px; border: 1px solid var(--jps-line); border-radius: 14px; background: var(--jps-surface); text-align: left; transition: border-color .15s, background .15s; }
.jps-fontrow:hover { border-color: var(--jps-accent); background: rgba(var(--jps-accent-rgb), .04); }
.jps-fontsample { font-size: 22px; line-height: 1.2; }
.jps-fontname { font-size: 11.5px; color: var(--jps-mut); }

/* --------------------------------------------------- Busy, toast */
.jps-busy { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .4); backdrop-filter: blur(4px); }
.jps-busy[hidden] { display: none; }
.jps-busy-box { display: flex; align-items: center; gap: 16px; padding: 22px 28px; border-radius: 20px; background: var(--jps-surface); box-shadow: 0 20px 50px rgba(15, 23, 42, .3); font-weight: 600; }
.jps-spin { width: 24px; height: 24px; border: 3px solid var(--jps-line); border-top-color: var(--jps-accent); border-radius: 50%; animation: jps-rot .8s linear infinite; }
@keyframes jps-rot { to { transform: rotate(360deg); } }
.jps-toast { position: absolute; left: 50%; bottom: 24px; z-index: 50; max-width: min(90vw, 480px); padding: 12px 20px; border-radius: 999px; background: var(--jps-ink); color: #fff; font-weight: 500; box-shadow: var(--jps-shadow); opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.jps-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------- Tablet + phone */
@media (max-width: 1180px) {
  .jps-body { grid-template-columns: 76px 280px minmax(0, 1fr) 260px; }
}

@media (max-width: 900px) {
  .jps-top { height: 56px; gap: 8px; padding: 0 10px; }
  .jps-eyebrow { display: none; }
  .jps-title strong { font-size: 14px; }
  .jps-top-actions { gap: 6px; }
  .jps-btn { height: 38px; padding: 0 14px; }
  /* Cart button: compact, icon-forward. Preview sits right beside it, icon-only. */
  .jps-btn-primary { height: 34px; padding: 0 12px; font-size: 12.5px; gap: 5px; }
  .jps-btn-ghost { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; }
  .jps-btn-ghost span:not(.jps-ico) { display: none; }
  .jps-pdf-btn, .jps-share-btn { display: none; }
  .jps-zoom { top: 10px; right: 10px; }
  .jps-price-val { font-size: 15px; }

  .jps-body { display: flex; flex-direction: column; }
  .jps-stage { order: 1; flex: 1; min-height: 0; }
  .jps-stage-inner { padding: 10px; }
  .jps-stagebar { margin-bottom: 10px; padding: 4px; }
  .jps-note { display: none; }

  .jps-inspector, .jps-drawer { position: relative; padding: 24px 16px 16px; border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(15, 23, 42, .12); max-height: 40vh; }
  .jps-inspector::before, .jps-drawer::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #d5dae1; }
  .jps-drawer::before { display: none; }
  .jps-drawer { padding-top: 14px; }
  .jps-inspector { order: 2; display: none; }
  .jps-drawer { order: 3; }
  .jps-modal.has-selection .jps-inspector { display: block; }
  .jps-modal.has-selection .jps-drawer { display: none; }
  .jps-empty { display: none; }

  /* Floating pill, matching the top bar, on mobile only - desktop keeps the vertical sidebar. */
  .jps-rail { order: 4; flex-direction: row; justify-content: space-around; gap: 0; margin: 0 10px calc(10px + env(safe-area-inset-bottom, 0px)); padding: 6px 6px; border: 1px solid var(--jps-line); border-radius: 999px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 10px 30px rgba(15, 23, 42, .12); overflow-x: auto; overflow-y: hidden; }
  .jps-tool { flex: 1 0 62px; padding: 4px 0; }
  .jps-tool .jps-ico { height: 30px; }
  .jps-grid { grid-template-columns: repeat(5, 1fr); }
  .jps-h { font-size: 15px; margin-bottom: 10px; }
  .jps-field { margin: 12px 0; }
  .jps-toast { bottom: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .jps-spin { animation-duration: 2s; }
  .jps-toast, .jps-btn, .jps-sw, .jps-thumb { transition: none; }
}

/* ------------------------------------------------------- v1.4 additions */

/* Price */
.jps-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding: 0 6px; }
.jps-price-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--jps-mut); }
.jps-price-val { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.jps-price-val.is-bump { animation: jps-bump .35s ease; }
@keyframes jps-bump { 0% { transform: scale(1); } 40% { transform: scale(1.14); color: var(--jps-accent); } 100% { transform: scale(1); } }

.jps-recap { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--jps-soft); }
.jps-recap-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.jps-recap-row.is-total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--jps-line); font-size: 15px; }
.jps-recap-row.is-total strong { font-size: 18px; }

/* Paid options */
.jps-addons { display: flex; flex-direction: column; gap: 8px; }
.jps-addon { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--jps-line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.jps-addon:hover { border-color: #cbd5e1; }
.jps-addon.is-on { border-color: var(--jps-accent); background: rgba(var(--jps-accent-rgb), .06); }
.jps-addon input { width: 18px; height: 18px; accent-color: var(--jps-accent); }
.jps-addon-name { flex: 1; font-weight: 600; }
.jps-addon-price { color: var(--jps-mut); font-weight: 600; font-size: 13px; white-space: nowrap; }
.jps-addon.is-on .jps-addon-price { color: var(--jps-accent); }

/* Real size of the selected element */
.jps-dims { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: rgba(var(--jps-accent-rgb), .08); color: var(--jps-accent); font-weight: 700; font-size: 13px; text-align: center; }
.jps-guide.is-below .jps-guide-label { bottom: auto; top: calc(100% + 6px); transform-origin: left top; }

/* Zoom */
.jps-zoom { position: absolute; top: 14px; right: 14px; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; background: rgba(255, 255, 255, .94); border: 1px solid var(--jps-line); border-radius: 14px; box-shadow: var(--jps-shadow); backdrop-filter: blur(8px); }
.jps-zoom .jps-ib { width: 34px; height: 34px; border-radius: 10px; }
.jps-zoom-lbl { min-width: 44px; height: 24px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--jps-mut); font-size: 11.5px; font-weight: 700; }
.jps-zoom-lbl:hover { color: var(--jps-ink); }

/* Mobile preview overlay */

.jps-pv { position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column; background: var(--jps-stage); }
.jps-pv[hidden] { display: none; }
.jps-pv-top { flex: none; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 12px; background: var(--jps-surface); border-bottom: 1px solid var(--jps-line); }
.jps-pv-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.jps-pv-title strong { font-size: 16px; }
.jps-pv-title span { font-size: 12px; color: var(--jps-mut); }
.jps-pv-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; touch-action: pan-x pan-y pinch-zoom; }
.jps-pv-img { display: block; flex: 0 1 auto; min-height: 0; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; border-radius: 16px; box-shadow: var(--jps-shadow); }
.jps-pv-note { margin: 10px 0 0; color: var(--jps-mut); font-size: 13px; text-align: center; }
.jps-pv-note:empty { display: none; }
.jps-pv-foot { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--jps-surface); border-top: 1px solid var(--jps-line); }
.jps-pv-tabs { display: flex; justify-content: center; }
.jps-pv-tabs:empty { display: none; }
.jps-pv-buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jps-pv-price { display: flex; flex-direction: column; line-height: 1.1; }
.jps-pv-price span { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--jps-mut); font-weight: 700; }
.jps-pv-price strong { font-size: 21px; }
.jps-pv .jps-btn span { display: inline; }

/* Font dropdown */
.jps-fontbtn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--jps-line); border-radius: 12px; background: var(--jps-surface); font-size: 18px; text-align: left; transition: border-color .15s, box-shadow .15s; }
.jps-fontbtn:hover { border-color: #cbd5e1; }
.jps-fontbtn[aria-expanded="true"] { border-color: var(--jps-accent); box-shadow: 0 0 0 3px rgba(var(--jps-accent-rgb), .16); }
.jps-fontbtn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.jps-fontbtn .jps-ico { color: var(--jps-mut); flex: none; }
.jps-fontsample-big { margin-top: 16px; padding: 20px 14px; border-radius: 14px; background: var(--jps-soft); font-size: 30px; line-height: 1.2; text-align: center; overflow: hidden; word-break: break-word; }

.jps-fontmenu { position: fixed; z-index: 20; display: flex; flex-direction: column; background: var(--jps-surface); border: 1px solid var(--jps-line); border-radius: 16px; box-shadow: 0 22px 60px rgba(15, 23, 42, .25); overflow: hidden; }
.jps-fontsearch { flex: none; height: 48px; border: 0; border-bottom: 1px solid var(--jps-line); border-radius: 0; }
.jps-fontsearch:focus { box-shadow: none; }
.jps-fontmenu-list { overflow-y: auto; padding: 0 6px 8px; overscroll-behavior: contain; }
.jps-fontcat { position: sticky; top: 0; z-index: 1; padding: 12px 10px 6px; background: var(--jps-surface); color: var(--jps-mut); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.jps-fontopt { display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 21px; line-height: 1.25; }
.jps-fontopt:hover { background: var(--jps-soft); }
.jps-fontopt.is-on { background: rgba(var(--jps-accent-rgb), .1); color: var(--jps-accent); }
.jps-fontopt-sample { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .jps-fontmenu { border-radius: 18px; }
}
@media (max-width: 480px) {
  .jps-price-lbl { display: none; }
}

/* ------------------------------------------------ "Votre commande" window */
.jps-order { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.jps-order[hidden] { display: none; }
.jps-order-sheet { display: flex; flex-direction: column; width: min(580px, 100%); max-height: 94%; background: var(--jps-surface); border-radius: 30px 30px 0 0; box-shadow: 0 -10px 50px rgba(15, 23, 42, .25); overflow: hidden; }
@media (min-width: 700px) {
  .jps-order { align-items: center; }
  .jps-order-sheet { max-height: 92%; border-radius: 30px; }
}
.jps-order-head { flex: none; display: flex; align-items: center; justify-content: space-between; margin: 0 28px; padding: 26px 0 18px; border-bottom: 1px solid var(--jps-line); }
.jps-order-title { margin: 0; font-size: 22px; font-weight: 400; letter-spacing: -.01em; }
.jps-order-x { width: 40px; height: 40px; }
.jps-order-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 28px; overscroll-behavior: contain; }

.jps-oi { padding: 6px 0 14px; border-bottom: 1px solid var(--jps-line); }
.jps-oi-head { display: flex; align-items: center; gap: 12px; padding: 18px 0 16px; font-size: 18px; }
.jps-oi-num { font-weight: 400; }
.jps-oi-sum { flex: 1; min-width: 0; color: var(--jps-mut); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jps-oi-sum[hidden] { display: none; }
.jps-oi-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.jps-oi-chev .jps-ico { transition: transform .2s; }
.jps-oi-chev.is-open .jps-ico { transform: rotate(180deg); }
.jps-oi-fields[hidden] { display: none; }

.jps-oi-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 12px; margin-bottom: 14px; }
.jps-oi-row label { font-size: 17px; font-weight: 700; line-height: 1.15; }
.jps-oi-field { display: flex; align-items: center; width: 100%; height: 54px; padding: 0 18px; border: 1px solid #dfe3e8; border-radius: 16px; background: var(--jps-surface); color: var(--jps-ink); font: inherit; font-size: 18px; }
.jps-oi-select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.jps-oi-qty { justify-content: center; text-align: center; }
.jps-oi-field:focus { outline: 0; border-color: var(--jps-accent); box-shadow: 0 0 0 3px rgba(var(--jps-accent-rgb), .16); }
.jps-oi-ro { background: var(--jps-surface); }

.jps-oi-add { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 26px 0 6px; padding: 10px; border: 0; background: transparent; color: var(--jps-accent) !important; font-size: 20px; font-weight: 700; }
.jps-oi-add:hover { filter: brightness(.9); }
.jps-order-total { margin: 14px 0 18px; text-align: center; font-size: 20px; }
.jps-order-total strong { font-weight: 800; }

.jps-order-foot { flex: none; display: flex; align-items: stretch; justify-content: center; gap: 14px; padding: 6px 28px calc(28px + env(safe-area-inset-bottom, 0px)); }
.jps-obtn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 58px; padding: 8px 26px; border-radius: 999px; font-size: 20px; font-weight: 800; line-height: 1.1; text-align: center; }
.jps-obtn-ghost { border: 2px solid var(--jps-ink); background: var(--jps-surface); color: var(--jps-ink) !important; }
.jps-obtn-ghost:hover { background: var(--jps-soft); }
.jps-obtn-primary { flex: 1; max-width: 300px; border: 2px solid var(--jps-accent); background: var(--jps-accent); color: #fff !important; }
.jps-obtn-primary:hover { filter: brightness(.95); }
.jps-obtn-primary span { display: inline; }

@media (max-width: 480px) {
  .jps-order-head, .jps-order-scroll, .jps-order-foot { padding-left: 22px; padding-right: 22px; }
  .jps-order-head { margin: 0 22px; padding-left: 0; padding-right: 0; }
  .jps-oi-row { grid-template-columns: 92px minmax(0, 1fr); }
  .jps-obtn { font-size: 18px; padding: 8px 18px; }
  .jps-oi-add { font-size: 19px; }
}

/* Resume banner */
.jps-resume { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; padding: 14px; border-radius: 14px; background: rgba(var(--jps-accent-rgb), .07); border: 1px solid rgba(var(--jps-accent-rgb), .25); font-size: 13px; }
.jps-resume strong { font-size: 14px; }
.jps-resume-actions { display: flex; gap: 8px; margin-top: 6px; }
.jps-btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }

/* --------------------------------------------- Collapsible bottom sheet (mobile) */
.jps-drawer-head { display: none; }
@media (max-width: 900px) {
  .jps-drawer-head { display: flex; justify-content: center; margin: 2px 0 12px; }
  .jps-drawer-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--jps-soft); color: var(--jps-mut); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
  .jps-drawer-toggle:hover { color: var(--jps-ink); }
  .jps-drawer-chev { transition: transform .2s; }
  .jps-modal.is-drawer-collapsed .jps-drawer-chev { transform: rotate(180deg); }

  /* Collapsed: shrink the sheet down to just its handle so the stage gets the space. */
  .jps-modal.is-drawer-collapsed .jps-drawer { max-height: none; padding-top: 10px; padding-bottom: 10px; }
  .jps-modal.is-drawer-collapsed .jps-drawer-content { display: none; }
  .jps-modal.is-drawer-collapsed .jps-drawer::before { display: none; }
}

/* Header actions: let the title give up space first so price/history/cart keep their labels */
@media (max-width: 360px) {
  .jps-history { display: none; }
}

/* ---------------------------------------------------------- v1.6 additions */

/* Overflow warning */
.jps-overflow-warn { position: absolute; left: 50%; top: 14px; z-index: 6; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: min(92%, 460px); padding: 9px 16px; border-radius: 999px; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-size: 12.5px; font-weight: 600; box-shadow: var(--jps-shadow); }
.jps-overflow-warn[hidden] { display: none; }
.jps-overflow-warn .jps-ico { flex: none; }

/* "No tint" swatch (clears a clipart colour) */
.jps-sw-none { position: relative; background: #fff repeating-linear-gradient(45deg, #e2e8f0 0 3px, #fff 3px 6px); }

/* Header PDF / Share icon buttons (desktop only; hidden on mobile, see media query) */
.jps-pdf-btn, .jps-share-btn { width: 36px; height: 36px; }

/* Preview overlay: PDF / Share row */
.jps-pv-extra { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
.jps-pv-extra .jps-ib { display: inline-flex; align-items: center; gap: 6px; width: auto; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--jps-soft); font-size: 12.5px; font-weight: 700; }
.jps-pv-extra .jps-ib:hover { background: #e5e7eb; }

/* Share menu popover */
.jps-sharemenu { position: fixed; z-index: 25; display: flex; flex-direction: column; padding: 6px; background: var(--jps-surface); border: 1px solid var(--jps-line); border-radius: 16px; box-shadow: 0 22px 60px rgba(15, 23, 42, .25); }
.jps-sharemenu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 13.5px; font-weight: 600; color: var(--jps-ink); }
.jps-sharemenu button:hover { background: var(--jps-soft); }
.jps-sharemenu-hint { margin: 6px 4px 2px; padding-top: 8px; border-top: 1px solid var(--jps-line); font-size: 11px; color: var(--jps-mut); font-weight: 400; line-height: 1.4; }

/* ---- Modern floating bar + iOS-style tactile feedback ---- */
.jps-top { margin: 10px 10px 0; padding: 0 14px; height: 58px; border: 1px solid var(--jps-line); border-radius: 999px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 10px 30px rgba(15, 23, 42, .12); }
.jps-body { border-top: none; }

.jps-btn, .jps-ib, .jps-tool, .jps-sw, .jps-size, .jps-chip, .jps-thumb, .jps-fontrow, .jps-fontopt, .jps-addon, .jps-drawer-toggle, .jps-obtn, .jps-oi-field {
  transition: transform .16s cubic-bezier(.34, 1.56, .64, 1), background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.jps-btn:active, .jps-ib:active:not(:disabled), .jps-tool:active, .jps-sw:active, .jps-size:active, .jps-chip:active, .jps-thumb:active, .jps-fontrow:active, .jps-addon:active, .jps-obtn:active {
  transform: scale(.94);
}
.jps-seg button { transition: color .15s ease; }
.jps-seg button.is-on { transition: background-color .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s ease; }

@media (max-width: 900px) {
  .jps-top { margin: 8px 8px 0; height: 52px; padding: 0 10px; }
  .jps-stage { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .jps-btn, .jps-ib, .jps-tool, .jps-sw, .jps-size, .jps-chip, .jps-thumb, .jps-fontrow, .jps-fontopt, .jps-addon, .jps-drawer-toggle, .jps-obtn, .jps-oi-field { transition: none; animation: none; }
}

/* ------------------------------------------------- Pre-made design templates */
a.jps-btn { text-decoration: none; }
.jps-photo-btn { position: relative; cursor: pointer; margin-bottom: 14px; }
.jps-tpl-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: rgba(var(--jps-accent-rgb), .07); color: var(--jps-ink); }
.jps-tpl-toggle { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; border: 1px dashed rgba(var(--jps-accent-rgb), .5); background: rgba(var(--jps-accent-rgb), .05); }
.jps-tpl-toggle .jps-check { font-weight: 700; }
.jps-tpl-toggle .jps-hint { margin: 6px 0 0; }
.jps-tpl-toggle .jps-field { margin: 12px 0 0; }
.jps-tpl-toggle .jps-field[hidden] { display: none; }

/* Template text with a font fixed by the shop manager: shown as a plain, non-interactive label. */
.jps-fontfixed{cursor:default;pointer-events:none;justify-content:flex-start}

/* Layers panel */
.jps-layers { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.jps-layer { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border: 1px solid var(--jps-line); border-radius: 12px; background: var(--jps-surface); cursor: pointer; }
.jps-layer:hover { border-color: #cbd5e1; }
.jps-layer:focus-visible { outline: 2px solid var(--jps-accent); outline-offset: 1px; }
.jps-layer.is-on { border-color: var(--jps-accent); box-shadow: 0 0 0 3px rgba(var(--jps-accent-rgb), .14); }
.jps-layer.is-hidden { opacity: .55; }
.jps-layer.is-hidden .jps-layer-name { text-decoration: line-through; }
.jps-layer-thumb { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--jps-soft) center / cover no-repeat; color: var(--jps-mut); }
.jps-layer-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.jps-layer-btns { display: flex; flex: 0 0 auto; gap: 2px; }
.jps-layer-btns .jps-ib { width: 30px; height: 30px; }
.jps-layer-btns .jps-ib[aria-pressed="true"] { color: var(--jps-accent); }
.jps-layer-btns .jps-ib:disabled { opacity: .3; }
.jps-warp .jps-chips { margin: 6px 0; }
