/* ═══════════════════════════════════════════════════════════════
   Jelly
   original Everywhere maroon + navy, speckled topbar/sidebar,
   soft lavender-white content cards
══════════════════════════════════════════════════════════════ */


: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;
}

/* Rain: each drop forms, falls straight down and fades out by shrinking, then forms again at the top. Uses the separate
   `translate` and `scale` properties so each drop keeps its inline rotate() and opacity; durations and delays differ per
   drop (nth-child) so they never fall in step. */
.sidebar-drip, .topbar-drip { animation: dripFall 2.4s cubic-bezier(.5, 0, 1, .6) infinite; }
.topbar-drip { --fall: 22px; }
.sidebar-drip { --fall: 70px; }
.sidebar-drip:nth-child(3n), .topbar-drip:nth-child(3n) { animation-duration: 3.1s; animation-delay: -1.1s; }
.sidebar-drip:nth-child(3n+1), .topbar-drip:nth-child(3n+1) { animation-duration: 2s; animation-delay: -.5s; }
.sidebar-drip:nth-child(4n), .topbar-drip:nth-child(4n) { animation-duration: 3.6s; animation-delay: -2.2s; }
@keyframes dripFall {
  0%   { translate: 0 0; scale: .2; }
  12%  { translate: 0 2px; scale: 1; }
  85%  { translate: 0 var(--fall); scale: 1; }
  100% { translate: 0 calc(var(--fall) * 1.15); scale: .2; }
}
@media (prefers-reduced-motion: reduce) { .sidebar-drip, .topbar-drip { animation: none; } }

.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)); }

/* Quarter in Review -- footer summary card: headline stat tiles + a 6-quarter
   trend line, same card/tile language as the rest of Home. */
.home-quarter-review-card { margin-top: 20px; }
.home-quarter-review-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 4px 0 16px;
}
.home-quarter-review-chart { padding-top: 4px; }
.stat-tile-value.positive { color: #1a7a35; }
.stat-tile-value.negative { color: var(--maroon); }
@media (max-width: 760px) {
  .home-quarter-review-tiles { grid-template-columns: repeat(2, 1fr); }
}
.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; }
.company-name-link { cursor: pointer; }
.company-name-link:hover { color: var(--accent); text-decoration: underline; }

.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, .cx-welcome h2 {
  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, html[data-theme="dark"] .cx-welcome h2 {
  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; }

/* ══════════════════════════════════
   BRAND THEMES: custom colors from a website
══════════════════════════════════ */
html[data-brand="custom"] .content > h1, html[data-brand="custom"] .view-title-block h1, html[data-brand="custom"] .cx-welcome h2 {
  background-image: none; -webkit-text-fill-color: currentColor; color: var(--title-blue);
}
.brand-row { align-items: flex-start; flex-wrap: wrap; }
.brand-box { flex: 1 1 340px; max-width: 520px; min-width: 260px; }
.brand-url { display: flex; gap: 8px; }
.brand-url input { flex: 1; min-width: 0; }
.brand-status { margin: 8px 0 0; min-height: 18px; font-size: 12.5px; color: var(--text-muted); }
.brand-status.bad { color: #c0392b; }
.brand-editor { margin-top: 10px; padding: 12px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--bg-2); }
.brand-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.brand-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); cursor: pointer; }
.brand-fields { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; font-size: 12.5px; color: var(--text-muted); }
.brand-fields label { display: flex; align-items: center; gap: 8px; }
.brand-fields input[type="color"] { width: 38px; height: 28px; padding: 0; border: 1px solid var(--border-2); border-radius: 6px; background: none; cursor: pointer; }
.brand-save { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-save input { flex: 1 1 140px; min-width: 0; }
.brand-primary { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.brand-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.brand-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 8px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); font-size: 13px; }
.brand-chip.on { border-color: var(--maroon); box-shadow: 0 0 0 1px var(--maroon); font-weight: 600; }
.brand-dots { display: inline-flex; }
.brand-dots i { width: 12px; height: 12px; border-radius: 50%; margin-left: -3px; border: 1px solid var(--surface); }
.brand-dots i:first-child { margin-left: 0; }
.brand-pick, .brand-del { border: none; background: none; cursor: pointer; font: inherit; color: var(--text); padding: 0 2px; }
.brand-del { color: var(--text-muted); font-size: 16px; line-height: 1; }
.brand-check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; }
.brand-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.brand-logo-row .brand-check { margin-bottom: 0; }
.brand-logo-prev { display: inline-flex; align-items: center; justify-content: center; height: 42px; min-width: 70px; padding: 4px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border-2); }
.brand-logo-prev img { max-height: 28px; max-width: 150px; object-fit: contain; }
.topbar-logo { gap: 12px; }
.topbar-brand-logo { display: inline-flex; align-items: center; gap: 12px; }
.topbar-x { color: rgba(255, 255, 255, .7); font-size: 18px; line-height: 1; }
.topbar-brand-pill { display: inline-flex; align-items: center; background: #fff; border-radius: 10px; padding: 5px 12px; }
.topbar-brand-pill img { display: block; height: 26px; width: auto; max-width: 160px; object-fit: contain; }
/* a firm's own fonts, when their theme brings them */
html[data-brand-title] .content > h1, html[data-brand-title] .view-title-block h1, html[data-brand-title] .home-section-head h3 {
  font-family: var(--brand-font-title), "Baloo 2", Roboto, sans-serif;
}
html[data-brand-body] body, html[data-brand-body] input, html[data-brand-body] button,
html[data-brand-body] select, html[data-brand-body] textarea {
  font-family: var(--brand-font-body), Roboto, -apple-system, "Segoe UI", sans-serif;
}
.brand-draft { margin: 0 0 10px; padding: 6px 10px; border-radius: 8px; background: var(--accent-dim); color: var(--text); font-size: 12.5px; font-weight: 600; }
.brand-edit { border: none; background: none; cursor: pointer; color: var(--text-muted); font-size: 13px; padding: 0 2px; }
.brand-reset { margin-top: 12px; }
/* the hidden attribute must win over display rules like inline-flex */
[hidden] { display: none !important; }
.brand-save { margin-bottom: 12px; }

/* ══════════════════════════════════
   CHAT: a Claude-style reading layout with history
══════════════════════════════════ */
.content:has(.cx) { padding: 0; overflow: hidden; }
.cx { display: flex; height: 100%; background: var(--bg); position: relative; }
.cx-side {
  width: 272px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 16px 12px; background: var(--bg-2); border-right: 1px solid var(--border);
}
.cx-new {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 1px solid var(--border-2);
  border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.cx-new span { color: var(--maroon); font-size: 18px; line-height: 1; }
.cx-new:hover { background: var(--bg-hover); }
.cx-search { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.cx-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.cx-group { margin: 14px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.cx-empty-list { margin: 14px 8px; font-size: 13px; color: var(--text-muted); }
.cx-item { display: flex; align-items: center; border-radius: 10px; }
.cx-item:hover, .cx-item.on { background: var(--bg-hover); }
.cx-item.on { box-shadow: inset 3px 0 0 var(--maroon); }
.cx-item-title { flex: 1; min-width: 0; text-align: left; padding: 8px 10px; border: none; background: none; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-ico { display: none; border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 6px; border-radius: 6px; }
.cx-item:hover .cx-ico { display: inline-block; }
.cx-ico:hover { background: var(--border); color: var(--text); }
.cx-rename { flex: 1; min-width: 0; margin: 4px; padding: 5px 8px; border: 1px solid var(--maroon); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.cx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cx-top { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.cx-title { font-weight: 600; font-size: 14.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-toggle { display: none; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); border-radius: 8px; padding: 4px 9px; font-size: 16px; cursor: pointer; }
.cx-scroll { flex: 1; overflow-y: auto; }
.cx-thread { max-width: 780px; margin: 0 auto; padding: 24px 20px 12px; display: flex; flex-direction: column; gap: 22px; }
.cx-msg.user { display: flex; justify-content: flex-end; }
.cx-bubble { max-width: 85%; padding: 10px 15px; border-radius: 18px 18px 6px 18px; background: var(--accent-dim); color: var(--text); font-size: 15px; line-height: 1.55; border: 1px solid var(--border); }
.cx-msg.ai { display: flex; gap: 12px; align-items: flex-start; }
.cx-avatar { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: "Baloo 2", Roboto, sans-serif; font-weight: 700; font-size: 15px; margin-top: 2px; }
.cx-body { flex: 1; min-width: 0; }
.cx-md { font-size: 15px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.cx-md > :first-child { margin-top: 0; } .cx-md > :last-child { margin-bottom: 0; }
.cx-md p { margin: 0 0 12px; }
.cx-md h2, .cx-md h3, .cx-md h4, .cx-md h5 { margin: 18px 0 8px; font-weight: 700; line-height: 1.3; color: var(--text); }
.cx-md h2 { font-size: 18px; } .cx-md h3 { font-size: 16.5px; } .cx-md h4, .cx-md h5 { font-size: 15px; }
.cx-md ul, .cx-md ol { margin: 0 0 12px; padding-left: 22px; } .cx-md li { margin: 3px 0; }
.cx-md strong { font-weight: 700; }
.cx-md a { color: var(--maroon); text-decoration: underline; text-underline-offset: 2px; }
.cx-md code { padding: 1px 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); font-size: 13px; }
.cx-md pre { margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); overflow-x: auto; }
.cx-md pre code { padding: 0; border: none; background: none; }
.cx-md blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--maroon); color: var(--text-muted); }
.cx-table { margin: 4px 0 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cx-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cx-table th { text-align: left; font-weight: 600; padding: 8px 12px; background: var(--bg-2); color: var(--text-muted); white-space: nowrap; border-bottom: 1px solid var(--border); }
.cx-table td { padding: 8px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.cx-table tbody tr:first-child td { border-top: none; }
.cx-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cx-tool { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.cx-tool i { width: 6px; height: 6px; border-radius: 50%; background: #1f8a5b; }
.cx-tool.live i { background: var(--maroon); animation: cxPulse 1s ease-in-out infinite; }
.cx-tool b { font-weight: 600; color: var(--text); }
@keyframes cxPulse { 50% { opacity: .25; transform: scale(.7); } }
.cx-actions { margin-top: 6px; opacity: 0; transition: opacity .15s; }
.cx-msg.ai:hover .cx-actions { opacity: 1; }
.cx-copy { border: none; background: none; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.cx-copy:hover { background: var(--bg-hover); color: var(--text); }
.cx-typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.cx-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); animation: cxBounce 1.1s ease-in-out infinite; }
.cx-typing i:nth-child(2) { animation-delay: .15s; } .cx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cxBounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.cx-caret { display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: text-bottom; background: var(--maroon); border-radius: 2px; animation: cxBlink 1s steps(2) infinite; }
@keyframes cxBlink { 50% { opacity: 0; } }
.cx-welcome { text-align: center; padding: 8vh 10px 0; }
.cx-welcome-mark { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: "Baloo 2", Roboto, sans-serif; font-weight: 700; font-size: 28px; }
.cx-welcome h2 { margin: 0 0 6px; font-family: "Baloo 2", Roboto, sans-serif; font-size: 30px; font-weight: 700; }
.cx-welcome p { margin: 0 auto 22px; max-width: 520px; color: var(--text-muted); font-size: 14.5px; line-height: 1.55; }
.cx-suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 640px; margin: 0 auto; }
.cx-chip { text-align: left; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.4; cursor: pointer; transition: background .15s, border-color .15s; }
.cx-chip:hover { background: var(--bg-hover); border-color: var(--maroon); }
.cx-composer { padding: 6px 20px 14px; }
.cx-box { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border: 1px solid var(--border-2); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.cx-box:focus-within { border-color: var(--maroon); }
.cx-box textarea { flex: 1; min-height: 24px; max-height: 200px; padding: 6px 0; border: none; outline: none; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; }
.cx-send { flex-shrink: 0; width: 36px; height: 36px; border: none; border-radius: 50%; background: var(--maroon); color: #fff; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.cx-send.stop { background: var(--text); font-size: 13px; }
.cx-hint { max-width: 780px; margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--text-dim); }
@media (max-width: 860px) {
  .cx-side { position: absolute; z-index: 20; top: 0; bottom: 0; left: 0; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .cx-side.open { transform: none; }
  .cx-toggle { display: inline-block; }
  .cx-suggest { grid-template-columns: 1fr; }
  .cx-ico { display: inline-block; }
}

/* ══════════════════════════════════
   SIGNALS: speckled blue cards, modern glass droplets
══════════════════════════════════ */
.signals-ticker-wrap { border: none; background: transparent; margin: 14px 0 6px; padding: 4px 0; }
.signals-ticker-row { display: flex; align-items: stretch; gap: 12px; padding-right: 12px; }
.signals-chip {
  width: 330px; padding: 12px 16px; gap: 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px;
  background-color: var(--blue); background-image: url('/static/img/noise.webp'); background-repeat: repeat;
  box-shadow: 0 6px 16px -8px rgba(13, 58, 102, .55); transition: transform .15s ease, filter .15s ease;
}
.signals-chip:hover { background-color: var(--blue); filter: brightness(1.12); transform: translateY(-2px); }
.signals-chip-name { font-family: "Baloo 2", Roboto, sans-serif; font-size: 15px; font-weight: 600; color: #fff; }
.signals-chip-fund { color: rgba(255, 255, 255, .72); font-weight: 500; }
.signals-chip-snippet { font-size: 12px; line-height: 1.4; color: rgba(255, 255, 255, .9); }
.signals-chip .partner-avatar, .signals-chip .row-avatar { border: 2px solid rgba(255, 255, 255, .85); }

.signals-graph-card { background: none; border: none; box-shadow: none; padding: 0; margin-bottom: 8px; }
.drop-field { position: relative; height: clamp(480px, calc(100vh - var(--header-h) - var(--footer-h) - 260px), 820px); overflow: hidden; contain: layout paint; }
.drop {
  position: absolute; left: 0; top: 0; width: var(--size); height: var(--size);
  border: 0; padding: 0; background: none; cursor: pointer; color: var(--text); font: inherit;
  will-change: transform; z-index: 1;
}
.drop.hover { z-index: 5; }
/* a teardrop: a square with three round corners, turned so the sharp one points up */
.drop-body {
  position: absolute; width: 78%; height: 78%; left: 11%; top: 19%;
  border-radius: 50% 0 50% 50%; transform: rotate(-45deg);
  background:
    radial-gradient(circle at 70% 28%, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 38%),
    linear-gradient(150deg, color-mix(in srgb, var(--c) 32%, #fff) 0%, color-mix(in srgb, var(--c) 14%, transparent) 52%, color-mix(in srgb, var(--c) 30%, transparent) 100%);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .9),
    inset 0 -18px 28px -10px color-mix(in srgb, var(--c) 50%, transparent),
    inset 10px 0 22px -14px rgba(255, 255, 255, .9),
    0 24px 34px -18px color-mix(in srgb, var(--c) 70%, rgba(20, 21, 46, .35));
  animation: dropWobble var(--wob, 8s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
.drop-shine {
  position: absolute; left: 25%; top: 36%; width: 17%; height: 8%; border-radius: 50%;
  background: rgba(255, 255, 255, .85); transform: rotate(-32deg); filter: blur(.6px); pointer-events: none;
}
.drop.hover .drop-body { animation-play-state: paused; transform: rotate(-45deg) scale(1.08); }
@keyframes dropWobble {
  0%   { transform: rotate(-45deg) scale(1, 1); }
  100% { transform: rotate(-45deg) scale(1.05, .96); }
}
.drop-in {
  position: absolute; left: 10%; right: 10%; top: 25%; bottom: 7%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1px; pointer-events: none;
}
.drop-photo { position: relative; display: inline-flex; margin-bottom: 3px; }
.drop-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; font-size: 14px; object-fit: cover; box-shadow: 0 3px 10px rgba(20, 21, 46, .22); }
.drop-fundlogo { position: absolute; right: -7px; bottom: -3px; width: 17px; height: 17px; border-radius: 5px; background: #fff; padding: 2px; box-shadow: 0 1px 4px rgba(20, 21, 46, .25); }
.drop-name { font-family: "Baloo 2", Roboto, sans-serif; font-weight: 600; font-size: 14px; line-height: 1.1; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drop-fund { font-size: 10.5px; color: var(--text-muted); line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-sector { margin-top: 4px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: color-mix(in srgb, var(--c) 45%, #1d1a33); background: rgba(255, 255, 255, .75); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.drop-snip {
  display: none; position: absolute; left: 50%; top: calc(100% - 4px); transform: translateX(-50%); width: 250px; z-index: 6;
  padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.4; text-align: left; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text); box-shadow: var(--shadow);
}
.drop.up .drop-snip { top: auto; bottom: calc(100% - 4px); }
.drop.hover .drop-snip { display: block; }
html[data-theme="dark"] .drop-sector { color: #fff; background: rgba(0, 0, 0, .35); }
html[data-theme="dark"] .drop-name { color: #fff; }
@media (max-width: 700px) { .drop-snip { width: 200px; } }
@media (prefers-reduced-motion: reduce) { .drop-body { animation: none; } }

/* ══════════════════════════════════
   TABLES: always reachable scrollbars, optional fit-to-screen
══════════════════════════════════ */
.table-wrap { max-height: max(360px, calc(100vh - var(--header-h) - var(--footer-h) - 190px)); overflow: auto; }
.fit-btn {
  padding: 7px 14px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface);
  color: var(--text-muted); font: inherit; font-size: 13px; cursor: pointer;
}
.fit-btn:hover { background: var(--bg-hover); color: var(--text); }
.fit-btn.on { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.table-wrap.fit { overflow-x: hidden; }
.table-wrap.fit table.data-table { width: 100%; min-width: 0; }
.table-wrap.fit .data-table th { width: auto !important; }
.table-wrap.fit .data-table td { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap.fit .data-table td > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* chat: Jelly pink and blue only, the real logo, a jelly-drop "thinking" animation */
.cx-avatar { overflow: hidden; background: var(--brand); }
.cx-avatar img { width: 13px; height: auto; display: block; }
.cx-welcome-logo { display: block; height: 62px; width: auto; margin: 0 auto 14px; }
.cx-send.stop { background: var(--blue); }
.cx-think { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.cx-think-drops { display: inline-flex; align-items: flex-end; gap: 5px; height: 24px; }
.cx-think-drops i { width: 9px; height: 13px; border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%; background: var(--maroon); animation: cxDrip 1.15s ease-in-out infinite; }
.cx-think-drops i:nth-child(2) { background: var(--blue); animation-delay: .15s; }
.cx-think-drops i:nth-child(3) { animation-delay: .3s; }
.cx-think-text {
  font-family: "Baloo 2", Roboto, sans-serif; font-size: 16px; font-weight: 600;
  background: linear-gradient(90deg, var(--text-muted) 0%, var(--maroon) 35%, var(--blue) 65%, var(--text-muted) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: cxShimmer 2.4s linear infinite;
}
@keyframes cxDrip { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-9px) scale(1.12, .92); } }
@keyframes cxShimmer { to { background-position: -220% 0; } }
.cx-continue { margin-left: 8px; padding: 5px 14px; border: 1px solid var(--maroon); border-radius: 999px; background: var(--surface); color: var(--maroon); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cx-continue:hover { background: var(--maroon); color: #fff; }
.cx-actions:has(.cx-continue) { opacity: 1; }
.cx-chip:hover { border-color: var(--blue); }
.cx-md a { color: var(--blue); }
.cx-md blockquote { border-left-color: var(--blue); }
/* a white logo goes straight onto the coloured top bar; any other logo sits on a white pill */
.topbar-brand-logo.light-logo .topbar-brand-pill { background: transparent; padding: 0; }
.brand-logo-prev.light { background: var(--brand); }

/* Private Companies: what the data is */
.explainer-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 6px 0 18px; }
.explainer-card {
  position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.explainer-card::after {
  content: ""; position: absolute; right: -34px; top: -34px; width: 110px; height: 110px; border-radius: 50%;
  background-color: var(--blue); background-image: url('/static/img/noise.webp'); opacity: .10;
}
.explainer-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 12px; color: #fff;
  background-color: var(--blue); background-image: url('/static/img/noise.webp'); background-repeat: repeat;
  box-shadow: 0 6px 14px -6px rgba(13, 58, 102, .6);
}
.explainer-icon svg { width: 21px; height: 21px; }
.explainer-card h3 { margin: 0 0 4px; font-family: "Baloo 2", Roboto, sans-serif; font-size: 17px; font-weight: 700; color: var(--text); }
.explainer-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); position: relative; }
@media (max-width: 860px) { .explainer-row { grid-template-columns: 1fr; } }

/* artistic bars: grow up from the floor, then the labels fade in */
.bar-pillar { transform-box: fill-box; transform-origin: bottom; animation: barGrow .7s cubic-bezier(.2, .8, .2, 1) both; }
.bar-label { animation: barLabelIn .5s ease-out both; }
@keyframes barGrow { from { transform: scaleY(.02); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes barLabelIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bar-pillar, .bar-label { animation: none; } }
.logo-link { display: inline-block; cursor: pointer; }
.sidebar-build .logo-link { display: block; }
.logo-link:hover img { filter: brightness(1.12); }

/* ══════════════════════════════════
   PHONES (under 860px wide). Nothing here applies on a computer.
══════════════════════════════════ */
.topbar-menu, .m-filter-btn, .m-sort, .sidebar-backdrop { display: none; }
@media (max-width: 860px) {
  :root { --header-h: 58px; --sidebar-w: 0px; --footer-h: 30px; }
  html, body { overflow-x: hidden; }

  /* top bar: menu button, small logo, search, avatar */
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar-drips, .topbar-divider, .profile-text, .search-kbd-hint { display: none; }
  .topbar-menu {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; padding: 0;
    border: none; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; position: relative; z-index: 1;
  }
  .topbar-menu svg { width: 22px; height: 22px; }
  .jelly-logo-img { height: 22px; }
  .topbar-x, .topbar-brand-logo { display: none !important; }
  .topbar-logo { padding: 0; }
  .topbar-search { margin: 0; min-width: 0; max-width: none; }
  .topbar-search input { font-size: 16px; }   /* 16px stops iPhones zooming in when the box is tapped */
  .topbar-right { gap: 6px; }
  .topbar-help { width: 36px; height: 36px; }

  /* the menu: slides in over the page */
  .sidebar {
    position: fixed; top: var(--header-h); bottom: 0; left: 0; z-index: 300; width: min(300px, 84vw);
    transform: translateX(-104%); transition: transform .22s ease; box-shadow: 8px 0 32px rgba(10, 5, 20, .35);
    padding-bottom: env(safe-area-inset-bottom); overflow-y: auto;
  }
  .sidebar.open { transform: none; }
  .sidebar-backdrop {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; top: var(--header-h); z-index: 250;
    background: rgba(15, 10, 25, .5); opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .nav-item { min-height: 46px; }

  /* the page itself gets the full width */
  .content { padding: 16px 14px 20px; height: calc(100dvh - var(--header-h) - var(--footer-h) - env(safe-area-inset-bottom)); }
  .content > h1, .view-title-block h1 { font-size: 26px; }
  .view-subtitle { font-size: 13px; }
  .app-footer { left: 0; font-size: 12px; height: calc(var(--footer-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); gap: 6px; }
  .app-footer, .terms-foot { font-size: 12px; }
  .view-header { flex-wrap: wrap; gap: 8px; }
  .view-count { width: 100%; }
  .fit-btn, .columns-wrap { display: none; }
  .m-filter-btn, .m-sort {
    display: inline-block; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border-2); border-radius: 10px;
    background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
  }
  .m-filter-btn.on { background: var(--maroon); border-color: var(--maroon); color: #fff; }
  .m-sort { max-width: 52vw; }
  .reset-filters-btn, .save-list-btn { min-height: 40px; }

  /* tables become a stack of cards: each row a card, each cell a labelled line */
  .table-wrap, .table-wrap.fit { max-height: none; overflow: visible; background: none; border: none; box-shadow: none; border-radius: 0; }
  .table-wrap table.data-table, .table-wrap .data-table tbody, .table-wrap .data-table tr { display: block; width: 100%; min-width: 0; }
  .table-wrap .data-table thead { display: none; }
  .table-wrap.filters-open .data-table thead {
    display: block; margin-bottom: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  }
  .table-wrap.filters-open .data-table thead tr:first-child { display: none; }
  .table-wrap.filters-open .filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .table-wrap.filters-open .filter-row th {
    display: block; position: static; height: auto; width: auto !important; padding: 0; background: none; border: none;
  }
  .table-wrap.filters-open .filter-row th::before {
    content: attr(data-label); display: block; margin-bottom: 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
  }
  .table-wrap .data-table tbody tr {
    position: relative; margin: 0 0 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-sm);
  }
  .table-wrap .data-table td {
    display: flex !important; gap: 10px; align-items: baseline; width: auto !important; max-width: none !important;
    padding: 4px 0; border: none; white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
  }
  .table-wrap .data-table td > * { max-width: 100% !important; }
  .table-wrap .data-table td::before {
    content: attr(data-label); flex: 0 0 94px; padding-top: 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim);
  }
  .table-wrap .data-table td:empty { display: none !important; }
  .table-wrap .data-table td.logo-cell { position: absolute; right: 12px; top: 12px; padding: 0; }
  .table-wrap .data-table td.logo-cell::before { display: none; }
  .table-wrap .data-table tr td:first-child:not(.logo-cell), .table-wrap .data-table td.logo-cell + td {
    padding-right: 48px; font-size: 16px; font-weight: 700;
  }
  .table-wrap .data-table tr td:first-child:not(.logo-cell)::before, .table-wrap .data-table td.logo-cell + td::before { display: none; }
  .pagination { flex-wrap: wrap; gap: 8px; justify-content: center; }
  .pagination .page-info { width: 100%; text-align: center; }
  .pagination button { min-height: 40px; }

  /* chat: the composer clears the keyboard bar and the home indicator */
  .cx-composer { padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); }
  .cx-box textarea { font-size: 16px; }
  .cx-top { padding: 8px 12px; }
  .cx-thread { padding: 16px 12px 8px; }
  .cx-bubble { max-width: 92%; }
  .cx-send { width: 40px; height: 40px; }

  /* settings and other forms */
  .settings-row { flex-wrap: wrap; }
  .brand-box { max-width: none; flex: 1 1 100%; }
  .home-card { padding: 14px; }
  .stats-row, .funds-charts-row { grid-template-columns: 1fr; }
  .drop-field { height: clamp(420px, calc(100dvh - var(--header-h) - var(--footer-h) - 230px), 640px); }
  .signals-chip { width: 270px; }
  input, select, textarea { font-size: 16px; }
  .cx-side:not(.open) { box-shadow: none; }
  /* the three explainer cards sit in a row you swipe, so they do not push the table off the screen */
  .explainer-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 6px -14px 14px; padding: 0 14px 6px; }
  .explainer-card { flex: 0 0 80%; scroll-snap-align: start; }
}

/* ── loading screen: pink, with the logo, until sign-in has finished ── */
.boot-splash {
  position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background-color: #9b1d5f; background-image: url('/static/img/noise.webp'); color: #fff; text-align: center; padding: 24px;
}
.boot-splash img { width: min(190px, 52vw); height: auto; }
.boot-drops { display: flex; align-items: flex-end; gap: 7px; height: 26px; }
.boot-drops i { width: 11px; height: 15px; border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%; background: rgba(255, 255, 255, .92); animation: cxDrip 1.15s ease-in-out infinite; }
.boot-drops i:nth-child(2) { animation-delay: .15s; background: #a9c4ee; }
.boot-drops i:nth-child(3) { animation-delay: .3s; }
.boot-splash p { margin: 0; font-size: 14px; max-width: 280px; line-height: 1.5; }
.boot-splash button { margin-left: 4px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 999px; background: transparent; color: #fff; font: inherit; cursor: pointer; }
body.booted .boot-splash { display: none; }

/* ── phones: the help guide and the welcome tour ── */
@media (max-width: 860px) {
  .sidebar:not(.open) { box-shadow: none; }
  .help-backdrop { padding: 8px; }
  .help-modal { width: 100%; height: calc(100dvh - 16px); grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .help-modal > * { min-width: 0; }
  .help-rail-head { padding: 14px 52px 6px 16px; }
  .help-close { top: 10px; right: 10px; width: 34px; height: 34px; }
  .help-rail-list { padding: 0 12px 10px; -webkit-overflow-scrolling: touch; }
  .help-topic { padding: 9px 14px; font-size: 14px; }
  .help-body { padding: 16px 16px 24px; }
  .help-body h2 { font-size: 20px; margin-right: 0; }
  .help-content { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
  .help-content kbd { white-space: nowrap; }
  .help-fig-btn { min-height: 90px; }
  .help-modal.help-tour { width: 100%; max-height: calc(100dvh - 16px); }
  .tour-shot { height: min(280px, 34vh); }
  .tour-text { padding: 16px 16px 4px; }
  .tour-text h2 { font-size: 20px; }
  .tour-text p { font-size: 15px; min-height: 0; }
  .tour-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
  .tour-next { padding: 11px 22px; }
  .signals-modal { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .funds-modal, .funds-modal-card { max-height: calc(100dvh - 24px); }
}

/* a heads-up that paid access is about to end */
.billing-banner {
  position: fixed; right: 16px; bottom: calc(var(--footer-h) + 14px); z-index: 150; max-width: 430px;
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 14px;
  background: #fff7e8; border: 1px solid #f0d49a; color: #5c3d00; box-shadow: 0 12px 34px rgba(60, 40, 0, .22);
  font-size: 13.5px; line-height: 1.45;
}
.billing-banner-actions { display: flex; align-items: center; gap: 10px; }
.billing-banner-actions button:first-child {
  padding: 8px 14px; border: none; border-radius: 10px; background: var(--maroon); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.billing-banner-actions button:last-child { margin-left: auto; border: none; background: none; color: #8a5a00; font-size: 20px; line-height: 1; cursor: pointer; }
@media (max-width: 860px) { .billing-banner { left: 12px; right: 12px; max-width: none; } }
html[data-theme="dark"] .billing-banner { background: #3a2c10; border-color: #6b5420; color: #f5deaa; }

/* ══════════════════════════════════
   TABLES (computers): every row is the same height; a cut-off value opens in full on hover
══════════════════════════════════ */
@media (min-width: 861px) {
  .data-table tbody tr { height: var(--row-h, 58px); }
  .data-table tbody td { height: var(--row-h, 58px); padding-top: 8px; padding-bottom: 8px; vertical-align: middle; overflow: hidden; }
  .data-table tbody td .cell {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
    max-height: calc(var(--row-h, 58px) - 16px); line-height: 1.4;
  }
  .data-table tbody td .cell:has(.sector-pill) { -webkit-line-clamp: 1; max-height: 28px; white-space: nowrap; }
  .data-table tbody td .cell:has(.sector-pill) .sector-pill { white-space: nowrap; }
  .data-table tbody td .cell-desc { position: static; max-height: none; -webkit-line-clamp: 2; }
  /* the old description-only pop-out is replaced by the hover card below */
  .data-table .cell-desc:hover { overflow: hidden; -webkit-line-clamp: 2; max-height: none; z-index: auto; }
  .data-table .cell-desc:hover .desc-inner { position: static; background: none; border: 0; box-shadow: none; padding: 0; width: auto; }
  html[data-density="compact"] { --row-h: 40px; }
  html[data-density="compact"] .data-table tbody td .cell { -webkit-line-clamp: 1; max-height: 20px; }
  html[data-density="compact"] .data-table tbody td .cell:has(.sector-pill) { max-height: 24px; }
  html[data-density="compact"] .data-table tbody td { padding-top: 3px; padding-bottom: 3px; }
  .table-wrap.fit .data-table tbody td .cell { -webkit-line-clamp: 1; max-height: 20px; }
}
.cell-tip {
  position: fixed; z-index: 400; max-width: 420px; padding: 10px 12px; border-radius: 10px; pointer-events: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-2); box-shadow: var(--shadow);
  font-size: 13px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere;
}
.cell-tip[hidden] { display: none; }
@media (max-width: 860px) {
  .table-wrap .data-table td .cell { display: block; -webkit-line-clamp: unset; max-height: none; overflow: visible; }
  .cell-tip { display: none !important; }
}


/* Portfolio "+" button under a row's logo, and the Feedback page */
.port-btn {
  display: block; margin: 4px auto 0; width: 22px; height: 22px; line-height: 1; padding: 0;
  border: 1px solid var(--border); border-radius: 50%; background: transparent;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
}
.port-btn:hover { border-color: var(--accent); color: var(--accent); }
.port-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 12px; }
.feedback-box { max-width: 640px; margin-bottom: 28px; }
.feedback-box textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; resize: vertical; box-sizing: border-box;
}
.feedback-box textarea:focus { outline: none; border-color: var(--accent); }
.feedback-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.feedback-history-title { margin: 0 0 10px; font-size: 14px; }
.feedback-item { max-width: 640px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; white-space: pre-wrap; }
.feedback-item-date { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }


/* Hacker Houses hero: pink speckled globe on the left, three number boxes on the right */
.hh-hero { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 28px; align-items: center; margin-bottom: 12px; }
.hh-hero:empty { display: none; }
.hh-hero > .muted { grid-column: 1 / -1; margin: 0; }
.hh-globe-wrap { position: relative; width: 100%; aspect-ratio: 1; touch-action: pan-y; }
.hh-globe-wrap canvas { display: block; max-width: 100%; }
.hh-tip { position: absolute; z-index: 2; pointer-events: none; padding: 6px 10px; font-size: 12px; line-height: 1.4;
  background: var(--text); color: var(--surface); border-radius: var(--radius-sm); max-width: 190px; }
.hh-cards { display: grid; gap: 14px; max-width: 420px; }
.hh-stat { width: 100%; text-align: left; font: inherit; color: inherit; padding: 18px 20px; gap: 16px; }
.hh-stat .stat-card-icon { width: 48px; height: 48px; border-radius: 12px; }
.hh-stat .stat-card-icon svg { width: 24px; height: 24px; }
.hh-stat .stat-card-value { font-size: 30px; line-height: 1.1; }
.hh-stat .stat-card-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.hh-hint { margin-top: 3px; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-stat-btn { cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.hh-stat-btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.hh-stat-btn:hover .hh-hint { color: var(--accent); }
@media (max-width: 760px) { .hh-hero { grid-template-columns: 1fr; } .hh-cards { max-width: none; } }

/* Chat usage: header meter, low-balance popup, toast */
.cx-meter { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.cx-meter[hidden] { display: none; }
.cx-meter.low span, .cx-meter.empty span { color: var(--text); font-weight: 600; }
.cx-meter button { font: 600 12px inherit; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.cx-meter button[hidden] { display: none; }
.cx-modal-back { position: fixed; inset: 0; z-index: 10000; background: rgba(20, 21, 43, .5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.cx-modal { width: 100%; max-width: 400px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.cx-modal h3 { margin: 0 0 6px; font-size: 20px; }
.cx-modal p { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.cx-amts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cx-amt { flex: 1 1 56px; padding: 10px 0; font: 600 15px inherit; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.cx-amt.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.cx-amt-other { flex: 1 1 100%; display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; }
.cx-amt-other input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: 15px inherit; padding: 10px 0; }
.cx-modal-err { min-height: 18px; margin-bottom: 8px; font-size: 13px; color: #c0392b; }
.cx-modal-actions { display: flex; gap: 8px; }
.cx-btn-go { flex: 2; padding: 12px; font: 600 15px inherit; border: 0; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; }
.cx-btn-go:disabled { opacity: .6; cursor: default; }
.cx-btn-later { flex: 1; padding: 12px; font: 500 14px inherit; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; }
.cx-modal .cx-modal-foot { margin: 12px 0 0; font-size: 12px; text-align: center; }
.cx-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10001; max-width: 90vw; padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--surface); font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
@media (max-width: 760px) { .cx-meter span { display: none; } .cx-meter .jbar { width: 56px; } }

.cx-meter button.quiet { background: transparent; color: var(--accent); }

/* Jelly theme for the chat usage meter and the reload box */
.jbar, .jmascot { --jelly: var(--accent); }
.jbar.low, .jmascot.low, .cx-modal.low { --jelly: #e08a00; }
.jbar.empty, .jmascot.empty, .cx-modal.empty { --jelly: #9aa0b4; }
.jbar { position: relative; display: block; width: 96px; height: 14px; border-radius: 999px; background: rgba(127, 127, 140, .18); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .25); }
.jbar.big { width: 100%; height: 22px; }
.jbar .jfill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 100) * 1%); min-width: 14px; border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--jelly) 60%, #fff) 0%, var(--jelly) 50%, color-mix(in srgb, var(--jelly) 82%, #000) 100%);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--jelly) 50%, transparent); transition: width .6s cubic-bezier(.3, 1.4, .5, 1); transform-origin: left center; animation: jwobbleX 3.4s ease-in-out infinite; }
.jbar .jfill::after { content: ""; position: absolute; left: 8%; right: 8%; top: 2px; height: 28%; border-radius: 999px; background: rgba(255, 255, 255, .5); }
.jbar.empty .jfill { display: none; }
.jbar u { position: absolute; bottom: 0; width: 5px; height: 0; margin-left: -2px; border-radius: 0 0 50% 50%; background: var(--jelly); opacity: 0; animation: jdrip 3.6s ease-in infinite; }
.jbar u:nth-of-type(1) { left: calc(var(--p, 100) * .86%); }
.jbar u:nth-of-type(2) { left: calc(var(--p, 100) * .42%); animation-delay: -1.7s; }
.jbar.big u { width: 7px; margin-left: -3px; }
.jbar.low u { animation-duration: 2s; }
.jbar.empty u { display: none; }
@keyframes jdrip { 0% { height: 0; opacity: 0; transform: translateY(0); } 12% { opacity: 1; }
  50% { height: 9px; transform: translateY(0); } 62% { height: 9px; opacity: 1; transform: translateY(2px); }
  100% { height: 5px; opacity: 0; transform: translateY(18px); } }
@keyframes jwobbleX { 0%, 100% { transform: scaleY(1); } 30% { transform: scaleY(1.12); } 60% { transform: scaleY(.94); } }

.cx-modal-back { animation: jfade .2s ease both; }
.cx-modal { animation: jpop .5s cubic-bezier(.2, 1.3, .4, 1) both; overflow: visible; }
@keyframes jfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes jpop { 0% { opacity: 0; transform: translateY(18px) scale(.86); } 100% { opacity: 1; transform: none; } }
.cx-modal-top { display: flex; align-items: center; gap: 12px; margin: -8px 0 10px; }
.jmascot { width: 112px; height: auto; flex: none; overflow: visible; }
.jmascot .jplate { fill: rgba(127, 127, 140, .25); }
.jmascot .jtrack { fill: color-mix(in srgb, var(--jelly) 14%, transparent); stroke: color-mix(in srgb, var(--jelly) 45%, transparent); stroke-width: 2; stroke-dasharray: 5 4; }
.jmascot.ok .jtrack { stroke-dasharray: none; }
.jmascot .jrise { fill: var(--jelly); transform-box: fill-box; transform-origin: 50% 100%; animation: jrise 1s cubic-bezier(.3, 1.4, .5, 1) .15s both; }
.jmascot .jeye { fill: rgba(20, 21, 43, .6); transform-box: fill-box; transform-origin: center; animation: jblink 4.2s infinite; }
.jmascot .jmouth { fill: none; stroke: rgba(20, 21, 43, .6); stroke-width: 3.2; stroke-linecap: round; }
.jmascot .jwob { transform-box: fill-box; transform-origin: 50% 100%; animation: jwobble 2.6s ease-in-out infinite; }
@keyframes jrise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes jwobble { 0%, 100% { transform: scale(1, 1); } 25% { transform: scale(1.04, .95); } 50% { transform: scale(.97, 1.04); } 75% { transform: scale(1.02, .98); } }
@keyframes jblink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.cx-modal-level { flex: 1; min-width: 0; }
.cx-modal-level b { display: block; margin-bottom: 8px; font-size: 18px; color: var(--jelly); }
.cx-modal-level .jbar.big { width: 100%; }

.cx-amt { position: relative; overflow: hidden; border-radius: 14px; transition: transform .15s; }
.cx-amt::before { content: ""; position: absolute; left: 12%; right: 12%; top: 3px; height: 30%; border-radius: 999px; background: rgba(255, 255, 255, .28); pointer-events: none; }
.cx-amt:hover { animation: jwobble .6s ease-in-out; }
.cx-amt:active { transform: scale(.92, .88); }
.cx-amt.on { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 80%, #000)); box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 40%, transparent); animation: jsquish .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jsquish { 0% { transform: scale(.88, 1.08); } 100% { transform: none; } }
.cx-btn-go { position: relative; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent) 55%, color-mix(in srgb, var(--accent) 80%, #000)); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .15s; }
.cx-btn-go::before { content: ""; position: absolute; left: 10%; right: 10%; top: 3px; height: 32%; border-radius: 999px; background: rgba(255, 255, 255, .3); pointer-events: none; }
.cx-btn-go:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); }
.cx-btn-go:active:not(:disabled) { transform: scale(.97, .94); }
@media (prefers-reduced-motion: reduce) {
  .jbar .jfill, .jbar u, .cx-modal, .cx-modal-back, .jmascot *, .cx-amt, .cx-amt.on { animation: none !important; transition: none !important; }
}
@media (max-width: 760px) { .jbar { width: 56px; } .jmascot { width: 88px; } }

/* ══════════════════════════════════
   PLAYFUL STAT CARDS + FILTER CONTROLS
   ══════════════════════════════════ */
.stat-card {
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease, border-color .2s ease;
  cursor: default;
}
.stat-card:hover {
  transform: translateY(-4px) scale(1.025) rotate(-.6deg);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .14);
  border-color: var(--accent);
}
.stat-card:nth-child(even):hover { transform: translateY(-4px) scale(1.025) rotate(.6deg); }
.stat-card::after {            /* a glossy jelly sheen that sweeps across on hover */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg); pointer-events: none; z-index: 2;
  transition: left .6s ease;
}
.stat-card:hover::after { left: 130%; }
.stat-card-icon { transition: transform .35s cubic-bezier(.34, 1.8, .64, 1); animation: iconBob 3.4s ease-in-out infinite; }
.stat-card:nth-child(2) .stat-card-icon { animation-delay: -.8s; }
.stat-card:nth-child(3) .stat-card-icon { animation-delay: -1.6s; }
.stat-card:nth-child(4) .stat-card-icon { animation-delay: -2.4s; }
.stat-card:hover .stat-card-icon { transform: scale(1.18) rotate(-8deg); }
@keyframes iconBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }

/* filtered state: the count card turns accent-coloured, with a "*" and a small tag */
.stat-card.is-filtered { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim), 0 6px 16px rgba(0, 0, 0, .1); }
.stat-asterisk { color: var(--accent); font-weight: 800; margin-left: 2px; display: inline-block; animation: asteriskSpin 4s linear infinite; }
@keyframes asteriskSpin { to { rotate: 360deg; } }
.stat-filtered-tag {
  display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  animation: tagIn .35s cubic-bezier(.34, 1.8, .64, 1) both;
}
@keyframes tagIn { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.stat-pop { animation: statPop .45s cubic-bezier(.34, 1.8, .64, 1); }
@keyframes statPop { 0% { transform: scale(.7); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }

/* column filter row: pill inputs with a jelly glow, and a bright bouncy operator dropdown */
.filter-cell input {
  border-radius: 999px; padding: 4px 10px;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.filter-cell input:focus { box-shadow: 0 0 0 3px var(--accent-dim); transform: scale(1.03); }
.filter-cell select {
  width: 26px; border-radius: 999px; border-color: var(--accent); background: var(--accent-dim); color: var(--accent);
  cursor: pointer; transition: transform .2s cubic-bezier(.34, 1.8, .64, 1), background .2s ease;
}
.filter-cell select:hover { transform: scale(1.2) rotate(-6deg); background: var(--accent); color: #fff; }
.filter-cell select:focus { box-shadow: 0 0 0 3px var(--accent-dim); }
.filter-cell:has(input:not(:placeholder-shown)) input { border-color: var(--accent); background: var(--accent-dim); }

@media (prefers-reduced-motion: reduce) {
  .stat-card, .stat-card-icon, .stat-asterisk, .stat-filtered-tag, .stat-pop,
  .filter-cell input, .filter-cell select { animation: none; transition: none; }
  .stat-card:hover, .stat-card:hover .stat-card-icon, .filter-cell select:hover { transform: none; }
}

/* usage face: brows, tear and the small header version */
.jmascot .jbrow, .jface .jbrow { fill: none; stroke: rgba(20, 21, 43, .6); stroke-width: 3; stroke-linecap: round; transition: d .5s ease; }
.jface .jmouth, .jface .jeye, .jface .jtear { transition: d .5s ease; }
.jmascot .jtear, .jface .jtear { fill: #6fb7ff; stroke: none; transform-box: fill-box; animation: jtearDrop 2.4s ease-in infinite; }
@keyframes jtearDrop { 0% { translate: 0 -3px; } 70% { translate: 0 12px; } 100% { translate: 0 14px; } }
.cx-face { display: inline-flex; font-style: normal; }
.jface { width: 28px; height: 24px; overflow: visible; }
.jface .jfacebg { fill: var(--jelly); }
.jface { --jelly: var(--accent); }
.jface.low { --jelly: #e08a00; }
.jface.empty { --jelly: #9aa0b4; }
.jface .jeye { fill: rgba(20, 21, 43, .75); }
.jface .jmouth { fill: none; stroke: rgba(20, 21, 43, .75); stroke-width: 5; stroke-linecap: round; }
.jface .jbrow { stroke: rgba(20, 21, 43, .75); stroke-width: 5; }
@media (prefers-reduced-motion: reduce) { .jtear { animation: none !important; } }

/* Jelly's food: PB&J and peanuts while he is fed, a growling tummy when he is not */
.jmascot .jbread { fill: #e8c58a; stroke: rgba(20, 21, 43, .28); stroke-width: .8; }
.jmascot .jpb { fill: #a8692e; }
.jmascot .jjam { fill: #8e3ca8; }
.jmascot .jnut ellipse { fill: #c9a063; stroke: rgba(20, 21, 43, .3); stroke-width: .6; }
.jmascot .jfood.jbite { animation: jbite 4.2s ease-in-out infinite; }
@keyframes jbite {
  0%, 14% { translate: 0 0; scale: 1; opacity: 1; }
  50% { translate: -50px -16px; scale: 1; opacity: 1; }
  68% { translate: -54px -18px; scale: .35; opacity: 1; }
  78% { translate: -54px -18px; scale: 0; opacity: 0; }
  92% { translate: 0 0; scale: 1; opacity: 0; }
  100% { translate: 0 0; scale: 1; opacity: 1; }
}
.jmascot.fed .jmouth { transform-box: fill-box; transform-origin: 50% 0; animation: jchew .5s ease-in-out infinite alternate; }
@keyframes jchew { from { transform: scaleY(1); } to { transform: scaleY(1.5); } }
.jmascot .jgrowl path { fill: none; stroke: rgba(20, 21, 43, .45); stroke-width: 2; stroke-linecap: round; animation: jgrowl .9s ease-in-out infinite alternate; }
@keyframes jgrowl { from { opacity: .15; } to { opacity: .95; } }

/* ══════════════════════════════════
   REPORTS: "Lay of the Land" -- the submission form and the territory map. Deliberately plain: real
   borders, real surfaces, the app's own button and table components -- not a bespoke glossy widget.
   Colors come from the app's existing sectorColor() hash palette (app.js), not a new one, so a sector
   or adjacency always reads the same here as it does in a sector pill or avatar elsewhere in Jelly.
══════════════════════════════════ */
.lotl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lotl-history-pick { display: flex; flex-direction: column; gap: 4px; }
.lotl-history-pick label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.lotl-history-pick select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; min-width: 220px;
}
.lotl-history-pick select:focus { outline: none; border-color: var(--accent); }

/* The intake form, specifically: the same speckled-blue treatment used for Signals chips and the
   explainer icons elsewhere in Jelly (var(--blue) + noise.webp), so the form reads as its own
   distinct, branded surface. */
.lotl-form {
  position: relative; overflow: hidden; max-width: 640px;
  background-color: var(--blue); background-image: url('/static/img/noise.webp'); background-repeat: repeat;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius); padding: 18px 20px 20px; margin-bottom: 24px;
  box-shadow: 0 8px 22px -10px rgba(13, 58, 102, .55);
}
.lotl-form-kicker { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(255, 255, 255, .7); margin-bottom: 10px; }
.lotl-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.lotl-field + .lotl-field { margin-top: 12px; }
.lotl-field label {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .85);
}
.lotl-field label svg { width: 14px; height: 14px; flex-shrink: 0; color: rgba(255, 255, 255, .7); }
.lotl-field-lead label { font-size: 13.5px; color: #fff; }
.lotl-field-lead label svg { width: 16px; height: 16px; color: #fff; }
.lotl-field input, .lotl-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; resize: vertical; box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(20, 21, 43, .04);
}
.lotl-field-lead input { font-size: 15.5px; padding: 11px 13px; }
.lotl-field input:focus, .lotl-field textarea:focus { outline: none; border-color: var(--accent); }
.lotl-field-row { display: flex; align-items: flex-start; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(255, 255, 255, .25); }
.lotl-or { align-self: center; margin-top: 24px; font-size: 11px; color: rgba(255, 255, 255, .7); font-weight: 700; text-transform: uppercase; }
.lotl-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

.lotl-report { max-width: 1120px; }
.lotl-summary {
  background: var(--bg-2); border: 1px solid var(--border); border-left: 3px solid var(--maroon);
  border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 22px;
}
.lotl-report-name { margin: 0 0 8px; font-family: "Baloo 2", Roboto, sans-serif; font-size: 20px; color: var(--text); }
.lotl-summary-sectors { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lotl-summary p { font-size: 14px; line-height: 1.6; color: var(--text); margin: 0; }
.lotl-insights { margin: 10px 0 0; padding-left: 18px; }
.lotl-insights li { font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.lotl-insights li::marker { color: var(--maroon); }

.lotl-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 24px; }
.lotl-stat-tile {
  display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.lotl-stat-num { font-family: "Baloo 2", Roboto, sans-serif; font-size: 22px; font-weight: 700; color: var(--maroon); }
.lotl-stat-label { font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); }

.lotl-section { margin-bottom: 26px; }
.lotl-section-head {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text); margin-bottom: 10px;
}
.lotl-section-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--maroon); flex-shrink: 0; }
.lotl-section-head .muted { font-weight: 500; text-transform: none; font-size: 12px; letter-spacing: normal; }

.lotl-investors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.lotl-investor-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.lotl-investor-logo { width: 30px; height: 30px; flex-shrink: 0; font-size: 12px; }
.lotl-investor-text { min-width: 0; }
.lotl-investor-name { font-weight: 600; font-size: 13.5px; }
.lotl-investor-meta { font-size: 11.5px; color: var(--text-muted); margin: 3px 0 6px; }
.lotl-investor-companies { font-size: 12px; color: var(--text); line-height: 1.5; }

.lotl-partners-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lotl-partner-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.lotl-partner-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.lotl-partner-name { font-weight: 600; font-size: 13px; }
.lotl-partner-fund { font-size: 11.5px; color: var(--text-muted); }
.lotl-partner-bar { height: 4px; border-radius: 2px; background: var(--bg-2); margin-bottom: 8px; overflow: hidden; }
.lotl-partner-bar-fill { height: 100%; background: var(--blue); border-radius: 2px; }
.lotl-partner-item p { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 0; }

@media (max-width: 860px) {
  .lotl-field-row { flex-direction: column; }
  .lotl-or { margin: 0; }
}

/* ══════════════════════════════════
   COMPANY CARD: opens from a click on any company name, on any table/page. Same modal pattern as
   the Venture Funds detail modal (.funds-modal-*), just its own instance since this one needs to be
   reachable from every page, not just one view.
══════════════════════════════════ */
.company-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;
}
.company-modal-backdrop.open { display: flex; }
.company-modal {
  background: var(--surface); border-radius: var(--radius); padding: 26px 30px;
  width: min(640px, 94vw); max-height: 86vh; overflow-y: auto; position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.company-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;
}
.company-modal-close:hover { color: var(--text); }
.company-modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; padding-right: 30px; }
.company-modal-head .row-avatar, .company-modal-head .row-avatar-logo { width: 44px; height: 44px; font-size: 16px; border-radius: 10px; }
.company-modal-name { font-family: "Baloo 2", Roboto, sans-serif; font-size: 19px; font-weight: 700; color: var(--text); }
.company-modal-link { font-size: 12.5px; color: var(--accent); }
.company-modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.company-modal-desc { font-size: 13.5px; line-height: 1.6; color: var(--text); margin: 12px 0; }
.company-modal-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.company-modal-fact-label { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-dim); }
.company-modal-fact-value { font-size: 13px; color: var(--text); margin-top: 2px; }
.company-modal-empty { font-size: 13px; color: var(--text-muted); margin-top: 14px; }

/* ══════════════════════════════════
   PORTFOLIO: search row (find a company to add) + a table/card toggle for the search results.
   The Your Portfolio list below stays a table regardless -- the toggle is for search results, where
   browsing by logo/sector in a card grid is more useful than for a short, already-curated list.
══════════════════════════════════ */
.portfolio-search-row { display: flex; align-items: center; gap: 12px; max-width: 640px; margin-bottom: 14px; }
.portfolio-search-row input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.portfolio-search-row input:focus { outline: none; border-color: var(--accent); }
.portfolio-view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.portfolio-view-btn {
  padding: 8px 14px; border: none; background: var(--surface); color: var(--text-muted); font: inherit; font-size: 13px; cursor: pointer;
}
.portfolio-view-btn + .portfolio-view-btn { border-left: 1px solid var(--border); }
.portfolio-view-btn.active { background: var(--maroon); color: #fff; }
#portfolioSearchResults { margin-bottom: 26px; }
#portfolioSearchResults:empty { margin-bottom: 0; }

.portfolio-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.portfolio-search-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; box-shadow: var(--shadow-sm);
}
.portfolio-search-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.portfolio-search-card-name { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.portfolio-search-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }

.watchlist-count-changed {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  color: var(--maroon); background: var(--accent-dim); border-radius: 999px; padding: 1px 7px; margin-left: 4px;
}
@media (max-width: 560px) { .company-modal-facts { grid-template-columns: 1fr; } }

/* ══════════════════════════════════
   LAY OF THE LAND report: five separate cards (company, who is talking, precedent transactions, investors, branch tree)
══════════════════════════════════ */
.lz-report { max-width: 1240px; display: flex; flex-direction: column; gap: 18px; }
.lz-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .lz-grid { grid-template-columns: minmax(0, 1fr); } }
.lz-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; min-width: 0; }
.lz-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--bg-2), var(--surface)); }
.lz-card-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--maroon); color: #fff; font: 700 13px "Baloo 2", Roboto, sans-serif; display: flex; align-items: center; justify-content: center; }
.lz-card-titles { flex: 1; min-width: 0; }
.lz-card-titles h3 { margin: 0; font: 700 16px "Baloo 2", Roboto, sans-serif; color: var(--text); }
.lz-card-titles p { margin: 1px 0 0; font-size: 12px; color: var(--text-muted); }
.lz-card-count { flex: none; min-width: 28px; padding: 3px 10px; border-radius: 999px; background: var(--accent-dim); color: var(--maroon); font-weight: 700; font-size: 12.5px; text-align: center; }
.lz-card-body { padding: 16px 18px 18px; }
.lz-empty { margin: 4px 0; color: var(--text-muted); font-size: 13.5px; }

.lz-overview { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.lz-overview-main { flex: 1 1 380px; min-width: 0; }
.lz-overview-main p { font-size: 14px; line-height: 1.6; margin: 8px 0 0; }
.lz-overview-stats { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 10px; flex: 0 1 300px; }
.lz-overview-stats div { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; flex-direction: column; }
.lz-overview-stats b { font: 700 24px "Baloo 2", Roboto, sans-serif; color: var(--title-blue); line-height: 1.1; }
.lz-overview-stats span { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }

.lz-logo { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: none; }
.lz-logo-letter { display: inline-flex; align-items: center; justify-content: center; color: #fff; font: 700 13px Roboto, sans-serif; border: 0; }

.lz-people { display: flex; flex-direction: column; gap: 14px; }
.lz-person { display: flex; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.lz-person:last-child { border-bottom: 0; padding-bottom: 0; }
.lz-person-av { position: relative; flex: none; width: 44px; height: 44px; }
.lz-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; font-size: 15px; }
.lz-fund-badge { position: absolute; right: -6px; bottom: -6px; line-height: 0; }
.lz-fund-badge .lz-logo { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(20,21,46,.2); font-size: 10px; }
.lz-person-main { flex: 1; min-width: 0; }
.lz-person-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.lz-person-name { font-weight: 700; font-size: 14px; }
.lz-person-fund { font-size: 12px; color: var(--text-muted); }
.lz-person-links { margin-left: auto; display: flex; gap: 8px; font-size: 11.5px; }
.lz-person-snip { margin: 5px 0 8px; font-size: 13px; line-height: 1.5; color: var(--text); }
.lz-meter-row { display: flex; align-items: center; gap: 10px; }
.lz-meter { flex: 1; height: 8px; border-radius: 99px; background: var(--bg-3); overflow: hidden; }
.lz-meter-fill { height: 100%; border-radius: 99px; background: currentColor; transition: width .5s ease; }
.lz-meter.lz-hi { color: var(--maroon); } .lz-meter.lz-mid { color: var(--title-blue); } .lz-meter.lz-lo { color: var(--text-dim); }
.lz-meter-label { flex: none; font-size: 11.5px; font-weight: 700; min-width: 86px; text-align: right; }
.lz-meter-label.lz-hi { color: var(--maroon); } .lz-meter-label.lz-mid { color: var(--title-blue); } .lz-meter-label.lz-lo { color: var(--text-muted); }
.lz-terms { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.lz-terms span { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-muted); }

.lz-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 12px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--bg-2); font-size: 12.5px; color: var(--text-muted); }
.lz-strip b { color: var(--text); }
.lz-deals { display: flex; flex-direction: column; }
.lz-deal { padding: 10px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.lz-deal:last-child { border-bottom: 0; }
.lz-deal-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lz-deal-company { font-weight: 700; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lz-deal-tag { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--blue-dim); color: var(--blue); }
.lz-deal-tag.lz-ma { background: var(--accent-dim); color: var(--maroon); }
.lz-deal-meta { text-align: right; font-size: 13px; display: flex; flex-direction: column; }
.lz-deal-meta span { font-size: 11.5px; color: var(--text-muted); }
.lz-deal-backers { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); }

.lz-inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lz-inv { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.lz-inv-logo { width: 38px; height: 38px; border-radius: 9px; font-size: 16px; }
.lz-inv-text { min-width: 0; }
.lz-inv-name { font-weight: 700; font-size: 13.5px; }
.lz-inv-meta { font-size: 11.5px; color: var(--text-muted); margin: 1px 0 4px; }
.lz-inv-cos { font-size: 12px; line-height: 1.4; color: var(--text); }

.lz-tree-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.lz-tree-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.lz-dot-fill { background: var(--maroon); } .lz-dot-ring { border: 2px solid var(--maroon); box-sizing: border-box; }
.lz-tree-legend .muted { margin-left: auto; }
.lz-tree-wrap { overflow-x: auto; border-radius: var(--radius-sm); background: radial-gradient(circle at 8% 50%, var(--accent-dim), transparent 38%), var(--bg); border: 1px solid var(--border); }
.lz-tree { display: block; width: 100%; min-width: 820px; height: auto; font-family: Roboto, sans-serif; }
.lz-br, .lz-lf { fill: none; stroke-linecap: round; transition: opacity .2s, stroke-width .2s; }
.lz-br { opacity: .7; }
.lz-lf { opacity: .3; stroke-width: 1.3; }
.lz-branch-g { transition: opacity .2s; }
.lz-tree:hover .lz-branch-g { opacity: .22; }
.lz-tree:hover .lz-branch-g:hover { opacity: 1; }
.lz-branch-g:hover .lz-br { opacity: .95; }
.lz-branch-g:hover .lz-lf { opacity: .7; }
.lz-node { filter: drop-shadow(0 1px 3px rgba(20,21,46,.3)); }
.lz-pill { opacity: .95; }
.lz-pill-text { fill: #fff; font-size: 11.5px; font-weight: 700; }
.lz-pill-text.lz-small { font-size: 10px; }
.lz-leaf { cursor: pointer; outline: none; }
.lz-leaf-text { font-size: 12px; fill: var(--text); }
.lz-leaf-meta { fill: var(--text-muted); font-size: 10.5px; }
.lz-leaf:hover .lz-leaf-text, .lz-leaf:focus .lz-leaf-text { font-weight: 700; fill: var(--maroon); }
.lz-root { filter: drop-shadow(0 3px 8px rgba(155,29,95,.4)); }
.lz-root-initial { fill: #fff; font: 700 24px "Baloo 2", Roboto, sans-serif; }
.lz-root-name { fill: var(--text); font: 700 13px "Baloo 2", Roboto, sans-serif; }

.lz-card-overview .lz-card-body { padding-top: 14px; }
.lz-co-summary { margin: 8px 0 14px; font-size: 14px; line-height: 1.55; max-width: 820px; }
.lz-co-none { margin-top: 12px; }
.lz-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.lz-fact { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 13px; display: flex; flex-direction: column; gap: 2px; }
.lz-fact span { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.lz-fact b { font: 700 17px "Baloo 2", Roboto, sans-serif; color: var(--title-blue); }
.lz-raise-notes { margin: 10px 0 0; padding: 9px 13px; border-left: 3px solid var(--maroon); background: var(--accent-dim); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; line-height: 1.5; }
.lz-raise-notes b { color: var(--maroon); margin-right: 6px; }
.lz-co-sub { margin: 16px 0 7px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.lz-rounds { display: flex; flex-direction: column; }
.lz-round { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.lz-round:last-child { border-bottom: 0; }
.lz-round-stage { min-width: 90px; font-weight: 600; color: var(--blue); }
.lz-round-date, .lz-round-by { color: var(--text-muted); font-size: 12px; }
.lz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lz-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px; border: 1px solid var(--border); border-radius: 99px; background: var(--bg); font-size: 12.5px; font-weight: 600; }
.lz-chip i { font-style: normal; font-weight: 500; color: var(--text-muted); font-size: 11.5px; }
.lz-chip-logo { width: 22px; height: 22px; border-radius: 50%; font-size: 11px; }
.lz-note { padding: 12px 16px; border: 1px dashed var(--border-2); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--text-muted); font-size: 13.5px; }
.lz-coverage { margin-bottom: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); }
.lz-coverage-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-bottom: 7px; }
.lz-coverage-top b { color: var(--text); font-size: 12.5px; }
.lz-sector-chip { background: var(--accent-dim) !important; color: var(--maroon) !important; border-color: transparent !important; font-weight: 600; }
.lz-meter-label { min-width: 130px; }
.lz-card-num { background: var(--accent-dim); color: inherit; width: 34px; height: 34px; font-size: 19px; line-height: 1; }

.lz-basis { margin-bottom: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); }
.lz-basis-top { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 4px; }
.lz-basis p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text); }
.lz-deal-snippet { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.4; color: var(--text); margin-top: 2px; }
.lz-deal-match { grid-column: 1 / -1; margin-top: 4px; }
.lz-deal-match .lz-meter-label { min-width: 70px; }
.lz-deal-match .lz-terms { margin-top: 5px; }

.lz-orbit { position: relative; width: 100%; max-width: 780px; aspect-ratio: 1.25 / 1; margin: 6px auto 22px; }
.lz-orbit-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.lz-orbit-lines line { stroke: var(--border-2); stroke-width: 1.5; }
.lz-orbit-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; padding: 6px; border-radius: 22px; background: var(--surface); box-shadow: 0 6px 22px rgba(20,21,46,.18); }
.lz-orbit-core-logo { width: 78px; height: 78px; border-radius: 16px; font-size: 34px; display: block; object-fit: contain; }
.lz-orbit-fund { position: absolute; transform: translate(-50%, -50%); z-index: 1; line-height: 0; padding: 4px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 8px rgba(20,21,46,.16); }
.lz-orbit-fund-logo { width: 30px; height: 30px; border-radius: 50%; font-size: 14px; object-fit: contain; }
.lz-orbit-node { position: absolute; transform: translate(-50%, 0); z-index: 3; display: flex; flex-direction: column; align-items: center; width: 170px; margin-top: -33px; text-align: center; }
.lz-orbit-node.lz-above { flex-direction: column-reverse; margin-top: 0; transform: translate(-50%, -100%); margin-top: 33px; }
.lz-orbit-av { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; font-size: 22px; border: 3px solid var(--surface); box-shadow: 0 3px 12px rgba(20,21,46,.22); flex: none; }
.lz-orbit-label { display: flex; flex-direction: column; gap: 1px; margin: 6px 0; line-height: 1.25; }
.lz-orbit-label b { font-size: 13.5px; }
.lz-orbit-label span { font-size: 11.5px; color: var(--text-muted); }
.lz-orbit-label em { font-style: normal; font-size: 11.5px; font-weight: 700; }
.lz-orbit-label em.lz-hi { color: var(--maroon); } .lz-orbit-label em.lz-mid { color: var(--title-blue); } .lz-orbit-label em.lz-lo { color: var(--text-muted); }
@media (max-width: 720px) { .lz-orbit { display: none; } }

/* demo: Portfolio table shows each company's description, website and stage */
.portfolio-name-cell { display: inline-flex; align-items: center; gap: 10px; }
.portfolio-table .portfolio-desc { max-width: 460px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.portfolio-table td { vertical-align: middle; }
.portfolio-table td:nth-child(2) { white-space: normal; }
/* demo: on the dark ON_Discourse look the blue "A product of Build With" mark is shown in white */
html[data-brand="custom"] .sidebar-build img { filter: brightness(0) invert(1); opacity: .85; }
