:root {
  color-scheme: light dark;
  --bg: #f7f8fb;
  --text: #111827;
  --muted: #5b6472;
  --line: #d9dee8;
  --accent: #126b63;
  --panel: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --text: #f4f6f8;
    --muted: #b2bdca;
    --line: #2a3542;
    --panel: #161d24;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px min(6vw, 72px);
  border-bottom: 1px solid var(--line);
}
a { color: var(--accent); text-decoration: none; }
nav { display: flex; gap: 16px; flex-wrap: wrap; }
main { max-width: 980px; margin: 0 auto; padding: 48px 20px; }
.brand { color: var(--text); font-weight: 800; }
.brand span { color: var(--accent); }
.hero h1 { font-size: clamp(2rem, 6vw, 4.8rem); line-height: 1; margin: 0 0 18px; }
.hero p { max-width: 760px; color: var(--muted); font-size: 1.18rem; }
.lab-hero h1 { font-size: clamp(2.4rem, 7vw, 5.8rem); }
.actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.actions a {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 14px;
  border-radius: 6px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 40px 0; }
.grid article, .list article {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 18px;
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 18px;
  margin: 24px 0;
}
.grid strong { display: block; font-size: 1.6rem; }
.grid span, .list p, .section-head p { color: var(--muted); }
table {
  background: var(--panel);
  border-collapse: collapse;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
main h1 code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
code.hash { overflow-wrap: anywhere; }
.ledger-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.ledger-row {
  margin: 0;
}
.ledger-entry-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  display: grid;
  gap: 16px;
  overflow: hidden;
  padding: 16px;
}
.ledger-row--bounty-reserve .ledger-entry-card,
.ledger-row--bounty-payment .ledger-entry-card,
.ledger-row--bounty-release .ledger-entry-card {
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}
.ledger-row--bounty-payment .ledger-entry-card { border-left: 6px solid #15803d; }
.ledger-row--bounty-release .ledger-entry-card { border-left: 6px solid #b45309; }
.ledger-row--bounty-reserve .ledger-entry-card { border-left: 6px solid var(--accent); }
.ledger-card-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.ledger-card-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  min-width: 0;
}
.ledger-entry-link {
  font-weight: 800;
}
.ledger-card-type {
  min-width: 0;
}
.ledger-amount {
  justify-self: end;
  white-space: nowrap;
}
.ledger-card-grid {
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0;
}
.ledger-field {
  min-width: 0;
}
.ledger-field dt {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  margin: 0 0 4px;
}
.ledger-field dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ledger-field--reference,
.ledger-field--hash {
  grid-column: span 2;
}
.ledger-type {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: .85rem;
  font-weight: 700;
  padding: 3px 8px;
}
.ledger-type--bounty-payment {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
}
.ledger-type--bounty-release {
  border-color: #facc15;
  color: #854d0e;
}
.ledger-type--bounty-reserve {
  border-color: #99f6e4;
  color: #115e59;
}
.ledger-scan-note {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  margin-top: 4px;
}
.reference-cell {
  max-width: none;
  overflow-wrap: anywhere;
}
.lead { color: var(--muted); font-size: 1.15rem; }
.wallet-balance {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.wallet-empty-pill {
  color: var(--muted);
}
.eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.detail dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.bounty-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}
.bounty-summary article,
.acceptance-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 18px;
}
.bounty-summary span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 8px;
}
.bounty-summary strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
}
.status-pill {
  display: inline-block;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  padding: 4px 10px;
  text-transform: capitalize;
}
.bounty-list-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.bounty-list-summary article {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  min-width: 0;
  padding: 14px;
}
.bounty-list-summary span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 6px;
  min-width: 0;
}
.bounty-list-summary code {
  overflow-wrap: anywhere;
  white-space: normal;
}
.bounty-list-summary strong {
  display: block;
  font-size: 1.25rem;
}
.acceptance-card h2 {
  margin: 0 0 10px;
}
.acceptance-card p:last-child {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 22px 0; }
.meta-grid article { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 14px; }
.meta-grid span { display: block; color: var(--muted); margin-bottom: 6px; }
.section-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-top: 42px; }
.section-head h2 { margin-bottom: 0; }
.project-list article { min-height: 190px; }
.doc-list { line-height: 1.9; }
pre {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 16px;
}
.result:empty { display: none; }
.notice { color: var(--muted); }
form { display: grid; gap: 14px; max-width: 680px; }
label { display: grid; gap: 6px; color: var(--muted); }
input, textarea, button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
}
button { cursor: pointer; color: white; background: var(--accent); border-color: var(--accent); }
.search-form {
  margin: 28px 0;
}
.search-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.search-row a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
}
.inline-form { margin-top: 18px; max-width: 180px; }
.webhook-table {
  display: table;
  table-layout: fixed;
  width: 100%;
}
.webhook-table th,
.webhook-table td {
  overflow-wrap: anywhere;
  vertical-align: top;
}
.webhook-table code {
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}
.wallet-tool form + h2 { margin-top: 34px; }
@media (max-width: 640px) {
  header { align-items: flex-start; flex-direction: column; }
  .search-row { grid-template-columns: 1fr; }
  .detail dl { grid-template-columns: 1fr; }
  .bounty-list-summary { grid-template-columns: 1fr; }
  .bounty-summary { grid-template-columns: 1fr; }
  .ledger-card-head { grid-template-columns: 1fr; }
  .ledger-card-title { align-items: flex-start; flex-direction: column; }
  .ledger-amount { justify-self: start; }
  .ledger-card-grid { grid-template-columns: 1fr; }
  .ledger-field--reference,
  .ledger-field--hash { grid-column: auto; }
  .webhook-table,
  .webhook-table tbody,
  .webhook-table tr,
  .webhook-table td {
    display: block;
    width: 100%;
  }
  .webhook-table thead {
    display: none;
  }
  .webhook-table tr {
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
  }
  .webhook-table td {
    border-bottom: 0;
    padding: 4px 0;
  }
  .webhook-table td::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: .82rem;
    font-weight: 700;
  }
}
