/* Pearl Tax — "midnight auditor" theme.
 * Deep ink-black, gold ledger rules, parchment text, serif display type,
 * mono numerals. Dark luminous Pearl family; its own personality. */
:root {
  --ink: #0b0d12;
  --ink2: #10131b;
  --panel: #141824;
  --line: #2a2f42;
  --gold: #d8b45a;
  --gold-dim: #8a713d;
  --paper: #ece5d3;
  --muted: #9a937f;
  --gain: #58c98a;
  --loss: #e0605e;
  --accent: #7fb2ff;
  --danger: #c0392b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(216, 180, 90, 0.07), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(216, 180, 90, 0.025) 34px 35px),
    var(--ink);
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.mono, code, pre, .ledger td.amt, .amt { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
code { color: var(--gold); font-size: 0.92em; }

/* masthead */
.masthead { border-bottom: 1px solid var(--gold-dim); background: rgba(16, 19, 27, 0.85); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 34px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.72rem; margin: 0 0 8px; font-family: ui-monospace, Menlo, monospace; }
h1 { font-size: 3rem; margin: 0 0 10px; letter-spacing: 0.01em; }
.lede { color: var(--muted); max-width: 62ch; }
.lede.small { font-size: 0.92rem; }
.masthead-seal {
  font-size: 5rem; color: transparent; -webkit-text-stroke: 1.5px var(--gold-dim);
  line-height: 1; user-select: none; flex: none;
}

/* tabs */
.tabs { display: flex; gap: 6px; padding: 18px 20px 0; flex-wrap: wrap; }
.tab {
  background: transparent; border: 1px solid var(--line); border-bottom: none;
  color: var(--muted); padding: 10px 16px; cursor: pointer; border-radius: 8px 8px 0 0;
  font-family: inherit; font-size: 0.95rem;
}
.tab .n {
  display: inline-block; width: 1.5em; height: 1.5em; line-height: 1.5em; text-align: center;
  border: 1px solid var(--gold-dim); border-radius: 50%; color: var(--gold);
  font-size: 0.8em; margin-right: 8px; font-family: ui-monospace, Menlo, monospace;
}
.tab.active { background: var(--panel); color: var(--paper); border-color: var(--gold-dim); }
.tab:hover { color: var(--paper); }

/* panels */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 28px; margin: 22px 0;
}
.panel h2 { margin: 0 0 6px; font-size: 1.5rem; }
.panel h3 { color: var(--gold); margin: 26px 0 8px; font-size: 1.1rem; font-weight: normal; letter-spacing: 0.04em; }
.panel h3.danger { color: var(--loss); }
.limits { border-color: var(--gold-dim); }
.limits ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.limits li { margin: 6px 0; }
.limits strong { color: var(--paper); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.input {
  background: var(--ink2); border: 1px solid var(--line); color: var(--paper);
  border-radius: 8px; padding: 10px 12px; font-size: 0.95rem; font-family: inherit; min-width: 0;
}
.input:focus { outline: none; border-color: var(--gold); }
input.input[type="text"] { flex: 1 1 220px; }
textarea.input { width: 100%; resize: vertical; }
select.input { padding: 8px 10px; }
.btn {
  background: transparent; border: 1px solid var(--gold-dim); color: var(--gold);
  border-radius: 8px; padding: 10px 18px; cursor: pointer; font-family: inherit; font-size: 0.95rem;
}
.btn:hover { background: rgba(216, 180, 90, 0.12); }
.btn-primary { background: var(--gold); color: #171204; font-weight: bold; border-color: var(--gold); }
.btn-primary:hover { background: #e6c470; }
.btn-danger { border-color: var(--danger); color: var(--loss); }
.btn-danger:hover { background: rgba(224, 96, 94, 0.12); }
.btn-small { padding: 4px 10px; font-size: 0.8rem; }
.msg { min-height: 1.4em; color: var(--muted); }
.msg.err { color: var(--loss); }
.msg.ok { color: var(--gain); }
.count { color: var(--muted); font-size: 0.85rem; font-family: ui-monospace, Menlo, monospace; }
.check { color: var(--muted); font-size: 0.92rem; display: flex; gap: 8px; align-items: center; }
.summaryline { color: var(--muted); font-size: 0.92rem; margin: 8px 0; }

/* address / price lists */
.addr-list { list-style: none; margin: 12px 0 0; padding: 0; }
.addr-list li {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.addr-list li:last-child { border-bottom: none; }
.addr-list .tag {
  font-size: 0.75rem; color: var(--ink); background: var(--gold); border-radius: 4px;
  padding: 2px 8px; font-family: ui-monospace, Menlo, monospace;
}
.addr-list .grow { flex: 1 1 200px; overflow-wrap: anywhere; }
.rm { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.rm:hover { color: var(--loss); }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 640px; }
table.ledger th, table.ledger td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.ledger thead th {
  color: var(--gold); font-weight: normal; letter-spacing: 0.06em; text-transform: uppercase;
  font-size: 0.72rem; font-family: ui-monospace, Menlo, monospace; white-space: nowrap;
}
table.ledger tbody tr:hover { background: rgba(216, 180, 90, 0.04); }
table.ledger td.amt, table.ledger th.amt { text-align: right; white-space: nowrap; }
.kind { font-size: 0.75rem; border-radius: 4px; padding: 2px 8px; font-family: ui-monospace, Menlo, monospace; }
.kind.receive { background: rgba(88, 201, 138, 0.15); color: var(--gain); }
.kind.send { background: rgba(224, 96, 94, 0.15); color: var(--loss); }
.kind.self { background: rgba(127, 178, 255, 0.15); color: var(--accent); }
.kind.mixed { background: rgba(216, 180, 90, 0.15); color: var(--gold); }
.pos { color: var(--gain); } .neg { color: var(--loss); }
.unc { color: var(--gold); font-style: italic; }

/* classify rows */
.classify-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cls-row {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center;
}
.cls-row.done { border-color: rgba(88, 201, 138, 0.4); }
.cls-meta { font-size: 0.88rem; color: var(--muted); }
.cls-meta .txid { font-family: ui-monospace, Menlo, monospace; color: var(--paper); }
.cls-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cls-controls select { max-width: 260px; }
.cls-note { grid-column: 1 / -1; font-size: 0.82rem; color: var(--gold-dim); }

/* report cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--ink2); }
.card .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.card .v { font-size: 1.5rem; margin-top: 4px; font-family: ui-monospace, Menlo, monospace; }
.refusal {
  border: 1px solid var(--loss); border-radius: 8px; padding: 16px 18px; margin: 14px 0;
  background: rgba(224, 96, 94, 0.07); color: var(--paper);
}
.refusal h4 { margin: 0 0 8px; color: var(--loss); }
.refusal ul { margin: 6px 0; padding-left: 20px; font-size: 0.9rem; color: var(--muted); }
.refusal code { font-size: 0.8rem; }

/* footer */
.footer { border-top: 1px solid var(--gold-dim); margin-top: 40px; padding: 22px 0 40px; color: var(--muted); font-size: 0.9rem; }
.footer a { color: var(--gold); }
.footer-inner { display: flex; flex-direction: column; gap: 8px; }
.donate code { color: var(--paper); font-size: 0.82rem; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  h1 { font-size: 2.1rem; }
  .masthead-seal { display: none; }
  .panel { padding: 18px; }
  .cls-row { grid-template-columns: 1fr; }
}

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