:root {
  --bg: #ffffff;
  --ink: #14151a;
  --muted: #7d808c;
  --line: #e6e7ec;
  --edge: #c9cbd4;
  --panel: #ffffff;
  --hover: #f5f5f8;
  --accent: #f2542d;
  --tick: #ffffff;
}

*, *::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;
  place-items: center;
  padding: 16px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- the panel ---- */
.group {
  position: relative;
  width: min(348px, 100%);
  border: 0;
  border-radius: 22px;
  background: var(--panel);
  padding: 8px;
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 1px rgba(20, 21, 26, 0.04),
    0 10px 24px -10px rgba(20, 21, 26, 0.14),
    0 34px 60px -30px rgba(20, 21, 26, 0.2);
}

.rows {
  position: relative;
  margin-top: 6px;
  padding-top: 6px;
}
.rows::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: var(--line);
}

/* ---- a row: the whole line is the label of its checkbox ---- */
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: clamp(44px, 12.4vh, 54px);
  padding: 7px 12px;
  border-radius: 15px;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background-color 0.25s ease;
}
.row--all { min-height: clamp(44px, 12vh, 52px); }
.row.is-hot { background: var(--hover); }
@media (hover: hover) {
  .row:hover { background: var(--hover); }
  .row:hover .box { --edge: #9a9daa; }
}

.row__input {
  position: absolute;
  opacity: 0;
  width: 22px;
  height: 22px;
  left: 12px;
  top: 50%;
  margin-top: -11px;
  pointer-events: none;
}

.row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.row__name {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 480;
  letter-spacing: -0.005em;
  color: var(--ink);
  white-space: nowrap;
  transition: font-weight 0.35s cubic-bezier(0.3, 1.4, 0.5, 1), color 0.3s ease;
}
.row--all .row__name { font-weight: 600; }
.row__note {
  font-size: 12.5px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}
.row.is-on .row__name { font-weight: 620; }
.row--all.is-on .row__name { font-weight: 680; }
.row.is-on .row__note { color: #5d606b; }

/* ---- the box ---- */
.box {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1.5px var(--edge), 0 1px 1.5px rgba(20, 21, 26, 0.06);
  background: #ffffff;
  transition: box-shadow 0.2s ease;
}
.box__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 55%),
    var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 3px 8px -3px var(--accent);
  transform: scale(0);
  opacity: 0;
}
.box__ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--accent);
  opacity: 0;
}
.box svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.box path {
  fill: none;
  stroke: var(--tick);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}
.row__input:focus-visible + .box {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- the count on the right of the parent ---- */
.count {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f3f6;
  color: #5d606b;
  font-size: 12.5px;
  font-weight: 540;
  transition: background-color 0.35s ease, color 0.35s ease;
}
.count__n {
  display: inline-block;
  min-width: 0.62em;
  text-align: center;
}
.row--all.is-on .count {
  background: color-mix(in srgb, var(--accent) 12%, #ffffff);
  color: color-mix(in srgb, var(--accent) 80%, #14151a);
}

/* the light that crosses the parent row when the last box joins */
.row__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 46%;
  background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent) 16%, transparent) 50%, transparent);
  opacity: 0;
  pointer-events: none;
}

/* ---- the pointer that shows the gesture when nobody touches ---- */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #14151a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(20, 21, 26, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-width: 360px) {
  .row { gap: 11px; padding: 6px 10px; }
  .row__input { left: 10px; }
  .row__name { font-size: 14.5px; }
}
