/* Auripath completion benchmarks infographic – vertical, CSS-only interactive layout */

.ap-comp-wrap {
  max-width: 760px;
  margin: 2.5rem auto;
  padding: 1.75rem;
  border-radius: 1.5rem;
  background: #fefce8; /* soft warm background to differentiate from opt-in chart */
  color: #0f172a;
  border: 1px solid #facc15;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ap-comp-heading {
  font-size: 1.45rem;
  margin: 0 0 0.75rem;
  color: #0f172a;
}

.ap-comp-intro {
  font-size: 0.94rem;
  color: #4b5563;
  margin: 0 0 1.1rem;
}

/* Scenario controls */

.ap-comp-controls {
  margin-top: 0.2rem;
  position: relative;
}

/* Hide radio inputs but keep them accessible */
.ap-comp-scenario-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ap-comp-scenarios {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.ap-comp-scenarios-label {
  font-size: 0.82rem;
  color: #374151;
  margin-right: 0.35rem;
}

.ap-comp-scenario-pill {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: #111827;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Active pill states via radio :checked */

#ap-comp-scenario-conservative:checked ~ .ap-comp-scenarios label[for="ap-comp-scenario-conservative"],
#ap-comp-scenario-typical:checked      ~ .ap-comp-scenarios label[for="ap-comp-scenario-typical"],
#ap-comp-scenario-optimistic:checked   ~ .ap-comp-scenarios label[for="ap-comp-scenario-optimistic"] {
  background: #f97316;
  color: #f9fafb;
  border-color: #ea580c;
}

.ap-comp-scenario-pill:hover {
  background: #e5e7eb;
}

/* Scenario explanatory note */

.ap-comp-note {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.2rem;
}

/* Context / why completion matters card */

.ap-comp-card-context {
  margin-top: 0.8rem;
  background: #fffbeb;
  border-color: #facc15;
}

.ap-comp-context-text {
  font-size: 0.8rem;
  color: #4b5563;
  margin: 0.25rem 0;
}

.ap-comp-context-list {
  margin: 0.35rem 0 0.35rem 1.1rem;
  padding: 0;
  font-size: 0.8rem;
  color: #4b5563;
}

/* Panels */

.ap-comp-panels {
  margin-top: 0.9rem;
}

/* Hide all panels by default */
.ap-comp-panel {
  display: none;
}

/* Show only the selected scenario panel */
#ap-comp-scenario-conservative:checked ~ .ap-comp-card-context ~ .ap-comp-panels [data-scenario-panel="conservative"],
#ap-comp-scenario-typical:checked      ~ .ap-comp-card-context ~ .ap-comp-panels [data-scenario-panel="typical"],
#ap-comp-scenario-optimistic:checked   ~ .ap-comp-card-context ~ .ap-comp-panels [data-scenario-panel="optimistic"] {
  display: block;
}

.ap-comp-card {
  margin-top: 0.8rem;
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.ap-comp-card + .ap-comp-card {
  margin-top: 0.85rem;
}

.ap-comp-subheading {
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
  color: #0f172a;
}

.ap-comp-chart-note {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0 0 0.7rem;
}

/* Summary row above chart */

.ap-comp-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.ap-comp-summary {
  padding: 0.5rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fffbeb;
}

.ap-comp-summary-format {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-bottom: 0.1rem;
}

.ap-comp-summary-value {
  font-size: 0.98rem;
  font-weight: 600;
  color: #111827;
}

.ap-comp-summary-caption {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #6b7280;
}

/* Chart */

.ap-comp-chart {
  margin-top: 0.35rem;
}

.ap-comp-axis-x {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
  position: relative;
}

.ap-comp-axis-x span {
  position: relative;
}

.ap-comp-axis-x::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 1px;
  background: #e5e7eb;
}

/* Bars */

.ap-comp-bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ap-comp-bar {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.ap-comp-bar-label {
  color: #111827;
}

.ap-comp-bar-track {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.ap-comp-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: #2563eb;
}

/* Per-format colours */
.ap-comp-bar-fill-pdf {
  background: #2563eb;
}

.ap-comp-bar-fill-audio {
  background: #22c55e;
}

.ap-comp-bar-fill-combo {
  background: #8b5cf6;
}

.ap-comp-bar-value {
  font-variant-numeric: tabular-nums;
  color: #111827;
}

/* Table */

.ap-comp-card-table .ap-comp-subheading {
  margin-bottom: 0.6rem;
}

.ap-comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ap-comp-table th,
.ap-comp-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.ap-comp-table thead th {
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
}

/* Footnote */

.ap-comp-footnote {
  margin-top: 0.95rem;
  font-size: 0.78rem;
  color: #6b7280;
}

/* Responsive */

@media (max-width: 640px) {
  .ap-comp-wrap {
    margin: 1.8rem auto;
    padding: 1.3rem 1.1rem;
  }
  .ap-comp-summary-row {
    grid-template-columns: 1fr;
  }
  .ap-comp-bar {
    grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto;
    gap: 0.4rem;
  }
}
