/* SENTINEL — day/night redesign. Rounded cards, soft shadows, Bitcoin-gold accent.
   Night is the default (:root); day mode remaps tokens via [data-theme="day"]. */
/* Ubuntu font family, self-hosted (Ubuntu Font Licence 1.0) — CSP allows same-origin only. */
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ubuntu-400.woff2') format('woff2'); }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/ubuntu-500.woff2') format('woff2'); }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/ubuntu-700.woff2') format('woff2'); }
@font-face { font-family: 'Ubuntu Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ubuntumono-400.woff2') format('woff2'); }
@font-face { font-family: 'Ubuntu Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/ubuntumono-700.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #0a0b0e;
  --bg2: #0e1014;
  --panel: #111318;
  --panel-hover: #171a21;
  --card: #0e1015;          /* inner cards nested inside panels */
  --border: #242936;
  --line: #1f2430;          /* hairline borders (also themes mempool scoped CSS) */
  --text: #edf0f5;
  --fg: #edf0f5;            /* alias used by mempool scoped CSS */
  --muted: #9aa4b4;
  --faint: #6b7484;
  --gold: #f7931a;          /* Bitcoin orange — primary accent */
  --gold-dark: #dd7d0a;
  --gold-soft: #ffce8a;     /* warm gold for small text on dark tiles */
  --green: #58a6ff;         /* proven / ok */
  --red: #e0564f;
  --amber: #f7931a;
  --blue: #6fb8ff;          /* links, WATCH */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.3);
  --topbar-bg: rgba(10, 11, 14, 0.9);
  --hero-img: url('hero-night.jpg');
  --mono: 'Ubuntu Mono', 'Consolas', 'SF Mono', monospace;
  --sans: 'Ubuntu', 'Segoe UI', system-ui, sans-serif;
}
[data-theme="day"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg2: #eaeef4;
  --panel: #ffffff;
  --panel-hover: #f7f9fc;
  --card: #ffffff;
  --border: #dde3ec;
  --line: #e4e8ef;
  --text: #141922;
  --fg: #141922;
  --muted: #596476;
  --faint: #8a93a3;
  --gold-soft: #b26305;
  --green: #1d6fd1;
  --red: #c93a32;
  --blue: #1668d6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 26px rgba(16, 24, 40, 0.07);
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --hero-img: url('hero-day.jpg');
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; font-weight: 400; line-height: 1.65; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--bg2); padding: 2px 7px; border-radius: 6px; word-break: break-all; }
code.wide { display: block; margin: 4px 0; padding: 8px 10px; }
pre { font-family: var(--mono); font-size: 13.5px; background: var(--bg2); padding: 16px 18px; border-radius: 14px; overflow-x: auto; white-space: pre-wrap; }

.topbar { background: var(--topbar-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.tb-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 22px; height: 72px; padding: 0 28px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text) !important; }
.brand:hover { text-decoration: none; }
.brand .brandmark { display: block; width: 36px; height: 36px; }
.brand-words { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--sans); font-weight: 700; letter-spacing: 0.3em; font-size: 16px; color: var(--text); }
.brand-sub { font-family: var(--sans); font-weight: 500; letter-spacing: 0.26em; font-size: 8px; color: var(--gold); }
.topbar nav { display: flex; justify-content: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a, .nav-more { color: var(--muted); font-family: var(--sans); font-weight: 500; font-size: 14.5px; letter-spacing: 0.01em; padding: 9px 13px; position: relative; border-radius: 8px; }
.topbar nav a:hover { color: var(--text); text-decoration: none; }
.topbar nav a.active { color: var(--text); }
.topbar nav a.active::after { content: ''; position: absolute; left: 13px; right: 13px; bottom: 0; height: 2.5px; border-radius: 2px; background: var(--gold); }
.nav-more { cursor: pointer; user-select: none; }
.nav-more:hover, .nav-more:focus-within { color: var(--text); }
.nav-drop { display: none; position: absolute; top: 100%; left: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-width: 176px; box-shadow: var(--shadow); z-index: 20; }
.nav-more:hover .nav-drop, .nav-more:focus-within .nav-drop { display: flex; flex-direction: column; }
.nav-drop a { padding: 8px 12px !important; border-radius: 8px; }
.nav-drop a:hover { background: var(--panel-hover); }
.nav-drop a.active::after { display: none; }
.tb-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.btn-ghost { display: inline-flex; align-items: center; gap: 9px; font-family: var(--sans); font-weight: 500; font-size: 14.5px; padding: 9px 19px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--text); text-decoration: none; }
.btn-gold { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 500; font-size: 14.5px; padding: 10px 19px; border: 0; border-radius: 11px; color: #15130d; background: var(--gold); }
.btn-gold:hover { background: var(--gold-soft); color: #15130d; text-decoration: none; }
[data-theme="day"] .btn-gold:hover { background: var(--gold-dark); color: #ffffff; }
.btn-gold.lg, .btn-ghost.lg { font-size: 16px; padding: 14px 26px; border-radius: 13px; }
.theme-toggle { flex: none; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--gold); font-size: 17px; line-height: 1; cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--gold); background: var(--panel-hover); }
.theme-toggle .tt-moon { display: none; }
[data-theme="day"] .theme-toggle .tt-sun { display: none; }
[data-theme="day"] .theme-toggle .tt-moon { display: inline; }

.container { max-width: 1080px; margin: 0 auto; padding: 44px 28px 110px; }
.footer { color: var(--faint); font-family: var(--sans); font-size: 14px; padding: 28px; text-align: center; }

/* mega footer (homepage) */
.footer-mega { border-top: 1px solid var(--line); background: var(--bg2); margin-top: 40px; padding: 54px 28px 30px; text-align: left; }
.fm-grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 34px; }
.fm-brand { display: flex; flex-direction: column; gap: 12px; }
.fm-brandrow { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: 0.18em; color: var(--text); }
.fm-brandrow img { width: 28px; height: 28px; }
.fm-tag { color: var(--muted); font-size: 15px; }
.footer-mega h4 { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-bottom: 13px; }
.footer-mega ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-mega ul a { color: var(--muted); font-size: 14.5px; }
.footer-mega ul a:hover { color: var(--gold); text-decoration: none; }
.fm-bottom { max-width: 1080px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.tm-wrap { position: relative; border-radius: 16px; background: var(--panel); overflow-x: auto; border: 1px solid var(--line); box-shadow: var(--shadow); }
.tm-canvas { display: block; }
.tm-tip { position: absolute; background: var(--bg2); color: var(--text); font-family: var(--mono); font-size: 11px; padding: 6px 9px; border-radius: 8px; pointer-events: none; white-space: nowrap; z-index: 5; box-shadow: var(--shadow); }
.tm-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0; }
.tm-chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--sans); font-size: 13.5px; color: var(--muted); }
.tm-chip i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: var(--faint); }
.tm-chip.anc i { background: var(--blue); }
.tm-chip.root i { background: var(--gold); }
.tm-chip.desc i { background: var(--text); }
.tm-story { border-left: 4px solid var(--gold); padding: 6px 0 6px 20px; margin-top: 18px; border-radius: 2px; }
.tm-step { font-family: var(--sans); font-size: 15.5px; color: var(--text); padding: 6px 0; }
.tm-axis { display: flex; justify-content: space-between; font-family: var(--sans); font-size: 12.5px; color: var(--faint); margin-top: 6px; }

.sponsor { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 28px; padding: 16px 22px; border-radius: 14px; font-family: var(--sans); font-size: 13.5px; background: var(--panel); border: 1px solid var(--line); }
.sponsor-tag { color: var(--gold); font-size: 11px; letter-spacing: 0.22em; font-weight: 700; }
.sponsor-link { color: var(--text); }
.sponsor-note { color: var(--faint); font-size: 12px; }

h1 { font-size: 48px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 16px; }
h2 { font-family: var(--sans); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin: 56px 0 18px; }
.muted { color: var(--muted); font-size: 15px; }
.eyebrow { font-family: var(--sans); font-size: 12.5px; font-weight: 700; letter-spacing: 0.24em; color: var(--gold); margin-bottom: 14px; }
.subtitle { color: var(--muted); font-size: 19px; max-width: 780px; }

/* section heading + LIVE badge */
.h2row { display: flex; align-items: center; gap: 14px; margin: 56px 0 18px; flex-wrap: wrap; }
.h2row h2 { margin: 0; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; color: var(--gold); background: rgba(247, 147, 26, 0.1); border: 1px solid rgba(247, 147, 26, 0.35); padding: 6px 12px; border-radius: 999px; }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: sigpulse 2s infinite; }

/* hero — split layout with photographic plate */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center; padding: 48px 0 26px; text-align: left; }
.hero h1 { font-size: 54px; line-height: 1.06; }
.hero h1 .accent { color: var(--gold); }
.hero p { margin: 22px 0 34px; }
.hero-art { width: 100%; max-width: 500px; justify-self: end; aspect-ratio: 1 / 1; border-radius: 26px; border: 1px solid var(--line); background-image: var(--hero-img); background-size: cover; background-position: center; box-shadow: var(--shadow), 0 0 70px rgba(247, 147, 26, 0.13); }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-block; font-family: var(--sans); font-weight: 500; font-size: 15px; padding: 12px 26px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--panel); cursor: pointer; }
.btn:hover { background: var(--panel-hover); color: var(--text); border-color: var(--border); text-decoration: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #ffffff; font-weight: 500; }
.btn.primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #ffffff; }

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 40px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow); }
.stat .k { font-family: var(--sans); font-weight: 500; font-size: 12px; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; }
.stat .v { font-family: var(--sans); font-weight: 700; font-size: 26px; margin-top: 4px; color: var(--text); }
.stat .v.gold { color: var(--gold); }

/* event cards */
.cards { display: flex; flex-direction: column; gap: 16px; }
.cards.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 16px; padding: 20px 24px; display: block; color: var(--text); box-shadow: var(--shadow); }
.card:hover { background: var(--panel-hover); text-decoration: none; }
.card .head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.card .id { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.08em; }
.card .headline { font-size: 19px; font-weight: 700; margin-bottom: 5px; line-height: 1.3; }
.card .summary { color: var(--muted); font-size: 14.5px; }
.card .facts { display: flex; gap: 12px 18px; flex-wrap: wrap; margin-top: 14px; font-family: var(--sans); font-size: 13px; color: var(--faint); }
.card .facts b { color: var(--text); font-weight: 500; font-family: var(--mono); font-size: 12.5px; }

/* Clearly visible gold share button — every card carries one. */
.share-btn { font: 700 11px/1 var(--mono); letter-spacing: 0.04em; color: #14161c; background: #f7931a; border: 1px solid #f7931a; border-radius: 6px; padding: 7px 13px; cursor: pointer; flex: 0 0 auto; }
.share-btn:hover { background: #ffa733; border-color: #ffa733; color: #14161c; }
.share-btn.copied { background: #3fbf6f; border-color: #3fbf6f; color: #0d130f; }
.card-share { display: flex; justify-content: flex-end; margin-top: 12px; }
.hp-mini-foot .share-btn { margin-left: auto; padding: 6px 10px; font-size: 10px; }
.card.sev-CRITICAL { border-left-color: var(--red); }
.card.sev-HIGH { border-left-color: var(--gold); }
.card.sev-WATCH { border-left-color: var(--blue); }
.card.sev-RESEARCH { border-left-color: var(--faint); }

.sev { font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; padding: 5px 12px; border-radius: 999px; background: var(--bg2); }
.sev-CRITICAL { color: var(--red); }
.sev-HIGH { color: var(--gold); }
.sev-WATCH { color: var(--blue); }
.sev-RESEARCH { color: var(--muted); }
.invalid { color: var(--red); font-family: var(--sans); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; }

/* report page */
.report-head { padding: 26px 0 6px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 28px; }
.meta-grid > div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); }
.meta-grid span { display: block; font-family: var(--sans); font-weight: 500; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.meta-grid strong { font-family: var(--mono); font-size: 15px; font-weight: 700; }
section { margin-bottom: 10px; }
section p { margin-bottom: 14px; max-width: 800px; }

.scores { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin-bottom: 14px; }
.score { display: grid; grid-template-columns: 100px 1fr 52px; align-items: center; gap: 14px; font-family: var(--sans); font-size: 13.5px; }
.score .k { color: var(--faint); }
.score .v { text-align: right; font-family: var(--mono); }
.bar, .simbar { height: 10px; background: var(--bg2); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--gold); border-radius: 999px; }
.simbar { display: inline-block; width: 90px; vertical-align: middle; }
.simbar > div { height: 100%; background: var(--blue); border-radius: 999px; }

ul.claims { list-style: none; max-width: 820px; }
ul.claims li { padding: 14px 20px; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 14px; margin-bottom: 12px; background: var(--panel); font-size: 16px; box-shadow: var(--shadow); }
ul.claims.proven li { border-left-color: var(--green); }
ul.claims.inferred li { border-left-color: var(--gold); }
ul.claims.unknown li { border-left-color: var(--faint); color: var(--muted); }
.claims .refs { margin-top: 6px; }
.claims .meth, .claims .conf { font-size: 13.5px; color: var(--faint); display: block; margin-top: 5px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { font-family: var(--sans); font-weight: 500; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 13.5px; }
tr:hover td { background: var(--panel); }

.analyst { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px; font-size: 16px; max-width: 820px; box-shadow: var(--shadow); }
.cite pre { border-left: 4px solid var(--gold); }

/* forms */
input[type=text], input[type=search], select { background: var(--panel); border: 1px solid var(--line); color: var(--text); font-family: var(--mono); font-size: 15px; padding: 12px 17px; border-radius: 12px; width: 100%; outline: none; }
input:focus { border-color: var(--gold); }
.searchrow { display: flex; gap: 12px; margin: 24px 0 32px; max-width: 760px; }
.searchrow input { flex: 1; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 28px; }
.filters select, .filters input { width: auto; min-width: 150px; }

.notice { border-radius: 14px; padding: 18px 22px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 15px; margin: 20px 0; max-width: 820px; }
.error { color: var(--red); }
.loading { color: var(--faint); font-family: var(--sans); font-size: 15px; padding: 34px 0; }

/* digest */
.digest-slot { font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: 0.18em; color: var(--gold); text-transform: uppercase; margin-bottom: 4px; }

/* age bands */
.band { display: grid; grid-template-columns: 110px 1fr 150px; gap: 14px; align-items: center; font-family: var(--sans); font-size: 13.5px; margin-bottom: 8px; }
.band .lbl { color: var(--muted); }
.band .amt { text-align: right; font-family: var(--mono); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { justify-self: start; max-width: 460px; }
  .fm-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 34px; }
  .hero h1 { font-size: 38px; }
  h2 { font-size: 23px; }
  .subtitle { font-size: 17.5px; }
  .topbar { height: auto; padding: 12px 18px; flex-wrap: wrap; gap: 10px; }
  .container { padding: 30px 18px 70px; }
  .band { grid-template-columns: 90px 1fr 110px; }
}

/* ============================== TX BOARDS ============================== */
.container.wide { max-width: 1320px; }
.board { position: relative; border-radius: 16px; overflow: hidden; margin: 18px 0 30px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.board-canvas-wrap { position: relative; width: 100%; }
.board-note { font-size: 12.5px; color: var(--faint); }

/* Value Flow Explorer — light board (fixed palette by design) */
.board-light { background: #f7f7f5; color: #1a1a1a; }
.board-light .board-note { color: #8a8a8a; }
.board-topbar { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; padding: 13px 18px; background: #ffffff; border-bottom: 1px solid #e4e4e0; font-size: 14px; color: #555; }
.flow-depth-label { color: #999; letter-spacing: 1px; font-size: 12.5px; text-transform: uppercase; }
.flow-stepper { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.flow-stepper b { min-width: 22px; text-align: center; font-size: 16px; color: #1a1a1a; }
.flow-detail { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; color: #999; font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; }
.flow-detail input[type=range] { width: 140px; accent-color: var(--gold); }
.mini-btn { background: #ececea; border: none; color: #333; width: 26px; height: 26px; border-radius: 6px; font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1; padding: 0; }
.mini-btn:hover { background: var(--gold); color: #fff; }
.board-bottombar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 18px; background: #ffffff; border-top: 1px solid #e4e4e0; }
.api-btn { width: auto; padding: 0 16px; height: 30px; display: inline-flex; align-items: center; background: var(--gold); color: #fff; font-size: 12px; letter-spacing: 1px; text-decoration: none; border-radius: 6px; }
.api-btn:hover { background: var(--gold-dark); color: #fff; }
#flow-select { flex: 1; min-width: 200px; }
.searchrow select { width: auto; }

/* Transfer Network — dark board (fixed palette by design) */
.board-dark { background: #171c24; min-height: 300px; }
.board-overlay-tl { position: absolute; top: 14px; left: 14px; z-index: 3; display: flex; gap: 10px; align-items: center; }
.board-overlay-tl input { width: 240px; background: rgba(12, 16, 22, 0.85); border: 1px solid #2c3644; color: #e8e8e8; font-size: 13px; padding: 9px 13px; border-radius: 8px; }
.pill { background: rgba(12, 16, 22, 0.85); border: 1px solid #2c3644; color: #9fb3c8; font-size: 11.5px; letter-spacing: 1px; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.pill b { color: #fff; }
.board-overlay-tr { position: absolute; top: 14px; right: 16px; z-index: 3; text-align: right; font-family: var(--mono); font-size: 12px; line-height: 1.55; color: #9fb3c8; pointer-events: none; }
.board-overlay-tr .hl { color: #fff; }
.board-timeline { display: flex; align-items: flex-end; gap: 2px; height: 74px; padding: 8px 14px 20px; background: #12161d; }
.tl-bar { flex: 1; min-width: 8px; background: #31435a; border-radius: 2px 2px 0 0; position: relative; cursor: pointer; }
.tl-bar:hover { background: #4a6280; }
.tl-bar.active { background: var(--gold); }
.tl-bar span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 9.5px; color: #6b7a8c; padding-top: 3px; white-space: nowrap; }

/* Analytics dashboard panels */
.board-panel { background: var(--panel); padding: 22px 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-title { font-size: 20px; font-weight: 700; letter-spacing: 1.5px; }
.panel-sub { font-size: 13px; color: var(--faint); margin-top: 2px; }
.panel-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.panel-controls label { display: inline-flex; gap: 7px; align-items: center; }
.panel-controls input[type=date] { background: var(--bg2); border: 1px solid var(--line); color: var(--text); font-family: var(--mono); font-size: 13px; padding: 8px 10px; border-radius: 8px; outline: none; }
.panel-controls .btn { padding: 9px 16px; font-size: 12.5px; }
.board-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 0 30px; }
.board-row .board { margin: 0; }
.donut-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut-legend { font-size: 12.5px; font-family: var(--mono); display: grid; grid-template-columns: auto auto auto; gap: 4px 14px; align-items: center; }
.donut-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.donut-legend .pc { text-align: right; color: var(--text); }
.donut-legend .amt { text-align: right; color: var(--faint); }
.table-scroll { overflow-x: auto; }
table.hist { border-collapse: collapse; font-family: var(--mono); font-size: 12px; white-space: nowrap; width: 100%; }
table.hist th { text-align: right; color: var(--faint); font-weight: 500; letter-spacing: 1px; font-size: 10.5px; padding: 7px 10px; border-bottom: 1px solid var(--border); }
table.hist td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
table.hist th:first-child, table.hist td:first-child { text-align: left; }
table.hist td.hodl { color: var(--blue); font-weight: 700; }
table.hist td.total { color: var(--text); }

/* Trace graph — black board with TOOLS rail (fixed palette by design) */
.board-black { background: #0e1013; }
.board-tools { position: absolute; left: 0; top: 0; bottom: 0; width: 58px; background: #14171c; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 12px; }
.tools-label { font-size: 9px; letter-spacing: 2.5px; color: #5c6470; }
.tool-btn { width: 38px; height: 38px; background: #1e232b; border: none; border-radius: 9px; color: #cfd6df; font-size: 16px; cursor: pointer; line-height: 1; padding: 0; }
.tool-btn:hover, .tool-btn.on { background: var(--gold); color: #fff; }
#trace-canvas-wrap { margin-left: 58px; }

@media (max-width: 900px) {
  .board-row { grid-template-columns: 1fr; }
  .board-overlay-tr { display: none; }
  .flow-detail { margin-left: 0; }
}

/* ============ MINING INTELLIGENCE ============ */
.lede { color: var(--muted); font-size: 16px; max-width: 820px; margin: 6px 0 10px; }
.prov { font-family: var(--sans); font-weight: 700; font-size: 10px; letter-spacing: 0.14em; padding: 3px 9px; border-radius: 999px; background: var(--bg2); }
.prov-PROVEN { color: var(--green); }
.prov-INFERRED { color: var(--gold); }
.prov-ESTIMATED { color: var(--muted); }
.stat .prov { display: inline-block; margin-top: 8px; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.metric.unavail { opacity: 0.75; }
.metric-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.metric-label { font-family: var(--sans); font-weight: 500; font-size: 12px; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; }
.metric-value { font-family: var(--sans); font-weight: 700; font-size: 23px; margin-top: 6px; }
.metric.unavail .metric-value { color: var(--faint); }
.metric-reason { color: var(--gold); font-size: 13.5px; margin-top: 4px; }
.metric-meth { color: var(--faint); font-size: 13px; margin-top: 8px; line-height: 1.5; }

.mining-signal { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--faint); border-radius: 16px; padding: 22px 26px; margin: 8px 0 4px; box-shadow: var(--shadow); }
.mining-signal.lvl-LOW { border-left-color: var(--green); }
.mining-signal.lvl-MODERATE { border-left-color: var(--muted); }
.mining-signal.lvl-ELEVATED { border-left-color: var(--gold); }
.mining-signal.lvl-CRITICAL { border-left-color: var(--red); }
.signal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.signal-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--gold); animation: sigpulse 2s infinite; }
@keyframes sigpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.signal-title { font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: 0.18em; color: var(--text); }
.signal-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: baseline; }
.signal-score { font-family: var(--sans); font-weight: 700; font-size: 24px; }
.signal-conf, .signal-asof { font-family: var(--mono); font-size: 13px; color: var(--faint); letter-spacing: 0.08em; }
.signal-interp { color: var(--muted); font-size: 15px; margin: 12px 0 14px; max-width: 860px; }
.mining-signal .mini-btn { background: var(--bg2); color: var(--text); border: 0; border-radius: 8px; font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; padding: 8px 16px; cursor: pointer; }
.mining-signal .mini-btn:hover { background: var(--panel-hover); }
.signal-evidence { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.evidence-line { background: var(--bg2); border-radius: 12px; padding: 14px 18px; }
.evidence-line.unavail { opacity: 0.7; }
.evidence-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.evidence-name { font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; }
.evidence-w, .evidence-score { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.evidence-val { font-family: var(--mono); font-size: 14px; margin-top: 6px; }

.mod-badge-live { color: var(--green); }
.mod-badge-partial { color: var(--gold); }
.mod-badge-unavailable { color: var(--faint); }
.card.mod-live { border-left-color: var(--green); }
.card.mod-partial { border-left-color: var(--gold); }
.card.mod-unavailable { border-left-color: var(--faint); }

/* ============================== HOMEPAGE (hp) — exact mockup layout ============================== */
.container.hp { max-width: 1280px; }
.hp-main { padding-top: 10px; padding-bottom: 0; }

/* hero with full-bleed photographic plate */
.hp-hero-wrap { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hp-hero-art { position: absolute; top: 0; right: 0; bottom: 0; width: 58%; background-image: var(--hero-img); background-size: cover; background-position: center 30%; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%); mask-image: linear-gradient(to right, transparent 0%, #000 30%); }
.hp-hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 72%, var(--bg) 100%); }
.hp-hero { position: relative; z-index: 1; display: flex; align-items: center; padding: 74px 28px 52px; min-height: 540px; }
.hp-hero-copy { max-width: 600px; }
.hp-pill { display: inline-flex; border: 1px solid rgba(247, 147, 26, 0.5); color: var(--gold); font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; padding: 7px 15px; border-radius: 999px; margin-bottom: 24px; background: rgba(247, 147, 26, 0.06); }
[data-theme="day"] .hp-pill { display: none; }
.hp-h1 { font-size: 64px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.04; margin: 0; }
.hp-h1 .accent { color: var(--gold); }
.hp-sub { color: var(--muted); font-size: 19px; max-width: 440px; margin: 22px 0 32px; }
.hp-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hp-cta .btn-ghost { background: var(--panel); }
.hp-feats { display: flex; gap: 36px; margin-top: 48px; flex-wrap: wrap; }
.hp-feat { display: flex; align-items: center; gap: 11px; font-family: var(--sans); font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.hp-feat svg { width: 27px; height: 27px; color: var(--gold); flex: none; }

/* panels */
.hp-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow); margin-top: 20px; }
.hp-panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hp-panel-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.hp-info { color: var(--faint); cursor: help; font-size: 14px; font-style: normal; }
.hp-link { margin-left: auto; color: var(--muted); font-family: var(--sans); font-weight: 500; font-size: 13.5px; }
.hp-link:hover { color: var(--gold); text-decoration: none; }
.hp-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.hp-3col .hp-panel { margin-top: 20px; display: flex; flex-direction: column; }
.hp-panel-btn { display: block; text-align: center; margin-top: auto; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); font-family: var(--sans); font-weight: 500; font-size: 13.5px; background: var(--card); }
.hp-panel-btn:hover { border-color: var(--gold); text-decoration: none; color: var(--text); }

/* live feed mini-cards */
.hp-feedrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.hp-mini { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; display: flex; flex-direction: column; gap: 8px; color: var(--text); font-family: var(--sans); min-height: 196px; }
.hp-mini:hover { border-color: var(--border); background: var(--panel-hover); text-decoration: none; }
.hp-mini-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hp-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 19px; background: var(--bg2); border: 1px solid var(--line); }
.hp-ago { color: var(--faint); font-size: 12px; }
.hp-mini-title { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.hp-mini-val { font-weight: 500; font-size: 13px; }
.hp-mini-sub { color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hp-chip { align-self: flex-start; background: rgba(247, 147, 26, 0.13); color: var(--gold-soft); font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 7px; }
.hp-mini-foot { margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--faint); font-size: 11.5px; font-family: var(--mono); }
.hp-mini-analysis { color: #a78bfa; font-weight: 500; font-size: 13px; font-family: var(--sans); }

/* overview panel */
.hp-big-label { color: var(--muted); font-size: 13px; }
.hp-bigrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hp-big { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.hp-delta { font-family: var(--sans); font-weight: 500; font-size: 13px; }
.hp-delta.up { color: #35c07d; } .hp-delta.down { color: var(--red); }
[data-theme="day"] .hp-delta.up { color: #14824d; }
.hp-chart { width: 100%; height: auto; display: block; margin: 12px 0 4px; }
.hp-4stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.hp-4stats > div span { display: block; color: var(--faint); font-size: 11.5px; }
.hp-4stats > div b { font-size: 15px; font-weight: 700; }
.hp-4stats > div b.gold { color: var(--gold); }

/* metric rows */
.hp-mrow { display: grid; grid-template-columns: 1fr auto auto 66px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 13.5px; }
.hp-mrow:last-of-type { border-bottom: 0; margin-bottom: 8px; }
.hp-mrow .lbl { color: var(--muted); }
.hp-mrow .val { font-weight: 700; }
.hp-mrow .dlt { font-size: 12px; font-weight: 500; }
.hp-mrow .dlt.up { color: #35c07d; } .hp-mrow .dlt.down { color: var(--red); }
[data-theme="day"] .hp-mrow .dlt.up { color: #14824d; }

/* signals donut */
.hp-donut-row { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; padding: 10px 0 16px; }
.hp-sleg { display: flex; flex-direction: column; gap: 10px; font-family: var(--sans); font-size: 13.5px; }
.hp-sleg > div { display: flex; align-items: center; gap: 9px; }
.hp-sleg i { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.hp-sleg b { min-width: 18px; text-align: right; }
.hp-sleg span { color: var(--muted); }

/* supply age heatmap */
.hp-toggle { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; margin-bottom: 14px; align-self: flex-start; }
.hp-toggle button { border: 0; background: transparent; color: var(--muted); font-family: var(--sans); font-weight: 500; font-size: 12.5px; padding: 6px 14px; border-radius: 7px; cursor: pointer; }
.hp-toggle button.on { background: rgba(247, 147, 26, 0.18); color: var(--gold); }
.hp-heat { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.hp-heat-row { display: grid; grid-template-columns: 74px 1fr 86px; gap: 10px; align-items: center; font-family: var(--sans); font-size: 12.5px; }
.hp-heat-row .lbl { color: var(--muted); }
.hp-heat-row .amt { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--text); }
.hp-heat-bar { height: 14px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.hp-heat-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6b4a12, var(--gold)); min-width: 3px; }
.hp-heat-scale { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin-bottom: 14px; }
.hp-heat-scale .grad { flex: 1; max-width: 190px; height: 7px; border-radius: 999px; background: linear-gradient(90deg, #6b4a12, var(--gold)); }

/* volume bars */
.hp-flow-big { font-size: 26px; font-weight: 700; color: var(--gold); }
.hp-flow-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.hp-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; font-family: var(--mono); margin: 4px 0 14px; }

/* recent intelligence */
.hp-rec { display: flex; flex-direction: column; margin-bottom: 8px; }
.hp-rec-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); font-family: var(--sans); font-size: 13.5px; line-height: 1.4; }
.hp-rec-row:hover { text-decoration: none; background: transparent; color: var(--text); }
.hp-rec-row:hover .txt { color: var(--gold-soft); }
.hp-rec-row:last-of-type { border-bottom: 0; }
.hp-rec-row .hp-ico { width: 32px; height: 32px; font-size: 16px; flex: none; }
.hp-rec-row .ago { color: var(--faint); font-size: 12px; flex: none; width: 62px; padding-top: 2px; }
.hp-rec-row .txt { flex: 1; }

/* CTA band */
.hp-band { display: grid; grid-template-columns: 1.25fr 1.7fr 1fr; gap: 34px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 36px 38px; margin-top: 26px; box-shadow: var(--shadow); }
.hp-band-brand { display: flex; gap: 20px; align-items: flex-start; }
.hp-band-brand img { width: 62px; height: 62px; flex: none; }
.hp-band-brand h2 { margin: 0 0 8px; font-size: 21px; line-height: 1.3; }
.hp-band-brand p { color: var(--muted); font-size: 14px; }
.hp-band-feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; text-align: center; }
.hp-band-feat { display: flex; flex-direction: column; align-items: center; gap: 7px; font-family: var(--sans); font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.hp-band-feat b { font-size: 13px; color: var(--text); }
.hp-bico { width: 46px; height: 46px; border-radius: 999px; background: rgba(247, 147, 26, 0.12); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.hp-bico svg { width: 22px; height: 22px; }
.hp-band-cta h3 { font-size: 16px; margin-bottom: 6px; }
.hp-band-cta p { color: var(--muted); font-size: 13px; }
.hp-api-row { display: flex; gap: 10px; margin-top: 14px; }
.hp-api-row code { flex: 1; display: flex; align-items: center; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg2); font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }

/* footer */
.hp-footer { border-top: 1px solid var(--line); background: var(--bg2); margin-top: 60px; }
.hp-footer .container { padding: 52px 28px 28px; }
.hp-foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 32px; }
.hp-foot-brand p { color: var(--muted); font-size: 14.5px; margin-top: 14px; }
.hp-footer h4 { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 13px; }
.hp-footer ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.hp-footer ul a { color: var(--muted); font-family: var(--sans); font-size: 14.5px; }
.hp-footer ul a:hover { color: var(--gold); text-decoration: none; }
.hp-socials { display: flex; gap: 10px; }
.hp-socials a { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--panel); }
.hp-socials a:hover { color: var(--gold); border-color: var(--gold); }
.hp-socials svg { width: 17px; height: 17px; }
.hp-foot-bottom { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-family: var(--sans); font-size: 13px; }

@media (max-width: 1080px) {
  .hp-feedrow { grid-template-columns: repeat(3, 1fr); }
  .hp-3col { grid-template-columns: 1fr; gap: 0; }
  .hp-band { grid-template-columns: 1fr; gap: 26px; }
  .hp-foot-grid { grid-template-columns: 1fr 1fr; }
  .hp-hero-art { width: 100%; opacity: 0.3; -webkit-mask-image: none; mask-image: none; }
  .hp-hero { min-height: 0; }
}
@media (max-width: 720px) {
  .tb-inner { height: auto; padding: 12px 18px; flex-wrap: wrap; gap: 10px; }
  .topbar nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .tb-actions .btn-ghost { display: none; }
  .hp-h1 { font-size: 42px; }
  .hp-feedrow { grid-template-columns: 1fr; }
  .hp-mini { min-height: 0; }
  .hp-band-feats { grid-template-columns: 1fr 1fr; }
  .hp-foot-grid { grid-template-columns: 1fr; }
  .hp-4stats { grid-template-columns: 1fr 1fr; }
}
