:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --line: #e3e1dc;
  --accent: #1f4e8c;
  --l: #1d4ed8;
  --ll: #60a5fa;
  --c: #8b8b94;
  --lr: #f87171;
  --r: #c81e1e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --card: #1c1c1f;
    --text: #ececef;
    --muted: #9a9aa2;
    --line: #2e2e33;
    --accent: #8fb4ff;
    --l: #3b82f6;
    --ll: #93c5fd;
    --c: #a1a1aa;
    --lr: #fca5a5;
    --r: #ef4444;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: clamp(15px, 14px + 0.2vw, 17px)/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
/* Fluid width: one column on phones, wider grids on laptops and desktops. */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }

.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.top .wrap:first-child { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding-top: 12px; }
@media (max-width: 640px) {
  .top { position: static; }  /* keep the screen for content on phones */
  nav { flex-wrap: wrap; }    /* every section visible, no sideways scrolling */
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.updated { color: var(--muted); font-size: 0.8rem; }
nav { display: flex; gap: 4px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: none; }
nav a {
  white-space: nowrap; text-decoration: none; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; font-size: 0.9rem;
}
nav a:hover { color: var(--text); }
nav a[aria-current="page"] { background: var(--text); color: var(--bg); }

main { padding-top: 16px; padding-bottom: 32px; }
h1 { font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem); margin: 24px 0 12px; letter-spacing: -0.01em; }
h1 a { color: inherit; text-decoration: none; }
section + section { margin-top: 32px; }

.stories {
  display: grid; gap: 14px; align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
.story {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin: 0; overflow-wrap: break-word; min-width: 0;
}
.story h2 { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); line-height: 1.3; margin: 6px 0 2px; }
.meta { color: var(--muted); font-size: 0.82rem; margin: 0 0 8px; }
.summary { margin: 8px 0; }
.story ul { margin: 8px 0; padding-left: 20px; }
.story li { margin: 3px 0; }
.diff, .blindspot { font-size: 0.92rem; margin: 8px 0; }
.blindspot { color: var(--muted); font-style: italic; }

.lean-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.8rem; }
.lean-label {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem;
  padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor;
}
.lean-left { color: var(--l); }
.lean-lean-left { color: var(--ll); }
.lean-center, .lean-balanced { color: var(--c); }
.lean-lean-right { color: var(--lr); }
.lean-right { color: var(--r); }
.spectrum { display: inline-flex; width: 110px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.seg { display: block; height: 100%; }
.seg-l { background: var(--l); }
.seg-ll { background: var(--ll); }
.seg-c { background: var(--c); }
.seg-lr { background: var(--lr); }
.seg-r { background: var(--r); }
.lean-legend { color: var(--muted); }

details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; }
.sources { list-style: none; padding: 0 !important; font-size: 0.9rem; }
.sources li { margin: 6px 0; }
.sources a { text-decoration: none; }
.sources a:hover { text-decoration: underline; }

.chip {
  display: inline-block; font-size: 0.68rem; font-weight: 600; padding: 1px 6px;
  border-radius: 999px; border: 1px solid currentColor; vertical-align: 1px; white-space: nowrap;
}
.chip-l { color: var(--l); }
.chip-ll { color: var(--ll); }
.chip-c { color: var(--c); }
.chip-lr { color: var(--lr); }
.chip-r { color: var(--r); }

.more { margin: 10px 0 0; font-size: 0.9rem; }
.prose { max-width: 72ch; }
.empty { color: var(--muted); }
.ratings { border-collapse: collapse; width: 100%; background: var(--card); border-radius: 8px; overflow: hidden; }
.ratings th, .ratings td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
code { background: var(--line); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

footer { color: var(--muted); font-size: 0.82rem; padding-bottom: 32px; border-top: 1px solid var(--line); }

/* ---- markets ---- */
:root { --up: #15803d; --down: #b91c1c; }
@media (prefers-color-scheme: dark) { :root { --up: #4ade80; --down: #f87171; } }
.up { color: var(--up); }
.down { color: var(--down); }
.flat, .muted { color: var(--muted); }

.section-h { font-size: 1.1rem; margin: 24px 0 8px; }
.market { margin-bottom: 8px; }
table.mkt { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.mkt th, .mkt td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.mkt tr:last-child td { border-bottom: 0; }
.mkt th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.mkt .num { text-align: right; white-space: nowrap; }
.mkt caption { text-align: left; font-weight: 700; padding: 0 0 6px; }
.sym { font-weight: 600; }
.co { display: block; color: var(--muted); font-size: 0.82rem; line-height: 1.3; }

/* Sectors and movers sit side by side on wide screens and stack on narrow ones. */
.market-grid { display: grid; gap: 0 28px; }
@media (min-width: 1100px) { .market-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }
.panel { container-type: inline-size; min-width: 0; }
.movers { display: grid; grid-template-columns: 1fr; gap: 12px; }
@container (min-width: 600px) { .movers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) {
  .col-etf { display: none; }
  .mkt th, .mkt td { padding: 7px 8px; }
}
.note { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }
