html,
body {
  touch-action: pan-x pan-y;
}

.investment-risk-warning {
  flex: none;
  margin: 0;
  padding: 16px 20px;
  color: #fff;
  background: #2d5488;
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
  overflow-anchor: none;
}

.desktop-warning {
  display: none;
  flex: none;
  overflow-anchor: none;
}
@media (min-width: 768px) {
  .investment-risk-warning {
    display: block;
  }
  .desktop-warning {
    display: block;
    background: #d4f7ff;
    padding: 44px 48px 30px;
    color: #000;
  }
  .desktop-warning-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.35;
    letter-spacing: 1.4px;
    overflow-wrap: anywhere;
  }
  .desktop-warning-content p {
    margin: 0 0 4px;
  }
  .desktop-warning-content p:first-child {
    font-size: 20px;
    font-weight: 700;
  }
  .desktop-warning-content p:last-child {
    font-weight: 700;
  }
}

/* Keep the viewport steady when the home content is replaced by the quiz. */
body:has(.hero) {
  overflow-anchor: none;
}

@media (max-width: 767px) {
  body > .investment-risk-warning {
    color: #ffffff;
    background: #6291c4;
    opacity: 1;
    text-align: center;
    font-size: 18px;
  }
}

:root {
  --info-bar-height: 50px;
}
.desktop-warning {
  display: none !important;
}
.desktop-info-actions {
  display: none;
}
.bottom-actions.info-actions {
  position: fixed;
  inset: auto 0 0;
  display: flex;
  z-index: 55;
  padding-bottom: env(safe-area-inset-bottom);
  background: #2d5488;
}
.bottom-actions.info-actions button {
  width: 50%;
  height: var(--info-bar-height);
  min-height: var(--info-bar-height);
  border: 0;
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
.bottom-actions.info-actions button:first-child {
  background: #087fe7;
}
.bottom-actions.info-actions button:last-child {
  background: #232f93;
}
@media (max-width: 767px) {
  .quiz-main .next-bar {
    bottom: calc(var(--info-bar-height) + env(safe-area-inset-bottom));
    padding-bottom: 0;
  }
  body:has(.info-actions) .site-footer {
    padding-bottom: calc(
      16px + var(--info-bar-height) + env(safe-area-inset-bottom)
    );
  }
  body:has(.next-bar) .site-footer {
    padding-bottom: calc(
      16px + var(--info-bar-height) + var(--next-height) +
        env(safe-area-inset-bottom)
    );
  }
  body:has(.is-complete, .is-registering) .preview-status {
    bottom: calc(24px + var(--info-bar-height) + env(safe-area-inset-bottom));
  }
}
@media (min-width: 768px) {
  :root {
    --info-bar-height: 0px;
  }
  .bottom-actions.info-actions {
    display: none;
  }
  .desktop-info-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: fixed;
    right: 24px;
    top: 35%;
    z-index: 55;
  }
  .desktop-info-actions .desktop-rules-button {
    display: block !important;
    position: static;
    transform: none;
    border: 0;
    border-radius: 12px;
    padding: 20px 16px;
    background: #2549ad;
    color: white;
    writing-mode: vertical-rl;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
  }
  .desktop-info-actions .desktop-rules-button:hover {
    background: #2d58c2;
  }
}

@media (min-width: 768px) {
  body:has(> .site-footer) {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background-color: #6291c4;
  }
  body > .site-footer {
    margin-top: auto;
    flex-shrink: 0;
  }
  .hero:not(.quiz-main)::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 180px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(98, 145, 196, 0), #6291c4);
  }
}

#rules-content .rules-numbered {
  list-style: decimal;
  padding-left: 24px;
  margin: 10px 0 18px;
}
#rules-content .rules-numbered li::before {
  content: none;
}

/* Shared disclosure for the homepage and all three quiz questions. */
.fund-risk-disclosure {
  display: none;
  flex: none;
  padding: 8px 20px 20px;
  background: #6291c4;
  color: #fff;
  overflow-anchor: none;
}
.fund-risk-disclosure-content {
  max-width: 1200px;
  margin: 0 auto;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.fund-risk-disclosure-content p {
  margin: 0;
}
.fund-risk-disclosure-content .fund-risk-source {
  margin-bottom: 4px;
  color: #fff;
  font-size: inherit;
  font-weight: 400;
}
.fund-risk-emphasis {
  color: #ffe609;
}
@media (min-width: 768px) {
  .fund-risk-disclosure {
    padding: 12px 48px 24px;
  }
}

body:has(.quiz-main:not(.is-complete):not(.is-registering)) > .fund-risk-disclosure {
  display: block;
}

/* Keep the homepage warning together with the footer at the bottom. */
@media (min-width: 768px) {
  body:has(.hero:not(.quiz-main)) > .investment-risk-warning {
    margin-top: auto;
  }
  body:has(.hero:not(.quiz-main)) > .site-footer {
    margin-top: 0;
  }
}

/* Let answered questions end after their explanation and navigation. */
body .quiz-main.is-answered:not(.is-complete):not(.is-registering) {
  min-height: 0;
}
body .quiz-main.is-answered:not(.is-complete):not(.is-registering) .quiz-content {
  padding-bottom: 16px;
}

.fund-principal-note {
  color: #0141c1;
  font-weight: 700;
}
