/* ==========================================================================
   AutoGenius Speed Layer & ETSv2 Field Report — Design System Components
   Shared primitives for index.html, js/charts.js, and js/sections.js
   ========================================================================== */

/* ==========================================================================
   1. Typography & Telemetry Utilities
   ========================================================================== */

.mono {
  font-family: var(--font-mono);
}

.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-tertiary); }
.text-emerald { color: var(--accent-emerald-ink); }
.text-coral { color: var(--accent-coral-ink); }
.text-amber { color: var(--accent-amber-ink); }
.text-cobalt { color: var(--accent-cobalt-ink); }
.text-violet { color: var(--accent-violet-ink); }
.text-cyan { color: var(--accent-cyan-ink); }

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

.code-pill,
.domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: var(--bg-code);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.domain-chip--emerald {
  border-color: var(--accent-emerald-border);
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-ink);
}

.domain-chip--coral {
  border-color: var(--accent-coral-border);
  background: var(--accent-coral-soft);
  color: var(--accent-coral-ink);
}

.domain-chip--cobalt {
  border-color: var(--accent-cobalt-border);
  background: var(--accent-cobalt-soft);
  color: var(--accent-cobalt-ink);
}

.domain-chip .text-muted {
  color: var(--text-secondary);
}

.domain-chip--emerald .text-muted,
.domain-chip--coral .text-muted,
.domain-chip--cobalt .text-muted,
.callout .domain-chip .text-muted,
.callout .text-muted {
  color: var(--text-primary);
}

.row-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.row-toggle-btn:hover {
  color: var(--accent-cobalt-ink);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   2. Hero Section & Architectural Constraint Banner
   ========================================================================== */

.hero-block {
  position: relative;
  padding: 24px 20px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  background-image: radial-gradient(var(--hero-grid-dot) 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: hidden;
}

.hero-block::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-emerald) 0%, var(--accent-cobalt) 55%, var(--accent-cyan) 100%);
}

.hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.032em;
  color: var(--text-primary);
  max-width: 24ch;
}

.hero-subtitle {
  margin: 0 0 20px;
  max-width: 72ch;
  font-size: clamp(0.975rem, 1.4vw, 1.1rem);
  line-height: 1.62;
  color: var(--text-secondary);
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-meta-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Zero-DNS Architectural Constraint Callout */
.constraint-banner {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-cyan-border);
  border-left: 4px solid var(--accent-cyan);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.constraint-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.constraint-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.constraint-tag {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-code);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-cyan-ink);
  overflow-wrap: anywhere;
}

.constraint-copy {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.58;
}

.constraint-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   3. Grand KPI Strip
   ========================================================================== */

.kpi-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.kpi-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--accent-cobalt);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.kpi-card:hover {
  border-color: var(--border-strong);
}

.kpi-card--emerald { border-top-color: var(--accent-emerald); }
.kpi-card--coral   { border-top-color: var(--accent-coral); }
.kpi-card--amber   { border-top-color: var(--accent-amber); }
.kpi-card--cobalt  { border-top-color: var(--accent-cobalt); }
.kpi-card--violet  { border-top-color: var(--accent-violet); }
.kpi-card--cyan    { border-top-color: var(--accent-cyan); }

.kpi-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.kpi-value {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.kpi-sub {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.45;
}

.kpi-meta {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}

/* ==========================================================================
   4. Responsive Grid Primitives & Editorial Cards
   ========================================================================== */

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}

.card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card--subtle {
  background: var(--bg-surface-2);
  box-shadow: none;
}

.card--emerald { border-top: 2px solid var(--accent-emerald); }
.card--coral   { border-top: 2px solid var(--accent-coral); }
.card--amber   { border-top: 2px solid var(--accent-amber); }
.card--cobalt  { border-top: 2px solid var(--accent-cobalt); }
.card--violet  { border-top: 2px solid var(--accent-violet); }
.card--cyan    { border-top: 2px solid var(--accent-cyan); }

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}

.card-title {
  margin: 0;
  font-size: 1.03125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.card-subtitle {
  margin: 4px 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.card-stat {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.card-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.58;
}

.card-body p {
  margin: 0 0 10px;
}

.card-body p:last-child {
  margin-bottom: 0;
}

.card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Evidence Bullet Lists */
.evidence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.evidence-list li {
  position: relative;
  padding-left: 15px;
  line-height: 1.5;
}

.evidence-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

/* Expected vs. Empirical Proof Comparison Box */
.vs-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.vs-box {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.vs-box--proved {
  border-color: var(--accent-emerald-border);
  background: var(--accent-emerald-soft);
}

.vs-box--warn {
  border-color: var(--accent-coral-border);
  background: var(--accent-coral-soft);
}

.vs-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.vs-box--proved .vs-label { color: var(--accent-emerald-ink); }
.vs-box--warn .vs-label   { color: var(--accent-coral-ink); }

/* Horizontal Telemetry Metric Strip (inside Vendor & Pillar Cards) */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.metric-cell-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.metric-cell-value {
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.metric-cell-note {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   5. Badges, Pills & Semantic Callouts
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  max-width: 100%;
  white-space: nowrap;
}

.chart-card .badge {
  white-space: normal;
  line-height: 1.32;
  border-radius: var(--radius-md);
}

@media (max-width: 639px) {
  .badge {
    white-space: normal;
    line-height: 1.32;
  }

  .data-table .badge {
    white-space: nowrap;
  }
}

.badge--emerald {
  border-color: var(--accent-emerald-border);
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-ink);
}

.badge--coral {
  border-color: var(--accent-coral-border);
  background: var(--accent-coral-soft);
  color: var(--accent-coral-ink);
}

.badge--amber {
  border-color: var(--accent-amber-border);
  background: var(--accent-amber-soft);
  color: var(--accent-amber-ink);
}

.badge--cobalt {
  border-color: var(--accent-cobalt-border);
  background: var(--accent-cobalt-soft);
  color: var(--accent-cobalt-ink);
}

.badge--violet {
  border-color: var(--accent-violet-border);
  background: var(--accent-violet-soft);
  color: var(--accent-violet-ink);
}

.badge--cyan {
  border-color: var(--accent-cyan-border);
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan-ink);
}

.badge--neutral {
  border-color: var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Editorial Callouts */
.callout {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-cobalt);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.58;
}

.callout--emerald { border-left-color: var(--accent-emerald); background: var(--accent-emerald-soft); }
.callout--coral   { border-left-color: var(--accent-coral);   background: var(--accent-coral-soft); }
.callout--amber   { border-left-color: var(--accent-amber);   background: var(--accent-amber-soft); }
.callout--cobalt  { border-left-color: var(--accent-cobalt);  background: var(--accent-cobalt-soft); }
.callout--violet  { border-left-color: var(--accent-violet);  background: var(--accent-violet-soft); }
.callout--cyan    { border-left-color: var(--accent-cyan);    background: var(--accent-cyan-soft); }

.callout-title {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.callout p {
  margin: 0;
}

/* Collapsible Methodology / Integrity Disclosures */
.editorial-details {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow: hidden;
}

.editorial-details summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
  transition: background-color var(--transition-fast);
}

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

.editorial-details summary:hover {
  background: var(--bg-surface-2);
}

.editorial-details summary::after {
  content: "▸";
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

.editorial-details[open] summary::after {
  transform: rotate(90deg);
}

.editorial-details-body {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ==========================================================================
   6. Interactive Controls — Segmented Toggles, Tabs, Filters & Inputs
   ========================================================================== */

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  max-width: 100%;
}

.segmented-btn {
  padding: 6px 11px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.segmented-btn:hover {
  color: var(--text-primary);
}

.segmented-btn.is-active,
.segmented-btn[aria-pressed="true"],
.segmented-btn[aria-selected="true"] {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Vendor Tab Bar */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface-2);
}

.tab-btn.is-active,
.tab-btn[aria-selected="true"] {
  background: var(--accent-cobalt-soft);
  border-color: var(--accent-cobalt-border);
  color: var(--accent-cobalt-ink);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

/* Filter Bar, Chips & Form Inputs */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-right: 4px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-chip.is-active,
.filter-chip[aria-pressed="true"] {
  background: var(--accent-emerald-soft);
  border-color: var(--accent-emerald-border);
  color: var(--accent-emerald-ink);
}

.search-input,
.select-input {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 0.84375rem;
  min-width: 0;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.search-input {
  flex: 1 1 210px;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-3);
}

.btn--sm {
  padding: 4px 9px;
  font-size: 11.5px;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

/* ==========================================================================
   7. Data Tables (Zero Page Overflow + Horizontal Scroll Shadow Hints)
   ========================================================================== */

.table-shell {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow: hidden;
  min-width: 0;
}

.table-shell-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.table-shell-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-image:
    linear-gradient(to right, var(--bg-surface), var(--bg-surface)),
    linear-gradient(to right, var(--bg-surface), var(--bg-surface)),
    linear-gradient(to right, var(--scroll-shadow-edge), transparent),
    linear-gradient(to left, var(--scroll-shadow-edge), transparent);
  background-position: left center, right center, left center, right center;
  background-repeat: no-repeat;
  background-size: 20px 100%, 20px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

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

.data-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: var(--bg-surface-2);
}

.data-table tbody tr.is-highlight {
  background: var(--accent-emerald-soft);
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.sort-btn:hover,
.sort-btn.is-sorted {
  color: var(--text-primary);
}

/* Expandable Explorer Row */
.data-table tr.is-expandable {
  cursor: pointer;
}

.data-table tr.expand-row td {
  padding: 0;
  background: var(--bg-surface-2);
}

.expand-panel {
  padding: 14px 16px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Inline Progress Meter */
.meter {
  height: 6px;
  width: 100%;
  min-width: 56px;
  border-radius: var(--radius-pill);
  background: var(--chart-bar-track);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-cobalt);
}

.meter-fill--emerald { background: var(--accent-emerald); }
.meter-fill--coral   { background: var(--accent-coral); }
.meter-fill--amber   { background: var(--accent-amber); }
.meter-fill--violet  { background: var(--accent-violet); }
.meter-fill--cyan    { background: var(--accent-cyan); }

/* ==========================================================================
   8. Visualization Card Shell & SVG Chart Typography (for js/charts.js)
   ========================================================================== */

.chart-card {
  position: relative;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}

.chart-title-group {
  min-width: 0;
  flex: 1 1 280px;
}

.chart-kicker {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.chart-title {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.018em;
  color: var(--text-primary);
}

.chart-subtitle {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chart-body {
  position: relative;
  width: 100%;
  min-width: 0;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.chart-svg text {
  fill: var(--chart-label);
}

.chart-svg .svg-strong {
  fill: var(--chart-label-strong);
  font-weight: 600;
}

.chart-svg .svg-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.chart-svg .svg-gridline {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.chart-svg .svg-axis {
  stroke: var(--chart-axis);
  stroke-width: 1;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-swatch--circle {
  border-radius: 50%;
}

/* Floating Interactive Telemetry Tooltip */
.chart-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  pointer-events: none;
  max-width: min(300px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--chart-tooltip-border);
  background: var(--chart-tooltip-bg);
  color: var(--chart-tooltip-text);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 110ms ease, transform 110ms ease;
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip-title {
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
}

.chart-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip-key {
  color: var(--chart-tooltip-muted);
}

.chart-tooltip-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #FFFFFF;
}

/* Interactive Chart Evidence Drawer (e.g. ForcedReflow call-stack details) */
.chart-drawer {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-drawer-code {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-code);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.chart-footnote {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-tertiary);
}

.chart-loading {
  padding: 36px 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
}

.chart-error,
.mount-error {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-coral-border);
  background: var(--accent-coral-soft);
  color: var(--accent-coral);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

/* ==========================================================================
   9. Future of ETS Pillars, Roadmap Cards & A11y Paradox Comparison
   ========================================================================== */

.pillar-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-cyan);
}

.pillar-card--emerald::before { background: var(--accent-emerald); }
.pillar-card--violet::before  { background: var(--accent-violet); }
.pillar-card--cyan::before    { background: var(--accent-cyan); }

.roadmap-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-cobalt);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roadmap-card--p0-day1  { border-left-color: var(--accent-coral); }
.roadmap-card--p0-week1 { border-left-color: var(--accent-amber); }
.roadmap-card--p1       { border-left-color: var(--accent-cobalt); }
.roadmap-card--p2       { border-left-color: var(--accent-cyan); }

.a11y-compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.a11y-compare-row:last-child {
  border-bottom: none;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* ==========================================================================
   10. Responsive Component Breakpoints
   ========================================================================== */

@media (min-width: 640px) {
  .hero-block {
    padding: 32px 32px 30px;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vs-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-card {
    padding: 24px 24px 20px;
  }

  .a11y-compare-row {
    grid-template-columns: 180px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
  }
}

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

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
