:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6860;
  --border: #dcd9d0;
  --accent: #1f5f3f;
  --accent-text: #ffffff;
  --error: #b42318;
  --success: #1f5f3f;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1d1c1a;
    --text: #edebe6;
    --muted: #a19e95;
    --border: #3a3833;
    --accent: #5fbf8a;
    --accent-text: #0e1a13;
    --error: #f97066;
    --success: #5fbf8a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 16px 40px;
}

h2 { margin: 0 0 6px; font-size: 1.25rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.invocations {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
}

.verse {
  margin: 20px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--muted);
}

.mission { margin: 24px 0 0; font-size: 1.1rem; }

.total {
  margin: 36px 0;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.total-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.total-amount {
  margin: 4px 0 0;
  font-size: clamp(2.5rem, 12vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.total-count { margin: 4px 0 0; color: var(--muted); min-height: 1.55em; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.note { margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; }

.field { margin-bottom: 16px; }

label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.95rem; }

.optional { color: var(--muted); font-weight: 400; }

input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

input[aria-invalid="true"] { border-color: var(--error); }

.money { position: relative; }
.money span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.money input { padding-left: 26px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

button {
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.6; cursor: wait; }

.status { margin: 14px 0 0; min-height: 1.55em; font-weight: 600; }
.status.error { color: var(--error); }
.status.success { color: var(--success); }

footer { margin-top: 28px; color: var(--muted); font-size: 0.85rem; }
footer p { margin: 0; }
