:root {
  --paper: #ffffff;
  --card: #ffffff;
  --track: #f3f3f4;
  --edge: rgba(12, 12, 16, 0.08);
  --ink: #0c0c10;
  --on-ink: #fafafa;
  --muted: #8a8a93;
  --line: #ececee;
  --sheen: rgba(255, 255, 255, 0.9);
  --accent: #6a4cff;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.len {
  width: min(372px, 100%);
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 20px;
  padding: clamp(14px, 3.4vh, 20px) clamp(14px, 4vw, 20px) clamp(16px, 3.8vh, 22px);
  box-shadow: 0 1px 2px rgba(12, 12, 16, 0.04), 0 22px 44px -26px rgba(12, 12, 16, 0.22);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.8vh, 16px);
}
.len__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.len__title {
  font-size: 14px;
  font-variation-settings: 'wght' 600, 'wdth' 100;
  letter-spacing: -0.01em;
}
.len__count {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variation-settings: 'wght' 450, 'wdth' 100;
}
.len__count [data-count] {
  display: inline-block;
  color: var(--ink);
  font-variation-settings: 'wght' 560, 'wdth' 100;
}

/* the picker */
.len__seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 12px;
  background: var(--track);
  box-shadow: inset 0 0 0 1px rgba(12, 12, 16, 0.03);
  touch-action: manipulation;
}
/* GSAP moves the pill; its look stays here */
.len__pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 40px;
  border-radius: 9px;
  background: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 6px 14px -8px rgba(12, 12, 16, 0.6), 0 1px 2px rgba(12, 12, 16, 0.2);
  pointer-events: none;
  will-change: transform, width;
}
.len__opt {
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  height: 36px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13.5px;
  transition: color 0.28s ease;
}
.len__opt > span {
  display: inline-block;
  font-variation-settings: 'wght' 520, 'wdth' 100;
  letter-spacing: -0.005em;
  will-change: transform;
}
.len__opt[aria-checked="true"] { color: var(--on-ink); }
.len__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .len__opt:hover:not([aria-checked="true"]) { color: var(--ink); }
}

/* the draft reply: skeleton lines and the caret that writes them */
.len__preview {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px 2px 0;
  overflow: hidden;
}
.len__line {
  position: relative;
  display: block;
  height: 9px;
  width: 0;
  flex: none;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
/* the sheen that runs once over a line when it has been written */
.len__line::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--sheen), transparent);
  transform: translateX(var(--sheen-x, -110%));
}
.len__caret {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 15px;
  border-radius: 2px;
  background: var(--accent);
  will-change: transform;
}
