/* Keep all four diagnosis screens on the same reading axis, clear of the orange edge. */
#diagnosis .quiz-shell {
  --diagnosis-edge: clamp(8px, 2.6vw, 32px);
  --diagnosis-gutter: clamp(18px, 4vw, 60px);
}

#diagnosis .quiz-shell::after {
  width: var(--diagnosis-edge);
}

#diagnosis .quiz-shell > .quiz-screen {
  grid-template-columns: minmax(0, 1fr);
  padding-inline: max(var(--diagnosis-gutter), calc((100% - 62rem) / 2));
}

#diagnosis .quiz-shell > .quiz-screen > * {
  min-width: 0;
}

#diagnosis .quiz-question .answer-grid button {
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(10px, 1.3vw, 18px);
  padding-inline: clamp(12px, 1.7vw, 24px);
}

#diagnosis .quiz-final :is(.quiz-verdict-main, .quiz-verdict-side) {
  min-width: 0;
  padding-inline: clamp(14px, 2.2vw, 30px);
  overflow-wrap: anywhere;
}

/* A complete, tappable question index above its answer on phones and tablets. */
@media (max-width: 980px) {
  #shift .objection-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  #shift .objection-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 1px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 1px;
    background: #bcc3c8;
    border-radius: 9px;
    overflow: clip;
    scroll-snap-type: none;
    touch-action: auto;
    cursor: auto;
  }

  #shift .objection-tabs button:nth-child(n) {
    display: flex;
    flex-flow: column;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    min-height: 68px;
    margin: 0;
    padding: 11px clamp(10px, 2.7vw, 18px) 13px;
    border: none;
    border-radius: 0;
    color: #242329;
    background: #f3f5f6;
    box-shadow: none;
    font-size: clamp(.85rem, 2.5vw, .96rem);
    line-height: 1.22;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #shift .objection-tabs button span {
    color: #795f50;
    font: 500 .63rem/1 var(--mono-font);
  }

  #shift .objection-tabs button[aria-selected="true"] {
    color: white;
    background: linear-gradient(120deg, #312927, #16171a 68%);
    box-shadow: inset 3px 0 #ff732f;
  }

  #shift .objection-tabs button[aria-selected="true"] span {
    color: #ffab71;
  }

  #shift .objection-tabs button:focus-visible {
    outline: 2px solid #cd460f;
    outline-offset: -4px;
  }
}

@media (max-width: 560px) {
  #shift .objection-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Let the rotated stripe bleed past both viewport edges while its copy stays centered. */
@media (max-width: 860px) {
  .roadmap-result > .roadmap-result-ribbon {
    position: absolute;
    top: 50%;
    inset-inline: -24px;
    width: auto;
    max-width: none;
    transform: translateY(-50%) rotate(-2.2deg);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-content: center;
    gap: 8px;
    padding: 16px 34px;
    text-align: center;
  }

  .roadmap-result .roadmap-result-mark {
    display: none;
  }

  .roadmap-result > .roadmap-result-ribbon > strong {
    font-size: clamp(1.45rem, 6.3vw, 3rem);
    line-height: 1.08;
    white-space: normal;
    text-wrap: balance;
  }
}
