/* Panel de actividades, secciones, pestañas y footer. */
.panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}
.control-section {
  background: #ffffff80;
  border: 1px solid #e0eaf4;
  border-radius: 17px;
  padding: 10px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  font-weight: bold;
  font-size: calc(13px * var(--text-scale, 1));
  color: #396388;
}
.section-title small {
  font-size: calc(9px * var(--text-scale, 1));
  font-weight: normal;
  color: #889db1;
}
.foot {
  font-size: calc(10px * var(--text-scale, 1));
  color: #8197ad;
  line-height: 1.7;
  padding: 0 9px;
}
@media (max-height: 640px) and (min-width: 851px) {
  .panel {
    gap: 7px;
  }

  .control-section {
    padding: 7px;
  }

  .section-title {
    margin-bottom: 5px;
    font-size: calc(12px * var(--text-scale, 1));
  }

  .foot {
    font-size: calc(9px * var(--text-scale, 1));
    line-height: 1.4;
  }
}

/* Compact activity panel: retain readable labels and remove shortcut rows. */
@media (min-width: 851px) and (pointer: fine), (min-width: 1101px) {
  .panel {
    gap: 8px;
  }

  .control-section {
    padding: 8px;
    flex-shrink: 0;
  }

  .section-title {
    margin-bottom: 6px;
  }

  .foot {
    font-size: calc(9px * var(--text-scale, 1));
    line-height: 1.2;
    padding: 0 4px;
  }
}
@media (min-width: 851px) and (pointer: fine) and (max-height: 680px),
  (min-width: 1101px) and (max-height: 680px) {
  .panel {
    gap: 6px;
  }

  .control-section {
    padding: 6px;
  }

  .section-title {
    margin-bottom: 4px;
  }
}
@media (min-width: 851px) and (pointer: fine) and (max-height: 680px),
  (min-width: 1101px) and (max-height: 680px) {
  .foot {
    display: none;
  }
}
.mobile-tabs {
  display: none;
}
.panel .section-title {
  display: none;
}
/* Reserve the same icon and two-line label space in every learning category. */
.panel {
  --lesson-card-height: calc(50px * var(--text-scale, 1) + 14px);
}
@media (max-width: 850px), (pointer: coarse) and (max-width: 1100px) {
  .section-title {
    display: none;
  }

  .panel {
    grid-row: 2;
    grid-column: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .control-section {
    min-height: 0;
    padding: 7px;
    border-radius: 16px;
    overflow-y: auto;
  }
}
@media (max-width: 850px) and (orientation: portrait) and (max-height: 650px) {
  .control-section {
    padding: 5px;
  }
}
@media (max-width: 850px) and (orientation: landscape) and (max-height: 500px),
  (pointer: coarse) and (max-width: 1100px) and (orientation: landscape) and (max-height: 500px) {
  .panel {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }

  .control-section {
    padding: 5px;
  }
}

/* Compact sections remain natural height; panel-content owns scrolling. */
@media (max-width: 850px), (pointer: coarse) and (max-width: 1100px) {
  .panel .control-section {
    overflow: visible;
    flex-shrink: 0;
  }
}
@media (max-width: 850px) and (orientation: landscape) and (max-height: 500px),
  (pointer: coarse) and (max-width: 1100px) and (orientation: landscape) and (max-height: 500px) {
  .panel .control-section {
    padding: 4px;
  }
}
@media (max-width: 850px), (pointer: coarse) and (max-width: 1100px) {
  .panel {
    --lesson-card-height: calc(45px * var(--text-scale, 1) + 10px);
  }
}
@media (max-width: 850px) and (orientation: landscape) and (max-height: 500px),
  (pointer: coarse) and (max-width: 1100px) and (orientation: landscape) and (max-height: 500px) {
  .panel {
    --lesson-card-height: calc(43px * var(--text-scale, 1) + 8px);
  }
}
@media (pointer: coarse) and (orientation: landscape) and (min-width: 900px) and (max-width: 1100px) and (min-height: 501px) {
  .panel {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    min-height: 0;
  }
}
@media (orientation: landscape) and (max-height: 400px) and (max-width: 1100px) {
  .panel {
    --lesson-card-height: calc((100svh - 224px) / 3);
  }
}

.panel-content {
  display: flex;
  flex-direction: column;
  gap: inherit;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.panel .control-section {
  container-type: inline-size;
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1100px) {
  .panel {
    gap: 1px;
  }
}
@media (max-width: 850px), (pointer: coarse) and (max-width: 1100px) {
  .panel .panel-content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
@media (min-width: 851px) and (pointer: fine), (min-width: 1101px) {
  .panel {
    min-height: min-content;
    overflow: visible;
  }

  .panel .panel-content {
    flex: 1 0 auto;
    overflow: visible;
  }
}
