 /* Shared chapter picker and full CBT presentation. See SHARED-STUDY-DESIGN-RULES.md. */
.study-cbt{ min-width: 0; }
.study-cbt [hidden] { display: none !important; }
.study-cbt .hub-content { overflow-wrap: anywhere; }
.study-cbt button,.study-cbt select,.study-cbt input {font:inherit;}
.study-cbt button { min-height:44px; padding:8px 14px; border:1px solid var(--shared-chrome-border); border-radius:7px; background:var(--shared-chrome-surface);color:var(--shared-chrome-text);cursor:pointer; }
.study-cbt .primary { background:var(--shared-chrome-accent);color:var(--shared-chrome-surface); }
.study-cbt button:disabled {opacity:.6;cursor:default;}
.study-cbt :is(button,input,select):focus-visible,.study-cbt button:focus-visible {outline:3px solid var(--shared-chrome-focus);outline-offset:3px;}
.study-cbt #test-builder{margin-top:20px;}
.study-cbt label {display:flex;align-items:center;gap:10px;min-height:44px;}
.study-cbt .exam-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 0;margin-top:12px;}
.study-cbt .exam-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:20px;align-items:start;}
.study-cbt .question-panel{min-width:0;padding:20px;border:1px solid var(--shared-chrome-border);border-radius:10px;background:var(--shared-chrome-surface);margin:16px 0;}
.study-cbt .question-stem, .study-cbt .solution p{white-space:pre-wrap;overflow-wrap:anywhere;}
.study-cbt .question-meta{font-size:.85rem;color:var(--shared-chrome-muted);}
.study-cbt .question-panel fieldset{padding:0;border:0;}
.study-cbt .question-panel fieldset label{flex-direction:row-reverse;justify-content:flex-end;padding:12px;border:1px solid var(--shared-chrome-border);border-radius:7px;margin:8px 0;white-space:pre-wrap;}
.study-cbt .question-panel input[type=radio]{flex:0 0 auto;width:20px;height:20px;}
.study-cbt .exam-controls{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px;padding-bottom:env(safe-area-inset-bottom);}
.study-cbt .question-table{max-width:100%;overflow:auto;margin:16px 0;}
.study-cbt .question-table table{width:100%;border-collapse:collapse;}
.study-cbt .question-table :is(th,td){padding:10px;border:1px solid var(--shared-chrome-border);text-align:start;min-width:110px;white-space:pre-wrap;overflow-wrap:anywhere;}
.study-cbt .question-palette{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;max-height:45vh;overflow:auto;padding:4px;}
.study-cbt .question-palette button{padding:5px;min-height:44px;}
.study-cbt .palette-content{background:var(--shared-chrome-surface);color:var(--shared-chrome-text);padding:12px;border:1px solid var(--shared-chrome-border);border-radius:9px;}
.study-cbt .status-legend{list-style:none;padding:0;font-size:.85rem;}
.study-cbt .status-legend li{padding:5px 8px;margin:5px 0;border-radius:5px;}
.study-cbt .palette-content .unvisited{background:#e6e7e8;color:#222;}
.study-cbt .palette-content .unanswered{background:#a92828;color:#fff;}
.study-cbt .palette-content .answered{background:#17663a;color:#fff;}
.study-cbt .palette-content .review, .study-cbt .palette-content .answered-review{background:#6539a7;color:#fff;}
.study-cbt .palette-content .answered-review::after{content:" ✓";}
.study-cbt .question-palette [aria-current]{outline:3px solid var(--shared-chrome-focus);outline-offset:1px;}
.study-cbt .solution{margin-top:16px;padding:12px;border-inline-start:3px solid var(--shared-chrome-accent);background:var(--shared-chrome-accent-soft);}
.study-cbt .score-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px;}
.study-cbt .score-grid div{padding:12px;border:1px solid var(--shared-chrome-border);}
.study-cbt .score-grid dd{margin:6px 0 0;font-weight:700;}
.cbt-drawer,.cbt-confirm {width:min(90vw,650px);max-height:85dvh;overflow:auto;border:1px solid var(--shared-chrome-border);border-radius:12px;background:var(--shared-chrome-surface);color:var(--shared-chrome-text);padding:20px;}
.cbt-drawer {margin:0 0 0 auto;width:min(360px,90vw);height:100dvh;max-height:100dvh;border-radius:0;}
.study-cbt::backdrop {background:rgb(0 0 0 / .55);}
@media(max-width:900px) { .study-cbt .exam-layout{grid-template-columns:minmax(0,1fr);}
.study-cbt .desktop-palette{display:none;}
.study-cbt .question-panel{padding:14px;}
.study-cbt .exam-controls button{flex:1 1 40%;}} /* The subject home keeps the chapter choice beside its question count. */
.study-cbt .subject-hub-hero{ min-height: 300px; padding-block: 18px; }
.study-cbt .study-home-content { padding-block: 24px 48px; }
.study-cbt .study-breadcrumbs{ display: flex; flex-wrap: wrap; gap: 8px; color: var(--shared-chrome-muted); font-size: .85rem; }
.study-cbt .study-notes-status{ display: flex; align-items: center; gap: 14px; margin-block: 20px 28px; padding-block: 12px; border-block: 1px solid var(--shared-chrome-border); }
.study-cbt .study-notes-status span{ padding: 3px 10px; border-radius: 5px; background: var(--shared-chrome-accent-soft); color: var(--shared-chrome-accent-strong); font-size: .85rem; }
.study-cbt .study-practice-heading{ display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.study-cbt .study-practice-heading h2{ margin: 0; }
.study-cbt .study-practice-heading p{ margin: 6px 0 0; color: var(--shared-chrome-muted); }
.study-cbt .study-practice-heading > a{ min-height: 44px; display: inline-flex; align-items: center; color: var(--shared-chrome-accent-strong); }
.study-cbt .study-picker-toolbar{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.study-cbt .study-picker-toolbar > div{ display: flex; gap: 8px; }
.study-cbt #chapter-selection-status{ color: var(--shared-chrome-muted); font-size: .9rem; }
.study-cbt .study-chapter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.study-cbt .study-chapter-choice { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 78px; padding: 12px 14px; border: 1px solid var(--shared-chrome-border); border-radius: 8px; background: var(--shared-chrome-surface); cursor: pointer; }
.study-cbt .study-chapter-choice:hover{ border-color: var(--shared-chrome-accent); }
.study-cbt .study-chapter-choice:has(input:checked){ border-color: var(--shared-chrome-accent); background: var(--shared-chrome-accent-soft); }
.study-cbt .study-chapter-choice:focus-within{ outline: 2px solid var(--shared-chrome-focus); outline-offset: 2px; }
.study-cbt .study-chapter-choice input{ flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--shared-chrome-accent); }
.study-cbt .study-chapter-number{ color: var(--shared-chrome-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.study-cbt .study-chapter-copy{ display: grid; min-width: 0; gap: 3px; }
.study-cbt .study-chapter-copy strong{ font-size: .95rem; line-height: 1.5; font-weight: 600; }
.study-cbt .study-chapter-copy > span{ font-size: .8rem; color: var(--shared-chrome-muted); }
.study-cbt .study-selection-bar{ position: sticky; bottom: max(10px,env(safe-area-inset-bottom)); z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding: 12px; border: 1px solid var(--shared-chrome-border); border-radius: 8px; background: var(--shared-chrome-surface); }
.study-cbt #chapter-selection-hint{ font-size: .85rem; color: var(--shared-chrome-muted); }
.study-cbt .study-source-note{ margin-top: 20px; color: var(--shared-chrome-muted); font-size: .85rem; }
.study-cbt .study-source-note summary{ min-height: 44px; cursor: pointer; }
.study-cbt .study-sr-only{ position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media(max-width:620px) {
  .study-cbt .subject-hub-hero { min-height: 0; padding-block: 10px; }
  .study-cbt .study-chapter-grid { grid-template-columns: minmax(0,1fr); }
  .study-cbt .study-chapter-choice { min-height: 72px; padding: 10px 12px; gap: 9px; }
.study-cbt .study-selection-bar button{ width: 100%; }
.study-cbt .study-selection-bar{ gap: 6px; }
}

.study-cbt .study-quiz-content { padding-block: 24px 48px; }
.study-cbt .quiz-intro-lead{ margin: 6px 0 20px; color: var(--shared-chrome-muted); }
.study-cbt .test-introduction{ display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,340px); gap: 24px; align-items: start; }
.study-cbt .test-intro-main, .study-cbt .test-intro-settings{ min-width: 0; padding: 20px; border: 1px solid var(--shared-chrome-border); border-radius: 10px; background: var(--shared-chrome-surface); }
.study-cbt .test-introduction h2{ margin: 0 0 12px; }
.study-cbt .test-intro-main h2:not(:first-child){ margin-top: 24px; }
.study-cbt .test-pool-summary{ margin: 0 0 10px; color: var(--shared-chrome-accent-strong); font-weight: 600; }
.study-cbt .selected-chapter-list{ padding-inline-start: 20px; margin: 8px 0 12px; }
.study-cbt .selected-chapter-list li{ margin-block: 6px; }
.study-cbt .test-rules{ padding-inline-start: 24px; margin: 0; }
.study-cbt .test-rules li{ padding-inline-start: 4px; margin-bottom: 12px; }
.study-cbt .test-intro-main > a{ display: inline-flex; min-height: 44px; align-items: center; color: var(--shared-chrome-accent-strong); }
.study-cbt .test-settings-fields{ display: grid; gap: 14px; }
.study-cbt .test-settings-fields label{ display: grid; gap: 6px; font-size: .9rem; }
.study-cbt .test-settings-fields :is(select,input:not([type=checkbox])){ width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--shared-chrome-border); border-radius: 6px; color: var(--shared-chrome-text); background: var(--shared-chrome-canvas); font: inherit; }
.study-cbt .test-settings-fields label:has(input[type=checkbox]){ display: flex; gap: 10px; }
.study-cbt .test-intro-settings input[type=checkbox]{ width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--shared-chrome-accent); }
.study-cbt .test-scoring{ padding-block: 12px; border-block: 1px solid var(--shared-chrome-border); font-size: .85rem; }
.study-cbt .test-intro-settings > button[type=submit]{ width: 100%; }
.study-cbt .intro-status-legend{ display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 0; margin: 8px 0 0; list-style: none; font-size: .85rem; }
.study-cbt .intro-status-legend li{ display: inline-flex; align-items: center; gap: 8px; }
.study-cbt .intro-status-dot{ display: inline-block; width: 14px; height: 14px; border: 1px solid currentColor; border-radius: 3px; flex: 0 0 auto; }
.study-cbt .intro-status-dot.unvisited{ background: #e6e7e8; color: #333; }
.study-cbt .intro-status-dot.unanswered{ background: #a92828; color: #a92828; }
.study-cbt .intro-status-dot.answered{ background: #17663a; color: #17663a; }
.study-cbt .intro-status-dot.review, .study-cbt .intro-status-dot.answered-review{ background: #6539a7; color: #6539a7; }
.study-cbt .intro-status-dot.answered-review{ box-shadow: inset 0 0 0 3px #fff; }
.study-cbt .resume-test{ margin-bottom: 16px; }
.study-cbt .test-history{ margin-top: 20px; }
.study-cbt .test-history summary{ min-height: 44px; cursor: pointer; }
@media(max-width:1000px) { .study-cbt .test-introduction{ grid-template-columns: minmax(0,1fr); gap: 14px; }
.study-cbt .test-settings-fields{ grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:560px) { .study-cbt .test-intro-main, .study-cbt .test-intro-settings{ padding: 14px; }
.study-cbt .test-settings-fields{ grid-template-columns: minmax(0,1fr); }
} /* The native modal gives the running test its own viewport and focus boundary. */
html:has(.cbt-session[open]){ overflow: hidden; }
.cbt-session {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  color: var(--shared-chrome-text);
  background: var(--shared-chrome-canvas);
}
.cbt-session[open] { display: flex; }
.cbt-session #cbt-app { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.cbt-session .exam-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  min-height: 64px;
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--shared-chrome-border);
  background: var(--shared-chrome-surface);
  flex: 0 0 auto;
}
.cbt-session .exam-brand { display: flex; align-items: center; min-width: 0; gap: 9px; }
.cbt-session .exam-brand img { flex: 0 0 auto; }
.cbt-session .exam-brand strong { font-size: .95rem; }
.cbt-session .exam-candidate { margin-inline-start: auto; font-size: .8rem; color: var(--shared-chrome-muted); }
.cbt-session #test-time { white-space: nowrap; font-size: .9rem; font-variant-numeric: tabular-nums; }
.cbt-session .close-exam { margin-inline-start: 4px; min-width: 44px; font-size: 24px; padding: 0; }
.cbt-session .mobile-palette-toggle { display: none; }
.cbt-session .exam-layout { flex: 1; min-height: 0; gap: 0; margin: 0; align-items: stretch; grid-template-columns: minmax(0,1fr) 280px; overflow: hidden; }
.cbt-session .question-panel { display: flex; flex-direction: column; min-height: 0; padding: 16px 22px 0; margin: 0; border: 0; border-radius: 0; }
.cbt-session .exam-question-heading { margin: 0; font-size: 20px; line-height: 1.4; }
.cbt-session .exam-question-heading:focus { outline: none; }
.cbt-session .question-meta { margin: 5px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--shared-chrome-border); font-size: .8rem; flex: 0 0 auto; }
.cbt-session .exam-question-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 14px 0; }
.cbt-session .question-stem { margin-top: 8px; line-height: 1.65; }
.cbt-session .question-panel fieldset label { min-height: 46px; margin-block: 7px; padding: 9px 12px; }
.cbt-session .question-panel fieldset label:has(input:checked) { background: var(--shared-chrome-accent-soft); border-color: var(--shared-chrome-accent); }
.cbt-session .answer-message:empty { display: none; }
.cbt-session .exam-controls { flex: 0 0 auto; margin: 0; padding: 12px 0 max(12px,env(safe-area-inset-bottom)); border-top: 1px solid var(--shared-chrome-border); background: var(--shared-chrome-surface); }
.cbt-session .desktop-palette { min-height: 0; border-left: 1px solid var(--shared-chrome-border); }
.cbt-session .palette-content { display: flex; flex-direction: column; height: 100%; min-height: 0; border: 0; border-radius: 0; padding: 14px; }
.cbt-session .palette-content h2 { margin: 0 0 10px; font-size: 18px; }
.study-cbt .palette-content .status-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0 0 14px; }
.study-cbt .palette-content .status-legend li { display: flex; align-items: start; gap: 6px; padding: 0; margin: 0; color: var(--shared-chrome-muted); background: transparent; font-size: 11.5px; }
.study-cbt .palette-content .status-legend li::before { content: ""; display: block; width: 10px; height: 10px; margin-top: 3px; flex: 0 0 auto; border-radius: 2px; }
.study-cbt .palette-content .status-legend .unvisited::before { background: #e6e7e8; border: 1px solid #777; }
.study-cbt .palette-content .status-legend .unanswered::before { background: #a92828; }
.study-cbt .palette-content .status-legend .answered::before { background: #17663a; }
.study-cbt .palette-content .status-legend :is(.review,.answered-review)::before { background: #6539a7; }
.study-cbt .palette-content .status-legend .answered-review::after { content: ""; }
.study-cbt .palette-content .status-legend .answered-review::before { box-shadow: inset 0 0 0 2px #fff; }
.cbt-session .question-palette { min-height: 0; max-height: none; align-content: start; flex: 1; }
.cbt-session .palette-content > p { margin: 10px 0 0; font-size: .8rem; }
@media(max-width:900px) {
  .cbt-session .exam-toolbar { flex-wrap: wrap; gap: 6px; min-height: 0; padding: 8px 10px; }
  .cbt-session .exam-candidate { display: none; }
  .cbt-session .exam-brand { flex: 1; }
  .cbt-session .exam-brand strong { font-size: .8rem; }
  .cbt-session .exam-brand img { width: 26px; height: 26px; }
  .cbt-session #test-time { order: 5; width: 100%; font-size: .85rem; }
  .cbt-session .mobile-palette-toggle { display: inline-block; min-width: 44px; padding: 0; font-size: 23px; }
  .cbt-session .exam-layout { grid-template-columns: minmax(0,1fr); }
  .cbt-session .question-panel { padding: 12px 12px 0; }
  .cbt-session .exam-controls { gap: 6px; }
  .cbt-session .exam-controls button { padding: 8px 6px; font-size: .8rem; }
}

.cbt-session .question-stem { font-size: 18px; }
.cbt-session .question-panel fieldset label { font-size: 16px; line-height: 1.55; }
.study-cbt .palette-content .status-legend { grid-template-columns: minmax(0,1fr); }
.study-cbt .palette-content .status-legend li { align-items: center; font-size: 12px; }
.study-cbt .palette-content .legend-label { flex: 1; }
.study-cbt .palette-content .legend-count { margin-inline-start: auto; color: var(--shared-chrome-text); font-variant-numeric: tabular-nums; } /* Native top-layer dialogs must explicitly reset the site's margin reset. */
.study-cbt.cbt-confirm{
  position: fixed; inset: 0; margin: auto; box-sizing: border-box;
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 24px; border-radius: 12px; overflow-y: auto;
}
.study-cbt.cbt-confirm h2 { margin: 0 0 20px; font-size: 23px; line-height: 1.4; }
.study-cbt::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(6px); }
.study-cbt .confirmation-counts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; }
.study-cbt .confirmation-counts > div { padding: 10px 12px; border-radius: 6px; background: var(--shared-chrome-canvas); }
.study-cbt .confirmation-counts dt { font-size: 14px; color: var(--shared-chrome-muted); }
.study-cbt .confirmation-counts dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.study-cbt .confirmation-note { margin: 18px 0; font-size: 15px; line-height: 1.65; }
.study-cbt .dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--shared-chrome-border); }
.cbt-session #cbt-app.showing-results { display: flex; padding: 0; overflow: hidden; }
.cbt-session .showing-results .exam-toolbar { justify-content: space-between; }
.cbt-session .showing-results .exam-toolbar h2 { margin: 0; font-size: 20px; }
.study-cbt .results-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; flex: 1; padding: 24px; }
.study-cbt .results-content { max-width: 1120px; margin-inline: auto; min-width: 0; }
.study-cbt .results-heading { margin: 0 0 12px; font-size: 18px; }
.study-cbt .score-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 0; margin: 0; border: 1px solid var(--shared-chrome-border); border-radius: 10px; overflow: hidden; background: var(--shared-chrome-surface); }
.study-cbt .score-grid > div { min-width: 0; padding: 14px 16px; border: 0; border-inline-end: 1px solid var(--shared-chrome-border); border-bottom: 1px solid var(--shared-chrome-border); }
.study-cbt .score-grid dt { font-size: 14px; color: var(--shared-chrome-muted); }
.study-cbt .score-grid dd { margin-top: 6px; font-size: 21px; line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.study-cbt .results-tools { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-block: 22px 14px; }
.study-cbt .results-tools label { display: grid; gap: 6px; font-size: 14px; }
.study-cbt .results-tools select { min-height: 44px; padding: 8px 36px 8px 12px; border: 1px solid var(--shared-chrome-border); border-radius: 7px; background: var(--shared-chrome-surface); color: var(--shared-chrome-text); font: inherit; max-width: 100%; }
.cbt-session .showing-results .question-panel { display: block; margin: 0; padding: 22px; border: 1px solid var(--shared-chrome-border); border-radius: 10px; }
.study-cbt .showing-results .question-panel h3 { font-size: 16px; color: var(--shared-chrome-muted); margin: 0 0 14px; font-weight: 600; }
.study-cbt .review-options { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.study-cbt .review-options li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--shared-chrome-border); border-radius: 7px; font-size: 16px; line-height: 1.6; }
.study-cbt .review-option-text { flex: 1; min-width: 120px; white-space: pre-wrap; overflow-wrap: anywhere; }
.study-cbt .review-options .is-correct { border-color: var(--shared-chrome-accent); background: var(--shared-chrome-accent-soft); }
.study-cbt .review-option-state { font-size: 12px; font-weight: 600; color: var(--shared-chrome-accent-strong); }
.study-cbt .review-options .is-selected { border-inline-start-width: 4px; }
.study-cbt .solution { font-size: 16px; line-height: 1.7; }
.study-cbt .solution p { margin-block: 8px; }
.study-cbt .review-controls { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--shared-chrome-border); }
.study-cbt .results-empty { padding: 20px; background: var(--shared-chrome-surface); border: 1px solid var(--shared-chrome-border); border-radius: 8px; }
@media(max-width:700px) {
  .study-cbt .results-scroll { padding: 16px 12px; }
  .study-cbt .score-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .study-cbt .score-grid > div { padding: 12px; }
  .study-cbt .score-grid dd { font-size: 19px; }
  .cbt-session .showing-results .question-panel { padding: 14px; }
  .study-cbt.cbt-confirm { padding: 20px; }
  .study-cbt .dialog-actions button { flex: 1; }
}
@media print { .cbt-session,.cbt-confirm,.cbt-drawer { display: none !important; } }

/* Compact introduction and reusable previous-result action. */
.study-cbt .study-quiz-content > h1 { font-size: clamp(24px,3vw,30px); line-height: 1.4; margin-block: 12px 16px; }
.study-cbt .test-pool-summary { font-size: 15px; line-height: 1.5; margin-bottom: 6px; }
.study-cbt .selected-chapter-details { font-size: 14px; }
.study-cbt .selected-chapter-details > summary { min-height: 32px; cursor: pointer; }
.study-cbt .test-intro-main h2:not(:first-child) { margin-top: 14px; }
.study-cbt .test-rules li { margin-bottom: 8px; }
.study-cbt .test-intro-settings > .previous-result { display: block; width: 100%; margin-top: 8px; }
.study-cbt .test-intro-settings > [role=alert]:empty { display: none; }
.study-cbt .test-history .history-result { display: block; width: 100%; text-align: start; margin-top: 6px; font-size: 14px; }

/* Palette summaries share the same presentation in the desktop rail and drawer. */
.study-cbt .palette-content h2 { margin: 0 0 14px; font-size: 18px; line-height: 1.4; }
.study-cbt .palette-content .status-legend { gap: 0; padding-bottom: 10px; border-bottom: 1px solid var(--shared-chrome-border); }
.study-cbt .palette-content .status-legend li { min-height: 32px; gap: 9px; font-size: 13px; line-height: 1.4; }
.study-cbt .palette-content .status-legend li::before { margin: 0; width: 11px; height: 11px; }
.study-cbt .palette-content .legend-label { min-width: 0; }
.study-cbt .palette-content .legend-count { min-width: 28px; text-align: end; font-size: 13px; font-weight: 600; }
.study-cbt.cbt-drawer[open] { display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; padding: 16px; }
.study-cbt.cbt-drawer > button { align-self: flex-end; }
.study-cbt.cbt-drawer .palette-content { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; border: 0; border-radius: 0; }
.study-cbt.cbt-drawer .question-palette { flex: 1; min-height: 0; max-height: none; align-content: start; }
.study-cbt.cbt-drawer .palette-content > p { margin: 12px 0 0; font-size: 13px; }
/* Separate navigation/reset from the two forward actions. */
.cbt-session .exam-controls { display: grid; grid-template-columns: auto auto minmax(12px,1fr) auto auto; gap: 10px; align-items: center; }
.cbt-session .exam-controls button { min-height: 44px; padding: 9px 14px; font-size: 14px; line-height: 1.4; font-weight: 500; white-space: normal; }
.cbt-session .exam-controls button:nth-child(3) { grid-column: 4; border-color: var(--shared-chrome-accent); color: var(--shared-chrome-accent-strong); }
.cbt-session .exam-controls button:nth-child(4) { grid-column: 5; font-weight: 600; }
.cbt-session .exam-controls button:disabled { opacity: .45; }
@media(max-width:700px) {
  .cbt-session .exam-controls { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .cbt-session .exam-controls button { width: 100%; padding: 9px 8px; font-size: 13px; }
  .cbt-session .exam-controls button:nth-child(3), .cbt-session .exam-controls button:nth-child(4) { grid-column: auto; }
}

/* Plain result labels, compact filters and a connected review pager. */
.study-cbt .score-grid > div { padding: 12px 14px; }
.study-cbt .score-grid dd { font-size: 20px; margin-top: 4px; }
.study-cbt .results-tools { justify-content: flex-start; align-items: center; gap: 12px; margin-block: 16px 12px; }
.study-cbt .results-tools label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.study-cbt .results-tools select { min-width: 160px; }
.study-cbt .results-tools button { font-size: 14px; }
.study-cbt .review-controls { justify-content: center; align-items: center; gap: 10px; padding-top: 14px; margin-top: 16px; }
.study-cbt .review-controls button { min-width: 110px; font-size: 14px; }
.study-cbt .review-position { min-width: 52px; text-align: center; font-size: 13px; color: var(--shared-chrome-muted); font-variant-numeric: tabular-nums; }
.study-cbt .review-options .review-option-state { padding: 2px 7px; border-radius: 4px; background: var(--shared-chrome-accent-soft); }
.study-cbt .showing-results .question-panel:focus { outline: none; }
@media(max-width:380px) {
  .study-cbt .review-controls { gap: 6px; }
  .study-cbt .review-controls button { min-width: 0; padding-inline: 10px; }
  .study-cbt .review-position { min-width: 42px; }
}

/* Answer correctness is semantic, independent of the theme's primary accent. */
.study-cbt {
  --cbt-correct-text: #17663a;
  --cbt-correct-border: #43845a;
  --cbt-correct-soft: #eef7f0;
  --cbt-wrong-text: #a92828;
  --cbt-wrong-border: #c74b45;
  --cbt-wrong-soft: #fff1f0;
}
:is(html[data-theme="dark"],html.dark,html[data-hindi-theme="dark"]) .study-cbt {
  --cbt-correct-text: #8dddac;
  --cbt-correct-border: #4b9f69;
  --cbt-correct-soft: #182d21;
  --cbt-wrong-text: #ffb4ad;
  --cbt-wrong-border: #dc7970;
  --cbt-wrong-soft: #34201f;
}
.study-cbt .review-options .is-correct,
.study-cbt .solution.is-correct { border-color: var(--cbt-correct-border); background: var(--cbt-correct-soft); }
.study-cbt .review-options .is-wrong,
.study-cbt .solution.is-wrong { border-color: var(--cbt-wrong-border); background: var(--cbt-wrong-soft); }
.study-cbt .review-options .is-correct .review-option-state,
.study-cbt .solution.is-correct > strong { color: var(--cbt-correct-text); background: transparent; }
.study-cbt .review-options .is-wrong .review-option-state,
.study-cbt .solution.is-wrong > strong { color: var(--cbt-wrong-text); background: transparent; }
.study-cbt .solution.is-skipped { border-color: var(--shared-chrome-muted); background: var(--shared-chrome-canvas); }


/* Minimal test directory; scoped sizes override article display typography. */
.study-cbt .study-test-directory { max-width: 1120px; margin-inline: auto; padding: 24px 28px 40px; }
.study-cbt .study-test-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 20px; }
.study-cbt .study-test-directory h1.study-test-title { font-size: 28px !important; line-height: 1.35 !important; margin: 0 0 4px; }
.study-cbt .study-test-meta { color: var(--shared-chrome-muted); font-size: 13px; }
.study-cbt .study-full-mock { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--shared-chrome-border); border-radius: 7px; font-size: 14px; color: var(--shared-chrome-accent-strong); background: var(--shared-chrome-surface); text-decoration: none; }
.study-cbt .study-full-mock:hover { border-color: var(--shared-chrome-accent); }
.study-cbt .study-full-mock:focus-visible { outline: 3px solid var(--shared-chrome-focus); outline-offset: 2px; }
.study-cbt .study-test-builder { border: 1px solid var(--shared-chrome-border); border-radius: 9px; background: var(--shared-chrome-surface); }
.study-cbt .study-test-builder .study-picker-toolbar { position: sticky; top: var(--shared-topbar-height,64px); z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--shared-chrome-border); background: var(--shared-chrome-surface); border-radius: 9px 9px 0 0; }
.study-cbt .study-picker-actions,.study-cbt .study-picker-continue { display: flex; align-items: center; gap: 8px; }
.study-cbt .study-test-builder .study-picker-toolbar button { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.study-cbt .study-picker-continue #chapter-selection-status { color: var(--shared-chrome-muted); font-size: 12px; }
.study-cbt .study-test-builder .study-chapter-grid { grid-template-columns: minmax(0,1fr); gap: 0; padding: 0 14px; }
.study-cbt .study-test-builder .study-chapter-choice { min-height: 56px; padding: 11px 10px; gap: 12px; border: 0; border-bottom: 1px solid var(--shared-chrome-border); border-radius: 0; background: transparent; scroll-margin-top: calc(var(--shared-topbar-height,64px) + 112px); }
.study-cbt .study-test-builder .study-chapter-choice:last-child { border-bottom: 0; }
.study-cbt .study-test-builder .study-chapter-choice:has(input:checked) { background: var(--shared-chrome-accent-soft); }
.study-cbt .study-test-builder .study-chapter-choice:hover { background: var(--shared-chrome-canvas); }
.study-cbt .study-test-builder .study-chapter-choice:focus-within { outline-offset: -2px; }
.study-cbt .study-test-builder .study-chapter-choice input { order: 3; width: 18px; height: 18px; margin-inline-start: 2px; }
.study-cbt .study-test-builder .study-chapter-number { flex: 0 0 24px; font-size: 12px; }
.study-cbt .study-test-builder .study-chapter-copy { display: flex; align-items: center; gap: 16px; flex: 1; }
.study-cbt .study-test-builder .study-chapter-copy strong { flex: 1; font-size: 15px; font-weight: 500; line-height: 1.5; }
.study-cbt .study-test-builder .study-chapter-copy > span { flex: 0 0 auto; font-size: 12px; white-space: nowrap; }
.study-cbt .study-test-builder > [role=alert]:empty { display: none; }
@media(max-width:620px) {
  .study-cbt .study-test-directory { padding: 16px 14px 30px; }
  .study-cbt .study-test-directory h1.study-test-title { font-size: 24px !important; }
  .study-cbt .study-test-header { padding-block: 16px; }
  .study-cbt .study-full-mock { font-size: 13px; padding-inline: 10px; }
  .study-cbt .study-test-builder .study-picker-toolbar { gap: 6px; padding: 8px 10px; }
  .study-cbt .study-picker-continue { width: 100%; justify-content: space-between; }
  .study-cbt .study-test-builder .study-chapter-grid { padding-inline: 8px; }
  .study-cbt .study-test-builder .study-chapter-choice { gap: 8px; padding: 10px 4px; }
  .study-cbt .study-test-builder .study-chapter-copy { display: grid; gap: 2px; }
  .study-cbt .study-test-builder .study-chapter-copy strong { font-size: 14px; }
  .study-cbt .study-test-builder .study-chapter-number { flex-basis: 20px; }
}

/* Statement questions: source labels retained, each statement gets its own row. */
.study-cbt .question-stem--structured { white-space: normal; line-height: 1.7; margin-block: 8px 18px; }
.study-cbt .question-stem--structured .question-intro,
.study-cbt .question-stem--structured .question-prompt { display: block; white-space: normal; }
.study-cbt .question-statements { display: grid; gap: 10px; margin-block: 12px; }
.study-cbt .question-statement { display: grid; grid-template-columns: max-content minmax(0,1fr); align-items: baseline; column-gap: 10px; }
.study-cbt .question-statement-marker { font-weight: 600; color: var(--shared-chrome-text); }
.study-cbt .question-statement-text { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.study-cbt .question-statement--labeled { grid-template-columns: minmax(0,1fr); row-gap: 2px; }
.study-cbt .question-prompt { font-weight: 500; margin-top: 12px; }
@media(max-width:620px) {
  .study-cbt .question-statements { gap: 8px; margin-block: 10px; }
  .study-cbt .question-statement { column-gap: 8px; }
}
