:root {
  --bg: #ffffff;
  --fg: #16181d;
  --muted: #6b7280;
  --rule: #e5e7eb;
  --accent: #7c3aed;
  --accent-2: #d97706;
  --danger: #dc2626;
  --card: #fafafa;
  --content: 900px;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --fg: #e6e8ec; --muted: #9aa1ac; --rule: #262a31;
    --accent: #a78bfa; --accent-2: #f59e0b; --card: #161a21;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted, .note, .help { color: var(--muted); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .5rem; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--rule); gap: 1rem;
}
.brand { font-weight: 700; color: var(--fg); }
.brand span { color: var(--muted); font-weight: 400; }
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.inline-form { display: inline; margin: 0; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.content { max-width: var(--content); margin: 2rem auto; padding: 0 1.2rem; }
.site-footer { max-width: var(--content); margin: 3rem auto 2rem; padding: 1rem 1.2rem 0;
  border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }

.hero { padding: 2rem 0; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.cta-row { display: flex; gap: .6rem; margin-top: 1rem; }

.btn {
  display: inline-block; padding: .55rem .9rem; border-radius: var(--radius);
  background: var(--accent); color: #fff; border: 1px solid transparent; cursor: pointer;
  font: inherit; text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--rule); }
.btn-danger { background: var(--danger); }
.btn-google { background: #fff; color: #16181d; border-color: var(--rule); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.actions { display: flex; gap: .5rem; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.msg { padding: .6rem .8rem; border-radius: var(--radius); border: 1px solid var(--rule); margin-bottom: .4rem; }
.msg.success { border-color: #16a34a55; }
.msg.error { border-color: #dc262655; }

.card-grid { list-style: none; padding: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 1.2rem; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; }
.card-title { font-weight: 600; font-size: 1.05rem; }
.card-meta { color: var(--muted); font-size: .9rem; margin-top: .2rem; }

.badge { display: inline-block; margin-top: .5rem; padding: .1rem .5rem; border-radius: 999px;
  font-size: .78rem; border: 1px solid var(--rule); color: var(--muted); }
.badge-anchored { color: #16a34a; border-color: #16a34a55; }
.badge-pending { color: var(--accent-2); border-color: #d9770655; }
.badge-failed { color: var(--danger); border-color: #dc262655; }

.stack { display: flex; flex-direction: column; gap: 1rem; max-width: 620px; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
  padding: .5rem .6rem; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: inherit; width: 100%;
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.error { color: var(--danger); font-size: .85rem; }
.checkbox { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.checkbox input { width: auto; margin-top: .2rem; }
.attest { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem; }

.detail { display: grid; grid-template-columns: 160px 1fr; gap: .4rem 1rem; margin: 1rem 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.keybox { background: var(--card); border: 1px solid var(--rule); border-radius: 8px;
  padding: .7rem; overflow-x: auto; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

.attest-table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .9rem; }
.attest-table th, .attest-table td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--rule); }

.divider { color: var(--muted); text-align: center; margin: .8rem 0; }
.empty { color: var(--muted); margin-top: 1.5rem; }

/* Add-printer wizard */
.wiz-steps { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0;
  margin: 0 0 1.3rem; counter-reset: wiz; }
.wiz-steps li { display: flex; align-items: center; gap: .4rem; color: var(--muted);
  font-size: .85rem; padding: .2rem .6rem .2rem .3rem; border-radius: 999px; }
.wiz-steps li::before { counter-increment: wiz; content: counter(wiz);
  width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--rule); font-size: .78rem; }
.wiz-steps li.active { color: var(--fg); }
.wiz-steps li.active::before { background: var(--accent); color: #fff; border-color: transparent; }
.wiz-steps li.done::before { background: var(--rule); color: var(--fg); }

.wizard fieldset.wiz-step { border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1rem 1.1rem 1.2rem; margin: 0 0 1rem; }
.wizard fieldset.wiz-step legend { font-weight: 600; padding: 0 .4rem; }
.wizard .field { max-width: 620px; }
.wizard .help { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.wizard .help code { background: var(--card); border: 1px solid var(--rule);
  border-radius: 5px; padding: .05rem .3rem; font-size: .82rem; }
.help-link { display: inline-block; margin-top: .5rem; font-size: .88rem; }

/* When JS is on, show only the active step. Without JS, all steps show and the single
   Save at the bottom still works. */
.wizard.js fieldset.wiz-step { display: none; }
.wizard.js fieldset.wiz-step.active { display: block; }

.wiz-nav { display: flex; align-items: center; gap: .5rem; max-width: 620px; }
.wiz-spacer { flex: 1; }
