.fe-learning-demo {
  border: 1px solid rgba(11, 111, 174, 0.28);
  border-radius: 12px;
  margin: 1.5rem 0;
  padding: 1rem;
}

.fe-learning-demo__title {
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.fe-learning-demo__lead {
  margin: 0 0 1rem;
}

.fe-learning-demo__rates {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.fe-learning-demo__rate {
  border: 1px solid rgba(11, 111, 174, 0.2);
  border-radius: 8px;
  padding: 0.65rem 0.5rem;
  text-align: center;
}

.fe-learning-demo__rate strong,
.fe-learning-demo__result strong {
  display: block;
  font-size: 1.2rem;
}

.fe-learning-demo__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.fe-learning-demo__button {
  background: transparent;
  border: 1px solid #0b6fae;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0.5rem 0.85rem;
}

.fe-learning-demo__button:hover,
.fe-learning-demo__button:focus-visible {
  background: rgba(11, 111, 174, 0.1);
}

.fe-learning-demo__button[aria-pressed="true"] {
  background: #0b6fae;
  color: #fff;
  font-weight: 700;
}

.fe-learning-demo__flow {
  align-items: stretch;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0;
}

.fe-learning-demo__step {
  border: 1px solid rgba(11, 111, 174, 0.24);
  border-radius: 8px;
  padding: 0.7rem 0.45rem;
  text-align: center;
}

.fe-learning-demo__step.is-first {
  background: rgba(11, 111, 174, 0.12);
  border-color: #0b6fae;
  font-weight: 700;
}

.fe-learning-demo__result {
  background: rgba(11, 111, 174, 0.07);
  border-radius: 10px;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
}

.fe-learning-demo__breakdown {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.fe-learning-demo__hint {
  font-size: 0.92em;
  margin: 0.8rem 0 0;
  opacity: 0.82;
}

.fe-binary-demo__array {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 1rem 0;
}

.fe-binary-demo__cell {
  border: 1px solid rgba(11, 111, 174, 0.26);
  border-radius: 8px;
  min-width: 0;
  padding: 0.65rem 0.2rem;
  position: relative;
  text-align: center;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.fe-binary-demo__cell.is-discarded {
  opacity: 0.25;
}

.fe-binary-demo__cell.is-mid {
  background: rgba(11, 111, 174, 0.13);
  border-color: #0b6fae;
  font-weight: 700;
}

.fe-binary-demo__cell.is-found {
  outline: 3px solid rgba(11, 111, 174, 0.35);
  outline-offset: 2px;
}

.fe-binary-demo__index {
  display: block;
  font-size: 0.75rem;
  opacity: 0.65;
}

.fe-binary-demo__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.fe-binary-demo__status {
  background: rgba(11, 111, 174, 0.07);
  border-radius: 10px;
  min-height: 3.2rem;
  padding: 0.8rem 1rem;
}

.fe-adj-demo__stage {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin: 1rem 0;
}

.fe-adj-demo__matrix {
  border-collapse: collapse;
  margin: 0 auto;
  text-align: center;
  width: 100%;
}

.fe-adj-demo__matrix th,
.fe-adj-demo__matrix td {
  border: 1px solid rgba(11, 111, 174, 0.2);
  padding: 0.25rem;
}

.fe-adj-demo__matrix button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  min-height: 2rem;
  width: 100%;
}

.fe-adj-demo__matrix button[aria-pressed="true"] {
  background: rgba(11, 111, 174, 0.14);
  font-weight: 700;
}

.fe-adj-demo__matrix .is-diagonal {
  opacity: 0.45;
}

.fe-adj-demo__graph {
  aspect-ratio: 1.2;
  border: 1px solid rgba(11, 111, 174, 0.18);
  border-radius: 10px;
  margin: 0 auto;
  max-width: 320px;
  position: relative;
  width: 100%;
}

.fe-adj-demo__graph svg {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.fe-adj-demo__edge {
  stroke: #0b6fae;
  stroke-width: 3;
}

.fe-adj-demo__edge.is-off {
  display: none;
}

.fe-adj-demo__node {
  align-items: center;
  background: #fff;
  border: 2px solid #0b6fae;
  border-radius: 50%;
  display: flex;
  font-weight: 700;
  height: 2.5rem;
  justify-content: center;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 2.5rem;
}

.fe-adj-demo__node.n1 { left: 18%; top: 20%; }
.fe-adj-demo__node.n2 { left: 82%; top: 20%; }
.fe-adj-demo__node.n3 { left: 18%; top: 80%; }
.fe-adj-demo__node.n4 { left: 82%; top: 80%; }

.fe-adj-demo__status {
  background: rgba(11, 111, 174, 0.07);
  border-radius: 10px;
  padding: 0.8rem 1rem;
}

@media (max-width: 520px) {
  .fe-learning-demo__rates,
  .fe-learning-demo__flow,
  .fe-adj-demo__stage {
    grid-template-columns: 1fr;
  }

  .fe-learning-demo__controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .fe-learning-demo__button {
    width: 100%;
  }

  .fe-binary-demo__array {
    gap: 0.25rem;
  }

  .fe-binary-demo__cell {
    font-size: 0.88rem;
    padding: 0.55rem 0.1rem;
  }
}
