/* ── Design tokens ───────────────────────────────────────────── */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #eef0f3;
  --border: #e6e8ea;
  --border-strong: #d8dadd;
  --divider: rgba(17, 19, 24, 0.07);
  --text: #111318;
  --text-muted: #69707a;
  --accent: #429a4e;
  --accent-hover: #3a8a45;
  --accent-deep: #2f6f39;
  --accent-soft: rgba(66, 154, 78, 0.10);
  --accent-border: rgba(66, 154, 78, 0.22);
  --radius-card: 8px;
  --radius-pill: 999px;

  /* Mono stack for eyebrow labels + tabular figures */
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* Faint cartographic graticule (echoes the homepage globe) — footer band */
  --tex-graticule: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='600' viewBox='0 0 900 600'><g fill='none' stroke='%23111318' stroke-opacity='0.05' stroke-width='1'><ellipse cx='450' cy='300' rx='300' ry='300'/><ellipse cx='450' cy='300' rx='115' ry='300'/><ellipse cx='450' cy='300' rx='225' ry='300'/><line x1='150' y1='300' x2='750' y2='300'/><path d='M150 300 Q450 150 750 300'/><path d='M150 300 Q450 90 750 300'/><path d='M150 300 Q450 450 750 300'/><path d='M150 300 Q450 510 750 300'/></g></svg>");

  --src-speech: #2563eb;
  --src-interview: #d97706;
  --src-truth_social: #dc2626;
  --src-announcement: #7c3aed;
  --src-manual: #69707a;

  /* Homepage sentiment globe */
  --globe-land: #d9dcdf;
  --globe-stroke: #1c1f23;
  --sent-pos: #429a4e; /* = --accent; literal because globe.js reads computed values */
  --sent-neg: #c0392b;
}

/* ── Pico variable overrides (custom.css loads after Pico) ───── */
/* Use both :root and [data-theme="light"] to beat Pico v2's scoped overrides */
:root,
[data-theme="light"] {
  --pico-primary: var(--accent);
  --pico-primary-hover: var(--accent-hover);
  --pico-primary-background: var(--accent);
  --pico-primary-hover-background: var(--accent-hover);
  --pico-primary-focus: var(--accent-soft);
  --pico-background-color: var(--bg);
  --pico-card-background-color: var(--surface);
  --pico-card-border-color: var(--border);
  --pico-card-sectioning-background-color: var(--surface-subtle);
  --pico-muted-border-color: var(--border);
  --pico-muted-color: var(--text-muted);
  --pico-color: var(--text);
  --pico-border-radius: 8px;
  --pico-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pico-line-height: 1.6;
}

/* ── Greenback: force all Pico primary buttons to use our accent ─ */
/* Pico v2 defines --pico-primary on [data-theme] with higher specificity than
   :root, so we override the rendered property directly on button elements.
   contrast / secondary variants are intentionally excluded. */
button:not(.contrast):not(.secondary),
[role="button"]:not(.contrast):not(.secondary):not(.nav-cta) {
  border-color: var(--accent);
}
button:not(.outline):not(.contrast):not(.secondary),
[role="button"]:not(.outline):not(.contrast):not(.secondary):not(.nav-cta) {
  background-color: var(--accent);
}
button:not(.outline):not(.contrast):not(.secondary):hover,
[role="button"]:not(.outline):not(.contrast):not(.secondary):not(.nav-cta):hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}
/* Outline buttons: transparent bg, greenback border+text */
button.outline, [role="button"].outline {
  background-color: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
button.outline:hover, [role="button"].outline:hover {
  background-color: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Faint geometric grid painted on the canvas (html bg) so it covers the WHOLE
   page behind all content. (NB: background-attachment:fixed on the root silently
   fails to composite in Chrome — keep the default scroll/repeat.) */
html {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(17, 19, 24, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 24, 0.028) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  background-repeat: repeat;
}
body { background: transparent; color: var(--text); -webkit-font-smoothing: antialiased; }

/* ── Eyebrow labels: small mono uppercase, wide tracking ─────────── */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.eyebrow.accent { color: var(--accent-deep); }

/* Align all data figures (dates, counts, tallies) as tabular */
.tnum, .quote-date, .rank-value, .rank-num, .big-num,
.pricing-card .price, .status-summary-card strong {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
/* Override Pico's default blue link color — accent for inline content links */
.prose a, .pricing-note a, .stub-note a, .auth-meta a,
.dash-quicklinks a, .profile-sidebar a { color: var(--accent); }
/* Header nav links explicitly dark, not blue */
.site-header a:not(.nav-cta) { color: var(--text); }

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  margin-bottom: 1.75rem;
}
.site-header nav { align-items: center; }
.site-header a.site-title { text-decoration: none; color: var(--text); font-size: 1.2rem; font-weight: 800; letter-spacing: -0.025em; }
.site-title .accent { color: var(--accent); }
.site-header a { font-size: 0.875rem; }

/* Quiet pill nav links: muted by default, soft fill on hover,
   accent-soft fill on the active section. Section links are separated
   by short hairline dividers. */
.site-header nav li { padding: 0 0.05rem; display: flex; align-items: center; }
.site-header li.nav-li + li.nav-li::before {
  content: "";
  width: 1px;
  height: 1.05em;
  background: var(--border-strong);
  margin: 0 0.6rem;
}
.site-header a.nav-link {
  display: inline-block;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.site-header a.nav-link:hover { background: var(--surface-subtle); color: var(--text); }
.site-header a.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.site-header a.nav-login {
  border: 1px solid var(--border-strong);
  margin: 0 0.4rem 0 0.9rem;
  font-weight: 600;
}
.site-header a.nav-login:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}
/* Log-out button, styled to match the bordered nav-login pill */
.site-header .nav-logout-form { display: inline-flex; margin: 0; }
.site-header .nav-logout-form button {
  font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  color: var(--text); background: transparent;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  padding: 0.38rem 0.75rem; transition: border-color 0.12s ease, color 0.12s ease;
}
.site-header .nav-logout-form button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) {
  .site-header { padding: 0.5rem 0.75rem; }
  .site-header nav { flex-wrap: wrap; row-gap: 0.5rem; }
  /* Logo on its own top row */
  .site-header nav ul:first-child { width: 100%; }
  /* All nav links + auth in a single horizontally-scrollable row */
  .site-header nav ul:last-child {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 0.2rem;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-header nav ul:last-child::-webkit-scrollbar { display: none; }
  .site-header nav li { flex: 0 0 auto; }
  .site-header a.nav-link { padding: 0.3rem 0.55rem; }
  /* dividers look broken when items wrap mid-row */
  .site-header li.nav-li + li.nav-li::before { content: none; }
  .site-header a.nav-login { margin-left: 0.25rem; }
}
.nav-cta {
  padding: 0.4rem 0.95rem !important;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.nav-cta:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, #f1f5f1 0%, #eaf0ea 100%);
  border-top: 1px solid var(--accent-border);
  margin-top: 4rem;
  padding: 2.5rem 0 1.75rem;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--tex-graticule);
  background-repeat: no-repeat;
  background-position: right -120px center;
  background-size: 620px auto;
  opacity: 0.7;
  pointer-events: none;
}
.site-footer > .container { position: relative; z-index: 1; }
.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 640px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
.footer-cols h4 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 0.6rem; color: var(--accent-deep); }
.footer-cols h4 .accent { color: var(--accent); }
.footer-cols a { display: block; font-size: 0.82rem; color: var(--text-muted); text-decoration: none; padding: 0.15rem 0; }
.footer-cols a:hover { color: var(--accent); }
.footer-tagline { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.footer-bottom { margin-top: 1.5rem; font-size: 0.78rem; color: var(--text-muted); }

/* ── Browse three-column layout ──────────────────────────────── */
.browse-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 248px;
  gap: 1.25rem;
  align-items: start;
}
/* Grid items default to min-width:auto and won't shrink below their content,
   which overflowed the viewport on mobile (filter inputs forcing 528px). Let
   every column shrink to its track. */
.browse-layout > * { min-width: 0; }
.browse-aside { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
@media (max-width: 1100px) {
  .browse-layout { grid-template-columns: 244px minmax(0, 1fr); }
  .browse-aside { display: none; }
}
@media (max-width: 768px) { .browse-layout { grid-template-columns: 1fr; } }

.filter-sidebar {
  position: sticky;
  top: 1rem;
  /* Scroll internally when the form is taller than the viewport, so the
     bottom controls (Sort by, buttons) aren't stuck off-screen. */
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-card-border-color);
  border-radius: var(--pico-border-radius);
  padding: 1.1rem 1rem;
}
.filter-sidebar hgroup { margin-bottom: 1rem; }
.filter-sidebar hgroup h2 { font-size: 1rem; margin-bottom: 0; }
.filter-sidebar hgroup p  { font-size: 0.8rem; color: var(--pico-muted-color); margin: 0; }
.filter-sidebar label { font-size: 0.8rem; margin-bottom: 0.2rem; }
.filter-sidebar input,
.filter-sidebar select { width: 100%; max-width: 100%; box-sizing: border-box; margin-bottom: 0.6rem; padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.filter-sidebar button,
.filter-sidebar a[role="button"] { width: 100%; margin-bottom: 0.4rem; font-size: 0.85rem; }
/* Stack From/To full-width — two date inputs side by side are too cramped
   in the 240px sidebar (native date controls have a large min-width). */
.date-range { display: grid; grid-template-columns: 1fr; gap: 0; }
.filter-sidebar input[type="date"] { width: 100%; min-width: 0; box-sizing: border-box; }

/* ── Pill filter bar (source type) ───────────────────────────── */
.pill-bar {
  display: flex; flex-wrap: nowrap; gap: 0.35rem;
  position: sticky; top: 0; z-index: 5;
  padding: 0.55rem 0; margin-bottom: 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
  scrollbar-width: none;            /* one tidy scrollable row, no visible bar */
}
.pill-bar::-webkit-scrollbar { display: none; }
.pill-filter {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--text-muted); text-decoration: none; white-space: nowrap;
  padding: 0.3rem 0.5rem; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--surface);
  flex: none;
  transition: border-color 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}
.pill-filter:hover { border-color: var(--border-strong); color: var(--text); }
.pill-filter.active {
  background: var(--accent-soft); color: var(--accent-deep);
  border-color: var(--accent-border);
}
.pill-filter .source-dot { width: 6px; height: 6px; }

/* ── Quote cards ─────────────────────────────────────────────── */
.quote-list { display: flex; flex-direction: column; gap: 0.75rem; }
.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.9rem 1.05rem;
  margin: 0;
  transition: border-color 0.12s ease;
}
.quote-card:hover { border-color: var(--accent-border); }

.quote-source {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 0.6rem;
  padding: 0.18rem 0.55rem 0.18rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.source-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--src-manual); flex: none; }
.source-dot.source-speech       { background: var(--src-speech); }
.source-dot.source-interview    { background: var(--src-interview); }
.source-dot.source-truth_social { background: var(--src-truth_social); }
.source-dot.source-announcement { background: var(--src-announcement); }
.source-label {
  font-family: var(--font-mono);
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
}

.quote-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 0; }
.quote-date, .speaker-name { font-size: 0.78rem; color: var(--text-muted); }

blockquote {
  border: none; padding: 0; margin: 0;
  font-size: 0.95rem; line-height: 1.6; color: var(--text);
}
blockquote p { margin: 0; }

.quote-actions { display: flex; gap: 1rem; margin-top: 0.6rem; font-size: 0.8rem; }
.quote-actions a { text-decoration: none; color: var(--accent); }

/* ── Tags ────────────────────────────────────────────────────── */
.tag-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.tag-pill {
  font-size: 0.72rem;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.6rem;
  text-decoration: none;
}
.tag-pill:hover { background: var(--accent-border); }

/* ── Detail view ─────────────────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 2rem;
}
@media (max-width: 640px) { .detail-layout { grid-template-columns: 1fr; } }

.full-quote p { font-size: 1rem; line-height: 1.75; margin-bottom: 1rem; }

.detail-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.detail-footer [role="button"],
.detail-footer button { font-size: 0.85rem; padding: 0.4rem 1rem; }
.danger-btn { color: #ef4444 !important; border-color: #ef4444 !important; }
.danger-btn:hover { background: #ef444422 !important; }

/* ── Admin / form ────────────────────────────────────────────── */
.form-layout { max-width: 720px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 1rem; margin-top: 1rem; }

.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
  min-height: 1.5rem;
}
.tag-suggestion {
  font-size: 0.75rem;
  background: var(--pico-secondary-background);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  cursor: pointer;
}
.tag-suggestion:hover { background: var(--pico-primary-background); }

/* ── Collector page ──────────────────────────────────────────── */
.collect-layout { display: flex; flex-direction: column; gap: 2rem; }
.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.status-success { background: var(--accent-soft); color: var(--accent-hover); }
.status-error   { background: #fdecea; color: #b42318; }
.status-running { background: #fef0e0; color: #b45309; }
.status-stale   { background: #fef0e0; color: #b45309; }
.status-never   { background: var(--surface-subtle); color: var(--text-muted); }

/* Admin collector-status dashboard */
.status-summary { display: flex; gap: 0.85rem; flex-wrap: wrap; margin: 1.25rem 0; }
.status-summary-card {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.7rem 1rem;
}
.status-summary-card strong { font-size: 1.25rem; }
.alert-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.alert-panel h2 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.alert-panel h3 { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
/* status table: visual break between country groups */
.country-group-start td { border-top: 2px solid var(--border-strong); }
.country-cell { white-space: nowrap; }
.country-cell small { line-height: 1.2; }

/* ── Admin (ops) chrome — deliberately distinct from the public site ── */
.admin-header {
  background: var(--text);
  padding: 0.55rem 1.5rem;
  margin-bottom: 1.75rem;
}
.admin-header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.admin-title {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}
.admin-title span { color: var(--accent); }
.admin-title .ops-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: 2px;
}
.admin-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.admin-nav li { list-style: none; padding: 0; margin: 0; }
.admin-nav a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
.admin-nav a.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.admin-exit {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
}
.admin-exit:hover { color: #fff; }

/* ── Flash messages ──────────────────────────────────────────── */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash-success { background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-hover); }
.flash-error   { background: #fdecea; border: 1px solid #f5c6c2; color: #b42318; }
.flash-info    { background: var(--surface-subtle); border: 1px solid var(--border-strong); color: var(--text-muted); }
.flash-info a  { color: var(--accent); font-weight: 600; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }

/* ── Section / page heads ────────────────────────────────────── */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.45rem; margin-bottom: 1rem;
}
.section-head h2 {
  margin: 0; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--accent-deep);
}
.section-head a { font-size: 0.85rem; color: var(--accent); text-decoration: none; }
.page-head { margin-bottom: 1.75rem; }
.page-head h1 { margin-bottom: 0.25rem; letter-spacing: -0.02em; }
.page-head p { color: var(--text-muted); margin: 0; }
.breadcrumb { font-size: 0.82rem; margin-bottom: 1rem; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.muted { color: var(--text-muted); font-size: 0.85rem; }
.muted-no-margin { margin: 0; }

/* ── Landing ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  text-align: center;
  padding: 4rem 1rem 2.25rem;
  isolation: isolate;
}
.hero .eyebrow { margin-bottom: 1rem; }
.hero h1 {
  font-size: clamp(2.75rem, 6vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0;
}
.hero h1 .accent-line {
  display: block;
  font-style: italic;
  font-weight: 700;
  color: var(--accent-deep);
}
.hero hgroup p { color: var(--text-muted); font-size: 1.12rem; max-width: 600px; margin: 1.1rem auto 0; line-height: 1.55; }
.hero-cta { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.75rem; flex-wrap: wrap; }
.hero-sub { color: var(--text-muted); }

/* Hero globe: centered showpiece below the title and CTAs */
.hero-globe {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 2.5rem auto 0;
}
#globe { display: block; width: 100%; max-width: 600px; aspect-ratio: 1 / 1; }
.globe-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.globe-legend-bar {
  width: 120px;
  height: 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--globe-land), var(--accent));
}
.globe-tooltip {
  position: fixed;
  z-index: 50;
  max-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(28, 31, 35, 0.08);
}
.globe-tooltip .tooltip-title { font-weight: 600; color: var(--text); }
.globe-tooltip .tooltip-sub { color: var(--text-muted); }
@media (max-width: 880px) {
  #globe { max-width: 340px; }
  .hero-globe { margin-top: 1.75rem; }
}

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 2.5rem 0; }
.features article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1.25rem; }
.features h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.features p { color: var(--text-muted); margin: 0; font-size: 0.88rem; }

.preview-strip { margin: 2.5rem 0; }
.preview-grid { display: grid; grid-template-columns: 2.4fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .preview-grid { grid-template-columns: 1fr; } }

.cta-band {
  text-align: center; padding: 3rem 1rem; margin-top: 2.5rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border); border-radius: var(--radius-card);
}
.cta-band h2 { margin-bottom: 0.4rem; }
.cta-band p { color: var(--text-muted); margin-bottom: 1.25rem; }
.cta-band a[role="button"] { margin: 0 0.25rem; }

/* .nav-cta defined in Header section above */

/* ── Pricing ─────────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 2rem 0; }
.pricing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pricing-card header h3 { margin: 0 0 0.25rem; }
.pricing-card .price { font-size: 2rem; font-weight: 700; margin: 0; }
.pricing-card .price small { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }
.pricing-card ul { list-style: none; padding: 0; margin: 0.5rem 0 1rem; font-size: 0.9rem; }
.pricing-card ul li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.pricing-card ul li:last-child { border-bottom: none; }
.pricing-card a[role="button"] { margin-top: auto; }
.pricing-note { text-align: center; color: var(--text-muted); }

/* ── Prose pages (about, legal, api docs) ────────────────────── */
.prose { max-width: 720px; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.25rem; }
.prose pre {
  background: var(--surface-subtle); border: 1px solid var(--border);
  padding: 0.75rem 1rem; border-radius: var(--pico-border-radius);
  overflow-x: auto; font-size: 0.85rem;
}
.prose code { font-size: 0.9em; }

/* ── Leaders / Topics ────────────────────────────────────────── */
.leaders-search {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem; max-width: 480px;
}
.leaders-search input { margin: 0; }

.leader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin: 1rem 0 2.5rem; }
.leader-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 0.85rem 1rem;
  text-decoration: none; display: flex; flex-direction: column; gap: 0.15rem;
  transition: border-color 0.12s ease;
}
.leader-card:hover { border-color: var(--accent); }
.leader-card strong { color: var(--text); }
.leader-card small { color: var(--text-muted); font-size: 0.78rem; }
.leader-list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
@media (max-width: 640px) { .leader-list { columns: 1; } }
.leader-list li {
  break-inside: avoid; padding: 0.35rem 0;
  display: flex; justify-content: space-between; gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.leader-list li a { text-decoration: none; }
.profile-layout { display: grid; grid-template-columns: 1fr 240px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .profile-layout { grid-template-columns: 1fr; } }
.profile-sidebar h3 { font-size: 0.95rem; margin-bottom: 0.6rem; }

.topic-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.topic-cloud .tag-pill { font-size: 0.85rem; padding: 0.25rem 0.8rem; }

/* ── Weekly semantic topics (/topics) ────────────────────────── */
.topic-week-meta {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--text-muted); margin: -1rem 0 1.5rem;
}
.topic-grid {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.topic-card {
  display: flex; flex-direction: column; gap: 0.35rem;
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 0.9rem 1rem;
  text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.topic-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(28, 31, 35, 0.06); }
.topic-rank {
  position: absolute; top: 0.7rem; right: 0.85rem;
  font-family: var(--font-mono); font-size: 0.7rem; color: #9aa0a8;
}
.topic-keywords {
  color: var(--text); font-weight: 600; font-size: 0.98rem; line-height: 1.3;
  padding-right: 1.5rem; overflow-wrap: anywhere;
}
.topic-card:hover .topic-keywords { color: var(--accent); }
.topic-stats { color: var(--text-muted); font-size: 0.8rem; }

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-card {
  max-width: 380px; margin: 3rem auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 2rem;
}
.auth-card hgroup { margin-bottom: 1.5rem; }
.auth-card hgroup h1 { margin-bottom: 0.25rem; font-size: 1.4rem; }
.auth-card hgroup p { color: var(--text-muted); margin: 0; font-size: 0.88rem; }
.auth-card form button { width: 100%; background: var(--accent); border-color: var(--accent); }
.auth-card form button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.auth-meta { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 1rem; }
.auth-meta a { color: var(--accent); }
.stub-note {
  margin-top: 1.5rem; padding: 0.6rem 0.9rem;
  background: #fef0e0; border: 1px solid #f3d9b3;
  border-radius: var(--pico-border-radius); color: #b45309; text-align: center;
}

/* ── Subscriber app pages ────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.85rem; margin-bottom: 1.75rem; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1.1rem; }
.dash-card h3 { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }
.big-num { font-size: 1.7rem; font-weight: 700; margin: 0; color: var(--text); }
.dash-card small { color: var(--text-muted); }
.dash-quicklinks ul { list-style: none; padding: 0; margin: 0; }
.dash-quicklinks li { padding: 0.45rem 0; border-bottom: 1px solid var(--border); list-style: none; }
.dash-quicklinks li::marker { display: none; content: ""; }
.dash-quicklinks li:last-child { border-bottom: none; }

/* ── Ranked-list sidebar ─────────────────────────────────────── */
.ranked-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.ranked-list h3 {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-deep);
  margin: 0 0 0.7rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--accent-border);
}
.ranked-item {
  display: flex; align-items: baseline; gap: 0.5rem;
  font-size: 0.82rem; padding: 0.3rem 0;
}
.ranked-item + .ranked-item { border-top: 1px solid var(--border); }
.ranked-item .rank-num { color: #9aa0a8; width: 1rem; flex: none; text-align: right; }
.ranked-item .rank-title {
  color: var(--text); text-decoration: none;
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.35;
}
.ranked-item .rank-title:hover { color: var(--accent); }
.ranked-item .rank-value {
  color: var(--text-muted); flex: none; margin-left: auto;
  white-space: nowrap; padding-left: 0.25rem;
}

/* ── Admin: per-collector run-history chart (status page) ─────────────── */
.collector-row { cursor: pointer; }
.collector-row .caret::before {
  content: "\25B8";           /* ▸ */
  color: var(--text-muted);
  font-size: 0.8em;
  margin-right: 4px;
}
.collector-row.expanded .caret::before { content: "\25BE"; }  /* ▾ */

.collector-history-row > td {
  background: var(--surface-subtle);
  border-top: 0;
  padding: 8px 12px;
}
.history-chart { padding: 4px 0; color: var(--text-muted); font-size: 0.85rem; }
.history-svg { display: block; max-width: 100%; }
.history-svg .bar-success { fill: var(--accent); }
.history-svg .bar-zero    { fill: var(--border); }
.history-svg .bar-error   { fill: #DC2626; /* source-type red / running grey — no token defined */ }
.history-svg .bar-running { fill: #C7CDD3; /* source-type red / running grey — no token defined */ }
.history-caption { margin-top: 6px; font-size: 0.8rem; }

