/* Pearl Invoice — "ledger book" theme: deep pine green, warm cream paper, gold ink. */
:root {
  --pine-900: #07170f;
  --pine-800: #0c241a;
  --pine-700: #123322;
  --pine-600: #1b4a32;
  --cream: #f5ecd7;
  --cream-dim: #d9cba8;
  --gold: #c9a227;
  --gold-bright: #e8c54a;
  --ink: #2a2418;
  --red: #b3402e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, var(--pine-600), var(--pine-900)) fixed, var(--pine-900);
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
  min-height: 100vh;
}
.ledger-head { text-align: center; padding: 34px 16px 8px; }
.ledger-head h1 { font-size: 2.6rem; margin: 6px 0; letter-spacing: 0.04em; color: var(--gold-bright); }
.seal { color: var(--gold); }
.tagline { color: var(--cream-dim); font-style: italic; margin: 0 0 14px; }
.ledger-rule {
  height: 3px; max-width: 760px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.tabs { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.tab {
  background: transparent; border: 1px solid var(--gold); color: var(--cream);
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 1rem;
}
.tab.active { background: var(--gold); color: var(--pine-900); font-weight: bold; }

main, #inv-verify-wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.stepper { list-style: none; display: flex; gap: 6px; padding: 18px 0 6px; margin: 0; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 110px; }
.step {
  width: 100%; background: var(--pine-800); color: var(--cream-dim);
  border: 1px solid var(--pine-600); border-radius: 10px; padding: 10px 6px;
  cursor: pointer; font-family: inherit; font-size: 0.95rem;
}
.step .n {
  display: inline-block; width: 1.6em; height: 1.6em; line-height: 1.6em; text-align: center;
  border-radius: 50%; background: var(--pine-600); color: var(--cream); margin-right: 6px;
}
.step.active { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 0 14px rgba(201,162,39,0.25); }
.step.active .n { background: var(--gold); color: var(--pine-900); font-weight: bold; }
.step.done .n { background: var(--pine-600); }

.paper {
  background: var(--cream); color: var(--ink);
  border-radius: 6px; padding: 26px 30px; margin: 14px 0;
  box-shadow: 0 10px 34px rgba(0,0,0,0.5), inset 0 0 60px rgba(201,162,39,0.07);
  border-top: 4px double var(--gold); border-bottom: 4px double var(--gold);
}
.paper h2 { margin-top: 0; color: var(--pine-800); border-bottom: 1px solid var(--gold); padding-bottom: 8px; }
.paper h3 { color: var(--pine-700); margin-bottom: 6px; }
.lede { font-style: italic; color: #5a4f35; }
.dim { color: #6e6040; font-size: 0.9rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85rem; overflow-wrap: anywhere; }
.gold-ink { color: #8a6d14; }
.strong { font-weight: bold; }
.sealbox { background: var(--pine-800); color: var(--gold-bright); padding: 14px; border-radius: 6px; border: 1px solid var(--gold); }
.sealbox.wrap { white-space: pre-wrap; }
.canon summary { cursor: pointer; color: var(--pine-700); font-weight: bold; }
.canon pre { background: #efe4c6; padding: 12px; border-radius: 6px; overflow-x: auto; }

.field { display: block; margin: 12px 0; font-weight: bold; color: var(--pine-800); }
.field input, .field textarea, #inv-txid-paste {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid #b9a86f; border-radius: 6px; background: #fffdf4;
  font-family: inherit; font-size: 1rem; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.items { width: 100%; border-collapse: collapse; margin: 8px 0; }
.items th, .items td { border-bottom: 1px dashed #b9a86f; padding: 8px 6px; text-align: left; }
.items th { color: var(--pine-700); font-size: 0.9rem; }
.items th.amt, .items td:nth-child(2) { text-align: right; }
.items input { width: 100%; padding: 8px; border: 1px solid #b9a86f; border-radius: 4px; background: #fffdf4; font-family: inherit; }
.inv-item-amt { text-align: right; }
.inv-rm { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1.1rem; min-width: 28px; min-height: 28px; line-height: 1; }

.btn {
  background: var(--pine-700); color: var(--cream); border: 1px solid var(--pine-600);
  padding: 10px 18px; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 1rem; margin: 6px 6px 6px 0;
}
.btn:hover { filter: brightness(1.12); }
.btn.gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--pine-900); font-weight: bold; border: none; }
.btn.ghost { background: transparent; color: var(--pine-700); border: 1px dashed var(--pine-600); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.grow { flex: 1; min-width: 200px; }
.chk { display: inline-flex; gap: 6px; align-items: center; color: var(--pine-800); }
.hint { min-height: 1.2em; font-weight: bold; color: var(--pine-700); }
.hint.warn { color: var(--red); }
.note { background: #efe4c6; border-left: 4px solid var(--gold); padding: 10px 14px; border-radius: 0 6px 6px 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 6px 0; border-bottom: 1px dotted #b9a86f; }

.qr-wrap { display: flex; justify-content: center; padding: 16px; }
.qr { background: #fff; padding: 14px; border: 3px double var(--gold); border-radius: 8px; }
.qr svg { display: block; width: 220px; height: 220px; }

.watch-state { font-size: 1.25rem; font-weight: bold; padding: 14px; border-radius: 8px; margin: 12px 0; background: #efe4c6; border: 1px solid var(--gold); }
.watch-state.unpaid { color: #7a2e1f; border-color: var(--red); }
.watch-state.partial { color: #8a6d14; }
.watch-state.paid { color: var(--pine-600); border-color: var(--pine-600); }

.verdict { font-size: 1.2rem; font-weight: bold; padding: 14px; border-radius: 8px; margin: 10px 0; }
.verdict.good { background: #dcead2; color: #1d4a2a; border: 2px solid #2e7d43; }
.verdict.bad { background: #f3d7d0; color: #7a1f12; border: 2px solid var(--red); }

.banner { max-width: 820px; margin: 12px auto; padding: 14px 18px; border-radius: 8px; font-weight: bold; }
.banner.error { background: #f3d7d0; color: #7a1f12; border: 2px solid var(--red); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--pine-800); color: var(--gold-bright); border: 1px solid var(--gold);
  padding: 10px 22px; border-radius: 999px; z-index: 50; font-weight: bold;
}
.limits { border-top-color: var(--red); }
.limits h2 { color: #7a2e1f; border-bottom-color: var(--red); }
.limits li { margin: 6px 0; }

.ledger-foot { text-align: center; padding: 26px 16px 40px; color: var(--cream-dim); }
.ledger-foot a { color: var(--gold-bright); }
.ledger-foot .dim { color: var(--cream-dim); }

/* Keyboard focus: a visible ring in this app's accent on every interactive element (fleet focus-visible pass). */
:focus-visible { outline: 2px solid var(--gold); 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(--gold); border-radius: 8px; background: #0b0e14; color: var(--gold); 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; }
}
