/* Preview-only: reserve a band ABOVE the flavor picker for the
   ?v-picker dropdown so it never covers the wheel or the current list.
   The visible control is a button + listbox; a visually hidden <select>
   stays in the DOM for Build Your Box scripts that set #flavorWheelSelect. */

#flavorWheelSwitcher {
  position: relative;
  width: 100%;
  min-height: 48px;
  margin: 0 0 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  /* Above the sticky mini top bar (z-index 1000) and the floating
     preview pills (~1001) so neither can cover or steal this control. */
  z-index: 1100;
  pointer-events: auto;
  isolation: isolate;
  scroll-margin-top: 96px;
}

#flavorWheelSwitcher:empty { min-height: 0; margin: 0; }

#flavorWheelSwitcher .fw-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  position: relative;
  z-index: 40;
  pointer-events: auto;
  font: 600 .72rem/1.2 'DM Sans', sans-serif;
  color: #7a6a5e;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

#flavorWheelSwitcher .fw-pick-cap {
  white-space: nowrap;
}

/* Keep #flavorWheelSelect for bybox setPicker(); hide it from view and hit-testing. */
#flavorWheelSwitcher .fw-native,
#flavorWheelSwitcher #flavorWheelSelect.fw-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  appearance: none !important;
  opacity: 0 !important;
}

#flavorWheelSwitcher .fw-trigger {
  appearance: none;
  -webkit-appearance: none;
  font: 600 .78rem/1.2 'DM Sans', sans-serif;
  color: var(--plum, #4a1942);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a1942' d='M1.2 1.4L6 6.2l4.8-4.8'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid #eadfd1;
  border-radius: 999px;
  padding: 8px 36px 8px 16px;
  min-height: 44px;
  min-width: min(280px, 100%);
  max-width: min(520px, calc(100vw - 24px));
  text-align: left;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 41;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#flavorWheelSwitcher .fw-pick.is-open .fw-trigger {
  box-shadow: 0 0 0 3px rgba(74, 25, 66, .12);
}

#flavorWheelSwitcher .fw-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  box-sizing: border-box;
  min-width: min(320px, 100%);
  width: max-content;
  max-width: min(520px, calc(100vw - 24px));
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #eadfd1;
  border-radius: 16px;
  box-shadow: 0 16px 40px -16px rgba(45, 25, 40, .45);
}

#flavorWheelSwitcher .fw-menu[hidden] { display: none !important; }

#flavorWheelSwitcher .fw-menu [role="option"] {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: 600 .82rem/1.3 'DM Sans', sans-serif;
  color: var(--plum, #4a1942);
  touch-action: manipulation;
}

#flavorWheelSwitcher .fw-menu [role="option"]:hover,
#flavorWheelSwitcher .fw-menu [role="option"]:focus {
  background: #f7eee4;
  outline: none;
}

#flavorWheelSwitcher .fw-menu [role="option"][aria-selected="true"] {
  background: #f3e6d4;
}

#flavorWheelMount {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

#flavorWheelMount[hidden],
#flavorWheelOpus[hidden],
#flavorWheelSol[hidden] {
  display: none !important;
}

/* When a wheel variant is on, hide the current button list visually but keep
   it in the DOM so autoFillFlavor, flavor data, art, and count badges still work. */
html:not([data-v-picker="0"]) #boxBuilder .flavor-picker > #flavorButtons,
html:not([data-v-picker="0"]) #classicBuilderPanel .flavor-picker > #flavorButtons {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}

html:not([data-v-picker="0"]) #boxBuilder .flavor-picker > .picker-label,
html:not([data-v-picker="0"]) #classicBuilderPanel .flavor-picker > .picker-label {
  display: none;
}

@media (max-width: 479.98px) {
  #flavorWheelSwitcher { min-height: 56px; margin-bottom: 14px; }
  #flavorWheelSwitcher .fw-pick { width: 100%; }
  #flavorWheelSwitcher .fw-trigger {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
  }
  #flavorWheelSwitcher .fw-menu {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
  }
}

/* The first fix set pointer-events:none on empty .tb9-mini chrome, but left
   .tb9-cards (a ~960×42 rail) at pointer-events:auto, so any control tucked
   under the cream/navy mini bar still received nav-chip hits instead of
   clicks. Refinements 11–16 use .tbr-mini, which was never given the pass-
   through at all. Clip the bar so its box-shadow / will-change layer cannot
   eat Safari taps in the fade just below it, and only real controls (logo,
   each chip, Order, day board) keep pointer-events. */
.tb9-mini,
.tb9-mini .tb9-in,
.tbr-mini,
.tbr-mini .tbr-in {
  pointer-events: none;
  overflow: hidden;
}
html.tb9-stuck .tb9-mini,
html.tbr-stuck .tbr-mini {
  will-change: auto;
}
.tb9-mini .tb9-cards,
.tbr-mini .tbr-cards {
  pointer-events: none;
}
.tb9-mini a,
.tb9-mini button,
.tb9-mini .tb9-logo,
.tb9-mini .tb9-card,
.tb9-mini .tb9-order,
.tb9-mini .tb9-arrow,
.tb9-mini input,
.tb9-mini select,
.tb9-mini label,
.tbr-mini a,
.tbr-mini button,
.tbr-mini summary,
.tbr-mini .tbr-logo,
.tbr-mini .tbr-card,
.tbr-mini .tbr-ticket,
.tbr-mini .tbr-order,
.tbr-mini .tbr-arrow,
.tbr-mini .tbr-board-btn,
.tbr-mini input,
.tbr-mini select,
.tbr-mini label {
  pointer-events: auto;
}
