/* Research Hub Central: application shell.
 * Concept: research case files on a trading desk. Each project is a dossier with a ticker tab,
 * ratings are stamped, prices and labels are typed like a terminal, research reads like a journal.
 * Flat purple and orange (no gradients, no glows, no emoji). The infographic keeps its own
 * reference colours and fonts in css/infographic.css. */

:root {
  /* colour */
  --bg: #120D18;          /* desk: deep aubergine */
  --surface: #1C1525;     /* raised areas */
  --file: #201829;        /* a case file */
  --panel: #0B0810;       /* recessed panels, inputs */
  --line: #33283F;        /* rules and borders */
  --brand: #7A4BD1;       /* purple: structure */
  --brand-dim: #3B2A57;
  --brand-soft: #C9B2F2;  /* links, secondary labels */
  --accent: #F58A2C;      /* orange: actions, stamps, emphasis */
  --accent-hover: #FFA457;
  --on-accent: #170F1F;
  --draft: #FF5C7A;       /* drafts and warnings */
  --warn: #FFC861;
  --go: #5CCB8A;          /* traffic-light green in the waiting graphic */
  --text: #F1EBF7;
  --muted: #A99CB9;
  --cream: #FFF9ED;       /* coin badge ground */
  /* type */
  --font-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;
  --font-head: var(--font-display);
  /* layout */
  --header-h: 64px;
  --chat-w: 390px;
  --chat-h: 320px;
  --shadow: 4px 4px 0 var(--brand);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  overflow-x: clip;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}
/* Faint dot grid, like ledger paper (an SVG pattern, not a gradient). */
body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Crect x='10' y='10' width='1.5' height='1.5' fill='%2333283F'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { text-wrap: balance; }
a { color: var(--brand-soft); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.muted { color: var(--muted); }
.small { font-size: 14px; }
.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex: none; }

/* Mono "typed" labels used across the site */
.label, .field-label, .data-table thead th, .chapter h4, .sub-h {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- masthead ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--panel);
  border-bottom: 3px solid var(--accent);
}
.wordmark {
  display: flex; flex-direction: column; justify-content: center;
  text-decoration: none; color: var(--text); line-height: 1;
}
.wordmark-logo { display: block; height: 44px; width: auto; }
.wordmark-main {
  font-family: var(--font-display); font-weight: 900; font-size: 30px;
  letter-spacing: 0.01em; text-transform: uppercase;
}
.wordmark-main b { color: var(--accent); font-weight: 900; }
.wordmark-sub {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted); margin-top: 3px;
}
.site-nav { display: flex; gap: 2px; }
.site-nav a {
  color: var(--muted); text-decoration: none;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 12px; border: 1px solid transparent;
}
.site-nav a:hover { color: var(--text); border-color: var(--line); }
.site-nav a.active { color: var(--accent); border-color: var(--accent); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account-name { font: 500 13px var(--font-mono); color: var(--text); letter-spacing: 0.04em; }

/* ---------- buttons, controls, tags ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 13px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); background: var(--surface);
  border: 2px solid var(--brand);
  padding: 8px 14px; cursor: pointer; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--brand);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--brand); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--brand); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--on-accent); box-shadow: 3px 3px 0 var(--brand); }
.btn-primary .icon { filter: invert(1); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-small { padding: 6px 10px; font-size: 12px; }
.btn-small .icon { width: 15px; height: 15px; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.btn-quiet:hover { color: var(--draft); border-color: var(--draft); box-shadow: none; transform: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover, .btn:active { transform: none; } }

.tool-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: 1px solid transparent; cursor: pointer;
}
.tool-btn:hover { border-color: var(--line); }
.tool-btn[aria-pressed="true"] { border-color: var(--accent); }
.tool-btn .icon { width: 18px; height: 18px; }

.seg { display: inline-flex; border: 2px solid var(--brand); }
.seg button {
  font: 500 12px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 0; padding: 7px 12px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--brand); color: #FFFFFF; }
.seg button:disabled { opacity: 0.45; cursor: not-allowed; }

.tag {
  display: inline-block; vertical-align: middle;
  font: 500 10px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 6px; border: 1px solid currentColor;
}
.tag-draft, .tag-unverified, .tag-sample { color: var(--draft); }
.tag-published, .tag-reviewed { color: var(--accent); }
.tag-provider { color: var(--brand-soft); }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--brand-soft); font: 12px var(--font-mono); letter-spacing: 0.06em;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent); }

input, textarea, select { font-family: var(--font-mono); }

/* ---------- rating stamp (the one bold flourish) ---------- */
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 74px; padding: 4px 8px 3px;
  border: 3px double var(--accent); color: var(--accent);
  transform: rotate(-5deg);
  font-family: var(--font-display); line-height: 0.9;
}
.stamp b { font-size: 34px; font-weight: 900; line-height: 1; }
.stamp small { display: block; margin-top: 3px; font: 500 9px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; }
.stamp.nr { border-color: var(--muted); color: var(--muted); }
.stamp.nr b { font-size: 22px; }

/* ---------- pages ---------- */
.page {
  max-width: 1180px; margin: 0 auto;
  padding-block: 40px 96px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Directory hero: the desk */
.desk { display: block; }
.desk-kicker { font: 500 12px var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.desk h1 {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(48px, 8vw, 104px); line-height: 0.96; letter-spacing: -0.005em;
  margin: 0;
}
.desk h1 .hl { display: inline-block; line-height: 0.8; background: var(--accent); color: var(--on-accent); padding: 0.09em 0.1em 0.05em; }
.desk h1 .ol { color: transparent; -webkit-text-stroke: 2px var(--brand-soft); }
.desk-lede { font-size: 20px; line-height: 1.5; max-width: 60ch; color: var(--muted); margin: 22px 0 0; }
.desk-lede em { color: var(--text); }

.dir-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 48px 0 18px; }
.dir-title { font: 900 28px var(--font-display); text-transform: uppercase; margin: 0; letter-spacing: 0.02em; }
.search {
  display: flex; align-items: center; gap: 10px; flex: 0 1 420px;
  padding: 0 12px; background: var(--panel); border: 2px solid var(--line);
}
.search:focus-within { border-color: var(--accent); }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: 14px var(--font-mono); padding: 11px 0; outline: none;
}

/* Case files */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 34px 22px; padding-top: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: var(--text);
  background: var(--file); border: 2px solid var(--line);
  padding: 22px 20px 16px;
  transition: border-color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}
.card:hover { border-color: var(--accent); color: var(--text); transform: translate(-2px, -2px); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
.card-tab {
  position: absolute; top: -16px; left: -2px; height: 16px;
  padding: 0 12px; background: var(--brand); color: #FFFFFF;
  font: 500 10px/16px var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase;
}
.card:hover .card-tab { background: var(--accent); color: var(--on-accent); }
.card-top { display: flex; align-items: center; gap: 14px; }
.card-top h3 {
  margin: 0; font: 800 30px/0.95 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em;
}
.card-top .card-sub { font: 13px var(--font-mono); color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.card-top .stamp { margin-left: auto; }
.card-badge, .report-badge {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: var(--cream); border: 2px solid var(--panel);
  display: flex; align-items: center; justify-content: center;
  font: 900 20px var(--font-display);
}
.card-narr { margin: 0; font-style: italic; color: var(--muted); font-size: 16px; line-height: 1.4; }
.coverage { display: flex; flex-direction: column; gap: 6px; }
.coverage-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.coverage-strip i { height: 10px; background: var(--panel); border: 1px solid var(--line); }
.coverage-strip i.on { background: var(--accent); border-color: var(--accent); }
.coverage-label { display: flex; justify-content: space-between; font: 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0;
  border-top: 1px dashed var(--line); padding-top: 12px;
}
.card-meta div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-meta dt { font: 10px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.card-meta dd { margin: 0; font: 500 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 18px; }
.card-tags:empty { display: none; }

/* Open a new file */
.request { margin-top: 72px; padding: 26px 24px; border: 2px dashed var(--brand); background: var(--surface); }
.request h2 { font: 900 30px var(--font-display); text-transform: uppercase; margin: 0 0 6px; }
.request > p { margin: 0; color: var(--muted); }
.req-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 16px; }
.req-form label { display: flex; flex-direction: column; gap: 6px; min-width: min(320px, 100%); font: 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.req-form input {
  background: var(--panel); color: var(--text); border: 2px solid var(--line);
  font: 15px var(--font-mono); padding: 10px 12px;
}
.req-form input:focus { border-color: var(--accent); outline: none; }
.req-msg { margin: 12px 0 0; font: 13px var(--font-mono); }
.cg-results { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-width: 760px; }
.cg-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--panel); border: 1px solid var(--line); }
.cg-row:hover { border-color: var(--brand); }
.cg-thumb { display: block; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--cream); overflow: hidden; }
.cg-thumb img { display: block; width: 100%; height: 100%; }
.cg-name { flex: 1; min-width: 0; font-size: 16px; }
.cg-name .muted { font: 12px var(--font-mono); }

/* Long-form pages */
.prose { max-width: 720px; }
.prose h1, .page-title {
  font: 900 clamp(40px, 6vw, 68px)/0.9 var(--font-display); text-transform: uppercase; margin: 0 0 24px;
}
.prose h2 { font: 800 26px var(--font-display); text-transform: uppercase; color: var(--accent); margin: 36px 0 8px; letter-spacing: 0.02em; }
.prose p { font-size: 18px; }

/* ---------- workspace ---------- */
body.is-workspace { overflow: hidden; }
.workspace { height: calc(100vh - var(--header-h)); display: grid; }
@supports (height: 100dvh) { .workspace { height: calc(100dvh - var(--header-h)); } }
.workspace.dock-left { grid-template-columns: var(--chat-w) 1fr; grid-template-areas: 'chat report'; }
.workspace.dock-bottom { grid-template-rows: 1fr var(--chat-h); grid-template-areas: 'report' 'chat'; }
.workspace.chat-hidden { grid-template-columns: 1fr; grid-template-rows: 1fr; grid-template-areas: 'report'; }
.workspace.chat-hidden .chat { display: none; }
.workspace.chat-expanded .chat { position: fixed; z-index: 45; top: var(--header-h); left: 0; right: 0; bottom: 0; }
/* Phones: the report and the chat stay side by side as before (drag handle to resize). When the keyboard opens, the
   workspace shrinks by the keyboard's height (--kb, set from the visible screen in app.js) so the text box stays above it. */
@media (max-width: 720px) {
  .workspace { height: calc(100vh - var(--header-h) - var(--kb, 0px)); }
  @supports (height: 100dvh) { .workspace { height: calc(100dvh - var(--header-h) - var(--kb, 0px)); } }
}
.report { grid-area: report; overflow-y: auto; min-width: 0; outline: none; }
/* Browsers ignore the locked page behind a workspace: a panel's scroll would pass through to it and move the screen. Stop the scroll at the panel's edge. */
.report, .modal-card, .fw-body { overscroll-behavior: contain; }
/* A strip or table that only scrolls sideways must not trap the wheel: over a table in the middle of a report the page stopped scrolling (Mike, 2026-11-20). Contain the sideways scroll only. */
.table-wrap, .trend-strip, .adm-tabs { overscroll-behavior-x: contain; overscroll-behavior-y: auto; }

/* ---------- chat: the research terminal ---------- */
.chat {
  grid-area: chat; min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 5px solid var(--brand);   /* the purple line the orange pill sits on (as the bottom dock and phones have) */
}
.dock-bottom .chat { border-right: 0; border-top: 5px solid var(--brand); }
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line);
}
.chat-title { display: flex; align-items: center; gap: 8px; font: 500 12px var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.chat-tools { display: flex; gap: 2px; }
.chat-note { margin: 0; padding: 8px 14px; font: 11px/1.5 var(--font-mono); color: var(--muted); border-bottom: 1px dashed var(--line); }
.research-toggle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px 0; font: 12px var(--font-mono); cursor: pointer; }
.research-toggle input { accent-color: var(--accent); }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 16px; }
.chat-empty { font-size: 17px; }
.chat-empty p { margin: 0 0 10px; }
.chat-empty .muted { font: 13px/1.6 var(--font-mono); }

.msg { max-width: 94%; font-size: 16px; line-height: 1.5; }
.msg-user { align-self: flex-end; }
.msg-user .msg-body { font: 14px/1.5 var(--font-mono); background: var(--surface); border: 1px solid var(--line); padding: 8px 12px; }
.msg-user .msg-body::before { content: '> '; color: var(--accent); }
.msg-ai { align-self: flex-start; border-left: 3px solid var(--brand); padding: 0 0 0 12px; }
.msg-status { font: 500 10px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 4px; }
.msg-status-supported { color: var(--accent); }
.msg-status-insufficient_evidence, .msg-status-stale_evidence, .msg-status-partial_evidence { color: var(--warn); }
.msg-status-conflicting_evidence { color: var(--draft); }
.msg-body { white-space: pre-wrap; }
.msg-answer p { margin: 0 0 0.7em; }
.msg-answer p:last-child { margin-bottom: 0; }
.msg-request { margin-top: 8px; padding: 8px 10px; background: var(--surface); border: 1px dashed var(--warn); font-size: 15px; }
.msg-need-help { margin-top: 8px; }
.msg-request-ask { margin-top: 6px; font: 12px var(--font-mono); color: var(--accent); }
.msg-cites, .msg-sources { margin: 8px 0 0; font: 12px/1.5 var(--font-mono); }
.msg-cites { padding-left: 18px; }
.msg-sources summary { cursor: pointer; color: var(--brand-soft); }
.msg-sources a { color: var(--text); word-break: break-word; }
.msg-update { margin-top: 8px; font: 500 12px var(--font-mono); color: var(--draft); }
.msg-meta { margin-top: 6px; font: 11px var(--font-mono); color: var(--muted); letter-spacing: 0.04em; }
.msg-pending { border-left-color: var(--line); }

/* Waiting graphic: a horizontal signal (red, amber, green) and three cars that roll off on green.
 * One 4.2s cycle: red 0-45%, amber 45-58%, green 58-92%, amber 92-100%. Flat, no glow. */
.wait { display: flex; align-items: flex-end; gap: 0; padding: 4px 0; }
.wait-light {
  display: inline-flex; gap: 5px; padding: 5px 7px;
  background: var(--panel); border: 2px solid var(--line);
}
.wait-light i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.wait-r { animation: wait-r 4.2s steps(1, end) infinite; }
.wait-a { animation: wait-a 4.2s steps(1, end) infinite; }
.wait-g { animation: wait-g 4.2s steps(1, end) infinite; }
@keyframes wait-r { 0% { background: var(--draft); } 45% { background: var(--line); } }
@keyframes wait-a { 0% { background: var(--line); } 45% { background: var(--warn); } 58% { background: var(--line); } 92% { background: var(--warn); } }
@keyframes wait-g { 0% { background: var(--line); } 58% { background: var(--go); } 92% { background: var(--line); } }
/* The road runs up to the light; cars queue at it and drive off under it on green. */
.wait-road {
  position: relative; display: inline-flex; justify-content: flex-end; gap: 7px;
  width: 140px; height: 26px; padding-right: 8px;
  align-items: flex-end; overflow: hidden;
  border-bottom: 2px dashed var(--line);
}
.wait-car {
  position: relative; flex: none; width: 24px; height: 8px; margin-bottom: 4px;
  background: var(--brand-soft); color: var(--brand-soft);
  border-radius: 2px 4px 1px 1px;
  animation: wait-drive 4.2s ease-in infinite;
}
/* cabin */
.wait-car::before {
  content: ''; position: absolute; left: 5px; bottom: 7px; width: 12px; height: 6px;
  background: currentColor; border-radius: 3px 3px 0 0;
}
/* wheels: one circle plus a hard (unblurred) copy for the second */
.wait-car::after {
  content: ''; position: absolute; left: 3px; bottom: -4px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--panel); box-shadow: 12px 0 0 var(--panel);
}
.wait-car:nth-child(2) { background: var(--accent); color: var(--accent); animation-delay: 0.1s; }
.wait-car:nth-child(1) { background: var(--brand); color: var(--brand); animation-delay: 0.2s; }
@keyframes wait-drive {
  0% { transform: translateX(-120px); opacity: 0; }
  14% { transform: translateX(0); opacity: 1; }
  58% { transform: translateX(0); opacity: 1; }
  88% { transform: translateX(150px); opacity: 1; }
  89%, 100% { transform: translateX(150px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wait-r, .wait-g, .wait-car { animation: none; }
  .wait-a { animation: none; background: var(--warn); }
}
.msg-error { border-left-color: var(--draft); }
.msg-feedback { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.feedback-form { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--surface); font-family: var(--font-mono); }
.feedback-form label { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.feedback-form input { accent-color: var(--accent); }
.feedback-form textarea { background: var(--panel); color: var(--text); border: 1px solid var(--line); font: 13px var(--font-mono); padding: 6px 8px; resize: vertical; }

.chat-compose { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.compose-row { display: flex; gap: 8px; align-items: flex-end; }
.compose-error { margin: 0; font: 12px var(--font-mono); color: var(--draft); }
.attach-btn {
  width: 46px; height: 46px; flex: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--line);
}
.attach-btn:hover { border-color: var(--accent); }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-user .file-chips { margin-top: 6px; justify-content: flex-end; }
.file-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  font: 12px var(--font-mono); color: var(--text); text-decoration: none;
  padding: 3px 8px; background: var(--panel); border: 1px solid var(--brand);
  overflow-wrap: anywhere;
}
a.file-chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-remove { background: none; border: 0; padding: 0 0 0 2px; cursor: pointer; display: inline-flex; }
.chip-remove .icon { width: 12px; height: 12px; }
.chat-compose textarea {
  flex: 1; resize: none; min-width: 0;
  background: var(--surface); color: var(--text); border: 2px solid var(--line);
  font: 14px var(--font-mono); padding: 9px 10px;
}
.chat-compose textarea:focus { border-color: var(--accent); outline: none; }
.send-btn {
  width: 46px; height: 46px; border: 2px solid var(--on-accent); cursor: pointer;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  box-shadow: 3px 3px 0 var(--brand);
}
.send-btn .icon { filter: invert(1); }
.chat-signin { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px; border-top: 1px solid var(--line); }

/* ---------- report: the dossier ---------- */
.report-head {
  padding: 22px 32px 0;
  border-bottom: 2px solid var(--line);
}
.back { display: inline-flex; align-items: center; gap: 4px; font: 12px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }
.back .icon { width: 15px; height: 15px; }
.report-title { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.report-badge { width: 64px; height: 64px; font-size: 24px; }
.report-title h1 {
  margin: 0; font: 900 clamp(40px, 5vw, 64px)/0.9 var(--font-display);
  text-transform: uppercase; color: var(--text); letter-spacing: 0;
}
.ticker {
  display: inline-block; vertical-align: middle; margin-left: 10px;
  font: 500 14px var(--font-mono); letter-spacing: 0.14em;
  color: var(--on-accent); background: var(--accent); padding: 3px 8px;
  transform: translateY(-0.6em);
}
.report-meta { margin: 8px 0 0; font: 13px var(--font-mono); color: var(--muted); letter-spacing: 0.02em; }
.sample-note { margin: 16px 0 0; padding: 9px 12px; border: 1px dashed var(--draft); font: 13px var(--font-mono); color: var(--text); }
.report-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.contrib-status { margin: 14px 0 0; padding: 9px 12px; font: 13px var(--font-mono); background: var(--panel); border-left: 4px solid var(--brand-soft); }
.contrib-status.contrib-published { border-left-color: var(--accent); }
.contrib-status.contrib-changes_requested, .contrib-status.contrib-rejected { border-left-color: var(--draft); }
.toc { display: flex; gap: 0; flex-wrap: wrap; margin-top: 20px; }
.toc a {
  font: 500 12px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 9px 12px 8px;
  border: 1px solid var(--line); border-bottom: 0; margin-right: -1px; background: var(--panel);
}
.toc a:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

.chapters { padding: 0 32px 140px; max-width: 1120px; }
.chapter { padding: 40px 0 34px; border-bottom: 1px dashed var(--line); scroll-margin-top: 12px; }
.chapter:focus { outline: none; }
.chapter h2 {
  display: flex; align-items: baseline; gap: 14px;
  font: 900 40px/0.95 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em;
  margin: 0 0 16px; color: var(--text);
}
.chapter-num {
  font: 900 64px/0.8 var(--font-display);
  color: transparent; -webkit-text-stroke: 1.5px var(--accent);
  min-width: 0.9em;
}
.chapter h4 { margin: 26px 0 8px; }
.chapter h5 { font: 600 18px var(--font-body); margin: 0 0 4px; }
.chapter p { margin: 0 0 12px; max-width: 70ch; }
.chapter ul { margin: 0 0 12px; padding-left: 22px; max-width: 70ch; }
.chapter li { margin-bottom: 4px; }
.lead { font-size: 21px; line-height: 1.45; }
.big { font: 900 56px/1 var(--font-display); margin: 0; }
.exec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.exec-grid h4 { margin-top: 10px; }

.chapter-head { display: flex; align-items: center; gap: 22px; margin-bottom: 12px; }
.chapter-head h2 { margin: 0; }
.chapter-score {
  position: relative; flex: none; width: 96px; height: 70px;
  border: 3px double var(--accent); color: var(--accent);
  font: 900 36px var(--font-display);
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-4deg);
}
.chapter-score span { position: absolute; bottom: 2px; font: 500 9px var(--font-mono); letter-spacing: 0.16em; color: var(--draft); }
.chapter-score-nr { border-color: var(--muted); color: var(--muted); font-size: 24px; }
.chapter-cols { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 34px; }
.chapter-summary { background: var(--file); border: 1px solid var(--line); padding: 6px 18px 14px; align-self: start; }
.chapter-summary ul { font-size: 16px; }
.summary-bullets li.is-draft::marker { color: var(--draft); }
.finding { padding: 12px 0 4px; border-top: 1px dashed var(--line); }
.finding:first-of-type { border-top: 0; }
.finding.is-draft { border-left: 3px solid var(--draft); padding-left: 14px; }
.cites { white-space: nowrap; }
.cite { font: 12px var(--font-mono); text-decoration: none; margin-left: 2px; }
.changelog { font: 13px/1.6 var(--font-mono); color: var(--muted); }
.chapter-has-draft > .chapter-head h2::after {
  content: 'DRAFT CHANGES'; align-self: center;
  font: 500 10px var(--font-mono); letter-spacing: 0.14em; color: var(--draft);
  border: 1px solid var(--draft); padding: 2px 6px;
}
.chapter-updated { animation: chapter-mark 2.4s steps(1, end) 1; }
@keyframes chapter-mark { 0% { box-shadow: inset 6px 0 0 var(--draft); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .chapter-updated { animation: none; } }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font: 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.data-table tbody th { font-weight: 500; white-space: nowrap; color: var(--muted); }
.coin-table { max-width: 560px; border-top: 2px solid var(--line); }
.coin-table th { width: 50%; }
.coin-table td { font-size: 16px; color: var(--text); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 16px; }
.kv dt { font: 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); align-self: center; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.gap { background: var(--file); border: 1px solid var(--line); border-left: 4px solid var(--warn); padding: 12px 14px; margin-bottom: 10px; }
.gap-closed { border-left-color: var(--accent); }
.gap h5 { font-size: 17px; }
.gap p { margin: 0; font-size: 15px; }
.sources li { margin-bottom: 10px; }
.src-url, a.src-url { font: 12px var(--font-mono); color: var(--muted); word-break: break-all; }
.attribution { font: 12px var(--font-mono); color: var(--muted); margin-top: 14px; letter-spacing: 0.04em; }
.empty-research { margin-top: 20px; padding: 14px 16px; background: var(--file); border: 1px dashed var(--brand-soft); font-size: 17px; }

/* ---------- floating infographic window ---------- */
.fw { position: fixed; z-index: 60; background: var(--panel); border: 2px solid var(--brand); box-shadow: 6px 6px 0 var(--on-accent); }
.fw-bar {
  height: 38px; display: flex; align-items: center; gap: 6px;
  padding: 0 4px 0 6px; background: var(--panel); border-bottom: 2px solid var(--brand);
  cursor: grab; user-select: none; touch-action: none;
}
.fw-dragging .fw-bar { cursor: grabbing; }
.fw-pinned .fw-bar, .fw-expanded .fw-bar, .fw-narrow .fw-bar { cursor: default; }
.fw-grip { width: 16px; height: 16px; }
.fw-pinned .fw-grip, .fw-expanded .fw-grip { opacity: 0.25; }
.fw-title { font: 500 12px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fw-status { font: 500 9px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; padding: 1px 5px; border: 1px solid currentColor; white-space: nowrap; }
.fw-status-draft { color: var(--draft); }
.fw-status-pub { color: var(--accent); }
.fw-tools { margin-left: auto; display: flex; }
.fw-btn { width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; cursor: pointer; }
.fw-btn:hover { border-color: var(--line); }
.fw-btn .icon { width: 16px; height: 16px; }
.fw-pin-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--brand-dim); }
.fw-close-btn { display: none; }
.fw-expanded .fw-close-btn { display: flex; }
.fw-expanded [data-act="pin"], .fw-expanded [data-act="minimize"], .fw-expanded [data-act="expand"], .fw-expanded .fw-resize { display: none; }
.fw-narrow [data-act="pin"], .fw-narrow .fw-resize { display: none; }
.fw-body { overflow: hidden; }
.fw-scaler { overflow: hidden; position: relative; }
.fw-ig { position: absolute; top: 0; left: 0; }
.fw-resize { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none; }
.fw-resize .icon { width: 22px; height: 22px; }
.fw-pinned .fw-resize { display: none; }
.fw-pinmenu { position: absolute; top: 38px; right: 64px; z-index: 2; display: flex; flex-direction: column; min-width: 160px; background: var(--panel); border: 2px solid var(--brand); }
.fw-pinmenu button { text-align: left; background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--line); font: 12px var(--font-mono); letter-spacing: 0.06em; padding: 9px 12px; cursor: pointer; }
.fw-pinmenu button:hover, .fw-pinmenu button:focus-visible { background: var(--accent); color: var(--on-accent); outline: none; }
.fw-unpin { color: var(--draft) !important; }
.fw:not(.fw-pinned) .fw-unpin { display: none; }
.fw-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(8, 5, 12, 0.78); }
.fw-expanded { z-index: 70; }
/* phones (Mike, 2026-11-06): no floating infographic pill (it repeated the logo and name); the report shows the rating beside a
   "View & share infographic" button instead, and the full-screen infographic labels its Share button */
.rating-chip, .ig-open { display: none; }
.fw-btn-label { display: none; }
@media (max-width: 720px) {
  .fw-pill { display: none !important; }
  .report-bar [data-act="share"] { display: none; }
  .rating-chip:not([hidden]) { display: inline-flex; }
  .ig-open:not([hidden]) { display: inline-flex; }
  .fw-expanded .fw-share-btn { width: auto; padding: 0 12px; gap: 6px; border: 1px solid var(--accent); border-radius: 999px; }
  .fw-expanded .fw-btn-label { display: inline; font: 600 13px var(--font-mono); }
}
.rating-chip {
  align-items: baseline; gap: 4px; padding: 4px 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--text);
}
.rating-chip b { font: 700 20px/1 var(--font-display); }
.rating-chip small { font: 12px var(--font-mono); color: var(--muted); }
.rating-chip.rc-good b { color: var(--go); }
.rating-chip.rc-mid b { color: var(--warn); }
.rating-chip.rc-low b { color: var(--draft); }
.rating-chip:focus-visible, .ig-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fw-pill {
  position: fixed; z-index: 60; display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; background: var(--panel); color: var(--text);
  border: 2px solid var(--brand); cursor: pointer; box-shadow: 4px 4px 0 var(--on-accent);
  font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
}
.fw-pill-badge { width: 30px; height: 30px; border-radius: 50%; background: var(--cream); display: flex; align-items: center; justify-content: center; font: 900 13px var(--font-display); }
.fw-pill-score { background: var(--accent); color: var(--on-accent); padding: 1px 6px; }
.fw-pill-dot { width: 10px; height: 10px; background: var(--draft); }
.fw-pill-docked { left: 12px; right: 12px; top: calc(var(--header-h) + 8px); justify-content: flex-start; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(8, 5, 12, 0.8); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: min(980px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 2px solid var(--brand); box-shadow: 8px 8px 0 var(--on-accent); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--panel); border-bottom: 2px solid var(--brand); }
.modal-head h2 { margin: 0; font: 900 28px var(--font-display); text-transform: uppercase; color: var(--text); }
.share-body { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 22px; padding: 20px; }
.share-preview { background: var(--panel); aspect-ratio: 1230 / 1536; max-width: 100%; display: flex; align-items: center; justify-content: center; }
.share-preview img { width: 100%; height: auto; display: block; }
.share-status { color: var(--muted); font: 13px var(--font-mono); padding: 16px; text-align: center; }
.share-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.share-warn { margin: 0; color: var(--draft); font: 13px var(--font-mono); }
#share-caption { width: 100%; resize: vertical; background: var(--panel); color: var(--text); border: 2px solid var(--line); font: 13px/1.5 var(--font-mono); padding: 10px; }
#share-caption:focus { border-color: var(--accent); outline: none; }
.share-count { font: 12px var(--font-mono); }
.share-count.over { color: var(--draft); }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share-msg { margin: 0; min-height: 22px; font: 13px var(--font-mono); color: var(--accent); }
.share-capture-host { position: absolute; left: -12000px; top: 0; width: 1230px; height: 1536px; pointer-events: none; }

.auth-card { width: min(440px, 100%); }
.auth-form { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font: 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.auth-form input { background: var(--panel); color: var(--text); border: 2px solid var(--line); font: 15px var(--font-mono); padding: 10px 12px; text-transform: none; letter-spacing: 0; }
.auth-form input:focus { border-color: var(--accent); outline: none; }
.auth-form p { margin: 0; }
.auth-form .btn { justify-content: center; }
.auth-error { color: var(--draft); font: 13px var(--font-mono); min-height: 20px; }

/* ---------- admin ---------- */
.admin section { margin-top: 40px; }
.admin h2 { font: 900 32px var(--font-display); text-transform: uppercase; color: var(--text); margin: 0 0 10px; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 2px; }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat { background: var(--file); border: 1px solid var(--line); padding: 12px 18px; min-width: 190px; display: flex; flex-direction: column; }
.stat span { font: 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat b { font: 900 40px var(--font-display); color: var(--accent); }
.stat small { font: 12px var(--font-mono); color: var(--muted); }
.role-select { background: var(--panel); color: var(--text); border: 1px solid var(--line); font: 12px var(--font-mono); padding: 4px 6px; }
.role-select:focus { border-color: var(--accent); outline: none; }
.sub-h { margin: 26px 0 10px; }
.lesson-card, .feedback-card { background: var(--file); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.feedback-card p { margin: 0; }
.lesson-form { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }

/* contributions and review */
.contrib-card { width: min(780px, 100%); }
.contrib-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.contrib-form p { margin: 0; }
.contrib-form h4 { margin: 8px 0 0; font: 500 12px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.contrib-form textarea, .review-note { width: 100%; resize: vertical; background: var(--panel); color: var(--text); border: 2px solid var(--line); font: 13px var(--font-mono); padding: 8px 10px; }
.contrib-form textarea:focus, .review-note:focus { border-color: var(--accent); outline: none; }
.contrib-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--file); border: 1px solid var(--line); border-left: 4px solid var(--brand); cursor: pointer; }
.contrib-item input { margin-top: 5px; accent-color: var(--accent); flex: none; }
.contrib-item > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.contrib-item .tag { align-self: flex-start; }
.contrib-text { font-size: 15px; }
.contrib-sources { margin: 2px 0 0; padding-left: 18px; font: 12px var(--font-mono); }
.contrib-sources a { word-break: break-word; }
.review-card { background: var(--surface); border: 2px solid var(--line); padding: 16px 18px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.review-card p { margin: 0; }
.review-head a { color: var(--text); font: 800 22px var(--font-display); text-transform: uppercase; text-decoration: none; }
.review-warn { padding: 7px 10px; border: 1px dashed var(--warn); font: 13px var(--font-mono); }

/* coin logos */
.has-logo { overflow: hidden; }
.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }   /* sized per logo by DDC.logoFit */
/* Every coin icon sits under the same glass bubble as the infographic coin (Resources/BubbleOverlay.png, cropped to the ball). */
.card-badge, .report-badge, .fw-pill-badge, .cg-thumb, .trend-icon { position: relative; }
.card-badge::after, .report-badge::after, .fw-pill-badge::after, .cg-thumb::after, .trend-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: url("../assets/brand/coin-bubble.png?v=2") center / 100% 100% no-repeat;
}

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
  :root { --chat-w: 330px; }
  .chapter-cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --chat-h: 46vh; --header-h: 58px; }
  body { font-size: 16px; }
  .site-header { gap: 10px; }
  .wordmark-main { font-size: 19px; white-space: nowrap; }
  .wordmark-logo { height: 34px; }
  .wordmark-sub { display: none; }
  .site-nav a { padding: 6px 7px; font-size: 11px; letter-spacing: 0.06em; }
  .account-name, .account .tag, .account [data-auth="register"] { display: none; }
  .account .btn { padding: 5px 8px; font-size: 11px; box-shadow: 2px 2px 0 var(--brand); }
  .workspace.dock-left, .workspace.dock-bottom { grid-template-columns: 1fr; grid-template-rows: 1fr var(--chat-h); grid-template-areas: 'report' 'chat'; }
  .workspace.chat-hidden { grid-template-rows: 1fr; }
  .dock-left .chat { border-right: 0; border-top: 5px solid var(--brand); }
  .chat-tools [data-dock="left"], .chat-tools [data-dock="bottom"] { display: none; }
  .report-head { padding: 16px 16px 0; }
  .chapters { padding: 0 16px 120px; }
  .chapter h2 { font-size: 30px; }
  .chapter-num { font-size: 46px; }
  .cards { grid-template-columns: 1fr; }
  .share-body { grid-template-columns: 1fr; }
  .share-preview { max-width: 260px; margin: 0 auto; width: 100%; }
}

/* community research labels */
.msg-published { color: var(--go); }

/* admin model switcher in the chat */
.model-pick { display: flex; align-items: center; gap: 8px; padding: 8px 14px 0; font: 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.model-pick select { background: var(--panel); color: var(--text); border: 1px solid var(--line); font: 12px var(--font-mono); padding: 4px 6px; text-transform: none; letter-spacing: 0; }
.model-pick select:focus { border-color: var(--accent); outline: none; }
/* while findings are added: pinned to the top of the report wherever the reader has scrolled */
.report-wait { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Drawn infinity mark for a supply with no maximum. */
.uncapped { vertical-align: -0.1em; }

/* ---------- browse page ---------- */
.br-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin: 18px 0 10px; }
.br-field { display: flex; flex-direction: column; gap: 4px; font: 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.br-field select { background: var(--panel); color: var(--text); border: 2px solid var(--line); padding: 9px 10px; font: 14px var(--font-mono); text-transform: none; letter-spacing: 0; }
.br-field select:focus { border-color: var(--accent); outline: none; }
.br-check { display: flex; align-items: center; gap: 8px; font: 13px var(--font-mono); color: var(--muted); padding-bottom: 10px; }
.br-check input { accent-color: var(--accent); }
.br-list { display: flex; flex-direction: column; border-top: 2px solid var(--line); }
.br-item {
  display: grid; grid-template-columns: 44px minmax(140px, 1.2fr) minmax(0, 1.6fr) repeat(4, minmax(84px, 0.6fr)) 84px;
  align-items: center; gap: 16px; padding: 14px 6px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none;
}
.br-item:hover, .br-item:focus-visible { background: var(--surface); }
.br-item .br-badge { width: 44px; height: 44px; font-size: 16px; }
.br-name { display: flex; flex-direction: column; min-width: 0; }
.br-name b { font: 800 20px var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.br-name .muted { font: 12px var(--font-mono); }
.br-narr { font-style: italic; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-num { display: flex; flex-direction: column; font: 14px var(--font-mono); }
.br-num small { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.br-score { justify-self: end; min-width: 64px; }
.br-score b { font-size: 26px; }
@media (max-width: 900px) {
  .br-item { grid-template-columns: 44px minmax(0, 1fr) auto; row-gap: 8px; }
  .br-narr { grid-column: 2 / 4; grid-row: 2; white-space: normal; }
  .br-num { display: none; }
  .br-score { grid-column: 3; grid-row: 1; }
}

/* ---------- footer ---------- */
/* Pages fill the screen so the footer sits at the bottom even when a page is short. */
#app { min-height: calc(100vh - var(--header-h)); }
.site-footer { background: var(--panel); border-top: 2px solid var(--line); }
body.is-workspace .site-footer { display: none; }
.foot-inner {
  max-width: 1180px; margin: 0 auto;
  padding-block: 44px 28px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-col h2 { font: 800 16px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.foot-col a { color: var(--brand-soft); text-decoration: none; font: 14px var(--font-mono); }
.foot-col a:hover, .foot-col a:focus-visible { color: var(--accent); text-decoration: underline; }
.foot-social ul { flex-direction: row; gap: 12px; }
.foot-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 2px solid var(--line); }
.foot-icon img { width: 22px; height: 22px; }
.foot-icon:hover, .foot-icon:focus-visible { border-color: var(--accent); }
.foot-base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.foot-base p { margin: 0; font: 12px var(--font-mono); color: var(--muted); }
.foot-img { display: block; height: 40px; width: auto; max-width: 100%; opacity: 0.7; }
.foot-img-link:hover .foot-img, .foot-img-link:focus-visible .foot-img { opacity: 1; }
@media (max-width: 700px) { .foot-cols { grid-template-columns: minmax(0, 1fr); gap: 26px; } }

/* footer editor (admin) */
.footer-editor fieldset { border: 2px solid var(--line); padding: 14px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.footer-editor legend { font: 800 14px var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); padding: 0 6px; }
.footer-editor label { display: flex; flex-direction: column; gap: 4px; font: 12px var(--font-mono); color: var(--muted); }
.footer-editor input:not([type=file]) { background: var(--panel); color: var(--text); border: 2px solid var(--line); padding: 8px; font: 13px var(--font-mono); min-width: 0; }
.footer-editor input:focus { border-color: var(--accent); outline: none; }
.fe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fe-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; align-items: center; }
.fe-links { display: flex; flex-direction: column; gap: 6px; }
.fe-net { display: flex; align-items: center; gap: 8px; color: var(--text); }
.fe-net img { width: 18px; height: 18px; }
.fe-image { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; background: var(--panel); }
.fe-image label.btn { flex-direction: row; color: var(--text); font: 600 13px var(--font-ui); }
.fe-actions { display: flex; align-items: center; gap: 12px; }
@media (max-width: 1000px) { .fe-grid { grid-template-columns: minmax(0, 1fr); } .fe-row { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
 * Refined style (October 2026). Keeps the layout, the purple and orange palette and the home-page
 * headline (kicker, headline and lede keep their original fonts). Everything else moves to one clean
 * sans-serif, soft rounded surfaces with hairline borders, calm grey supporting text and quiet buttons:
 * no offset shadows, tilted stamps, dashed boxes or uppercase typewriter labels.
 * ===================================================================== */
:root {
  --font-ui: 'Inter Tight', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-code: 'IBM Plex Mono', Consolas, 'Courier New', monospace;
  --font-body: var(--font-ui);
  --font-mono: var(--font-ui);
  --r: 16px;
  --r-sm: 10px;
  --hair: #2A2133;
  --surface-2: #241C2E;
  --shadow: none;
}
html, body { font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body { background-image: none; }
.data-table, .card-meta dd, .br-num, .card-sub, .stat b, .coin-table td { font-variant-numeric: tabular-nums; }

/* the home-page headline block stays exactly as it was */
.desk-kicker { font-family: var(--font-code); }
.desk-lede { font-family: var(--font-serif); }

/* labels: sentence case, calm grey */
.label, .field-label, .data-table thead th, .chapter h4, .sub-h,
.coverage-label, .card-meta dt, .kv dt, .stat span, .br-num small, .br-field, .req-form label, .auth-form label,
.model-pick, .chat-title, .msg-status, .back, .toc a, .tag, .fw-title, .fw-status, .fw-pill, .contrib-form h4 {
  text-transform: none; letter-spacing: 0;
}
.label, .field-label, .data-table thead th, .chapter h4, .sub-h { font-size: 13px; font-weight: 600; color: var(--muted); }
.coverage-label, .card-meta dt, .kv dt, .stat span, .br-num small { font-size: 12px; color: var(--muted); }

/* header */
.site-header { background: var(--panel); border-bottom: 1px solid var(--hair); gap: 24px; }
.site-nav { gap: 4px; }
.site-nav a { font: 500 14px var(--font-ui); text-transform: none; letter-spacing: 0; padding: 7px 12px; border: 0; border-radius: 8px; }
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a.active { color: var(--text); background: var(--surface-2); }
.account-name { font: 500 14px var(--font-ui); letter-spacing: 0; }

/* buttons and controls */
.btn {
  font: 600 14px var(--font-ui); text-transform: none; letter-spacing: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  padding: 8px 14px; box-shadow: none; text-decoration: none; transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { transform: none; box-shadow: none; background: var(--surface-2); border-color: var(--brand-dim); }
.btn:active { transform: none; box-shadow: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-quiet:hover { background: transparent; border-color: var(--draft); }
.tool-btn, .fw-btn { border-radius: 8px; }
.tool-btn:hover, .fw-btn:hover { background: var(--surface); border-color: transparent; }
.seg { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { font: 500 13px var(--font-ui); text-transform: none; letter-spacing: 0; }
.tag { font: 600 11px var(--font-ui); padding: 2px 8px; border-radius: 999px; }
.link-btn { font: 13px var(--font-ui); letter-spacing: 0; }
input, textarea, select { font-family: var(--font-ui); }
.search, .req-form input, .auth-form input, .br-field select, .footer-editor input:not([type=file]), .chat-compose textarea,
#share-caption, .feedback-form textarea, .contrib-form textarea, .review-note, .role-select, .model-pick select {
  border-width: 1px; border-radius: var(--r-sm); font-family: var(--font-ui);
}
.search { background: var(--surface); }
.search input { font: 15px var(--font-ui); }

/* rating: a quiet badge instead of a tilted stamp */
.stamp {
  transform: none; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  min-width: 64px; padding: 6px 10px 5px; line-height: 1;
}
.stamp b { font: 700 26px var(--font-ui); letter-spacing: -0.02em; }
.stamp small { font: 500 11px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--muted); margin-top: 3px; }
.stamp.nr b { font-size: 20px; }
.chapter-score { transform: none; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font: 700 32px var(--font-ui); }
.chapter-score span { font: 500 11px var(--font-ui); letter-spacing: 0; }

/* section titles */
.dir-tools { margin: 64px 0 20px; }
.dir-title { font: 600 26px var(--font-ui); text-transform: none; letter-spacing: -0.02em; }

/* deep dive cards */
.cards { gap: 18px; padding-top: 0; }
.card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r);
  padding: 20px; gap: 14px; transition: border-color 0.15s ease, background 0.15s ease;
}
.card:hover { transform: none; box-shadow: none; border-color: var(--brand-dim); background: var(--file); }
.card-tab { position: static; height: auto; padding: 0; background: none; color: var(--muted); font: 500 12px var(--font-ui); letter-spacing: 0; text-transform: none; }
.card:hover .card-tab { background: none; color: var(--muted); }
.card-top h3 { font: 600 22px/1.15 var(--font-ui); text-transform: none; letter-spacing: -0.02em; }
.card-top .card-sub { font: 14px var(--font-ui); }
.card-badge, .report-badge { border: 0; }
.card-narr { font: 14px/1.5 var(--font-ui); font-style: normal; }
.coverage-strip { gap: 3px; }
.coverage-strip i { height: 6px; border: 0; border-radius: 3px; background: var(--surface-2); }
.coverage-strip i.on { background: var(--accent); }
.card-meta { border-top: 1px solid var(--hair); }
.card-meta dd { font: 500 14px var(--font-ui); }

/* start a new deep dive */
.request { border: 1px solid var(--hair); border-radius: var(--r); background: var(--surface); padding: 28px; }
.request h2 { font: 600 24px var(--font-ui); text-transform: none; letter-spacing: -0.02em; }
.req-form label { font: 500 13px var(--font-ui); }
.req-form input { font: 15px var(--font-ui); background: var(--panel); }
.req-msg { font: 14px var(--font-ui); }
.cg-row { border-radius: var(--r-sm); }
.cg-name .muted { font: 13px var(--font-ui); }

/* long-form pages */
.prose h2 { font: 600 22px var(--font-ui); text-transform: none; letter-spacing: -0.01em; color: var(--text); }
.prose p { font-size: 17px; }

/* report */
.report-head { border-bottom: 1px solid var(--hair); }
.back { font: 500 13px var(--font-ui); }
.report-meta, .changelog, .attribution, .src-url, a.src-url, .cite { font-family: var(--font-ui); }
.report-meta { font-size: 14px; }
.ticker { font: 600 13px var(--font-ui); letter-spacing: 0; border-radius: 6px; }
.toc { gap: 6px; }
.toc a { font: 500 13px var(--font-ui); border: 1px solid var(--hair); border-radius: 999px; margin: 0; padding: 6px 12px; background: transparent; }
.toc a:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.chapter { border-bottom: 1px solid var(--hair); }
.chapter h5 { font: 600 16px var(--font-ui); }
.lead { font-size: 19px; }
.chapter-summary, .gap, .empty-research, .lesson-card, .feedback-card, .contrib-item, .review-card, .stat { border-radius: 12px; border-color: var(--hair); }
.chapter-summary { background: var(--surface); }
.finding { border-top: 1px solid var(--hair); }
.data-table { font: 14px var(--font-ui); }
.data-table th, .data-table td { border-bottom: 1px solid var(--hair); }
.coin-table { border-top: 1px solid var(--hair); }
.sample-note, .contrib-status, .review-warn, .msg-request, .empty-research { border-style: solid; border-radius: var(--r-sm); }

/* chat */
.chat { border-right: 5px solid var(--brand); }   /* the purple line the orange handle pill sits on (Mike, 2026-11-11; the bottom dock and phones already had it) */
.chat-head { border-bottom: 1px solid var(--hair); }
.chat-title { font: 600 14px var(--font-ui); color: var(--text); }
.chat-note { font: 13px/1.5 var(--font-ui); border-bottom: 1px solid var(--hair); }
.chat-empty .muted { font: 14px/1.6 var(--font-ui); }
.msg { font-size: 15px; }
.msg-user .msg-body { font: 15px/1.5 var(--font-ui); border-radius: 12px 12px 4px 12px; border-color: var(--hair); }
.msg-user .msg-body::before { content: none; }
.msg-ai { border-left-width: 2px; }
.msg-status { font: 600 12px var(--font-ui); }
.attach-btn, .send-btn { border-radius: var(--r-sm); border-width: 1px; box-shadow: none; }
.file-chip { border-radius: 999px; font: 12px var(--font-ui); }
.wait-light { border-width: 1px; border-radius: 999px; }
.wait-road { border-bottom-style: solid; border-bottom-width: 1px; }

/* floating infographic window, menus and dialogs */
.fw { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: none; }
.fw-bar { border-bottom: 1px solid var(--hair); }
.fw-title { font: 600 13px var(--font-ui); }
.fw-status { font: 600 10px var(--font-ui); border-radius: 999px; padding: 1px 7px; }
.fw-pinmenu { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fw-pinmenu button { font: 14px var(--font-ui); letter-spacing: 0; }
.fw-pill { border: 1px solid var(--line); border-radius: 999px; box-shadow: none; font: 600 13px var(--font-ui); }
.fw-pill-score { border-radius: 999px; padding: 1px 8px; }
.modal-card { border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
.modal-head { border-bottom: 1px solid var(--hair); border-radius: var(--r) var(--r) 0 0; }
.modal-head h2 { font: 600 22px var(--font-ui); text-transform: none; letter-spacing: -0.02em; }

/* admin */
.admin h2 { font: 600 24px var(--font-ui); text-transform: none; letter-spacing: -0.02em; border-bottom: 0; padding-bottom: 0; }
.stat b { font: 700 34px var(--font-ui); letter-spacing: -0.02em; }
.stat small { font: 13px var(--font-ui); }
.lesson-card, .feedback-card, .contrib-item { border-left-width: 1px; }
.review-head a { font: 600 20px var(--font-ui); text-transform: none; }

/* browse page */
.br-field { font: 500 13px var(--font-ui); }
.br-field select { font: 14px var(--font-ui); background: var(--surface); }
.br-check { font: 14px var(--font-ui); }
.br-list { border-top: 1px solid var(--hair); }
.br-item { border-bottom: 1px solid var(--hair); padding: 14px 10px; }
.br-item:hover, .br-item:focus-visible { background: var(--surface); border-radius: 12px; }
.br-name b { font: 600 17px var(--font-ui); text-transform: none; letter-spacing: -0.01em; }
.br-name .muted { font: 13px var(--font-ui); }
.br-narr { font: 14px var(--font-ui); font-style: normal; }
.br-num { font: 500 14px var(--font-ui); }
.br-score b { font-size: 22px; }

/* footer */
.site-footer { border-top: 1px solid var(--hair); }
.foot-col h2 { font: 600 14px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--text); }
.foot-col a { font: 14px var(--font-ui); color: var(--muted); }
.foot-col a:hover, .foot-col a:focus-visible { color: var(--text); text-decoration: none; }
.foot-icon { border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--surface); }
.foot-icon:hover, .foot-icon:focus-visible { border-color: var(--line); background: var(--surface-2); }
.foot-base { border-top: 1px solid var(--hair); }
.foot-base p { font: 13px var(--font-ui); }
.footer-editor fieldset { border: 1px solid var(--hair); border-radius: 12px; }
.footer-editor legend { font: 600 14px var(--font-ui); letter-spacing: 0; text-transform: none; color: var(--text); }
.footer-editor label { font: 13px var(--font-ui); }
.fe-image { border-radius: var(--r-sm); }

@media (max-width: 720px) {
  .site-nav a { padding: 6px 8px; font-size: 13px; }
  .account .btn { box-shadow: none; padding: 6px 9px; font-size: 13px; }
}
@media (max-width: 420px) {
  .site-header { gap: 6px; }
  .wordmark-logo { height: 28px; }
  .site-nav a { padding: 6px 5px; }
}

/* valuation scenario in a narrow report (phones, or a tablet with the chat beside it): label and value on one line,
   the note below, so the table never scrolls sideways. Long unbroken words wrap instead of running off the edge. */
.report { overflow-wrap: break-word; }
.scenario-wrap { container: scenario / inline-size; }
@container scenario (max-width: 540px) {
  .scenario-table, .scenario-table tbody { display: block; }
  .scenario-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
  .scenario-table th, .scenario-table td { padding: 0; border: 0; }
  .scenario-table tbody th { white-space: normal; }
  .scenario-table td:first-of-type { text-align: right; }
  .scenario-table td + td { grid-column: 1 / -1; margin-top: 4px; font-size: 13px; color: var(--muted); text-align: left; }
}

/* first load while the site is starting */
.loading-page { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 120px; }

/* ---------- admin: tabs and panels ---------- */
.adm-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.adm-top .page-title { margin-bottom: 8px; }
.adm-status { margin: 0; font-size: 15px; }
.adm-tabs {
  display: flex; gap: 4px; margin: 20px 0 24px; padding: 4px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 12px;
  overflow-x: auto; scrollbar-width: none;
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 8px 14px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font: 500 14px var(--font-ui); color: var(--muted);
}
.adm-tab:hover { color: var(--text); background: var(--surface); }
.adm-tab[aria-selected="true"] { color: var(--text); background: var(--surface-2); }
.adm-badge { min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 12px/18px var(--font-ui); text-align: center; }
.adm-badge-quiet { background: var(--line); color: var(--text); }
.admin .adm-pane section, .adm-panel {
  margin: 0 0 18px; padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r);
}
.admin .adm-pane section h2 { font: 600 20px var(--font-ui); letter-spacing: -0.01em; margin: 0 0 6px; }
.adm-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 12px; }
.adm-panel-head h2 { margin: 0 !important; }
.adm-count { font: 600 13px var(--font-ui); color: var(--muted); }
.adm-tools { margin-left: auto; display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; }
.adm-tools .adm-search { flex: 0 0 240px; }
.adm-search { flex: 0 1 260px; }
.adm-search input { padding: 8px 0; font-size: 14px; }
.adm-filter { display: flex; align-items: center; gap: 8px; font: 500 13px var(--font-ui); color: var(--muted); }
.adm-filter select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 14px var(--font-ui); padding: 7px 8px; }
.adm-filter select:focus { border-color: var(--accent); outline: none; }
.adm-filter input[type="checkbox"] { accent-color: var(--accent); }
.cg-id { font: 12px var(--font-mono); color: var(--muted); }
.adm-mono { font-family: var(--font-mono); text-transform: none; }
.admin .review-card { background: var(--panel); }
@media (max-width: 720px) {
  .adm-tools { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .adm-tools .adm-search { flex: 1 1 100%; }
  .adm-search { flex: 1 1 100%; }
}

/* ---------- rating gauges (js/gauge.js) ----------
 * Bright scale on a dark instrument; depth comes from flat layers (shadow, bevel, lit and shaded needle). */
:root {
  --g-1: #FF3D6E;        /* scale: hot red */
  --g-2: #FF8A1F;        /* orange */
  --g-3: #FFD23F;        /* yellow */
  --g-4: #B6F23A;        /* lime */
  --g-5: #2EF0A0;        /* bright green */
  --g-housing: #3A2D4A;
  --g-bevel-hi: #6B5785;
  --g-bevel-lo: #1A1322;
  --g-face: #0D0A12;
}
.gauge { display: block; flex: none; overflow: visible; }
.gauge-sm { width: 112px; height: 78px; }
.gauge-lg { width: 190px; height: 133px; }
.g-drop { fill: #000; opacity: 0.5; }
.g-housing { fill: var(--g-housing); }
.g-bevel-hi { fill: none; stroke: var(--g-bevel-hi); stroke-width: 2.2; stroke-linecap: round; }
.g-bevel-lo { fill: none; stroke: var(--g-bevel-lo); stroke-width: 2.2; }
.g-face { fill: var(--g-face); }
.g-track { fill: none; stroke: var(--g-bevel-lo); stroke-width: 11; }
.g-seg { fill: none; stroke-width: 9; opacity: 0.16; transition: opacity 0.35s ease; transition-delay: var(--d, 0ms); }
.gauge-on .g-seg.g-lit { opacity: 1; }
.g-tick { stroke: var(--muted); stroke-width: 1.1; opacity: 0.7; }
.g-label { fill: var(--muted); font: 600 7px var(--font-ui); text-anchor: middle; }
.g-q { fill: var(--muted); font: 700 18px var(--font-ui); text-anchor: middle; }
.g-needle, .g-needle-shadow {
  transform-box: view-box; transform-origin: 60px 62px; transform: rotate(0deg);
  transition: transform 1.3s cubic-bezier(0.22, 1.35, 0.4, 1);
}
.g-needle-shadow { fill: #000; opacity: 0.45; transform: translate(1.5px, 2.5px) rotate(0deg); }
.g-needle-lit { fill: #FFFFFF; }
.g-needle-shade { fill: #C9BEDA; }
.g-hub { fill: var(--g-bevel-lo); stroke: var(--g-bevel-hi); stroke-width: 1.4; }
.g-hub-cap { fill: var(--accent); }
.g-hub-shine { fill: #FFFFFF; opacity: 0.85; }
.g-glass { fill: #FFFFFF; opacity: 0.07; pointer-events: none; }
.gauge-nr .g-hub-cap { fill: var(--line); }
@media (prefers-reduced-motion: reduce) {
  .g-needle, .g-needle-shadow, .g-seg { transition: none; }
}
.chapter-head { flex-wrap: wrap; gap: 14px 18px; }
.overall-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.overall-row .big { margin: 0; }

/* ---------- home hero graphic: the research engine ----------
 * A rendered still (orb and research inputs), road-track ribbons drawn in SVG that wave slowly around
 * the orb, and a separate floating card in the deep dive infographic style. Sizes scale with the graphic. */
.desk { position: relative; }
.desk > div:first-child { position: relative; z-index: 1; }
.hero-engine {
  position: absolute; z-index: 0; pointer-events: none; container-type: inline-size;
  top: -56px; right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); width: 58%; max-width: 780px;
  transform: translateX(14%);
}
.he-scene { position: relative; animation: he-float 14s ease-in-out infinite; }
.he-scene img { display: block; width: 100%; height: auto; }
.he-scene .he-orb, .he-roads { position: absolute; inset: 0; width: 100%; height: 100%; }
/* far halves of the roads pass behind this cut-out of the orb (a little larger than the orb, so they
 * disappear with a small gap instead of touching its rim); near halves pass in front of it */
.he-scene .he-orb { clip-path: circle(10.6% at 33.95% 51.4%); }
/* the social media page: its own layer, opposite the blockchain cluster across the orb */
.he-scene .he-social { position: absolute; left: 48.75%; top: 35.3%; width: 14.5%; height: auto; animation: he-bob 9s ease-in-out infinite; }
@keyframes he-bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-1.2%) rotate(-1.5deg); } }
.he-track {
  transform-box: view-box; transform-origin: 611px 694px; transform: rotate(var(--a));
  animation: he-wave 16s ease-in-out infinite;
}
.he-asphalt { fill: none; stroke: #2E2A36; stroke-width: 44; }
.he-edge { fill: none; stroke: #EDE7DC; stroke-width: 3.2; opacity: 0.9; }
.he-lane { fill: none; stroke: #F4EFE6; stroke-width: 3.6; stroke-dasharray: 22 18; animation: he-lane 7s linear infinite; }
@keyframes he-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes he-wave {
  0%, 100% { transform: rotate(var(--a)) scaleY(1); }
  50% { transform: rotate(calc(var(--a) + 12deg)) scaleY(0.78); }
}
@keyframes he-lane { to { stroke-dashoffset: -400; } }

}
@media (max-width: 900px) {
  .hero-engine { position: relative; top: 0; right: auto; width: 100%; margin: -2% 0 -4%; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .he-scene, .he-track, .he-lane, .he-scene .he-social { animation: none; }
}

/* infographic window: template switch (administrators only) */
.fw-tpl {
  flex: none; height: 26px; padding: 0 9px; margin-right: 4px; cursor: pointer;
  font: 600 12px var(--font-ui); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.fw-tpl:hover, .fw-tpl:focus-visible { border-color: var(--accent); }

/* ---------- resizable split between chat and report ---------- */
.workspace { position: relative; }
.ws-split {
  position: absolute; z-index: 5; top: 0; bottom: 0; left: var(--chat-w); width: 12px; margin-left: -6px;
  cursor: col-resize; touch-action: none; background: transparent;
}
/* The handle is always visible, as on phones (Mike, 2026-11-11): the chat's purple line with the orange pill in the middle of it */
.ws-split::after {
  content: ''; position: absolute; top: 50%; bottom: auto; left: 0; width: 8px; height: 64px; margin-top: -32px;
  background: var(--accent); border-radius: 4px; transition: filter 0.12s ease;
}
.ws-split:hover::after, .ws-split:focus-visible::after, .ws-resizing .ws-split::after { filter: brightness(1.15); }
.ws-split:focus-visible { outline: none; }
.ws-split-h {
  top: auto; left: 0; right: 0; bottom: var(--chat-h); width: auto; height: 12px; margin: 0 0 -6px;
  cursor: row-resize;
}
.ws-split-h::after { top: 4px; bottom: auto; left: 50%; right: auto; width: 64px; height: 8px; margin: 0 0 0 -32px; }
.workspace.chat-hidden .ws-split, .workspace.chat-expanded .ws-split { display: none; }
/* while dragging, keep text from being selected and frames from swallowing the pointer */
.ws-resizing { user-select: none; cursor: col-resize; }
.ws-resizing .chat, .ws-resizing .report { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .ws-split::after { transition: none; } }
/* touch screens (Mike, 2026-11-06: "dragging the size handle sometimes doesn't work, it's too thin"): the grabbable band is 40px tall and sits above the chat, and a visible grip shows where to hold */
@media (pointer: coarse), (max-width: 720px) {
  .ws-split { width: 34px; margin-left: -17px; }
  .ws-split::after { left: 14px; width: 8px; border-radius: 4px; background: var(--accent); opacity: 1; }
  /* the band is 20px above the chat's top edge and 8px into it; the grip is drawn ON the purple line (the chat's top border), in the same purple, not floating in the report */
  .ws-split-h { width: auto; height: 28px; margin: 0 0 -8px; }
  .ws-split-h::after { top: 18px; left: 50%; right: auto; width: 64px; height: 8px; margin-left: -32px; border-radius: 4px; }
  .ws-split:hover::after, .ws-split:focus-visible::after, .ws-resizing .ws-split::after { background: var(--accent); filter: brightness(1.15); opacity: 1; }
}

/* infographic window: the bar never makes the window wider than the infographic */
.fw-bar { min-width: 0; overflow: hidden; }
.fw-tools { flex: none; }
.fw-compact .fw-status, .fw-compact .fw-grip { display: none; }
.fw-compact .fw-btn { width: 26px; }
.fw-compact .fw-tpl { padding: 0 6px; font-size: 11px; }
.fw-tiny .fw-title { display: none; }
.fw-tiny .fw-btn { width: 24px; }
.fw-tiny .fw-btn .icon { width: 14px; height: 14px; }

/* No deep dive matched a search: offer to start one */
.dir-empty { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.dir-empty p { margin: 0; }

/* The minimised infographic can be dragged anywhere */
.fw-pill { touch-action: none; user-select: none; }
.fw-pill-dragging { cursor: grabbing; }

/* ---------- validation of research: keep, edit or reject each finding ---------- */
.vcards { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.vcards-intro { margin: 0; font: 13px var(--font-ui); color: var(--muted); }
.vcards-intro b { color: var(--text); }
.vcards-also { margin: 6px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font: 13px var(--font-ui); color: var(--muted); }
.vcards-also b { color: var(--text); }
.vbtn-add { border-color: var(--go); }
.vcard { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--r-sm, 6px); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vcard.is-keep, .vcard.is-decided.is-keep { border-left-color: var(--go); }
.vcard.is-edit, .vcard.is-decided.is-edit { border-left-color: var(--accent); }
.vcard.is-reject, .vcard.is-decided.is-reject { border-left-color: var(--draft); }
.vcard.is-decided.is-reject .vcard-view { opacity: 0.6; }
.vcard.is-move, .vcard.is-decided.is-move { border-left-color: var(--go); }
.vcard-top { display: flex; flex-wrap: wrap; gap: 6px; }
.vcard-view p.vcard-dup, .vcard-view p.vcard-q { font: 13px var(--font-ui); color: var(--draft); }
.vcard-view p.vcard-replaced, p.vcard-replaced { font: 13px var(--font-ui); color: var(--draft); border-left: 3px solid var(--draft); padding-left: 8px; margin: 6px 0; }
.vcard-src .tag { margin-left: 4px; }
.vcard-view b { font: 600 15px var(--font-ui); }
.vcard-view p { margin: 4px 0 0; font-size: 15px; line-height: 1.45; }
.vcard-src { margin: 6px 0 0; padding-left: 18px; font: 12px var(--font-ui); }
.vcard-src a { word-break: break-word; }
.vcard-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.vbtn { font: 600 13px var(--font-ui); padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.vbtn:hover { border-color: var(--brand-soft); }
.vbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vbtn[data-v="keep"][aria-pressed="true"] { background: var(--go); border-color: var(--go); color: var(--on-accent); }
.vbtn[data-v="edit"][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vbtn[data-v="reject"][aria-pressed="true"] { background: var(--draft); border-color: var(--draft); color: var(--on-accent); }
.vcard-edit { display: flex; flex-direction: column; gap: 6px; }
.vcard-edit .field-label { display: flex; flex-direction: column; gap: 3px; font: 12px var(--font-ui); color: var(--muted); }
.vcard-edit input, .vcard-edit textarea { font: 14px var(--font-ui); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; width: 100%; box-sizing: border-box; }
.vcard-edit input:focus, .vcard-edit textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.vcard-reject { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vcard-reject.vcard-need { outline: 1px dashed var(--draft); outline-offset: 4px; }
.vchip { display: inline-flex; align-items: center; gap: 4px; font: 12px var(--font-ui); padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.vchip:has(input:checked) { border-color: var(--draft); color: var(--draft); }
.vcard-done { margin: 0; font: 13px var(--font-ui); color: var(--muted); }
.vcard-done-keep, .vcard-done-edit { color: var(--text); }
.vcards-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.vcards-foot .auth-error { flex-basis: 100%; margin: 0; }
.review-card .vcards { margin-top: 4px; }
.review-attn { border-color: var(--draft); }

/* ---------- reader validation of member research ---------- */
.vote-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font: 12px var(--font-ui); }
.vote-by { color: var(--muted); }
.vote-btns { display: inline-flex; gap: 6px; margin-left: auto; }
.vote-btn { font: 600 12px var(--font-ui); padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.vote-btn:hover:not(:disabled) { border-color: var(--brand-soft); }
.vote-btn:disabled { opacity: 0.5; cursor: default; }
.vote-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.vote-btn-main { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vote-btn-main[aria-pressed="true"] { background: var(--surface); color: var(--accent); }
.vote-n { font-weight: 500; opacity: 0.8; margin-left: 2px; }
.vote-reasons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.vchip-btn { font: 12px var(--font-ui); padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; }
.vchip-btn:hover { border-color: var(--draft); color: var(--draft); }
.vote-msg { flex-basis: 100%; }
.vote-msg:empty { display: none; }
.vote-needs { border-top-color: var(--accent); }

/* ---------- research checklist per category ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font: 14px var(--font-ui); }
.checklist li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ck-state { font: 600 11px var(--font-ui); padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); min-width: 62px; text-align: center; }
.ck-done .ck-state { color: var(--go); border-color: var(--go); }
.ck-missing .ck-state { color: var(--warn); border-color: var(--warn); }
.gap-asks { display: flex; flex-wrap: wrap; gap: 6px; }

/* Home page toolbar: title, browse button and search in three equal, evenly spaced columns of the same height */
.dir-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 24px; }
.dir-tools > * { min-width: 0; }
.dir-tools .dir-title { justify-self: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dir-tools .btn { justify-self: stretch; height: 48px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.dir-tools .search { flex: none; width: 100%; height: 48px; box-sizing: border-box; }
@media (max-width: 760px) { .dir-tools { grid-template-columns: 1fr; gap: 12px; } }
.dir-more { display: flex; justify-content: center; margin-top: 22px; }
.tag-trending { color: var(--accent); border-color: var(--accent); }

/* Trending now: the market's most searched coins (no logos), scrolling sideways inside its own strip */
.trend-now { margin: 56px 0 0; display: flex; flex-direction: column; gap: 14px; }
.trend-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; }
.trend-head p { margin: 0; }
.trend-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.trend-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm, 8px); min-width: 0; }
.trend-rank { font: 600 12px var(--font-ui); color: var(--muted); }
.trend-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trend-name b { font: 600 16px var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-name .muted { font: 12px var(--font-ui); }
.trend-price { font: 14px var(--font-ui); font-variant-numeric: tabular-nums; }
.trend-chg.up { color: var(--go); }
.trend-chg.down { color: var(--draft); }
.trend-tile .btn { margin-top: auto; justify-content: center; }
.trend-msg:empty { display: none; }
.trend-now + .dir-tools { margin-top: 40px; }
.trend-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.trend-top .trend-name { flex: 1; }
.trend-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--cream); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font: 800 14px var(--font-ui); }
.trend-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.trend-top .trend-rank { align-self: flex-start; }

/* Page content written by the server for search engines that do not run JavaScript; the app draws the page instead */
.js .prerender { display: none; }
.prerender { max-width: 860px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-left, 0px)); }

/* ---------- Buy now buttons (deep dive header) and the Exchanges admin tab ---------- */
.buy-box { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--surface); }
.buy-box[hidden] { display: none; }
.buy-label { margin: 0 0 10px; font: 600 13px var(--font-ui); color: var(--muted); }
.buy-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.buy-list li { min-width: 0; }
.buy-btn {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; box-sizing: border-box;
  padding: 8px 14px; min-height: 44px; border: 2px solid var(--accent); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text); font: 600 14px var(--font-ui); text-decoration: none;
}
/* Mike, 2026-11-06: the exchange call to action is a quiet dark red button, not the orange action colour */
.buy-box { border-color: #5a1a24; }
.buy-btn { background: #3a0f17; border-color: #8c1d2f; color: #f3dfe2; }
.buy-btn:hover, .buy-btn:focus-visible { background: #8c1d2f; border-color: #b3283d; color: #fff; text-decoration: none; }
.buy-btn:focus-visible { outline: 2px solid #b3283d; outline-offset: 2px; }
.buy-btn img { height: 24px; width: auto; max-width: 72px; object-fit: contain; border-radius: 4px; flex: none; }
.buy-btn span { min-width: 0; overflow-wrap: anywhere; }
.buy-note { margin: 10px 0 0; font: 12px/1.5 var(--font-ui); color: var(--muted); }
/* phones (Mike, 2026-11-07: "very wide with blank space on the right"): smaller buttons, two to a row */
@media (max-width: 520px) {
  .buy-box { padding: 12px; }
  .buy-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .buy-list li { width: auto; }
  .buy-btn { width: 100%; min-height: 38px; padding: 6px 8px; gap: 6px; justify-content: center; font-size: 13px; text-align: center; }
  .buy-btn img { height: 20px; max-width: 40px; }
}
.ex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ex-grid .ex-wide { grid-column: 1 / -1; }
.footer-editor label.ex-check { flex-direction: row; align-items: center; gap: 8px; align-self: end; color: var(--text); }
.ex-logo { max-height: 40px; max-width: 120px; object-fit: contain; background: var(--bg); padding: 4px; }
.ex-list { display: flex; flex-direction: column; gap: 4px; }
.ex-state-listed { color: var(--text); font-weight: 600; }
.ex-state-not_listed, .ex-state-unknown, .ex-state-stale, .ex-state-no_coin { color: var(--muted); }
.ex-override { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 220px; }
.ex-override select, .ex-override input { background: var(--panel); color: var(--text); border: 1px solid var(--line); padding: 6px; font: 13px var(--font-ui); min-width: 0; max-width: 100%; }
.ex-override [hidden] { display: none; }
@media (max-width: 700px) { .ex-grid { grid-template-columns: minmax(0, 1fr); } }

/* Announcement banner above the header (page editor, Site-wide) and pictures on editable pages. */
.site-banner { padding: 10px 16px; text-align: center; font-size: 15px; line-height: 1.4; }
.site-banner a { color: inherit; text-decoration: underline; }
.site-banner-notice { background: var(--accent); color: var(--on-accent); }
.site-banner-info { background: var(--brand); color: var(--text); }
.page-img { display: block; max-width: 100%; height: auto; margin: 0 0 16px; }

/* Gap lifecycle: limitations (no public source), closed gaps, and the chat bar for the gap being worked on */
.gap-limit { border-left-color: var(--brand); }
.gap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gaps-closed { margin: 10px 0; }
.gaps-closed summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.gap-target { margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--file); font-size: 14px; }

/* deep dive videos (js/video.js): the coin's video and its playlist, a picture with a play button until pressed (Mike, 2026-11-07) */
.video-box { margin-top: 18px; }
.video-box[hidden] { display: none; }
.vid-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.vid { margin: 0; min-width: 0; }
.vid iframe, .vid-play { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--hair); border-radius: var(--r-sm); background: #000; }
.vid-play { position: relative; padding: 0; cursor: pointer; overflow: hidden; }
.vid-play img, .vid-blank { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.88; transition: opacity 0.15s; }
.vid-blank { background: linear-gradient(135deg, #1b1230, #3a0f17); }
.vid-play:hover img, .vid-play:focus-visible img { opacity: 1; }
.vid-icon { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: #8c1d2f; border: 2px solid #f3dfe2; }
.vid-icon::after { content: ''; position: absolute; left: 22px; top: 16px; border-left: 18px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.vid-play:focus-visible { outline: 2px solid #b3283d; outline-offset: 2px; }
.vid figcaption { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; font: 13px/1.4 var(--font-ui); color: var(--muted); }
.vid figcaption b { font-weight: 600; color: var(--text); font-size: 14px; }

/* Still needed: categories that need research, waiting answers, recommended items (open reports only) */
.still-needed { margin-bottom: 18px; }
.needs { background: var(--file); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 12px 14px; }
.needs h3 { margin: 0 0 6px; }
.needs h4 { margin: 12px 0 6px; font-size: 15px; }
.needs-summary { margin: 0 0 8px; }
.needs-cats, .needs-items { list-style: none; margin: 0; padding: 0; }
.needs-cat, .needs-item { padding: 8px 0; border-top: 1px solid var(--line); }
.needs-cat:first-child, .needs-item:first-child { border-top: 0; }
.needs-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.needs-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 0; }
.needs-wait { display: block; margin-top: 4px; color: var(--accent); font-size: 14px; }
.needs-preview { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.needs-item p { margin: 4px 0; font-size: 15px; }
.needs-compact { padding: 8px 10px; margin: 8px 0; font-size: 14px; }
.needs-compact h3 { font-size: 15px; }
.card-needs { margin: 6px 0 0; font-size: 13px; color: var(--accent); }
.msg-nudge { margin-top: 8px; padding: 6px 10px; border-left: 4px solid var(--accent); font-size: 14px; }
.msg-flash { outline: 2px solid var(--accent); }
@media (max-width: 640px) { .needs-row { flex-direction: column; align-items: flex-start; } .needs-btns .btn { width: 100%; } }

/* Item 8 (HUMA test): on a phone the expanded infographic window labels Share and shows a Close button; the compact and tiny widths used to squeeze
   the labelled Share button to icon width, so its label ran over Close. Share keeps its natural width, Close keeps its own, and they never overlap. */
@media (max-width: 720px) {
  .fw-expanded .fw-tools { gap: 8px; align-items: center; }
  .fw-expanded .fw-share-btn, .fw-expanded.fw-compact .fw-share-btn, .fw-expanded.fw-tiny .fw-share-btn { width: auto; min-width: 76px; flex: none; padding: 0 10px; white-space: nowrap; }
  .fw-expanded .fw-share-btn .icon, .fw-expanded.fw-tiny .fw-share-btn .icon { width: 16px; height: 16px; }
  .fw-expanded .fw-close-btn, .fw-expanded.fw-compact .fw-close-btn, .fw-expanded.fw-tiny .fw-close-btn { flex: none; width: 34px; height: 34px; margin-left: 4px; }
  .fw-expanded .fw-status, .fw-expanded .fw-grip { display: none; }
  .fw-expanded .fw-title { display: block; flex: 1 1 0; min-width: 0; }
  .fw-expanded .fw-tpl { flex: none; }
}

/* LAYOUT RULE (Mike, 2026-11-09): nothing sticks out of its box. A button's label wraps onto the next line instead of running past the
 * edge, in the chat, the cards and the report. Long words and addresses break rather than push the box wider. tests/layout-rules.test.js
 * keeps these rules in place. */
.btn { max-width: 100%; box-sizing: border-box; }
.msg .btn, .msg-body .btn, .needs .btn, .needs-btns .btn, .card .btn, .msg-need-help { white-space: normal; text-align: left; line-height: 1.3; overflow-wrap: anywhere; }
.msg-need-help { display: flex; width: 100%; justify-content: flex-start; padding: 9px 14px; border-radius: 10px; font-weight: 600; }
.msg, .msg-body, .msg-request, .needs, .card { overflow-wrap: anywhere; min-width: 0; }

/* ---------- upgrade page (Hub Pro, paid in crypto) ---------- */
.upgrade { max-width: 760px; }
.upgrade-plans { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0; }
.upgrade-plan { flex: 1 1 240px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.upgrade-plan h2 { margin: 0 0 6px; font-size: 18px; }
.upgrade-price { margin: 0; font-size: 34px; font-weight: 700; }
.upgrade-price span { font-size: 15px; font-weight: 500; color: var(--muted); }
.upgrade-save { margin: 4px 0 14px; color: var(--accent); font-size: 14px; }
.upgrade-note, .upgrade-fine, .upgrade-history { color: var(--muted); }
.upgrade-fine { font-size: 14px; }
.upgrade-err { color: var(--dn); }

/* ---------- research meter in the chat: a picture, no numbers ---------- */
.chat-note:has(.chat-meter) { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.chat-meter-label, .chat-meter-word { flex: 0 0 auto; white-space: nowrap; }
.chat-meter { flex: 1 1 120px; min-width: 80px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.chat-meter-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.3s ease; }
.chat-meter.low .chat-meter-fill { background: var(--draft); }
.chat-meter-word a { font-weight: 600; }
.upgrade-bundle { margin: 22px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.upgrade-bundle h2 { margin: 0 0 6px; font-size: 18px; }
.upgrade-bundle ul { margin: 8px 0 14px; padding-left: 20px; }
.upgrade-bundle.has-img { display: flex; gap: 22px; align-items: center; }
.upgrade-bundle-text { flex: 1 1 55%; min-width: 0; }
.upgrade-bundle-img { flex: 1 1 45%; min-width: 0; display: block; }
.upgrade-bundle-img img { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--surface-2); }
@media (max-width: 640px) { .upgrade-bundle.has-img { flex-direction: column; align-items: stretch; } }
.msg-shared { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* Draft deep dive page (administrators only, server/drafts.js): flat coral banner, one Publish button */
.draft-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--draft); color: var(--text); }
.draft-banner .draft-msg { flex-basis: 100%; margin: 0; }
/* On a draft the PAGE scrolls, not the report box: clip (never a scroll container) and never hold back the wheel, or the page does not scroll over the text (Mike, 2026-11-20). */
.draft-page .draft-report { display: block; max-width: 100%; overflow: clip; overscroll-behavior: auto; }
@media (max-width: 640px) { .draft-banner { flex-direction: column; align-items: stretch; } .draft-banner .btn { width: 100%; } }

/* Research and improve on a draft (Mike, 2026-11-19) */
.draft-improve { margin: 0 0 22px; padding: 16px 18px; border: 1px solid var(--line); background: var(--file); }
.draft-improve h2 { margin: 0 0 6px; font-size: 20px; }
.draft-improve > p { margin: 0 0 12px; max-width: 70ch; }
.draft-improve-form { display: grid; gap: 6px; max-width: 720px; }
.draft-improve-form select, .draft-improve-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); }
.draft-improve-form textarea { resize: vertical; min-height: 76px; }
.draft-improve-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.draft-improve-msg { min-width: 0; overflow-wrap: anywhere; }
.draft-improve .linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-soft); text-decoration: underline; cursor: pointer; }
.draft-requests { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; max-width: 720px; }
.draft-request { padding: 10px 12px; border: 1px solid var(--line); }
.draft-request p { margin: 6px 0 0; overflow-wrap: anywhere; }
.draft-request-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.draft-request-summary { color: var(--muted); }
.draft-request-done { border-color: var(--brand); }
.draft-request-failed { border-color: var(--draft); }
.draft-improve h3 { margin: 18px 0 4px; font-size: 16px; }
.draft-ask { max-width: 720px; margin-bottom: 8px; }
.draft-ask-log { display: grid; gap: 8px; margin: 8px 0; }
.draft-ask-turn { padding: 8px 12px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.draft-ask-turn p { margin: 6px 0 0; }
.draft-ask-user { background: var(--panel); }
.draft-ask-answer { border-color: var(--brand); }
.draft-ask-turn .btn { margin-top: 8px; }
.draft-ask-form { display: grid; gap: 6px; }
.draft-ask-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); resize: vertical; }

/* deploy drill 2026-11-20: a harmless change used to prove the automatic rollback */
