:root {
  --bg: #f6f4f1;
  --panel: #ffffff;
  --ink: #1d2321;
  --ink-soft: #5c6663;
  --line: #e2ddd6;
  --holly: #1f6b4a;
  --holly-ink: #ffffff;
  --berry: #b3303a;
  --shadow: 0 1px 2px rgba(29,35,33,.06), 0 8px 24px rgba(29,35,33,.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181a;
    --panel: #1d2225;
    --ink: #eef1f0;
    --ink-soft: #9aa5a3;
    --line: #2e3538;
    --holly: #4cb183;
    --holly-ink: #0d1412;
    --berry: #e8707a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 620px; margin: 0 auto; padding: 44px 16px 72px; }

.masthead { margin-bottom: 22px; }

h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.15; letter-spacing: -.02em; }
h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }

.sub { margin: 0 0 4px; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.centred { text-align: center; }

/* ---------- cards ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 18px; }

.card.organiser { border-color: var(--holly); }

/* ---------- forms ---------- */

.label { display: block; font-weight: 600; margin: 18px 0 7px; }
.card > .label:first-of-type { margin-top: 14px; }

.hint { font-weight: 400; color: var(--ink-soft); font-size: 14px; }

input[type="text"], textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

textarea { resize: vertical; }

input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--holly);
  outline-offset: 2px;
}

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

button:hover { border-color: var(--ink-soft); }
button:disabled { opacity: .55; cursor: default; }

button.primary { background: var(--holly); border-color: var(--holly); color: var(--holly-ink); }
button.primary:hover:not(:disabled) { filter: brightness(1.07); }
button.big { padding: 14px 24px; font-size: 17px; width: 100%; }
button.ghost { background: transparent; }

.count { color: var(--ink-soft); font-size: 14px; }
.error { margin: 14px 0 0; color: var(--berry); font-weight: 600; }
.note { margin: 14px 0 0; color: var(--ink-soft); font-size: 14px; }

/* ---------- who's in ---------- */

.people { list-style: none; margin: 10px 0 0; padding: 0; }

.people li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
}

.people li:first-child { border-top: 0; }
.people .tick { color: var(--holly); font-size: 14px; }
.people .nowt { color: var(--ink-soft); font-size: 14px; }
.people .you { color: var(--ink-soft); font-size: 14px; }

/* ---------- invite link ---------- */

.linkrow { gap: 10px; }

.url {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---------- the reveal ---------- */

.reveal { text-align: center; padding: 30px 20px 34px; }

.lead {
  margin: 26px 0 2px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: 12px;
  font-weight: 600;
}

#revealed > .lead:first-child { margin-top: 0; }

.recipient {
  margin: 0;
  font-size: 42px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--holly);
}

.suggestions {
  margin: 8px 0 0;
  white-space: pre-wrap;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
}

a.plain { color: var(--holly); }

@media (max-width: 520px) {
  main { padding-top: 26px; }
  h1 { font-size: 27px; }
  .recipient { font-size: 34px; }
  .linkrow { flex-wrap: nowrap; }
}

/* ---------- setting a draw up ---------- */

h2.spaced { margin-top: 26px; }

input[type="email"] {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pair {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.pair input { flex: 1 1 0; min-width: 0; }

button.small {
  padding: 7px 13px;
  font-size: 14px;
  flex: 0 0 auto;
}

button.danger {
  color: var(--berry);
  border-color: var(--line);
  background: transparent;
}

button.danger:hover { border-color: var(--berry); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0 18px;
}

/* ---------- chasing people ---------- */

.people.chase li { flex-wrap: wrap; }

.people .who { font-weight: 600; }

.people .email {
  color: var(--ink-soft);
  font-size: 14px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people.chase button { margin-left: auto; }

@media (max-width: 520px) {
  .pair { flex-wrap: wrap; }
  .pair input { flex: 1 1 100%; }
  .people .email { flex-basis: 100%; order: 3; }
}
