:root {
  --bg: #f0f0f4;
  --card: #ffffff;
  --ink: #17181d;
  --soft: rgba(23, 24, 29, 0.55);
  --line: rgba(23, 24, 29, 0.08);
  --accent: #6a5cf6;
  --ok: #1fb86c;
}

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

.cp { position: relative; width: min(312px, 100%); }
.cp__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.cp__head h1 { font-size: 15px; line-height: 19px; font-weight: 720; letter-spacing: -0.01em; }
.cp__count { height: 16px; overflow: hidden; font-size: 12px; line-height: 16px; font-weight: 560; color: var(--soft); }
.cp__count span { display: block; }
.cp__add { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px 0 9px; border: 0; border-radius: 11px; background: #ffffff; color: var(--ink); font: inherit; font-size: 12.500px; font-weight: 660; cursor: pointer; outline: none; box-shadow: 0 0 0 1px var(--line), 0 6px 10px -8px rgba(23, 24, 29, 0.4); -webkit-tap-highlight-color: transparent; }
.cp__add svg { width: 14px; height: 14px; fill: none; stroke: var(--accent); stroke-width: 1.800; stroke-linecap: round; }
.cp__add:focus-visible, .cp__pin:focus-visible, .cp__resolve:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }

/* the design under review: a drawn page, the place where the pins live */
.cp__canvas { position: relative; height: min(216px, 56vh); margin-top: 10px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 30px 46px -34px rgba(23, 24, 29, 0.5), 0 8px 16px -12px rgba(23, 24, 29, 0.18); cursor: crosshair; touch-action: manipulation; }
.cp__mock { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 20px; pointer-events: none; }
.cp__mock .m { fill: #e6e6ec; }
.cp__mock .s { fill: #f1f1f5; }
.cp__mock .a { fill: var(--accent); }
.cp__mock .o { fill: none; stroke: #d9d9e2; stroke-width: 1.500; }

/* a pin: its point is the bottom left corner, the author's initials inside */
.cp__pin { position: absolute; width: 28px; height: 28px; margin-top: -28px; padding: 0; border: 0; border-radius: 50% 50% 50% 4px; background: var(--accent); color: #ffffff; font: inherit; font-size: 10.500px; font-weight: 740; letter-spacing: 0.01em; cursor: pointer; outline: none; display: grid; place-items: center; box-shadow: 0 0 0 2px #ffffff, 0 8px 12px -6px rgba(23, 24, 29, 0.55); transition: background-color 0.3s ease; -webkit-tap-highlight-color: transparent; }
.cp__pin.is-done { background: var(--ok); }
.cp__pin > * { grid-area: 1 / 1; }
.cp__pin svg { width: 14px; height: 14px; fill: none; stroke: #ffffff; stroke-width: 2.100; stroke-linecap: round; stroke-linejoin: round; }
.cp__pin path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cp__ripple { position: absolute; width: 26px; height: 12px; margin: -6px 0 0 -13px; border-radius: 50%; box-shadow: 0 0 0 1.500px var(--accent); opacity: 0; pointer-events: none; }

.cp__bubble { position: absolute; left: 0; top: 0; width: 172px; padding: 10px 11px 9px; border-radius: 15px; background: #17181d; color: #ffffff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 26px -14px rgba(23, 24, 29, 0.7); opacity: 0; visibility: hidden; cursor: default; z-index: 3; }
.cp__who { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; line-height: 16px; }
.cp__who b { font-weight: 700; }
.cp__who span { font-weight: 540; color: rgba(255, 255, 255, 0.5); }
.cp__msg { min-height: 34px; margin-top: 3px; font-size: 12.500px; line-height: 17px; font-weight: 540; color: rgba(255, 255, 255, 0.84); }
.cp__msg.is-typing span::after { content: ""; display: inline-block; width: 1.500px; height: 13px; margin-left: 1px; vertical-align: -2px; background: #ffffff; }
.cp__resolve { display: inline-flex; align-items: center; gap: 4px; height: 26px; margin-top: 7px; padding: 0 10px 0 7px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, 0.12); color: #ffffff; font: inherit; font-size: 12px; font-weight: 660; cursor: pointer; outline: none; transition: background-color 0.2s ease; -webkit-tap-highlight-color: transparent; }
.cp__resolve svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .cp__resolve:hover { background: rgba(255, 255, 255, 0.2); } }

.cp__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; }
