/* ───────────────────────────────────────────── */
/* Popover (pill-shaped) container              */
/* ───────────────────────────────────────────── */
#filter-popover {
  position: fixed;
  display: none;
  overflow: hidden;   /* allow ghosts to show below */
  flex-direction: row;
  align-items: center;
  padding: 8px;
  background: rgba(34,34,34,0.95);
  border-radius: 25px;
  border: 1px solid #555;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 10000;
}

/* ───────────────────────────────────────────── */
/* Chip wrapper holds a fixed ghost + moving btn */
/* ───────────────────────────────────────────── */
#filter-popover .chip-wrapper {
  position: relative;
  width: 35px;
  height: 35px;
  margin: 0 4px;
}

/* the “ghost” circle, always at top:0 */
#filter-popover .chip-wrapper .ghost {
  position: absolute;
  top: 0; left: 0px;
  width: 35px;
  height: 35px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 0;
}

/* show the ghost when wrapper.off is there */
#filter-popover .chip-wrapper.off .ghost {
  opacity: 1;
}

/* ───────────────────────────────────────────── */
/* Category chips: solid-color circles           */
/* ───────────────────────────────────────────── */
#filter-popover .chip-wrapper .filter-chip {
  position: absolute;
  top: 0; left: 0;
  width: 35px; height: 35px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: top 150ms ease, filter 150ms ease;
  z-index: 1;
  will-change: top;
}

/* your brand colors */
#filter-popover #chip-portraits,
.custom-toolbar #chip-portraits {
  background: #54c7e0;
}

#filter-popover #chip-references,
.custom-toolbar #chip-references {
  background: #e2d25e;
}

#filter-popover #chip-symbols,
.custom-toolbar #chip-symbols {
  background: #d186a8;
}


/* hover lifts */
#filter-popover .chip-wrapper .filter-chip:not(.filter-switch):hover {
  top: -4px;
  transition-delay: 0s;
}

/* On hover-out, delay the drop slightly */
#filter-popover .chip-wrapper .filter-chip:not(:hover) {
  transition-delay: 150ms;  /* You can tweak this to taste */
}

/* off-click drops and dims */
#filter-popover .chip-wrapper.off .filter-chip:not(.filter-switch) {
  top: 20px;
  filter: brightness(0.7);
}

.chip-wrapper.off .filter-chip {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}


/* ───────────────────────────────────────────── */
/* Filter-switch (no wrapper)                   */
/* ───────────────────────────────────────────── */
#filter-popover .filter-switch {
  position: relative;
  width: 35px; height: 35px;
  margin: 0 4px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 150ms ease;
  z-index: 1;
}

/* RGB gradient */
#filter-popover .filter-switch::before {
  content: "";
  position: absolute; top:0; left:0;
  width:100%; height:100%;
  border-radius:50%;
  background: linear-gradient(90deg, red, green, blue);
  z-index: 1;
  transition: transform 150ms ease, filter 150ms ease;
}

/* Grayscale gradient */
#filter-popover .filter-switch::after {
  content: "";
  position: absolute; top:0; left:0;
  width:100%; height:100%;
  border-radius:50%;
  background: linear-gradient(90deg, #000, #888, #fff);
  z-index: 2;
  transition: transform 150ms ease, filter 150ms ease;
}

/* when off, slide the B&W layer */
#filter-popover .filter-switch.off::after {
  transform: translateY(20px);
  filter: brightness(0.7);
}

/* ───────────────────────────────────────────── */
/* Chip tooltip                                  */
/* ───────────────────────────────────────────── */
#chip-tooltip {
  /* font-family: "Helvetica", "Arial", ui-sans-serif, sans-serif; */
  position: fixed !important;
  transform: none !important;
  width: 25vw;
  max-width: max-content;
  z-index:   20000;
  opacity:   0;
  transition: opacity 150ms ease;
}
#chip-tooltip.visible {
  opacity: 1 !important;
}

/* ───────────────────────────────────────────── */
/* Inline demo pop-over (instructions page)      */
/* ───────────────────────────────────────────── */
.instruction_image {
  position: relative;
}
.instruction_image .filter-popover.inline {
  opacity: 0;
  display: flex;
  transition: opacity 150ms ease;
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
  align-items: center;
  padding: 8px;
  background: rgba(34,34,34,0.95);
  border-radius: 25px;
  border: 1px solid #555;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 10;
  overflow: visible;
}
.instruction_image:hover .filter-popover.inline,
.instruction_image .filter-popover.inline:hover {
  opacity: 1;
}
.instruction_image .chip-wrapper {
  position: relative;
  width: 35px; height: 35px;
  margin: 0 4px;
}
.instruction_image .ghost {
  position: absolute;
  top: 0; left: 0;
  width: 35px; height: 35px;
  border: 2px dotted rgba(255,255,255,0.7);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.instruction_image .filter-chip {
  position: absolute;
  top: 0; left: 0;
  width: 35px; height: 35px;
  border: none; border-radius: 50%;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}
.instruction_image .chip-wrapper .filter-chip:hover {
  transform: translateY(-4px);
}
.instruction_image .chip-wrapper.off .filter-chip {
  transform: translateY(20px);
  filter: brightness(0.7);
}
.instruction_image .chip-wrapper.off .ghost {
  opacity: 1;
}
.instruction_image .filter-switch {
  position: absolute; top:0; left:0;
  width: 35px; height: 35px;
  border-radius: 50%;
  overflow: hidden;
}
.instruction_image .filter-switch {
  background: linear-gradient(90deg, red, green, blue);
}
.instruction_image .filter-switch::after {
  content: "";
  position: absolute; top:0; left:0;
  width:100%; height:100%;
  background: linear-gradient(90deg, #000, #888, #fff);
}

/* ───────────────────────────────────────────── */
/* NEW: Disclaimer switch styled as a filter chip */
/* ───────────────────────────────────────────── */
.disclaimer-switch-container .filter-popover.disclaimer-well {
  position: relative;
  display: inline-flex;
  padding: 8px;
  background: rgba(34,34,34,0.95);
  border-radius: 25px;
  border: 1px solid #555;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.disclaimer-switch-container .filter-switch {
  position: relative;
  width: 35px;
  height: 35px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  transition: transform 150ms ease, filter 150ms ease;
}

.disclaimer-switch-container .filter-switch input {
  position: absolute;
  width: 1px; height: 1px;
  margin: 0; padding: 0;
  opacity: 0;
  pointer-events: none;
}

.disclaimer-switch-container .filter-switch .color-layer {
  position: absolute; top:0; left:0;
  width:100%; height:100%;
  border-radius:50%;
  background: linear-gradient(90deg, red, green, blue);
  z-index: 1;
}

.disclaimer-switch-container .filter-switch .bw-layer {
  position: absolute; top:0; left:0;
  width:100%; height:100%;
  border-radius:50%;
  background: linear-gradient(90deg, #000, #888, #fff);
  z-index: 2;
  transition: transform 150ms ease, filter 150ms ease;
}

.disclaimer-switch-container .filter-switch input:not(:checked) ~ .bw-layer {
  transform: translateY(20px);
  filter: brightness(0.7);
}

.disclaimer-switch-container .filter-switch:hover {
  transform: translateY(-4px);
}

.disclaimer-switch-container .filter-switch input:not(:checked) ~ .bw-layer:hover {
  transform: translateY(20px);
}
#filter-popover .chip-wrapper.highlight .filter-chip:not(.filter-switch) {
  transform: translateY(-4px);
}

/* ========== Touch Device Support ========== */

/* Ensure toolbar chips appear inline */
.custom-toolbar .chip-wrapper {
  display: inline-block;
  margin: 0 0.25em;
  vertical-align: middle;
}

/* Maintain styling consistency with popover chips */
.custom-toolbar .filter-chip {
  width: 35px;
  height: 35px;
  top: -5px;
  border-radius: 50%;
  background-color: var(--filter-default-bg, #999);
  border: none;
  position: relative;
}

.custom-toolbar .chip-wrapper[data-state="highlight"] .filter-chip {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7);
}

.custom-toolbar .chip-wrapper[data-state="off"] .filter-chip {
  opacity: 0.3;
}

/* Optional: adjust color filter switch */
.custom-toolbar .filter-switch {
  background: linear-gradient(135deg, #000 50%, #fff 50%);
  border: 1px solid #ccc;
  top: 2px;
  left: 5px;
}

.custom-toolbar .filter-switch.off {
  filter: grayscale(100%);
  opacity: 0.5;
}