/* Paid-plan waitlist (site/js/waitlist.js): a one-field "notify me" dialog from the plan buttons, plus inline forms.
   Linear/Vercel-style: small centered card, plan chip, one email field with the button beside it; bottom sheet on phones. */
html.wl-lock { overflow: hidden; }

.wl {
  width: min(460px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; margin: auto;
  border: 0; border-radius: 20px; background: transparent; color: var(--fg); overflow: visible;
}
.wl[open] { animation: wl-in .22s cubic-bezier(.2, .9, .3, 1) both; }
.wl::backdrop { background: rgba(17, 12, 34, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: wl-fade .2s ease both; }
@keyframes wl-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes wl-fade { from { opacity: 0; } }

.wl-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 26px 26px 22px;
  box-shadow: 0 40px 90px -30px rgba(40, 20, 90, .45), 0 2px 8px rgba(15, 12, 30, .06);
  max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
}
.wl-x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.wl-x:hover { background: var(--soft); color: var(--fg); }
.wl-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.wl-view { display: grid; gap: 14px; }
.wl-view[hidden] { display: none; }

.wl-plan {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; margin-right: 34px;
  border: 1px solid var(--line); border-radius: 14px; background: #faf9fe;
}
.wl-ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.wl-ic svg { width: 19px; height: 19px; fill: currentColor; }
.wl[data-plan="unlimited"] .wl-ic { background: #0b0d10; color: #fff; }
.wl-pt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.wl-pn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wl-pn { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.wl-pp { font-size: 13.5px; color: var(--fg); line-height: 1.4; font-variant-numeric: tabular-nums; }
.wl-pw { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.wl-soon {
  flex: none; font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 4px 7px; border-radius: 999px;
}

.wl h2 { margin: 6px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; }
.wl-lede { margin: -4px 0 2px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.wl-lede b { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }

.wl-form { display: grid; gap: 8px; }
.wl-label { font-size: 13.5px; font-weight: 550; }
.wl-row { display: flex; gap: 8px; }
.wl-row input, .wl-inline input {
  flex: 1; min-width: 0; width: 100%; font: 400 16px var(--font); color: var(--fg); padding: 0 14px; height: 46px;
  border: 1px solid var(--line); border-radius: 11px; background: #fbfafd; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.wl-row input:focus, .wl-inline input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: #fff; }
.wl-row input[aria-invalid="true"], .wl-inline input[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 4px #fee2e2; }
.wl-go { height: 46px; padding: 0 18px; border-radius: 11px; flex: none; }
.wl-go[aria-busy="true"], .wl-inline button[aria-busy="true"] { cursor: progress; opacity: .75; }
.wl-err {
  margin: 0; padding: 9px 12px; border-radius: 10px; font-size: 14px; line-height: 1.45; text-align: left;
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
}
.wl-err[hidden] { display: none; }
.wl-ts { display: none; }
.wl-ts.on { display: flex; justify-content: center; padding-top: 4px; }
.wl-fine { margin: 2px 0 0; font-size: 13px; color: var(--faint); line-height: 1.5; }
.wl-fine a { color: var(--muted); text-underline-offset: 2px; }

.wl-ok { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--ok-bg); color: var(--ok); }
.wl-ok svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; animation: wl-tick .45s .1s ease-out both; }
@keyframes wl-tick { from { stroke-dashoffset: 24; } }
.wl-done-h:focus { outline: none; }
.wl-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.wl-acts .btn { flex: 1 1 160px; }

/* Inline form (e.g. /login "Accounts open soon") */
.wl-inline { display: grid; gap: 8px; text-align: left; }
.wl-inline .wl-row button { height: 46px; padding: 0 18px; border-radius: 11px; flex: none; }
.wl-inline-done { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 14px; background: #f6fbf8; border: 1px solid #cdebd9; outline: none; }
.wl-inline-done .wl-ok { flex: none; width: 40px; height: 40px; border-radius: 12px; }
.wl-inline-done .wl-ok svg { width: 22px; height: 22px; }
.wl-inline-done p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.wl-inline-done b { color: var(--fg); }

/* Phones: bottom sheet, field and button stacked */
@media (max-width: 560px) {
  .wl { width: 100vw; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .wl[open] { animation-name: wl-up; }
  .wl-card { border-radius: 22px 22px 0 0; border-bottom: 0; padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 24px); }
  .wl-card::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: -8px auto 12px; }
  .wl h2 { font-size: 20px; }
  .wl-row { flex-direction: column; }
  .wl-row input { flex: none; height: 48px; }
  .wl-go, .wl-inline .wl-row button { width: 100%; height: 48px; }
  .wl-acts { flex-direction: column; }
  .wl-acts .btn { flex: none; width: 100%; }
}
@keyframes wl-up { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  .wl[open], .wl::backdrop, .wl-ok svg { animation: none; }
}

/* /login "Accounts open soon" */
.si-wl { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.si-wl-h, .si-wl .wl-fine { margin: 0 0 4px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--muted); }
.si-wl-h [data-wl-plan] { color: var(--fg); font-weight: 600; }
.si-wl .wl-fine { margin: 2px 0 0; font-size: 13px; color: var(--faint); }
.si-box .wl-inline-done { margin-top: 20px; }
