/* NexusPlexus design system — "Split Signal" (redesign 2026-07-27).
   Dark Koyfin-style chrome, Polymarket-style odds charts, and the two-sided
   insider-vs-market card that states the product thesis. One accent (gold)
   for brand/score; blue is the prediction market's color; green/red are
   reserved strictly for trade direction. The /week page ("This Week") is a
   deliberate light editorial sheet — see the .paper block at the bottom. */

:root {
  --bg: #101318;
  --panel: #171c24;
  --panel-2: #131720;
  --border: #232a38;
  --text: #e6eaf1;
  --muted: #7c8698;
  --accent: #d9a441;   /* brand + divergence score */
  --mkt: #4c8dff;      /* the prediction market's color */
  --buy: #35c08e;
  --sell: #f27b6c;
  --diverge: #d9a441;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--mkt); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  display: flex; align-items: baseline; gap: 1.3rem; flex-wrap: wrap;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  /* Explicit, not inherited: light pages (body.paper — /week) keep the same
     dark chrome, so the nav never sinks into a light background. */
  background: var(--bg);
}
header.site .logo {
  font-size: 1.15rem; font-weight: 800; letter-spacing: .03em; color: var(--text);
}
header.site .logo span { color: var(--accent); }
header.site nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
header.site nav a { color: var(--muted); font-size: .92rem; }
header.site nav a:hover { color: var(--text); text-decoration: none; }
header.site nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
header.site .tag { color: var(--muted); font-size: .85rem; margin-left: auto; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.4rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Small-caps micro-label over every figure (Koyfin habit) */
.lab {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted);
}

.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1.2rem;
  overflow-x: auto;
}

table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td {
  text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td.wrap { white-space: normal; }
table.data th {
  color: var(--muted); font-weight: 600; cursor: pointer; user-select: none;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
}
table.data th.sorted-asc::after { content: " ▲"; }
table.data th.sorted-desc::after { content: " ▼"; }
table.data tr:hover td { background: rgba(255,255,255,.02); }

.badge {
  display: inline-block; padding: .12rem .55rem; border-radius: 4px;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
}
.badge.buy    { background: rgba(53,192,142,.14);  color: var(--buy); }
.badge.sell   { background: rgba(242,123,108,.14); color: var(--sell); }
.badge.agree  { background: rgba(76,141,255,.14);  color: var(--mkt); }
.badge.diverge{ background: rgba(217,164,65,.16);  color: var(--diverge); }
.badge.neutral{ background: rgba(124,134,152,.14); color: var(--muted); }
.badge.noise  { background: rgba(124,134,152,.12); color: var(--muted); }
/* no_read: the question has no bullish/bearish meaning — deliberately
   verdict-less, dashed so these rows are easy to spot when scanning. */
.badge.noread { background: transparent; color: var(--muted);
                border: 1px dashed var(--border); }

.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--buy); }
.neg { color: var(--sell); }

.chart-wrap { position: relative; height: 380px; }

button, .btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: .35rem .8rem; font-size: .85rem; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--mkt); outline-offset: 2px; }
button.approve { color: var(--buy); }
button.reject { color: var(--sell); }

input[type=email], select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: .45rem .7rem; font-size: .95rem;
}

.ad-slot { display: none; } /* reserved (PRD §10) — renders nothing until configured */

/* ---------------- Split-signal cards (Trending) ----------------
   Insiders on the left, the prediction market on the right, the tension
   in the middle. The hero (#1) gets the full treatment; the rest are
   compact. The social-screenshot job moved to /week, so cards use natural
   height instead of the old 4:5 lock. */

.scard {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; margin-bottom: 1.3rem;
}
.scard-head {
  display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap;
  padding: 1.1rem 1.4rem 0;
}
.scard-rank { font-size: .78rem; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.scard-ticker { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.scard-ticker:hover { color: var(--accent); text-decoration: none; }
.scard-co { color: var(--muted); font-size: .82rem; }
.scard-score { margin-left: auto; text-align: right; }
.scard-score .num { font-size: 1.35rem; font-weight: 800; color: var(--accent); }
.scard-q {
  padding: .35rem 1.4rem .9rem; margin: 0; color: #aeb7c6;
  font-size: .95rem; max-width: 75ch;
}
.scard-split {
  display: grid; grid-template-columns: 1fr 84px 1fr;
  border-top: 1px solid var(--border);
}
.scard-side { padding: 1rem 1.4rem; min-width: 0; }
.scard-big { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; margin: .25rem 0 .1rem; }
.scard-side .det { color: var(--muted); font-size: .8rem; }
.scard-vs {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .45rem; border-left: 1px dashed var(--border); border-right: 1px dashed var(--border);
  padding: .6rem 0;
}
.scard-vs .word { font-size: .64rem; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.scard-vs .word.agree { color: var(--mkt); }
.scard-vs .word.neutral { color: var(--muted); }
.scard-vs .word.noread { color: var(--muted); border: 1px dashed var(--border);
                         border-radius: 4px; padding: .1rem .3rem; }
.meter { width: 8px; height: 56px; border-radius: 4px;
  background: linear-gradient(180deg, var(--sell), var(--accent) 55%, var(--mkt)); }
.meter.buyside { background: linear-gradient(180deg, var(--buy), var(--accent) 55%, var(--mkt)); }
.meter.quiet { background: var(--border); }
.scard-chart { border-top: 1px solid var(--border); padding: .9rem 1.4rem .3rem; position: relative; height: 150px; }
.scard.hero .scard-chart { height: 210px; }
.scard-sentence {
  margin: 0; padding: .8rem 1.4rem; color: var(--text); font-size: .92rem;
  border-top: 1px solid var(--border); border-left: 3px solid var(--accent);
}
.scard-ctx {
  display: flex; gap: 1.6rem; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding: .8rem 1.4rem; font-size: .78rem;
  color: var(--muted); background: var(--panel-2);
}
.scard-ctx b { display: block; color: #cfd6e2; font-size: .88rem; font-weight: 700; }

@media (max-width: 640px) {
  .scard-split { grid-template-columns: 1fr; }
  .scard-vs { flex-direction: row; border: 0; border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border); }
  .meter { width: 56px; height: 8px;
    background: linear-gradient(90deg, var(--sell), var(--accent) 55%, var(--mkt)); }
  .meter.buyside { background: linear-gradient(90deg, var(--buy), var(--accent) 55%, var(--mkt)); }
}

/* Compact grid for ranks 2+ */
.scard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 1.3rem; }
.scard-grid .scard { margin-bottom: 0; }
@media (max-width: 480px) { .scard-grid { grid-template-columns: 1fr; } }

/* Cluster strip (30-day insider clusters, market-wide) */
.cluster-strip { margin-top: 2rem; }
.cluster-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.cchip {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: .8rem 1rem; font-size: .85rem;
}
.cchip .t { display: flex; justify-content: space-between; gap: .6rem; font-weight: 700; }
.cchip .t .amt { font-variant-numeric: tabular-nums; }
.cchip .d { color: var(--muted); margin-top: .2rem; font-size: .8rem; }

details.noise-rows summary { cursor: pointer; color: var(--muted); padding: .4rem 0; }

footer.site {
  max-width: 1100px; margin: 2rem auto 0; padding: 1.2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem;
}
footer.site p { margin: .3rem 0; }

.empty { padding: 2rem; text-align: center; color: var(--muted); }
.error { color: var(--sell); }

/* ---- /scoreboard: insiders vs the crowd ---- */
.sb-headline {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin: 1.4rem 0 1.8rem;
}
.sb-stat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.1rem 1.3rem;
}
.sb-stat .sb-num { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; }
.sb-stat.gold .sb-num { color: var(--accent); }
.sb-stat .sb-lab { color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.calib-row {
  display: grid; grid-template-columns: 72px 1fr 130px 90px;
  gap: .8rem; align-items: center; padding: .45rem 0;
}
.calib-lab { color: var(--muted); font-size: .82rem; text-align: right; }
.calib-track {
  position: relative; height: 14px; border-radius: 7px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
}
.calib-bar {
  position: absolute; inset: 2px auto 2px 2px; border-radius: 5px;
  background: linear-gradient(90deg, rgba(217,164,65,.55), var(--accent));
}
.calib-tick {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--mkt); border-radius: 1px;
}
.calib-val { font-size: .85rem; }
.calib-n { font-size: .78rem; text-align: right; }
table.data tr.disagreed td { background: rgba(217,164,65,.05); }
table.data tr.disagreed td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 640px) {
  .calib-row { grid-template-columns: 60px 1fr 84px; }
  .calib-n { display: none; }
}

/* ---------------- "This Week" — the editorial paper sheet ----------------
   Deliberately light while the rest of the site is dark: it reads as
   editorial content in a social feed, not a terminal screenshot. The .sheet
   is the crop target — masthead, headline, chart, receipts all inside. */

body.paper { background: #e9e6de; }
.paper main { max-width: 860px; }
.sheet {
  background: #fbfaf7; color: #14161a; border: 1px solid #d5d1c5;
  box-shadow: 0 10px 40px rgba(20,20,10,.18);
  font-family: Georgia, "Times New Roman", serif;
}
.sheet-mast {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  flex-wrap: wrap; padding: 1.2rem 2rem .8rem; border-bottom: 2px solid #14161a;
}
.sheet-mast .logo { font-weight: 700; font-size: 1.25rem; color: #14161a; }
.sheet-mast .wk {
  font: 700 .68rem/1 -apple-system, "Segoe UI", sans-serif;
  text-transform: uppercase; letter-spacing: .14em; color: #6d6a61;
}
.sheet-body { padding: 1.8rem 2rem 1.6rem; }
.sheet .kick {
  font: 700 .7rem/1 -apple-system, "Segoe UI", sans-serif;
  text-transform: uppercase; letter-spacing: .16em; color: #0f6b66;
  margin: 0 0 .8rem;
}
.sheet h1.head {
  font-size: 1.85rem; line-height: 1.24; font-weight: 700; margin: 0 0 1rem;
  text-wrap: balance; max-width: 24em;
}
.sheet h1.head em { font-style: normal; border-bottom: 3px solid #0f6b66; }
.sheet .chartcard { border: 1px solid #dcd8cc; background: #fff; padding: 1.1rem 1.2rem .7rem; }
.sheet .chartcard .cwrap { position: relative; height: 220px; }
.sheet .chartcard .cap {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem;
  font: .72rem/1.5 -apple-system, "Segoe UI", sans-serif; color: #6d6a61; margin-top: .4rem;
}
.sheet .receipt {
  font: .78rem/1.6 -apple-system, "Segoe UI", sans-serif; color: #6d6a61; margin: .8rem 0 0;
}
.sheet .receipt a { color: #0f6b66; }
.sheet .alsohead {
  font: 700 .7rem/1 -apple-system, "Segoe UI", sans-serif; text-transform: uppercase;
  letter-spacing: .13em; color: #6d6a61; border-top: 1px solid #dcd8cc;
  padding-top: 1.1rem; margin: 1.6rem 0 .2rem;
}
.sheet .also {
  display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0;
  border-bottom: 1px solid #ece8dd; font-size: .98rem;
}
.sheet .also:last-of-type { border-bottom: 0; }
.sheet .also .n {
  font: 700 .82rem/1.7 -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums; white-space: nowrap; color: #14161a;
}
.sheet .also .n.up { color: #0f6b66; }
.sheet .also .n.dn { color: #a33d33; }
.paper .pagenote {
  font-size: .8rem; color: #6d6a61; max-width: 860px; margin: .9rem auto 0;
  font-family: -apple-system, "Segoe UI", sans-serif;
}
/* Footer legibility on the light page: same content, paper-tuned colors. */
body.paper footer.site { color: #5d6472; border-top-color: #d5d1c5; }
body.paper footer.site a { color: #0f6b66; }

@media (max-width: 560px) {
  .sheet-mast, .sheet-body { padding-left: 1.1rem; padding-right: 1.1rem; }
  .sheet h1.head { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .scard, .cchip { transition: border-color .15s ease; }
  .scard:hover, .cchip:hover { border-color: #34405a; }
}
