/* Компактная карточка №10: формула хранится в теории блока, а не повторяется в каждом задании. */
.block-theory { gap: 12px; margin-bottom: 14px; padding: 13px 15px; }
.block-theory h4 { margin-bottom: 5px; }
.block-theory ul { gap: 4px; }
.block-theory-example { padding: 10px 12px; }
.task10-card { min-height: 0; }
.task10-card .task-prompt { min-height: 0; margin: 10px 0 6px; }
.task10-card .answer-row { margin-top: 8px; }
.task10-card .feedback { min-height: 20px; margin-top: 5px; }
.task10-card .task-actions { margin-top: 5px; }

/* Все восемь тематических блоков должны быть видны без скрытой горизонтальной прокрутки. */
.task10-page .block-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  overflow: visible;
}

.task10-page .block-tab {
  width: 100%;
  white-space: normal;
  text-align: left;
}

.block-theory-formula {
  width: fit-content;
  max-width: 100%;
  margin: 5px 0 7px;
  padding: 7px 12px;
  overflow-x: auto;
  border: 1px solid #d8c5ec;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #3f2b56;
  font-size: 1.12rem;
}

.task-visual { width: 100%; margin: 3px 0 1px; }
.venn-visual,
.probability-tree { margin: 0; }
.venn-frame {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 2 / 1;
  margin: 0 auto;
  overflow: hidden;
  border: 1.5px solid #8066a5;
  border-radius: 12px;
  background: #fffefd;
}
.venn-circle {
  position: absolute;
  top: 22%;
  width: 45%;
  height: 62%;
  border: 2px solid #4d3965;
  border-radius: 50%;
  background: rgba(183, 153, 218, 0.34);
}
.venn-circle-a { left: 16%; }
.venn-circle-b { right: 16%; background: rgba(174, 219, 202, 0.36); }
.venn-label {
  position: absolute;
  top: 49%;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-style: italic;
}
.venn-label-a { left: 8%; }
.venn-label-b { right: 8%; }
.venn-region-value,
.venn-marker {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
}
.venn-region-value {
  padding: 1px 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.77);
  font: 800 0.86rem/1.1 "Cambria Math", Cambria, serif;
}
.venn-marker {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2f223c;
}
.venn-marker.weighted span {
  position: absolute;
  left: 8px;
  top: -7px;
  white-space: nowrap;
  color: #372747;
  font: 750 0.68rem/1 "Cambria Math", Cambria, serif;
}
.venn-visual figcaption {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.probability-tree {
  width: min(100%, 560px);
  margin-inline: auto;
  padding: 8px 10px;
  border: 1px solid #d4c3e6;
  border-radius: 12px;
  background: #fffefd;
}
.tree-stage {
  position: relative;
  width: 100%;
  height: 250px;
}
.tree-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.tree-lines line {
  stroke: #76658a;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.tree-node {
  position: absolute;
  z-index: 2;
  display: flex;
  max-width: 21%;
  align-items: center;
  gap: 5px;
  transform: translate(-8px, -50%);
  color: #3e3348;
  font-size: 0.74rem;
  line-height: 1.12;
}
.tree-node strong { overflow-wrap: anywhere; }
.tree-node-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border: 2px solid #6d4f91;
  border-radius: 50%;
  background: #fffefd;
  box-shadow: 0 0 0 2px rgba(255, 254, 253, 0.85);
}
.tree-node.root { max-width: 17%; color: #4f376c; }
.tree-node.root .tree-node-dot { width: 13px; height: 13px; background: #74529a; }
.tree-node.leaf.target .tree-node-dot { border-color: #3f876f; background: #ccebdd; }
.tree-probability {
  position: absolute;
  z-index: 3;
  min-width: 30px;
  padding: 1px 4px;
  transform: translate(-50%, -50%);
  border-radius: 5px;
  background: rgba(255, 254, 253, 0.94);
  color: #5f4779;
  font: 800 0.72rem/1.15 "Cambria Math", Cambria, serif;
  text-align: center;
}

@media (max-width: 620px) {
  .block-theory-formula { font-size: 1rem; }
  .venn-frame { width: 100%; }
  .probability-tree { padding: 6px; }
  .tree-stage { height: 230px; }
  .tree-node { max-width: 23%; font-size: 0.66rem; }
  .tree-node.root { max-width: 18%; }
  .tree-node-dot { width: 9px; height: 9px; }
  .tree-node.root .tree-node-dot { width: 11px; height: 11px; }
  .tree-probability { min-width: 27px; font-size: 0.67rem; }
  .venn-marker.weighted span { font-size: 0.62rem; }
}

.block-theory {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  gap: 16px;
  margin: 0 0 18px 55px;
  padding: 16px 18px;
  border: 1px solid #d9cae9;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(250, 247, 253, 0.98), rgba(240, 232, 250, 0.82));
}

.block-theory h4 {
  margin: 0 0 8px;
  color: var(--lavender-dark);
  font-size: 1rem;
}

.block-theory ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #544b61;
}

.block-theory-example {
  align-self: stretch;
  margin: 0;
  padding: 13px 15px;
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: rgba(255, 254, 253, 0.88);
  color: #5f4b20;
  font-family: "Cambria Math", Cambria, Georgia, serif;
  font-size: 1.05rem;
}

.block-theory-example strong {
  display: block;
  margin-bottom: 5px;
  color: #725817;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.82rem;
}

.task10-card {
  display: flex;
  min-height: 430px;
  flex-direction: column;
}

.task-type {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.task10-card .task-prompt {
  min-height: 64px;
  margin: 15px 0 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
}

.task10-card .equation {
  display: flex;
  min-height: 96px;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: center;
  overflow-wrap: anywhere;
  color: #32263e;
  font-family: "Cambria Math", Cambria, Georgia, serif;
  font-size: clamp(1.42rem, 2.5vw, 1.85rem);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.task10-card .equation sup,
.block-theory sup {
  font-size: 0.63em;
  line-height: 0;
}

.task10-card .answer-row {
  margin-top: auto;
}

.teacher-roots {
  margin: 7px 0 11px;
  color: #5f4b20;
  font-weight: 800;
}

body.teacher-mode .task10-card {
  min-height: 0;
}

@media (max-width: 820px) {
  .task10-page .block-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .block-theory {
    grid-template-columns: 1fr;
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .task10-card {
    min-height: 0;
  }

  .task10-card .task-prompt {
    min-height: 0;
  }

  .task10-card .equation {
    min-height: 86px;
    font-size: clamp(1.35rem, 7vw, 1.82rem);
  }
}

/* Эти правила идут после старой верстки и убирают только лишнюю высоту карточек №10. */
.block-theory { gap: 12px; margin-bottom: 14px; padding: 13px 15px; }
.block-theory h4 { margin-bottom: 5px; }
.block-theory ul { gap: 4px; }
.block-theory-example { padding: 10px 12px; }
.task10-card { min-height: 0; }
.task10-card .task-prompt { min-height: 0; margin: 10px 0 6px; }
.task10-card .answer-row { margin-top: 8px; }
.task10-card .feedback { min-height: 20px; margin-top: 5px; }
.task10-card .task-actions { margin-top: 5px; }



@media (max-width: 420px) {
  .task10-page .block-tabs {
    grid-template-columns: 1fr;
  }
}
