:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --line: #e2e2e2;
  --field: #ffffff;
  --button: #111111;
  --button-text: #ffffff;
  --ok: #1d6b35;
  --error: #b00020;
  --note-bg: #f4f4f4;
  --font: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --text: #ededed;
    --muted: #9a9a9a;
    --line: #2e2e2e;
    --field: #1b1b1b;
    --button: #ededed;
    --button-text: #121212;
    --ok: #74c58c;
    --error: #ff8a80;
    --note-bg: #1b1b1b;
  }
}
:root[data-theme="dark"] {
  --bg: #121212;
  --text: #ededed;
  --muted: #9a9a9a;
  --line: #2e2e2e;
  --field: #1b1b1b;
  --button: #ededed;
  --button-text: #121212;
  --ok: #74c58c;
  --error: #ff8a80;
  --note-bg: #1b1b1b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 19px/1.6 var(--font);
}
main { max-width: 840px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; text-underline-offset: 2px; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.15rem; }

section { padding: 2rem 0; border-top: 1px solid var(--line); }

.hero { padding: 4rem 0 2.5rem; }
.kicker { color: var(--muted); margin: 0 0 0.4rem; }
.counter { margin: 0 0 1.4rem; }
.counter a { text-decoration: none; }
#count-total { font-weight: 600; }
.counter-detail { color: var(--muted); }
.counter-detail::before { content: " · "; }

.part-label { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.15rem; margin: 0 0 1rem; }
.part-label span {
  display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem;
  border-radius: 50%; background: var(--text); color: var(--bg); font-size: 0.95rem;
}
.paper { border: 1px solid var(--line); padding: 2rem 1.75rem; }
.paper > :last-child { margin-bottom: 0; }
.recipients { font-style: normal; color: var(--muted); font-size: 0.92rem; margin-bottom: 1.5rem; }
.asks li { margin-bottom: 0.6em; }
.signoff { margin-top: 1.5rem; }

.pledge { list-style: none; padding: 0; margin: 1rem 0 0; counter-reset: pledge; }
.pledge li {
  counter-increment: pledge; position: relative; padding: 1rem 1.2rem 1rem 3.2rem; margin-bottom: 0.6rem;
  border-left: 4px solid var(--text); background: var(--note-bg); font-size: 1.15rem; font-weight: 600; line-height: 1.4;
}
.pledge li::before { content: counter(pledge) "."; position: absolute; left: 1.2rem; top: 1rem; }
@media (max-width: 480px) { .paper { padding: 1.25rem 1rem; } }
ol { padding-left: 1.4em; }
ol li { margin-bottom: 0.4em; }

.button {
  display: inline-block; background: var(--button); color: var(--button-text);
  border: 1px solid var(--button); border-radius: 3px; padding: 0.5em 1.2em;
  font: 600 1rem var(--font); text-decoration: none; cursor: pointer;
}
.button:hover { opacity: 0.85; }
.button:disabled { opacity: 0.5; cursor: wait; }
.button.secondary { background: none; color: var(--text); border-color: var(--line); }

.note { color: var(--muted); font-size: 0.9rem; }

form { display: grid; gap: 1rem; margin-top: 1rem; }
label { display: grid; gap: 0.25rem; font-size: 0.95rem; }
input, select {
  font: 1rem var(--font); color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: 3px; padding: 0.45em 0.6em; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--text); outline-offset: -1px; }
.watiam { display: flex; }
.watiam input { border-radius: 3px 0 0 3px; min-width: 0; }
.suffix {
  display: flex; align-items: center; padding: 0 0.6em; border: 1px solid var(--line); border-left: 0;
  border-radius: 0 3px 3px 0; background: var(--note-bg); color: var(--muted); white-space: nowrap;
}
label.check { grid-template-columns: auto 1fr; align-items: start; gap: 0.6rem; }
label.check input { width: 1rem; height: 1rem; margin-top: 0.3rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.privacy { background: var(--note-bg); padding: 0.8rem 1rem; font-size: 0.9rem; margin: 0; }
.msg { margin: 0; min-height: 1.4em; color: var(--error); }
.signed { border: 1px solid var(--line); padding: 1.2rem; margin-top: 1rem; }
.signed input { font-size: 0.85rem; }

.signatures, .endorsements { list-style: none; padding: 0; margin: 0; }
.signatures li, .endorsements li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.1rem 0.6rem; align-items: baseline; }
.who { font-weight: 600; }
.meta { color: var(--muted); font-size: 0.92rem; }
.tag { font-size: 0.8rem; color: var(--muted); font-style: italic; }
.tag.verified { color: var(--ok); }
.empty { color: var(--muted); }
.more { margin-top: 1rem; }

.faq details { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 0.5rem 0 0.2rem; }

footer { max-width: 840px; margin: 0 auto; padding: 2rem 16px 3rem; color: var(--muted); font-size: 0.85rem; }

/* admin + remove pages */
.admin { padding-top: 2rem; padding-bottom: 4rem; }
.login { max-width: 360px; margin: 3rem auto; }
.admin-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1rem; }
.admin-bar h1 { font-size: 1.6rem; margin: 0; }
.admin-bar .note { margin: 0; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0 1.4rem; border-bottom: 1px solid var(--line); margin: 1.5rem 0 1rem; }
.admin-tabs button {
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  padding: 0.5rem 0; font: 1rem var(--font); color: var(--muted); cursor: pointer;
}
.admin-tabs button[aria-current] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.count:not(:empty) { font-size: 0.85rem; background: var(--note-bg); padding: 0.05em 0.5em; border-radius: 999px; margin-left: 0.2rem; }
.help { background: var(--note-bg); padding: 0.7rem 1rem; font-size: 0.92rem; margin: 0 0 1rem; }
.help ol { margin: 0; padding-left: 1.2em; }
.help li { margin: 0.15em 0; }
.admin-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.admin-main { min-width: 0; flex: 1 1 320px; }
.admin-main .meta { margin-top: 0.15rem; overflow-wrap: anywhere; }
.admin-row .actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.admin-row .actions .button { padding: 0.3em 0.8em; font-size: 0.9rem; }
.pill { font-size: 0.78rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.05em 0.55em; margin-left: 0.5rem; color: var(--muted); }
.not-emailed { color: var(--error); }
.button.danger { color: var(--error); }
.endorse-form { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 0.6rem; align-items: end; margin: 0 0 1rem; }
@media (max-width: 560px) { .endorse-form { grid-template-columns: 1fr; } }
code { font-size: 0.9em; }

/* Avoid stacked rules: the letter box's bottom border already separates it from the pledge,
   and the next section's top border closes the signature lists. */
#pledge { border-top: 0; padding-top: 1rem; }
.signatures li:last-child, .endorsements li:last-child { border-bottom: 0; }
.faq details:last-of-type { border-bottom: 0; }
.verify-banner { border: 2px solid var(--error); padding: 1rem 1.2rem; margin-top: 1.5rem; }
.verify-banner p { margin: 0 0 0.6rem; }
.verify-title { color: var(--error); font-weight: 600; font-size: 1.1rem; }
.verify-banner.done { border-color: var(--ok); }
.verify-banner.done .verify-title { color: var(--ok); margin: 0; }
.verify-fields { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.8rem; margin: 0 0 0.8rem; align-items: baseline; }
.verify-fields dt { font-weight: 600; }
.verify-fields dd { margin: 0; overflow-wrap: anywhere; }
.verify-status { color: var(--muted); font-size: 0.92rem; }
.copy { font: 0.8rem var(--font); background: none; border: 1px solid var(--line); border-radius: 3px; color: var(--text); padding: 0.05em 0.5em; cursor: pointer; }
.note code { overflow-wrap: anywhere; }
.verify-status:empty { display: none; }
