:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #18181b;
  --soft: rgba(24, 24, 27, 0.58);
  --faint: rgba(24, 24, 27, 0.36);
  --line: rgba(24, 24, 27, 0.09);
  --accent: #e2522b;
  --row: 52px;
}

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

.gb { position: relative; width: min(326px, 100%); padding: 14px 14px 8px; border-radius: 26px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 34px 54px -36px rgba(24, 24, 27, 0.5), 0 10px 18px -14px rgba(24, 24, 27, 0.22); }

.gb__head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px; }
.gb__head h1 { font-size: 16px; line-height: 21px; font-weight: 740; letter-spacing: -0.015em; }
.gb__count { height: 17px; overflow: hidden; font-size: 12px; line-height: 17px; font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; }
.gb__count span { display: block; }

.gb__form { display: flex; gap: 6px; margin-top: 10px; }
.gb__field { position: relative; flex: 1 1 auto; min-width: 0; display: block; }
.gb__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.gb__field input { width: 100%; height: 44px; padding: 0 34px 0 12px; border: 0; border-radius: 14px; background: #f4f4f6; color: var(--ink); font: inherit; font-size: 13.500px; font-weight: 560; outline: none; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.25s ease, background-color 0.25s ease; }
.gb__field input::placeholder { color: var(--faint); }
.gb__field input:focus-visible, .gb__field.is-live input { background: #ffffff; box-shadow: inset 0 0 0 1.500px var(--ink); }
.gb__field.is-empty input { box-shadow: inset 0 0 0 1.500px var(--accent); }
.gb__left { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 10.500px; font-weight: 640; color: var(--faint); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.2s ease, color 0.2s ease; }
.gb__field.is-live .gb__left { opacity: 1; }
.gb__left.is-low { color: var(--accent); }

.gb__sign { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 78px; height: 44px; padding: 0 13px; border: 0; border-radius: 14px; background: var(--ink); color: #ffffff; font: inherit; font-size: 13.500px; font-weight: 700; cursor: pointer; outline: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 18px -12px rgba(24, 24, 27, 0.7); transition: background-color 0.3s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gb__sign svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.600; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.gb__sign .pen { transform-box: fill-box; transform-origin: 20% 90%; transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.2s ease; }
.gb__sign .ck { stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset 0.35s ease 0.1s, opacity 0.1s ease; }
.gb.is-signed .gb__sign { background: var(--accent); }
.gb.is-signed .gb__sign .pen { transform: rotate(-30deg) scale(0.5); opacity: 0; }
.gb.is-signed .gb__sign .ck { stroke-dashoffset: 0; opacity: 1; }
.gb__signtext { height: 20px; line-height: 20px; overflow: hidden; }
.gb__signtext span { display: block; white-space: nowrap; }
.gb__sign:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
@media (hover: hover) { .gb:not(.is-signed) .gb__sign:hover { background: #2f2f34; } .gb__sign:hover .pen { transform: rotate(-12deg); } }

/* the list shows three notes: a new one pushes the oldest out of the bottom */
.gb__list { list-style: none; height: calc(var(--row) * 3); margin-top: 8px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.gb__note { display: flex; align-items: center; gap: 10px; height: var(--row); padding: 0 2px; overflow: hidden; }
.gb__face { flex: none; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: hsl(var(--h, 20) 80% 94%); color: hsl(var(--h, 20) 60% 34%); box-shadow: inset 0 0 0 1px hsl(var(--h, 20) 60% 84%); font-style: normal; font-size: 13px; font-weight: 740; }
.gb__body { flex: 1 1 auto; min-width: 0; display: grid; }
.gb__body b { font-size: 12.500px; line-height: 17px; font-weight: 700; white-space: nowrap; }
.gb__body em { margin-left: 5px; font-style: normal; font-weight: 540; color: var(--faint); }
.gb__body > span { font-size: 12.500px; line-height: 17px; font-weight: 540; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb__note.is-new .gb__face { background: var(--ink); color: #ffffff; box-shadow: none; }

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