/* Live exam progress bar and pre-grading selected-answer states */
.exam-progress-shell {
  position: sticky;
  top: 64px;
  z-index: 45;
  max-height: 0;
  overflow: hidden;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 260ms ease, opacity 220ms ease, transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.exam-progress-shell.is-visible {
  max-height: 110px;
  overflow: visible;
  border-bottom: 1px solid rgba(16, 42, 86, 0.09);
  background: rgba(255, 254, 250, 0.97);
  box-shadow: 0 5px 16px rgba(10, 27, 57, 0.075);
  opacity: 1;
  transform: translateY(0);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.exam-progress-inner {
  width: min(calc(100% - 32px), 1080px);
  margin: 0 auto;
  padding: 10px 0 11px;
}

.exam-progress-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.exam-section-progress {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid #d8e0e6;
  border-radius: 13px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.82);
  color: #142036;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(16, 42, 86, 0.04);
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.exam-section-progress:hover {
  border-color: #a9bbc7;
  background: #fff;
  box-shadow: 0 5px 14px rgba(16, 42, 86, 0.09);
  transform: translateY(-1px);
}

.exam-section-progress:focus-visible {
  outline: 3px solid rgba(0, 165, 181, 0.28);
  outline-offset: 2px;
}

.exam-section-progress-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #c9d4dc;
  border-radius: 10px;
  background: #f3f6f8;
  color: #617083;
  font-size: 0.82rem;
  font-weight: 900;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.exam-section-progress-content,
.exam-section-progress-heading {
  min-width: 0;
}

.exam-section-progress-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.exam-section-progress-title {
  overflow: hidden;
  color: #102a56;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-section-progress-percent {
  flex: 0 0 auto;
  color: #617083;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.exam-section-progress-track {
  position: relative;
  display: block;
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e0e7ec;
}

.exam-section-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0095a5 0%, #08bcc8 100%);
  box-shadow: 0 1px 5px rgba(0, 165, 181, 0.3);
  transition: width 280ms ease;
}

.exam-section-progress-count {
  display: block;
  margin-top: 4px;
  color: #738191;
  font-size: 0.67rem;
  font-weight: 750;
  line-height: 1;
}

.exam-section-progress.is-started {
  border-color: #b8dfe2;
  background: linear-gradient(145deg, #fff 0%, #f0fafb 100%);
}

.exam-section-progress.is-started .exam-section-progress-index {
  border-color: #69c4cc;
  background: #e7f7f8;
  color: #007f8c;
  box-shadow: 0 0 0 3px rgba(0, 165, 181, 0.08);
}

.exam-section-progress.is-started .exam-section-progress-percent {
  color: #007f8c;
}

.exam-section-progress.is-complete {
  border-color: #a8d2bb;
  background: linear-gradient(145deg, #fff 0%, #edf8f2 100%);
}

.exam-section-progress.is-complete .exam-section-progress-index {
  border-color: #19744e;
  background: #19744e;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(25, 116, 78, 0.1);
}

.exam-section-progress.is-complete .exam-section-progress-fill {
  background: linear-gradient(90deg, #19744e 0%, #2b9369 100%);
}

.exam-section-progress.is-complete .exam-section-progress-percent,
.exam-section-progress.is-complete .exam-section-progress-count {
  color: #19744e;
}

.exam-section {
  scroll-margin-top: 178px;
}

/* Selected answers before grading */
.answer-option:has(input:checked):not(.correct-option):not(.wrong-option) {
  border-color: #69c4cc;
  background: #edf9fa;
  box-shadow: inset 3px 0 0 #00a5b5, 0 2px 7px rgba(0, 165, 181, 0.08);
}

.answer-option:has(input:checked):not(.correct-option):not(.wrong-option) .letter {
  color: #007f8c;
}

.match-row.has-progress-answer:not(.is-correct):not(.is-wrong) {
  border-color: #8bcfd5;
  background: #f1fafb;
  box-shadow: inset 3px 0 0 #00a5b5;
}

.match-row.has-progress-answer:not(.is-correct):not(.is-wrong) select,
.inline-answer-control.has-progress-answer:not(.inline-correct):not(.inline-wrong) select,
.inline-answer-control.has-progress-answer:not(.inline-correct):not(.inline-wrong) input {
  border-color: #52b8c2;
  background-color: #f1fafb;
  box-shadow: 0 0 0 2px rgba(0, 165, 181, 0.1);
}

@media (max-width: 760px) {
  .exam-progress-inner {
    width: min(calc(100% - 20px), 1080px);
    padding-block: 8px 9px;
  }

  .exam-progress-sections {
    gap: 6px;
  }

  .exam-section-progress {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 6px;
    border-radius: 10px;
    padding: 7px;
  }

  .exam-section-progress-index {
    width: 25px;
    height: 25px;
    border-radius: 8px;
    font-size: 0.7rem;
  }

  .exam-section-progress-title {
    font-size: 0.68rem;
  }

  .exam-section-progress-percent {
    font-size: 0.68rem;
  }

  .exam-section-progress-count {
    font-size: 0.61rem;
  }

  .exam-section {
    scroll-margin-top: 164px;
  }
}

@media (max-width: 500px) {
  .exam-section-progress {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .exam-section-progress-index {
    display: none;
  }

  .exam-section-progress-title {
    font-size: 0.62rem;
  }

  .exam-section-progress-percent {
    font-size: 0.63rem;
  }

  .exam-section-progress-count {
    font-size: 0.58rem;
  }
}

@media print {
  .exam-progress-shell {
    display: none !important;
  }
}