/* Clean Static Benchmark & Longread Styles (Zero Tailwind CDN, Zero FOUC) */

:root {
  --bm-bg: #f8fafc;
  --bm-surface: #ffffff;
  --bm-border: #e2e8f0;
  --bm-text: #0f172a;
  --bm-muted: #475569;
  --bm-blue: #2563eb;
  --bm-cyan: #0891b2;
  --bm-emerald: #10b981;
  --bm-amber: #f59e0b;
  --bm-rose: #e11d48;
  --bm-violet: #7c3aed;
  --bm-radius: 6px;
  --bm-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Sticky Section Jump Navigation */
.sticky-jump-nav {
  position: sticky;
  top: 0;
  z-index: 35;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bm-border);
  margin: 1.5rem 0 2rem;
  padding: 0.55rem 0.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem;
}

.sticky-jump-nav a {
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--bm-muted);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.sticky-jump-nav a:hover,
.sticky-jump-nav a.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* KPI Summary Grid (3x2 on desktop, 2x3 on tablet, 1-col on mobile) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 960px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-top: 2px solid #2563eb;
  border-radius: var(--bm-radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--bm-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card.accent-emerald,
.kpi-card.accent-rose,
.kpi-card.accent-cyan,
.kpi-card.accent-amber {
  border-top-color: #2563eb;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bm-muted);
}

.kpi-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--bm-text);
  margin: 0.35rem 0;
  line-height: 1.15;
}

.kpi-note {
  font-size: 0.82rem;
  color: var(--bm-muted);
  line-height: 1.45;
  margin: 0;
}

/* Longread Section Spacing & Dividers */
.bm-section {
  padding: 2.25rem 0;
  border-top: 1px solid var(--bm-border);
  scroll-margin-top: 3.75rem;
}

.bm-kicker {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bm-blue);
  margin-bottom: 0.35rem;
}

.bm-lead {
  font-size: 0.98rem;
  color: var(--bm-muted);
  line-height: 1.65;
  max-width: 78ch;
}

/* 2-Column & Single Chart Grids */
.chart-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.chart-card {
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  padding: 1.25rem;
  box-shadow: var(--bm-shadow);
}

.chart-card h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.02rem;
  color: var(--bm-text);
}

.chart-subtitle {
  font-size: 0.82rem;
  color: var(--bm-muted);
  margin: 0 0 1rem;
  line-height: 1.45;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

.chart-container-tall {
  position: relative;
  width: 100%;
  height: 390px;
}

.methodology-note {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--bm-border);
  font-size: 0.76rem;
  color: var(--bm-muted);
  line-height: 1.45;
}

/* Interactive Control Pills (Churn / Horizon / Vendor / Profile) */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.9rem;
  background: #f8fafc;
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
}

.toggle-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.toggle-btn {
  appearance: none;
  border: 1px solid var(--bm-border);
  background: var(--bm-surface);
  color: var(--bm-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.36rem 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn:hover {
  border-color: #94a3b8;
  color: var(--bm-text);
}

.toggle-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

/* Callout & Verdict Grids */
.card-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.info-card {
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  padding: 1.15rem;
  box-shadow: var(--bm-shadow);
}

.info-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.96rem;
  color: var(--bm-text);
}

.info-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--bm-muted);
  line-height: 1.5;
}

/* Status Badges */
.bm-badge {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.bm-badge-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.bm-badge-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.bm-badge-risk { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.bm-badge-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* FAQ Accordion / Cards */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.faq-item {
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--bm-shadow);
}

.faq-item h3 {
  margin: 0 0 0.5rem;
  font-size: 0.96rem;
  color: var(--bm-text);
}

.faq-item p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--bm-muted);
  line-height: 1.55;
}

@media (max-width: 640px) {
  .chart-grid-2 { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .chart-container { height: 280px; }
  .chart-container-tall { height: 340px; }
}

/* ==========================================================================
   Block 1: Traffic-Light Matrix, Scoring Badges, Hero & Benchmark Tables
   ========================================================================== */

.bm-hero {
  padding: 2rem 0 1.25rem;
}

.bm-hero h1 {
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin: 0.45rem 0 0.75rem;
  color: var(--bm-text);
}

.bm-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.bm-baseline-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.22rem 0.6rem;
  border-radius: 4px;
}

.bm-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  box-shadow: var(--bm-shadow);
  margin: 1rem 0 1.5rem;
}

.bm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.bm-table thead th {
  background: #f1f5f9;
  color: var(--bm-text);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--bm-border);
  white-space: nowrap;
}

.bm-table tbody td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--bm-border);
  vertical-align: top;
  line-height: 1.45;
}

.bm-table tbody tr:last-child td {
  border-bottom: none;
}

.bm-table tbody tr:hover {
  background: #f8fafc;
}

/* Sticky First Column on Horizontal Scroll */
#rebundling-matrix th:first-child,
#rebundling-matrix td:first-child,
#landscape-matrix th:first-child,
#landscape-matrix td:first-child,
#scorecard-matrix > thead > tr > th:first-child,
#scorecard-matrix > tbody > tr.chapter-summary-row > td:first-child,
#scorecard-matrix > tfoot > tr > td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}

#rebundling-matrix thead th:first-child,
#landscape-matrix thead th:first-child,
#scorecard-matrix > thead > tr > th:first-child {
  background: #f1f5f9;
  z-index: 3;
}

/* Scorecard 10-column equal fit (no horizontal scroll on desktop) */
#scorecard-matrix {
  table-layout: fixed;
  width: 100%;
}

#scorecard-matrix th,
#scorecard-matrix td {
  padding: 0.55rem 0.4rem;
  white-space: normal;
  overflow-wrap: break-word;
  text-align: center;
}

#scorecard-matrix th:first-child,
#scorecard-matrix td:first-child {
  text-align: left;
  padding-left: 0.75rem;
  padding-right: 0.6rem;
}

#scorecard-matrix thead th {
  font-size: 0.7rem;
  line-height: 1.25;
}

#scorecard-matrix tr.criteria-subrow {
  background: #f8fafc;
  font-size: 0.79rem;
}

#scorecard-matrix tr.criteria-subrow td:first-child {
  padding-left: 1.35rem;
  color: var(--bm-muted);
  background: #f8fafc;
}

#advisor-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

#advisor-cards .info-card {
  min-width: 0;
  padding: 0.9rem;
  overflow-wrap: anywhere;
}

#advisor-cards .bm-badge {
  white-space: normal;
  max-width: 100%;
  line-height: 1.3;
}

#advisor-cards code {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Horizontal Full-Width FAQ Accordion (100% SSR <details>) */
.faq-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.faq-accordion {
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: var(--bm-radius);
  box-shadow: var(--bm-shadow);
  overflow: hidden;
}

.faq-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bm-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-accordion summary::-webkit-details-marker {
  display: none;
}

.faq-accordion summary::after {
  content: "+";
  font-family: "JetBrains Mono", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bm-blue);
  flex-shrink: 0;
}

.faq-accordion[open] summary {
  border-bottom: 1px solid var(--bm-border);
  background: #f8fafc;
}

.faq-accordion[open] summary::after {
  content: "−";
}

.faq-accordion p {
  margin: 0;
  padding: 0.95rem 1.2rem;
  font-size: 0.87rem;
  color: var(--bm-muted);
  line-height: 1.6;
}

/* Compact 1-line rows for Verified Primary Sources table */
#eeat-sources-table {
  font-size: 0.76rem;
}

#eeat-sources-table th,
#eeat-sources-table td {
  padding: 0.5rem 0.65rem;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  #advisor-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #advisor-cards {
    grid-template-columns: 1fr;
  }
}

/* Quiet Editorial Cell Semantics (2 / 1 / 0) */
.cell-win {
  background: #ffffff;
  color: var(--bm-text);
  border-left: 2px solid #16a34a;
}

.cell-mid {
  background: #ffffff;
  color: var(--bm-text);
  border-left: 2px solid #d97706;
}

.cell-fail {
  background: #ffffff;
  color: var(--bm-text);
  border-left: 2px solid #dc2626;
}

.cell-na {
  background: #f8fafc;
  color: var(--bm-muted);
  border-left: 2px solid #cbd5e1;
}

.tl-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.16rem 0.48rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
  white-space: nowrap;
}

.tl-win::before,
.tl-mid::before,
.tl-fail::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tl-win::before { background: #16a34a; }
.tl-mid::before { background: #d97706; }
.tl-fail::before { background: #dc2626; }

.tl-win { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.tl-mid { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.tl-fail { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.tl-na { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
}

.score-2 { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.score-1 { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.score-0 { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

.cell-note {
  display: block;
  font-size: 0.78rem;
  line-height: 1.4;
}

.stack-name {
  font-weight: 700;
  color: var(--bm-text);
  display: block;
  margin-bottom: 0.15rem;
}

.stack-cat {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--bm-muted);
}

.bm-goto-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--bm-blue);
  text-decoration: none;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  white-space: nowrap;
}

.bm-goto-link:hover {
  background: var(--bm-blue);
  color: #ffffff;
  border-color: var(--bm-blue);
}

.rubric-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.9rem 1.1rem;
  background: var(--bm-surface);
  border: 1px solid var(--bm-border);
  border-radius: 10px;
  margin: 0.9rem 0 1.35rem;
  font-size: 0.82rem;
}

.rubric-legend-title {
  grid-column: 1 / -1;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bm-muted);
}

.rubric-legend-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  line-height: 1.4;
  color: var(--bm-muted);
}

@media (max-width: 768px) {
  .rubric-legend {
    grid-template-columns: 1fr;
  }
}

.bm-split-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
  gap: 1.25rem;
  align-items: start;
  margin: 1.25rem 0;
}

@media (max-width: 960px) {
  .bm-split-2 {
    grid-template-columns: 1fr;
  }
}

.bm-split-2 .bm-table {
  table-layout: fixed;
}

.bm-split-2 .bm-table thead th {
  white-space: normal;
  padding: 0.6rem 0.65rem;
}

.bm-split-2 .bm-table tbody td {
  padding: 0.6rem 0.65rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

