/* AIMT-UX-001 stages 4/5: the entry forms share the solving screen's compact
   cards and hierarchy. Keep original form controls, routes and costs intact. */
body.clearpath:is(.cp-quiz,.cp-exam) { --cp-primary:#087e68; --cp-primary-hover:#076453; --cp-line:#d3dfdf; --cp-bg:#f4f8f6; }
body.clearpath.cp-quiz .main-content { max-width:1120px; }
body.clearpath.cp-quiz .cp-page-intro { margin-bottom:12px; }
body.clearpath.cp-quiz .cp-page-intro h1 { font-size:1.5rem; }
body.clearpath.cp-quiz :is(#quiz-generator-form,.math-problem-form) { max-width:100%; padding:24px; border-radius:9px; }
body.clearpath.cp-quiz .cp-entry-description { color:var(--cp-muted); margin:0 0 18px; font-size:.9rem; }
/* Account resume is a compact choice, not a second copy of the question cards. */
body.clearpath.cp-quiz .cp-quiz-resume { border:1px solid var(--cp-line); border-radius:9px; background:#edf5f2; padding:12px 16px; margin-bottom:10px; scroll-margin-top:24px; }
body.clearpath.cp-quiz .cp-quiz-resume[hidden] { display:none; }
body.clearpath.cp-quiz .cp-quiz-resume h2 { font-size:1rem; margin:0 0 6px; }
body.clearpath.cp-quiz .cp-quiz-resume p { font-size:.86rem; line-height:1.45; margin:0 0 8px; color:var(--cp-muted); }
body.clearpath.cp-quiz .cp-resume-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px 18px; }
body.clearpath.cp-quiz .cp-resume-actions a { font-size:.82rem; }
body.clearpath.cp-quiz .cp-resume-actions .button { padding:8px 12px; }
body.clearpath.cp-quiz #quiz-generator-form { display:grid; grid-template-columns:1fr 1fr; gap:8px 18px; }
body.clearpath.cp-quiz #quiz-generator-form :is(h2,p,#quiz-access-note) { grid-column:1/-1; margin-top:0; }
body.clearpath.cp-quiz #quiz-generator-form label[for=topic] { grid-column:1; grid-row:3; }
body.clearpath.cp-quiz #quiz-generator-form label[for=difficulty] { grid-column:2; grid-row:3; }
body.clearpath.cp-quiz #quiz-generator-form #topic { grid-column:1; grid-row:4; }
body.clearpath.cp-quiz #quiz-generator-form #difficulty { grid-column:2; grid-row:4; }
body.clearpath.cp-quiz #quiz-generator-form button { justify-self:start; margin-top:8px; }
body.clearpath.cp-quiz #quiz-generator-form .cp-quiet-button { justify-self:end; }
/* Keep the resumed questions immediately after the continuation choices and
   ahead of the generator. Compact rows preserve aligned actions and legibility. */
body.clearpath.cp-quiz #question-box { padding:0; margin:0 0 16px; background:transparent; border:0; box-shadow:none; }
body.clearpath.cp-quiz #question-box h2 { font-size:1rem; margin:10px 0 8px; }
body.clearpath.cp-quiz #quiz-questions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
/* Share the prompt/action/note rows across adjacent cards. Variable question
   length or a wrapped note must never push one action below its neighbours.
   Explicitly override the older last-child rule that removed bottom padding. */
body.clearpath.cp-quiz .quiz-question,
body.clearpath.cp-quiz .quiz-question:last-child { display:grid; grid-row:span 3; grid-template-rows:subgrid; align-items:start; justify-items:start; padding:12px 14px; margin:0; border:1px solid var(--cp-line); border-radius:9px; background:white; min-width:0; }
body.clearpath.cp-quiz .quiz-question>p:first-child { flex:1; font-size:.88rem; margin:0 0 10px; line-height:1.45; overflow-wrap:anywhere; }
body.clearpath.cp-quiz .quiz-question .practice-launch { font-size:.82rem; padding:8px 12px; }
body.clearpath.cp-quiz .quiz-question .cp-question-note { font-size:.72rem; color:var(--cp-muted); margin:6px 0 0; }
body.clearpath.cp-quiz .quiz-question mjx-container { max-width:100%; overflow:auto; }
body.clearpath.cp-quiz .math-problem-form h2 { margin-top:0; }
body.clearpath.cp-quiz #problem-drop-zone { min-height:90px; border-radius:7px; padding:18px; }
body.clearpath.cp-exam .exam-page-wrapper { max-width:1120px; }
body.clearpath.cp-exam .exam-card { border-radius:9px; padding:24px; }
body.clearpath.cp-exam .cp-exam-fields { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
body.clearpath.cp-exam #exam-cost-note { border-radius:6px; background:#edf5f2; padding:12px; }
body.clearpath.cp-exam .saved-exam-list li { border-radius:7px; padding:16px; }
@media(max-width:700px) {
  body.clearpath.cp-quiz #quiz-questions,body.clearpath.cp-exam .cp-exam-fields { grid-template-columns:1fr; }
  body.clearpath.cp-quiz :is(#quiz-generator-form,.math-problem-form),body.clearpath.cp-exam .exam-card { padding:18px; }
  body.clearpath.cp-quiz #quiz-generator-form { display:block; }
}
