/* ========================================================================
   Make Nashville Survey Results — shared stylesheet
   Matches makenashville.org design system.
   ======================================================================== */

/* --- Design tokens ------------------------------------------------------ */
:root {
  /* Colors */
  --color-bg: #ffffff;
  --color-bg-alt: #f0f0f0;
  --color-bg-dark: #f5f5f5;
  --color-bg-footer: #151517;
  --color-text: #151517;
  --color-text-secondary: #333333;
  --color-text-muted: #666666;
  --color-text-dim: #767676;
  --color-border: #dddddd;
  --color-accent: #c8102e;
  --color-accent-hover: #a00d24;
  --color-link: #1e3385;
  --color-white: #ffffff;

  /* Typography */
  --font-heading: "Oswald", Helvetica, Arial, sans-serif;
  --font-body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  /* Layout */
  --max-width: 1200px;
  --radius: 4px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }

/* --- Headings ----------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; letter-spacing: 0.1em; color: var(--color-text-muted); }

p { margin: 0 0 var(--space-sm); }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout ------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}
section { padding: var(--space-xl) 0; }
section.alt { background: var(--color-bg-dark); }
.subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

/* --- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-text);
  color: var(--color-white);
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* --- Focus -------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Site header / nav (matches makenashville.org) ---------------------- */
.site-header {
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.site-logo img {
  height: 60px;
  width: auto;
}
.site-logo:hover { text-decoration: none; }
.nav-toggle {
  /* Always display:none — the linked <label> still toggles the checked state
     via for/id, and we don't need the checkbox itself to render. */
  display: none;
}
.nav-toggle-label {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-xs);
}
.nav-toggle-label span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  font-family: var(--font-body);
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
}
.nav-link:hover { color: var(--color-text); text-decoration: none; }
.nav-link.active {
  color: var(--color-text);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 2px;
}
.nav-status {
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 4px 10px;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .nav-toggle-label { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* --- Site footer (matches makenashville.org) --------------------------- */
.site-footer {
  background: var(--color-bg-footer);
  color: #aaa;
  padding: var(--space-lg) 0 var(--space-md);
  font-size: 0.9rem;
}
.site-footer a { color: #aaa; }
.site-footer a:hover { color: var(--color-white); }
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-lg);
  align-items: start;
}
.site-footer .footer-info p { margin: 0 0 var(--space-xs); line-height: 1.55; }
.site-footer .footer-address { color: var(--color-white); font-weight: 600; }
.site-footer .footer-openhouse { color: var(--color-text-dim); font-size: 0.85rem; }
.site-footer .footer-heading {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-white);
  margin: 0 0 var(--space-sm);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 0.4rem; }
.site-footer .footer-meta {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-text-dim);
}
.site-footer .footer-meta .methodology { max-width: 60ch; line-height: 1.55; margin: 0; }
.site-footer .footer-meta .meta-right { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }

@media (max-width: 900px) {
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; }
}
/* (footer-ghost button rules live near .btn--ghost) */

/* --- Share links -------------------------------------------------------- */
.share-links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  color: var(--color-text-dim);
}
.share-links .share-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--color-text-dim);
}
.share-links a {
  color: #ddd;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.share-links a:hover { color: #fff; border-color: #fff; }

/* --- Back-to-top button ------------------------------------------------- */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s, background 0.2s;
  z-index: 60;
}
.to-top:hover { background: var(--color-accent-hover); color: #fff; text-decoration: none; }
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- Board: executive summary + table of contents ---------------------- */
.exec-summary {
  background: linear-gradient(180deg, #fff8ec 0%, #fff 100%);
  border: 1px solid #f0d49b;
  border-left: 4px solid #b45309;
  border-radius: var(--radius);
  padding: var(--space-md);
  margin: var(--space-md) 0;
}
.exec-summary h2 {
  margin-top: 0;
  font-size: 1.5rem;
  color: #5a3a08;
}
.exec-summary .pillars,
.exec-summary .actions { padding-left: 1.25rem; }
.exec-summary .pillars li,
.exec-summary .actions li { margin-bottom: 0.4rem; line-height: 1.5; }
.toc {
  background: var(--color-bg-dark);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin: var(--space-md) 0;
}
.toc h2 {
  font-size: 1rem;
  margin: 0 0 var(--space-sm);
}
.toc-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}
.toc-list a {
  color: var(--color-text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.toc-list a:hover { color: var(--color-text); border-bottom-color: var(--color-accent); }
.toc-list .toc-board { color: #b45309; }
.toc-list .toc-board::before { content: "● "; font-size: 0.7em; }
@media (max-width: 600px) {
  .toc-list { grid-template-columns: 1fr; }
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn--primary { background: var(--color-accent); color: var(--color-white); }
.btn--primary:hover { background: var(--color-accent-hover); color: var(--color-white); }
.btn--ghost {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn--ghost:hover { background: var(--color-bg-alt); }

/* Footer-scoped override: dark footer needs light button chrome */
.site-footer .btn--ghost {
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.site-footer .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: #ffffff;
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  background: var(--color-bg);
  padding: var(--space-xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}
.hero .eyebrow {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}
.hero h1 { font-size: clamp(2.25rem, 6vw, 4rem); margin-bottom: var(--space-md); }
.hero .lede {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin-bottom: var(--space-md);
}
.hero .headline-stat {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-top: var(--space-md);
}
.hero .headline-stat-label {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-secondary);
  text-transform: none;
  letter-spacing: 0;
  margin-top: var(--space-xs);
}
.hero-ctas {
  margin-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* --- Stat tiles --------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0;
}
.stat {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  text-align: left;
}
.stat .value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--color-text);
}
.stat .unit {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-left: 0.25em;
}
.stat .label {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}
.stat.accent .value { color: var(--color-accent); }

/* --- CSS bar chart ------------------------------------------------------ */
.bar-chart {
  display: grid;
  gap: var(--space-xs);
  margin: var(--space-md) 0;
}
.bar-chart.bar-chart--roomy { gap: 14px; }
.bar-chart.bar-chart--roomy .bar-row { font-size: 1rem; }
.bar-chart.bar-chart--roomy .bar-track { height: 22px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 4fr auto;
  gap: var(--space-sm);
  align-items: center;
  font-size: 0.95rem;
}
.bar-row .bar-label { color: var(--color-text-secondary); }
.bar-row .bar-track {
  position: relative;
  height: 18px;
  background: var(--color-bg-alt);
  border-radius: 2px;
  overflow: hidden;
}
.bar-row .bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--color-accent);
  border-radius: 2px;
}

/* Rank-based color: highest value = darkest, lowest = lightest.
   Applied to every .bar-chart unless [data-no-rank] is set.
   Ranks are assigned in filter.js by sorted bar-fill width. */
.bar-row[data-rank="1"] .bar-fill { background: #7a0e1f; }
.bar-row[data-rank="2"] .bar-fill { background: #c8102e; }
.bar-row[data-rank="3"] .bar-fill { background: #ed5a3a; }
.bar-row[data-rank="4"] .bar-fill { background: #f5934e; }
.bar-row[data-rank="5"] .bar-fill { background: #fbc070; }
.bar-row[data-rank="6"] .bar-fill { background: #ffd28a; }
.bar-row[data-rank="7"] .bar-fill { background: #ffe6a8; }
.bar-row[data-rank="8"] .bar-fill { background: #ffe6a8; }

/* Orange family override for the paired social-events chart (alt-orange) */
.bar-row[data-rank="1"] .bar-fill.alt-orange { background: #b1450f; }
.bar-row[data-rank="2"] .bar-fill.alt-orange { background: #ed5a3a; }
.bar-row[data-rank="3"] .bar-fill.alt-orange { background: #f5934e; }
.bar-row[data-rank="4"] .bar-fill.alt-orange { background: #ffd28a; }
.bar-row[data-rank="5"] .bar-fill.alt-orange { background: #ffe6a8; }
.bar-row .bar-value {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 700;
}

/* --- Before/after paired bars (growth) ---------------------------------- */
.growth {
  display: grid;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}
.growth-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 3fr 3fr;
  gap: var(--space-sm);
  align-items: center;
}
.growth-row .label { color: var(--color-text-secondary); }
.growth-row .before, .growth-row .after {
  display: flex; align-items: center; gap: var(--space-xs);
  font-variant-numeric: tabular-nums;
}
.growth-row .before .bar, .growth-row .after .bar {
  height: 12px; background: var(--color-bg-alt); flex: 1; border-radius: 2px;
  position: relative; overflow: hidden;
}
.growth-row .before .bar-fill { background: var(--color-text-muted); }
.growth-row .after .bar-fill { background: var(--color-accent); }
.growth-row .bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; }

/* --- Theme mention count (board section h3 badge) --------------------- */
.theme-count {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-alt);
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 10px;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
  line-height: 1.4;
}
.theme-count--expandable {
  cursor: pointer;
  border: 1px solid rgba(122, 14, 31, 0.25);
  background: #fff;
  color: var(--color-accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease;
}
.theme-count--expandable:hover,
.theme-count--expandable:focus-visible {
  background: var(--color-accent);
  color: #fff;
  outline: none;
}
.theme-count--expandable[aria-expanded="true"] {
  background: var(--color-accent);
  color: #fff;
}
.extra-quotes {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: #fffaf2;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 4px 4px 0;
}
.extra-quotes-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--color-accent);
  margin: 0 0 var(--space-sm);
}
.extra-quotes .pull-quote {
  margin: var(--space-sm) 0;
  font-size: 1rem;
}

/* --- Detractor voices (board only) ----------------------------------- */
.detractor-card {
  border: 1px solid rgba(122, 14, 31, 0.18);
  border-left: 5px solid var(--color-accent);
  border-radius: 4px;
  padding: var(--space-md);
  margin: var(--space-md) 0;
  background: #fffaf2;
}
.detractor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid rgba(122, 14, 31, 0.18);
}
.detractor-score {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--color-accent);
}
.detractor-score strong { font-size: 1.15rem; letter-spacing: 0; }
.detractor-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
}
.detractor-card .pull-quote {
  margin: 0 0 var(--space-sm);
  background: #fff;
  border-left: 3px solid var(--color-accent);
  font-size: 1.05rem;
}
.detractor-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* --- Pull quotes -------------------------------------------------------- */
.pull-quote {
  border-left: 4px solid var(--color-accent);
  padding: var(--space-md) var(--space-md);
  margin: var(--space-md) 0;
  background: var(--color-bg-alt);
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--color-text);
}
.pull-quote cite {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.85rem;
  font-style: normal;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
/* --- Theme frequency bubbles (Section 3 public) -----------------------
   Each bubble contains a multi-word cloud. Bubble area scales with the
   number of members who raised that theme in open text. */
.bubble-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg) var(--space-lg);
  margin: var(--space-md) 0 var(--space-lg);
  padding: var(--space-lg) 0;
}
.theme-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-family: var(--font-heading);
  color: var(--color-text);
  transition: transform 200ms cubic-bezier(.2,.7,.3,1);
}
.theme-bubble:hover { transform: scale(1.04) rotate(-0.5deg); }
@media (prefers-reduced-motion: reduce) {
  .theme-bubble,
  .theme-bubble .bubble-words,
  .theme-count--expandable {
    transition: none;
  }
  .theme-bubble:hover { transform: none; }
}
.theme-bubble:hover .bubble-words {
  box-shadow:
    0 18px 40px -20px rgba(122, 14, 31, 0.45),
    0 4px 16px -6px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.theme-bubble .bubble-words {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  padding: 26px;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, var(--color-bg-alt) 65%, #f0e6d2 100%);
  border: 2px solid rgba(122, 14, 31, 0.18);
  border-radius: 50%;
  aspect-ratio: 1;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow:
    0 8px 24px -12px rgba(122, 14, 31, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transition: box-shadow 220ms ease;
  position: relative;
}
.theme-bubble figcaption {
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 280px;
  font-weight: 500;
}
.theme-bubble figcaption strong {
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0;
}

/* Bubble size tiers — radius scales with sqrt(count) so area ≈ count */
.theme-bubble--xl .bubble-words {
  width: 320px;
  background: radial-gradient(circle at 30% 25%, #fffbf3 0%, #fdf2e0 55%, #f5d99a 100%);
  border-color: rgba(122, 14, 31, 0.28);
}
.theme-bubble--lg .bubble-words {
  width: 270px;
  background: radial-gradient(circle at 30% 25%, #fffaf0 0%, #ffe8c8 60%, #ffc88e 100%);
  border-color: rgba(184, 78, 9, 0.32);
}
.theme-bubble--md .bubble-words {
  width: 220px;
  background: radial-gradient(circle at 30% 25%, #fff8e8 0%, #ffe6a8 60%, #f5b870 100%);
  border-color: rgba(180, 83, 9, 0.32);
}
.theme-bubble--sm .bubble-words {
  width: 175px;
  padding: 18px;
  gap: 2px 10px;
  background: radial-gradient(circle at 30% 25%, #fff 0%, #faf0e0 70%, #f5dba8 100%);
  border-color: rgba(122, 14, 31, 0.2);
}

/* Inside-bubble word scale — smaller than free-form cloud since circular */
.theme-bubble .w {
  font-family: var(--font-heading);
  display: inline-block;
  line-height: 1.05;
  letter-spacing: -0.005em;
  color: var(--color-text);
}
.theme-bubble .w-xs { font-size: 0.8rem; opacity: 0.8; font-weight: 400; }
.theme-bubble .w-sm { font-size: 1rem; font-weight: 500; }
.theme-bubble .w-md { font-size: 1.25rem; font-weight: 600; }
.theme-bubble .w-lg { font-size: 1.6rem; font-weight: 700; }
.theme-bubble .w-xl { font-size: 2.05rem; font-weight: 700; }

/* Color tints inside bubbles */
.theme-bubble .w-pos { color: #7a0e1f; }
.theme-bubble .w-warm { color: #b45309; }
.theme-bubble .w-accent { color: #c8102e; font-style: italic; }
.theme-bubble .w-soft { color: var(--color-text-secondary); font-style: italic; opacity: 0.75; }

/* Subtle rotation for organic feel — every other XS word slightly tilted */
.theme-bubble .w-soft { transform: rotate(-3deg); }
.theme-bubble .w-accent { transform: rotate(2deg); }

/* Smaller bubbles → smaller words */
.theme-bubble--md .w-xl { font-size: 1.55rem; }
.theme-bubble--md .w-lg { font-size: 1.3rem; }
.theme-bubble--md .w-md { font-size: 1.05rem; }
.theme-bubble--sm .w-xl { font-size: 1.3rem; }
.theme-bubble--sm .w-lg { font-size: 1.1rem; }
.theme-bubble--sm .w-md { font-size: 0.95rem; }
.theme-bubble--sm .w-sm { font-size: 0.85rem; }
.theme-bubble--sm .w-xs { font-size: 0.75rem; }

@media (max-width: 720px) {
  .theme-bubble--xl .bubble-words { width: 260px; padding: 20px; }
  .theme-bubble--xl .w-xl { font-size: 1.6rem; }
  .theme-bubble--xl .w-lg { font-size: 1.35rem; }
  .theme-bubble--lg .bubble-words { width: 220px; padding: 18px; }
  .theme-bubble--lg .w-xl { font-size: 1.45rem; }
  .theme-bubble--md .bubble-words { width: 185px; padding: 16px; }
  .theme-bubble--md .w-lg { font-size: 1.1rem; }
  .theme-bubble--sm .bubble-words { width: 150px; padding: 14px; }
  .theme-bubble--sm .w-lg { font-size: 0.95rem; }
}
.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* --- Request cards ------------------------------------------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0;
}
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
}
.card .card-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}
.card h3 { margin-bottom: var(--space-xs); font-size: 1.1rem; }
.card .card-body { font-size: 0.95rem; color: var(--color-text-secondary); margin-bottom: var(--space-sm); }
.card blockquote {
  margin: 0 0 var(--space-sm);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-text);
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-sm);
}
.card .response {
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.card .response strong { color: var(--color-text); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; }

/* --- Shop table --------------------------------------------------------- */
.shop-table-wrap { overflow-x: auto; }
.shop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: var(--space-md) 0;
}
.shop-table th, .shop-table td {
  text-align: left;
  padding: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.shop-table thead th {
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  background: var(--color-bg-dark);
  cursor: pointer;
  user-select: none;
}
.shop-table thead th[aria-sort] { position: relative; padding-right: 1.5em; }
.shop-table thead th[aria-sort="ascending"]::after { content: " ▲"; position: absolute; right: 0.5em; color: var(--color-accent); }
.shop-table thead th[aria-sort="descending"]::after { content: " ▼"; position: absolute; right: 0.5em; color: var(--color-accent); }
.shop-table tbody td.num { font-variant-numeric: tabular-nums; }
.shop-table .score {
  display: inline-block; min-width: 2.5em; padding: 2px 6px; border-radius: 3px;
  font-weight: 600; font-variant-numeric: tabular-nums; text-align: center;
}
.shop-table .score.high { background: #e7f5e8; color: #1c6b22; }
.shop-table .score.mid { background: #fef3c7; color: #8a5b00; }
.shop-table .score.low { background: #fde2e4; color: #9b1c1c; }

/* --- Demographics grid -------------------------------------------------- */
.demos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-md) 0;
}
.demo h4 { margin-bottom: var(--space-sm); font-size: 0.85rem; color: var(--color-text-muted); }
.demo--wide { grid-column: 1 / -1; }

/* --- Shared viz helpers -------------------------------------------------- */
.viz-heading {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text);
  margin: var(--space-lg) 0 var(--space-xs);
}
.viz-heading:first-of-type { margin-top: var(--space-md); }
.viz-caption {
  margin: 0 0 var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Compact full-ranking line under viz */
.rank-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-md);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-dark);
  border-radius: 4px;
  border-left: 4px solid var(--color-text-muted);
}
.rank-detail .rank-label {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-right: var(--space-xs);
}
.rank-detail .rank-item { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-detail .rank-item strong { font-weight: 600; color: var(--color-text); }

/* --- Hero stat: radial gauge ------------------------------------------- */
.hero-stat {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.4fr;
  gap: var(--space-lg);
  align-items: center;
  margin: var(--space-md) 0;
}
.gauge {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: block;
}
.gauge-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: var(--space-xs);
}
.hero-stat .stats { margin: 0; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.hero-stat .stat { padding: var(--space-sm) var(--space-md); }
.hero-stat .stat .value { font-size: 2rem; }
.hero-stat .stat .label { font-size: 0.72rem; }
@media (max-width: 760px) {
  .hero-stat { grid-template-columns: 1fr; gap: var(--space-md); }
  .hero-stat .stats { grid-template-columns: 1fr 1fr; }
}

/* --- Donut chart (comms first-place) ----------------------------------- */
.donut-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: var(--space-lg);
  align-items: center;
  margin: var(--space-md) 0;
}
.donut {
  width: 100%;
  max-width: 320px;
  display: block;
  margin: 0 auto;
}
.donut-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.donut-legend li {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--color-border);
}
.donut-legend li:last-child { border-bottom: 0; }
.donut-legend .swatch {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.08);
}
.donut-legend .name {
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
  color: var(--color-text);
}
.donut-legend .firsts {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.donut-legend .pct {
  font-family: var(--font-heading);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  min-width: 3.2em;
  text-align: right;
}
@media (max-width: 760px) {
  .donut-layout { grid-template-columns: 1fr; gap: var(--space-md); }
}

/* --- Sankey diagram (growth) ------------------------------------------- */
.sankey {
  width: 100%;
  max-width: 880px;
  margin: var(--space-md) auto 0;
  display: block;
}
.sankey text { font-family: var(--font-body); }
.sankey .axis-head {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  fill: var(--color-text);
}
.sankey .block-label {
  font-size: 13px;
  fill: var(--color-text);
}
.sankey .block-label .count {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
}
.sankey .ribbon { transition: fill-opacity 0.2s; }
.sankey .ribbon:hover { fill-opacity: 0.85; }
.sankey .block { stroke: rgba(255,255,255,0.4); stroke-width: 0.5; }
.sankey-caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 auto;
  max-width: 60ch;
}

/* --- Histogram (vertical bars, e.g. hours per month) ------------------- */
.histogram {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 110px;
  margin: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
}
.histogram .hist-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.histogram .hist-col .hist-bar { min-height: 2px; }
.histogram .hist-bar {
  width: 100%;
  background: var(--color-accent);
  border-radius: 2px 2px 0 0;
  transition: filter 0.2s;
}
.histogram .hist-col:hover .hist-bar { filter: brightness(1.05); }
.histogram .hist-count {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text);
}
.hist-axis {
  display: flex;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.hist-axis .hist-tick {
  flex: 1;
  min-width: 0;
}

/* --- Paired-bar comparison (class vs social blockers) ------------------ */
.paired-chart { margin: var(--space-md) 0; }
.paired-legend {
  display: flex;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}
.paired-legend .lk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.paired-legend .swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
}
.paired-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) 3fr;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}
.paired-label { color: var(--color-text-secondary); }
.paired-bars { display: grid; gap: 4px; }
.paired-bar {
  height: 16px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.paired-bar.cl { background: var(--color-accent); }
.paired-bar.sc { background: #f5934e; color: #1a1a1a; }
.paired-bar.zero { background: transparent; color: var(--color-text-dim); padding-left: 0; font-weight: 400; font-style: italic; }

/* --- Split bar charts (class vs social blockers, side by side) --------- */
.split-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin: var(--space-md) 0;
}
.split-charts .chart-col h4 {
  margin: 0 0 var(--space-sm);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.split-charts .chart-col .bar-chart { margin-top: 0; }
.split-charts .scale-note {
  font-size: 0.72rem;
  color: var(--color-text-dim);
  margin-top: var(--space-xs);
  font-style: italic;
}
.split-charts .bar-fill.alt-orange { background: #f5934e; }
@media (max-width: 760px) {
  .split-charts { grid-template-columns: 1fr; gap: var(--space-md); }
}

/* --- Visit-time heatmap (time-of-day × day-of-week) -------------------- */
.visit-grid {
  display: grid;
  grid-template-columns: minmax(96px, auto) repeat(7, 1fr);
  gap: 2px;
  font-size: 0.85rem;
  margin: var(--space-sm) 0 var(--space-xs);
}
.visit-grid .vg-head, .visit-grid .vg-row-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 4px;
}
.visit-grid .vg-head { text-align: center; }
.visit-grid .vg-row-label { text-align: right; align-self: center; padding-right: 8px; }
.visit-grid .vg-cell {
  text-align: center;
  padding: 10px 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  border-radius: 3px;
  transition: filter 0.2s;
}
.visit-grid .vg-cell:hover { filter: brightness(1.05); }
.visit-grid .vg-cell.l0 { background: #f6f3ee; color: var(--color-text-dim); }
.visit-grid .vg-cell.l1 { background: #fef3c7; color: #5a4400; }
.visit-grid .vg-cell.l2 { background: #ffd28a; color: #5a3a08; }
.visit-grid .vg-cell.l3 { background: #f5934e; color: #4a1f00; }
.visit-grid .vg-cell.l4 { background: #ed5a3a; color: #fff; }
.visit-grid .vg-cell.l5 { background: #c8102e; color: #fff; }
.visit-grid .vg-cell.l6 { background: #7a0e1f; color: #fff; }
.visit-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}
.visit-legend .lg-swatch { display: inline-block; width: 22px; height: 10px; border-radius: 2px; }

/* --- Tenure curve line chart ------------------------------------------- */
.tenure-curve { width: 100%; height: auto; display: block; margin-top: var(--space-xs); }
.tenure-curve .axis { stroke: var(--color-border); stroke-width: 1; }
.tenure-curve .tick-label {
  font-family: var(--font-body); font-size: 12px; fill: var(--color-text-secondary);
}
.tenure-curve .line { fill: none; stroke: var(--color-accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tenure-curve .dot { fill: var(--color-accent); stroke: #fff; stroke-width: 2; }
.tenure-curve .dot.dip { fill: #999; }
.tenure-curve .value {
  font-family: var(--font-heading); font-size: 14px; font-weight: 700; fill: var(--color-text);
}
.tenure-curve .value.dip { fill: var(--color-text-muted); }
.tenure-curve .annotation {
  font-family: var(--font-body); font-size: 11px; fill: var(--color-text-muted); font-style: italic;
}

/* --- NPS proportional bar ---------------------------------------------- */
.nps-bar {
  display: flex;
  width: 100%;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  margin: var(--space-xs) 0;
}
.nps-bar .nps-seg { height: 100%; }
.nps-promoter { background: var(--color-accent); }
.nps-passive  { background: #d4d4d4; }
.nps-detractor { background: #1a1a1a; }
.nps-row {
  display: flex; flex-wrap: wrap; gap: var(--space-md);
  font-size: 0.85rem; color: var(--color-text-secondary);
}
.nps-row .nps-key {
  display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.nps-row .nps-key .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
}

/* --- Compact usage table (Personal vs Both vs Pro) --------------------- */
.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: var(--space-md) 0;
}
.usage-table th, .usage-table td {
  text-align: left;
  padding: 6px var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}
.usage-table thead th {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-weight: 700;
  border-bottom: 2px solid var(--color-border);
}
.usage-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.usage-table .pip {
  display: inline-block; min-width: 1.8em; padding: 1px 6px; border-radius: 2px;
  font-size: 0.8rem; font-variant-numeric: tabular-nums; text-align: center;
}
.usage-table .pip.p  { background: #fde2e4; color: #9b1c1c; }  /* personal — soft red */
.usage-table .pip.b  { background: #fef3c7; color: #8a5b00; }  /* both — amber */
.usage-table .pip.pr { background: #e7f5e8; color: #1c6b22; }  /* pro */
.usage-table .pip.zero { color: var(--color-text-dim); background: transparent; }

/* --- Member-location heatmap (Leaflet + CartoDB tiles) ----------------- */
.heatmap {
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-sm);
  margin-top: var(--space-sm);
}
.member-map {
  width: 100%;
  height: 480px;
  border-radius: var(--radius);
  background: var(--color-bg-dark);
}
.member-map-fallback {
  padding: var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
}
.heatmap-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}
.heatmap-legend .legend-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-right: var(--space-xs);
}
.heatmap-legend .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.heatmap-legend .chip .swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.heatmap-legend .note {
  margin-left: auto;
  max-width: 36ch;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
/* Override leaflet tooltip to match site type */
.leaflet-tooltip {
  font-family: var(--font-body);
  font-size: 0.85rem;
}
@media (max-width: 600px) {
  .member-map { height: 340px; }
  .heatmap-legend .note { margin-left: 0; }
}

/* --- Two-column ("get involved") block --------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin: var(--space-md) 0;
}
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
}

/* --- Board-only callouts ------------------------------------------------ */
.board-callout {
  border-left: 4px solid #b45309;
  background: #fff8ec;
  padding: var(--space-md);
  margin: var(--space-md) 0;
  border-radius: var(--radius);
}
.board-callout .label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #b45309;
  margin-bottom: var(--space-xs);
}

/* --- Collapsible appendix ---------------------------------------------- */
details.appendix {
  margin: var(--space-md) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-dark);
}
details.appendix > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.appendix > summary::after {
  content: "▼";
  font-size: 0.8em;
  color: var(--color-accent);
  transition: transform 0.2s;
}
details.appendix[open] > summary::after { transform: rotate(180deg); }
details.appendix > summary::-webkit-details-marker { display: none; }
details.appendix .appendix-body { padding: 0 var(--space-md) var(--space-md); }

/* --- Print "Save as PDF" button position ------------------------------- */
.print-cta {
  display: flex;
  justify-content: flex-end;
  margin: var(--space-md) 0;
}

/* --- Print stylesheet --------------------------------------------------- */
@media print {
  @page {
    size: letter;
    margin: 0.6in 0.5in;
  }
  :root {
    --color-bg: #ffffff;
    --color-bg-alt: #ffffff;
    --color-bg-dark: #ffffff;
  }
  body {
    font-family: Georgia, "Times New Roman", serif;
    color: #000;
    background: #fff;
    font-size: 10.5pt;
    line-height: 1.45;
  }
  h1, h2, h3, h4 {
    font-family: Helvetica, Arial, sans-serif;
    color: #000;
    page-break-after: avoid;
  }
  /* Hide interactive chrome */
  .site-header,
  .skip-link,
  .print-cta,
  .nav-links,
  .btn,
  .to-top,
  .share-links,
  .member-map,
  .leaflet-container,
  .sankey-tooltip,
  .site-footer .footer-grid,
  .shop-table thead th[aria-sort]::after {
    display: none !important;
  }
  /* Show fallback summary instead of the live map */
  .member-map-fallback { display: block !important; padding: 0; text-align: left; }
  /* Force all details expanded */
  details.appendix,
  details.appendix > .appendix-body,
  details[open] {
    display: block !important;
  }
  details.appendix > summary { cursor: default; }
  /* Section breaks */
  section { padding: 12pt 0; page-break-inside: avoid; }
  section h2 { page-break-before: auto; }
  .hero { page-break-after: avoid; }
  /* Avoid splitting */
  .stat, .card, .pull-quote, .shop-table tr, .growth-row { page-break-inside: avoid; }
  /* Print-only header (set via JS or duplicated in markup) */
  .print-header {
    display: block !important;
    border-bottom: 1px solid #000;
    padding-bottom: 6pt;
    margin-bottom: 12pt;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 9pt;
  }
  /* Footer note */
  .site-footer {
    background: #fff;
    color: #000;
    border-top: 1px solid #000;
    padding: 12pt 0 0;
    font-size: 9pt;
  }
  .site-footer a { color: #000; text-decoration: underline; }
  a { color: #000; text-decoration: none; }
  /* Stat tiles flatten */
  .stat { border: 1px solid #999; box-shadow: none; }
  .stat .value, .hero .headline-stat { color: #000; }
  .card { border: 1px solid #999; border-top: 3px solid #000; box-shadow: none; }
  .pull-quote { border-left: 3px solid #000; background: #fff; }
  .bar-row .bar-fill, .growth-row .after .bar-fill { background: #000; }
  .growth-row .before .bar-fill { background: #999; }
  /* New viz: keep visible in print, drop colors to grayscale */
  .gauge path[stroke="#c8102e"] { stroke: #000 !important; }
  .gauge path[stroke="#f0f0f0"] { stroke: #ddd !important; }
  .donut circle[stroke] { stroke-opacity: 1; }
  .sankey .block { stroke: #000 !important; stroke-width: 0.5 !important; }
  .sankey .ribbon { fill-opacity: 0.35 !important; }
  .shop-table thead th { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .shop-table .score.high, .shop-table .score.mid, .shop-table .score.low {
    background: #fff; border: 1px solid #000; color: #000;
  }
}

/* Print-only header is hidden onscreen */
.print-header { display: none; }

/* =========================================================================
   Filter bar (interactive filtering of survey results)
   ========================================================================= */
#filter-bar {
  position: sticky;
  top: 0;
  z-index: 2000; /* above Leaflet map (default ~1000) */
  background: var(--color-bg, #fff);
  border-bottom: 1px solid #e5e5e5;
  padding: var(--space-sm) 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
#filter-bar .filter-toggle {
  font-size: .8rem;
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--color-text-secondary, #555);
  margin-right: 6px;
}
#filter-bar .filter-toggle:hover { background: #f5f5f5; }
#filter-bar.is-collapsed .filter-groups { display: none; }
#filter-bar.is-collapsed .filter-disclaimer { display: none; }
#filter-bar .filter-inner {
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  padding: 0 var(--space-md);
}
.filter-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xs);
}
.filter-header-text {
  font-family: var(--font-heading, sans-serif);
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--color-text-secondary, #555);
}
.filter-status {
  font-size: .85rem;
  color: var(--color-text-muted, #666);
}
.filter-status.is-active {
  color: var(--color-accent, #c8102e);
  font-weight: 600;
}
#filter-reset {
  font-size: .8rem;
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--color-text-secondary, #555);
}
#filter-reset:hover {
  background: #f5f5f5;
  border-color: #999;
}
.filter-groups {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-group-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-secondary, #666);
}
.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.filter-chip {
  font-size: .75rem;
  padding: 3px 9px;
  background: #f5f3ee;
  border: 1px solid #e0ddd5;
  border-radius: 999px;
  cursor: pointer;
  color: var(--color-text-secondary, #444);
  user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.filter-chip:hover {
  background: #ebe7df;
  border-color: #c8c4ba;
}
.filter-chip.is-active {
  background: var(--color-accent, #c8102e);
  border-color: var(--color-accent, #c8102e);
  color: #fff;
}

/* Sub-count: muted "(n of N)" beneath a primary percent value */
.sub-count {
  display: block;
  font-size: .65rem;
  color: var(--color-text-muted, #999);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-body, sans-serif);
}
.stat .sub-count { font-size: .7rem; }
.bar-row .bar-value .sub-count { display: inline; font-size: .85em; margin-left: 4px; }
.nps-key .sub-count { display: inline; font-size: .85em; margin-left: 2px; }

@media print {
  #filter-bar { display: none; }
}

/* --- Filter comparison badges ("vs N overall") ------------------------- */
.compare-baseline {
  display: inline-block;
  font-size: .75rem;
  color: var(--color-text-muted, #888);
  font-weight: 400;
  margin-left: 4px;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font-body, sans-serif);
}
.compare-baseline.up { color: #1a7a3a; }
.compare-baseline.down { color: #b45309; }
.stat .compare-baseline { display: block; margin-left: 0; margin-top: 2px; font-size: .7rem; }
.bar-row .bar-value .compare-baseline { display: inline; font-size: .8em; }

/* --- Unfiltered-section disclaimer ------------------------------------- */
.unfiltered-note {
  font-size: .75rem;
  color: var(--color-text-muted, #888);
  font-style: italic;
  margin: var(--space-xs) 0 var(--space-sm);
  padding: 6px 10px;
  background: #f8f6f0;
  border-left: 2px solid #d4c8a8;
  border-radius: 0 4px 4px 0;
}

/* --- Stacked usage bars (personal/both/pro) ---------------------------- */
.usage-bars {
  display: grid;
  grid-template-columns: 40px minmax(110px, auto) 1fr;
  column-gap: var(--space-sm);
  row-gap: 8px;
  align-items: center;
  margin: var(--space-sm) 0 var(--space-md);
}
.usage-bars .usage-bubble {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-accent, #c8102e);
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  /* default size for the smallest; render() scales actual size */
  transition: width .15s, height .15s;
}
.usage-bars .usage-shop {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.2;
}
.usage-bars .usage-shop small {
  display: block;
  font-weight: 400;
  font-size: .7rem;
  color: var(--color-text-muted, #888);
  margin-top: 2px;
}
.usage-bars .usage-bar {
  display: flex;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0ece4;
  border: 1px solid #e0ddd5;
}
.usage-bars .usage-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.usage-bars .usage-seg.personal { background: #c8102e; }
.usage-bars .usage-seg.both     { background: #f5934e; color:#3a2200; text-shadow:none; }
.usage-bars .usage-seg.pro      { background: #7a0e1f; }
.usage-legend {
  display: flex;
  gap: var(--space-md);
  font-size: .8rem;
  color: var(--color-text-secondary, #555);
  margin-bottom: var(--space-xs);
  flex-wrap: wrap;
}
.usage-legend .lg-item { display: flex; align-items: center; gap: 6px; }
.usage-legend .lg-swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
@media (max-width: 640px) {
  .usage-bars { grid-template-columns: 32px 1fr; }
  .usage-bars .usage-bar { grid-column: 1 / -1; }
}

/* --- Commute range bar ------------------------------------------------- */
.range-stat {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-xs) 0;
  font-size: .85rem;
}
.range-stat .rng-label { color: var(--color-text-secondary, #555); }
.range-stat .rng-val { font-weight: 600; }
.range-bar {
  position: relative;
  flex: 1;
  height: 6px;
  background: linear-gradient(90deg, #f5934e, #c8102e, #7a0e1f);
  border-radius: 3px;
  margin-top: 4px;
}
.range-bar .rng-marker {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 14px;
  background: #151517;
}
.range-bar .rng-iqr {
  position: absolute;
  top: 0;
  height: 6px;
  background: rgba(0,0,0,0.18);
  border-radius: 3px;
}

/* --- Tenure block: bars + curve side-by-side --------------------------- */
.tenure-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  align-items: start;
}
@media (max-width: 700px) {
  .tenure-layout { grid-template-columns: 1fr; }
}
.tenure-layout .viz-heading {
  margin-top: 0;
  font-size: .85rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* --- Custom Sankey hover tooltip --------------------------------------- */
.sankey-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 3000;
  max-width: 320px;
  padding: 10px 12px;
  background: #151517;
  color: #fff;
  font-family: var(--font-body, sans-serif);
  font-size: .85rem;
  line-height: 1.4;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s, transform .12s;
}
.sankey-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.sankey-tooltip strong {
  color: #ffd28a;
  font-family: var(--font-heading, sans-serif);
  letter-spacing: .05em;
  font-size: .78rem;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.sankey-tooltip .tt-count {
  color: #fff;
  font-family: var(--font-heading, sans-serif);
  font-weight: 700;
  font-size: 1.05rem;
}
.sankey-tooltip .tt-sub {
  color: rgba(255,255,255,0.75);
  font-size: .78rem;
  margin-top: 3px;
}
/* Give sankey interactive shapes a hover affordance */
svg.sankey path.ribbon, svg.sankey rect.block {
  cursor: help;
  transition: opacity .12s, filter .12s;
}
svg.sankey path.ribbon:hover, svg.sankey rect.block:hover {
  filter: brightness(1.1);
}
svg.sankey:hover path.ribbon:not(:hover),
svg.sankey:hover rect.block:not(:hover) {
  opacity: 0.55;
}

/* --- Low-sample shop rows (insufficient data, greyed) ----------------- */
.shop-table tbody tr.low-n {
  opacity: 0.55;
}
.shop-table tbody tr.low-n td {
  font-style: italic;
}
.shop-table tbody tr.low-n .score {
  background: #ececec !important;
  color: #888 !important;
  font-weight: 400;
}
.shop-table tbody tr.low-n .lown-tag {
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a5b00;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-style: normal;
  font-weight: 600;
}

.callout-takeaways {
  background: #151517;
  color: #fafafa;
  padding: var(--space-lg) 0;
  border-top: 4px solid var(--color-accent);
  border-bottom: 4px solid var(--color-accent);
}
.callout-takeaways .container {
  max-width: 920px;
}
.callout-takeaways .callout-eyebrow {
  font-family: var(--font-heading);
  font-size: .85rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #ffd28a;
  margin-bottom: var(--space-xs);
}
.callout-takeaways .callout-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: var(--space-md);
  color: #fafafa;
  line-height: 1.15;
}
.callout-takeaways .takeaway-list {
  list-style: none;
  counter-reset: takeaway;
  padding: 0;
  margin: 0 0 var(--space-md);
  display: grid;
  gap: var(--space-sm);
}
.callout-takeaways .takeaway-list li {
  counter-increment: takeaway;
  position: relative;
  padding: var(--space-sm) var(--space-sm) var(--space-sm) calc(var(--space-md) + var(--space-md));
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.55;
  color: #fafafa;
}
.callout-takeaways .takeaway-list li::before {
  content: counter(takeaway);
  position: absolute;
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffd28a;
  width: 2.25rem;
  text-align: center;
  line-height: 1;
}
.callout-takeaways .takeaway-list li strong {
  color: #ffd28a;
  font-weight: 600;
}
.callout-takeaways .callout-meta {
  font-size: .85rem;
  color: #b0b0b0;
  margin: 0;
  font-style: italic;
}
@media (max-width: 600px) {
  .callout-takeaways .takeaway-list li {
    padding-left: var(--space-md);
    padding-top: calc(var(--space-sm) + 1.5rem);
  }
  .callout-takeaways .takeaway-list li::before {
    left: var(--space-sm);
    top: var(--space-sm);
    transform: none;
    font-size: 1.4rem;
  }
}
@media print {
  .callout-takeaways {
    background: white;
    color: black;
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
    page-break-inside: avoid;
  }
  .callout-takeaways .callout-eyebrow,
  .callout-takeaways .callout-title,
  .callout-takeaways .takeaway-list li,
  .callout-takeaways .takeaway-list li strong {
    color: black;
  }
  .callout-takeaways .takeaway-list li {
    background: white;
    border-left: 2px solid #000;
  }
  .callout-takeaways .takeaway-list li::before {
    color: black;
  }
}

.info-rank-chart .bar-value {
  min-width: 11ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.info-rank-chart .bar-value .sub-count {
  display: inline-block;
  min-width: 5.5ch;
  text-align: left;
}

.rbt-table {
  display: grid;
  gap: 1px;
  background: #e2e2e2;
  border: 1px solid #e2e2e2;
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .9rem;
}
.rbt-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 1fr 1fr 60px;
  gap: 1px;
  background: #e2e2e2;
}
.rbt-row > * {
  background: #fff;
  padding: 8px 10px;
  text-align: center;
}
.rbt-row > [role="rowheader"] {
  text-align: right;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-secondary);
}
.rbt-row.rbt-head > * {
  font-family: var(--font-heading);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: #fafafa;
}
.rbt-row.rbt-head > * small {
  font-size: .65rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  margin-left: 2px;
}
.rbt-cell {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: #151517;
  transition: background 200ms ease;
}
.rbt-n {
  color: var(--color-text-muted);
  font-size: .85rem;
}
@media (max-width: 700px) {
  .rbt-row {
    grid-template-columns: 70px 1fr 1fr 1fr 1fr 40px;
    font-size: .8rem;
  }
  .rbt-row > * { padding: 6px 4px; }
  .rbt-cell { font-size: .9rem; }
  .rbt-row.rbt-head > * { font-size: .65rem; }
}
@media print {
  .rbt-cell { background: white !important; color: black; }
}

/* ============================================================
   Captain readouts (shops/*.html)
   Scoped styles for the per-shop captain readout pages.
   ============================================================ */

.usage-row {
  height: 1.5rem;
  background: var(--color-surface, #f4f1ec);
  border-radius: 4px;
  margin-bottom: .5rem;
}

.usage-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
}

.quotes-overflow > summary {
  cursor: pointer;
  margin-top: 1rem;
}
