.quiz-flyout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 42, 74, 0.4);
  backdrop-filter: blur(3px);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

header {
  background: rgba(246, 250, 255, 0.92) !important;
  border-bottom: 1px solid rgba(159, 176, 209, 0.2) !important;
}

.nav {
  min-height: 82px;
}

.brand {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

.badge {
  font-size: 0.9rem;
  padding: 6px 12px;
  box-shadow: 0 0 24px rgba(107, 226, 255, 0.3);
}

nav ul {
  gap: 34px;
}

nav ul a {
  font-size: 1.02rem;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.nav-actions .btn {
  border-radius: 12px;
  padding: 12px 22px;
}

.nav-actions .btn.alt {
  border: 1px solid rgba(79, 140, 255, 0.5);
  background: #ffffff;
}

@media (min-width: 901px) {
  .nav {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
  }

  .nav > nav {
    justify-self: center;
  }

  .nav > nav .nav-links {
    justify-content: center;
  }

  .nav .nav-actions {
    margin-left: 0;
    justify-self: end;
  }
}

.quiz-flyout-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.quiz-flyout {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(520px, 100vw);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.99), rgba(242, 247, 255, 0.99));
  border-left: 1px solid rgba(47, 109, 255, 0.24);
  box-shadow: -20px 0 38px rgba(38, 67, 122, 0.16);
  z-index: 120;
  transform: translateX(104%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
}

.quiz-flyout.open {
  transform: translateX(0);
}

.quiz-flyout-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(159, 176, 209, 0.2);
}

.quiz-flyout-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.quiz-flyout-header p {
  margin: 4px 0 0;
  color: #5f7092;
  font-size: 14px;
}

.quiz-close {
  border: 1px solid #d4e1f6;
  color: #1d2b45;
  background: #fff;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.quiz-flyout-body {
  overflow-y: auto;
  padding: 14px 20px 20px;
}

.quiz-flyout fieldset {
  margin: 0 0 14px;
  border: 1px solid #d4e1f6;
  border-radius: 12px;
  padding: 12px;
}

.quiz-flyout legend {
  padding: 0 8px;
  font-weight: 700;
}

.quiz-flyout label {
  display: block;
  margin: 8px 0;
  color: #2f4468;
  font-size: 14px;
}

.quiz-wrap .choice-option,
.quiz-flyout .choice-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  white-space: normal;
}

.quiz-wrap .choice-option input[type="radio"],
.quiz-wrap .choice-option input[type="checkbox"],
.quiz-flyout .choice-option input[type="radio"],
.quiz-flyout .choice-option input[type="checkbox"] {
  margin: 0;
  align-self: center;
}

.quiz-wrap .choice-option span,
.quiz-flyout .choice-option span {
  min-width: 0;
}

.quiz-flyout input[type="text"],
.quiz-flyout input[type="email"],
.quiz-flyout select,
.quiz-flyout textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #d4e1f6;
  border-radius: 10px;
  background: #ffffff;
  color: #1d2b45;
}

.quiz-flyout .quiz-submit {
  border: 1px solid transparent;
  background: linear-gradient(90deg, #4f8cff, #6c6dff);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
}

.quiz-flyout-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(47, 109, 255, 0.08);
  border: 1px solid rgba(47, 109, 255, 0.28);
}

.mobile-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #d4e1f6;
  background: #ffffff;
  color: #1d2b45;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  display: block;
}

.mobile-nav-toggle span::before,
.mobile-nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
}

.mobile-nav-toggle span::before { top: -6px; }
.mobile-nav-toggle span::after { top: 6px; }

.mobile-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(340px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid #d4e1f6;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(38, 67, 122, 0.18);
  z-index: 70;
}

.mobile-menu.open { display: block; }

.mobile-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #1d2b45;
}

.mobile-menu a:hover,
.mobile-menu summary:hover,
.mobile-menu summary.current { background: rgba(47, 109, 255, 0.1); }

@media (max-width: 900px) {
  nav {
    position: relative;
    margin-left: auto;
  }

  .nav {
    align-items: center !important;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
  }

  .nav .brand {
    font-size: 1.6rem;
  }

  .brand .badge {
    display: inline-flex;
    font-size: 0.78rem;
    padding: 5px 10px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none !important;
  }

  .nav-actions {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(159, 176, 209, 0.18);
  }

  .nav-actions .btn {
    justify-content: center;
    text-align: center;
    padding: 12px 14px;
  }
}
