/*
 * rsk.zone — an independent technical reference.
 *
 * The look is a printed dossier, not a product page: a light paper ground, a
 * fixed measure, hairline rules, serif prose and monospace for every figure.
 * Deliberately nothing like rootstock.io, which is dark, full-bleed and
 * green; the only shared note is the logomark's orange, used sparingly.
 */

:root {
  --paper:      #fbfaf8;
  --paper-2:    #f3f1ed;
  --paper-3:    #e9e6e0;
  --ink:        #15181d;
  --ink-2:      #3d444e;
  --ink-3:      #6b7280;
  --rule:       #d9d5cd;
  --rule-soft:  #e8e5df;
  --accent:     #2f44b8;   /* indigo: links, structure */
  --accent-2:   #1b2a7a;
  --brand:      #ff931e;   /* the Rootstock logomark orange, as an accent only */
  --good:       #1c7a4a;
  --warn:       #8a5a00;
  --warn-bg:    #fdf4e3;
  --bad:        #a3161b;   /* reserved for warnings about losing money */
  --bad-bg:     #fdeeee;
  --measure:    74ch;
  --wide:       1180px;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #14161a;
    --paper-2:   #1b1e24;
    --paper-3:   #242830;
    --ink:       #e8e6e1;
    --ink-2:     #b9bcc3;
    --ink-3:     #8b9099;
    --rule:      #333841;
    --rule-soft: #272b33;
    --accent:    #93a5ff;
    --accent-2:  #b9c4ff;
    --good:      #5fd39b;
    --warn:      #e8b562;
    --warn-bg:   #2a2317;
    --bad:       #ff8b8b;
    --bad-bg:    #2e1618;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------------ masthead */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover { color: var(--ink); }

.wordmark img { width: 22px; height: 22px; display: block; }

.wordmark .dot { color: var(--brand); }

.wordmark .tag {
  font-weight: 450;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-left: 1px solid var(--rule);
  padding-left: 0.6rem;
  margin-left: 0.1rem;
}

nav.sections {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.875rem;
  margin-left: auto;
}

nav.sections a {
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

nav.sections a:hover { color: var(--accent); }

nav.sections a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--brand);
}

/* ------------------------------------------------------------------- layout */

main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.prose { max-width: var(--measure); }

h1, h2, h3, h4 {
  font-family: var(--sans);
  letter-spacing: -0.021em;
  line-height: 1.2;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  font-weight: 760;
  margin: 0 0 0.4rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 3rem 0 0.9rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 1.08rem;
  font-weight: 680;
  margin: 2rem 0 0.5rem;
}

h4 {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 1.5rem 0 0.4rem;
  color: var(--ink-2);
}

p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}

.dateline {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.5rem;
}

ul, ol { margin: 0 0 1rem; padding-left: 1.3rem; }
li { margin-bottom: 0.4rem; }

code, kbd, samp {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  padding: 0.08em 0.32em;
  word-break: break-word;
}

pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-left: 3px solid var(--rule);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0 0 1.2rem;
}

pre code { background: none; border: 0; padding: 0; font-size: inherit; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* -------------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
}

caption {
  caption-side: top;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-3);
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--rule-soft);
}

th, td {
  padding: 0.44rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--rule-soft);
  white-space: nowrap;
  vertical-align: top;
}

th {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--paper-2);
  position: sticky;
  top: 0;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--paper-2); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 22ch; font-family: var(--serif); font-size: 0.95rem; }
tr.current td { background: color-mix(in srgb, var(--brand) 9%, transparent); }
tr.current td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* ------------------------------------------------------------------- figures */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 0 1.5rem;
}

.stat {
  background: var(--paper);
  padding: 0.9rem 1rem;
}

.stat .k {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.25rem;
}

.stat .v {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.15;
  word-break: break-all;
}

.stat .v.sm { font-size: 0.95rem; }
.stat .sub { font-family: var(--sans); font-size: 0.75rem; color: var(--ink-3); margin-top: 0.2rem; }

/* --------------------------------------------------------------------- cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: " →"; color: var(--ink-3); font-weight: 400; }
.card p { font-size: 0.95rem; color: var(--ink-2); margin: 0 0 0.8rem; }
.card .meta {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  border-top: 1px solid var(--rule-soft);
  padding-top: 0.6rem;
}

/* --------------------------------------------------------------------- notes */

.note {
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.2rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.97rem;
}

.note.caution { border-left-color: var(--warn); background: var(--warn-bg); }
.note.verified { border-left-color: var(--good); }

/* Kept distinct from .caution, and used only where the consequence of getting
 * it wrong is irreversible loss of someone's bitcoin. */
.note.danger {
  border-left: 5px solid var(--bad);
  background: var(--bad-bg);
  font-size: 1rem;
}
.note.danger .label { color: var(--bad); letter-spacing: 0.1em; }
.note.danger strong { color: var(--bad); }
.note > :last-child { margin-bottom: 0; }

.note .label {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.3rem;
}

.source {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-3);
  margin: -0.5rem 0 1.4rem;
}

.source::before { content: "Source: "; font-weight: 600; }
.source a { color: var(--accent); }

.pill {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.12em 0.5em;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  vertical-align: 0.1em;
}

.pill.chain { border-color: var(--good); color: var(--good); }
.pill.live  { border-color: var(--brand); color: var(--warn); }
.pill.gap   { border-color: var(--warn); color: var(--warn); }

.mono { font-family: var(--mono); font-size: 0.86em; }
.muted { color: var(--ink-3); }
.key { font-family: var(--mono); font-size: 0.72rem; word-break: break-all; white-space: normal; }

/* --------------------------------------------------------------------- forms */

.form-card {
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 1.5rem;
  background: var(--paper);
  max-width: var(--measure);
}

label {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 620;
  margin-bottom: 0.35rem;
  color: var(--ink-2);
}

textarea, input[type="text"] {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.6rem 0.7rem;
  line-height: 1.5;
}

textarea { min-height: 9rem; resize: vertical; }

textarea:focus, input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  background: var(--paper);
}

.field { margin-bottom: 1.1rem; }

.hint {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-top: 0.3rem;
}

.counter { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.counter.over { color: #c0392b; font-weight: 700; }

button {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 620;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (prefers-color-scheme: dark) {
  button { color: #10131a; }
}

.captcha-row { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.captcha-q {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
}
.captcha-row .field { flex: 1 1 9rem; margin-bottom: 0; }
.captcha-row input { max-width: 9rem; }

.form-status {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  display: none;
}
.form-status.show { display: block; }
.form-status.ok { background: color-mix(in srgb, var(--good) 14%, transparent); border-left: 3px solid var(--good); }
.form-status.err { background: var(--warn-bg); border-left: 3px solid var(--warn); }

/*
 * The honeypot field. Moved off-screen rather than display:none, because
 * naive scrapers skip hidden fields but happily fill a positioned one.
 *
 * This lives in the stylesheet and not in a style="" attribute on purpose:
 * the Content-Security-Policy sets style-src 'self' with no 'unsafe-inline',
 * which blocks inline style attributes too — an inline rule here would be
 * dropped by the browser and the trap would be visible to real people.
 */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

noscript .note { margin-top: 1rem; }

/* -------------------------------------------------------------------- footer */

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

.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-3);
}

.footer-inner h4 {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: var(--ink-3);
}

.footer-inner ul { list-style: none; padding: 0; margin: 0; }
.footer-inner li { margin-bottom: 0.3rem; }
.footer-inner a { color: var(--ink-2); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); text-decoration: underline; }

.disclaimer {
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  line-height: 1.5;
}
.disclaimer-inner { max-width: var(--wide); margin: 0 auto; padding: 1.1rem 1.5rem; color: var(--ink-3); font-family: var(--sans); }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 0.5rem;
  background: var(--paper); color: var(--ink);
  padding: 0.5rem 1rem; z-index: 100;
  border: 2px solid var(--accent); border-radius: 4px;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --------------------------------------------------------------------- toc */

.toc {
  font-family: var(--sans);
  font-size: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 2rem;
  background: var(--paper-2);
  max-width: var(--measure);
}
.toc h4 { margin: 0 0 0.45rem; }
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc li { margin-bottom: 0.2rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 640px) {
  main { padding: 1.75rem 1rem 3rem; }
  .masthead-inner { padding: 0.65rem 1rem; gap: 0.75rem; }
  nav.sections { gap: 0.9rem; font-size: 0.82rem; width: 100%; margin-left: 0; }
  .wordmark .tag { display: none; }
  h2 { margin-top: 2.2rem; }
}

@media print {
  .masthead, footer.site, .toc, form { display: none; }
  body { background: #fff; color: #000; }
  main { max-width: none; }
}

/*
 * Pull quotes from external writing. Distinguished from .note, which is this
 * site's own editorial voice — a reader should be able to tell at a glance
 * which words are being quoted and which are ours.
 */
blockquote.quote {
  margin: 0 0 1.2rem;
  padding: 0.3rem 0 0.3rem 1.2rem;
  border-left: 3px solid var(--brand);
  color: var(--ink-2);
  font-size: 1rem;
}

blockquote.quote p { margin: 0 0 0.7rem; }
blockquote.quote > :last-child { margin-bottom: 0; }
blockquote.quote q { font-style: italic; }

/* ------------------------------------------------------ link-list entries */

.entries {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  max-width: var(--measure);
}

.entry {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule-soft);
  margin: 0;
}

.entry:last-child { border-bottom: 0; }

.entry-title {
  font-family: var(--sans);
  font-weight: 620;
  font-size: 1rem;
  line-height: 1.35;
  text-decoration: none;
}

.entry-title:hover { text-decoration: underline; }

/* An external destination, marked once rather than repeated in every summary. */
.entry-title::after {
  content: " ↗";
  font-weight: 400;
  color: var(--ink-3);
  font-size: 0.85em;
}

.entry-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-3);
  margin-top: 0.2rem;
}

.entry-sum {
  font-size: 0.97rem;
  color: var(--ink-2);
  margin-top: 0.3rem;
}

.entry-note {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-top: 0.25rem;
  padding-left: 0.7rem;
  border-left: 2px solid var(--rule);
}

/* ------------------------------------------------------ ecosystem filter */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.eco-filter {
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper-2);
  padding: 0.7rem 0.8rem;
  margin: 0 0 1.25rem;
}

/*
 * A packed grid rather than a wrapped row.
 *
 * Twelve checkboxes of uneven width wrap into a ragged block that is both
 * taller than it needs to be and hard to scan, which pushes the project table
 * below the fold — the one thing the reader actually came for. Fixed columns
 * keep it a tidy rectangle two or three rows deep, and the labels line up so
 * the eye can run down them.
 */
.eco-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.1rem 0.75rem;
}

.eco-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  margin: 0;
  padding: 0.14rem 0.3rem;
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
}

.eco-box:hover { color: var(--accent); background: var(--paper-3); }
.eco-box input { accent-color: var(--accent); cursor: pointer; margin: 0; flex: none; }

/* The label text, so a long category name truncates rather than breaking the grid. */
.eco-box > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "All" leads the grid and is set apart from the categories it clears. */
.eco-box.eco-all {
  font-weight: 680;
  color: var(--ink);
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--rule-soft);
  border-radius: 0;
  margin-bottom: 0.3rem;
  padding-bottom: 0.35rem;
}

/* A ticked category is visibly the thing being filtered on. */
.eco-box:has(input:checked) { color: var(--accent); font-weight: 650; }
.eco-box.eco-all:has(input:checked) { color: var(--ink); }

.eco-n {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.eco-tools {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule-soft);
}

.eco-search { flex: 0 1 20rem; margin: 0; }
.eco-search input {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.82rem;
  padding: 0.32rem 0.55rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
}

.eco-hint {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--ink-3);
  flex: 1 1 auto;
}

.eco-count {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------- ecosystem table */

#eco-table td { vertical-align: top; }
#eco-table .eco-name { white-space: nowrap; font-family: var(--sans); font-size: 0.85rem; }
#eco-table .eco-cats { white-space: normal; min-width: 9ch; }
#eco-table .eco-links { white-space: nowrap; font-family: var(--sans); font-size: 0.78rem; }

.tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  margin: 0 0.15em 0.15em 0;
  white-space: nowrap;
}

.eco-link { margin-right: 0.5em; }
.eco-link:last-child { margin-right: 0; }

.eco-empty {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-3);
  padding: 1.25rem;
  margin: 0;
  text-align: center;
}

@media (max-width: 760px) {
  #eco-table .eco-cats { display: none; }
  .eco-boxes { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
  .eco-box { font-size: 0.78rem; }
}

/*
 * The filter sets the `hidden` attribute on rows. A browser's default
 * `tr { display: table-row }` has higher specificity than `[hidden]`'s
 * `display: none` in some engines, so the row stays visible unless this is
 * stated explicitly.
 */
#eco-table .eco-row[hidden] { display: none; }

/* ------------------------------------------------------------- charts */

.chart { display: block; width: 100%; height: auto; }
.chart-grid { stroke: var(--rule-soft); stroke-width: 1; }
.chart-grid-x { stroke-dasharray: 2 4; }
.chart-zero { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-ytick, .chart-xtick, .chart-legend, .chart-ylabel, .chart-empty-text {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--ink-3);
}
.chart-legend { font-family: var(--sans); font-size: 12px; fill: var(--ink-2); }
.chart-ylabel { font-family: var(--sans); font-size: 11px; }
.chart-fill { opacity: 0.1; }
.chart-crosshair { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }

/* --- the 3-column grid of thumbnails --- */

.chart-grid-list, ul.chart-grid {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.chart-card { margin: 0; }

.chart-card-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.8rem 0.9rem 0.9rem;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.chart-card-link:hover { border-color: var(--accent); transform: translateY(-2px); }

.chart-card-title {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--ink);
}
.chart-card-link:hover .chart-card-title { color: var(--accent); }

.chart-card .chart { margin: 0.2rem 0; }

.chart-card-sub { font-size: 0.86rem; color: var(--ink-2); line-height: 1.4; }

.chart-card-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  margin-top: auto;
  padding-top: 0.35rem;
}

/* --- the full chart on a detail page --- */

.chart-full {
  margin: 0 0 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  padding: 0.6rem 0.8rem 0.5rem;
}

.chart-full svg { cursor: crosshair; }
.chart-full svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chart-readout {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-2);
  border-top: 1px solid var(--rule-soft);
  margin-top: 0.4rem;
  padding-top: 0.5rem;
  min-height: 1.4em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  align-items: center;
}

.readout-series { display: inline-flex; align-items: center; gap: 0.35rem; }

.readout-swatch {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 2px;
  background: var(--accent);
}

@media (max-width: 900px) {
  ul.chart-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  ul.chart-grid { grid-template-columns: 1fr; }
}
