/* COLA Pareto Frontier Viewer — page-specific styles.
 * Inherits palette from ../css/variables.css. No hardcoded hex values. */

:root {
  /* Category palette for scatter points / badges */
  --sweep-pareto-named: var(--link);          /* gold — Capped@150 */
  --sweep-pareto:       var(--chart-simple);  /* cyan — Pareto only */
  --sweep-named:        var(--accent);        /* red — named only */
  --sweep-other:        var(--text-secondary);/* gray — neither */
}

/* Compact header ~80px tall */
header.compact {
  padding: 0.6rem 0 0.4rem 0;
  margin-bottom: 0.4rem;
}

header.compact h1 {
  margin: 0 0 0.3rem 0;
  font-size: 1.4rem;
}

header.compact p.claim {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

header.compact p.claim strong {
  color: var(--link);
}

.boot-error {
  display: none;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  color: var(--text);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* Section ledes */
.section-lede {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

/* Scatter plot */
.scatter-canvas-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem;
  height: 460px;
}

.scatter-canvas-wrap canvas {
  max-height: 460px;
}

.scatter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  align-items: center;
  margin: 0.5rem 0 0.7rem 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.legend-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 50%;
}

.legend-dot.pareto {
  background: var(--sweep-pareto);
}

.legend-dot.other {
  background: var(--sweep-other);
  width: 8px;
  height: 8px;
}

.legend-dot.diamond {
  transform: rotate(45deg);
  border-radius: 0;
}

.legend-dot.diamond.filled {
  background: var(--sweep-pareto-named);
}

.legend-dot.diamond.outline {
  background: transparent;
  border: 1.5px solid var(--sweep-named);
}

/* Key-results table */
.key-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.key-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: var(--text);
}

.key-table th,
.key-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.key-table th {
  background: var(--surface-alt);
  font-weight: 600;
  text-align: right;
}

.key-table th:nth-child(1),
.key-table th:nth-child(2),
.key-table th:nth-child(3),
.key-table th:nth-child(5),
.key-table td.text {
  text-align: left;
}

.key-table tbody tr.pareto-row td {
  background: var(--surface-alt);
}

.key-table tbody tr.pareto-named-row td {
  background: var(--surface-alt);
  border-bottom-color: var(--link);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 3px;
  background: var(--surface-alt);
  color: var(--text);
  letter-spacing: 0.03em;
}

.badge-pareto {
  background: transparent;
  color: var(--sweep-pareto);
  border: 1px solid var(--sweep-pareto);
}

.badge-named {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.badge-pareto-named {
  background: var(--link);
  color: var(--bg);
}

/* Methodology prose */
.methodology {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}

/* Cap-cancels-out table */
.cap-table {
  width: auto;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.4rem 0;
  color: var(--text);
}

.cap-table th,
.cap-table td {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  color: var(--text);
}

.cap-table th {
  background: var(--surface-alt);
  font-weight: 600;
}

.cap-table th:first-child,
.cap-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.cap-table .cap-value {
  color: var(--link);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Three assumptions as compact prose list */
.assumption-prose {
  margin: 0;
  padding-left: 1.4rem;
  color: var(--text);
}

.assumption-prose li {
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.assumption-prose li:last-child {
  margin-bottom: 0;
}

.assumption-prose strong {
  color: var(--link);
}

.assumption-prose code {
  background: var(--code-bg);
  color: var(--text);
  padding: 0.03rem 0.3rem;
  border-radius: 3px;
  font-size: 0.82rem;
}

/* Footer links */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.2rem;
  margin-top: 1.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-links a {
  color: var(--link);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links .footer-divider {
  color: var(--border);
}

/* Mobile responsive */
@media (max-width: 768px) {
  header.compact h1 {
    font-size: 1.2rem;
  }

  header.compact p.claim {
    font-size: 0.88rem;
  }

  .scatter-canvas-wrap {
    height: 380px;
    padding: 0.5rem;
  }

  .scatter-canvas-wrap canvas {
    max-height: 380px;
  }

  .key-table {
    font-size: 0.78rem;
  }

  .key-table th,
  .key-table td {
    padding: 0.4rem 0.5rem;
  }

  .cap-table th,
  .cap-table td {
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .footer-links .footer-divider {
    display: none;
  }
}
