/* One stylesheet, no images or icon fonts. Tokens on :root, dark theme below. */
:root {
  --accent: #0b7a75;
  --accent-soft: #e3f2f1;
  --link: #1a5fb4;
  --visited: #613583;
  --ok: #1e7b34;
  --ok-soft: #e6f4ea;
  --warn: #9a6700;
  --warn-soft: #fff8c5;
  --error: #b42318;
  --error-soft: #fdecea;
  --text: #1b1f24;
  --muted: #57606a;
  --surface: #fff;
  --surface-2: #f6f8fa;
  --border: #d0d7de;
  --shadow: 0 1px 3px rgba(27, 31, 36, 0.12);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #3fb8af;
    --accent-soft: #0f2e2c;
    --link: #78aeed;
    --visited: #c4a7e7;
    --ok: #57c46b;
    --ok-soft: #10291a;
    --warn: #e0b341;
    --warn-soft: #2e2508;
    --error: #ff7b72;
    --error-soft: #35110f;
    --text: #e6edf3;
    --muted: #9da7b1;
    --surface: #0d1117;
    --surface-2: #161b22;
    --border: #30363d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}
* {
  box-sizing: border-box;
}
html {
  font:
    16px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    sans-serif;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
}
main,
.site-header,
.site-footer {
  max-width: 36em;
  margin: 0 auto;
  padding: 0 1rem;
}
main {
  padding-bottom: 3rem;
}
h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 1.5rem 0 0.5rem;
}
h2 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.5rem;
}
h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.25rem;
}
p,
ul,
ol {
  margin: 0.5rem 0;
}
a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
a:visited {
  color: var(--visited);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.site-header .brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.9rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card > h2:first-child,
.card > h3:first-child {
  margin-top: 0;
}
.notice {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.notice.ok {
  background: var(--ok-soft);
  border-color: var(--ok);
}
.notice.warn {
  background: var(--warn-soft);
  border-color: var(--warn);
}
.notice.error {
  background: var(--error-soft);
  border-color: var(--error);
}
.ok-text {
  color: var(--ok);
}
.warn-text {
  color: var(--warn);
}
.error-text {
  color: var(--error);
}
label {
  display: block;
  font-weight: 600;
  margin: 1rem 0 0.25rem;
}
.hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9rem;
}
input,
select,
textarea {
  font: inherit;
  font-weight: 400;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  width: 100%;
  min-height: 44px;
}
textarea {
  min-height: 8rem;
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin: 0.15rem 0.5rem 0 0;
  flex: none;
  accent-color: var(--accent);
}
.check {
  display: flex;
  align-items: flex-start;
  font-weight: 400;
  margin: 0.75rem 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.row > * {
  flex: 1 1 10rem;
}
button,
.button {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--button-text);
  text-decoration: none;
  cursor: pointer;
}
.button:visited {
  color: var(--button-text);
}
button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--accent);
}
button.link {
  background: none;
  border: none;
  color: var(--link);
  text-decoration: underline;
  padding: 0.25rem 0;
  min-height: 44px;
  font-weight: 400;
}
/* One row per draft: titles wrap in the first column, so every delete button lines up. */
.draft-list {
  list-style: none;
  padding: 0;
}
.draft-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}
.draft-list button.link {
  justify-content: flex-start;
  text-align: start;
  overflow-wrap: anywhere;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.search {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}
.search input {
  flex: 1;
}
.results {
  list-style: none;
  padding: 0;
}
.results li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.results .url {
  color: var(--ok);
  font-size: 0.9rem;
  word-break: break-all;
}
.facts {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.facts li {
  margin: 0.15rem 0;
}
.steps {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  color: var(--muted);
}
.steps li {
  flex: 1;
  border-top: 4px solid var(--border);
  padding-top: 0.25rem;
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 0;
}
.steps li[aria-current="step"] {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}
.steps li.done {
  border-color: var(--ok);
}
progress {
  width: 100%;
  height: 1rem;
  accent-color: var(--accent);
}
.milestones {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.05em;
}
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.recovery-code {
  font-family: ui-monospace, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
}
.preview-banner {
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 600;
}
details {
  margin: 0.75rem 0;
}
.optional {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}
summary {
  cursor: pointer;
  color: var(--link);
  min-height: 44px;
  display: flex;
  align-items: center;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th,
td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.pages canvas,
.pages img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  margin: 1rem 0;
  background: #fff;
}
.hidden,
[hidden] {
  display: none !important;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .pages canvas,
  .pages img {
    border: none;
    margin: 0;
    page-break-after: always;
    width: 100%;
  }
}
.field-status {
  display: block;
  min-height: 1.5em;
}

.field-dependent {
  margin-left: 2rem;
}
.signature-count {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0.25rem 0;
}
.support-count {
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
}
.support-count details {
  margin: 0;
  flex-basis: 100%;
}
.account-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1rem 0;
}
[aria-current="page"],
[aria-current="step"] {
  font-weight: 700;
  text-decoration: underline;
}
#editor-errors:empty {
  display: none;
}
#editor-errors {
  border-left: 3px solid var(--warn);
  padding-left: 1rem;
}

.support-count .milestones,
#goals-field {
  flex-basis: 100%;
}
.field-error {
  color: var(--error);
  margin: 0.25rem 0;
  font-weight: 400;
}
.section {
  scroll-margin-top: 1rem;
}
.preparation-topics li {
  margin-bottom: 0.8rem;
}

/* Author branding uses fixed pairs. The viewer's colour scheme remains in control. */
:root {
  --button-text: #fff;
}
body[data-petition-theme="mint"] {
  --accent: #0b7a75;
  --accent-soft: #e3f2f1;
}
body[data-petition-theme="blue"] {
  --accent: #245aa8;
  --accent-soft: #e8effa;
}
body[data-petition-theme="plum"] {
  --accent: #753a88;
  --accent-soft: #f3eafa;
}
body[data-petition-theme="ochre"] {
  --accent: #805500;
  --accent-soft: #fff3d6;
}
/* Crimson, kept bluer and darker than --error so it never reads as an alert. */
body[data-petition-theme="red"] {
  --accent: #951238;
  --accent-soft: #fce8ee;
}
body[data-petition-theme="indigo"] {
  --accent: #4b3fb0;
  --accent-soft: #ecebfb;
}
body[data-petition-theme="graphite"] {
  --accent: #424a53;
  --accent-soft: #eef0f2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --button-text: #0d1117;
  }
  body[data-petition-theme="mint"] {
    --accent: #3fb8af;
    --accent-soft: #0f2e2c;
  }
  body[data-petition-theme="blue"] {
    --accent: #8ab4f8;
    --accent-soft: #17243b;
  }
  body[data-petition-theme="plum"] {
    --accent: #cba5df;
    --accent-soft: #2e1b39;
  }
  body[data-petition-theme="ochre"] {
    --accent: #e5bb66;
    --accent-soft: #30250f;
  }
  body[data-petition-theme="red"] {
    --accent: #ff94a8;
    --accent-soft: #3a1420;
  }
  body[data-petition-theme="indigo"] {
    --accent: #a8a3f7;
    --accent-soft: #1e1c3d;
  }
  body[data-petition-theme="graphite"] {
    --accent: #b6bec8;
    --accent-soft: #22272e;
  }
}
.author-thanks-text,
.author-thanks {
  white-space: pre-wrap;
}
