:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fb;
  color: #111827;
}

body {
  margin: 0;
}

a {
  color: #2563eb;
}

button,
.button {
  border: 0;
  border-radius: 6px;
  background: #111827;
  color: white;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

input,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  box-sizing: border-box;
  width: 100%;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.topbar h1 {
  font-size: 20px;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.layout {
  display: grid;
  gap: 18px;
  padding: 24px;
  max-width: 1120px;
  margin: 0 auto;
}

section,
.login-panel,
.donate-panel {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
}

section h2 {
  margin-top: 0;
}

.auth-page,
.donate-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel,
.donate-panel {
  width: min(440px, calc(100vw - 32px));
}

.login-panel form,
.donate-panel form,
.grid-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 16px;
}

.toggle-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.toggle-form label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-form input {
  width: auto;
}

.state-label {
  font-weight: 800;
}

.state-label.enabled {
  color: #047857;
}

.state-label.disabled {
  color: #b91c1c;
}

.template-list {
  display: grid;
  gap: 12px;
}

.template {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  gap: 10px;
  align-items: center;
}

.list p {
  padding: 10px 0;
  margin: 0;
  border-bottom: 1px solid #e5e7eb;
}

.status-panel {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.status-panel p {
  margin: 4px 0;
}

code {
  overflow-wrap: anywhere;
}

.error {
  color: #dc2626;
}

@media (max-width: 720px) {
  .template,
  .inline-form {
    grid-template-columns: 1fr;
  }
}
