:root {
  --bg: #f1f1f5;
  --card: #ffffff;
  --ink: #17181d;
  --soft: rgba(23, 24, 29, 0.55);
  --faint: rgba(23, 24, 29, 0.34);
  --line: rgba(23, 24, 29, 0.08);
  --bar: #17181d;
  --accent: #5b5bf0;
  --row: 38px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%), 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: 10px 14px;
}

.ba { position: relative; width: min(316px, 100%); padding: 12px 10px 10px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 1px 0 #ffffff inset, 0 30px 50px -34px rgba(23, 24, 29, 0.5), 0 8px 16px -12px rgba(23, 24, 29, 0.2); }

.ba__head { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; }
.ba__head h1 { flex: 1 1 auto; font-size: 14.500px; line-height: 20px; font-weight: 700; letter-spacing: -0.01em; }
.ba__count { height: 18px; overflow: hidden; font-size: 12.500px; line-height: 18px; font-weight: 580; color: var(--soft); }
.ba__count span { display: block; }

/* the checkbox: a spring fills it with the accent, then the tick draws itself */
.ba__pick { position: relative; flex: none; width: 18px; height: 18px; border: 0; border-radius: 6px; background: #ffffff; box-shadow: inset 0 0 0 1.500px rgba(23, 24, 29, 0.22); cursor: pointer; outline: none; overflow: hidden; transition: box-shadow 0.25s ease; -webkit-tap-highlight-color: transparent; }
.ba__pick:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); overflow: visible; }
.ba__fill { position: absolute; inset: 0; border-radius: 6px; background: var(--accent); transform: scale(0); }
.ba__pick svg { position: absolute; inset: 1px; width: 16px; height: 16px; fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ba__pick path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.ba__list { list-style: none; height: calc(var(--row) * 5); margin-top: 4px; }
.ba__row { position: relative; display: flex; align-items: center; gap: 10px; height: var(--row); padding: 0 8px; border-radius: 11px; overflow: hidden; cursor: pointer; transition: background-color 0.25s ease; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.ba__row.is-on { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ba__doc { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--faint); stroke-width: 1.400; stroke-linejoin: round; stroke-linecap: round; transition: stroke 0.25s ease; }
.ba__row.is-on .ba__doc { stroke: var(--accent); }
.ba__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.500px; font-weight: 620; letter-spacing: -0.005em; }
.ba__size { flex: none; font-size: 12px; font-weight: 560; color: var(--soft); white-space: nowrap; }
@media (hover: hover) {
  .ba__row:hover { background: rgba(23, 24, 29, 0.04); }
  .ba__row.is-on:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .ba__row:hover .ba__pick, .ba__pick:hover { box-shadow: inset 0 0 0 1.500px var(--accent); }
}

/* the place of the bar: a hint while nothing is picked, then the dark pill rises into it */
.ba__slot { position: relative; height: 46px; margin-top: 8px; }
.ba__hint { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 560; color: var(--faint); text-align: center; }
.ba__bar { position: absolute; inset: 0; border-radius: 16px; background: linear-gradient(180deg, #23252c, var(--bar)); color: #ffffff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 22px -14px rgba(23, 24, 29, 0.75); overflow: hidden; opacity: 0; visibility: hidden; }
.ba__layer { position: absolute; inset: 0; display: flex; align-items: center; gap: 6px; padding: 0 7px 0 15px; }
.ba__layer--toast { opacity: 0; visibility: hidden; }
.ba__n { flex: 1 1 auto; display: flex; align-items: center; gap: 0.320em; font-size: 13.500px; line-height: 18px; font-weight: 620; white-space: nowrap; }
.ba__num { display: inline-block; height: 18px; line-height: 18px; overflow: hidden; min-width: 0.640em; text-align: center; font-weight: 740; }
.ba__num span { display: block; }
.ba__act { flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: #ffffff; font: inherit; font-size: 13px; font-weight: 680; cursor: pointer; outline: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); -webkit-tap-highlight-color: transparent; }
.ba__act--undo { background: rgba(255, 255, 255, 0.12); }
.ba__x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: rgba(255, 255, 255, 0.7); cursor: pointer; outline: none; display: grid; place-items: center; transition: background-color 0.2s ease, color 0.2s ease; -webkit-tap-highlight-color: transparent; }
.ba__x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.700; stroke-linecap: round; }
.ba__act:focus-visible, .ba__x:focus-visible { box-shadow: 0 0 0 2px var(--bar), 0 0 0 4px #ffffff; }
@media (hover: hover) { .ba__x:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; } }
/* the time left to undo: a thin line that drains along the bottom of the pill */
.ba__drain { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; filter: brightness(1.35); }

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

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17181d; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(23, 24, 29, 0.3)); z-index: 5; }
