:root {
  --red: #C8102E; --red-deep: #8E0E22; --ink: #1A1A1A; --muted: #6B7280;
  --surface: #F6F7F9; --card: #FFFFFF; --line: #E5E7EB; --good: #1F7A4D; --bad: #B91C1C;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/1.5 -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif; }
a { color: var(--red); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.mark { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 22px; height: 22px; }
.mark i { display: block; background: #D1D5DB; border-radius: 3px; }
.mark i.on { background: var(--red); }
.top nav { display: flex; gap: 16px; align-items: center; }
.top nav a { text-decoration: none; color: var(--ink); font-weight: 600; }
.wrap { max-width: 760px; margin: 40px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card.narrow { max-width: 560px; margin: 0 auto; }
h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -0.02em; }
.lead { margin: 0 0 22px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input:not([type]) {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff;
}
input:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.slugrow { display: flex; align-items: center; gap: 8px; }
.slugrow input { flex: 1; }
.suffix { color: var(--muted); white-space: nowrap; }
.msg { font-style: normal; font-size: 13px; color: var(--muted); min-height: 18px; }
.msg.good { color: var(--good); } .msg.bad { color: var(--bad); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.span2 { grid-column: 1 / -1; }
.opt { color: var(--muted); font-weight: 400; }
.wizard { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 22px; }
.wizard-step { flex: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 10px; border-bottom: 3px solid var(--line); text-transform: uppercase; letter-spacing: .04em; }
.wizard-step.current { color: var(--ink); border-color: var(--red); }
.wizard-step.done { color: var(--ink); border-color: var(--red); opacity: .55; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
select:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.plans { border: 0; padding: 0; margin: 4px 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plans legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.plan:has(input:checked) { border-color: var(--red); box-shadow: 0 0 0 2px rgba(200,16,46,.15); }
.plan input { position: absolute; opacity: 0; }
.plan-name { font-weight: 700; } .plan-price { font-size: 22px; font-weight: 800; } .plan-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.plan-note { font-size: 12px; color: var(--muted); }
.btn { display: inline-block; background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--red-deep); } .btn:disabled { opacity: .6; cursor: default; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.error { color: var(--bad); min-height: 20px; margin: 0 0 8px; }
.hint { font-size: 13px; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code { background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.results { list-style: none; padding: 0; margin: 0 0 12px; }
.results li a { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; text-decoration: none; color: var(--ink); font-weight: 600; }
.results li a:hover { border-color: var(--red); }
.results li a small { color: var(--muted); font-weight: 400; }
.results li.empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }
.steps { list-style: none; padding: 0; margin: 0 0 20px; }
.steps li { display: flex; flex-direction: column; padding: 10px 12px 10px 38px; position: relative; border-left: 2px solid var(--line); margin-left: 10px; }
.steps li::before { content: ""; position: absolute; left: -8px; top: 15px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--line); }
.steps li.running::before { border-color: var(--red); animation: pulse 1s infinite alternate; }
.steps li.done::before, .steps li.skipped::before { background: var(--red); border-color: var(--red); }
.steps li.failed::before { background: var(--bad); border-color: var(--bad); }
.steps li.pending b { color: var(--muted); font-weight: 500; }
.steps li small { color: var(--muted); }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(200,16,46,.35); } to { box-shadow: 0 0 0 6px rgba(200,16,46,0); } }
.big { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.code { font-size: 20px; letter-spacing: .12em; font-weight: 700; }
.done, .failed { border-top: 1px solid var(--line); padding-top: 18px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px; }
@media (max-width: 640px) { .grid, .plans { grid-template-columns: 1fr; } .card { padding: 22px; } h1 { font-size: 24px; } .wrap { margin: 20px auto; } }

/* admin console */
.admin { max-width: 1040px; }
.admin-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.tokenform { display: flex; gap: 8px; align-items: center; }
.tokenform input { width: 220px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.admin-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; margin-top: 12px; }
.church-list { list-style: none; padding: 0; margin: 0; border-right: 1px solid var(--line); padding-right: 12px; }
.church-btn { width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.church-btn:hover { background: var(--surface); }
.church.current .church-btn { border-color: var(--red); background: #fff; }
.church-btn small { color: var(--muted); }
.meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.pill { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.pill.active { background: #E6F4EC; color: var(--good); }
.pill.failed, .pill.suspended { background: #FDE8E8; color: var(--bad); }
.pill.provisioning { background: #FFF1F3; color: var(--red); }
.pill.off { background: #EEF0F3; color: var(--ink); }
.church-list .empty { color: var(--muted); padding: 8px; }
.detail-head h2 { margin: 0; font-size: 22px; }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 12px 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.actions { display: flex; gap: 8px; margin-bottom: 8px; }
.btn.ghost { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn.ghost:hover { background: #FFF1F3; }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid var(--bad); }
.btn.danger:hover { background: #FDE8E8; }
.pill.deleted { background: #EEE; color: #666; }
.pages fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pages legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
.page { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.page input { accent-color: var(--red); width: 16px; height: 16px; }
.savebar { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
h3 { margin: 18px 0 4px; font-size: 16px; }
@media (max-width: 760px) { .admin-grid { grid-template-columns: 1fr; } .church-list { border-right: 0; padding-right: 0; } }

/* The wizard toggles steps and the "other software" box with the hidden
   attribute; make sure no display rule on those wrappers beats it. */
[hidden] { display: none !important; }
