/* The range's layout mechanics only: where the sheet sits, how it slides and swipes, the wall view filling the
   screen. Fonts, colours, sizes and corners are the app's: restyle any of it. */
.range[hidden],
.range [hidden] {
  display: none !important;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  cursor: pointer;
}
.range-row-pictures {
  display: flex;
  gap: 0.25rem;
}
.range-row-picture {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.range-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  overscroll-behavior: contain;
  background: var(--range-backdrop, rgb(0 0 0 / 0.4));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.range-dialog:not([open]) {
  display: none;
}
.range-dialog::backdrop {
  background: none;
}
.range-dialog[data-state='open'] {
  opacity: 1;
}

.range-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 40rem;
  max-height: 92dvh;
  background: var(--range-sheet, Canvas);
  color: CanvasText;
  transform: translateY(100%);
  /* a spring's settle: quick out, a hair past, back */
  transition: transform 0.38s cubic-bezier(0.22, 1.2, 0.36, 1);
}
.range-dialog[data-state='open'] .range-sheet {
  transform: none;
}
.range-dialog[data-state='closing'] .range-sheet {
  transition-timing-function: cubic-bezier(0.5, 0, 0.75, 0);
  transition-duration: 0.22s;
}

.range-head {
  /* the sheet's handle: a pull down here is the sheet's (range.js), not the browser's */
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.range-grip {
  position: absolute;
  top: 0.4rem;
  left: 50%;
  translate: -50% 0;
  width: 2.5rem;
  height: 0.25rem;
  border-radius: 1rem;
  background: currentColor;
  opacity: 0.3;
}

.range-track {
  display: flex;
  gap: 0.75rem;
  /* a card taller than the room left scrolls down to its buttons */
  overflow: auto;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1rem;
  padding-inline: 1rem;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}
.range-card {
  flex: 0 0 82%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.range-picture {
  height: min(40dvh, 22rem);
  display: flex;
}
.range-picture-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.range-add,
.range-place,
.range-close,
.range-previous,
.range-next,
.range-back,
.range-take,
.range-pick,
.range-another {
  min-height: 44px;
  cursor: pointer;
}
.range-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.range-add[aria-disabled='true'] {
  cursor: default;
}
.range-check {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.range-steps {
  display: none;
  justify-content: space-between;
}
@media (hover: hover) and (pointer: fine) {
  .range-steps {
    display: flex;
  }
}

.range-wall {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--range-wall, Canvas);
  color: CanvasText;
}
.range-wall-head,
.range-wall-picks,
.range-wall-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.range-wall-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.range-wall-view {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.range-wall-size {
  position: absolute;
  width: 44px;
  height: 44px;
  translate: -50% -50%;
  touch-action: none;
  cursor: nwse-resize;
}
@media (pointer: coarse) {
  .range-wall-size {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .range-dialog,
  .range-sheet,
  .range-dialog[data-state='closing'] .range-sheet {
    transition-duration: 0.01s;
  }
}
