/* ══════════════════════════════════════════════════════
   Cutiora — collage-maker.css  (prefix cm-, checked unused 2026-11-13)
   The page also loads sticker-maker.css on purpose: the step titles
   (sm-step-kicker / sm-step-title), buttons and chips look exactly like
   the other tools (owner: "same feel as Sticker Maker").
   Phone first: every row of chips is ONE line that swipes sideways
   (owner's rule: few buttons, nothing piling up on small iPhones).
   ══════════════════════════════════════════════════════ */

.cm-step { width: 100%; }
.cm-step[hidden] { display: none; }

/* ── step dots (the dot style itself is sticker-maker.css .sm-step-dot / .sm-step-line) ── */
.cm-steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 22px; }

/* ── Step 1: "Templates | Create your own" — the same pill tabs as Photo Booth's
   "Classic Layouts | Frame Templates" (owner's request 2026-11-13; that style lives
   inline in tools/photobooth.html, so it is repeated here, not shared) ── */
.cm-tabs { display: flex; gap: 6px; background: #fdf5f5; border: 2px solid #2c2c2c; border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.cm-tab {
  flex: 1; border: none; background: transparent; border-radius: 999px; padding: 9px 10px; cursor: pointer;
  font: 700 13px 'Nunito', sans-serif; color: #666; touch-action: manipulation;
}
.cm-tab:not(.active):hover { color: #2c2c2c; }
.cm-tab.active { background: #E60023; color: #fff; }
.cm-tab:focus-visible { outline: 3px solid #e6b800; outline-offset: 2px; }
@media (max-width: 360px) { .cm-tab { font-size: 12px; padding: 9px 4px; } }   /* "Create your own" stays on one line at 320px */
.cm-panel[hidden], .cm-row[hidden] { display: none; }
.cm-soon { margin: 24px 0; text-align: center; font: 700 14px 'Nunito', sans-serif; color: #888; }

/* ── Step 2: the two chip rows (photo count, then style) ── */
.cm-row {
  display: flex; align-items: center; gap: 6px; padding: 2px 2px 8px;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; overflow-anchor: none;
}
.cm-row::-webkit-scrollbar { height: 6px; }
.cm-row::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.cm-row-label { flex: 0 0 auto; font: 800 12px 'Nunito', sans-serif; color: #888; padding-inline-end: 2px; }
.cm-chip {
  flex: 0 0 auto; min-width: 36px; border: 2px solid #2c2c2c; background: #fff; color: #555; border-radius: 999px;
  padding: 6px 12px; font: 700 13px 'Nunito', sans-serif; cursor: pointer; white-space: nowrap; touch-action: manipulation;
}
.cm-chip:not(.active):hover { background: #fff9e0; }
.cm-chip.active { background: #FFE566; color: #2c2c2c; box-shadow: 2px 2px 0 #2c2c2c; }
@media (max-width: 480px) { .cm-chip { font-size: 12px; padding: 5px 10px; } }

/* ── the template cards: ONE line that swipes sideways, the same cards as Photo Booth's
   "Frame Templates" (.wpb-frame-card in tools/photobooth.html) — owner 2026-11-14, item 219 ── */
.cm-grid {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 10px; margin-top: 6px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; overflow-anchor: none;
}
.cm-grid::-webkit-scrollbar { height: 6px; }
.cm-grid::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.cm-grid::-webkit-scrollbar-thumb:hover { background: #FFE566; }
.cm-card {
  position: relative; flex: 0 0 128px; width: 128px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px; background: #fff; border: 2px solid #2c2c2c; border-radius: 12px; cursor: pointer; touch-action: manipulation;
  scroll-snap-align: start; text-align: center; font-family: 'Nunito', sans-serif;
}
.cm-card:hover { background: #fff9e0; }
.cm-card:focus-visible { outline: 3px solid #e6b800; outline-offset: 2px; }
.cm-card-thumb {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 196px;
  overflow: hidden; border-radius: 6px; border: 1px solid #cfc9bc; background: #f1eee7;
}
.cm-card-img { display: block; max-width: 100%; max-height: 100%; }
.cm-card-name { font-weight: 700; font-size: 13px; color: #2c2c2c; line-height: 1.2; }
.cm-card-sub { font-size: 11px; color: #888; }
.cm-stage-note { margin-top: 10px; }
.cm-empty { flex: 1 1 100%; text-align: center; color: #888; font: 700 14px 'Nunito', sans-serif; padding: 24px 8px; }

/* ── Step 2: back link on top, Undo / Redo above the picture (owner, item 220) ── */
.sm-back-link.cm-back-top { display: inline-block; margin: 0 0 12px; font-size: 13px; }
.cm-topbar { display: flex; justify-content: center; gap: 8px; margin: 0 0 8px; }   /* centred over the picture (owner, item 221) */
.cm-topbar .sm-btn { min-height: 34px; padding: 4px 12px; font-size: 12px; border-width: 2px; white-space: nowrap; }
@media (max-width: 380px) { .cm-topbar { gap: 5px; } .cm-topbar .sm-btn { padding: 4px 7px; } }   /* Undo · Redo · Layers on one line at 320px */

/* ── the photo edit window (part 3) ── */
.cm-edit { position: fixed; inset: 0; z-index: 1000; background: rgba(30, 24, 28, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cm-edit[hidden] { display: none; }
.cm-edit-box {
  width: 100%; max-width: 520px; max-height: 100%; display: flex; flex-direction: column;
  background: #fff; border: 3px solid #2c2c2c; border-radius: 14px; box-shadow: 6px 6px 0 #2c2c2c; overflow: hidden;
}
.cm-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 3px solid #2c2c2c; background: #FFF3B0; }
.cm-edit-head .sm-btn { min-height: 36px; padding: 4px 14px; border-width: 2px; }
.cm-edit-title { margin: 0; font: 400 18px 'Fredoka One', cursive; color: #2c2c2c; }
.cm-edit-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 18px; overscroll-behavior: contain; }
.cm-edit-view { position: relative; display: flex; justify-content: center; margin-bottom: 4px; }
.cm-edit-view canvas { display: block; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.2); touch-action: none; cursor: grab; background: #f1eee7; }   /* light: the frame's own shape (heart, polaroid…) shows */
.cm-edit-spin { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; }
.cm-edit-spin.show { display: flex; animation: cmSpinIn .12s linear .15s both; }   /* shows only when the work takes > 150 ms */
.cm-edit-spin::before { content: ''; width: 40px; height: 40px; box-sizing: border-box; border-radius: 50%; border: 5px solid rgba(255,255,255,.5); border-top-color: #E60023; animation: cmSpin .8s linear infinite; }
@keyframes cmSpinIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmSpin { to { transform: rotate(360deg); } }
.cm-edit-zoom { margin-bottom: 8px; }
@media (max-width: 600px) {   /* phones: full screen (study §6) */
  .cm-edit { padding: 0; }
  .cm-edit-box { max-width: none; height: 100%; border: none; border-radius: 0; box-shadow: none; }
}
html.cm-edit-open, html.cm-edit-open body { overflow: hidden; }

/* ── item 229: the windows get the site's look (owner: "white on white, no soul") ──
   yellow title band + thick black line (like .tool-head), cream body with soft pink dots, the
   preview on a pink dotted mat, coloured buttons with the site's hard shadow. */
.cm-edit { background: rgba(44, 20, 32, .62); }
.cm-edit-box { background: #FFFDF3; }
.cm-edit-head { background: #FFE566; }
.cm-edit-title { font-size: 19px; }
.cm-edit-body {
  background-color: #FFFDF3;
  background-image: radial-gradient(rgba(230, 0, 35, .07) 1.4px, transparent 1.6px); background-size: 18px 18px;
}
.cm-edit-view {
  padding: 12px; margin-bottom: 8px; border: 3px solid #2c2c2c; border-radius: 14px; box-shadow: 3px 3px 0 #2c2c2c;
  background-color: #FDE3EC;
  background-image: radial-gradient(rgba(255, 255, 255, .85) 2px, transparent 2.2px); background-size: 16px 16px;
}
.cm-edit-view canvas { box-shadow: 0 3px 12px rgba(60, 20, 40, .28); }
.cm-edit .sm-btn { border: 2px solid #2c2c2c; box-shadow: 2px 2px 0 #2c2c2c; background: #fff; }
.cm-edit .sm-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #2c2c2c; }
.cm-edit .cm-add { background: #fff; color: #2c2c2c; }             /* the main button: white (owner, item 230 — pink is not a site colour) */
.cm-edit .cm-add:hover { background: #fff9e0; }
.cm-edit .cm-leave-go { background: #E60023; border-color: #2c2c2c; color: #fff; }
.cm-edit .cm-leave-go:hover { background: #c4001d; }
.cm-edit-zoom { background: #fff; border: 2px solid #2c2c2c; border-radius: 12px; padding: 8px 12px; }
/* the small windows (Leave / Custom size / Edit text): a title band on top, the text on a soft pink card */
.cm-leave-box { padding: 0 !important; overflow: hidden; background: #FFF6F9 !important; }
.cm-leave-box .cm-edit-title { margin: 0; padding: 14px 16px; background: #FFE566; border-bottom: 3px solid #2c2c2c; }
.cm-leave-box .cm-leave-text { margin: 14px 18px 14px; }
.cm-leave-box .cm-own-size, .cm-leave-box .cm-words { margin-left: 18px; margin-right: 18px; }
.cm-leave-box .cm-own-size { margin-bottom: 18px; }
.cm-leave-box .cm-leave-btns { padding: 0 18px 18px; margin: 0; }
.cm-leave-box .cm-own-field input, .cm-leave-box .cm-word { background: #fff; box-shadow: 2px 2px 0 #2c2c2c; }

/* ── Step 2 buttons (part 2) ── */
.cm-bar { margin-top: 10px; flex-wrap: nowrap; }   /* one line even on a 320px phone (owner's rule) */
.cm-bar .sm-btn { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 8px 6px; }
@media (max-width: 380px) { .cm-bar { gap: 5px; } .cm-bar .sm-btn { font-size: 12px; padding: 8px 2px; } }
.cm-bar[hidden] { display: none; }
.cm-bar .cm-add { background: #FFE566; flex-grow: 1.7; }   /* the longest label gets more room */
.cm-sel-bar .sm-btn.active { background: #FFE566; box-shadow: 2px 2px 0 #2c2c2c; }
/* the red ✕ that ends the selection (owner, item 221) */
.cm-bar .cm-sel-close { flex: 0 0 42px; padding: 0; background: #E60023; border-color: #E60023; color: #fff; font-size: 18px; font-weight: 800; }
.cm-bar .cm-sel-close:not(:disabled):hover { background: #c4001d; }
.cm-bar .cm-sel-close:not(:disabled):active { background: #a80019; }
/* (item 229: Replace removed — Edit · Swap · Remove · ✕ fit on one line at 320px, no 2 × 2 block any more) */

/* ── Step 2 picture (item 222, the Shape Frames way): background canvas + one sticker per design part ── */
.cm-stage { display: flex; justify-content: center; }
/* item 240: zoomed → the stage is a window of the fitted size that scrolls over the bigger picture */
.cm-stage.cm-zoomed { display: block; overflow: auto; margin: 0 auto; overscroll-behavior: contain; outline: 2px solid #2c2c2c; border-radius: 4px; }
.cm-stage.cm-zoomed .cm-wrap { margin: 0; }
.cm-stage.cm-zoomed #wCmLayer:not(.cm-active) { touch-action: pan-x pan-y; }   /* one finger on an empty spot moves around */
.cm-zoom { margin: 10px 0 0; }
.cm-zoom-val { border: none; background: none; cursor: pointer; padding: 4px 2px; }
.cm-zoom .sm-btn:disabled { opacity: 0.4; cursor: default; }
.cm-wrap {
  position: relative; overflow: hidden; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.2); background: #fff;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;   /* no border: the sticker engine measures offsetWidth */
}
#wCmBase { display: block; width: 100%; height: 100%; }
#wCmLayer { position: absolute; inset: 0; touch-action: pan-y; }   /* no z-index: parts, stickers and drawings interleave (Layers) */
#wCmLayer.cm-active { touch-action: none; }
#wCmDrawings { position: absolute; inset: 0; pointer-events: none; }
.cm-draw { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.cm-stage.cm-drawing .cm-draw.active { pointer-events: auto; touch-action: none; cursor: crosshair; }
.cm-stage.cm-drawing #wCmLayer, .cm-stage.cm-drawing #wCmLayer .wst-el { pointer-events: none; }
/* a design part = the shared .wst-el sticker holding its own canvas; the canvas is a bit larger than the box
   (the baked shadow), so the box and its handles fit the object itself */
.cm-el, .cm-el.selected { border: 0 !important; }
.cm-el.selected, .cm-st.selected { outline: 2px dashed #e60023; outline-offset: 0; }
.cm-st.selected { border-color: transparent !important; }
.cm-el canvas.cm-art { position: absolute; display: block; pointer-events: none; }
.cm-el .wst-flip { display: none !important; }   /* flipping would mirror the photos and words inside */

/* ── Create your own (part 7, item 224) ── */
.cm-size-hint { margin: 4px 0 10px; text-align: center; font: 700 14px 'Nunito', sans-serif; color: #555; }
.cm-sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 480px) { .cm-sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cm-size {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; background: #fff; border: 2px solid #2c2c2c;
  border-radius: 12px; cursor: pointer; font-family: 'Nunito', sans-serif; touch-action: manipulation;
}
.cm-size:hover { background: #fff9e0; }
.cm-size-box { display: block; height: 70px; max-width: 100%; border: 2px solid #2c2c2c; border-radius: 4px; background: #fdeef3; }
.cm-size-name { font-weight: 800; font-size: 14px; color: #2c2c2c; }
.cm-size-sub { font-weight: 700; font-size: 11px; color: #888; text-align: center; }
.cm-frame-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .cm-frame-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cm-frame-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 8px 4px; min-height: 92px;
  background: #fff; border: 2px solid #2c2c2c; border-radius: 10px; cursor: pointer; font: 700 12px 'Nunito', sans-serif; color: #2c2c2c; touch-action: manipulation;
}
.cm-frame-btn:hover { background: #fff9e0; }
.cm-frame-btn img { max-width: 100%; max-height: 58px; object-fit: contain; display: block; }
.cm-bg-swatches { flex-wrap: wrap; justify-content: center; }
.cm-leave-box { max-width: 360px; height: auto !important; padding: 20px 18px; text-align: center; border: 3px solid #2c2c2c !important; border-radius: 14px !important; box-shadow: 6px 6px 0 #2c2c2c !important; }
.cm-leave { padding: 16px !important; }
.cm-leave-text { margin: 8px 0 16px; font: 700 14px 'Nunito', sans-serif; color: #555; }
.cm-leave-btns { flex-wrap: nowrap; }
.cm-leave-btns .sm-btn { flex: 1 1 0; }
.cm-leave-go { color: #E60023; }

/* item 225: custom size, frame search + shapes, background patterns, part colour */
.cm-size-box-own { display: flex !important; align-items: center; justify-content: center; width: 56px; font-size: 24px; color: #E60023; background: #fff !important; border-style: dashed !important; }
.cm-own-size { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 8px; margin-top: 12px; }
.cm-own-size[hidden] { display: none; }
.cm-own-field { display: flex; flex-direction: column; gap: 3px; font: 800 12px 'Nunito', sans-serif; color: #555; }
.cm-own-field input { width: 90px; padding: 8px; border: 2px solid #2c2c2c; border-radius: 8px; font: 700 15px 'Nunito', sans-serif; }
.cm-own-x { font: 800 18px 'Nunito', sans-serif; padding-bottom: 8px; }
.cm-frame-search { width: 100%; box-sizing: border-box; margin: 0 0 10px; border: 2px solid #2c2c2c; border-radius: 8px; padding: 9px 12px; font: 700 14px 'Nunito', sans-serif; }
.cm-frame-search:focus { outline: none; border-color: #E60023; }
.cm-frame-grid { max-height: 250px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.cm-frame-btn[hidden] { display: none; }
.cm-frame-shape { display: block; max-height: 52px; }
.cm-frame-free { display: flex; align-items: center; justify-content: center; height: 50px; }   /* the usual "upload" arrow (item 227) */
.cm-noframe { text-align: center; color: #888; font: 700 13px 'Nunito', sans-serif; }
.cm-noframe[hidden], .cm-custom-block[hidden] { display: none; }
.cm-custom-block { margin-top: 12px; }
.cm-bg-upload { width: 100%; margin-bottom: 10px; }
.cm-pattern-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.cm-patterns { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.cm-pattern { flex: 0 0 auto; padding: 0; border: 2px solid #2c2c2c; border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; line-height: 0; }
.cm-pattern canvas, .cm-pattern img { width: 56px; height: 56px; display: block; }
.cm-pattern.active { box-shadow: 0 0 0 3px #FFE566, 0 0 0 5px #2c2c2c; }
.cm-pattern-color { width: 56px; height: 56px; box-sizing: border-box; position: relative; }   /* plain colours in the same row (item 226) */
.cm-pattern-color.sm-swatch-custom { background: conic-gradient(#ff5f6d, #ffc371, #b4ec51, #42e695, #3bb2b8, #8e7cf0, #f05fb5, #ff5f6d); }
.cm-pattern-color input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cm-bg-swatches[hidden] { display: none; }
.cm-pattern-cats { margin-bottom: 2px; }
.cm-pattern-colors { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 6px; }
.cm-pattern-colors[hidden] { display: none; }
.cm-pattern-colors input[type=color] { width: 34px; height: 30px; border: 2px solid #2c2c2c; border-radius: 6px; padding: 1px; background: #fff; }
.cm-el-color { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.cm-el-color[hidden] { display: none; }
.cm-el-color input[type=color] { width: 26px; height: 26px; border: 2px solid #2c2c2c; border-radius: 50%; padding: 0; overflow: hidden; background: none; }
/* item 232 (owner): the circle showed a SQUARE colour inside — the browser's own swatch box. Make the swatch fill the circle. */
.cm-el-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cm-el-color input[type=color]::-webkit-color-swatch { border: none; border-radius: 50%; }
.cm-el-color input[type=color]::-moz-color-swatch { border: none; border-radius: 50%; }

/* Layers button (top bar) + panel */
.cm-layers-btn { position: relative; }
.cm-layers-btn.active { background: #FFE566; }
.cm-layers-badge {
  position: absolute; top: -8px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  border-radius: 10px; background: #e60023; color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
}
.cm-layers-panel { width: 100%; box-sizing: border-box; padding: 10px 12px; margin: 0 0 10px; border: 3px solid #2c2c2c; border-radius: 12px; background: #fffdf3; }
.cm-layers-panel[hidden] { display: none; }
.cm-layers-panel .wls-base { display: none; }
/* drag a row from anywhere (item 223); item 247: on a phone a swipe SCROLLS the list (pan-y) and a short hold drags */
.cm-layers-panel .wls-row.wls-rowdrag { touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* the PHOTO inside a frame is selected (item 223): the frame's own handles hide, a yellow box marks the photo */
.cm-el.cm-photo-on { outline: none !important; }
.cm-el.cm-photo-on .wst-del, .cm-el.cm-photo-on .wst-resize, .cm-el.cm-photo-on .wst-rotate { display: none !important; }
.cm-photo-mark { position: absolute; z-index: 4; pointer-events: none; box-sizing: border-box; border: 3px dashed #FFB800; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }    /* the fixed "Photo" row of the engine: here the background is paper, not a photo */

/* tabs under the picture */
.cm-tabs-area { width: 100%; margin-top: 10px; }
.cm-tabs-area[hidden] { display: none; }
.cm-sticker-cats { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: thin; }
.cm-sticker-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 210px; overflow-y: auto; overflow-x: hidden; padding: 4px 2px; margin-top: 8px; scrollbar-width: thin; box-sizing: border-box; width: 100%; }
@media (max-width: 480px) { .cm-sticker-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; } }
#wCmPanelDraw .sm-opt input[type=range] { width: 110px; }
#wCmDrawColor { width: 34px; height: 34px; border: 2px solid #2c2c2c; border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.cm-el-bar .cm-sel-close-wide { flex: 0 0 auto; padding: 0 22px; font-size: 14px; }

/* ── item 228 ── */
/* the tab row SWIPES sideways when the tabs do not fit (owner: no more squeezed / overlapping tabs on phones) */
#wCmTabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
/* item 247: "more buttons this way" hint on the swiping tab row (js addScrollHint) */
/* item 247: the Edit window for a free "Upload photo" — filters / adjustments only (the photo shows whole) */
.cm-edit-free .cm-edit-zoom, .cm-edit-free .cm-edit-body > .sm-hint { display: none; }
.cm-sh-wrap { position: relative; }
.cm-sh { position: absolute; top: 0; bottom: 0; width: 38px; border: 0; padding: 0; margin: 0; display: none;
  align-items: center; font: 900 22px/1 'Nunito', sans-serif; color: #2c2c2c; cursor: pointer; z-index: 3; -webkit-tap-highlight-color: transparent; }
.cm-sh-r { right: 0; justify-content: flex-end; padding-right: 4px; background: linear-gradient(to right, rgba(255,255,255,0), #fff 60%); }
.cm-sh-l { left: 0; justify-content: flex-start; padding-left: 4px; background: linear-gradient(to left, rgba(255,255,255,0), #fff 60%); }
.cm-sh-wrap.can-r .cm-sh-r, .cm-sh-wrap.can-l .cm-sh-l { display: flex; }
.cm-sh-wrap.can-r .cm-sh-r { animation: cm-sh-nudge 1.4s ease-in-out 2; }
@keyframes cm-sh-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .cm-sh-wrap.can-r .cm-sh-r { animation: none; } }
#wCmTabs::-webkit-scrollbar { display: none; }
#wCmTabs .sm-tab { flex: 1 0 auto; padding: 10px 14px; white-space: nowrap; }
#wCmTabs .sm-tab[hidden] { display: none; }
.cm-tabs-area.cm-sel-text #wCmTabs { display: none; }   /* a selected text: only its own controls */
/* text layers (shared text-layer-engine): no z-index on the holder, so texts mix with parts / stickers */
#wCmTexts { position: absolute; inset: 0; pointer-events: none; }
.cm-stage.cm-drawing #wCmTexts .wDragTextWrap { pointer-events: none; }
#wCmTexts .wDragTextWrap.txt-selected { outline: 2px dashed #e60023; }
.cm-text-top { display: flex; justify-content: center; gap: 8px; }
.cm-text-top .sm-btn[hidden] { display: none; }
#wCmTextDone { background: #E60023; border-color: #E60023; color: #fff; padding: 0 22px; font-size: 14px; font-weight: 800; }   /* same red "✕ Done" as a selected sticker */
#wCmTextDone:hover { background: #c4001d; }
.cm-text-edit { margin-top: 10px; }
.cm-text-edit[hidden] { display: none; }
#wCmTextInput {
  display: block; width: 100%; box-sizing: border-box; min-height: 48px; resize: vertical; padding: 8px 10px;
  border: 2px solid #2c2c2c; border-radius: 8px; font: 700 15px 'Nunito', sans-serif; color: #2c2c2c; background: #fff;
}
#wCmTextInput:focus { outline: none; border-color: #E60023; }
.cm-text-style { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin-top: 10px; }
.cm-text-ol { display: inline-flex; align-items: center; gap: 8px; }   /* the switch and its colour stay together */
#wCmTextFont { font: 700 13px 'Nunito', sans-serif; padding: 7px 8px; border: 2px solid #2c2c2c; border-radius: 8px; background: #fff; color: #2c2c2c; }
#wCmTextColor, #wCmTextOutlineColor { width: 34px; height: 30px; border: 2px solid #2c2c2c; border-radius: 6px; padding: 1px; background: #fff; cursor: pointer; }
.cm-text-extras { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; scrollbar-width: thin; }
.cm-text-grid { display: flex; flex-wrap: wrap; gap: 5px; max-height: 170px; overflow-y: auto; padding: 6px 2px; margin-top: 4px; scrollbar-width: thin; }
.cm-extra {
  background: #f9f9f9; border: 1.5px solid #ddd; padding: 5px 8px; font-size: 14px; cursor: pointer; border-radius: 6px;
  font-family: inherit; white-space: nowrap; touch-action: manipulation; color: #2c2c2c;
}
.cm-extra:hover { background: #fff8d6; border-color: #2c2c2c; }
/* the outline of a sticker / uploaded photo: a canvas BEHIND the picture inside the sticker element */
.cm-st canvas.cm-outline { position: absolute; z-index: -1; display: block; pointer-events: none; max-width: none; }
.cm-outline-row { width: 100%; box-sizing: border-box; margin-top: 10px; padding: 12px; border: 2px solid #2c2c2c; border-radius: 12px; background: #fffdf3; }
.cm-outline-row[hidden] { display: none; }
.cm-outline-row .sm-style-body { justify-content: center; }
#wCmElOutline.active { background: #FFE566; }
/* item 231: the background's dots / stars colour (under the background colours) */
.cm-bg2 { justify-content: center; margin: 12px auto 0; }
.cm-bg2[hidden] { display: none; }
.cm-bg2 input[type=color] { width: 34px; height: 30px; border: 2px solid #2c2c2c; border-radius: 6px; padding: 1px; background: #fff; }
/* item 240 (owner): the page's extra colours side by side in ONE wrapping row (not a column — too tall on phones):
   each = a round swatch with its short name under it, 4 per row at 320 px */
.cm-bg-extra { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 10px 4px; margin: 14px auto 0; max-width: 460px; }
.cm-bg-extra:empty { display: none; }
/* 50px each: 4 fit side by side even on a 320px phone (the panel is ~218px there); circles stay on one line
   even when a name takes 2 lines */
.cm-bg-extra .cm-bg2 { flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; margin: 0; width: 50px; text-align: center; }
.cm-bg-extra .cm-bg2 span { font-size: 10.5px; line-height: 1.2; order: 2; overflow-wrap: anywhere; }
@media (min-width: 480px) { .cm-bg-extra { gap: 10px 8px; } .cm-bg-extra .cm-bg2 { width: 62px; } .cm-bg-extra .cm-bg2 span { font-size: 11px; } }
.cm-bg-extra .cm-bg2 input[type=color] { width: 34px; height: 34px; border-radius: 50%; padding: 2px; cursor: pointer; }
.cm-bg-extra .cm-bg2 input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.cm-bg-extra .cm-bg2 input[type=color]::-webkit-color-swatch { border: none; border-radius: 50%; }
.cm-bg-extra .cm-bg2 input[type=color]::-moz-color-swatch { border: none; border-radius: 50%; }
.cm-el-bar .sm-btn[hidden] { display: none; }
/* small phones, a part with TWO actions (e.g. 🎨 Colour + ✏️ Edit text): the actions on one line, "✕ Done" under them */
@media (max-width: 400px) {
  .cm-el-bar:has(> :not([hidden]):not(.cm-sel-close) ~ :not([hidden]):not(.cm-sel-close)) { flex-wrap: wrap; }
  .cm-el-bar:has(> :not([hidden]):not(.cm-sel-close) ~ :not([hidden]):not(.cm-sel-close)) .cm-sel-close-wide { flex: 1 1 100%; }
}
/* the words of a template part */
.cm-words { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.cm-word { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 2px solid #2c2c2c; border-radius: 8px; font: 700 15px 'Nunito', sans-serif; color: #2c2c2c; }
.cm-word:focus { outline: none; border-color: #E60023; }

/* item 240: Save template — the button (white like the site's main buttons in windows), the window and "Mine" cards */
.cm-save-tpl { background: #fff; color: #2c2c2c; }
.cm-save-tpl[hidden] { display: none !important; }
.cm-save-box { position: relative; }
.cm-save-x { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border: 2px solid #2c2c2c; border-radius: 50%;
  background: #e8333a; color: #fff; font: 700 20px/1 'Nunito', sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cm-save-opt { display: flex; align-items: center; gap: 10px; margin: 10px auto; padding: 10px 14px; max-width: 260px;
  border: 2px solid #2c2c2c; border-radius: 10px; background: #fff; font: 700 15px 'Nunito', sans-serif; cursor: pointer; }
.cm-save-opt input { width: 20px; height: 20px; accent-color: #E60023; }   /* red tick (owner, item 245) */
#wCmSaveGo { background: #4CAF50; color: #fff; }             /* green Save, same green as the site's Download button (owner, item 245) */
#wCmSaveGo:hover { background: #43a047; }
.cm-save-opt input:disabled + span { opacity: 0.45; }
.cm-save-note { font-size: 12px; color: #8a2b31; text-align: center; margin: 4px 0 0; }
.cm-save-note[hidden] { display: none; }
.cm-card-mine { position: relative; cursor: pointer; }
.cm-card-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 2px solid #2c2c2c; border-radius: 50%;
  background: #e8333a; color: #fff; font: 700 16px/1 'Nunito', sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* item 241: the empty "Mine" card (like the stickers' empty "+" tile) and its sentence under it */
.cm-card.cm-card-add { border-color: transparent; background: none; box-shadow: none; }
.cm-card-add .cm-card-thumb { border: 2px dashed #bbb; background: #fff; position: relative; }
.cm-card-add:hover .cm-card-thumb, .cm-card-add:focus-visible .cm-card-thumb { border-color: #e60023; }
.cm-card-add:focus-visible { outline: none; }
.cm-add-plus { font: 400 42px/1 'Nunito', sans-serif; color: #bbb; }
.cm-card-add:hover .cm-add-plus { color: #e60023; }
.cm-mine-hint { text-align: center; color: #888; font: 700 13px/1.4 'Nunito', sans-serif; margin: 6px 0 0; }
