/* ==========================================================================
   namule.com — preset sticker picker (Namule Core 1.0.9)
   ========================================================================== */

/* ---- Category tiles in the designer controls ---- */
.nm-pk-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.nm-pk-tile {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 10px;
  min-height: 44px;
  border: 2px solid #E4DCFF;
  border-radius: 16px;
  background: #FFFFFF;
  color: #1A1826;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.nm-pk-tile:hover { transform: translateY(-2px); border-color: #7C4DFF; box-shadow: 0 8px 18px rgba(36, 23, 68, .10); }
.nm-pk-tile:focus-visible { outline: 3px solid #FFC234; outline-offset: 2px; }
.nm-pk-tile.is-live { background: linear-gradient(180deg, #FAF7FF 0%, #FFFFFF 100%); }
.nm-pk-tile:not(.is-live) { opacity: .72; }
.nm-pk-tile-img {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: #F7F4FF;
}
.nm-pk-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nm-pk-tile-emoji { display: flex; align-items: center; justify-content: center; font-size: 36px; }
.nm-pk-tile-name { font-size: 13.5px; font-weight: 800; line-height: 1.2; }
.nm-pk-tile-badge {
  font-size: 11px;
  font-weight: 700;
  color: #5C5772;
  background: #F1ECFF;
  border-radius: 999px;
  padding: 2px 9px;
}
.nm-pk-tile.is-live .nm-pk-tile-badge { background: #E6F7EC; color: #1B6B3A; }

/* browse button inside the empty canvas hint */
.nm-d-empty-hint .nm-d-empty-browse { pointer-events: auto; margin-top: 12px; max-width: 220px; }

/* ---- Picker dialog ---- */
html.nm-pk-lock, html.nm-pk-lock body { overflow: hidden; }
.nm-pk[hidden] { display: none; }
.nm-pk {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  --nm-ink: #1A1826;
  --nm-muted: #5C5772;
  --nm-border: #E4DCFF;
  --nm-surface: #F7F4FF;
  --nm-purple: #7C4DFF;
  --nm-purple-dark: #6030EB;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1A1826;
}
.nm-pk *, .nm-pk *::before, .nm-pk *::after { box-sizing: border-box; }
.nm-pk-backdrop { position: absolute; inset: 0; background: rgba(26, 24, 38, .62); }
.nm-pk-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(980px, 96vw);
  height: min(780px, 92vh);
  background: #FFFFFF;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(20, 10, 50, .45);
  overflow: hidden;
  outline: none;
}
.nm-pk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 8px;
}
.nm-pk-title { margin: 0; font-size: 20px; font-weight: 850; letter-spacing: -.01em; }
.nm-pk-x {
  appearance: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: #F1ECFF; color: #3B2378;
  font-size: 28px; line-height: 1; cursor: pointer;
}
.nm-pk-x:hover { background: #E4DAFF; }
.nm-pk-x:focus-visible, .nm-pk-tab:focus-visible, .nm-pk-chip:focus-visible, .nm-pk-sticker:focus-visible,
.nm-pk-sheet:focus-visible, .nm-pk-search:focus-visible { outline: 3px solid #FFC234; outline-offset: 2px; }

.nm-pk-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 18px 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid #E4DCFF;
}
.nm-pk-tab {
  appearance: none;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid #E4DCFF;
  border-radius: 999px;
  background: #FFFFFF;
  color: #3B2378;
  font: inherit; font-size: 14px; font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.nm-pk-tab:hover { border-color: #7C4DFF; }
.nm-pk-tab.is-active { background: #7C4DFF; border-color: #7C4DFF; color: #FFFFFF; }
.nm-pk-tab-sheets:not(.is-active) { background: #FFF6DB; border-color: #FFC234; }

.nm-pk-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 10px 18px 4px;
}
.nm-pk-filters[hidden] { display: none; }
.nm-pk-chipgroup { display: flex; flex-wrap: wrap; gap: 6px; }
.nm-pk-chip {
  appearance: none;
  min-height: 36px;
  padding: 5px 13px;
  border: 1.5px solid #D9CFFF;
  border-radius: 999px;
  background: #FFFFFF;
  color: #3B2378;
  font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.nm-pk-chip.is-active { background: #EFE9FF; border-color: #7C4DFF; color: #4A22C8; }
.nm-pk-search {
  flex: 1 1 160px;
  min-width: 140px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1.5px solid #D9CFFF;
  border-radius: 999px;
  font: inherit; font-size: 14px;
}
.nm-pk-help { margin: 6px 18px 0; font-size: 13px; color: #5C5772; }

.nm-pk-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 18px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}
.nm-pk-sticker, .nm-pk-sheet {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 8px;
  border: 2px solid #EEE8FF;
  border-radius: 14px;
  background: #FBF9FF;
  color: #1A1826;
  font: inherit;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.nm-pk-sticker:hover, .nm-pk-sheet:hover { border-color: #7C4DFF; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(36, 23, 68, .12); }
.nm-pk-sticker:active { transform: scale(.97); }
.nm-pk-sticker[aria-busy="true"] { opacity: .6; cursor: progress; }
.nm-pk-sticker.is-added { border-color: #30B866; background: #EAFBF0; }
.nm-pk-sticker img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  background: repeating-conic-gradient(#F4F0FF 0% 25%, #FFFFFF 0% 50%) 50% / 14px 14px;
  border-radius: 10px;
}
.nm-pk-sticker-name { font-size: 12.5px; font-weight: 700; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.nm-pk-sheet { grid-column: span 1; }
.nm-pk-sheet-cv { width: 100%; max-width: 120px; height: auto; aspect-ratio: 4 / 7; border-radius: 8px; border: 1px solid #E4DCFF; background: #FAF8FF; }
.nm-pk-sheet-use { font-size: 12px; font-weight: 800; color: #7C4DFF; }
.nm-pk-msg { grid-column: 1 / -1; margin: 18px 4px; color: #5C5772; font-size: 15px; line-height: 1.5; text-align: center; }
.nm-pk-msg.is-error { color: #B01532; }
.nm-pk-sheets-intro { margin: 0 4px 4px; text-align: left; font-size: 13px; }
.nm-pk-morewrap { grid-column: 1 / -1; text-align: center; padding: 6px 0; }

.nm-pk-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #E4DCFF;
  background: #FBF9FF;
}
.nm-pk-mini { width: 32px; height: 56px; border: 1px solid #D9CFFF; border-radius: 4px; background: #FAF8FF; flex: 0 0 auto; }
.nm-pk-foot-mid { flex: 1 1 auto; min-width: 0; }
.nm-pk-count { font-size: 14px; font-weight: 800; }
.nm-pk-toast { min-height: 18px; font-size: 12.5px; font-weight: 700; color: #1B6B3A; }
.nm-pk-toast.is-error { color: #B01532; }
.nm-pk-done { flex: 0 0 auto; min-height: 44px; }

@media (max-width: 640px) {
  .nm-pk { align-items: flex-end; }
  .nm-pk-panel { width: 100vw; height: 94vh; height: 94dvh; border-radius: 22px 22px 0 0; }
  .nm-pk-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 10px 12px 12px; }
  .nm-pk-tabs, .nm-pk-filters, .nm-pk-head, .nm-pk-foot { padding-left: 12px; padding-right: 12px; }
  .nm-pk-help { margin-left: 12px; margin-right: 12px; font-size: 12.5px; }
  .nm-pk-done { padding-left: 14px; padding-right: 14px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .nm-pk-tile, .nm-pk-sticker, .nm-pk-sheet { transition: none; }
}
