[data-direction-wheel] > :is(.mol-select, select[data-global-support]),
.direction-wheel-trigger[hidden] {
  display: none !important;
}

html.direction-wheel-open {
  overflow: hidden;
  overscroll-behavior: none;
}

dialog.direction-wheel {
  --direction-wheel-row: 52px;
  --direction-wheel-rail: clamp(52px, calc(var(--direction-wheel-visible, 100dvh) - 92px), 260px);
  position: fixed;
  inset: auto 0 calc(var(--direction-wheel-bottom, 0px) + max(8px, env(safe-area-inset-bottom)));
  box-sizing: border-box;
  width: min(440px, calc(100% - 16px));
  max-width: none;
  max-height: calc(var(--direction-wheel-visible, 100dvh) - max(8px, env(safe-area-inset-bottom)) - 8px);
  margin: 0 auto;
  padding: 6px 12px 12px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #c3cebb;
  border-radius: 18px;
  background: #fcfbf6;
  color: #153d31;
  font: 400 16px/1.3 system-ui, sans-serif;
  box-shadow: 0 16px 50px #0e261d44;
}

dialog.direction-wheel[open] {
  display: block;
  animation: direction-wheel-in 180ms ease-out both;
}

dialog.direction-wheel::backdrop {
  background: rgb(16 35 28 / 35%);
  animation: direction-wheel-backdrop 150ms ease-out both;
}

.direction-wheel__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  border-bottom: 1px solid #dce1d4;
}

.direction-wheel .direction-wheel__bar h2 {
  margin: 0;
  color: inherit;
  font: 650 16px/1.2 system-ui, sans-serif;
  text-align: center;
}

.direction-wheel__bar button {
  min-height: 44px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #245d45;
  font: 500 15px/1.2 system-ui, sans-serif;
  cursor: pointer;
}

.direction-wheel__bar .direction-wheel__cancel {
  justify-self: start;
}

.direction-wheel__bar .direction-wheel__done {
  justify-self: end;
  font-weight: 700;
}

.direction-wheel__drum {
  position: relative;
  height: var(--direction-wheel-rail);
  margin-top: 4px;
  isolation: isolate;
}

.direction-wheel__drum::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 0;
  left: 0;
  height: var(--direction-wheel-row);
  box-sizing: border-box;
  border-block: 1px solid #c4d1bb;
  border-radius: 9px;
  background: #e6eddf;
  transform: translateY(-50%);
  content: "";
}

.direction-wheel__rail {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
}

.direction-wheel__rail::-webkit-scrollbar {
  display: none;
}

.direction-wheel__track {
  padding-block: calc((var(--direction-wheel-rail) - var(--direction-wheel-row)) / 2);
}

.direction-wheel__row {
  display: grid;
  box-sizing: border-box;
  place-items: center;
  min-width: 0;
  height: var(--direction-wheel-row);
  padding: 4px 8px;
  scroll-snap-align: center;
  text-align: center;
  cursor: pointer;
}

.direction-wheel__row span {
  display: block;
  max-width: 100%;
  backface-visibility: hidden;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.direction-wheel__row[aria-selected="true"] span {
  font-weight: 650;
}

.direction-wheel :is(button, .direction-wheel__rail):focus-visible {
  outline: 2px solid #507c62;
  outline-offset: -2px;
}

@keyframes direction-wheel-in {
  from { opacity: 0; transform: translateY(16px); }
}

@keyframes direction-wheel-backdrop {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  dialog.direction-wheel[open],
  dialog.direction-wheel::backdrop {
    animation: none;
  }

  .direction-wheel__row span {
    transform: none !important;
    opacity: 1 !important;
  }
}
