/* Pearl Covenant — oath-seal theme: midnight violet, deep indigo, amber seal. */
:root {
  --bg: #0d0a1c;
  --bg2: #120e28;
  --panel: #161130;
  --panel2: #1c1539;
  --line: #3a2f6b;
  --ink: #f0ecff;
  --muted: #a79fd4;
  --amber: #f0b64c;
  --amber-hi: #ffd98a;
  --amber-dim: #8a6a30;
  --green: #8fd6a0;
  --red: #ef9a8d;
  --code: #0b0819;
  --violet: #8f7bff;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 50% -10%, #1e1650 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--ink); font: 16px/1.55 -apple-system, "Segoe UI", Roboto, sans-serif;
}
.topbar {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; border-bottom: 2px solid var(--amber-dim);
  background: linear-gradient(180deg, #17123a, #0d0a1c);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; gap: .8rem; align-items: center; }
.brand .seal { width: 40px; height: 40px; color: var(--amber); }
.brand h1 { margin: 0; font-size: 1.5rem; letter-spacing: .02em; color: var(--amber-hi); font-family: Georgia, "Times New Roman", serif; }
.tagline { margin: 0; color: var(--muted); font-size: .9rem; }
.steps { display: flex; gap: .4rem; flex-wrap: wrap; }
.steps button {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: .45rem .8rem; border-radius: 999px; cursor: pointer; font-size: .85rem;
}
.steps button.active { border-color: var(--amber); color: var(--amber-hi); background: #241b4d; }
.steps button.done { border-color: var(--green); color: var(--green); }
main { max-width: 980px; margin: 0 auto; padding: 1.5rem; }
.panel { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem; margin-bottom: 1.5rem; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.panel.active { display: block; }
.panel h2 { margin-top: 0; color: var(--amber-hi); font-family: Georgia, serif; }
.panel h3 { color: var(--amber); margin: 1.4rem 0 .6rem; font-family: Georgia, serif; }
.lede { color: var(--muted); max-width: 70ch; }
.lede strong { color: var(--ink); }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin: 1rem 0; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  background: var(--code); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: .6rem .7rem; font-size: .95rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber-dim); border-color: var(--amber); }
input[readonly], textarea[readonly] { color: var(--muted); }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--amber-dim); background: #241b4d; color: var(--amber-hi);
  padding: .55rem 1.1rem; border-radius: 8px; cursor: pointer; font-size: .92rem;
}
.btn:hover:not(:disabled) { border-color: var(--amber); background: #2e2360; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #e8b95a, #b8892f); color: #241a05; border-color: #ffd98a; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f2c96e, #c79536); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--amber-dim); }
.error { background: #3a1d22; border: 1px solid #7a3a44; color: #f2b1a5; padding: .7rem 1rem; border-radius: 8px; margin: .8rem 0; }
.ok { background: #173a26; border: 1px solid #3f7a54; color: #a9e6b4; padding: .7rem 1rem; border-radius: 8px; margin: .8rem 0; }
.hint { color: var(--muted); font-size: .85rem; }
.party-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem; margin: 1rem 0; }
.party-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.party-card h3 { margin: 0 0 .6rem; font-size: 1rem; color: var(--amber-hi); }
.key-ok { font-size: .78rem; color: var(--green); font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.addr-row { display: flex; gap: 1.2rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.addr { font-size: 1.02rem; color: var(--amber-hi); word-break: break-all; }
.addr.small { font-size: .8rem; }
.qr-wrap { margin: 1rem 0; }
.qr-wrap > div { display: inline-block; background: #fff; border-radius: 8px; padding: 6px; }
.qr-wrap img { max-width: 100%; height: auto; display: block; }
table.keys { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .85rem; }
table.keys th, table.keys td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.keys th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.keys td code { font-size: .75rem; color: #d9d2ff; word-break: break-all; }
table.keys tr.selected td { background: #241b4d; }
.badge { font-size: .72rem; background: #241b4d; border: 1px solid var(--amber-dim); color: var(--amber-hi); border-radius: 999px; padding: .1rem .55rem; white-space: nowrap; }
.badge.dim { background: transparent; border-color: var(--line); color: var(--muted); }
.asm { display: block; background: var(--code); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; font-size: .82rem; color: #d9d2ff; word-break: break-all; white-space: pre-wrap; }
details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.summary { background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin: .8rem 0; font-size: .88rem; }
.summary .krow { display: grid; grid-template-columns: 130px 1fr; gap: .8rem; padding: .2rem 0; }
.summary .krow dt { color: var(--muted); }
.summary .krow dd { margin: 0; word-break: break-all; }
.summary .krow dd code { font-size: .78rem; color: #d9d2ff; }
.balance { font-size: 1rem; color: var(--amber-hi); font-weight: 600; }
.pay-row { display: grid; grid-template-columns: 1fr 180px 40px; gap: .6rem; margin-bottom: .6rem; align-items: end; }
.quorum { height: 14px; background: var(--code); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: .6rem 0 .2rem; }
.quorum > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--amber)); transition: width .3s; }
footer { max-width: 980px; margin: 0 auto; padding: 1.5rem; color: var(--muted); font-size: .85rem; text-align: center; }
footer a { color: var(--amber-hi); }
footer .donate code { font-size: .75rem; color: var(--amber-hi); word-break: break-all; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .pay-row { grid-template-columns: 1fr; }
  .summary .krow { grid-template-columns: 1fr; }
  .topbar { position: static; }
  table.keys { display: block; overflow-x: auto; }
}

/* Keyboard focus: a visible ring in this app's accent on every interactive element (fleet focus-visible pass). */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Skip link: the first Tab stop on the page — parked off-screen until keyboard focus reveals it (fleet skip-link pass). */
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 1000; padding: 10px 16px; border: 2px solid var(--amber); border-radius: 8px; background: #0b0e14; color: var(--amber); font-weight: 700; text-decoration: none; transition: top .15s ease; }
.skip-link:focus-visible { top: 12px; }
main:focus { outline: none; }

/* Reduced motion: when the OS asks for reduced motion, animations and transitions finish near-instantly and scrolling is not smoothed (fleet reduced-motion pass). Near-zero durations — not animation: none — so fade-ins still land on their end state and no content can be stranded invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
