/* The number wheel (wheel.js), after the iPhone's pickers: a drum of values behind a grey band, in a sheet from the bottom. */
.wheel-back { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0); transition: background 0.3s ease; }
.wheel-back.in { background: rgba(0, 0, 0, 0.32); }
.wheel-sheet { width: 100%; max-width: 520px; padding: 6px 8px max(16px, env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; background: #f9f9f9; box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.06); transform: translateY(100%); transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1); }
.wheel-back.in .wheel-sheet { transform: none; }
html.wheel-open, html.wheel-open body { overflow: hidden; }

.wheel-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; }
.wheel-head b { max-width: 60vw; overflow: hidden; color: #000; font-size: 15px; font-weight: 600; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.wheel-head button { padding: 10px 8px; color: var(--brand); font-size: 17px; }
.wheel-cancel { justify-self: start; }
.wheel-done { justify-self: end; font-weight: 600; }
.wheel-live { min-height: 20px; color: var(--muted); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.wheel-live b { font-weight: 600; }

.wheel-drum { position: relative; margin: 6px 0 2px; overflow: hidden; perspective: 900px; }
.wheel-band { position: absolute; top: 50%; right: 8px; left: 8px; transform: translateY(-50%); border-radius: 8px; background: rgba(118, 118, 128, 0.12); pointer-events: none; }
.wheel-scroll { position: relative; height: 100%; overflow-y: scroll; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; outline: none; transform-style: preserve-3d; }
.wheel-scroll::-webkit-scrollbar { display: none; }
.wheel-row { display: flex; align-items: center; justify-content: center; scroll-snap-align: center; color: #000; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; backface-visibility: hidden; cursor: default; user-select: none; -webkit-user-select: none; }
.wheel-row.on { font-weight: 500; }
.wheel-unit { position: absolute; top: 50%; left: calc(50% + 44px); transform: translateY(-50%); color: #000; font-size: 17px; font-weight: 500; pointer-events: none; }
/* Top and bottom fade into the sheet, as on the iPhone */
.wheel-drum::before, .wheel-drum::after { content: ''; position: absolute; right: 0; left: 0; z-index: 1; height: 36%; pointer-events: none; }
.wheel-drum::before { top: 0; background: linear-gradient(#f9f9f9, rgba(249, 249, 249, 0)); }
.wheel-drum::after { bottom: 0; background: linear-gradient(rgba(249, 249, 249, 0), #f9f9f9); }
.wheel-type { display: block; margin: 4px auto 0; padding: 10px 12px; color: var(--brand); font-size: 15px; }
.wheel-tick { position: fixed; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* On the page: the value as a grey pill, like the time in an iPhone alarm, and the whole row opens the wheel */
.wheel-pill { flex: none; min-width: 64px; padding: 6px 12px; border-radius: 8px; background: rgba(118, 118, 128, 0.12); color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; text-align: center; }
.wheel-pill:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wheel-on { cursor: pointer; }
.wheel-on .money-input, .wheel-on input[type=range], .wheel-on output { display: none; }
.calc-slider.wheel-on .calc-top { align-items: center; }
.wheel-live .gain { color: var(--success-ink); }
.wheel-live .loss { color: var(--danger); }
