/* The Sticker Maker (inc/sticker-tool.inc.php): the samples, the sticker on
   its check, the shape buttons and the swatches. The layout is pt-ui.css's,
   the phone editor pt-app.css's, the sliders and buttons take pt-theme.css's
   look. */

/* ── Empty state: the samples ─────────────────────────────────────────── */
.sticker-editor .sample-thumbnails-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  /* Without a width it shrinks to half the box (left: 50%). */
  width: 90%;
}
/* By id: in the phone editor the photo box is out of the card. */
#sk-empty.hidden { display: none; }
.sticker-editor .sample-thumbnails { display: flex; justify-content: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.sticker-editor .sample-thumbnail {
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
  width: 110px;
  height: 110px;
  padding: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sticker-editor .sample-thumbnail:hover,
.sticker-editor .sample-thumbnail:focus-visible { border-color: var(--pt-accent, #0f70e6); box-shadow: 0 4px 12px rgba(15, 112, 230, 0.25); }
.sticker-editor .sample-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767px) { .sticker-editor .sample-thumbnail { width: 84px; height: 84px; } }

/* ── The sticker ──────────────────────────────────────────────────────── */
#sk-viewport { position: relative; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
/* A square, as big as the box allows, on a check that shows what is see-through */
#sk-canvas {
  display: block;
  width: min(100%, 512px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 12px;
  background: repeating-conic-gradient(#d9dde2 0 25%, #f4f5f7 0 50%) 0 0 / 24px 24px;
}
#sk-canvas[hidden] { display: none; }
.pt-app-stage #sk-canvas { width: auto; height: 100%; max-width: 100%; background: repeating-conic-gradient(#3a3f4b 0 25%, #2a2e37 0 50%) 0 0 / 24px 24px; }
/* The cut-out on its way: over the sticker */
.sk-busy {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(22, 24, 29, 0.55);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  padding: 16px;
}
.sk-busy[hidden] { display: none; }

/* ── Controls ─────────────────────────────────────────────────────────── */
.sk-title { display: block; }
.sk-note { font-size: 0.72rem; line-height: 1.45; color: #6c757d; margin: 6px 0 0; }
.sk-note:empty { display: none; }
.pt-app-sheet .sk-note { color: inherit; opacity: 0.75; }
.sk-link {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 0.8rem;
  color: var(--pt-accent, #0f70e6);
  cursor: pointer;
}
.sk-link:disabled { color: #9aa1aa; cursor: default; }

/* Cut-out | Circle | Rounded, and Top | Bottom: CB's segmented track */
.sk-seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--cb-bg, #f5f4f2); }
.sk-seg-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 36px;
  padding: 6px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cb-text, #3d434b);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.sk-seg-btn span { max-width: 100%; overflow-wrap: anywhere; hyphens: auto; text-align: center; }
.sk-seg-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.sk-seg-btn[aria-pressed="true"] { background: #fff; color: var(--cb-ink, #16181d); box-shadow: 0 2px 8px -2px rgba(22, 24, 29, 0.25); }
.sk-seg-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(15, 112, 230, 0.35); }
/* Top | Bottom: as wide as their words (a basis of 0 broke "Bottom" in two) */
.sk-seg-sm .sk-seg-btn { flex: 1 0 auto; flex-direction: row; padding: 4px 12px; }
.sk-seg-sm .sk-seg-btn span { overflow-wrap: normal; white-space: nowrap; }
fieldset:disabled .sk-seg-btn { cursor: default; opacity: 0.7; }

.sk-text-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sk-text-opts .sk-seg { flex: 0 1 auto; }

.sk-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sk-swatch {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.sk-swatch:hover { transform: scale(1.06); }
.sk-swatch:focus-visible,
.sk-swatch-pick:focus-within { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(15, 112, 230, 0.6); }
/* The chosen one: CB's double ring. */
.sk-swatch[aria-pressed="true"],
.sk-swatch-pick.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cb-ink, #16181d); }
/* A colour of your own: the colour wheel, the picker over it. */
.sk-swatch-pick { display: block; background: conic-gradient(#ff4757, #ffd32a, #00c389, #00c6ff, #4782dc, #764ba2, #ff4757); margin: 0; }
.sk-swatch-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
fieldset:disabled .sk-swatch { cursor: default; opacity: 0.7; transform: none; }

/* ── Phone editor ─────────────────────────────────────────────────────── */
/* The shapes, the outline colours and the caption lifted into the white
   bottom bar */
.pt-app-panels #sk-shape.pt-app-panel-on { display: flex !important; margin: 4px 8px 6px; background: var(--pt-app-fill); }
.pt-app-panels #sk-colors.pt-app-panel-on { padding: 6px 6px 8px; gap: 10px; margin: 0 !important; }
.pt-app-panels .sk-swatch { width: 36px; height: 36px; border-color: var(--pt-app-line-strong); }
.pt-app-panels .sk-swatch[aria-pressed="true"],
.pt-app-panels .sk-swatch-pick.on { box-shadow: 0 0 0 2px var(--pt-app-bar), 0 0 0 4px var(--pt-app-on); }
.pt-app-panels #sk-text-row.pt-app-panel-on { display: block !important; padding: 6px 8px 8px; margin: 0 !important; }
.pt-app-panels #sk-text-row .form-label { display: none; }
.pt-app-panels #sk-text-row .form-control { margin: 0 0 8px !important; font-size: 16px; }
.pt-app-panels #sk-text-row .sk-text-opts { flex-wrap: nowrap; }
.pt-app-panels #sk-place { flex: none; background: var(--pt-app-fill); }
.pt-app-panels #sk-inks { flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding: 4px 4px 2px; }
