/* style.css's body/main assume the single-viewport game layout (fixed
   height, internal scroll panels) -- this page is a normal long scrolling
   document instead, so override just enough to opt out of that. */
body.learning-page {
  display: block;
  height: auto;
  overflow-y: auto;
}

.learning-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.dim {
  color: var(--dim);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  text-align: left;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--dim);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

tr.top-candidate td {
  color: var(--accent);
  font-weight: 600;
}

.panel h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
  margin: 0 0 0.75rem;
}

.panel h3 {
  font-size: 0.8rem;
  margin: 1rem 0 0.4rem;
}

.panel h3:first-child {
  margin-top: 0;
}

.sparkline-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.sparkline h3 {
  font-size: 0.75rem;
  color: var(--dim);
  margin: 0 0 0.3rem;
  text-transform: none;
  letter-spacing: normal;
}

#mistakes-list,
#generations-list,
#training-event-log {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

#mistakes-list li,
#generations-list li,
#training-event-log li {
  margin-bottom: 0.75rem;
}

#training-event-log li.stuck-detection {
  border-top: 1px solid var(--warn);
  color: var(--dim);
  padding-top: 0.55rem;
}

#training-event-log .event-title {
  color: var(--warn);
  font-weight: 600;
}

#run-table .outcome {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
}

#run-table .outcome.died {
  color: var(--warn);
}

#run-table .outcome.amulet_escaped {
  color: var(--accent);
}

#run-table a {
  color: var(--text);
  text-decoration: none;
}

#run-table a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.summary-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  font-size: 0.9rem;
}

.summary-grid dt {
  color: var(--dim);
}

.summary-grid dd {
  margin: 0;
}

#decision-table .source-jev {
  color: var(--accent);
}

#decision-table .source-rule {
  color: var(--warn);
}

#decision-table tr.captured-pre_death_tail {
  background: rgba(224, 164, 88, 0.08);
}

/* Three top-level groups by causal status (turn-loop dashboard redesign,
   2026-09-23): what changes the next decision, whether it's working, and
   what is built but structurally disabled -- see learning.js and the
   backend modules it reads from for what each group actually means. */
.loop-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.loop-group-header {
  padding-top: 0.5rem;
  border-top: 2px solid var(--border);
}

.loop-group-header h1 {
  font-size: 1.1rem;
  margin: 0 0 0.3rem;
}

.loop-group-header .dim {
  margin: 0;
  max-width: 60em;
}

.cadence {
  font-size: 0.65rem;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.5rem;
}
