:root {
  --bg: #ffffff;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.58);
  --line: rgba(23, 23, 26, 0.1);
  --accent: #2f6bff;
  --circle: #ff6a3d;
  --square: #7c5cff;
  --pill: #ffc24a;
}

*, *::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: 8px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.lp { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: min(348px, 100%); padding: 14px 16px 16px; border-radius: 26px; background: #ffffff; box-shadow: inset 0 0 0 1.500px var(--line), 0 30px 44px -30px rgba(23, 23, 26, 0.4); }

/* the artboard: three flat shapes stacked in the order of the list; the frame of the picked one is drawn over them */
.lp__view { display: grid; place-items: center; height: min(112px, 27vh); border-radius: 18px; background: #f1f1f4; box-shadow: inset 0 0 0 1px rgba(23, 23, 26, 0.04); overflow: hidden; }
.lp__art { position: relative; width: 150px; height: 88px; }
.lp__shape { position: absolute; }
.lp__shape i { display: block; width: 100%; height: 100%; }
.lp__shape--circle { left: 0; top: 10px; width: 74px; height: 74px; }
.lp__shape--circle i { border-radius: 50%; background: var(--circle); }
.lp__shape--square { left: 42px; top: 0; width: 66px; height: 66px; }
.lp__shape--square i { border-radius: 16px; background: var(--square); }
.lp__shape--pill { left: 60px; top: 46px; width: 90px; height: 40px; }
.lp__shape--pill i { border-radius: 20px; background: var(--pill); }
.lp__sel { position: absolute; left: 0; top: 0; width: 10px; height: 10px; box-shadow: 0 0 0 1.500px var(--accent); opacity: 0; pointer-events: none; z-index: 9; }
.lp__sel i { position: absolute; width: 7px; height: 7px; border-radius: 2px; background: #ffffff; box-shadow: 0 0 0 1.500px var(--accent); }
.lp__sel i:nth-child(1) { left: -4px; top: -4px; }
.lp__sel i:nth-child(2) { right: -4px; top: -4px; }
.lp__sel i:nth-child(3) { left: -4px; bottom: -4px; }
.lp__sel i:nth-child(4) { right: -4px; bottom: -4px; }

.lp__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 2px; }
.lp__head strong { font-size: 15px; line-height: 18px; font-weight: 740; letter-spacing: -0.01em; }
.lp__clip { display: block; height: 16px; line-height: 16px; overflow: hidden; white-space: nowrap; font-size: 12px; font-weight: 620; color: var(--soft); }
.lp__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }

/* the list: the top layer first. Every row is placed by the script, so two rows can swap places */
.lp__list { position: relative; height: 120px; border-radius: 14px; background: rgba(23, 23, 26, 0.04); }
.lp__row { position: absolute; left: 0; top: 0; width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; height: 40px; }
.lp__eye { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.lp__eye svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; }
.lp__eye .lp__pupil { fill: currentColor; stroke: none; }
.lp__eye .lp__slash { stroke-width: 1.800; stroke-dasharray: 1; stroke-dashoffset: 1; }
.lp__eye:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.lp__pick { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 9px; height: 34px; margin-right: 3px; padding: 0 10px 0 7px; border-radius: 11px; text-align: left; font-size: 13.500px; font-weight: 680; white-space: nowrap; transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease; }
.lp__pick span { overflow: hidden; text-overflow: ellipsis; }
.lp__pick i { display: block; width: 22px; height: 22px; border-radius: 7px; background: #ffffff; box-shadow: inset 0 0 0 1px rgba(23, 23, 26, 0.1); display: grid; place-items: center; }
.lp__pick i::before { content: ""; display: block; }
.lp__row[data-id="circle"] .lp__pick i::before { width: 12px; height: 12px; border-radius: 50%; background: var(--circle); }
.lp__row[data-id="square"] .lp__pick i::before { width: 12px; height: 12px; border-radius: 3.500px; background: var(--square); }
.lp__row[data-id="pill"] .lp__pick i::before { width: 14px; height: 7px; border-radius: 3.500px; background: var(--pill); }
.lp__row.is-picked .lp__pick { background: #ffffff; box-shadow: inset 0 0 0 1.500px var(--accent), 0 6px 10px -6px rgba(23, 23, 26, 0.35); }
.lp__row.is-hidden .lp__pick { color: rgba(23, 23, 26, 0.4); }
.lp__row.is-hidden .lp__eye { color: rgba(23, 23, 26, 0.4); }
.lp__pick:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }

.lp__acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lp__btn { display: flex; justify-content: center; align-items: center; gap: 6px; height: 44px; border-radius: 22px; font-size: 13.500px; font-weight: 720; white-space: nowrap; box-shadow: inset 0 0 0 1.500px rgba(23, 23, 26, 0.2); transition: opacity 0.2s ease, box-shadow 0.2s ease; }
.lp__btn svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lp__btn[aria-disabled="true"] { opacity: 0.38; cursor: default; }
.lp__btn:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }

.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: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 12; }

@media (hover: hover) { .lp__btn:not([aria-disabled="true"]):hover { box-shadow: inset 0 0 0 1.500px var(--ink); } .lp__row:not(.is-picked) .lp__pick:hover { background: rgba(23, 23, 26, 0.05); } }
@media (max-width: 350px) { .lp { padding: 12px 13px 14px; } .lp__btn { font-size: 13px; gap: 5px; } }
@media (max-height: 400px) { .lp { gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .lp__pick, .lp__btn { transition: none; } }
