/* Mobile study workspace. GOV.UK-inspired colours, with a stable exam frame. */
body { background: #fff; }
#app { padding-top: 24px; padding-bottom: 35px; }
.site-header-inner { padding-block: 8px; min-height: 60px; }
.brand-wordmark { font-size: 27px; }
.header-account { font-size: 14px; }
.prototype-strip { font-size: 12px; padding-block: 7px; gap: 9px; }
.prototype-strip .phase-tag { font-size: 11px; padding: 1px 5px; }
.prototype-strip > span { font-size: 12px !important; }
.prototype-strip a { font-size: 12px; margin-left: auto; }
.view h1 { font-size: 36px; line-height: 1.1; margin: 0 0 18px; letter-spacing: -.025em; }
.section-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; margin: 0 0 10px; }
.full-width { width: 100%; }
.compact-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.compact-heading h1 { margin-bottom: 0; }
.bank-badge { padding: 7px 10px; background: #e8f1f8; color: #174d7a; font-size: 13px; font-weight: 700; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.start-panel { padding: 25px; background: #f4f8fb; border-top: 4px solid var(--brand); }
.start-heading { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.start-heading h1 { font-size: 38px; margin-bottom: 0; }
.compact-signs { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 65px; }
.compact-signs img { object-fit: contain; }
.compact-signs img:last-child { margin-right: 20px; }
.start-copy { margin: 16px 0 22px; font-size: 17px; max-width: 320px; }
.home-progress { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 18px 0; border-top: 1px solid #c9d9e6; margin-bottom: 16px; }
.home-progress > * { font-size: 13px; color: var(--muted); line-height: 1.5; text-decoration: none; }
.home-progress strong { display: block; color: var(--ink); font-size: 26px; line-height: 1.2; margin-bottom: 5px; }
.home-progress strong small { color: var(--muted); font-size: 14px; font-weight: 400; }
.home-progress a { color: var(--link); text-decoration: underline; }
.start-micro { margin: 12px 0 0; font-size: 12px; text-align: center; color: var(--muted); line-height: 1.4; }
.compact-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.compact-section-heading h2 { margin: 0; font-size: 21px; }
.compact-section-heading .text-link { min-height: 32px; font-size: 14px; }
.home-topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-topic { display: flex; align-items: center; gap: 11px; padding: 16px 13px; min-height: 96px; background: #fff; border: 1px solid #cdd5da; color: var(--ink); text-align: left; }
.home-topic:hover { border-color: var(--brand); background: #f4f8fb; }
.topic-initial { font-size: 12px; font-weight: 700; background: #edf3f7; color: #1a65a6; width: 28px; height: 28px; display: grid; place-items: center; flex-shrink: 0; }
.home-topic strong { font-size: 15px; display: block; line-height: 1.25; }
.home-topic small { color: var(--muted); display: block; margin-top: 6px; font-size: 12px; }
.compact-upgrade { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 19px 20px; background: #f3f3f3; margin: 22px 0 10px; border-left: 3px solid var(--brand); text-decoration: none; }
.compact-upgrade strong { display: block; font-size: 17px; color: var(--ink); line-height: 1.35; }
.compact-upgrade small { display: block; font-size: 14px; margin-top: 5px; line-height: 1.4; color: var(--link); }
.compact-details { margin: 0; border-bottom: 1px solid var(--line); }
.compact-details summary { padding: 17px 0; min-height: 52px; font-size: 16px; line-height: 1.4; color: var(--link); cursor: pointer; }
.compact-details > p, .compact-details > a { font-size: 16px; line-height: 1.5; margin-bottom: 20px; }
.compact-link-row { display: flex; flex-wrap: wrap; gap: 5px 20px; padding-bottom: 12px; }
.compact-note { font-size: 14px; color: var(--muted); line-height: 1.4; margin: 16px 0 24px; }
.practice-primary { display: flex; flex-wrap: wrap; gap: 12px; }
.topic-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.topic-choice { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); background: white; text-align: left; padding: 17px; color: var(--ink); min-height: 83px; }
.topic-choice > span:nth-child(2) { flex: 1; }
.topic-choice strong { display: block; font-size: 17px; }
.topic-choice small { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.topic-choice:hover { background: #f4f8fb; border-color: var(--brand); }
.mini-sign-set { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin: 24px 0; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.mini-sign-set > div { display: flex; gap: 8px; }
.mini-sign-set img { width: 42px; height: 42px; object-fit: contain; }
.mini-sign-set .text-link { font-size: 15px; }
.compact-demo { padding: 12px 15px; border-left: 3px solid #b1b4b6; background: #f3f3f3; font-size: 14px; line-height: 1.5; margin: 10px 0 24px; }
.pass-choice { padding: 24px; border: 1px solid var(--line); border-top: 4px solid var(--brand); }
.free-choice { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top-width: 1px; padding: 17px 20px; margin-bottom: 18px; }
.free-choice h2 { font-size: 20px; margin: 0 0 5px; }
.free-choice p { margin: 0; font-size: 14px; }
.free-choice .text-link { font-size: 14px; }
.mobile-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pass-expanded { background: #f4f8fb; }
.pass-choice-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.pass-choice-top h2 { font-size: 27px; margin: 0; }
.pass-choice-top .section-kicker { font-size: 12px; letter-spacing: 0; font-weight: 400; margin-bottom: 6px; }
.compact-price { font-size: 35px; white-space: nowrap; }
.compact-price small { font-size: 12px; font-weight: 400; display: block; text-align: right; }
.pass-facts { display: flex; gap: 20px; padding: 18px 0; margin-top: 18px; border-top: 1px solid var(--line); font-size: 16px; }
.pass-facts strong { font-size: 21px; }
.pass-choice > p { font-size: 15px; line-height: 1.5; margin-bottom: 20px; }
.pass-choice > .start-micro { font-size: 12px; margin-bottom: 0; }
.pass-choice > .small-note { font-size: 12px; margin-bottom: 0; }
.price-difference { font-size: 16px; line-height: 1.5; padding: 18px 0; }
.mini-comparison > div { display: grid; grid-template-columns: 1.3fr repeat(3,1fr); border-bottom: 1px solid var(--line); gap: 7px; padding: 12px 0; font-size: 13px; }
.mobile-checkout { max-width: 540px; margin: auto; }
.mobile-checkout > .text-link { margin-bottom: 18px; }
.mobile-checkout h1 { font-size: 32px; }
.compact-pass { padding: 23px; border-top: 4px solid var(--brand); background: #f4f8fb; }
.compact-pass h1 { font-size: 30px; }
.compact-pass .pass-state { font-size: 14px; }
.library-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.library-heading { font-size: 24px; margin: 30px 0 18px; }
.bank-packs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.bank-pack { padding: 20px; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.pack-status { font-size: 11px; font-weight: 700; color: var(--link); letter-spacing: .07em; }
.bank-pack h3 { font-size: 21px; margin: 10px 0; }
.bank-pack p { font-size: 14px; color: var(--muted); margin: 0; }
.compact-about { max-width: 680px; }
.about-steps { margin: 28px 0; }
.about-steps article { padding: 16px 0 16px 48px; position: relative; border-top: 1px solid var(--line); }
.about-steps article > strong { position: absolute; left: 0; top: 18px; font-size: 15px; color: var(--link); }
.about-steps h2 { font-size: 23px; margin: 0 0 9px; }
.about-steps p { font-size: 16px; margin: 0; }
.compact-about > .btn { margin-bottom: 20px; }
.compact-empty { text-align: center; padding: 35px 0; max-width: 500px; margin: auto; }
.compact-empty > .icon { width: 42px; height: 42px; color: var(--green); }
.compact-empty h2 { font-size: 27px; margin: 20px 0 15px; }
.compact-empty p { font-size: 17px; margin-bottom: 24px; }
.compact-review .mistake-item { grid-template-columns: minmax(0,1fr) auto; padding: 20px 0; gap: 15px; }
.compact-review .mistake-item h2 { font-size: 18px; line-height: 1.4; margin: 8px 0 0; }
.compact-review .mistake-item small { font-size: 12px; color: var(--muted); }
.compact-results { max-width: 560px; margin: auto; }
.compact-score { padding: 25px 0; border-bottom: 1px solid var(--line); }
.compact-score > strong { font-size: 64px; line-height: 1; color: var(--green); }
.compact-score > strong > span { font-size: 28px; color: var(--muted); font-weight: 400; }
.compact-score p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.result-metrics { display: flex; gap: 30px; font-size: 14px; padding: 18px 0; }
.result-metrics strong { font-size: 23px; display: block; margin-bottom: 4px; }
.next-step { border-top: 1px solid var(--line); padding-top: 23px; }
.next-step h2 { font-size: 24px; margin-bottom: 12px; }
.next-step p { font-size: 17px; line-height: 1.5; margin-bottom: 22px; }
.next-step > .text-link { margin-top: 12px; }
.site-footer { padding-top: 22px; padding-bottom: 25px; }
.footer-inner { gap: 10px 20px; }
.footer-inner > div { display: none; }
.footer-inner > .small-note { font-size: 12px; margin: 0; padding-top: 10px; }
.footer-inner nav a { font-size: 13px; min-height: 32px; }

/* The viewport, question area, answer area and action bar keep identical bounds. */
body.is-quiz { height: 100dvh; overflow: hidden; padding: 0; background: #eef2f5; }
body.is-quiz .site-header, body.is-quiz .service-nav-bar, body.is-quiz .prototype-strip,
body.is-quiz .site-footer, body.is-quiz .bottom-nav { display: none !important; }
body.is-quiz #app { height: 100dvh; min-height: 0; max-width: none; padding: 0; margin: 0; overflow: hidden; }
.exam-shell { position: relative; height: 100dvh; max-width: 880px; margin: 0 auto; background: white; display: grid; grid-template-rows: 60px 4px minmax(0,1fr) calc(80px + env(safe-area-inset-bottom,0px)); border-inline: 1px solid #d4dbe0; }
.exam-topbar { display: flex; gap: 12px; align-items: center; padding: 0 22px; background: white; }
.exam-topbar .back-button { width: 44px; height: 44px; justify-content: center; padding: 0; color: var(--link); }
.exam-topbar > div { flex: 1; min-width: 0; }
.exam-topbar strong { display: block; font-size: 16px; line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exam-topbar small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.exam-count { font-size: 19px; font-weight: 700; flex-shrink: 0; }
.exam-count small { display: inline; font-weight: 400; font-size: 15px; }
.exam-progress { background: #e5edf4; overflow: hidden; }
.exam-progress > span { display: block; height: 100%; background: var(--brand); }
.exam-stage { position: relative; min-height: 0; display: grid; grid-template-rows: 42% minmax(0,1fr); overflow: hidden; }
.exam-question-pane { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: #f4f8fb; border-bottom: 1px solid #ccdbe7; }
.exam-question-content { padding: 22px 26px; }
.exam-question-content .question-id { font-size: 11px; color: #526575; margin: 0 0 10px; letter-spacing: .05em; }
.exam-question-content .question-title { font-size: 24px; line-height: 1.3; letter-spacing: -.015em; margin: 0; }
.exam-question-content .question-visual { display: flex; justify-content: center; margin: 14px 0 0; padding: 0; border: 0; height: 115px; background: transparent; }
.exam-question-content .question-visual img { width: 100%; height: 115px; max-width: 300px; object-fit: contain; }
.exam-answer-pane { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 16px 25px; }
.exam-answer-pane .answers { display: grid; grid-template-rows: repeat(4,minmax(66px,1fr)); gap: 10px; min-height: 100%; margin: 0; }
.exam-answer-pane .answer-option { display: grid; grid-template-columns: 32px minmax(0,1fr) 22px; gap: 14px; align-items: center; padding: 11px 15px; margin: 0; border: 1px solid #b1bdc6; background: #fff; color: var(--ink); border-radius: 0; line-height: 1.35; min-height: 66px; font-size: 18px; width: 100%; }
.exam-answer-pane .answer-letter { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #b1bdc6; border-radius: 0; font-size: 14px; background: white; color: var(--muted); }
.exam-answer-pane .answer-copy { font-size: inherit; line-height: inherit; }
.exam-answer-pane .answer-status { display: flex; align-items: center; justify-content: center; }
.exam-answer-pane .answer-status .icon { width: 21px; height: 21px; }
.exam-answer-pane .answer-option.is-selected { border: 2px solid var(--brand); padding: 10px 14px; background: #edf5fc; box-shadow: none; }
.exam-answer-pane .answer-option.is-correct { border: 2px solid #0f7a52; padding: 10px 14px; background: #edf8f1; color: #174e35; }
.exam-answer-pane .answer-option.is-incorrect { border: 2px solid #b12a2a; padding: 10px 14px; background: #fff1f1; color: #9a2121; }
.exam-answer-pane .answer-option:disabled { opacity: 1; cursor: default; }
.exam-footer { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr); align-items: center; gap: 18px; padding: 13px 25px calc(13px + env(safe-area-inset-bottom,0px)); border-top: 1px solid #c8d0d6; background: white; z-index: 10; }
.exam-footer .btn { width: 100%; min-height: 49px; font-size: 18px; padding: 11px 12px; }
.exam-hint { font-size: 14px; line-height: 1.3; color: var(--muted); }
.explanation-toggle { border: 0; background: transparent; color: var(--link); font-size: 15px; text-align: left; min-height: 44px; display: flex; gap: 8px; align-items: center; text-decoration: underline; padding: 0; }
.exam-feedback { position: absolute; z-index: 5; bottom: 0; left: 0; right: 0; max-height: 62%; display: flex; flex-direction: column; background: #f0f8f3; border-top: 4px solid var(--green); box-shadow: 0 -10px 30px #0b0c0c26; padding: 0; }
.exam-feedback.is-error { background: #fff5f2; border-top-color: #b12a2a; }
.feedback-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px 8px; }
.feedback-top h2 { font-size: 23px; line-height: 1.25; margin: 0; }
.feedback-close { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; flex-shrink: 0; }
.feedback-scroll { padding: 0 26px 20px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.feedback-scroll p { font-size: 17px; line-height: 1.5; margin: 0 0 12px; }
.feedback-scroll .correct-answer-text { font-weight: 700; }
.feedback-scroll .review-hint { font-size: 14px; }
.feedback-scroll .source-details { padding-top: 10px; border-top: 1px solid #cad4cd; margin-top: 15px; }
.feedback-scroll .source-details summary { font-size: 15px; min-height: 36px; }
.feedback-scroll .source-details a, .feedback-scroll .source-details p { font-size: 14px; }
.exam-question-pane:focus-visible, .exam-answer-pane:focus-visible, .feedback-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.exam-question-pane:focus:not(:focus-visible), .exam-answer-pane:focus:not(:focus-visible) { outline: none; }
.exam-question-content #question-title:focus, #feedback-title:focus { outline: none; box-shadow: none; }

@media (max-width: 799px) {
  #app { padding: 18px 20px 28px; }
  .site-header-inner { padding: 5px 20px; min-height: 54px; }
  .brand-wordmark { font-size: 24px; }
  .prototype-strip { margin: 0 20px; }
  .service-nav-bar { display: none; }
  .view h1 { font-size: 30px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 22px; }
  .start-panel { padding: 20px; }
  .start-heading h1 { font-size: 33px; }
  .start-copy { font-size: 16px; margin: 12px 0 16px; }
  .compact-signs { flex-basis: 56px; }
  .compact-signs img:first-child { width: 56px; height: 56px; }
  .compact-signs img:last-child { width: 43px; height: 43px; margin-right: 16px; }
  .home-progress { padding: 13px 0; margin-bottom: 12px; }
  .home-progress strong { font-size: 25px; }
  .home-topic-grid { gap: 9px; }
  .home-topic { min-height: 74px; padding: 12px 10px; gap: 9px; }
  .home-topic strong { font-size: 14px; }
  .home-topic small { margin-top: 4px; font-size: 11px; }
  .topic-initial { width: 24px; height: 24px; }
  .compact-upgrade { padding: 15px; margin-top: 20px; }
  .compact-upgrade strong { font-size: 16px; }
  .compact-upgrade small { font-size: 13px; }
  .compact-section-heading { margin-bottom: 10px; }
  .compact-section-heading h2 { font-size: 20px; }
  .topic-picker { grid-template-columns: 1fr; gap: 9px; }
  .topic-choice { min-height: 72px; padding: 13px 15px; }
  .topic-choice strong { font-size: 16px; }
  .practice-primary > .btn-primary { flex-basis: 100%; }
  .practice-primary .btn { font-size: 16px; }
  .mini-sign-set img { width: 34px; height: 34px; }
  .mini-sign-set > div { gap: 4px; }
  .mini-sign-set .text-link { font-size: 14px; }
  .mobile-plan-grid { grid-template-columns: 1fr; gap: 16px; }
  .pass-choice { padding: 20px; }
  .free-choice { padding: 15px; }
  .pass-choice-top h2 { font-size: 25px; }
  .compact-price { font-size: 32px; }
  .pass-facts { padding: 14px 0; margin-top: 15px; }
  .pass-choice > p { margin-bottom: 17px; }
  .bank-packs { grid-template-columns: 1fr; gap: 10px; }
  .bank-pack { flex-direction: row; align-items: center; padding: 17px; }
  .bank-pack h3 { font-size: 19px; margin: 6px 0; }
  .bank-pack p { font-size: 12px; }
  .bank-pack .btn { font-size: 14px; }
  .compact-pass { padding: 20px; }
  .compact-pass h1 { font-size: 28px; }
  .library-actions .btn { font-size: 16px; }
  .site-footer { margin-top: 0; padding: 16px 20px calc(90px + env(safe-area-inset-bottom,0px)); border-top-width: 3px; }
  .footer-inner nav { gap: 0 15px; }
  .footer-inner nav a:nth-last-child(2) { display: none; }
  .footer-inner > .small-note { max-width: 400px; }
  .bottom-nav { height: calc(61px + env(safe-area-inset-bottom,0px)); padding-bottom: env(safe-area-inset-bottom,0px); }
  .exam-shell { border: 0; grid-template-rows: 56px 3px minmax(0,1fr) calc(76px + env(safe-area-inset-bottom,0px)); }
  .exam-topbar { padding: 0 12px; gap: 7px; }
  .exam-topbar strong { font-size: 14px; }
  .exam-topbar small { font-size: 11px; }
  .exam-question-content { padding: 17px 20px; }
  .exam-question-content .question-title { font-size: 20px; line-height: 1.32; }
  .exam-question-content .question-visual { height: 100px; margin-top: 10px; }
  .exam-question-content .question-visual img { height: 100px; max-width: 260px; }
  .exam-question-content .question-id { margin-bottom: 8px; }
  .exam-answer-pane { padding: 12px 15px; }
  .exam-answer-pane .answers { gap: 9px; grid-template-rows: repeat(4,minmax(65px,1fr)); }
  .exam-answer-pane .answer-option { grid-template-columns: 28px minmax(0,1fr) 17px; gap: 10px; font-size: 16px; min-height: 65px; padding: 10px 11px; }
  .exam-answer-pane .answer-option.is-selected,.exam-answer-pane .answer-option.is-correct,.exam-answer-pane .answer-option.is-incorrect { padding: 9px 10px; }
  .exam-answer-pane .answer-letter { width: 26px; height: 26px; font-size: 13px; }
  .exam-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom,0px)); gap: 12px; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); }
  .exam-footer .btn { font-size: 16px; min-height: 48px; padding: 10px 11px; gap: 6px; }
  .exam-hint { font-size: 12px; }
  .explanation-toggle { font-size: 14px; gap: 5px; }
  .explanation-toggle .icon { width: 16px; height: 16px; }
  .feedback-top { padding: 10px 15px 5px; }
  .feedback-top h2 { font-size: 21px; }
  .feedback-scroll { padding: 0 20px 17px; }
  .feedback-scroll p { font-size: 16px; }
}
@media (max-width: 359px) {
  #app { padding-inline: 15px; }
  .prototype-strip { margin-inline: 15px; }
  .prototype-strip > a { display: none; }
  .start-panel { padding: 17px; }
  .start-heading h1 { font-size: 30px; }
  .home-topic { padding: 10px 8px; }
  .home-topic .topic-initial { display: none; }
  .home-topic strong { font-size: 14px; }
  .start-panel > .btn { font-size: 17px; }
  .compact-signs { flex-basis: 48px; }
  .compact-signs img:first-child { width: 48px; height: 48px; }
  .compact-signs img:last-child { width: 36px; height: 36px; margin-right: 12px; }
  .compact-price { font-size: 29px; }
  .pass-choice-top h2 { font-size: 23px; }
  .exam-question-content { padding-inline: 16px; }
  .exam-question-content .question-title { font-size: 18px; }
  .exam-answer-pane { padding: 10px 12px; }
  .exam-answer-pane .answer-option { font-size: 15px; gap: 8px; }
  .exam-footer { padding-inline: 12px; gap: 8px; }
  .exam-footer .btn { font-size: 15px; padding-inline: 8px; }
}
@media (max-height: 620px) {
  .exam-stage { grid-template-rows: 40% minmax(0,1fr); }
  .exam-question-content { padding-block: 12px; }
  .exam-feedback { max-height: 90%; }
}
@media (min-width: 800px) {
  .exam-question-content:has(.question-visual) { display: grid; grid-template-columns: minmax(0,1fr) 230px; gap: 0 20px; align-items: start; }
  .exam-question-content:has(.question-visual) .question-id { grid-column: 1; }
  .exam-question-content:has(.question-visual) h1 { grid-column: 1; }
  .exam-question-content .question-visual { grid-column: 2; grid-row: 1 / 3; height: 160px; margin: 0; }
  .exam-question-content .question-visual img { height: 160px; }
}
