/* EveryLamport — what a free trade costs.
   (Filename stays feeless.css; the folder name is stale on purpose.)

   Dark is the default and the design's home; light is a full second skin rather
   than an inversion. Canvases can't read CSS variables through the 2D context,
   so every colour a chart needs is declared here as --chart-* and charts.js
   pulls them with getComputedStyle on each draw.

   Colour means exactly one thing on this site: who took the money. Nothing is
   tinted for decoration, so a bar, a receipt line and a chart segment for the
   same party are always the same hue. */

:root {
  color-scheme: dark;

  --ink:        #06070a;
  --ink-2:      #0b0d12;
  --panel:      rgba(255, 255, 255, 0.028);
  --panel-2:    rgba(255, 255, 255, 0.048);
  --line:       rgba(255, 255, 255, 0.085);
  --line-soft:  rgba(255, 255, 255, 0.05);
  --text:       #e9eaee;
  --text-dim:   #9297a3;
  --text-faint: #666c7a;

  /* One per party. */
  --platform:  #4fd1c5;
  --creator:   #a78bfa;
  --third:     #ffb020;
  --validator: #60a5fa;
  --unknown:   #6b7688;
  --refund:    #3d4655;
  --bad:       #ff6b81;

  --accent: var(--platform);
  --glow-1: rgba(79, 209, 197, 0.10);
  --glow-2: rgba(255, 176, 32, 0.06);

  --paper:       #f4f1e9;
  --paper-ink:   #14161b;
  --paper-ink-2: #5c6068;
  --paper-shadow: 0 26px 52px -20px rgba(0, 0, 0, 0.75);

  --chart-axis:  rgba(255, 255, 255, 0.075);
  --chart-grid:  rgba(255, 255, 255, 0.045);
  --chart-text:  #666c7a;
  --chart-label: #9297a3;
  --chart-rule:  rgba(255, 255, 255, 0.3);

  /* The wordmark glyph is paper-coloured; against the light skin's white bar it
     needs a dark chip behind it or it disappears entirely. */
  --mark-chip: rgba(255, 255, 255, 0.07);

  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', sans-serif;

  --w: 1120px;
  --r: 14px;
}

:root[data-theme='light'] {
  color-scheme: light;

  --ink:        #fcfcfd;
  --ink-2:      #ffffff;
  --panel:      rgba(15, 20, 34, 0.022);
  --panel-2:    rgba(15, 20, 34, 0.042);
  --line:       rgba(15, 20, 34, 0.11);
  --line-soft:  rgba(15, 20, 34, 0.065);
  --text:       #12151c;
  --text-dim:   #565d6c;
  --text-faint: #848b99;

  --platform:  #0f8f83;
  --creator:   #6d47dd;
  --third:     #b87400;
  --validator: #2563eb;
  --unknown:   #8a919c;
  --refund:    #c3c8d0;
  --bad:       #cc2f47;

  --glow-1: rgba(15, 143, 131, 0.07);
  --glow-2: rgba(184, 116, 0, 0.05);

  --paper:       #fbf9f3;
  --paper-shadow: 0 2px 6px rgba(16, 18, 24, 0.06), 0 20px 40px -20px rgba(16, 18, 24, 0.2);

  --chart-axis:  rgba(15, 20, 34, 0.1);
  --chart-grid:  rgba(15, 20, 34, 0.06);
  --chart-text:  #848b99;
  --chart-label: #565d6c;
  --chart-rule:  rgba(15, 20, 34, 0.32);
  --mark-chip: #12151c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Two soft washes, fixed so they don't parallax against the content. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  height: 560px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(820px 460px at 14% -10%, var(--glow-1), transparent 70%),
    radial-gradient(680px 420px at 90% 2%, var(--glow-2), transparent 72%);
}

a { color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.wrap { position: relative; z-index: 1; max-width: var(--w); margin: 0 auto; padding: 0 24px; }

header.top {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 58px; }

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand b { font-weight: 650; font-size: 16px; letter-spacing: -0.02em; }

/* The nav sits immediately after the brand, on the left. The controls are pushed
   to the far right by .actions, not by the nav. */
nav.links { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
nav.links::-webkit-scrollbar { display: none; }
nav.links a {
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s;
}
nav.links a:hover { color: var(--text); background: var(--panel-2); }
nav.links a[aria-current='page'] { color: var(--text); background: var(--panel-2); font-weight: 550; }

.actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.theme {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s;
}
.theme:hover { color: var(--text); }
/* The toggle is icon-only up here; the word would crowd the bar. */
.theme span { display: none; }

/* ---------- footer ---------- */
footer {
  margin-top: 46px;
  border-top: 1px solid var(--line-soft);
  padding: 26px 0 44px;
  color: var(--text-faint);
  font-size: 12.5px;
}
footer a { color: var(--text-dim); }
footer .row { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
footer .row .sp { margin-left: auto; }

/* ---------- page ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--w);
  margin: 0 auto;
  padding: 52px 24px 8px;
}

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.kicker::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.page-head { margin-bottom: 34px; }
.page-head h1 {
  margin: 20px 0 0;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.032em;
  font-weight: 680;
  max-width: 20ch;
}
.page-head h1 em { font-style: normal; color: var(--accent); }
.page-head .lede { margin: 18px 0 0; max-width: 66ch; font-size: 17px; color: var(--text-dim); }
.page-head .lede strong { color: var(--text); font-weight: 550; }

section { margin-top: 44px; }
section > h2 { font-size: 22px; font-weight: 640; letter-spacing: -0.022em; margin-bottom: 6px; }
section > .sub { margin: 0 0 18px; color: var(--text-dim); max-width: 74ch; font-size: 15px; }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 370px) minmax(0, 1fr); gap: 26px; align-items: start; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 20px;
}
.card h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.012em; }
.card h3 + p { margin-top: 8px; font-size: 13.5px; color: var(--text-dim); }
a.card { text-decoration: none; display: block; transition: border-color 0.16s; }
a.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* ---------- stats ---------- */
.stat {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 15px 16px 14px;
}
.stat .k {
  font: 500 10.5px/1.35 var(--mono);
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--text-faint);
  /* Two lines' worth, so a label that wraps does not push its number out of line
     with its neighbours in a row of cards. */
  min-height: 2.7em;
}
.stat .v {
  margin-top: 6px;
  font: 640 30px/1.05 var(--sans);
  letter-spacing: -0.028em;
  font-variant-numeric: tabular-nums;
}
.stat .n { margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--text-dim); }
.stat.accent .v { color: var(--accent); }
.stat.warn .v { color: var(--third); }
.stat.bad .v { color: var(--bad); }

/* ---------- charts ---------- */
.chart {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 14px 12px 8px;
}
.chart canvas { display: block; width: 100%; }
.chart-cap { margin: 6px 4px 2px; font-size: 12.5px; color: var(--text-faint); }

.legend { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 14px; }
.legend div { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); }
.legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }

.bar-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 84px; gap: 12px; align-items: center; padding: 5px 0; }
.bar-row .bl { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 7px; }
.bar-track { height: 7px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.bar-row .bv { text-align: right; font: 500 12.5px/1 var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- the receipt ---------- */
.receipt {
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  padding: 26px 22px 22px;
  box-shadow: var(--paper-shadow);
  -webkit-mask:
    radial-gradient(7px 7px at 7px 0, transparent 0 6.5px, #000 7px) repeat-x top / 14px 8px,
    radial-gradient(7px 7px at 7px 100%, transparent 0 6.5px, #000 7px) repeat-x bottom / 14px 8px,
    linear-gradient(#000, #000) no-repeat center / 100% calc(100% - 14px);
  mask:
    radial-gradient(7px 7px at 7px 0, transparent 0 6.5px, #000 7px) repeat-x top / 14px 8px,
    radial-gradient(7px 7px at 7px 100%, transparent 0 6.5px, #000 7px) repeat-x bottom / 14px 8px,
    linear-gradient(#000, #000) no-repeat center / 100% calc(100% - 14px);
}
.receipt .r-head { text-align: center; margin-bottom: 14px; }
.receipt .r-head b { display: block; font-size: 13.5px; letter-spacing: 0.16em; text-transform: uppercase; }
.receipt .r-head span { display: block; font-size: 10px; color: var(--paper-ink-2); margin-top: 4px; }
.receipt hr { border: 0; border-top: 1px dashed rgba(20, 22, 27, 0.24); margin: 11px 0; }
.r-line { display: flex; gap: 10px; align-items: baseline; }
.r-line .lbl { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.r-line .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-line .bps { font-size: 9.5px; color: var(--paper-ink-2); }
.r-line.faint { color: var(--paper-ink-2); }
.r-line.total { font-weight: 700; font-size: 13.5px; }
.r-foot { margin-top: 13px; font-size: 9.5px; color: var(--paper-ink-2); text-align: center; line-height: 1.6; }
.r-sig { word-break: break-all; }

/* ---------- controls ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.btn {
  font: 500 12.5px/1 var(--sans);
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.btn:hover { color: var(--text); background: var(--panel-2); }
.btn[aria-pressed='true'] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 14px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th {
  font: 500 10px/1.3 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
}
tbody tr { border-top: 1px solid var(--line-soft); }
tbody tr:first-child { border-top: 0; }
tbody tr:hover { background: var(--panel-2); }
td.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }

/* ---------- verification ---------- */
.vrow {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 9px 14px; border-top: 1px solid var(--line-soft); font-size: 13px; cursor: pointer;
}
.vrow:first-child { border-top: 0; }
.vrow:hover { background: var(--panel-2); }
.tick { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.tick.ok { background: color-mix(in srgb, var(--platform) 18%, transparent); color: var(--platform); }
.tick.no { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.tick.wait { background: var(--panel-2); color: var(--text-faint); }
.vrow .sig { font: 400 11.5px/1.4 var(--mono); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }
.vrow .meta { font: 400 11px/1.4 var(--mono); color: var(--text-faint); }

.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-word; }

.pill {
  display: inline-flex; align-items: center;
  font: 500 10px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--text-faint); background: var(--panel);
}
.pill.signed { border-color: color-mix(in srgb, var(--platform) 45%, transparent); color: var(--platform); background: color-mix(in srgb, var(--platform) 12%, transparent); }
.pill.observed { border-color: color-mix(in srgb, var(--third) 42%, transparent); color: var(--third); background: color-mix(in srgb, var(--third) 12%, transparent); }

/* ---------- notes ---------- */
.note {
  border-left: 2px solid var(--line);
  padding: 2px 0 2px 15px;
  color: var(--text-dim);
  font-size: 14px;
  max-width: 78ch;
}
.note b { color: var(--text); font-weight: 600; }
.caution { border-left-color: var(--third); }
.quote {
  margin: 0; padding: 14px 18px;
  border-left: 2px solid var(--line);
  background: var(--panel);
  border-radius: 0 9px 9px 0;
  color: var(--text-dim); font-size: 14.5px;
}
.quote b { color: var(--text); font-weight: 600; }

/* ---------- pager ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.pager-link {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  text-decoration: none; transition: border-color 0.16s;
}
.pager-link:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pager-link.next { text-align: right; }
.pager-link span { font-size: 14px; font-weight: 550; }
.pager-link i { font-style: normal; font: 400 11px/1.3 var(--mono); color: var(--text-faint); }

.skeleton { color: var(--text-faint); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  /* The nav scrolls sideways rather than collapsing behind a button: eight items
     is few enough to swipe, and a menu that hides the page list on the page-list
     site is worse than a scrollbar. */
  header.top .wrap { gap: 10px; }
  .brand b { display: none; }
  .page { padding: 32px 18px 8px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 120px minmax(0, 1fr) 72px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-link.next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
