.prob-tool { margin-top: 1rem; }

.prob-module { margin-bottom: 2.5rem; }
.prob-module + .prob-module {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.prob-module-title { margin: 0 0 0.25rem; font-size: 1.35rem; font-weight: 700; }
.prob-module-intro { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.95rem; }

/* ── Score-probability module ── */
.score-loading { color: var(--text-muted); font-style: italic; padding: 2rem 0; }

.score-controls {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.score-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--text-muted); }
.score-field input[type="number"] {
  width: 110px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.score-theta { flex: 1; min-width: 220px; }
.score-theta input[type="range"] { width: 100%; accent-color: var(--accent); }
.score-theta-val { color: var(--text); font-family: var(--font-mono); }
.score-theta-hint {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.score-chart { width: 100%; margin: 0.5rem 0 1rem; }
.score-chart svg { display: block; width: 100%; height: auto; }

.score-readout {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent);
  background: var(--accent-light);
  border-radius: 8px;
}
.score-readout-label { font-size: 1rem; color: var(--text); }
.score-readout-value { font-size: 1.8rem; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.score-readout-onein { font-size: 0.9rem; color: var(--text-muted); font-family: var(--font-mono); }
.score-readout-sub { font-size: 0.8rem; color: var(--text-muted); }
.score-readout-best {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.1rem;
}

.prob-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.prob-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
}

.prob-row.target {
  border-color: var(--accent);
  background: var(--accent-light);
}

.prob-row-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
}
.prob-row-label { font-weight: 700; }
.prob-row-sub { font-size: 0.72rem; color: var(--text-muted); }

.prob-row-dice { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

.prob-die {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.prob-die-arrow {
  width: 44px;
  height: 15px;
  font-size: 9px;
  line-height: 12px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 3px;
  cursor: pointer;
}
.prob-die-arrow:hover { background: var(--accent-light); border-color: var(--accent); }

.prob-keep-info { font-size: 0.72rem; color: var(--text-muted); }

/* Transition between rows */
.prob-transition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  margin: 0 auto;
}
.prob-trans-arrow { font-size: 1.1rem; color: var(--text-muted); }
.prob-trans-label { font-size: 0.85rem; color: var(--text-muted); }
.prob-trans-value { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.prob-trans-onein { font-size: 0.75rem; color: var(--text-muted); }
.prob-trans-note { font-size: 0.75rem; color: var(--color-danger); }
.prob-transition.impossible .prob-trans-value { color: var(--color-danger); }

/* Mobile: the die up/down arrows are the main way to change values on a phone,
   so give them a taller, comfortable tap target. */
@media (max-width: 620px) {
  .prob-die-arrow { height: 26px; font-size: 12px; line-height: 24px; }
  .prob-die { gap: 4px; }
}
