:root {
  --bg: #ffffff;
  --card: #f4f3ef;
  --ink: #17181b;
  --soft: rgba(23, 24, 27, 0.4);
  --line: rgba(23, 24, 27, 0.09);
  --accent: #ff5b2e;
  --cell: 54px;
  --row: 40px;
}

*, *::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;
}

.sz {
  width: min(344px, 100%);
  padding: 16px 0 12px;
  border-radius: 26px;
  background: var(--card);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 0 0 1px var(--line),
    0 30px 60px -32px rgba(23, 24, 27, 0.4);
}
.sz__head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 18px; }
.sz__title { font-size: 15px; font-weight: 660; font-stretch: 106%; letter-spacing: -0.008em; }
.sz__foot { font-size: 12px; font-weight: 480; color: var(--soft); }
.sz__foot b { display: inline-block; height: 16px; overflow: hidden; vertical-align: bottom; font-weight: 680; color: var(--ink); font-variant-numeric: tabular-nums; }
.sz__foot b span { display: block; line-height: 16px; }

.sz__body { display: grid; grid-template-columns: 44px minmax(0, 1fr); margin: 12px 0 10px; }
.sz__names { display: grid; grid-auto-rows: var(--row); row-gap: 1px; padding: 8px 0 7px; }
.sz__names span { display: grid; place-items: center end; font-size: 10px; font-weight: 720; letter-spacing: 0.08em; color: var(--accent); }
.sz__names span i { display: inline-block; font-style: normal; }
.sz__rules {
  position: relative;
  padding: 7px 0;
  overflow: hidden;
  outline: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 80%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 16%, #000 80%, transparent);
}
.rule { position: relative; height: var(--row); border-top: 1px solid var(--line); }
.rule:last-of-type { border-bottom: 1px solid var(--line); }
.rule__strip { position: absolute; left: 0; top: 0; height: 100%; display: flex; will-change: transform; }
.rule__cell {
  flex: none;
  width: var(--cell);
  height: 100%;
  border: 0;
  background: none;
  font-family: inherit;
  font-stretch: inherit;
  font-size: 15px;
  font-weight: 480;
  color: var(--soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s ease, font-weight 0.3s ease;
}
.rule__cell i { display: inline-block; font-style: normal; }
.rule__cell.is-on { color: var(--ink); font-weight: 720; }

/* the lens: one frame over the three rulers, where the chosen size sits */
.sz__lens { position: absolute; left: 50%; top: 2px; bottom: 2px; width: calc(var(--cell) + 4px); margin-left: calc(var(--cell) / -2 - 2px); pointer-events: none; }
.sz__lens i { position: absolute; inset: 0; border-radius: 15px; background: #ffffff; box-shadow: 0 0 0 1.500px var(--ink), 0 10px 22px -10px rgba(23, 24, 27, 0.45); }
.sz__rules .rule { z-index: 1; }
.sz__rules:focus-visible .sz__lens i { box-shadow: 0 0 0 2.500px var(--accent), 0 10px 22px -10px rgba(23, 24, 27, 0.45); }

.sz__bar { display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.sz__step { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 1px var(--line), 0 2px 5px -2px rgba(23, 24, 27, 0.25); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity 0.3s ease; }
.sz__step svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sz__step:disabled { opacity: 0.35; cursor: default; }
.sz__step:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sz__say { flex: 1; min-width: 0; height: 19px; overflow: hidden; font-size: 13.500px; line-height: 19px; font-weight: 540; text-align: center; }
.sz__say span { display: block; white-space: nowrap; }

.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.35));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (hover: hover) {
  .rule__cell:not(.is-on):hover { color: rgba(23, 24, 27, 0.75); }
}
