/* Profile Picture Maker  additions on top of app.css */
.ppm-root { padding-top: 1rem; padding-bottom: 3rem; }

.ppm-info-list { list-style: none; padding: 0; margin: 1rem 1rem 0; text-align: left; }
.ppm-info-list li { padding: .5rem 0 .5rem 1.5rem; position: relative; color: #4b5563; font-size: .95rem; line-height: 1.5; }
.ppm-info-list li::before { content: ""; position: absolute; left: 0; top: .85rem; width: 8px; height: 8px; border-radius: 50%; background-image: linear-gradient(to right, var(--gradient-primary), var(--gradient-secondary)); }

.workspace.ppm-workspace { display: none; padding: 0; }
.workspace.ppm-workspace.ppm-open { display: block; }

/* --------- Branded header --------- */
.ppm-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid #eef0f4;
}
.ppm-app-header[hidden] { display: none; }
.ppm-brand { display: inline-flex; align-items: center; gap: 8px; color: #1a1f2e; font-weight: 700; }
.ppm-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background-image: linear-gradient(135deg, var(--gradient-primary), var(--gradient-secondary));
}
.ppm-brand-logo svg { width: 16px; height: 16px; }
.ppm-brand-title { font-size: 1.05rem; letter-spacing: -0.01em; }
.ppm-all-tools {
  color: #6b7280;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}
.ppm-all-tools:hover { color: var(--gradient-primary); }

/* Loading */
.ppm-loading { text-align: center; padding: 4rem 1rem; }
.ppm-loading[hidden] { display: none; }
.ppm-loading .progressive-loader { margin: 0; justify-content: center; }

/* --------- Toolbar --------- */
.ppm-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1.5rem 1.5rem .75rem;
  flex-wrap: wrap;
  position: relative;
}
.ppm-toolbar[hidden] { display: none; }
.ppm-tb-group {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0 auto;
}
.ppm-tb-right { margin-left: auto; position: absolute; right: 1.5rem; top: 1.5rem; }

.ppm-tb-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: #fff;
  border: 1px solid #e4e7eb;
  color: #222b3a;
  padding: .55rem .95rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 1px 2px rgba(30, 30, 60, .04);
}
.ppm-tb-btn:hover { border-color: #c8ccd6; box-shadow: 0 2px 6px rgba(30, 30, 60, .08); }
.ppm-tb-btn.ppm-tb-open {
  background-image: linear-gradient(135deg, var(--gradient-primary), var(--gradient-secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(101, 87, 255, .3);
}
.ppm-tb-btn.ppm-tb-open:hover { color: #fff; }
.ppm-tb-icon { display: inline-flex; }
.ppm-tb-icon svg { width: 16px; height: 16px; }
.ppm-tb-chevron { font-size: .7rem; opacity: .7; margin-left: -2px; }

/* Edit Photo button avatar */
.ppm-edit-photo-btn { padding-left: .35rem; }
.ppm-edit-photo-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eef0f4;
  color: #6b7280;
  overflow: hidden;
}
.ppm-edit-photo-avatar svg { width: 14px; height: 14px; }
.ppm-edit-photo-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dropdown container */
.ppm-tb-dropdown { position: relative; }
.ppm-tb-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(30, 30, 60, .12);
  padding: 14px;
  z-index: 20;
  min-width: 240px;
}
.ppm-tb-menu[hidden] { display: none; }
.ppm-tb-right .ppm-tb-menu { left: auto; right: 0; }

/* Background menu */
.ppm-bg-menu { width: 340px; max-width: 92vw; }
.ppm-menu-tabs {
  display: flex;
  background: #f4f4f5;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: .85rem;
}
.ppm-menu-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #55606f;
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.ppm-menu-tab.ppm-menu-tab-active {
  background-image: linear-gradient(135deg, var(--gradient-primary), var(--gradient-secondary));
  color: #fff;
  box-shadow: 0 2px 6px rgba(101, 87, 255, .3);
}
.ppm-menu-tab svg { width: 14px; height: 14px; }
.ppm-menu-label {
  font-size: .75rem;
  color: #55606f;
  font-weight: 600;
  letter-spacing: .01em;
  margin-bottom: .55rem;
}
.ppm-color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.ppm-color-chip {
  aspect-ratio: 1/1;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: transform .15s ease;
}
.ppm-color-chip:hover { transform: scale(1.1); }
.ppm-color-chip.ppm-chip-active { border-color: #222b3a; }
.ppm-reset-btn {
  width: 100%;
  margin-top: .85rem;
  background: #1a2032;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 600;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.ppm-reset-btn:hover { background: #12162a; }
.ppm-reset-btn.ppm-reset-slim { padding: 8px; font-size: .8rem; margin-top: .5rem; }

/* --------- Slider row --------- */
.ppm-slider-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .55rem;
  font-size: .78rem;
  color: #55606f;
  font-weight: 500;
}
.ppm-slider-row .ppm-slider-label { min-width: 68px; }
.ppm-slider-row input[type=range] {
  flex: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgb(229, 231, 235);
  outline: none;
  margin: 6px 0;
}
.ppm-slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #222b3a;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  transition: box-shadow .2s ease;
}
.ppm-slider-row input[type=range]::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.ppm-slider-row input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #222b3a;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
  transition: box-shadow .2s ease;
}
.ppm-slider-row input[type=range]::-moz-range-thumb:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.ppm-slider-val {
  min-width: 30px;
  text-align: right;
  color: #1a1f2e;
  font-variant-numeric: tabular-nums;
  font-size: .75rem;
}

/* --------- Filter presets --------- */
.ppm-preset-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: .5rem;
}
.ppm-preset-btn {
  background: #f4f5f7;
  border: 1px solid transparent;
  color: #1a1f2e;
  font-size: .75rem;
  font-weight: 500;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.ppm-preset-btn:hover { background: #ebeef2; }
.ppm-preset-btn.ppm-preset-active {
  background: rgba(101,87,255,.1);
  color: var(--gradient-primary);
  border-color: rgba(101,87,255,.3);
  font-weight: 600;
}

/* --------- Edit Photo dropdown (wider, has sliders) --------- */
.ppm-edit-photo-menu { width: 300px; max-width: 92vw; }
.ppm-menu-item-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: .88rem;
  color: #1a1f2e;
  font-weight: 500;
  text-align: left;
}
.ppm-menu-item-btn:hover { background: #f4f4f5; }
.ppm-menu-item-btn svg { width: 16px; height: 16px; color: #6b7280; }
.ppm-menu-divider {
  border: none;
  border-top: 1px solid #eef0f4;
  margin: .55rem 0;
}

/* Shape menu */
.ppm-shape-menu { min-width: 220px; }
.ppm-shape-option, .ppm-filter-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  color: #222b3a;
  text-align: left;
}
.ppm-shape-option:hover, .ppm-filter-option:hover { background: #f4f4f5; }
.ppm-shape-option svg { width: 20px; height: 20px; color: #6b7280; }
.ppm-shape-option.ppm-shape-active,
.ppm-filter-option.ppm-filter-active { color: var(--gradient-primary); font-weight: 600; }
.ppm-shape-option.ppm-shape-active svg { color: var(--gradient-primary); }

/* Filter menu */
.ppm-filter-menu { min-width: 200px; }
.ppm-badge {
  display: inline-block;
  margin-left: auto;
  background-image: linear-gradient(135deg, var(--gradient-primary), var(--gradient-secondary));
  color: #fff;
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* --------- Gallery --------- */
.ppm-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 1.5rem 1.5rem 2rem;
}
@media (max-width: 900px) { .ppm-gallery { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (max-width: 480px) { .ppm-gallery { grid-template-columns: 1fr; gap: 16px; } }

.ppm-card {
  position: relative;
  aspect-ratio: 1/1;
  cursor: pointer;
  overflow: hidden;
  background: transparent;
  transition: transform .2s ease;
}
.ppm-card:hover { transform: translateY(-3px); }
.ppm-card-shape { position: absolute; inset: 0; overflow: hidden; }
.ppm-card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.ppm-card-subject {
  position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%;
  filter: brightness(var(--pp-fb, 100%)) contrast(var(--pp-fc, 100%)) saturate(var(--pp-fs, 100%)) grayscale(var(--pp-fg, 0%)) sepia(var(--pp-fse, 0%));
  transform: translate(var(--pp-sub-x, 0%), var(--pp-sub-y, 0%)) scale(var(--pp-sub-scale, 1));
  transform-origin: center;
  transition: filter .12s ease;
}
.ppm-cust-preview .ppm-card-subject { cursor: grab; }
.ppm-cust-preview .ppm-card-subject:active { cursor: grabbing; }

.ppm-card[data-shape="round"] .ppm-card-shape { border-radius: 50%; }
.ppm-card[data-shape="rounded"] .ppm-card-shape { border-radius: 16px; }
.ppm-card[data-shape="extra"] .ppm-card-shape { border-radius: 40px; }
.ppm-card[data-shape="square"] .ppm-card-shape { border-radius: 0; }

.ppm-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(20, 24, 40, .35);
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 3;
  pointer-events: none;
}
.ppm-card[data-shape="round"] .ppm-card-overlay { border-radius: 50%; }
.ppm-card[data-shape="rounded"] .ppm-card-overlay { border-radius: 16px; }
.ppm-card[data-shape="extra"] .ppm-card-overlay { border-radius: 40px; }
.ppm-card:hover .ppm-card-overlay { opacity: 1; pointer-events: auto; }

.ppm-card-download {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background-image: linear-gradient(135deg, var(--gradient-primary), var(--gradient-secondary));
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(101, 87, 255, .35);
}
.ppm-card-download svg { width: 15px; height: 15px; }
.ppm-card-tooltip {
  background: #fff;
  color: #1a1f2e;
  font-size: .72rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(30, 30, 60, .15);
  white-space: nowrap;
}

/* --------- Customize View --------- */
.ppm-cust-wrap {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(30, 30, 60, .08);
  overflow: hidden;
  margin: 0 auto;
}

.ppm-cust-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid #eef0f4;
}
.ppm-cust-topbar-mid {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0 auto;
}
.ppm-cust-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: 1px solid #e4e7eb;
  color: #222b3a;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  padding: .5rem .85rem;
  border-radius: 999px;
}
.ppm-cust-back:hover { border-color: #c8ccd6; background: #f9fafb; }

.ppm-cust-iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #55606f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ppm-cust-iconbtn svg { width: 18px; height: 18px; }
.ppm-cust-iconbtn:not(:disabled):hover { background: #f4f4f5; color: #222b3a; }
.ppm-cust-iconbtn:disabled { opacity: .4; cursor: not-allowed; }

.ppm-cust-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .6rem 1.2rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(34, 197, 94, .3);
}
.ppm-cust-dl-btn:hover { background: #16a34a; }

.ppm-cust-body {
  display: flex;
  min-height: 560px;
}

/* Left sidebar icon nav */
.ppm-cust-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 76px;
  padding: .5rem .3rem;
  border-right: 1px solid #eef0f4;
  flex-shrink: 0;
  background: #fafbfc;
}
.ppm-cust-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: .6rem .2rem;
  border-radius: 10px;
  cursor: pointer;
  color: #55606f;
  font-size: .68rem;
  font-weight: 500;
  transition: all .12s;
}
.ppm-cust-nav-btn svg { width: 22px; height: 22px; }
.ppm-cust-nav-btn:hover { background: #f0f1f5; color: #1a1f2e; }
.ppm-cust-nav-btn.ppm-cust-nav-active {
  background: rgba(101, 87, 255, .1);
  color: var(--gradient-primary);
}

/* Content panels */
.ppm-cust-panels {
  width: 330px;
  flex-shrink: 0;
  border-right: 1px solid #eef0f4;
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 640px;
}
.ppm-cust-panel { display: block; }
.ppm-cust-panel[hidden] { display: none; }
.ppm-cust-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1f2e;
  margin: 0 0 1rem;
}
.ppm-panel-desc { font-size: .9rem; color: #55606f; margin-bottom: 1rem; }

/* Edit background row */
.ppm-edit-bg-row {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}
.ppm-edit-bg-input {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f4f5f7;
  border: 1px solid #e4e7eb;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .85rem;
  color: #6b7280;
}
.ppm-edit-bg-input svg { color: #9ca3af; }
.ppm-edit-bg-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e4e7eb;
  background: #6557ff;
  cursor: pointer;
  padding: 0;
}

.ppm-cust-tabs { margin-bottom: 1rem; }

/* Pexels image search in Photos tab */
.ppm-pex-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f4f5f7;
  border: 1px solid #e4e7eb;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: .75rem;
}
.ppm-pex-search svg { color: #9ca3af; flex-shrink: 0; }
.ppm-pex-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: .9rem;
  color: #1a1f2e;
}
.ppm-pex-search input::placeholder { color: #9ca3af; }

.ppm-pex-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: .85rem;
}
.ppm-pex-chip {
  background: #f4f5f7;
  border: 1px solid transparent;
  color: #55606f;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
}
.ppm-pex-chip:hover { background: #ebeef2; color: #1a1f2e; }
.ppm-pex-chip.ppm-pex-chip-active {
  background: rgba(101, 87, 255, .1);
  color: var(--gradient-primary);
  border-color: rgba(101, 87, 255, .25);
}

.ppm-pex-status {
  font-size: .8rem;
  color: #6b7280;
  padding: 4px 2px;
  min-height: 20px;
}
.ppm-pex-status.ppm-pex-error { color: #dc2626; }

.ppm-pex-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: .25rem;
}
.ppm-pex-thumb {
  position: relative;
  aspect-ratio: 1/1;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #f4f5f7;
  transition: transform .12s ease;
}
.ppm-pex-thumb:hover { transform: scale(1.03); }
.ppm-pex-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ppm-pex-thumb.ppm-pex-thumb-active { border-color: var(--gradient-primary); }
.ppm-pex-thumb.ppm-pex-thumb-active::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-image: linear-gradient(135deg, var(--gradient-primary), var(--gradient-secondary));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* Preview area */
.ppm-cust-preview-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 2rem;
}
.ppm-cust-preview-frame {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1/1;
  padding: 8px;
}
.ppm-cust-preview {
  width: 100%;
  height: 100%;
}
.ppm-cust-preview-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid #3b82f6;
  border-radius: 2px;
  z-index: 2;
}
.ppm-handle-tl { top: -1px; left: -1px; }
.ppm-handle-tr { top: -1px; right: -1px; }
.ppm-handle-bl { bottom: -1px; left: -1px; }
.ppm-handle-br { bottom: -1px; right: -1px; }
.ppm-cust-preview-topdot {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 14px;
  background: #3b82f6;
}
.ppm-cust-preview-topdot::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
}
.ppm-cust-preview-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px dashed rgba(59, 130, 246, .5);
  border-radius: 4px;
  pointer-events: none;
}

.ppm-panel-hint { font-size: .82rem; color: #6b7280; margin-bottom: .85rem; line-height: 1.4; }

/* --------- Templates grid --------- */
.ppm-tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ppm-tpl-card {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
  background: #f4f5f7;
  transition: transform .12s ease, border-color .12s ease;
}
.ppm-tpl-card:hover { transform: scale(1.04); border-color: rgba(101, 87, 255, .3); }
.ppm-tpl-card.ppm-tpl-active { border-color: var(--gradient-primary); }
.ppm-tpl-card-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px;
  opacity: 0;
  transition: opacity .12s ease;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}
.ppm-tpl-card:hover .ppm-tpl-card-inner { opacity: 1; }
.ppm-tpl-name {
  font-size: .68rem;
  font-weight: 600;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ppm-tpl-count {
  font-size: .75rem;
  color: #6b7280;
  margin: 0 0 .5rem;
  font-weight: 500;
}

/* --------- Patterns grid --------- */
.ppm-pattern-colors {
  display: flex;
  gap: 10px;
  margin-bottom: .85rem;
}
.ppm-pattern-color-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .75rem;
  color: #55606f;
  font-weight: 600;
}
.ppm-pattern-color-label input[type=color] {
  width: 100%;
  height: 36px;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  padding: 2px;
}
.ppm-pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ppm-pattern-thumb {
  aspect-ratio: 1/1;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
  overflow: hidden;
  background: #f4f5f7;
  transition: transform .12s;
}
.ppm-pattern-thumb:hover { transform: scale(1.05); }
.ppm-pattern-thumb.ppm-pattern-active { border-color: var(--gradient-primary); }

/* --------- Decals --------- */
.ppm-decal-toolrow {
  display: flex;
  gap: 8px;
  margin-bottom: .85rem;
  align-items: center;
}
.ppm-decal-cat {
  flex: 1;
  background: #f4f5f7;
  border: 1px solid #e4e7eb;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .85rem;
  color: #1a1f2e;
  cursor: pointer;
  outline: none;
}
.ppm-decal-color-label {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e4e7eb;
}
.ppm-decal-color-label input[type=color] {
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}
.ppm-decal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.ppm-decal-thumb {
  aspect-ratio: 1/1;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid #eef0f4;
  padding: 6px;
  background: #f9fafb;
  transition: all .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1f2e;
}
.ppm-decal-thumb:hover { background: #fff; border-color: var(--gradient-primary); }
.ppm-decal-thumb svg { width: 100%; height: 100%; max-width: 40px; max-height: 40px; }

/* --------- Layers panel --------- */
.ppm-layer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ppm-layer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #eef0f4;
  background: #fff;
  font-size: .85rem;
  color: #1a1f2e;
  cursor: pointer;
  transition: all .12s;
}
.ppm-layer-row:hover { background: #f9fafb; }
.ppm-layer-row.ppm-layer-selected { border-color: var(--gradient-primary); background: rgba(101, 87, 255, .05); }
.ppm-layer-row.ppm-layer-locked { opacity: .8; }
.ppm-layer-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f4f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #55606f;
  overflow: hidden;
}
.ppm-layer-thumb svg { width: 20px; height: 20px; }
.ppm-layer-name { flex: 1; }
.ppm-layer-actions { display: inline-flex; gap: 2px; }
.ppm-layer-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ppm-layer-btn:hover { background: #f0f1f5; color: #1a1f2e; }
.ppm-layer-btn.ppm-layer-btn-danger:hover { color: #dc2626; background: #fee2e2; }
.ppm-layer-btn svg { width: 14px; height: 14px; }

/* --------- Decal overlay in preview --------- */
.ppm-decals-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;   /* container transparent to clicks */
  z-index: 4;              /* above subject (which is z:3) */
}
.ppm-card-shape > .ppm-card-subject { z-index: 3; position: absolute; }

.ppm-decal {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  pointer-events: auto;    /* decals themselves catch clicks */
  cursor: move;
  user-select: none;
  -webkit-user-drag: none;
  color: var(--decal-color, #ffffff);
}
.ppm-decal svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.ppm-decal.ppm-decal-selected {
  outline: 2px dashed #3b82f6;
  outline-offset: 4px;
  border-radius: 4px;
}
/* Gallery cards: decals are visual only, no drag */
.ppm-card:not(.ppm-cust-preview) .ppm-decal { pointer-events: none; cursor: default; }

@media (max-width: 991px) {
  .ppm-cust-body { flex-direction: column; }
  .ppm-cust-sidebar {
    flex-direction: row;
    width: 100%;
    padding: .5rem;
    border-right: none;
    border-bottom: 1px solid #eef0f4;
    overflow-x: auto;
    gap: 4px;
  }
  .ppm-cust-nav-btn { min-width: 68px; flex-shrink: 0; }
  .ppm-cust-panels { width: 100%; border-right: none; border-bottom: 1px solid #eef0f4; max-height: none; }
  .ppm-cust-topbar { padding: .6rem .75rem; flex-wrap: wrap; }
  .ppm-cust-topbar-mid { margin: 0; }
}

@media (max-width: 767px) {
  .ppm-toolbar { padding: 1rem .75rem .5rem; }
  .ppm-tb-right { position: static; margin-left: auto; }
  .ppm-tb-btn { padding: .45rem .75rem; font-size: .82rem; }
  .ppm-bg-menu { width: 280px; }
  .ppm-color-grid { grid-template-columns: repeat(7, 1fr); }
  .ppm-app-header { padding: 12px 16px; }
  .ppm-gallery { padding: 1rem .75rem 1.5rem; }
}
