:root {
  --ink: #1f2328;
  --muted: #5d6670;
  --line: #d9dde1;
  --ground: #fbfaf7;
  --accent: #2f6f5e;
  --accent-ink: #ffffff;
  --error: #a3261b;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e6e3;
    --muted: #a0a7ae;
    --line: #3a3f45;
    --ground: #17191c;
    --accent: #6fbfa8;
    --accent-ink: #10201b;
    --error: #ff8a7d;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.menu a {
  color: var(--muted);
  text-decoration: none;
}

.menu a.current {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.menu form {
  margin: 0;
}

.main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.narrow {
  max-width: 24rem;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 0.75rem;
}

section + section {
  border-top: 1px solid var(--line);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
}

.form label {
  font-weight: 600;
  margin-top: 0.75rem;
}

.form label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}

input[type=text],
input[type=password],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

input[type=checkbox] {
  width: 1.2rem;
  height: 1.2rem;
}

button,
.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.form button {
  align-self: flex-start;
  margin-top: 1rem;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

button.link {
  padding: 0;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
}

.hint,
.meta {
  margin: 0;
  color: var(--muted);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.error {
  color: var(--error);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.list a {
  display: block;
  overflow-wrap: anywhere;
}

.files {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.busy {
  padding: 1rem 0;
}

.busy p:first-child::before {
  content: "";
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.5rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.hidden {
  display: none;
}

.summary {
  margin-top: 1rem;
}

.summary table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.summary th,
.summary td {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  text-align: left;
}

.danger-zone {
  margin-top: 3rem;
}
