/* Floating Preview Toolbar (Desktop) + Mobile Bottom Dock & Slide-Up Drawer */
body.has-preview-bar {
  padding-bottom: 92px;
}

.kpb-bar {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: calc(100vw - 20px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(19, 17, 26, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f8f7fc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
}

.kpb-bar.is-collapsed {
  padding: 6px 12px;
}

.kpb-bar.is-collapsed .kpb-hide-collapsed {
  display: none;
}

.kpb-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.kpb-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.18);
}

.kpb-link {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.kpb-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.kpb-select {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.kpb-select option {
  background: #1a1625;
  color: #ffffff;
}

.kpb-nav-arrow {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.kpb-nav-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
}

.kpb-admin-link {
  background: rgba(168, 85, 247, 0.24);
  color: #f3e8ff;
  border: 1px solid rgba(192, 132, 252, 0.4);
}

.kpb-admin-link:hover {
  background: rgba(168, 85, 247, 0.42);
}

.kpb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ec4899;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  margin-left: 4px;
}

.kpb-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.58);
  margin-right: 2px;
  white-space: nowrap;
}

.kpb-color-name {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  margin-left: 3px;
  white-space: nowrap;
}

.kpb-swatches {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.kpb-swatch-gap {
  width: 3px;
}

.kpb-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s;
}

.kpb-swatch:hover {
  transform: scale(1.18);
}

.kpb-swatch.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
  transform: scale(1.15);
}

/* 15 Swatch Colors */
.kpb-swatch-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.kpb-triad {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.kpb-triad i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* 15 Flat Swatch Colors */
.kpb-c-purple, .kpb-swatch[data-theme-btn="purple"] { background: #5b21b6; }
.kpb-c-lavender, .kpb-swatch[data-theme-btn="lavender"] { background: #7e22ce; }
.kpb-c-periwinkle, .kpb-swatch[data-theme-btn="periwinkle"] { background: #4338ca; }

.kpb-c-pink, .kpb-swatch[data-theme-btn="pink"] { background: #db2777; }
.kpb-c-magenta, .kpb-swatch[data-theme-btn="magenta"] { background: #a21caf; }
.kpb-c-blush, .kpb-swatch[data-theme-btn="blush"] { background: #be4b78; }

.kpb-c-blue, .kpb-swatch[data-theme-btn="blue"] { background: #2563eb; }
.kpb-c-navy, .kpb-swatch[data-theme-btn="navy"] { background: #1e3a8a; }
.kpb-c-sky, .kpb-swatch[data-theme-btn="sky"] { background: #0369a1; }

.kpb-c-red, .kpb-swatch[data-theme-btn="red"] { background: #dc2626; }
.kpb-c-burgundy, .kpb-swatch[data-theme-btn="burgundy"] { background: #881337; }
.kpb-c-coral, .kpb-swatch[data-theme-btn="coral"] { background: #e05344; }

.kpb-c-gold, .kpb-swatch[data-theme-btn="gold"] { background: #b48213; }
.kpb-c-honey, .kpb-swatch[data-theme-btn="honey"] { background: #d97706; }
.kpb-c-sunshine, .kpb-swatch[data-theme-btn="sunshine"] { background: #eab308; }

.kpb-pill-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #f8f7fc;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.kpb-pill-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.kpb-pill-btn.is-active {
  background: #ffffff;
  color: #16131f;
  border-color: #ffffff;
}

.kpb-fav-btn.is-favorited {
  background: #f59e0b;
  color: #16131f;
  border-color: #f59e0b;
}

/* Mobile Dock & Slide-Up Customizer Sheet */
.kpb-mobile-dock {
  display: none;
}

.kpb-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 16, 0.62);
  backdrop-filter: blur(4px);
  z-index: 10001;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.kpb-sheet-backdrop.is-open {
  display: flex;
}

.kpb-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: #171421;
  color: #f8f7fc;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 -18px 46px rgba(0, 0, 0, 0.45);
}

.kpb-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.kpb-sheet-sec {
  margin-bottom: 18px;
}

.kpb-sheet-sec-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.kpb-sheet-colors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kpb-sheet-color-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f8f7fc;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.kpb-sheet-color-btn.is-active {
  background: #ffffff;
  color: #16131f;
  border-color: #ffffff;
}

.kpb-sheet-fonts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kpb-sheet-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kpb-sheet-btn {
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f8f7fc;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.kpb-sheet-btn.is-active {
  background: #ffffff;
  color: #16131f;
  border-color: #ffffff;
}

.kpb-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #16131f;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 9px 16px;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  z-index: 10002;
  max-width: calc(100vw - 32px);
  text-align: center;
  transition: opacity 0.2s, transform 0.2s;
}

.kpb-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Clean face framing when casual photo is selected */
img[data-karol-photo="primary"].is-casual-crop {
  object-position: center 12% !important;
  transform: scale(1.22);
  transform-origin: center 14%;
}

@media (max-width: 960px) {
  .kpb-bar {
    display: none;
  }
  .kpb-mobile-dock {
    position: fixed;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: calc(100vw - 20px);
    max-width: 500px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(19, 17, 26, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #f8f7fc;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12.5px;
  }
  .kpb-style-trigger {
    flex: 1;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.11);
    color: #ffffff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    padding: 0 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.has-preview-bar {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
}
