.quiz-layout {
  min-width: 0;
}

#quiz-sidenav {
  min-width: 0;
}

.stepnav-wrap {
  position: sticky;
  top: 1rem;
}

.stepnav-scroll {
  min-width: 0;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.stepnav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.stepnav-item {
  min-width: 0;
}

.stepnav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.6rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(16, 42, 77, 0.08);
  border-radius: 10px;
  background: rgba(250, 252, 255, 0.72);
  color: #1d2b3f;
  box-shadow: none;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.stepnav-link:hover {
  border-color: rgba(27, 79, 135, 0.22);
  background: rgba(245, 249, 253, 0.98);
}

.stepnav-link:focus-visible {
  outline: none;
  border-color: rgba(27, 79, 135, 0.7);
  box-shadow: 0 0 0 4px rgba(27, 79, 135, 0.12);
}

.stepnav-item.active .stepnav-link {
  border-color: rgba(23, 65, 112, 0.3);
  background: rgba(235, 243, 251, 0.95);
  color: #102a4d;
  box-shadow: 0 2px 8px rgba(11, 23, 39, 0.06);
}

.stepnav-item.done:not(.active) .stepnav-link {
  border-color: rgba(47, 95, 68, 0.14);
  background: rgba(249, 252, 250, 0.96);
}

.stepnav .step-label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  line-height: 1.25;
  font-size: 0.82rem;
}

.badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(96, 110, 132, 0.6);
  box-shadow: none;
}

.stepnav-item.active .badge-dot {
  background: #1b4f87;
}

.stepnav-item.done .badge-dot {
  background: #2d8657;
}

@media (max-width: 991.98px) {
  .stepnav-wrap {
    position: static;
  }

  .stepnav-scroll {
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 0.3rem;
    margin: 0 -0.05rem;
    scrollbar-width: none;
  }

  .stepnav-scroll::-webkit-scrollbar {
    display: none;
  }

  .stepnav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.55rem;
    width: max-content;
    padding-inline: 0.05rem;
  }

  .stepnav-item {
    flex: 0 0 auto;
  }

  .stepnav-link {
    width: auto;
    min-height: 2.95rem;
    padding: 0.72rem 0.95rem;
    border-radius: 14px;
    white-space: nowrap;
  }

  .stepnav .step-label {
    font-size: 0.91rem;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  .stepnav-link {
    min-height: 2.8rem;
    padding: 0.65rem 0.85rem;
  }

  .stepnav .step-label {
    font-size: 0.87rem;
  }
}
