.section-header .progress-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

#titles {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

#titles-section {
  display: none;
  margin-top: 20px;
}

#group-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.speaker-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}


.speaker-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-dark);
  border: 4px solid var(--paper);
  box-shadow:
    0 0 0 1px var(--border-color),
    0 8px 20px rgba(93, 64, 55, 0.3);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.speaker-btn svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.speaker-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 0 0 1px var(--border-color),
    0 12px 24px rgba(93, 64, 55, 0.4);
  background: var(--brand-primary);
}

.speaker-btn:active {
  transform: scale(0.95);
}

.speed-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 20px auto;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  width: fit-content;
  user-select: none;
  margin-top: 10px;
  padding: 4px 12px;
  background: var(--paper);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  box-shadow: none;
}


.speed-indicator:hover {
  background: #fff;
  border-color: var(--brand-accent);
}

.speed-indicator .speed-icon {
  color: var(--brand-primary);
}

.translation-toggle {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 26px;
  background: #ddd;
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 3px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.translation-toggle .circle {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.translation-toggle .label {
  font-size: 0.7rem;
  font-weight: bold;
  margin-left: 4px;
  color: #444;
  pointer-events: none;
}

.translation-toggle.on {
  background: linear-gradient(135deg, #4cafef, #0078d7);
}

.translation-toggle.on .circle {
  transform: translateX(24px);
}

.mcq-question {
  margin: auto;
  text-align: center;
  color: black;
}

#mcq-question-english {
  font-family: var(--font-sans);
  text-align: center;
  color: var(--brand-dark);
  font-size: 1.1rem;
  margin-bottom: 20px;
  font-weight: 500;
}

#loading-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

#loading-popup-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-popup-overlay .loading-content-box {
  background: var(--bg-modal);
  padding: 25px 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

#status-text {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  display: block;
  margin-bottom: 10px;
}

#dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.loader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 16px;
}

.loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-dark);
  opacity: .25;
  animation: dotPulse 1.2s ease-in-out infinite;
}

.loader span:nth-child(2) {
  animation-delay: .2s;
}

.loader span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes dotPulse {

  0%,
  60%,
  100% {
    transform: scale(1);
    opacity: .25;
  }

  30% {
    transform: scale(1.6);
    opacity: 1;
  }
}

#dots.loader {
  display: inline-flex;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .loader span {
    animation: none;
    opacity: .6;
  }
}