/* anonymous-credit-tokens.info
   Hand-rolled stylesheet. No framework, no fetched fonts, dark-friendly via
   prefers-color-scheme. The CSP is default-src 'self', so inline styles are
   blocked; every rule the site needs lives in this file. */

:root {
  color-scheme: light dark;
  --bg: #fcfcfd;
  --fg: #1c2026;
  --muted: #59626e;
  --link: #0b63c5;
  --border: #d8dde4;
  --surface: #f2f4f7;
  --accent: #8a6d1d;
  --success: #176b45;
  --danger: #a12e2e;
  --wallet-glow: rgba(138, 109, 29, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --fg: #e4e7eb;
    --muted: #98a2ae;
    --link: #79b3f5;
    --border: #2b323b;
    --surface: #1c2128;
    --accent: #d3b45a;
    --success: #58c792;
    --danger: #ff8585;
    --wallet-glow: rgba(211, 180, 90, 0.1);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Shared measure for header, main, and footer content. */
main,
.site-header nav,
.site-footer .inner {
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

main {
  padding-block: 1.5rem 3rem;
}

h1 {
  font-size: 1.65rem;
  line-height: 1.25;
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 2.2rem 0 0.6rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.6rem 0 0.4rem;
}

p,
ul,
ol,
dl {
  margin: 0.75rem 0;
}

a {
  color: var(--link);
}

small,
.muted {
  color: var(--muted);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1.1rem;
  padding-block: 0.75rem;
}

.brand {
  font-weight: 650;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}

.site-header ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
  margin: 0;
  padding: 0;
}

.site-header ul a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.site-header ul a:hover,
.site-header ul a:focus-visible {
  color: var(--fg);
  text-decoration: underline;
}

.site-header a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
}

/* Code */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--surface);
  border-radius: 4px;
  padding: 0.1em 0.3em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
  margin: 0.9rem 0;
}

pre code {
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: 0.85rem;
  overflow-wrap: normal;
}

/* Tables */

.table-scroll {
  overflow-x: auto;
  margin: 0.9rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Definition lists (API fields) */

dl.fields dt {
  font-weight: 600;
  margin-top: 0.7rem;
}

dl.fields dd {
  margin: 0.1rem 0 0.4rem 0;
}

/* Callouts */

.status-banner {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  padding: 0.75rem 1rem;
  margin: 1.2rem 0;
}

.note {
  border-left: 3px solid var(--accent);
  padding: 0.1rem 0 0.1rem 0.9rem;
  color: var(--muted);
  margin: 0.9rem 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer .inner {
  padding-block: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin: 0.5rem 0;
  padding: 0;
}

.site-footer a {
  color: var(--muted);
}

.site-footer .status {
  margin-top: 0.75rem;
}

/* Browser wallet */

.eyebrow,
.wallet-kicker {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.wallet-intro .eyebrow {
  margin-bottom: 0.25rem;
}

.wallet-intro h1 {
  margin-top: 0;
}

.lede {
  font-size: 1.08rem;
  line-height: 1.65;
}

.wallet-shell {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 18px 60px var(--wallet-glow);
  margin: 1.75rem 0 2.5rem;
  overflow: hidden;
}

.wallet-statusbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.8rem 1rem;
}

.wallet-statusbar p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.25rem 0 0;
}

.wallet-status {
  align-items: center;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.45rem;
}

.wallet-status::before {
  background: var(--accent);
  border-radius: 50%;
  content: "";
  height: 0.55rem;
  width: 0.55rem;
}

.wallet-status[data-state="ready"]::before {
  background: var(--success);
}

.wallet-status[data-state="busy"]::before {
  animation: wallet-pulse 1.2s ease-in-out infinite;
}

.wallet-status[data-state="error"]::before {
  background: var(--danger);
}

@keyframes wallet-pulse {
  50% {
    opacity: 0.3;
    transform: scale(0.7);
  }
}

.wallet-notice {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
}

.wallet-notice[data-tone="error"] {
  color: var(--danger);
}

.wallet-balance {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  padding: 1.4rem 1.25rem 1.1rem;
}

.wallet-total {
  align-items: baseline;
  display: flex;
  gap: 0.45rem;
  line-height: 1;
  margin: 0.35rem 0 0;
}

.wallet-total strong {
  font-size: clamp(2.6rem, 12vw, 4.6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.055em;
}

.wallet-total span {
  color: var(--muted);
  font-size: 0.95rem;
}

.wallet-balance dl {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  min-width: 13rem;
}

.wallet-balance dl div {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.wallet-balance dt {
  color: var(--muted);
  font-size: 0.75rem;
}

.wallet-balance dd {
  font-size: 0.82rem;
  font-weight: 650;
  margin: 0;
}

.wallet-visibility {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.wallet-visibility > div {
  padding: 0.9rem 1.2rem;
}

.wallet-visibility > div + div {
  border-left: 1px solid var(--border);
}

.wallet-visibility h2 {
  font-size: 0.85rem;
  margin: 0 0 0.35rem;
}

.wallet-visibility ul {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
  padding-left: 1.1rem;
}

.wallet-pending {
  background: var(--surface);
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.82rem;
  margin: 0;
  padding: 0.65rem 1rem 0.65rem 2rem;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.wallet-action {
  min-width: 0;
  padding: 1.2rem;
}

.wallet-action + .wallet-action {
  border-left: 1px solid var(--border);
}

.wallet-action-heading {
  align-items: start;
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.wallet-action-heading h2 {
  font-size: 1rem;
  margin: 0;
}

.wallet-action-heading p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0.2rem 0 0;
}

.wallet-step {
  align-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  flex: 0 0 1.65rem;
  font-size: 0.75rem;
  font-weight: 750;
  height: 1.65rem;
  justify-content: center;
}

.wallet-action label {
  color: var(--muted);
  display: grid;
  font-size: 0.75rem;
  font-weight: 650;
  gap: 0.25rem;
}

.wallet-input-row {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  margin-top: 0.3rem;
}

.wallet-field-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1.4fr 0.7fr 1fr;
  margin-bottom: 0.65rem;
}

.wallet-action input,
.wallet-action select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font: inherit;
  font-size: 0.88rem;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  width: 100%;
}

.wallet-action input:focus-visible,
.wallet-action select:focus-visible,
.wallet-shell button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.wallet-shell button {
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 6px;
  color: var(--bg);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.58rem 0.75rem;
}

.wallet-shell button:hover:not(:disabled) {
  opacity: 0.82;
}

.wallet-shell button:disabled,
.wallet-shell input:disabled,
.wallet-shell select:disabled {
  cursor: wait;
  opacity: 0.52;
}

.wallet-shell .button-quiet,
.wallet-shell .button-danger {
  background: transparent;
  color: var(--fg);
}

.wallet-shell .button-quiet {
  border-color: var(--border);
}

.wallet-shell .button-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.wallet-action small {
  color: var(--muted);
  display: block;
  font-size: 0.71rem;
  line-height: 1.45;
  margin-top: 0.55rem;
}

.wallet-records {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
}

.wallet-records section {
  min-width: 0;
  padding: 1rem 1.2rem;
}

.wallet-records section + section {
  border-left: 1px solid var(--border);
}

.wallet-records h2 {
  font-size: 0.86rem;
  margin: 0 0 0.7rem;
}

.wallet-token-list,
.wallet-history {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  max-height: 13rem;
  overflow-y: auto;
  padding: 0;
}

.wallet-token {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  font-size: 0.78rem;
  justify-content: space-between;
  padding: 0.45rem 0.55rem;
}

.wallet-token span,
.wallet-empty {
  color: var(--muted);
}

.wallet-history li {
  display: grid;
  font-size: 0.74rem;
  gap: 0.5rem;
  grid-template-columns: 4.7rem 1fr;
}

.wallet-history time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.wallet-history li[data-tone="success"] span {
  color: var(--success);
}

.wallet-history li[data-tone="error"] span {
  color: var(--danger);
}

.wallet-footer {
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 1.2rem;
}

.wallet-footer p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  margin: 0;
  max-width: 34rem;
}

.protocol-steps {
  counter-reset: protocol-step;
  display: grid;
  gap: 0.8rem;
  list-style: none;
  padding: 0;
}

.protocol-steps li {
  border-left: 2px solid var(--border);
  color: var(--muted);
  padding-left: 0.9rem;
}

.protocol-steps strong {
  color: var(--fg);
}

@media (max-width: 42rem) {
  .wallet-balance {
    align-items: start;
    flex-direction: column;
    gap: 1rem;
  }

  .wallet-balance dl {
    width: 100%;
  }

  .wallet-visibility,
  .wallet-actions,
  .wallet-records {
    grid-template-columns: 1fr;
  }

  .wallet-visibility > div + div,
  .wallet-action + .wallet-action,
  .wallet-records section + section {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .wallet-field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wallet-field-grid label:first-child {
    grid-column: 1 / -1;
  }

  .wallet-footer,
  .wallet-statusbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wallet-status[data-state="busy"]::before {
    animation: none;
  }
}
