:root {
  color-scheme: light dark;
  --text: #1a1a1a;
  --muted: #555;
  --background: #fff;
  --accent: #0b57d0;
  --accent-text: #fff;
  --error: #b3261e;
  --success: #146c2e;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ececec;
    --muted: #b0b0b0;
    --background: #121212;
    --accent: #8ab4f8;
    --accent-text: #0b1d3a;
    --error: #f2b8b5;
    --success: #9cd67d;
  }
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
}

main {
  max-width: 32rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
}

h1:focus {
  outline: none;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--error);
}

.success {
  color: var(--success);
}

button {
  font: inherit;
  font-weight: 600;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  color: var(--accent-text);
  background: var(--accent);
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h2 {
  font-size: 1rem;
  margin-top: 1.5rem;
}

.amount {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.details dd small {
  display: block;
  font-size: 0.8125rem;
}

label {
  display: block;
  margin-top: 1.5rem;
  font-weight: 600;
}

textarea {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  min-height: 4rem;
  margin: 0.5rem 0 1rem;
  padding: 0.5rem;
  border: 1px solid var(--muted);
  border-radius: 0.5rem;
  color: var(--text);
  background: var(--background);
}

button + button,
button + label {
  margin-top: 1rem;
}

button.secondary {
  color: var(--error);
  background: transparent;
  border: 2px solid var(--error);
}
