/* Compact quiz layout and action alignment - 2026-08-22 */

/* Back + explain are a matched left/right pair everywhere. */
#screen-quiz .question-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  align-items:stretch;
}
#screen-quiz .question-actions > button{
  width:100%;
  min-height:44px;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
#screen-quiz #backBtn{justify-self:stretch}
#screen-quiz #explainBtn{justify-self:stretch}

/* The old duplicate hesitation action is intentionally retired. */
#screen-quiz .never-thought{display:none!important}

/* Keep the results review CTA directly with the challenge action. */
#screen-results #challengeResultBtn + #reviewAnswersBtn{
  margin-top:8px;
  width:100%;
}

/* Keep the footer below the quiz viewport. */
#screen-quiz.active{
  min-height:calc(100svh - 72px);
}

/* Phone quiz: use the available viewport and let the answer buttons fill it. */
@media(max-width:760px){
  #screen-quiz{
    padding-top:8px;
    padding-bottom:10px;
  }
  #screen-quiz.active{
    min-height:calc(100svh - 58px);
    display:flex;
    flex-direction:column;
  }
  #screen-quiz .sticky-status{
    position:relative;
    top:auto;
    flex:0 0 auto;
    padding:3px 0 9px;
    background:var(--bg);
  }
  #screen-quiz .status-row{
    margin-bottom:5px;
    font-size:11px;
  }
  #screen-quiz .progress{height:5px}

  #screen-quiz .question-card{
    flex:1 1 auto;
    min-height:0;
    display:flex;
    flex-direction:column;
    padding:16px;
    border-radius:20px;
  }
  #screen-quiz .question-meta{
    font-size:10px;
    line-height:1.2;
  }
  #screen-quiz .why-question{
    padding-top:4px;
    font-size:11px;
    line-height:1.2;
  }
  #screen-quiz .why-answer{
    margin-top:6px;
    padding:9px 11px;
    font-size:12px;
    line-height:1.35;
  }
  #screen-quiz .question-card h2{
    font-size:clamp(24px,6.8vw,30px);
    line-height:1.08;
    margin:9px 0 12px;
  }

  #screen-quiz .answers{
    flex:1 1 auto;
    min-height:0;
    display:grid;
    grid-auto-rows:minmax(0,1fr);
    gap:8px;
    margin:10px 0 12px;
  }
  #screen-quiz .answer,
  #screen-quiz .no-fit-answer{
    height:100%;
    min-height:0;
    display:flex;
    align-items:center;
    justify-content:flex-start;
  }
  #screen-quiz .answer{
    padding:12px 14px;
    border-radius:14px;
    font-size:16px;
    line-height:1.28;
  }
  #screen-quiz .no-fit-answer{
    margin-top:0;
    padding:11px 13px;
    border-radius:14px;
    font-size:14px;
    line-height:1.22;
    justify-content:center;
  }
  #screen-quiz .no-fit-answer small{
    margin-top:3px;
    font-size:10px;
    line-height:1.15;
  }
  #screen-quiz .question-actions{
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:0;
    padding-top:2px;
  }
  #screen-quiz .question-actions > button{
    min-height:46px;
    padding:9px 10px;
    font-size:13px;
    line-height:1.15;
  }
  #screen-quiz .explainer{
    margin-top:9px;
    padding:12px;
    border-radius:14px;
    font-size:13px;
    line-height:1.35;
  }
  #screen-quiz .explainer p{margin:5px 0}
  #screen-quiz .explainer-tradeoff{
    margin-top:7px;
    padding-top:7px;
  }
}

/* On short phones, keep everything visible but still use the card efficiently. */
@media(max-width:760px) and (max-height:740px){
  .topbar{padding-bottom:8px}
  #screen-quiz .question-card{padding:11px}
  #screen-quiz .question-card h2{font-size:21px;margin:5px 0 7px}
  #screen-quiz .answers{gap:5px;margin:6px 0 8px}
  #screen-quiz .answer{padding:7px 10px;font-size:13px;line-height:1.16}
  #screen-quiz .no-fit-answer{padding:7px 10px;font-size:12px}
  #screen-quiz .question-actions{padding-top:1px}
  #screen-quiz .question-actions > button{min-height:38px;padding:6px;font-size:11px}
}
