.ege-body .ege-theory {
  --theory-ink: #173b50;
  --theory-green: #156652;
  background: #f4f8f6;
  border-top: 5px solid var(--theory-green);
}
.ege-theory .eyebrow { color: var(--theory-green); }
.ege-theory h2 { color: var(--theory-ink); text-wrap: balance; }
.ege-theory .ege-theory-intro { font-size: 1.1rem; }
.ege-theory-rule {
  padding: 16px 20px;
  border-left: 4px solid var(--theory-green);
  background: #e4f2eb;
}
.ege-theory-model, .ege-theory-picture {
  margin: 24px 0;
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid #b6cec5;
  border-radius: 12px;
  background: #fff;
}
.ege-theory-picture { text-align: center; }
.ege-theory-picture svg { display: block; width: min(100%, 400px); margin: auto; }
.ege-theory-picture figcaption { font-size: .9rem; color: #405665; }
.ege-theory-model figcaption { color: var(--theory-ink); line-height: 1.6; }
.ege-theory-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.ege-theory-controls[hidden] { display: none; }
.ege-theory-controls button {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid #4f796e;
  border-radius: 8px;
  background: #f4f8f6;
  color: #173b50;
  font: inherit;
  cursor: pointer;
}
.ege-theory-controls button[aria-pressed="true"] { background: #156652; color: #fff; }
.ege-theory-controls button:focus-visible { outline: 3px solid #3f68bf; outline-offset: 3px; }
.ege-theory-model .ege-theory-diagram {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}
.ege-theory-diagram li {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #e7eff6;
  color: var(--theory-ink);
  overflow-wrap: anywhere;
}
.ege-theory-diagram li:last-child { background: #dcefe4; }
.ege-theory-diagram li:not(:last-child)::after {
  content: "→" / "";
  position: absolute;
  top: 50%;
  right: -18px;
  transform: translateY(-50%);
}
.ege-theory-diagram span { display: block; font-size: .83rem; margin-bottom: 6px; }
.ege-theory-diagram strong { display: block; }
.ege-theory-result p:last-child { margin-bottom: 0; }
@media (max-width: 620px) {
  .ege-theory-model .ege-theory-diagram { grid-template-columns: 1fr; }
  .ege-theory-diagram li:not(:last-child)::after {
    content: "↓" / "";
    top: auto;
    bottom: -23px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}
