/* ═══════════════════════════════════════════════════════════════
   Jelly
   original Everywhere maroon + navy, speckled topbar/sidebar,
   soft lavender-white content cards
══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&family=Baloo+2:wght@600;700&display=swap');

:root {
  --bg:          #f8f7fb;
  --bg-2:        #efedf5;
  --bg-3:        #e6e3ee;
  --bg-hover:    #ece9f3;
  --border:      #ded9ea;
  --border-2:    #c7c1d9;
  --text:        #14152b;
  --text-muted:  #5c5f75;
  --text-dim:    #9a9bb0;

  /* Reverted to the original Everywhere brand values (topbar/sidebar/logo
     asked to go back to this, not the brighter magenta tried first) --
     var(--maroon)/var(--navy) still flow through nav-item.active, chat
     bubbles, the chart palette, etc. automatically. */
  --maroon:      #9b1d5f;
  --navy:        #081f48;
  --accent:      var(--maroon);
  --accent-dim:  #f5e8ef;
  --blue:        #0d3a66;
  --blue-dim:    #e5eefb;

  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 8px 28px rgba(20,21,46,.10);
  --shadow-sm:   0 2px 10px rgba(20,21,46,.06);

  --surface:     #fff;      /* cards, panels, table bodies */
  --brand:       #9b1d5f;   /* the fixed brand maroon of the top bar and sidebar */
  --footer-h:    30px;
  --title-blue:  #2f63b8;   /* page titles */

  --header-h:  76px;
  --sidebar-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

html, body {
  /* the whole page must never scroll horizontally -- only .table-wrap does */
  overflow-x: hidden;
  width: 100%;
}

body, input, button, select, textarea {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background-color: var(--bg);
  background-image: url('/static/img/noise.webp');
  background-repeat: repeat;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════
   HEADER, everywhere berry, speckled
══════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  width: 100%;
  background-color: var(--brand);
  background-image: url('/static/img/noise.webp');
  background-repeat: repeat;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  overflow: hidden;
}
.topbar-drips {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.topbar-drip { position: absolute; }
.topbar-logo, .topbar-search, .topbar-right { position: relative; z-index: 1; }

.topbar-logo {
  display: flex; align-items: center;
  flex-shrink: 0;
  padding: 0 6px;
}
.jelly-logo-img {
  height: 30px;
  width: auto;
  display: block;
}
.topbar-logo .jelly-wordmark {
  font-family: "Baloo 2", "Roboto", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: -.01em;
}

.topbar-search {
  position: relative;
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}
.search-wrap {
  position: relative;
  display: flex; align-items: center;
  background: var(--bg);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
}
.search-wrap:focus-within { border-color: var(--navy); background: var(--surface); }
.search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-dim); pointer-events: none;
  z-index: 1;
}
.topbar-search input {
  width: 100%;
  padding: 10px 46px 10px 40px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.topbar-search input::placeholder { color: var(--text-dim); }
.search-kbd-hint {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  pointer-events: none;
}

/* ══════════════════════════════════
   CHAT TAB: Claude-style conversation-list + transcript layout
══════════════════════════════════ */
.chat-view {
  display: flex;
  gap: 16px;
  height: calc(100vh - var(--header-h) - 48px);
}
.chat-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
}
.chat-sidebar-head h2 { font-size: 16px; font-weight: 700; color: var(--text); }
.chat-new-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.chat-new-btn:hover { opacity: .88; }

.chat-search-wrap {
  position: relative;
  display: flex; align-items: center;
}
.chat-search-icon {
  position: absolute; left: 10px;
  width: 14px; height: 14px;
  color: var(--text-dim);
  pointer-events: none;
}
.chat-search-wrap input {
  width: 100%;
  padding: 8px 10px 8px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  outline: none;
  background: var(--bg-2);
}
.chat-search-wrap input:focus { border-color: var(--accent); background: var(--surface); }

.chat-convo-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-convo-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
  padding: 10px 10px 4px;
}
.chat-convo-group-label:first-child { padding-top: 2px; }
.chat-convo-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.chat-convo-item:hover { background: var(--bg-hover); }
.chat-convo-item.active { background: var(--accent-dim); }
.chat-convo-item.active .chat-convo-title { color: var(--accent); }
.chat-convo-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}
.chat-convo-title-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
}
.chat-convo-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}
.chat-convo-time {
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.chat-convo-preview {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-convo-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.chat-convo-rename,
.chat-convo-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px;
}
.chat-convo-delete { font-size: 15px; }
.chat-convo-rename:hover { color: var(--navy); }
.chat-convo-delete:hover { color: var(--maroon); }
.chat-convo-rename-input {
  width: 100%;
  font-size: 13px;
  padding: 2px 4px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  outline: none;
  background: var(--bg);
  color: var(--text);
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.chat-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-msg { display: flex; gap: 10px; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--navy);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-msg-avatar svg { width: 15px; height: 15px; color: #fff; }
.chat-msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.chat-msg.user .chat-msg-bubble { background: var(--accent); color: #fff; }
.chat-msg.assistant .chat-msg-bubble { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.chat-msg-bubble.loading { color: var(--text-dim); }
.chat-msg-bubble.error { color: var(--maroon); }
.chat-msg.assistant:has(.chat-chart) .chat-msg-bubble { max-width: 90%; }
.chat-chart { margin-top: 10px; }
.chat-chart svg { display: block; overflow: visible; }
.chat-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.chat-chart-legend-vertical { flex-direction: column; gap: 6px; }
.chat-chart-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.chat-chart-swatch {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.chat-input-form {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--border);
}
.chat-input-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.chat-input-form button {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
}
.chat-input-form button:hover { opacity: .9; }

.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
  flex-shrink: 0;
}
.topbar-help {
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: transparent; cursor: pointer;
  color: rgba(255,255,255,.88);
  transition: background .15s, color .15s;
}
.topbar-help svg { width: 22px; height: 22px; }
.topbar-help:hover { background: rgba(255,255,255,.16); color: #fff; }
.topbar-help:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.topbar-divider {
  width: 1px; height: 24px;
  background: rgba(255,255,255,.25);
}

.profile {
  display: flex; align-items: center;
  gap: 8px;
  cursor: default;
}
.profile-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--maroon);
  background: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.profile-text {
  display: flex; flex-direction: column; line-height: 1.25;
}
.profile-name {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
}
.profile-org {
  font-size: 11px;
  color: rgba(255,255,255,.7);
}

/* ══════════════════════════════════
   SHELL / SIDEBAR
══════════════════════════════════ */
.shell {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  width: 100%;
}

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background-color: var(--brand);
  background-image: url('/static/img/noise.webp');
  background-repeat: repeat;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Decorative blue jelly drops, scattered sporadically across the full sidebar
   width (not a straight line down one edge) -- real teardrop SVGs (same blob
   shape + wet highlight as the topbar mark), each independently sized/rotated. */
.sidebar-drips {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.sidebar-drip {
  position: absolute;
}

.nav-items { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}
.nav-item.active {
  background-color: var(--blue);
  background-image: url('/static/img/noise.webp');
  background-repeat: repeat;
  color: #fff;
  font-weight: 600;
}

/* Thin speckled-blue seam exactly where the pink sidebar meets the grey
   content area -- replaces the old "Deeper insights" promo card. */
.sidebar-edge {
  position: absolute;
  top: 0; right: 0;
  width: 7px; height: 100%;
  background-color: var(--blue);
  background-image: url('/static/img/noise.webp');
  background-repeat: repeat;
  z-index: 2;
}

/* Same seam, but running the full width along the bottom of the topbar --
   where the pink topbar meets the grey content below it. */
.topbar-edge {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 7px;
  background-color: var(--blue);
  background-image: url('/static/img/noise.webp');
  background-repeat: repeat;
  z-index: 2;
}

/* ══════════════════════════════════
   CONTENT
══════════════════════════════════ */
.content {
  flex: 1;
  min-width: 0; /* critical: without this a flex child won't shrink below its
                   content's intrinsic width, and a wide table drags the whole
                   page into horizontal scroll instead of scrolling internally */
  /* .content, not the page, is the single scroll container -- fixed height so
     the outer page can never scroll. Previously .table-wrap did its own nested
     overflow/max-height and relied on the page never scrolling for its sticky
     thead to "freeze"; but nothing actually stopped the page from scrolling,
     so once table-wrap itself scrolled out of view its sticky header went
     with it. Scrolling here instead means table-wrap/topbar/sidebar never
     move, so the sticky thead genuinely can't disappear. */
  height: calc(100vh - var(--header-h) - var(--footer-h));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 32px;
}

.content h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* ══════════════════════════════════
   HOME
══════════════════════════════════ */
.home-wrap { max-width: 1500px; }

.home-hero { margin-bottom: 18px; }
.home-hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.home-hero-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 2px;
}
.home-hero-sub {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
}

.home-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.home-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.home-pill:hover { background: var(--bg-2); }
.home-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.home-main-col, .home-side-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
/* Same speckle texture as the topbar/sidebar, but noise.webp turns out to be
   SO faint (near-white grain) that it's invisible on a white card even at full
   opacity -- it only reads on a saturated color. contrast() punches the grain's
   tiny luminance variation up into something actually visible; multiply keeps
   pure-white pixels from tinting the card while the darker speckles show through. */
/* noise.webp turned out to be too faint to amplify reliably (see git history --
   contrast()+multiply on it produced nothing visible in an actual screenshot,
   twice). This is a purpose-built SVG feTurbulence grain instead -- real
   visible speckle, tunable directly, no fighting a mystery asset. */
.home-card::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url('/static/img/grain.svg');
  background-repeat: repeat;
  opacity: .08;
  pointer-events: none;
}
.home-card > * { position: relative; z-index: 1; }
.home-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.home-section-head h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.home-section-note { font-size: 11px; color: var(--text-dim); }

/* Featured story */
.home-featured {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.home-featured-bg {
  position: relative;
  min-height: 320px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 24px;
}
.home-featured-bg::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,20,0) 30%, rgba(8,8,18,.85) 100%);
}
.home-featured-tag {
  position: absolute; top: 16px; left: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 5px;
  z-index: 1;
}
.home-featured-text { position: relative; z-index: 1; color: #fff; max-width: 640px; }
.home-featured-kicker { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #f0a9cd; margin-bottom: 8px; }
.home-featured-title { font-size: 26px; font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.home-featured-excerpt { font-size: 13px; color: rgba(255,255,255,.85); line-height: 1.5; margin-bottom: 12px; max-width: 520px; }
.home-featured-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
}
.home-featured-cta:hover { text-decoration: none; opacity: .92; }
.home-featured-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.home-featured-dots { display: flex; gap: 6px; }
.home-featured-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-2); }
.home-featured-dot.active { background: var(--accent); width: 16px; border-radius: 3px; }
.home-featured-count { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.home-featured-arrows { display: flex; gap: 8px; }
.home-featured-arrow {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
}
.home-featured-arrow:hover { background: var(--bg-2); }

/* Tech Benchmarks (reuses .dash-sidebar-item etc. from the old dashboard --
   same real data, just laid out 2-up in a home-card instead of a rail). */
.home-bench-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

/* In-depth research row */
.home-indepth-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.home-indepth-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-decoration: none;
}
.home-indepth-card:hover { background: var(--bg-2); text-decoration: none; }
.home-indepth-kicker { font-size: 10px; font-weight: 700; letter-spacing: .03em; color: var(--accent); margin-bottom: 6px; }
.home-indepth-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 8px; }
.home-indepth-pill {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

/* Latest Intelligence */
.home-latest-list {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}
.home-latest-item { display: flex; gap: 10px; text-decoration: none; }
.home-latest-item:hover .home-latest-title { color: var(--accent); text-decoration: none; }
.home-latest-thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.home-latest-thumb-fallback { background: linear-gradient(135deg, var(--navy), var(--maroon)); }
.home-latest-body { min-width: 0; }
.home-latest-meta { font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: .02em; margin-bottom: 3px; }
.home-latest-title { font-size: 13px; color: var(--text); line-height: 1.35; }

/* Ask Jelly */
.home-ask-jelly { background: linear-gradient(165deg, var(--accent-dim), #fff 70%); }
.home-ask-jelly-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.home-ask-jelly-star { width: 16px; height: 16px; color: var(--accent); }
.home-ask-jelly-head h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.home-beta-tag {
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 9px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.home-ask-jelly-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.home-ask-jelly-form { display: flex; gap: 8px; margin-bottom: 12px; }
.home-ask-jelly-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
  background: var(--surface);
}
.home-ask-jelly-form button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.home-ask-jelly-chips { display: flex; flex-direction: column; gap: 6px; }
.home-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.home-chip:hover { border-color: var(--accent); color: var(--text); }

/* Trending Sectors */
.home-trending-list { display: flex; flex-direction: column; gap: 10px; }
.home-trending-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.home-trending-rank {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-muted);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.home-trending-name { flex: 1; color: var(--text); font-weight: 500; }
.home-trending-row .row-avatar { flex-shrink: 0; }
.home-trending-row.has-tags { align-items: flex-start; }
.home-trending-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.home-trending-line1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.home-trending-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.home-trending-count { color: var(--accent); font-weight: 600; font-size: 11px; }

/* Money Raised by Sector -- full-width: real bar chart (reuses the Chat tab's
   SVG chart renderer) + Most Active Investors panel, side by side. */
.home-funding-card { margin-top: 20px; }
.home-funding-split { display: flex; gap: 24px; align-items: stretch; }
.home-funding-chart { flex: 1.7; min-width: 0; }
.home-funding-investors {
  flex: 1;
  min-width: 0;
  border-left: 1px solid var(--border);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
}
.home-funding-investors-head { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; }
@media (max-width: 900px) {
  .home-funding-split { flex-direction: column; }
  .home-funding-investors { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 16px; }
}

@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-indepth-row { grid-template-columns: 1fr; }
}

/* M&A Activity -- Recent Acquisitions + Top Valuation Multiples, evenly split
   (unlike Money Raised by Sector's chart+sidebar, both sides here are lists
   of similar visual weight). */
.home-ma-card { margin-top: 20px; }
.home-ma-split { display: flex; gap: 24px; align-items: stretch; }
.home-ma-split > div { min-width: 0; }
.home-ma-chart-col { flex: 1.3; }
.home-ma-recent-col { flex: 1; border-left: 1px solid var(--border); padding-left: 24px; }
@media (max-width: 900px) {
  .home-ma-split { flex-direction: column; }
  .home-ma-recent-col { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 16px; }
}

/* Space Launch Activity -- the 4-block colored banner deliberately mirrors
   spacestatsonline.com's own "Launches:" banner (gray/green/yellow/red)
   instead of the generic stat-card look used elsewhere on Home, since that's
   the specific presentation being matched here. */
.home-space-card { margin-top: 20px; }
.home-space-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin: 4px 0 10px;
  border-radius: 8px;
  overflow: hidden;
}
.home-space-banner-block {
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.home-space-banner-block.total { background: #e7e7ee; }
.home-space-banner-block.success { background: #dcf1e0; }
.home-space-banner-block.partial { background: #fbecc7; }
.home-space-banner-block.failure { background: #f6dade; }
.home-space-banner-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.home-space-banner-value { font-size: 17px; font-weight: 700; color: var(--text); }
.home-space-substats {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 18px;
}
.home-space-substats strong { color: var(--text); }
.home-space-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.home-space-status-dot.ok { background: #1a7a35; }
.home-space-status-dot.fail { background: var(--maroon); }
.home-space-countries { display: flex; flex-direction: column; gap: 10px; }
.home-space-substack { display: flex; flex-direction: column; gap: 20px; }
.home-space-country-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.home-space-country-name { width: 90px; flex-shrink: 0; color: var(--text); }
.home-space-country-track { flex: 1; height: 7px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.home-space-country-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--accent)); }
.home-space-country-count { width: 28px; text-align: right; color: var(--text-muted); font-weight: 600; }
@media (max-width: 700px) {
  .home-space-banner { grid-template-columns: repeat(2, 1fr); }
}

/* Top Valuation Multiples -- animated bar leaderboard, logo + raw multiple
   text living inside the gradient fill itself (see homeMaMultiplesHtml). */
.mchart { display: flex; flex-direction: column; gap: 18px; }
.mchart-row {
  opacity: 0;
  animation: mchartRowIn .5s ease forwards;
}
.mchart-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  margin-bottom: 7px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mchart-track {
  background: var(--bg-2);
  border-radius: 999px;
  height: 36px;
}
.mchart-fill {
  height: 100%;
  min-width: 130px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 6px 0 4px;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--accent) 0%, #c23a8a 45%, var(--blue) 100%);
  box-shadow: 0 3px 10px rgba(155, 29, 95, .28);
  transform: scaleX(0);
  transform-origin: left center;
  animation: mchartFillIn .7s cubic-bezier(.2, .9, .25, 1.1) forwards;
}
.mchart-fill .row-avatar-logo,
.mchart-fill .row-avatar {
  width: 26px; height: 26px; flex-shrink: 0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.mchart-value {
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  margin-left: auto;
  padding-right: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
@keyframes mchartRowIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes mchartFillIn {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}


/* ══════════════════════════════════
   COMPANIES TABLE
══════════════════════════════════ */
.view-header {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 16px;
}
.view-count {
  font-size: 13px;
  color: var(--text-muted);
}
.funds-search-wrap { margin-left: auto; }
.funds-search-wrap input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  width: 220px;
}
.funds-search-wrap input:focus { border-color: var(--accent); }
.funds-table thead th.sortable { cursor: pointer; user-select: none; }
.funds-table thead th.sortable:hover { color: var(--accent); }
.fund-fuzzy-tag {
  color: var(--text-dim);
  font-weight: 700;
  cursor: help;
}

.funds-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0 20px;
}
@media (max-width: 900px) { .funds-charts-row { grid-template-columns: 1fr; } }

.fund-recent-deal { display: flex; flex-direction: column; gap: 1px; }
.fund-recent-deal-company {
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.fund-recent-deal-date { font-size: 11px; color: var(--text-dim); }

.fund-logo {
  width: 26px; height: 26px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  display: inline-block;
}

.funds-row-clickable { cursor: pointer; }
.funds-row-clickable:hover { background: var(--bg-2); }

.funds-modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20, 10, 20, .45);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 20px;
}
.funds-modal-backdrop.open { display: flex; }
.funds-modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: min(1100px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.funds-modal-close {
  position: absolute; top: 14px; right: 14px;
  border: none; background: var(--bg-2); border-radius: 999px;
  width: 28px; height: 28px; font-size: 16px; line-height: 1;
  color: var(--text-muted); cursor: pointer;
}
.funds-modal-close:hover { color: var(--text); }
.funds-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; padding-right: 30px; }
.funds-modal-name { font-size: 17px; font-weight: 700; color: var(--text); }
.funds-modal-meta-line { font-size: 12px; color: var(--text-muted); }
.funds-modal-source-link { font-size: 12px; color: var(--accent); }
.funds-modal-section { margin-top: 20px; }
.funds-modal-section h4 { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 10px; }
.funds-modal-companies-list {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px) { .funds-modal-companies-list { grid-template-columns: 1fr; } }
.funds-modal-company-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.funds-modal-company-row:nth-child(odd) { border-right: 1px solid var(--border); }
.funds-modal-company-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.funds-modal-company-status {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--text-dim); letter-spacing: .03em;
}
.funds-modal-company-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.funds-modal-tag {
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 2px 8px;
}
.funds-modal-company-desc {
  font-size: 12px; line-height: 1.5; color: var(--text-muted);
  margin: 6px 0 0;
}
.funds-modal-deals-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.funds-modal-deals-table th {
  text-align: left; font-weight: 600; color: var(--text-dim);
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  padding: 6px 8px; border-bottom: 1px solid var(--border);
}
.funds-modal-deals-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); color: var(--text); }
.funds-modal-deals-table tr:last-child td { border-bottom: none; }
.view-growth {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.view-growth.positive { color: #1a7a35; }
.view-growth.negative { color: var(--maroon); }

.reset-filters-btn {
  margin-left: auto;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.reset-filters-btn:hover { background: var(--bg-hover); color: var(--text); }

.columns-wrap { position: relative; }
.columns-btn {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.columns-btn:hover { background: var(--bg-hover); color: var(--text); }
.columns-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 6px;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
}
.columns-panel.open { display: flex; flex-direction: column; }
.columns-panel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.columns-panel-item:hover { background: var(--bg-hover); }

.save-list-btn, .pagination-open-btn {
  background-color: var(--maroon);
  background-image: url('/static/img/noise.webp');
  background-repeat: repeat;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.save-list-btn:hover, .pagination-open-btn:hover { opacity: .85; }
.pagination-open-btn { padding: 4px 10px; font-size: 12px; }

.delete-list-btn {
  background: var(--surface);
  color: var(--maroon);
  border: 1px solid var(--maroon);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.delete-list-btn:hover { background: var(--accent-dim); }

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  /* vertical scrolling happens on .content now; this only needs its own
     horizontal scroll so a wide table never drags the rest of the page sideways */
  max-width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.data-table thead th {
  position: sticky; top: 0; z-index: 2;
  height: 33px; /* fixed so the filter row below can sit at a known top offset */
  background: var(--bg-2);
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.data-table thead th.sortable:hover { color: var(--accent); }
.sort-arrow { color: var(--accent); }
.data-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.data-table tbody tr:hover { background: var(--accent-dim); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table .company-name { font-weight: 600; }

.col-logo   { width: 40px; }
.col-name   { width: 140px; }
.col-desc   { width: 220px; }
.col-web    { width: 110px; }
.col-inv    { width: 130px; }
.col-sector { width: 110px; }
.col-stage  { width: 90px; }
.col-year   { width: 90px; }
.col-fin    { width: 100px; }
.col-raised { width: 100px; }
.col-tracked{ width: 130px; }
.col-status { width: 100px; }

/* column filter row -- selector needs two classes (.data-table .filter-row th) to
   out-specificity ".data-table thead th" above; otherwise that rule's top:0 wins
   and both rows stick to the same offset instead of stacking */
.data-table .filter-row th {
  position: sticky; top: 33px; z-index: 2;
  background: var(--surface);
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}
.filter-cell {
  display: flex; flex-direction: row; align-items: center; gap: 3px;
}
.filter-cell select {
  flex-shrink: 0;
  width: 22px;
  font-size: 9px;
  padding: 2px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: inherit;
  outline: none;
  background: var(--surface);
  /* collapsed to a small dropdown -- only the arrow is visible until opened,
     the text option labels still read fine in the native dropdown popup */
  text-indent: -9999px;
}
.filter-cell input {
  width: 100%;
  min-width: 0;
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.filter-cell input:focus, .filter-cell select:focus { border-color: var(--accent); }
.filter-cell input:disabled { background: var(--bg-2); color: var(--text-dim); }

.logo-cell { text-align: center; }
.company-logo {
  width: 26px; height: 26px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: inline-block;
}
.company-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  line-height: 26px;
}

/* Colored-initial avatar for tables with no real logo field (Precedent
   Transactions -- there's no logo_url in the source data to back a real one). */
.row-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.row-avatar-logo {
  width: 26px; height: 26px;
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  padding: 3px;
  flex-shrink: 0;
}
.acquirer-cell {
  display: inline-flex; align-items: center; gap: 6px;
}
.acquirer-cell .row-avatar-logo, .acquirer-cell .row-avatar {
  width: 18px; height: 18px; border-radius: 5px; font-size: 9px; padding: 2px;
}

/* Sector pills -- pastel background + matching colored text, same palette
   pairing used for the Home page's In-Depth Research/Ask Jelly pills. */
.sector-pill {
  display: inline-block;
  vertical-align: top;
  max-width: 100px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  margin: 1px 3px 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Title block + stat cards row, above the filter/table controls */
.view-title-block { margin-bottom: 4px; }
#recentListCard { margin-top: 18px; max-width: 480px; }
.view-title-block h1 { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.view-subtitle { font-size: 13px; color: var(--text-muted); max-width: 720px; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 20px;
}
.stat-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url('/static/img/grain.svg');
  background-repeat: repeat;
  opacity: .08;
  pointer-events: none;
}
.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.stat-card-icon svg { width: 20px; height: 20px; }
.stat-card-body { position: relative; z-index: 1; min-width: 0; }
.stat-card-value { font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-card-label { font-size: 11px; color: var(--text-muted); }
.stat-card-pct {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.stat-card-pct.positive { color: #1a7a35; }
.stat-card-pct.negative { color: var(--maroon); }
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* description: truncated, expands on hover without shifting layout */
.cell-desc {
  position: relative;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cell-desc:hover {
  overflow: visible;
  -webkit-line-clamp: unset;
  max-height: none;
  z-index: 3;
}
.cell-desc:hover .desc-inner {
  position: absolute;
  left: 0; top: -4px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  width: 280px;
  white-space: normal;
}

/* pagination */
.pagination {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.pagination button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.pagination button:hover:not(:disabled) { background: var(--bg-hover); }

.page-info { color: var(--text-muted); margin-right: 4px; }
.page-numbers { display: flex; align-items: center; gap: 4px; }
.page-number {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 28px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.page-number:hover:not(.active) { background: var(--bg-hover); }
.page-number.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.page-ellipsis { padding: 0 4px; color: var(--text-muted); }

/* ══════════════════════════════════
   TRENDING RESEARCH, FRONT PAGE
   (masthead + editorial grid, NYT/WSJ front-page treatment)
══════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,600&display=swap');

.front-page-wrap { width: 100%; }

.fp-masthead {
  text-align: center;
  padding: 6px 0 16px;
}
.fp-nameplate {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 34px;
  line-height: 1;
  color: var(--navy);
  letter-spacing: -.3px;
}
.fp-dateline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: .3px;
}
.fp-rule {
  border: none;
  border-top: 3px double var(--navy);
  margin: 4px 0 26px;
}

/* Daily market blurb, synthesized by Claude from that day's news_posts --
   sits between the dateline and the rule, styled as a lede paragraph rather
   than another card so it reads like the front page's own opening line. */
.fp-market-summary {
  max-width: 62em;
  margin: 14px auto 0;
  font-family: Georgia, 'Playfair Display', serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  text-align: center;
}
.fp-market-summary a { color: var(--maroon); }

/* Single flowing column always: hero, then the wrapping brief grid. No
   separate photo rail -- that column reliably ran dry before the main
   column did, leaving a tall dead gap next to it. Photos still show via
   fp-brief-thumb on whichever brief cards have one. */
.front-page {
  display: block;
}

/* -- Dashboard page layout: main story column + a NYT-home-page-style rail on
   the right (Tech Benchmarks, condensed -- no charts, just headline density) -- */
.dash-columns {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 36px;
  align-items: start;
}
@media (max-width: 1200px) {
  .dash-columns { grid-template-columns: 1fr; }
}
/* Same idea for the right rail: if Tech Benchmarks AND the news spillover are
   both empty, don't leave a dead 400px column -- let the main column take
   the full page width. */
.dash-columns.dash-columns--no-sidebar { grid-template-columns: 1fr; }
.dash-columns--no-sidebar .dash-sidebar { display: none; }

.dash-sidebar {
  border-left: 1px solid var(--border);
  padding-left: 28px;
}
.dash-sidebar-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--maroon);
  border-bottom: 3px solid var(--navy);
  padding-bottom: 8px;
  margin-bottom: 2px;
}
.dash-sidebar-head--news {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 2px solid var(--border);
}

/* Flat, divider-separated list rows -- deliberately unlike the boxed,
   colored-border Tech Benchmarks cards above, so the two sections never
   read as one continuous thing. */
.dash-sidebar-news-item {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.dash-sidebar-news-item:first-child { padding-top: 14px; }
.dash-sidebar-news-item:last-child { border-bottom: none; }
.dash-sidebar-news-item:hover .dash-sidebar-news-headline { text-decoration: underline; }
.dash-sidebar-news-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 4px;
}
.dash-sidebar-news-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--navy);
  line-height: 1.3;
}
.dash-sidebar-news-dek {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}
.dash-sidebar-news-meta {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 5px;
}
.dash-sidebar-item {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--item-color, var(--maroon));
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin-top: 16px;
  transition: transform .15s, box-shadow .15s;
}
.dash-sidebar-item:first-child { margin-top: 14px; }
.dash-sidebar-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dash-sidebar-row { display: flex; gap: 12px; align-items: flex-start; }
.dash-sidebar-row .org-logo, .dash-sidebar-row .org-logo-placeholder { width: 34px; height: 34px; border-radius: 8px; font-size: 15px; }
.dash-sidebar-body { min-width: 0; flex: 1; }
.dash-sidebar-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dash-sidebar-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 16.5px;
  color: var(--navy);
  line-height: 1.35;
  display: block;
}
.dash-sidebar-headline:hover { text-decoration: underline; }
.dash-sidebar-stat {
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}
.dash-sidebar-source {
  font-size: 10.5px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 2px;
}
.dash-mini-bars { margin-top: 10px; }
.dash-mini-bar-row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.dash-mini-bar-row:last-child { margin-bottom: 0; }
.dash-mini-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  width: 92px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-mini-bar-track { flex: 1; height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.dash-mini-bar-fill { height: 100%; border-radius: 3px; }

/* -- ticker (OpenRouter): signed values, up/down arrows instead of bars -- */
.dash-ticker { margin-top: 10px; }
.dash-ticker-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  padding: 3px 0;
}
.dash-ticker-arrow { font-size: 9px; flex-shrink: 0; }
.dash-ticker-label {
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-ticker-val { font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* -- share donut (InferenceX): leader vs runner-up, a genuine 2-slice share -- */
.dash-share-donut { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.dash-share-legend { font-size: 10.5px; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.dash-share-legend div { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-share-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

.dash-sidebar-more {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--maroon);
  margin-top: 16px;
  text-align: right;
}

.fp-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 6px;
}
.fp-source-desc {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 12px;
  max-width: 40em;
}
.fp-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  color: var(--navy);
  line-height: 1.12;
}
.fp-headline a { color: inherit; }
.fp-headline a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }
.fp-dek {
  font-family: Georgia, 'Playfair Display', serif;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.45;
}
.fp-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--maroon);
  font-weight: 700;
}
.fp-stat .fp-stat-num { font-size: 15px; }

/* Hero: the lead story, text beside a real (or gradient-fallback) photo,
   plus a second smaller "live" item stacked below the headline in the SAME
   left column, sharing that one photo. */
.fp-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}
@media (max-width: 700px) {
  .fp-hero { grid-template-columns: 1fr; }
}
.fp-hero-text { display: flex; flex-direction: column; }
.fp-hero .fp-headline { font-size: 34px; }
.fp-hero .fp-dek { font-size: 16px; max-width: 46em; }
.fp-hero-live {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.fp-hero-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  background-color: var(--navy);
  background-size: cover;
  background-position: center;
}

.fp-divider { border-top: 1px solid var(--border); margin: 26px 0; }

/* Repeating row-block: 1-2 stacked headline items on the left, one photo on
   the right. Each block only pairs a photo with its own 1-2 headlines (never
   a whole page's worth of text), so any height mismatch stays small and
   local instead of the old page-length side-rail leaving a giant dead gap. */
.fp-row-block {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
  align-items: start;
}
/* Alternates block to block (see BI%2 in app.js) so photos don't always sit
   on the same side -- reads as an actual varied layout, not a repeated template. */
.fp-row-block--reverse { grid-template-columns: 200px 1fr; }
.fp-row-block--reverse .fp-row-photo { order: -1; }
@media (max-width: 700px) {
  .fp-row-block, .fp-row-block--reverse { grid-template-columns: 1fr; }
  .fp-row-block--reverse .fp-row-photo { order: 0; }
}
.fp-row-text { display: flex; flex-direction: column; }
.fp-row-item { display: block; color: inherit; text-decoration: none; }
.fp-row-item:hover .fp-headline { text-decoration: underline; }
.fp-row-item + .fp-row-item { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.fp-row-item .fp-headline { font-size: 18px; }
.fp-row-item .fp-dek { font-size: 12.5px; margin-top: 6px; }

.fp-row-photo { display: block; color: inherit; text-decoration: none; }
.fp-row-photo:hover .fp-photo-caption { text-decoration: underline; }
.fp-row-photo-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background-color: var(--navy);
  background-size: cover;
  background-position: center;
}
.fp-photo-caption {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.4;
}

/* Footer strip for whatever's left over -- the reference's
   "THE LATEST POLLS: Michigan Senate • Minnesota Governor • ..." row. */
.fp-latest-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  border-top: 2px solid var(--navy);
  padding-top: 9px;
  margin-bottom: 12px;
}
.fp-latest-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.fp-latest-links a { font-size: 12.5px; font-weight: 600; color: var(--navy); text-decoration: none; }
.fp-latest-links a:hover { text-decoration: underline; }

.fp-empty {
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
}
.pagination button:disabled { opacity: .4; cursor: default; }

/* ══════════════════════════════════
   NEWS -- built to match the NYT front page reference exactly: an asymmetric
   lead block (headline-only main story + a "live"-style secondary item,
   stacked text-only on the left; one tall photo on the right), a compact
   audio-style brief row, a 3-column trio (two stacked text columns flanking
   a single center photo), then a footer "The Latest" link strip. Deliberately
   NOT a uniform tile grid -- every section has a different shape and text/
   image ratio, same as the reference screenshot.
══════════════════════════════════ */
.news-tile-kicker {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 5px;
}
.news-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.news-divider { border-top: 1px solid var(--border); margin: 26px 0; }

/* Lead: text-only main headline + a secondary "live" item stacked below it,
   both on the left; one tall photo fills the right column. */
.news-lead {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 36px;
  margin-top: 24px;
}
@media (max-width: 900px) { .news-lead { grid-template-columns: 1fr; } }

.news-lead-left { display: flex; flex-direction: column; }
.news-lead-main, .news-lead-live { display: block; color: inherit; text-decoration: none; }
.news-lead-main:hover .news-lead-headline,
.news-lead-live:hover .news-lead-live-headline { text-decoration: underline; }
.news-lead-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.2;
  color: var(--navy);
}
.news-lead-dek {
  font-family: Georgia, 'Playfair Display', serif;
  font-style: italic;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
}
.news-lead-live {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.news-kicker-live {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 5px;
}
.news-lead-live-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
  line-height: 1.3;
}
.news-more-link {
  display: inline-block;
  margin-top: 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--maroon);
}

.news-lead-photo { display: block; color: inherit; text-decoration: none; }
.news-lead-photo:hover .news-photo-caption { text-decoration: underline; }
.news-lead-photo-img {
  aspect-ratio: 4 / 5;
  background-color: var(--navy);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
}
.news-photo-caption {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Compact audio-style brief: small square thumb + kicker + headline, full width. */
.news-audio-row {
  display: flex;
  gap: 16px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.news-audio-row:hover .news-audio-headline { text-decoration: underline; }
.news-audio-thumb {
  width: 64px; height: 64px; flex: 0 0 64px;
  background-color: var(--navy);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
}
.news-audio-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--navy);
  line-height: 1.3;
  margin-top: 3px;
}

/* Trio: two stacked text columns flanking one center photo -- the reference's
   "polls" row (autopsy / map / Michigan race). */
.news-trio {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 30px;
}
@media (max-width: 900px) { .news-trio { grid-template-columns: 1fr; } }
.news-trio-col { display: flex; flex-direction: column; }
.news-trio-item { display: block; color: inherit; text-decoration: none; }
.news-trio-item:hover .news-trio-headline { text-decoration: underline; }
.news-trio-item + .news-trio-item { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.news-trio-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--navy);
  line-height: 1.3;
}
.news-trio-dek {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}
.news-trio-center { display: block; color: inherit; text-decoration: none; }
.news-trio-center:hover .news-photo-caption { text-decoration: underline; }
.news-trio-img {
  aspect-ratio: 1 / 1;
  background-color: var(--navy);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
}

/* Footer strip: everything else, as a dense wrapped list of plain links. */
.news-latest-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 2px solid var(--navy);
  padding-top: 9px;
  margin-bottom: 12px;
}
.news-latest-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.news-latest-links a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.news-latest-links a:hover { text-decoration: underline; }

/* ══════════════════════════════════
   TECH BENCHMARKS, full dark "instrument panel" theme, deliberately distinct
   from the rest of the (light, editorial) site. Three categories, each a
   dark-mode-validated glow color:
     LLMs #3d84d6 · Robotics #d6417d · Chips #c77620
   (validated as a categorical set via scripts/validate_palette.js --mode dark)
══════════════════════════════════ */
.bench-dark-theme {
  --bd-bg: #0a0e1a;
  --bd-bg-2: #10162a;
  --bd-panel: #131b32;
  --bd-border: rgba(255,255,255,.09);
  --bd-border-soft: rgba(255,255,255,.05);
  --bd-text: #eef1f8;
  --bd-text-muted: #a7b0c8;
  --bd-text-dim: #6b7592;

  background-color: var(--bd-bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(61,132,214,.14), transparent 60%),
    radial-gradient(ellipse 900px 500px at 90% 10%, rgba(214,65,125,.10), transparent 60%),
    url('/static/img/noise.webp');
  background-repeat: no-repeat, no-repeat, repeat;
  margin: -28px -32px;
  padding: 28px 32px 48px;
  min-height: calc(100vh - var(--header-h));
  color: var(--bd-text);
}
.bench-dark-theme .view-count { color: var(--bd-text-dim); }
.bench-dark-theme h1 { color: var(--bd-text); }

.bench-page-head { margin-bottom: 8px; }

/* -- quick-counts + gauge widget row -- */
.bench-widget-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.4fr;
  gap: 16px;
  margin-bottom: 36px;
  align-items: stretch;
}
@media (max-width: 1200px) {
  .bench-widget-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .bench-widget-row { grid-template-columns: 1fr; }
}

.widget-card {
  background: linear-gradient(160deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), var(--bd-panel);
  border: 1px solid var(--bd-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.03);
  padding: 14px 16px;
}

.stat-tile { display: flex; flex-direction: column; justify-content: space-between; }
.stat-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.stat-tile-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--bd-text-dim);
}
.stat-tile-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-color);
  box-shadow: 0 0 8px 1px var(--cat-color);
  flex-shrink: 0;
}
.stat-tile-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--bd-text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-tile-sub {
  font-size: 11px;
  color: var(--cat-color);
  font-weight: 700;
  margin-top: 4px;
  text-shadow: 0 0 12px color-mix(in srgb, var(--cat-color) 55%, transparent);
}
.stat-tile-source {
  font-size: 10px;
  color: var(--bd-text-dim);
  margin-top: 2px;
}
.stat-tile-body { display: flex; gap: 10px; align-items: flex-start; }

/* -- real org logos (Clearbit), falling back to a colored monogram if unmapped
   or the image 404s -- so widgets read as branded data, not placeholder text -- */
.org-logo, .org-logo-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  object-fit: contain;
}
.org-logo { background: #fff; padding: 3px; }
.org-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  font-family: 'Playfair Display', Georgia, serif;
}
.bench-row .org-logo, .bench-row .org-logo-placeholder { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }

.investor-logo, .investor-logo-placeholder {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: contain;
}
.investor-logo { background: #fff; border: 1px solid var(--border); padding: 2px; }
.investor-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}

/* -- radial gauges: one bounded stat per ring, never a share-of-100 pie -- */
.gauge-widget {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
}
.gauge { display: flex; flex-direction: column; align-items: center; text-align: center; }
.gauge svg { overflow: visible; }
.gauge-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 17px;
  fill: var(--bd-text);
}
.gauge-sublabel {
  font-size: 8px;
  fill: var(--bd-text-dim);
  font-family: Roboto, sans-serif;
}
.gauge-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--bd-text-muted);
  margin-top: 6px;
  max-width: 110px;
}
.gauge-ring-bg { stroke: rgba(255,255,255,.08) !important; }
.gauge-ring-fill { filter: drop-shadow(0 0 6px currentColor); }

/* -- single no-scroll asymmetric grid: one large hero rectangle, a tall side
   rectangle, two small brief rectangles underneath -- mirrors the Dashboard
   tab's hero/side/brief layout and the PitchBook reference's mixed-size grid. -- */
.bench-front {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 54px;
  grid-auto-flow: dense;
  gap: 20px;
}
@media (max-width: 1100px) {
  .bench-front { grid-template-columns: repeat(2, 1fr); }
}
/* size recipe (8 boards: 2 lg, 2 md, 4 sm) -- see BENCH_ORDER in app.js for
   which source lands in which slot; deliberately not uniform, same idea as
   the News mosaic. */
.bench-board--lg { grid-column: span 4; grid-row: span 7; }
.bench-board--md { grid-column: span 3; grid-row: span 5; display: flex; flex-direction: column; }
.bench-board--md .bench-rows { flex: 1; overflow-y: auto; }
.bench-board--sm { grid-column: span 3; grid-row: span 4; }
@media (max-width: 1100px) {
  .bench-board--lg, .bench-board--md, .bench-board--sm { grid-column: span 2; }
}

.bench-single-body { padding: 14px 20px 18px; }
.bench-single-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--bd-text);
  line-height: 1.25;
  display: block;
}
.bench-single-headline:hover { text-decoration: underline; }
.bench-single-dek {
  font-size: 11.5px;
  color: var(--bd-text-muted);
  margin-top: 8px;
  line-height: 1.4;
}
.bench-single-stat {
  font-size: 13px;
  font-weight: 800;
  margin-top: 12px;
}

/* Main (charts) + right-hand Research rail, dark-theme equivalent of the
   Dashboard tab's dash-columns/dash-sidebar split. */
.bench-columns {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 1200px) {
  .bench-columns { grid-template-columns: 1fr; }
}
.bench-sidebar {
  border-left: 1px solid var(--bd-border);
  padding-left: 22px;
}
.bench-sidebar-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bd-text-dim);
  border-bottom: 2px solid var(--bd-border);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.bench-sidebar-item {
  background: linear-gradient(160deg, rgba(255,255,255,.03), rgba(255,255,255,.005)), var(--bd-panel);
  border: 1px solid var(--bd-border);
  border-left: 2px solid var(--item-color, var(--cat-color));
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.bench-sidebar-item:last-child { margin-bottom: 0; }
.bench-sidebar-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.bench-sidebar-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--bd-text);
  line-height: 1.3;
  display: block;
}
.bench-sidebar-headline:hover { text-decoration: underline; }
.bench-sidebar-stat { font-size: 11.5px; font-weight: 700; margin-top: 6px; }
.bench-sidebar-source { font-size: 10.5px; color: var(--bd-text-dim); font-style: italic; margin-top: 4px; }

.bench-board {
  background: linear-gradient(160deg, rgba(255,255,255,.03), rgba(255,255,255,.005)), var(--bd-panel);
  border: 1px solid var(--bd-border);
  border-left: 2px solid var(--cat-color);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px -16px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.03);
  overflow: hidden;
}

.bench-header { padding: 16px 20px 13px; border-bottom: 1px solid var(--bd-border-soft); }
.bench-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 17px;
  color: var(--bd-text);
  line-height: 1.15;
}
.bench-header .bench-desc { font-size: 11px; color: var(--bd-text-muted); margin-top: 6px; line-height: 1.4; }
.bench-header .bench-date {
  font-size: 10px;
  color: var(--bd-text-dim);
  margin-top: 6px;
  letter-spacing: .3px;
  text-transform: uppercase;
  font-weight: 600;
}

.bench-rows.compact .bench-row { padding: 7px 18px; }
.bench-rows.compact .bench-row-sub { display: none; }

/* -- hand-built inline-SVG charts: gradient-filled, glowing bars on a dark,
   speckled panel. Every chart gets the glow now, not just one category. -- */
.mini-chart {
  padding: 18px 24px 6px;
  background-color: rgba(255,255,255,.015);
  background-image: url('/static/img/noise.webp');
  background-repeat: repeat;
  background-blend-mode: overlay;
  border-bottom: 1px solid var(--bd-border-soft);
}
.mini-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.mini-chart .chart-baseline { stroke: rgba(255,255,255,.18); stroke-width: 1.5; }
.mini-chart .chart-axis-label { font-size: 10px; font-weight: 600; fill: var(--bd-text-muted); font-family: Roboto, sans-serif; }
.mini-chart .chart-value-label {
  font-size: 11px;
  font-weight: 800;
  font-family: Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
/* marks a diverging bar that's been clipped to the scale cap -- the label still
   shows the real, uncapped number */
.mini-chart .chart-clip-marker { font-size: 11px; font-weight: 900; font-family: Roboto, sans-serif; }
.mini-chart .bar-fill {
  cursor: pointer;
  transition: opacity .15s, filter .15s;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--cat-color) 65%, transparent));
}
.mini-chart .bar-fill:hover { opacity: .8; filter: drop-shadow(0 0 12px var(--cat-color)); }

/* Chips (InferenceX) -- extra-deep panel + stronger glow, echoing InferenceX's
   own dark chart tool; still the same dark theme as its siblings, just turned up. */
.mini-chart--dark {
  background-color: rgba(0,0,0,.25);
  background-image: url('/static/img/noise.webp'), radial-gradient(ellipse at 30% 20%, rgba(199,118,32,.16), transparent 60%);
  background-blend-mode: overlay, normal;
}
.mini-chart--dark .chart-axis-label--dark { fill: rgba(255,255,255,.75); }

/* -- table half -- */
.bench-rows { list-style: none; }
.bench-row { display: flex; align-items: center; gap: 12px; padding: 9px 20px; border-bottom: 1px solid var(--bd-border-soft); }
.bench-row:last-child { border-bottom: none; }
.bench-row:nth-child(even) { background: rgba(255,255,255,.02); }
.bench-row:hover { background: rgba(255,255,255,.045); }

.bench-rank {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--bd-text);
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bench-row:nth-child(1) .bench-rank { background: #d4af37; color: #10162a; box-shadow: 0 0 10px -1px #d4af37; }
.bench-row:nth-child(2) .bench-rank { background: #c3cad9; color: #10162a; box-shadow: 0 0 10px -1px #c3cad9; }
.bench-row:nth-child(3) .bench-rank { background: #d99a5b; color: #10162a; box-shadow: 0 0 10px -1px #d99a5b; }

.bench-row-body { min-width: 0; flex: 1; }
.bench-row-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--bd-text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bench-row-title:hover { text-decoration: underline; }
.bench-row-sub {
  font-size: 10px;
  color: var(--bd-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bench-row-stat { flex-shrink: 0; text-align: right; padding-left: 6px; }
.bench-row-stat-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--cat-color);
  font-variant-numeric: tabular-nums;
  display: block;
  text-shadow: 0 0 10px color-mix(in srgb, var(--cat-color) 40%, transparent);
}
.bench-row-stat-label { font-size: 8px; color: var(--bd-text-dim); text-transform: uppercase; letter-spacing: .4px; }

.bench-empty { padding: 18px 20px; font-size: 12px; color: var(--bd-text-dim); font-style: italic; }

/* ══════════════════════════════════
   SIGNALS -- ticker + sector-clustered network graph
   ══════════════════════════════════ */
.signals-ticker-wrap {
  margin: 18px 0 20px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.signals-ticker-track {
  display: flex;
  width: max-content;
  /* JS (buildSignalsDOM) overrides this with a duration computed from actual
     content width, so scroll SPEED stays constant as more partners get added
     later -- this is just a safe default before that runs. */
  animation: signalsMarquee 100s linear infinite;
}
.signals-ticker-track:hover { animation-play-state: paused; }
.signals-ticker-row { display: flex; align-items: stretch; }
@keyframes signalsMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.signals-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border: none; border-right: 1px solid var(--border);
  background: transparent;
  font: inherit; text-align: left; cursor: pointer;
  width: 340px; flex-shrink: 0;
}
.signals-chip:hover { background: var(--bg-2); }
.signals-chip-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.signals-chip-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signals-chip-fund { font-weight: 500; color: var(--text-muted); }
.signals-chip-snippet {
  font-size: 11px; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Real partner photos (unavatar.io, keyed off Twitter handle) -- always
   circular, unlike the rounded-square .row-avatar used for companies/funds,
   since these are faces. .row-avatar picks up the same size classes as a
   fallback (see partnerAvatarHtml), so both look identical when a photo
   isn't available. */
.partner-avatar { object-fit: cover; background: var(--bg-2); flex-shrink: 0; }
.signals-chip-avatar { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; }
.signals-modal-avatar { width: 44px; height: 44px; border-radius: 50%; font-size: 15px; }

/* Graph card: dark "signal in space" canvas -- deliberately breaks from the
   light .home-card look used everywhere else in the app, since a flat white
   SVG chart is exactly the "corporate" look this was asked to move away from. */
.signals-graph-card {
  margin-bottom: 20px;
  background: radial-gradient(ellipse at 50% 35%, #241a3d 0%, #140f24 65%, #0e0a1c 100%);
  border-color: #2c2246;
}
.signals-graph-card::before { display: none; }
.signals-graph-card .home-section-head h3 { color: #f2eefc; }
.signals-graph-card .home-section-note { color: #9d92c2; }
.signals-graph-svg { display: block; height: auto; }
.signals-spoke { stroke-width: 1; stroke-opacity: .3; }
.signals-label { paint-order: stroke; stroke: #0e0a1c; stroke-width: 3px; }
.signals-node-group { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .18s ease; }
.signals-node-group:hover { transform: scale(1.14); }
.signals-node-ring { stroke-width: 2.5; transition: stroke-width .18s ease; }
.signals-node-group:hover .signals-node-ring { stroke-width: 3.5; }

.signals-modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20, 10, 20, .45);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 20px;
}
.signals-modal-backdrop.open { display: flex; }
.signals-modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.signals-modal-close {
  position: absolute; top: 14px; right: 14px;
  border: none; background: var(--bg-2); border-radius: 999px;
  width: 28px; height: 28px; font-size: 16px; line-height: 1;
  color: var(--text-muted); cursor: pointer;
}
.signals-modal-close:hover { color: var(--text); }
.signals-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-right: 30px; }
.signals-modal-avatar { width: 40px; height: 40px; border-radius: 10px; font-size: 13px; }
.signals-modal-name { font-size: 15px; font-weight: 700; color: var(--text); }
.signals-modal-fund { font-size: 12px; color: var(--text-muted); }
.signals-modal-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.signals-modal-pulse { font-size: 13px; line-height: 1.6; color: var(--text); margin-bottom: 14px; white-space: pre-wrap; }
.signals-modal-links { font-size: 12px; margin-bottom: 8px; }
.signals-modal-checked { font-size: 11px; color: var(--text-dim); }

@media (max-width: 900px) {
  .signals-chip { width: 260px; }
}

/* Companies | Programs toggle under a view title (Accelerators tab) */
.view-toggle { display: inline-flex; gap: 4px; margin-top: 10px; padding: 3px; border: 1px solid var(--border, #e2e2e8); border-radius: 999px; }
.view-toggle-btn { border: 0; background: transparent; padding: 5px 14px; border-radius: 999px; font: inherit; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.view-toggle-btn.active { background: var(--maroon); color: #fff; }

/* Account menu (opened from the profile chip; attached to <body> because the topbar clips overflow) */
.profile-menu {
  position: fixed; z-index: 1000; min-width: 250px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.profile-menu[hidden] { display: none; }
.profile-menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px;
  border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.profile-menu-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex;
  align-items: center; justify-content: center; background: var(--accent-dim); color: var(--maroon);
  font-weight: 600; font-size: 14px; }
.profile-menu-name { font-weight: 600; font-size: 14px; color: var(--text); }
.profile-menu-email { font-size: 12.5px; color: var(--text-muted); word-break: break-all; }
.profile-menu-item { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0;
  background: none; border-radius: var(--radius-sm); font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.profile-menu-item:hover { background: var(--bg-hover); }


/* ══════════════════════════════════
   HELP GUIDE (pop-up opened from the ? button)
══════════════════════════════════ */
.help-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(20, 10, 20, .45);
  align-items: center; justify-content: center;
  padding: 20px;
}
.help-backdrop.open { display: flex; }
.help-modal {
  position: relative;
  display: grid; grid-template-columns: 236px 1fr;
  width: min(940px, 94vw); height: min(660px, 86vh);
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.help-modal:focus { outline: none; }
.help-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 28px; height: 28px; border: none; border-radius: 999px;
  background: var(--bg-2); color: var(--text-muted);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.help-close:hover { color: var(--text); }
.help-rail {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg); border-right: 1px solid var(--border);
}
.help-rail-head {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 14px;
  font-size: 15px; font-weight: 700; color: var(--navy);
}
.help-rail-mark {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--maroon); color: #fff; font-size: 14px; font-weight: 700;
}
.help-rail-list { overflow-y: auto; padding: 0 10px 16px; }
.help-rail-group {
  padding: 14px 10px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim);
}
.help-topic {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; margin-bottom: 2px;
  border: none; border-radius: var(--radius-sm); background: none;
  font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer;
}
.help-topic:hover { background: var(--bg-hover); }
.help-topic.active { background: var(--accent-dim); color: var(--maroon); font-weight: 600; }
.help-body { overflow-y: auto; padding: 26px 34px 30px; min-width: 0; }
.help-body h2 {
  margin: 0 30px 12px 0;
  font-size: 22px; font-weight: 700; color: var(--navy);
}
.help-content { font-size: 14px; line-height: 1.6; color: var(--text); }
.help-content p { margin: 0 0 12px; }
.help-content h3 { margin: 20px 0 6px; font-size: 13px; font-weight: 700; color: var(--maroon); }
.help-content ul, .help-content ol { margin: 0 0 12px; padding-left: 20px; }
.help-content li { margin-bottom: 6px; }
.help-content kbd {
  padding: 1px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px;
  border-radius: 5px; background: var(--bg); font: inherit; font-size: 12px;
}
.help-tip {
  margin-top: 16px; padding: 11px 14px;
  background: var(--accent-dim); border-left: 3px solid var(--maroon);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--navy);
}
@media (max-width: 720px) {
  .help-modal { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .help-rail { border-right: 0; border-bottom: 1px solid var(--border); }
  .help-rail-head { padding: 14px 16px 6px; }
  .help-rail-list { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 0 12px 12px; }
  .help-rail-group { display: none; }
  .help-topic { width: auto; white-space: nowrap; margin: 0; }
  .help-body { padding: 18px 18px 24px; }
}

/* ── Help guide: pictures, enlarge view, welcome tour ── */
.help-fig { margin: 4px 0 16px; }
.help-fig-btn {
  position: relative; display: block; width: 100%; padding: 0; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-2); min-height: 120px;
  box-shadow: var(--shadow-sm);
}
.help-fig-btn img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .25s; }
.help-fig-btn img.loaded { opacity: 1; }
.help-fig-btn:not(:has(img.loaded))::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-hover) 50%, var(--bg-2) 100%);
  background-size: 200% 100%; animation: help-shimmer 1.2s linear infinite;
}
@keyframes help-shimmer { to { background-position: -200% 0; } }
.help-fig-zoom {
  position: absolute; right: 10px; bottom: 10px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(8, 31, 72, .82); color: #fff; font-size: 11.5px; font-weight: 500;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.help-fig-btn:hover .help-fig-zoom, .help-fig-btn:focus-visible .help-fig-zoom { opacity: 1; }
.help-fig figcaption { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.help-fig-missing { display: none; }
.help-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.help-legend { padding-left: 22px; }
.help-link {
  padding: 0; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--maroon);
  text-decoration: underline; text-underline-offset: 3px;
}
.help-lightbox {
  display: none; position: fixed; inset: 0; z-index: 500;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(8, 10, 24, .86); cursor: zoom-out;
}
.help-lightbox.open { display: flex; }
.help-lightbox img {
  max-width: 96vw; max-height: 92vh; border-radius: var(--radius-sm);
  background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.help-lightbox-close {
  position: absolute; top: 16px; right: 20px; width: 34px; height: 34px;
  border: none; border-radius: 999px; background: rgba(255, 255, 255, .15); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.help-lightbox-close:hover { background: rgba(255, 255, 255, .28); }

/* welcome tour */
.help-modal.help-tour {
  display: flex; flex-direction: column;
  width: min(900px, 94vw); height: auto; max-height: 92vh;
}
.tour-shot {
  display: block; width: 100%; height: min(400px, 44vh); padding: 0; cursor: zoom-in;
  border: none; border-bottom: 1px solid var(--border); background: var(--bg-2); overflow: hidden;
}
.tour-shot img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.tour-shot img.loaded { opacity: 1; }
.tour-text { padding: 20px 32px 6px; }
.tour-text h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: var(--navy); }
.tour-text p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text); min-height: 70px; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 32px 22px; }
.tour-skip, .tour-back {
  padding: 8px 12px; border: none; border-radius: var(--radius-sm); background: none;
  font: inherit; font-size: 13.5px; color: var(--text-muted); cursor: pointer;
}
.tour-skip:hover, .tour-back:hover { background: var(--bg-hover); color: var(--text); }
.tour-nav { display: flex; align-items: center; gap: 8px; }
.tour-next {
  padding: 9px 20px; border: none; border-radius: var(--radius-sm);
  background: var(--maroon); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tour-next:hover { filter: brightness(1.08); }
.tour-dots { display: flex; gap: 8px; }
.tour-dot { width: 9px; height: 9px; padding: 0; border: none; border-radius: 50%; background: var(--border-2); cursor: pointer; transition: transform .15s, background .15s; }
.tour-dot.active { background: var(--maroon); transform: scale(1.3); }
.help-modal.help-tour .help-close { z-index: 3; background: rgba(255, 255, 255, .9); }
@media (max-width: 720px) {
  .tour-text, .tour-foot { padding-left: 18px; padding-right: 18px; }
  .tour-skip { padding: 8px 4px; }
}

/* ── Settings page ── */
.settings-wrap { display: grid; gap: 16px; max-width: 760px; }
.settings-card { padding: 22px 26px; }
.settings-list { margin: 8px 0 0; display: grid; gap: 10px; }
.settings-list > div { display: flex; gap: 16px; }
.settings-list dt { width: 90px; color: var(--text-muted); font-size: 13.5px; }
.settings-list dd { margin: 0; font-size: 14px; font-weight: 500; color: var(--text); }
.settings-plan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; font-size: 15px; }
.settings-badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.settings-badge.ok { background: #e3f4ec; color: #1f6b4a; }
.settings-badge.warn { background: #fff1d6; color: #8a5a00; }
.settings-badge.bad { background: #fde8e8; color: #9b1c1c; }
.settings-btn {
  margin-top: 8px; padding: 10px 18px; border: none; border-radius: var(--radius-sm);
  background: var(--maroon); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.settings-btn:hover { filter: brightness(1.08); }
.settings-btn:disabled { opacity: .6; cursor: default; }
.settings-fine { margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }
.settings-warn { margin: 8px 0; padding: 9px 12px; border-radius: var(--radius-sm); background: #fff1d6; color: #6b4300; font-size: 13.5px; }


/* ══════════════════════════════════
   FOOTER BAR
══════════════════════════════════ */
.app-footer {
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 40;
  height: var(--footer-h);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg); border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
/* the footer line: speckled grey lettering in the Jelly display font */
.app-footer, .terms-foot { font-family: "Baloo 2", Roboto, sans-serif; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.app-footer span, .app-footer a, .terms-copy {
  background-image: url('/static/img/speckle-grey.png'); background-size: 48px 48px;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.app-footer a { text-decoration: underline; text-decoration-color: #8a8da0; text-underline-offset: 3px; }
.app-footer a:hover { text-decoration-color: var(--text); }
html[data-theme="dark"] .app-footer span, html[data-theme="dark"] .app-footer a, html[data-theme="dark"] .terms-copy {
  background-image: url('/static/img/speckle-grey-dark.png');
}
html[data-theme="dark"] .app-footer a { text-decoration-color: #aeb1c8; }

/* ══════════════════════════════════
   DARK THEME  (only applies when html[data-theme="dark"]; light is untouched)
══════════════════════════════════ */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f1d;  --bg-2: #171a30;  --bg-3: #1f2340;  --bg-hover: #1e2240;
  --border: #2a2e4e;  --border-2: #3a4066;
  --text: #e8e9f5;  --text-muted: #a6a9c6;  --text-dim: #7b7ea3;
  --surface: #151729;
  --maroon: #d0509a;  --accent-dim: #3b1c2f;
  --title-blue: #7aa2f5;
  --navy: #6b95ee;  --blue-dim: #16294f;
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .4);
}
html[data-theme="dark"] body { background-image: none; }
html[data-theme="dark"] .home-featured-arrow { background: var(--surface); color: var(--text); border-color: var(--border-2); }

/* ══════════════════════════════════
   TABLE DENSITY
══════════════════════════════════ */
html[data-density="compact"] .data-table tbody td { padding-top: 3px; padding-bottom: 3px; }
html[data-density="compact"] .data-table thead th { padding-top: 6px; padding-bottom: 6px; }

/* ══════════════════════════════════
   SETTINGS: preferences
══════════════════════════════════ */
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.settings-row:first-of-type { border-top: none; }
.settings-row-label b { display: block; font-size: 14px; color: var(--text); }
.settings-row-label span { font-size: 12.5px; color: var(--text-muted); }
.settings-saved { margin-left: 10px; font-size: 12.5px; font-weight: 600; color: #1f8a5b; opacity: 0; transition: opacity .2s; }
.settings-saved.show { opacity: 1; }
.seg { display: inline-flex; flex-shrink: 0; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg-btn {
  padding: 8px 16px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--text-muted);
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn:hover { background: var(--bg-hover); }
.seg-btn.on { background: var(--maroon); color: #fff; font-weight: 600; }
.settings-select {
  padding: 8px 10px; min-width: 190px; border: 1px solid var(--border-2); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px;
}
.settings-ghost {
  padding: 8px 14px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer;
}
.settings-ghost:hover { background: var(--bg-hover); }
.settings-link { color: var(--accent); font-weight: 600; cursor: pointer; }

/* ══════════════════════════════════
   TERMS OF USE
══════════════════════════════════ */
.terms-page { max-width: 1060px; margin: 0 auto; }
.terms-standalone .terms-page { padding: 0 20px 56px; }
.terms-hero {
  position: relative; overflow: hidden; color: #fff;
  background-color: var(--brand); background-image: url('/static/img/noise.webp'); background-repeat: repeat;
  border-radius: var(--radius); padding: 34px 40px 30px; margin-bottom: 22px;
}
.terms-standalone .terms-hero { border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 26px; }
.terms-hero::after {
  content: ""; position: absolute; right: -50px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(91, 148, 230, .55), rgba(91, 148, 230, 0) 70%);
  pointer-events: none;
}
.terms-hero-logos { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.terms-logo-jelly { height: 46px; width: auto; }
.terms-logo-build { height: 36px; width: auto; }
.terms-by { font: 600 16px "Baloo 2", Roboto, sans-serif; }
.content .terms-hero h1, .terms-hero h1 {
  position: relative; z-index: 1; margin: 0; color: #fff;
  font-family: "Baloo 2", Roboto, sans-serif; font-size: 40px; font-weight: 700; letter-spacing: -.01em;
}
.terms-meta { position: relative; z-index: 1; margin: 6px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .8); }
.terms-back { position: relative; z-index: 1; display: inline-block; margin-top: 14px; color: #fff; font-size: 13.5px; font-weight: 600; }
.terms-body { display: grid; grid-template-columns: 236px 1fr; gap: 26px; align-items: start; }
.terms-toc {
  position: sticky; top: 8px; padding: 14px 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); max-height: calc(100vh - var(--header-h) - 70px); overflow-y: auto;
}
.terms-standalone .terms-toc { max-height: calc(100vh - 30px); }
.terms-toc-title { padding: 2px 10px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.terms-toc ol { list-style: none; margin: 0; padding: 0; }
.terms-toc a {
  display: flex; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.35; color: var(--text-muted);
}
.terms-toc a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.terms-toc a span { flex: none; width: 18px; font-weight: 700; color: var(--maroon); }
.terms-summary {
  margin-bottom: 16px; padding: 20px 24px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--blue-dim);
}
.terms-summary-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--navy); }
.terms-summary-mark {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 700;
}
.terms-summary ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--text); }
.terms-summary li { margin-bottom: 5px; }
.terms-summary-note { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); }
.terms-section {
  margin-bottom: 14px; padding: 22px 26px; scroll-margin-top: 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  font-size: 14px; line-height: 1.65; color: var(--text);
}
.terms-section h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 18px; font-weight: 700; color: var(--navy); }
.terms-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--maroon); color: #fff; font-size: 13px; font-weight: 700;
}
.terms-section p { margin: 0 0 10px; }
.terms-section ul { margin: 0; padding-left: 20px; }
.terms-section li { margin-bottom: 8px; }
.terms-callout { border-left: 4px solid var(--maroon); background: linear-gradient(90deg, var(--accent-dim), var(--surface) 45%); }
.terms-caps { font-size: 12.5px; letter-spacing: .01em; }
.terms-fill { padding: 0 4px; border-radius: 4px; background: #ffe58a; color: #5a4300; font-weight: 600; }
.terms-foot { padding: 26px 0 6px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.terms-foot-logos { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.terms-foot-logos img:first-child { height: 34px; width: auto; }
.terms-foot-logos img:last-child { height: 30px; width: auto; }
html[data-theme="dark"] .terms-foot-logos img { filter: brightness(1.7); }
@media (max-width: 860px) {
  .terms-body { grid-template-columns: 1fr; }
  .terms-toc { display: none; }
  .terms-hero { padding: 26px 22px; }
  .terms-hero h1 { font-size: 32px; }
}


/* ══════════════════════════════════
   PAGE TITLES: blue, in the Jelly display font
══════════════════════════════════ */
.content > h1, .view-title-block h1 {
  font-family: "Baloo 2", Roboto, sans-serif; font-weight: 700; letter-spacing: -.01em; line-height: 1.15;
  color: var(--title-blue);
  /* dark speckled blue, like the board seams */
  background-image: url('/static/img/speckle-navy.png'); background-size: 48px 48px;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] .content > h1, html[data-theme="dark"] .view-title-block h1 {
  background-image: url('/static/img/speckle-navy-dark.png');
}
.content > h1 { font-size: 30px; }
.view-title-block h1 { font-size: 32px; }

/* ══════════════════════════════════
   BUILD WITH logo at the bottom of the sidebar
══════════════════════════════════ */
.sidebar-build { position: relative; z-index: 1; margin-top: auto; padding: 16px 20px 6px; text-align: center; }
.sidebar-build img { display: block; width: 122px; height: auto; margin: 0 auto; }
.sidebar-build img.sidebar-product-of { width: 96px; margin-bottom: 7px; }
