@layer reset, tokens, base, layout, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { margin: 0; }
  h1, h2, h3, p, dl, dd, figure { margin: 0; }
  img, svg, canvas { display: block; max-width: 100%; }
  table { border-collapse: collapse; border-spacing: 0; }
  button, input { font: inherit; color: inherit; }
  button { cursor: pointer; }
  a { color: inherit; }
  [hidden] { display: none !important; }
}

@layer tokens {
  :root {
    --bg: oklch(14% 0.012 78);
    --bg-raised: oklch(17.5% 0.014 78);
    --bg-inset: oklch(12% 0.012 78);
    --ink: oklch(93.5% 0.016 86);
    --muted: oklch(70% 0.022 80);
    --faint: oklch(52% 0.018 80);
    --line: oklch(30% 0.016 78);
    --line-strong: oklch(42% 0.02 78);
    --brass: oklch(79% 0.108 84);
    --brass-dim: oklch(62% 0.08 84);
    --brass-ink: oklch(20% 0.04 75);
    --good: oklch(76% 0.13 155);
    --bad: oklch(68% 0.145 28);
    --warn: oklch(80% 0.12 85);
    --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --serif: "Newsreader", "Iowan Old Style", Palatino, "Times New Roman", serif;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    /* Chi Rho (labarum): the Lazarus mark, geometry identical to static/chi-rho.svg and the
       mempool theme's copy. Kept as a mask so it takes --brass wherever it is used. Its viewBox
       is cropped to the mark, so any box masking it wants width = 0.636 * height. */
    --chi-rho: url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2020.36%2032%22%3E%3Cpath%20d=%22M15.96%204.16C15.96%202.91%2015.56%202.02%2014.61%201.56C14.14%201.33%2013.51%201.21%2012.71%201.21H9.61L9.69%200H13.65C14.77%200%2015.67%200.18%2016.36%200.55C17.04%200.91%2017.54%201.4%2017.86%202.01C18.17%202.63%2018.33%203.32%2018.33%204.07C18.33%204.84%2018.17%205.55%2017.84%206.2C17.52%206.84%2017.01%207.36%2016.32%207.75C15.63%208.13%2015.3%208.33%2014.01%208.33H9.69L9.61%207.12H13.4C14.39%207.12%2015.19%206.66%2015.63%205.78C15.85%205.35%2015.96%204.81%2015.96%204.16ZM11.57%200%2011.57%2010.83V30.94L13.18%2031.55V32H7.2V31.55L8.8%2030.94V10.83V1.06L7.2%200.45V0ZM9.8%2020.31%203.89%2027.07%206.01%2027.79V28.32H0V27.79L2.08%2027.07L9.02%2019.39L9.97%2018.7L15.18%2012.61L13.05%2011.89V11.36H19.07V11.89L16.99%2012.61L10.77%2019.61ZM14.05%2027.07%209.04%2020.79%208.6%2020.39%202.34%2012.63%200.3%2011.89V11.36H8.93V11.89L6.61%2012.61L10.91%2018.05L11.38%2018.5L18.32%2027.04L20.36%2027.79V28.32H11.73V27.79Z%22/%3E%3C/svg%3E");
    --space: 1.15rem;
    --measure: 74rem;
    --radius: 2px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    color-scheme: dark;
  }
  @media (min-width: 880px) {
    :root { --space: 1.5rem; }
  }
}

@layer base {
  html { scrollbar-gutter: stable; scroll-behavior: smooth; }
  body {
    min-height: 100dvh;
    font-family: var(--sans);
    font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.02rem);
    line-height: 1.5;
    color: var(--ink);
    background:
      radial-gradient(1200px 500px at 8% -10%, oklch(22% 0.03 80 / 0.45), transparent 55%),
      var(--bg);
    text-rendering: optimizeLegibility;
  }
  ::selection {
    background: color-mix(in oklch, var(--brass) 55%, black);
    color: var(--ink);
  }
  :focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 2px;
  }
  a {
    color: var(--brass);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in oklch, var(--brass) 45%, transparent);
  }
  a:hover { text-decoration-color: var(--brass); }
  h1, h2, h3 { text-wrap: balance; }
  p, .lede, .note { text-wrap: pretty; }
  code, .mono {
    font-family: var(--mono);
    font-size: 0.86em;
    font-feature-settings: "tnum" 1;
  }
  code {
    padding: 0.05em 0.3em;
    border-radius: var(--radius);
    background: color-mix(in oklch, var(--brass) 8%, var(--bg-inset));
    color: color-mix(in oklch, var(--ink) 90%, var(--brass));
  }
  pre code { padding: 0; background: none; }
}

@layer layout {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem 1.5rem;
    align-items: end;
    padding: 0.65rem var(--space) 0.55rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in oklch, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
  }
  .site-header::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, var(--brass), transparent 55%);
  }
  .brand {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.55rem 1rem;
    min-width: 0;
  }
  .wordmark {
    font-family: var(--serif);
    font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.05rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ink);
    text-decoration: none;
  }
  /* Chi Rho ahead of the wordmark. Masked rather than inlined so it takes --brass and scales
     with font-size, which is what shrinks it for .wordmark.small in the footer. */
  .wordmark::before {
    content: "";
    display: inline-block;
    width: 0.65em;
    height: 1.02em;
    margin-right: 0.34em;
    vertical-align: -0.15em;
    background: var(--brass);
    -webkit-mask: var(--chi-rho) center / contain no-repeat;
    mask: var(--chi-rho) center / contain no-repeat;
  }
  .wordmark em {
    font-style: italic;
    font-weight: 400;
    color: var(--brass);
  }
  .lede {
    color: var(--muted);
    font-size: 0.86rem;
    max-width: 36rem;
  }
  .lede i { font-family: var(--serif); color: var(--ink); }
  .header-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
  }
  @media (max-width: 720px) {
    .site-header { grid-template-columns: 1fr; align-items: start; }
    .header-meta { justify-content: flex-start; }
  }
  .nav {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 1.1rem;
    padding-top: 0.2rem;
    font-size: 0.82rem;
  }
  .nav a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 0.08rem;
    transition: color 140ms var(--ease), border-color 140ms var(--ease);
  }
  .nav a:hover { color: var(--ink); border-bottom-color: var(--brass); }
  .nav .nav-out {
    display: inline-flex;
    gap: 1.1rem;
    margin-left: auto;
  }
  .nav .nav-out a { color: var(--faint); }
  .nav .nav-out a:hover { color: var(--ink); }
  .ext::after {
    content: "\2197";
    margin-left: 0.2em;
    font-size: 0.8em;
    color: var(--brass-dim);
  }
  @media (max-width: 720px) {
    .nav .nav-out { margin-left: 0; }
  }

  /* Footer: same four-column link tree as the Lazarus Mempool footer, so the two sites read
     as one product. */
  .site-footer {
    margin-top: 2rem;
    border-top: 1px solid var(--line);
    background: var(--bg-inset);
  }
  .footer-grid {
    display: grid;
    grid-template-columns: minmax(13rem, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 1.4rem 1.6rem;
    padding-block: 2rem 2.4rem;
  }
  @media (max-width: 960px) {
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
  }
  @media (max-width: 520px) {
    .footer-grid { grid-template-columns: 1fr; }
  }
  .footer-brand { display: grid; gap: 0.5rem; align-content: start; max-width: 28rem; }
  .footer-brand .note { font-size: 0.84rem; }
  .wordmark.small { font-size: 1.35rem; }
  .serif { font-family: var(--serif); color: var(--ink); }
  .footer-col { display: grid; gap: 0.38rem; align-content: start; font-size: 0.84rem; }
  .footer-col a { color: var(--muted); text-decoration: none; }
  .footer-col a:hover { color: var(--brass); text-decoration: underline; }
  .footer-col .note { font-size: 0.76rem; line-height: 1.4; }
  .category {
    margin-bottom: 0.25rem;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .footer-endpoint { font-size: 0.78rem; color: var(--ink); }
  .footer-endpoint .mono { font-size: 0.74rem; word-break: break-all; }
  .wrap {
    width: min(100% - (var(--space) * 2), var(--measure));
    margin-inline: auto;
    padding-block: 1.35rem 3.2rem;
  }
  .stack { display: grid; gap: 1.6rem; }
  section { container-type: inline-size; scroll-margin-top: 6.2rem; }
}

@layer components {
  .chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.22rem 0.5rem;
    border: 1px solid var(--line);
    background: var(--bg-raised);
    color: var(--muted);
    white-space: nowrap;
  }
  a.chip { text-decoration: none; color: var(--muted); }
  a.chip:hover { border-color: var(--brass); color: var(--ink); }
  .chip b { color: var(--ink); font-weight: 500; }
  .chip.stale[data-live]::before { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in oklch, var(--bad) 20%, transparent); }
  .chip[data-live]::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--good) 20%, transparent);
    align-self: center;
  }

  .ticker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: var(--bg-raised);
  }
  @container (min-width: 36rem) {
    .ticker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
  .ticker > * {
    padding: 0.62rem 0.75rem 0.7rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  @container (min-width: 36rem) {
    .ticker > *:nth-child(4n) { border-right: 0; }
    .ticker > *:nth-last-child(-n+4) { border-bottom: 0; }
  }
  @container (max-width: 35.99rem) {
    .ticker > *:nth-child(2n) { border-right: 0; }
    .ticker > *:nth-last-child(-n+2) { border-bottom: 0; }
  }
  .ticker dt {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .ticker dd {
    margin-top: 0.28rem;
    font-family: var(--mono);
    font-size: clamp(1.02rem, 0.9rem + 0.45vw, 1.2rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
  }
  .ticker small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.15rem;
    font-family: var(--sans);
    font-size: 0.72rem;
    letter-spacing: 0;
    line-height: 1.35;
    color: var(--muted);
    font-weight: 400;
  }

  .chart-wrap {
    position: relative;
    margin-top: 0.55rem;
    border: 1px solid var(--line);
    background:
      linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 28px,
      linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 12.5% 100%,
      var(--bg-inset);
  }
  .chart-wrap canvas { width: 100%; height: 120px; }
  .chart-caption {
    position: absolute;
    top: 0.45rem;
    left: 0.65rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
  }
  /* Key for the block-found ticks the canvas draws along the top of the plot. */
  .chart-legend { color: var(--good); white-space: nowrap; }
  .chart-legend::before { content: "\25BE\00a0"; }
  @container (max-width: 34rem) {
    .chart-legend-noun { display: none; }
  }
  /* Tooltip for those ticks. Follows the pointer horizontally; sits above the plot. */
  .chart-tip {
    position: absolute;
    top: 1.7rem;
    z-index: 2;
    display: grid;
    gap: 0.05rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--line-strong);
    background: var(--bg-raised);
    box-shadow: 0 6px 18px rgb(0 0 0 / 45%);
    font-family: var(--mono);
    font-size: 0.68rem;
    line-height: 1.35;
    white-space: nowrap;
    pointer-events: none;
  }
  .chart-tip b { color: var(--good); font-weight: 600; }

  .panel {
    padding: 0.9rem 1rem 1rem;
    border: 1px solid var(--line);
    background: var(--bg-raised);
  }
  .panel.compact { padding: 0.8rem 0.95rem; }
  .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.6rem;
  }
  .section-head h2 {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: -0.02em;
  }
  .section-head p, .kicker { color: var(--muted); font-size: 0.86rem; }
  .section-head h3 {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  .sub-head {
    margin: 1.1rem 0 0.45rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
  }
  .faint { color: var(--faint); }
  .linkish {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brass);
    font-size: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in oklch, var(--brass) 45%, transparent);
  }
  .linkish:hover { text-decoration-color: var(--brass); }
  .offline-note {
    margin-top: 0.55rem;
    padding: 0.5rem 0.7rem;
    border-left: 2px solid var(--bad);
    background: color-mix(in oklch, var(--bad) 8%, var(--bg-inset));
  }
  .copy { color: color-mix(in oklch, var(--ink) 88%, var(--muted)); }
  .copy + .copy { margin-top: 0.65rem; }
  .note { color: var(--muted); font-size: 0.86rem; }
  .note + .note, .copy + .note { margin-top: 0.55rem; }
  .band-notes {
    margin-top: 0.55rem;
    padding: 0.6rem 0.75rem 0.65rem;
    border: 1px solid var(--line);
    background: var(--bg-raised);
  }
  .band-sub { margin-top: 0.35rem; color: var(--faint); font-size: 0.82rem; }
  .callout {
    margin-top: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-left: 2px solid var(--brass);
    background: color-mix(in oklch, var(--brass) 7%, var(--bg-inset));
    color: color-mix(in oklch, var(--ink) 86%, var(--muted));
  }
  .payout-blurb { margin-bottom: 0.35rem; }

  /* Segmented control for the two mining paths. */
  .tablist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
  }
  .tab {
    flex: 1 1 14rem;
    display: grid;
    gap: 0.1rem;
    padding: 0.5rem 0.75rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-inset);
    text-align: left;
    transition: border-color 140ms var(--ease), background 140ms var(--ease), color 140ms var(--ease);
  }
  .tab .tab-title {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--muted);
  }
  .tab .tab-sub {
    font-size: 0.75rem;
    color: var(--faint);
  }
  .tab:hover { border-color: var(--line-strong); }
  .tab:hover .tab-title { color: var(--ink); }
  .tab[aria-selected="true"] {
    border-color: var(--brass);
    background: color-mix(in oklch, var(--brass) 12%, var(--bg-raised));
  }
  .tab[aria-selected="true"] .tab-title { color: var(--brass); }
  .tab[aria-selected="true"] .tab-sub { color: var(--muted); }

  .facts {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.45rem 0.9rem;
    margin-top: 0.65rem;
    font-size: 0.88rem;
  }
  .facts.tight { margin-top: 0.1rem; gap: 0.42rem 0.75rem; grid-template-columns: 4.8rem 1fr; }
  .copy + .facts { margin-top: 0.8rem; }
  .facts dt { color: var(--faint); }
  .facts dd { min-width: 0; overflow-wrap: anywhere; }
  .facts dd.copyable { align-items: flex-start; }

  .steps {
    margin: 0.85rem 0 0;
    padding-left: 1.25rem;
    color: color-mix(in oklch, var(--ink) 88%, var(--muted));
  }
  .steps li + li { margin-top: 0.5rem; }
  .steps li::marker { color: var(--brass-dim); }
  .cfg {
    margin: 0.4rem 0 0;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--bg-inset);
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: pre-wrap;
    color: var(--ink);
  }
  h3.kicker { font-weight: 500; }

  .fold {
    margin-top: 0.85rem;
    border-top: 1px solid var(--line);
    padding-top: 0.6rem;
  }
  .fold summary {
    cursor: pointer;
    color: var(--brass);
    font-size: 0.82rem;
    font-weight: 500;
    list-style: none;
  }
  .fold summary::-webkit-details-marker { display: none; }
  .fold summary::before { content: "+"; margin-right: 0.4rem; color: var(--faint); }
  .fold[open] summary::before { content: "–"; }
  .fold .steps { margin-top: 0.65rem; }
  .fold .scroll { margin-top: 0.65rem; }
  .fold-head { margin: 0.85rem 0 0.35rem; }

  .field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 0.7rem;
  }
  .field-row input {
    flex: 1 1 16rem;
    min-width: 0;
    padding: 0.58rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg-inset);
    font-family: var(--mono);
    font-size: 0.84rem;
  }
  .field-row input::placeholder { color: var(--faint); }
  .field-row input:focus { border-color: var(--brass); outline: none; }
  .btn {
    flex: 0 0 auto;
    padding: 0.58rem 0.95rem;
    border: 1px solid var(--brass);
    border-radius: var(--radius);
    background: var(--brass);
    color: var(--brass-ink);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: filter 140ms var(--ease);
  }
  .btn:hover { filter: brightness(1.06); }

  .meter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.2rem 0 0.8rem;
  }
  .window-meter {
    position: relative;
    flex: 1 1 auto;
    height: 0.62rem;
    border: 1px solid var(--line);
    background:
      repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), var(--line) calc(12.5% - 1px) 12.5%),
      var(--bg-inset);
  }
  .window-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brass-dim), var(--brass));
    transition: width 0.45s var(--ease);
  }
  .meter-value {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    color: var(--brass);
  }

  .mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .mini-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  @container (max-width: 40rem) {
    .mini-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @container (max-width: 32rem) {
    .mini-grid { grid-template-columns: 1fr; }
    .mini-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  .metric {
    padding: 0.55rem 0.65rem 0.6rem;
    border: 1px solid var(--line);
    background: var(--bg-inset);
  }
  .metric small {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .metric b {
    display: block;
    margin-top: 0.2rem;
    font-family: var(--mono);
    font-size: 1.02rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--bg-raised);
  }
  .scroll.tall {
    max-height: 26rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  table {
    width: 100%;
    font-family: var(--mono);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
  }
  th, td {
    padding: 0.44rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }
  th {
    position: sticky;
    top: 0;
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--faint);
    background: var(--bg-raised);
  }
  th.num, td.num { text-align: right; }
  td.wrapcell { white-space: normal; min-width: 12rem; }
  td.empty { color: var(--faint); text-align: center; }
  tbody tr:nth-child(even) td {
    background: color-mix(in oklch, var(--ink) 2.5%, transparent);
  }
  tbody tr:last-child td { border-bottom: 0; }
  tbody tr:hover td {
    background: color-mix(in oklch, var(--brass) 8%, transparent);
  }
  td a { font-family: var(--mono); }
  .table-label { margin: 0.9rem 0 0.35rem; }
  .table-label:first-child { margin-top: 0; }

  .ok { color: var(--good); }
  .bad { color: var(--bad); }
  .status-pill {
    padding: 0.14rem 0.55rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: color-mix(in oklch, currentColor 10%, transparent);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .miner-card { display: grid; gap: 1rem; margin-bottom: 0.55rem; }

  /* Small labelled states inside tables: coinbase kind, block status, our own gateway. */
  .pill {
    display: inline-block;
    padding: 0.08rem 0.45rem;
    border: 1px solid color-mix(in oklch, currentColor 55%, transparent);
    border-radius: 999px;
    background: color-mix(in oklch, currentColor 9%, transparent);
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.5;
    color: var(--muted);
    white-space: nowrap;
  }
  .pill.ok { color: var(--good); }
  .pill.warn { color: var(--warn); }
  .pill.bad { color: var(--bad); }
  .pill.brass { color: var(--brass); }

  .pubkey { font-size: 0.74em; line-height: 1.35; }

  .coinbase-table td.faint, .coinbase-table tr.faint td { color: var(--faint); }
  .coinbase-table tr.pool-row td {
    border-top: 1px solid var(--line-strong);
    color: color-mix(in oklch, var(--ink) 80%, var(--brass));
  }

  tr.block-row { cursor: pointer; }
  tr.block-row td { vertical-align: top; }
  tr.block-row:focus-visible td { outline: 2px solid var(--brass); outline-offset: -2px; }
  .disclose {
    display: inline-block;
    width: 0.5rem;
    margin-right: 0.45rem;
    color: var(--faint);
    transition: transform 140ms var(--ease);
  }
  .disclose::before { content: "\25B8"; }
  tr.block-row[aria-expanded="true"] .disclose { transform: rotate(90deg); }
  tr.block-detail > td { padding: 0 0 0.35rem 1.4rem; background: var(--bg-inset) !important; }
  tr.block-detail:hover > td { background: var(--bg-inset) !important; }
  table.inner { font-size: 0.74rem; }
  table.inner th { position: static; background: transparent; }
  table.inner tbody tr:nth-child(even) td { background: transparent; }
  table.inner tbody tr:hover td { background: transparent; }
  table.inner td, table.inner th { padding: 0.32rem 0.6rem; }
  table.inner tbody tr:last-child td { border-bottom: 0; }

  .copyable {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    max-width: 100%;
  }
  .copyable > .mono,
  .copyable > a {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .copy-btn {
    flex: 0 0 auto;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-inset);
    color: var(--muted);
    transition: color 140ms var(--ease), border-color 140ms var(--ease), background 140ms var(--ease);
  }
  .copy-btn::before {
    content: "";
    display: block;
    width: 0.86rem;
    height: 0.86rem;
    margin: auto;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='5' y='5' width='8' height='9' rx='1' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M3 11V3.5A1.5 1.5 0 0 1 4.5 2H11' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='5' y='5' width='8' height='9' rx='1' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M3 11V3.5A1.5 1.5 0 0 1 4.5 2H11' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .copy-btn:hover {
    color: var(--brass);
    border-color: var(--brass);
  }
  .copy-btn[data-copied] {
    color: var(--good);
    border-color: var(--good);
  }
  .copy-btn[data-copied]::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  .addr-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    font-family: var(--mono);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
  }
  .addr-line .copyable { font-size: inherit; }

  .links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1.4rem;
    margin-top: 0.7rem;
    color: var(--muted);
    font-size: 0.86rem;
  }

  /* Three plain-language promises under the ticker, for people who have never pool-mined. */
  .pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
  }
  @container (max-width: 44rem) {
    .pillars { grid-template-columns: 1fr; }
  }
  .pillars li {
    padding: 0.7rem 0.85rem 0.75rem;
    border: 1px solid var(--line);
    border-top: 2px solid var(--brass-dim);
    background: var(--bg-raised);
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
  }
  .pillars b { display: block; margin-bottom: 0.2rem; color: var(--ink); font-weight: 600; }

  /* "If a block is found right now": reward -> miners / pool. */
  .payout-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 2fr);
    align-items: stretch;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
  }
  @container (max-width: 44rem) {
    .payout-hero { grid-template-columns: 1fr; }
    .payout-hero .payout-arrow { display: none; } /* outranks the base rule below */
  }
  .payout-big {
    display: grid;
    align-content: center;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line-strong);
    background:
      radial-gradient(120% 90% at 0% 0%, color-mix(in oklch, var(--brass) 16%, transparent), transparent 60%),
      var(--bg-inset);
  }
  .payout-big small, .payout-split .metric small {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .payout-big b {
    font-family: var(--mono);
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--brass);
    line-height: 1.1;
  }
  .payout-big .faint, .payout-split .faint { font-size: 0.76rem; line-height: 1.35; }
  .payout-arrow {
    display: grid;
    place-items: center;
    width: 2rem;
    color: var(--brass-dim);
  }
  .payout-arrow::before { content: "\2192"; font-size: 1.4rem; }
  .payout-split {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 0.55rem;
  }
  @container (max-width: 30rem) {
    .payout-split { grid-template-columns: 1fr; }
  }
  .payout-split .metric { display: grid; align-content: center; gap: 0.15rem; padding: 0.8rem 0.9rem; }
  .payout-split .metric b { margin-top: 0; font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem); }
  .payout-split .split-miners { border-left: 3px solid var(--good); }
  .payout-split .split-miners b { color: var(--ink); }
  .payout-split .split-pool { border-left: 3px solid var(--brass-dim); }

  /* The same coinbase split as the table below, as a ring: a slice per payout address. */
  .donut-row {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    align-items: center;
    gap: 1.5rem;
    margin: 0.35rem 0 1.1rem;
  }
  @container (max-width: 38rem) {
    .donut-row { grid-template-columns: 1fr; justify-items: center; gap: 1rem; }
  }
  .donut-figure { position: relative; width: 100%; max-width: 15rem; margin: 0; }
  .donut { display: block; width: 100%; height: auto; }
  .donut-arc { transition: opacity 120ms var(--ease); }
  .donut-figure:hover .donut-arc { opacity: 0.55; }
  .donut-figure .donut-arc:hover { opacity: 1; }
  .donut-hole {
    position: absolute;
    inset: 22%;
    display: grid;
    place-content: center;
    text-align: center;
    pointer-events: none;
  }
  .donut-hole b {
    display: block;
    font-family: var(--mono);
    font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.45rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--brass);
    line-height: 1.05;
  }
  .donut-hole small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.62rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .donut-side { display: grid; gap: 0.6rem; min-width: 0; }
  /* Multi-column rather than grid so the ranking reads down one column and on to the next,
     the same order as the table under it. */
  .donut-legend {
    columns: 2;
    column-gap: 1.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  @container (max-width: 30rem) {
    .donut-legend { columns: 1; }
  }
  .donut-item {
    display: grid;
    grid-template-columns: 0.55rem minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.16rem 0;
    font-size: 0.78rem;
    border-bottom: 1px solid color-mix(in oklch, var(--line) 55%, transparent);
    break-inside: avoid;
  }
  .donut-swatch {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 1px;
    /* baseline-aligned with the row's text rather than its box */
    transform: translateY(0.06rem);
  }
  .donut-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .donut-label a { font-size: 0.76rem; }
  .donut-name { color: var(--ink); }
  .donut-name::before { content: "\00b7\00a0"; color: var(--faint); }
  .donut-pct {
    font-family: var(--mono);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
  }
  .donut-desc { margin: 0; font-size: 0.74rem; line-height: 1.45; color: var(--faint); }

  /* Fee schedule cards ahead of the connect tabs. */
  .fee-schema {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.8rem;
  }
  @container (max-width: 36rem) {
    .fee-schema { grid-template-columns: 1fr; }
  }
  .fee-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "kicker rate" "title rate" "copy copy" "cta cta";
    gap: 0.1rem 1rem;
    padding: 0.75rem 0.9rem 0.8rem;
    border: 1px solid var(--line);
    background: var(--bg-raised);
    cursor: pointer;
    transition: border-color 140ms var(--ease), background 140ms var(--ease);
  }
  .fee-card:hover { border-color: var(--line-strong); }
  .fee-card.reco:hover { border-color: var(--brass); }
  .fee-cta {
    grid-area: cta;
    margin-top: 0.45rem;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--brass);
  }
  .fee-cta::after { content: " \2193"; color: var(--brass-dim); }
  .fee-card.reco {
    border-color: color-mix(in oklch, var(--brass) 55%, var(--line));
    background: color-mix(in oklch, var(--brass) 7%, var(--bg-raised));
  }
  .fee-kicker {
    grid-area: kicker;
    font-size: 0.66rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .fee-card.reco .fee-kicker { color: var(--brass); }
  .fee-title { grid-area: title; font-weight: 600; color: var(--ink); }
  .fee-rate {
    grid-area: rate;
    align-self: center;
    font-family: var(--mono);
    font-size: 1.7rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--muted);
  }
  .fee-card.reco .fee-rate { color: var(--brass); }
  .fee-copy { grid-area: copy; margin-top: 0.3rem; color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
  .tab-fee {
    margin-left: 0.35rem;
    padding: 0.02rem 0.4rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    vertical-align: 0.1em;
  }
  .tab-fee.reco { border-color: var(--brass-dim); color: var(--brass); }

  .table-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.9rem 0 0.35rem;
  }
  .table-head:first-of-type { margin-top: 0; }
  .table-head .table-label { margin: 0; }
  .table-count { font-family: var(--mono); font-size: 0.74rem; color: var(--faint); }
  .ticker.slim { margin-bottom: 0.6rem; }
  /* Gateway rows carry prose-ish cells (client build, state); let those wrap so the table
     fits the page instead of scrolling sideways. */
  #gwtable td:nth-child(3) { white-space: normal; min-width: 12rem; }
  #gwtable td { vertical-align: top; line-height: 1.4; }
  #gwtable td .faint { font-size: 0.72rem; }
  .ticker.slim dd { font-size: 1rem; }

  .how-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    counter-reset: how;
  }
  @container (max-width: 44rem) {
    .how-grid { grid-template-columns: 1fr; }
  }
  .how-grid h3 {
    margin-bottom: 0.4rem;
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--brass);
  }
  .how-grid .copy { font-size: 0.88rem; }
  #how .note { margin-top: 0.7rem; }
}

@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .skip {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    z-index: 40;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--brass);
    background: var(--bg-raised);
    font-size: 0.8rem;
    text-decoration: none;
    transition: top 140ms var(--ease);
  }
  .skip:focus { top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .site-header { backdrop-filter: none; }
}
