/* Status badges */
.badge {
  display: inline-block;
  padding: 0 1ch;
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  border: var(--border-thickness) solid;
  line-height: calc(var(--line-height) * 1.5);
  vertical-align: middle;
}
.badge-live {
  color: #116611;
  border-color: #116611;
  background: #e6f4e6;
}
.badge-halted {
  color: #991111;
  border-color: #991111;
  background: #fde6e6;
}
.badge-experimental {
  color: #886600;
  border-color: #886600;
  background: #fef9e6;
}
.badge-archived {
  color: #555;
  border-color: #555;
  background: #eee;
}

@media (prefers-color-scheme: dark) {
  .badge-live {
    color: #66cc66;
    border-color: #66cc66;
    background: #112211;
  }
  .badge-halted {
    color: #ff6666;
    border-color: #ff6666;
    background: #221111;
  }
  .badge-experimental {
    color: #ccaa33;
    border-color: #ccaa33;
    background: #221f11;
  }
  .badge-archived {
    color: #999;
    border-color: #666;
    background: #1a1a1a;
  }
}

/* Breadcrumb navigation */
nav {
  font-size: 0.85rem;
  color: var(--text-color-alt);
  margin-bottom: var(--line-height);
}
nav a {
  color: var(--text-color-alt);
  text-decoration: underline;
  text-decoration-thickness: var(--border-thickness);
}
nav a:hover {
  color: var(--text-color);
}

/* Subtitle line */
.subtitle {
  color: var(--text-color-alt);
  font-style: italic;
  margin-top: 0;
}

/* Strategy card grid on index */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30ch, 1fr));
  gap: var(--line-height) 2ch;
  margin-bottom: calc(var(--line-height) * 2);
}
.strategy-card {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc(var(--line-height) - var(--border-thickness)) 1ch;
}
.strategy-card h3 {
  margin: 0 0 0;
  font-size: 1rem;
}
.strategy-card p {
  margin: calc(var(--line-height) / 2) 0;
  font-size: 0.85rem;
  color: var(--text-color-alt);
}
.strategy-card .badge {
  margin-top: calc(var(--line-height) / 2);
}
.strategy-card a {
  text-decoration: none;
}
.strategy-card a:hover h3 {
  text-decoration: underline;
}

#math-logic h3 {
  font-size: 0.9rem;
  margin-top: calc(var(--line-height) * 1.5);
  margin-bottom: 0;
}

#math-logic figure pre {
  border: var(--border-thickness) solid var(--text-color);
  padding: var(--line-height) 1ch;
  overflow-x: auto;
  font-size: 0.75rem;
  line-height: 1.15rem;
}

#math-logic p + figure {
  margin-top: calc(var(--line-height) / 2);
}

/* Decision replay report */
.report-disclaimer {
  border-left: 3px solid var(--text-color);
  padding-left: 1ch;
  color: var(--text-color-alt);
  font-size: 0.9rem;
}

.report-status {
  margin-top: calc(var(--line-height) / 2);
}

.report-meta {
  color: var(--text-color-alt);
  font-size: 0.85rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12ch, 1fr));
  gap: 1ch;
  margin: var(--line-height) 0;
}

.metric-card {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc(var(--line-height) / 2) 1ch;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-color-alt);
  text-transform: uppercase;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
}

.outcome-bar {
  display: block;
  margin: calc(var(--line-height) / 2) 0;
  border: var(--border-thickness) solid var(--text-color);
}

.outcome-legend {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--line-height) 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75ch 1.5ch;
  font-size: 0.85rem;
}

.outcome-legend .swatch {
  display: inline-block;
  width: 1.1ch;
  height: 1.1ch;
  margin-right: 0.5ch;
  border: 1px solid var(--text-color);
  vertical-align: middle;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: var(--line-height);
}

.report-table th,
.report-table td {
  border: var(--border-thickness) solid var(--text-color);
  padding: 0.4ch 0.7ch;
  text-align: left;
  vertical-align: middle;
}

.report-table th {
  background: color-mix(in srgb, var(--text-color) 8%, transparent);
}

.report-table .outcome-bar {
  min-width: 12ch;
  margin: 0;
}

.family-coverage {
  margin: var(--line-height) 0;
  padding-top: calc(var(--line-height) / 2);
  border-top: var(--border-thickness) dashed color-mix(in srgb, var(--text-color) 35%, transparent);
}

.family-coverage h4 {
  margin: 0 0 calc(var(--line-height) / 2) 0;
  font-size: 0.95rem;
}

.family-list {
  font-size: 0.9rem;
  color: var(--text-color-alt);
}

.decision-replay h3 {
  margin-top: calc(var(--line-height) * 1.5);
}

/* ASCII diagrams */
figure pre {
  border: var(--border-thickness) solid var(--text-color);
  padding: var(--line-height) 1ch;
  overflow-x: auto;
}
