.sf-lab {
  position: fixed;
  top: 128px;
  right: 20px;
  z-index: 1400;
  width: 320px;
  max-width: calc(100vw - 24px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.sf-lab[hidden] { display: none !important; }

.sf-lab.is-collapsed {
  width: auto;
}

.sf-lab-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  padding: 0;
  cursor: grab;
  color: #fff;
  background: #1a1a1a;
  border-radius: 999px !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  font: 500 15px/1 "Playfair Display", Georgia, serif;
  letter-spacing: -0.02em;
  touch-action: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.sf-lab-fab:focus,
.sf-lab-fab:focus-visible {
  outline: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.sf-lab-fab:active,
.sf-lab.is-dragging .sf-lab-fab { cursor: grabbing; }

.sf-lab.is-open .sf-lab-fab {
  display: none;
}

.sf-lab-panel {
  display: none;
  overflow: hidden;
  background: rgba(255, 252, 248, 0.92);
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 22px !important;
  box-shadow: 0 18px 50px rgba(20, 12, 8, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sf-lab.is-open .sf-lab-panel {
  display: flex;
  flex-direction: column;
  max-height: min(72vh, 640px);
}

.sf-lab-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px 16px;
  cursor: grab;
  touch-action: none;
}

.sf-lab-head:active { cursor: grabbing; }

.sf-lab-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sf-lab-icon {
  width: 30px;
  height: 30px;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #1a1a1a;
  cursor: pointer;
  border-radius: 999px !important;
  opacity: 0.72;
}

.sf-lab-icon:hover { opacity: 1; background: rgba(26, 26, 26, 0.06); }
.sf-lab-icon:disabled { opacity: 0.28; cursor: default; background: transparent; }
.sf-lab-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.sf-lab-save {
  height: 28px;
  padding: 0 10px;
  border: 0;
  background: #1a1a1a;
  color: #fff;
  font: 600 10px/1 Inter, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 999px !important;
}

.sf-lab-save[disabled] {
  background: rgba(26, 26, 26, 0.1);
  color: rgba(26, 26, 26, 0.4);
  cursor: default;
}

.sf-lab-home {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 14px;
}

.sf-lab[data-view="home"] .sf-lab-home { display: flex; }
.sf-lab[data-view="home"] .sf-lab-fonts,
.sf-lab[data-view="home"] .sf-lab-colors,
.sf-lab[data-view="home"] .sf-lab-hero,
.sf-lab[data-view="home"] .sf-lab-banner { display: none; }
.sf-lab[data-view="home"] [data-act="back"] { display: none !important; }
.sf-lab[data-view="fonts"] .sf-lab-home,
.sf-lab[data-view="fonts"] .sf-lab-colors,
.sf-lab[data-view="fonts"] .sf-lab-hero,
.sf-lab[data-view="fonts"] .sf-lab-banner { display: none; }
.sf-lab[data-view="fonts"] .sf-lab-fonts {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.sf-lab[data-view="colors"] .sf-lab-home,
.sf-lab[data-view="colors"] .sf-lab-fonts,
.sf-lab[data-view="colors"] .sf-lab-hero,
.sf-lab[data-view="colors"] .sf-lab-banner { display: none; }
.sf-lab[data-view="colors"] .sf-lab-colors { display: flex; }
.sf-lab[data-view="hero"] .sf-lab-home,
.sf-lab[data-view="hero"] .sf-lab-fonts,
.sf-lab[data-view="hero"] .sf-lab-colors,
.sf-lab[data-view="hero"] .sf-lab-banner { display: none; }
.sf-lab[data-view="hero"] .sf-lab-hero { display: flex; }
.sf-lab[data-view="banner"] .sf-lab-home,
.sf-lab[data-view="banner"] .sf-lab-fonts,
.sf-lab[data-view="banner"] .sf-lab-colors,
.sf-lab[data-view="banner"] .sf-lab-hero { display: none; }
.sf-lab[data-view="banner"] .sf-lab-banner { display: flex; }

.sf-lab-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  padding: 12px 12px;
  text-align: left;
  background: #fff;
  cursor: pointer;
  border-radius: 14px !important;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
}

.sf-lab-row:hover { background: #faf8f5; }

.sf-lab-row-text { flex: 1; min-width: 0; }

.sf-lab-row-k {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.sf-lab-row-v {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-lab-row-go {
  flex-shrink: 0;
  opacity: 0.28;
}

.sf-lab-swatches {
  display: flex;
  gap: 5px;
  margin-top: 7px;
}

.sf-lab-swatches i {
  display: block;
  width: 12px;
  height: 12px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.sf-lab-colors {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 14px;
}

.sf-lab-hero,
.sf-lab-banner {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 14px;
  overflow: auto;
}

.sf-lab-looks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.sf-lab-look {
  height: 34px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--look-bg, #821332);
  color: var(--look-fg, #fff8f0);
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.1);
  font: 600 9px/1 Inter, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sf-lab-look.is-on {
  box-shadow: inset 0 0 0 1.5px #1a1a1a;
}

.sf-lab-tint-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.38;
  padding-top: 4px;
}

.sf-lab-area {
  display: block;
  width: 100%;
  min-height: 68px;
  resize: none;
  border: 0;
  padding: 12px 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
  font: 500 13px/1.4 Inter, sans-serif;
  color: #1a1a1a;
  outline: none;
}

.sf-lab-area:focus {
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.22);
}

.sf-lab-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
}

.sf-lab-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.38;
}

.sf-lab-hero > .sf-lab-kicker {
  padding: 2px 4px 0;
}

.sf-lab-tint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
  cursor: pointer;
}

.sf-lab-block .sf-lab-tint {
  padding: 0;
  box-shadow: none;
}

.sf-lab-tint-hex {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  opacity: 0.45;
}

.sf-lab-tint input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sf-lab-tint input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.sf-lab-tint input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.sf-lab-tint input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.sf-lab-slide {
  display: grid;
  gap: 4px;
}

.sf-lab-slide-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.62;
}

.sf-lab-slide input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #1a1a1a;
  cursor: pointer;
}

.sf-lab-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sf-lab-seg-btn {
  height: 34px;
  border: 0;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
  font: 600 12px/1 Inter, sans-serif;
  color: rgba(26, 26, 26, 0.42);
  cursor: pointer;
}

.sf-lab-seg-btn.is-on {
  color: #1a1a1a;
  box-shadow: inset 0 0 0 1px #1a1a1a;
}

.sf-lab-color {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
  cursor: pointer;
}

.sf-lab-color.is-on {
  box-shadow: inset 0 0 0 1.5px #1a1a1a;
}

.sf-lab-color-text { flex: 1; min-width: 0; }

.sf-lab-color-k {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.sf-lab-color-hex {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  opacity: 0.45;
}

.sf-lab-color input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sf-lab-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.sf-lab-color input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.sf-lab-color input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.sf-lab-palette {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 4px 2px;
}

.sf-lab-palette-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sf-lab-chip {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: #ccc;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.sf-lab-chip.is-confirm::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.42);
}

.sf-lab-chip-x {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 1;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  color: #fff;
  font: 700 11px/1 Inter, sans-serif;
  opacity: 0;
  pointer-events: none;
}

.sf-lab-chip:hover .sf-lab-chip-x,
.sf-lab-chip.is-confirm .sf-lab-chip-x {
  opacity: 1;
  pointer-events: auto;
}

.sf-lab-chip.is-confirm .sf-lab-chip-x {
  background: #fff;
  color: #1a1a1a;
}

.sf-lab-palette-add {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: rgba(26, 26, 26, 0.06);
  color: #1a1a1a;
  font: 500 22px/40px Inter, sans-serif;
  cursor: pointer;
}

@media (hover: none) {
  .sf-lab-chip-x {
    opacity: 0.85;
    pointer-events: auto;
  }
}

.sf-lab-fonts { display: none; }

.sf-lab-roles {
  display: flex;
  gap: 6px;
  padding: 0 12px 12px;
}

.sf-lab-role {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 10px 8px 8px;
  text-align: left;
  background: #fff;
  cursor: pointer;
  border-radius: 14px !important;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
}

.sf-lab-role.is-on {
  box-shadow: inset 0 0 0 1.5px #1a1a1a;
}

.sf-lab-role-k {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.45;
  margin-bottom: 4px;
}

.sf-lab-role-v {
  display: block;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-lab-search {
  margin: 0 12px 8px;
  height: 36px;
  width: calc(100% - 24px);
  border: 0;
  padding: 0 12px;
  background: rgba(26, 26, 26, 0.05);
  font: 400 13px/1 Inter, sans-serif;
  color: #1a1a1a;
  outline: none;
  border-radius: 12px !important;
}

.sf-lab-search::placeholder { color: rgba(26, 26, 26, 0.38); }

.sf-lab-list {
  flex: 1;
  overflow: auto;
  padding: 0 8px 10px;
  -webkit-overflow-scrolling: touch;
}

.sf-lab-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  padding: 9px 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 10px !important;
}

.sf-lab-item:hover,
.sf-lab-item.is-on {
  background: rgba(26, 26, 26, 0.05);
}

.sf-lab-item-name {
  font-size: 15px;
  line-height: 1.2;
}

.sf-lab-item-cat {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.38;
}

.sf-lab-empty {
  padding: 22px 12px;
  text-align: center;
  font-size: 12px;
  opacity: 0.45;
}

@media (max-width: 720px) {
  .sf-lab {
    top: auto;
    right: 14px;
    bottom: 92px;
  }
}

/* Beat the storefront-wide `border-radius: 0 !important` reset. */
#sf-lab .sf-lab-panel { border-radius: 22px !important; }
#sf-lab .sf-lab-fab,
#sf-lab .sf-lab-icon,
#sf-lab .sf-lab-save { border-radius: 999px !important; }
#sf-lab .sf-lab-role,
#sf-lab .sf-lab-row,
#sf-lab .sf-lab-color,
#sf-lab .sf-lab-area,
#sf-lab .sf-lab-block,
#sf-lab .sf-lab-tint { border-radius: 14px !important; }
#sf-lab .sf-lab-tint input[type="color"],
#sf-lab .sf-lab-tint input[type="color"]::-webkit-color-swatch,
#sf-lab .sf-lab-tint input[type="color"]::-moz-color-swatch {
  border-radius: 10px !important;
}
#sf-lab .sf-lab-seg-btn { border-radius: 12px !important; }
#sf-lab .sf-lab-search { border-radius: 12px !important; }
#sf-lab .sf-lab-item { border-radius: 10px !important; }
#sf-lab .sf-lab-swatches i,
#sf-lab .sf-lab-chip-x { border-radius: 999px !important; }
#sf-lab .sf-lab-chip,
#sf-lab .sf-lab-palette-add { border-radius: 4px !important; }
#sf-lab .sf-lab-color input[type="color"],
#sf-lab .sf-lab-color input[type="color"]::-webkit-color-swatch,
#sf-lab .sf-lab-color input[type="color"]::-moz-color-swatch {
  border-radius: 10px !important;
}
