/* Concrete theme — shared by every page. Light (A) is the default; dark (B)
   applies via [data-theme="dark"] on <html>, or the OS preference when the
   viewer hasn't picked one. */

:root {
  color-scheme: light;
  --bg: #F2F1EE; --surface: #FFFFFF; --surface-2: #E9E7E2;
  --line: #D9D7D1; --line-strong: #C4C1B9;
  --text: #1C1B19; --muted: #6B6962;
  --accent: #FF5A1F; --accent-hover: #E84E14; --on-accent: #1C1B19; --accent-text: #C8430F;
  --gain: #2F7D4F; --loss: #C2372B; --warn: #A86B00;
  --radius: 6px; --radius-sm: 4px;
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131311; --surface: #1B1B18; --surface-2: #22221E;
  --line: #2A2925; --line-strong: #3A3934;
  --text: #ECEAE3; --muted: #8C8A82;
  --accent: #FF7A45; --accent-hover: #FF8A5B; --on-accent: #131311; --accent-text: #FF8A5B;
  --gain: #8DBE7A; --loss: #E8715A; --warn: #E0A840;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131311; --surface: #1B1B18; --surface-2: #22221E;
    --line: #2A2925; --line-strong: #3A3934;
    --text: #ECEAE3; --muted: #8C8A82;
    --accent: #FF7A45; --accent-hover: #FF8A5B; --on-accent: #131311; --accent-text: #FF8A5B;
    --gain: #8DBE7A; --loss: #E8715A; --warn: #E0A840;
  }
}

/* Base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok { color: var(--gain); } .bad { color: var(--loss); } .warn { color: var(--warn); }
.status { min-height: 20px; font-size: 13.5px; color: var(--muted); }

/* Header */
header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { max-width: 1120px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand::before { content: ""; width: 12px; height: 12px; background: var(--accent); border-radius: 2px; }
nav { display: flex; gap: 2px; flex: 1; }
nav a { white-space: nowrap; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14px; }
nav a:hover { color: var(--text); background: var(--surface-2); }
nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.health-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 13px; font-weight: 500; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
[data-tone="ok"] > .dot, .dot[data-tone="ok"], [data-tone="local"] > .dot, .dot[data-tone="local"] { background: var(--gain); }
[data-tone="warn"] > .dot, .dot[data-tone="warn"], [data-tone="testnet"] > .dot, .dot[data-tone="testnet"] { background: var(--warn); }
[data-tone="bad"] > .dot, .dot[data-tone="bad"], [data-tone="mainnet"] > .dot, .dot[data-tone="mainnet"] { background: var(--loss); }

/* Theme switch */
.theme-switch { display: inline-flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.theme-switch .track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: background .15s; }
.theme-switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.theme-switch[aria-checked="true"] .track { background: var(--accent); border-color: var(--accent); }
.theme-switch[aria-checked="true"] .track::after { transform: translateX(14px); background: var(--on-accent); }
.theme-switch:hover { color: var(--text); }

/* Buttons */
button { font: inherit; cursor: pointer; border: 0; border-radius: var(--radius-sm); }
.btn { display: inline-block; padding: 9px 16px; font-weight: 600; font-size: 14px; background: var(--accent); color: var(--on-accent); text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); font-weight: 500; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; color: var(--accent-text); padding: 0 2px; font-size: 12px; font-weight: 600; }

/* Layout */
main { max-width: 1120px; margin: 0 auto; padding: 36px 24px 72px; }
.article { max-width: 780px; }
.article .lede { font-size: 18px; color: var(--muted); margin: 12px 0 28px; }
.article section { margin-top: 30px; }
.article h2 { font-size: 22px; margin-bottom: 8px; }
.article h3 { font-size: 16px; margin: 22px 0 6px; }
.article p, .article li { max-width: 72ch; }
.article li + li { margin-top: 7px; }
.article .callout { margin: 24px 0; padding: 16px 18px; border-left: 4px solid var(--accent); background: var(--surface); }
.article-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.eyebrow { font-family: var(--mono); color: var(--accent-text); font-size: 12.5px; font-weight: 500; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.1; letter-spacing: -.015em; margin: 6px 0 8px; font-weight: 700; }
.subtitle { color: var(--muted); max-width: 640px; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.panel-head h2 { margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { margin-top: 4px; font-family: var(--mono); font-size: 26px; font-weight: 500; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-sub { margin-top: 4px; color: var(--muted); font-size: 12.5px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { white-space: nowrap; color: var(--muted); font-size: 12px; text-align: left; padding: 0 10px 10px; font-weight: 500; }
td { border-top: 1px solid var(--line); padding: 11px 10px; white-space: nowrap; }
td:first-child, th:first-child { padding-left: 0; } td:last-child, th:last-child { padding-right: 0; }
td.num, th.num { text-align: right; }
td.num { font-family: var(--mono); }
.empty { padding: 24px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: 13.5px; text-align: center; }

/* Badges */
.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: var(--radius-sm); text-transform: capitalize;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.badge.success { color: var(--gain); background: color-mix(in srgb, var(--gain) 10%, transparent); border-color: color-mix(in srgb, var(--gain) 30%, transparent); }
.badge.failed { color: var(--loss); background: color-mix(in srgb, var(--loss) 10%, transparent); border-color: color-mix(in srgb, var(--loss) 30%, transparent); }
.badge.attempt, .badge.queued, .badge.pending { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge.confirmed { color: var(--gain); background: color-mix(in srgb, var(--gain) 10%, transparent); border-color: color-mix(in srgb, var(--gain) 30%, transparent); }

@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .brand { flex: 1; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .theme-switch .label { display: none; }
  main { padding: 24px 16px 60px; }
}
