:root {
  --bg: #ffffff;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.55);
  --line: rgba(23, 23, 26, 0.14);
  --field: #f5f4f1;
  --accent: #0f9d74;
}

*, *::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;
}
button, input { font: inherit; color: inherit; border: 0; background: none; outline: none; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }

.ls { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: min(336px, 100%); }
.ls__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding: 0 4px; }
.ls__label { display: block; height: 18px; overflow: hidden; font-size: 13px; line-height: 18px; font-weight: 650; }
.ls__label span { display: block; }
.ls__count { font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
.ls__count b { font-weight: 680; color: var(--ink); }

.ls__field { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; height: 56px; margin-top: 8px; padding: 0 6px 0 16px; border-radius: 18px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 4px -2px rgba(23, 23, 26, 0.12); transition: box-shadow 0.25s, background-color 0.25s; }
.ls__field:focus-within { box-shadow: inset 0 0 0 1.500px var(--ink); }
.ls[data-state="short"] .ls__field { background: color-mix(in srgb, var(--accent) 8%, #ffffff); box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--accent) 55%, transparent); }
.ls__input, .ls__squeeze, .ls__short { grid-column: 1; grid-row: 1; min-width: 0; font-size: 14.5px; font-weight: 520; white-space: nowrap; }
.ls__input { width: 100%; height: 40px; text-overflow: ellipsis; }
.ls__squeeze { overflow: hidden; text-overflow: ellipsis; transform-origin: 0 50%; opacity: 0; pointer-events: none; }
.ls__short { display: flex; align-items: baseline; font-size: 16px; font-weight: 640; opacity: 0; visibility: hidden; }
.ls[data-state="short"] .ls__short { visibility: visible; }
.ls[data-state="short"] .ls__input { visibility: hidden; }
.ls__domain { color: var(--soft); font-weight: 560; }
.ls__alias { flex: 1 1 auto; min-width: 0; width: 100%; height: 40px; font-weight: 700; color: var(--accent); }

.ls__btn { position: relative; grid-column: 2; width: 92px; height: 44px; margin-left: 8px; border-radius: 13px; background: var(--ink); color: #ffffff; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 16px -10px rgba(23, 23, 26, 0.7); }
.ls__btn:focus-visible { box-shadow: 0 0 0 2px var(--field), 0 0 0 4px var(--ink); }
.ls__face { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; opacity: 0; }
.ls__face[data-face="shorten"] { opacity: 1; }
.ls__face svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.100; stroke-linecap: round; stroke-linejoin: round; }
.ls__face path { stroke-dasharray: 1; stroke-dashoffset: 1; }

/* the length of the link as a line: it shrinks with it */
.ls__meter { display: block; height: 3px; margin: 10px 4px 0; border-radius: 2px; background: rgba(23, 23, 26, 0.08); overflow: hidden; }
.ls__meter i { display: block; height: 100%; border-radius: 2px; background: var(--ink); transform-origin: 0 50%; }
.ls[data-state="short"] .ls__meter i { background: var(--accent); }
.ls__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; height: 30px; margin-top: 6px; padding: 0 4px; }
.ls__saved { display: block; height: 16px; overflow: hidden; font-size: 12px; line-height: 16px; color: var(--soft); white-space: nowrap; }
.ls__saved span { display: block; overflow: hidden; text-overflow: ellipsis; }
.ls__new { height: 30px; padding: 0 2px; font-size: 12.5px; font-weight: 650; color: var(--ink); opacity: 0; visibility: hidden; border-radius: 6px; }
.ls[data-state="short"] .ls__new { visibility: visible; }
.ls__new:focus-visible { box-shadow: 0 0 0 2px var(--ink); }

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

@media (prefers-reduced-motion: reduce) { .ls__field { transition: none; } }
