:root {
  --bg: #000000;
  --card: #111114;
  --card-hi: #1a1a1f;
  --ink: #f4f3f6;
  --soft: rgba(244, 243, 246, 0.5);
  --line: rgba(255, 255, 255, 0.09);
  --accent: #8b7bff;
  --on: 0; /* 0 off, 1 live: the script moves it */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  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: 12px 16px;
}

.fr {
  width: min(336px, 100%);
  padding: 14px 15px 15px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px var(--line),
    0 40px 80px -40px color-mix(in srgb, var(--accent) calc(var(--on) * 60%), transparent),
    0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
.fr__head { display: flex; align-items: center; gap: 10px; }
.fr__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) calc(var(--on) * 20%), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.fr__icon svg { width: 20px; height: 20px; fill: none; stroke: color-mix(in srgb, var(--accent) calc(var(--on) * 100%), var(--soft)); stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.fr__flag { fill: color-mix(in srgb, var(--accent) calc(var(--on) * 34%), transparent); }
.fr__name { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fr__name code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.500px; font-weight: 600; letter-spacing: -0.01em; }
.fr__state { height: 15px; overflow: hidden; font-size: 11.500px; line-height: 15px; font-weight: 520; color: color-mix(in srgb, var(--accent) calc(var(--on) * 100%), var(--soft)); }
.fr__state span { display: block; white-space: nowrap; }

.fr__switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) calc(var(--on) * 100%), rgba(255, 255, 255, 0.14));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.fr__knob { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 999px; background: #ffffff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45); }
.fr__switch:focus-visible { box-shadow: 0 0 0 2px #000, 0 0 0 4px #ffffff; }

.fr__body { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); opacity: calc(0.42 + var(--on) * 0.58); }
.fr__read { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fr__pct { font-size: clamp(28px, 8vh, 36px); line-height: 1; font-weight: 600; font-stretch: 96%; letter-spacing: -0.02em; }
.fr__pct i { margin-left: 1px; font-style: normal; font-size: 0.5em; font-weight: 560; color: var(--soft); }
.fr__users { font-size: 12px; font-weight: 480; color: var(--soft); text-align: right; }
.fr__users b { font-weight: 640; color: var(--ink); }

.fr__bars { display: flex; align-items: flex-end; gap: 2px; height: clamp(26px, 8vh, 36px); margin-top: 10px; }
.fr__bars i {
  flex: 1;
  min-width: 0;
  height: 34%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.13);
  transition: height 0.5s cubic-bezier(0.3, 1.7, 0.5, 1), background-color 0.25s ease;
}
.fr__bars i.is-in { height: var(--h, 100%); background: var(--accent); }
.fr:not(.is-on) .fr__bars i { height: 20%; background: rgba(255, 255, 255, 0.1); }

.fr__slide { position: relative; height: 28px; margin-top: 8px; }
.fr__track { position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.fr__fill { display: block; width: 0; height: 100%; border-radius: 999px; background: color-mix(in srgb, var(--accent) calc(var(--on) * 100%), rgba(255, 255, 255, 0.3)); }
.fr__thumb {
  position: absolute;
  left: 0;
  top: 3px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 4px 10px -2px rgba(0, 0, 0, 0.7), 0 0 0 calc(var(--press, 0) * 7px) color-mix(in srgb, var(--accent) 30%, transparent);
  pointer-events: none;
}
.fr__range { position: absolute; left: -11px; right: -11px; top: 0; width: calc(100% + 22px); height: 100%; margin: 0; opacity: 0; cursor: grab; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.fr__slide { margin-left: 11px; margin-right: 11px; }
.fr__slide:has(.fr__range:focus-visible) .fr__thumb { box-shadow: 0 0 0 2px #000, 0 0 0 4px #ffffff; }
.fr:not(.is-on) .fr__range { pointer-events: none; }

.fr__stages { display: flex; gap: 6px; margin-top: 8px; }
.stage-chip {
  flex: 1;
  height: 28px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  color: var(--soft);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}
.stage-chip.is-on { color: var(--ink); background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent); }
.stage-chip:focus-visible { box-shadow: inset 0 0 0 2px #ffffff; }
.fr:not(.is-on) .stage-chip { pointer-events: none; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #14151a;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (hover: hover) {
  .stage-chip:hover { color: var(--ink); }
}
