:root {
  --bg: #f1f0ec;
  --card: #ffffff;
  --ink: #17181c;
  --soft: rgba(23, 24, 28, 0.55);
  --line: rgba(23, 24, 28, 0.08);
  --accent: #1e9e62;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% 0%, #faf9f6 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 10px;
}

.ab { position: relative; width: min(344px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); padding: 16px 16px 14px; border-radius: 26px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(23, 24, 28, 0.05), 0 30px 50px -32px rgba(23, 24, 28, 0.35); }
.ab__roll { display: block; overflow: hidden; }
.ab__roll > span { display: block; white-space: nowrap; }

.ab__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 24px; }
.ab__title { font-size: 15.500px; font-weight: 720; font-stretch: 104%; letter-spacing: -0.005em; white-space: nowrap; }
/* --chip-bg and --chip-ink are tweened by the script when the test becomes significant */
.ab__chip { --chip-bg: rgba(23, 24, 28, 0.06); --chip-ink: rgba(23, 24, 28, 0.62); height: 24px; padding: 0 10px; border-radius: 12px; background: var(--chip-bg); color: var(--chip-ink); font-size: 11.500px; line-height: 24px; font-weight: 680; }
.ab__meta { margin-top: 3px; font-size: 12px; line-height: 16px; font-weight: 540; color: var(--soft); white-space: nowrap; }

/* one variant: its name and rate, and under them the likely range on a shared scale */
.ab__row { margin-top: 13px; }
.ab__line { display: flex; align-items: center; gap: 8px; height: 24px; }
.ab__key { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: rgba(23, 24, 28, 0.07); font-size: 11.500px; font-weight: 760; }
.ab__name { font-size: 13.500px; font-weight: 640; white-space: nowrap; }
.ab__win { height: 18px; padding: 0 7px; border-radius: 9px; background: var(--accent); color: #ffffff; font-size: 10.500px; line-height: 18px; font-weight: 720; opacity: 0; white-space: nowrap; }
.ab__range { margin-left: auto; font-size: 11px; font-weight: 560; color: rgba(23, 24, 28, 0.42); white-space: nowrap; }
.ab__rate { min-width: 46px; text-align: right; font-size: 18px; font-weight: 760; font-stretch: 98%; letter-spacing: -0.015em; white-space: nowrap; }
.ab__track { position: relative; height: 14px; margin-top: 6px; border-radius: 7px; background: repeating-linear-gradient(90deg, rgba(23, 24, 28, 0.045) 0 1px, transparent 1px 25%), rgba(23, 24, 28, 0.035); overflow: hidden; }
.ab__band { --band: rgba(23, 24, 28, 0.2); position: absolute; left: 0; top: 2px; bottom: 2px; width: 100%; border-radius: 5px; background: var(--band); transform-origin: 0 50%; }
.ab__row--b .ab__band { --band: color-mix(in srgb, var(--accent) 36%, #ffffff); }
.ab__tick { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; margin-left: -1.500px; border-radius: 2px; background: var(--ink); }

.ab__stats { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 8px; margin-top: 14px; }
.ab__stats > div { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; height: 42px; padding: 9px 12px 0; border-radius: 13px; background: rgba(23, 24, 28, 0.04); overflow: hidden; }
.ab__stats dt { font-size: 11.500px; font-weight: 600; color: var(--soft); }
.ab__stats dd { font-size: 15px; font-weight: 760; white-space: nowrap; }
.ab__meter { position: absolute; left: 12px; right: 12px; bottom: 8px; height: 3px; border-radius: 2px; background: rgba(23, 24, 28, 0.08); }
.ab__meterfill { position: absolute; inset: 0; border-radius: 2px; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }
.ab__level { position: absolute; top: -3px; width: 1.500px; height: 9px; margin-left: -0.750px; background: var(--ink); opacity: 0.45; }

/* the day: a real range input, restyled */
.ab__days { display: block; margin-top: 12px; }
.ab__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ab__days input { display: block; width: 100%; height: 24px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: grab; outline: none; touch-action: none; }
.ab__days input:active { cursor: grabbing; }
.ab__days input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--done, 0%), rgba(23, 24, 28, 0.12) var(--done, 0%)); }
.ab__days input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--done, 0%), rgba(23, 24, 28, 0.12) var(--done, 0%)); }
.ab__days input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border: 0; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 1px rgba(23, 24, 28, 0.14), 0 2px 6px rgba(23, 24, 28, 0.22), inset 0 0 0 6px #ffffff, inset 0 0 0 11px var(--ink); }
.ab__days input::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 1px rgba(23, 24, 28, 0.14), 0 2px 6px rgba(23, 24, 28, 0.22), inset 0 0 0 6px #ffffff, inset 0 0 0 11px var(--ink); }
.ab__days input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink), inset 0 0 0 6px #ffffff, inset 0 0 0 11px var(--ink); }
.ab__days input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink), inset 0 0 0 6px #ffffff, inset 0 0 0 11px var(--ink); }
.ab__ends { display: flex; justify-content: space-between; margin-top: 1px; font-size: 10.500px; line-height: 14px; font-weight: 600; color: rgba(23, 24, 28, 0.4); }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; pointer-events: none; opacity: 0; fill: var(--ink); stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(23, 24, 28, 0.3)); z-index: 5; }
