/* BTCX Observatory — site-wide stylesheet.
 *
 * Shared across the dashboard pages (`/`, `/chain`, `/utxo`, `/network`).
 * Single source of truth; no per-page CSS files. Modest scope:
 * typography, layout, chart-mount sizing, summary tiles. The
 * vendored uPlot.min.css is loaded alongside for uPlot's own styles.
 */

:root {
    --fg:           #1a1a1a;
    --fg-muted:     #6a6a6a;
    --fg-faint:     #999;
    --bg:           #ffffff;
    --bg-tile:      #f7f7f8;
    --bg-code:      #f1f1f3;
    --border:       #e5e5e7;
    --accent:       #1a4a8a;
    --warn-bg:      #fff8e0;
    --warn-border:  #d4a000;

    --radius:       6px;
    --gap:          1.25rem;
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.55;
    margin: 0;
}

main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

h1 { margin: 0 0 0.25rem; font-weight: 600; }
h2 { margin: 2rem 0 0.75rem; font-weight: 600; font-size: 1.25rem; }

.subtitle  { color: var(--fg-muted); margin: 0 0 2rem; }

nav.global {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    display: flex;
    gap: 1.5rem;
    align-items: baseline;
    font-size: 0.95rem;
}
nav.global .brand {
    font-weight: 600;
    margin-right: auto;
}
nav.global a {
    color: var(--fg-muted);
    text-decoration: none;
}
nav.global a:hover     { color: var(--fg); }
nav.global a.active    { color: var(--fg); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

code {
    background: var(--bg-code);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.9em;
}

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

/* ---------- Summary tiles (the top row of each tier dashboard) ---------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--gap);
    margin-bottom: 2rem;
}
.tile {
    background: var(--bg-tile);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}
.tile .label { color: var(--fg-muted); font-size: 0.85rem; }
.tile .value { font-size: 1.5rem; font-weight: 600; margin-top: 0.15rem; }
.tile .sub   { color: var(--fg-faint); font-size: 0.8rem; margin-top: 0.25rem; }

/* ---------- Chart mounts ---------- */

.chart-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
    margin-bottom: var(--gap);
}
@media (min-width: 900px) {
    .chart-row.two { grid-template-columns: 1fr 1fr; }
}

.chart {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem 0.6rem;
}
.chart h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg-muted);
}
.chart .mount { width: 100%; height: 280px; }
.chart .mount.tall { height: 360px; }

/* ---------- Misc ---------- */

.note {
    background: var(--warn-bg);
    border-left: 3px solid var(--warn-border);
    padding: 0.75rem 1rem;
    margin-top: 2.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

footer {
    margin: 3rem 0 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--fg-faint);
    font-size: 0.85rem;
    text-align: center;
}

/* ---------- Richlist table (UTXO dashboard) ---------- */

table.richlist {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: var(--gap);
}
table.richlist th,
table.richlist td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
table.richlist th {
    background: var(--bg-tile);
    color: var(--fg-muted);
    font-weight: 600;
}
table.richlist th.num,
table.richlist td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
table.richlist td.addr code {
    font-size: 0.85em;
}
