.tp-mode-main{max-width:880px;padding-bottom:4rem}
.tp-mode-heading{display:flex;gap:1rem;justify-content:space-between;align-items:center;flex-wrap:wrap}
.tp-mode-heading h1{font-size:clamp(1.35rem,4vw,2rem)}
.tp-mode-countdown{border:1px solid #89b3a9;border-radius:.7rem;padding:.6rem 1rem;display:flex;gap:.6rem;align-items:center;font-variant-numeric:tabular-nums}
.tp-mode-countdown strong{font-size:1.45rem}
.tp-mode-settings{border:1px solid #cbded9;background:#fff;border-radius:.9rem;padding:.85rem 1.1rem;margin:1rem 0}
.tp-mode-settings summary{cursor:pointer;font-weight:700;color:#075a4e}
.tp-mode-settings form{padding:.7rem 0}
.tp-settings-fields{display:flex;gap:1rem;flex-wrap:wrap}
.tp-settings-fields label{display:flex;flex:1 1 230px;gap:.35rem;flex-direction:column;font-weight:600}
.tp-settings-fields select{padding:.6rem;border-radius:.5rem;border:1px solid #c6d7d3;background:#fff;color:#123}
.tp-mode-help{font-size:.85rem;opacity:.78}
.tp-mode-question{margin-top:1rem;touch-action:pan-y;max-width:100%;min-height:340px}
.tp-mode-question h2{font-size:clamp(1.1rem,3vw,1.5rem);line-height:1.4;overflow-wrap:break-word}
.tp-mode-answers{margin:1rem 0 0;border:0;padding:0;display:flex;flex-direction:column;gap:.5rem;min-inline-size:0}
.tp-mode-answers .tp-pe-option{border-radius:.7rem;cursor:pointer;padding:.75rem .85rem}
.tp-mode-answers .tp-pe-option span{line-height:1.4}
.tp-mode-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
.tp-mode-controls{display:flex;gap:1rem;align-items:center;justify-content:space-between;min-height:3.5rem;margin:1.25rem 0}
.tp-mode-controls a{min-width:112px;text-align:center}
.tp-mode-review details{padding:.85rem;border-bottom:1px solid #d6e3e0}
.tp-mode-review summary{font-weight:600;cursor:pointer}
.tp-mode-review-option{padding:.35rem .7rem;border-radius:.5rem}
.tp-exam-body[data-theme=unused]{color:inherit}
html[data-tp-theme=dark] body.tp-exam-body{background:#111e22;color:#e6f1ef}
html[data-tp-theme=dark] .tp-paid-panel,html[data-tp-theme=dark] .tp-mode-settings{background:#1b2b31;color:#e6f1ef;border-color:#35545c}
html[data-tp-theme=dark] .tp-mode-settings summary,html[data-tp-theme=dark] .tp-mode-main a{color:#a8e4d7}
html[data-tp-theme=dark] .tp-pe-option{background:#253940;color:#e6f1ef;border-color:#35545c}
html[data-tp-theme=dark] .tp-mode-settings select{background:#20333a;color:#e6f1ef;border-color:#466068}
html[data-tp-theme=dark] .tp-pe-feedback{background:#203b36;color:#e6f1ef}
html[data-tp-theme=dark] .tp-mode-countdown{border-color:#466068}
html[data-tp-theme=dark] .tp-mode-review details{border-color:#466068}
@media(max-width:600px){.tp-mode-main{padding-inline:1rem}.tp-mode-controls a{min-width:auto;flex:1}.tp-mode-question{padding:1rem}.tp-mode-heading{align-items:start}}
.tp-mode-account-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:.9rem;margin:1rem 0}
.tp-mode-account-choice{border:1px solid #cbded9;border-radius:.9rem;padding:1.15rem;background:#fff;display:flex;flex-direction:column;gap:.65rem;align-items:flex-start}
.tp-mode-account-choice .tp-account-muted{margin:0 0 .4rem;line-height:1.45}
.tp-mode-account-choice .tp-account-primary{margin-top:auto}

.tp-completed-history{list-style:none;margin:.6rem 0;padding:0;display:grid;gap:.4rem}
.tp-completed-history li{padding:.5rem 0;border-bottom:1px solid #e1ebe8}
.tp-completed-history a{font-weight:600}
/* Limit the account results list only when six or more completed attempts exist.
   The rest of the account page and the full exam answer review remain freely scrollable. */
.tp-completed-history-scroll{
  max-block-size:12.5rem;overflow-y:auto;overflow-x:hidden;
  scrollbar-gutter:stable;overscroll-behavior:contain;
  padding-inline-end:.45rem;
}
.tp-completed-history-scroll:focus-visible{outline:2px solid #0b786a;outline-offset:3px;border-radius:.25rem}


/* Completed results use an ordinary vertically scrolling document, no swipe navigation. */
.tp-mode-review{max-width:100%;}
.tp-review-item{padding:1.3rem 0 1.55rem;border-top:1px solid #d6e3e0;scroll-margin-top:1.5rem;}
.tp-review-item h3{font-size:clamp(1.05rem,3vw,1.3rem);line-height:1.42;margin:.85rem 0;overflow-wrap:anywhere;}
.tp-review-item .tp-mode-review-option{margin:.45rem 0;padding:.65rem .85rem;line-height:1.45;overflow-wrap:break-word;}
.tp-review-item .tp-pe-correct{border:1px solid #4b9c83;background:#edf9f3;color:#153e35;}
.tp-review-item .tp-pe-incorrect{border:1px solid #d5a59d;background:#fff3f0;color:#672b22;}
.tp-review-status{font-weight:600;border-radius:2rem;padding:.28rem .65rem;font-size:.88rem;}
.tp-review-status-correct{background:#e5f5ed;color:#155b43;}
.tp-review-status-wrong{background:#fff0e9;color:#813124;}
.tp-review-status-unanswered{background:#f0f3f4;color:#43535a;}
.tp-recommendations ul{padding-inline-start:1.5rem;}
.tp-recommendations li{margin:.55rem 0;line-height:1.5;}
.tp-recommendations li span{opacity:.7;font-size:.9em;}
html[data-tp-theme=dark] .tp-review-item{border-color:#466068;}
html[data-tp-theme=dark] .tp-review-item .tp-pe-correct{background:#1d4539;color:#d9f9ea;}
html[data-tp-theme=dark] .tp-review-item .tp-pe-incorrect{background:#51302e;color:#ffe4df;}
@media(max-width:600px){.tp-review-item{padding:1rem 0 1.25rem;}.tp-review-item .tp-mode-review-option{padding:.55rem .65rem;}}


/* Instant-feedback practice ONLY. Never disclose the answer before submission in
   deferred-feedback practice or in the timed exam. Use explicit classes based on
   server-validated answer IDs; never infer correctness from checked state. */
.tp-mode-answers.tp-feedback-revealed .tp-pe-option.tp-pe-correct {
  background-color:#e6f5ed !important;
  border:2px solid #278060 !important;
  color:#164c3b !important;
}
.tp-mode-answers.tp-feedback-revealed .tp-pe-option.tp-pe-incorrect {
  background-color:#fff0ed !important;
  border:2px solid #c45d4b !important;
  color:#713021 !important;
}
.tp-mode-answers.tp-feedback-revealed:disabled .tp-pe-option {
  opacity:1;
  cursor:default;
}
.tp-mode-answers.tp-feedback-revealed .tp-answer-judgement {
  display:block;
  font-size:.88rem;
  font-weight:700;
  margin-top:.3rem;
  line-height:1.35;
}
html[data-tp-theme=dark] .tp-mode-answers.tp-feedback-revealed .tp-pe-option.tp-pe-correct {
  background-color:#1e4538 !important;
  border-color:#5cb99a !important;
  color:#d9f6e9 !important;
}
html[data-tp-theme=dark] .tp-mode-answers.tp-feedback-revealed .tp-pe-option.tp-pe-incorrect {
  background-color:#4b302f !important;
  border-color:#e18c80 !important;
  color:#ffe5df !important;
}

/* Match the explanation panel to the grading result as well. */
.tp-mode-question .tp-pe-feedback.tp-feedback-error {
  background-color:#fff2ef !important;
  color:#682f25 !important;
  border:1px solid #df998b;
}
.tp-mode-question .tp-pe-feedback.tp-feedback-success {
  background-color:#e9f7ef !important;
  color:#164b3b !important;
  border:1px solid #8fcab5;
}
html[data-tp-theme=dark] .tp-mode-question .tp-pe-feedback.tp-feedback-error {
  background-color:#4b302f !important;
  color:#ffe9e4 !important;
  border-color:#bd756c;
}
html[data-tp-theme=dark] .tp-mode-question .tp-pe-feedback.tp-feedback-success {
  background-color:#1e4538 !important;
  color:#e1f7eb !important;
  border-color:#488f76;
}


/* Compact question-page toolbar. The current question starts immediately below it. */
.tp-mode-main {padding-top:.6rem;}
.tp-mode-toolbar {
  display:flex;align-items:center;justify-content:space-between;gap:.75rem;
  direction:ltr;position:relative;min-height:3.05rem;
  padding:.5rem .85rem;margin:0 0 .55rem;
  background:#fff;border:1px solid #cbded9;border-radius:.9rem;
}
.tp-mode-toolbar .tp-mode-back {font-weight:600;white-space:nowrap;text-decoration:none;}
.tp-mode-toolbar .tp-mode-back:hover {text-decoration:underline;}
.tp-mode-toolbar-actions {display:flex;align-items:center;gap:.7rem;margin-left:auto;min-width:0;}
.tp-mode-toolbar .tp-mode-settings {
  position:relative;flex:0 0 auto;margin:0;padding:0;border:0;
  border-radius:0;background:transparent;
}
.tp-mode-toolbar .tp-mode-settings summary {
  cursor:pointer;font-weight:700;padding:.25rem .2rem;white-space:nowrap;
}
.tp-mode-toolbar .tp-mode-settings form {
  position:absolute;top:calc(100% + .65rem);right:-.15rem;left:auto;
  width:min(350px,calc(100vw - 2rem));max-width:calc(100vw - 2rem);
  padding:1.05rem;z-index:30;margin:0;
  background:#fff;border:1px solid #bfd8d0;border-radius:.85rem;
  box-shadow:0 12px 32px rgba(11,43,44,.16);
}
.tp-mode-toolbar .tp-mode-settings .tp-settings-fields {display:grid;gap:.85rem;}
.tp-mode-toolbar .tp-mode-settings .tp-settings-fields label {min-width:0;}
.tp-mode-toolbar .tp-mode-countdown {
  padding:.3rem .55rem;gap:.4rem;border-radius:.55rem;
}
.tp-mode-toolbar .tp-mode-countdown strong {font-size:1.05rem;}
.tp-mode-question {margin-top:0;}
/* Restore high contrast on LIGHT outline navigation buttons in the dark theme;
   the site's broad dark-theme anchor rule must not override these buttons. */
html[data-tp-theme=dark] .tp-mode-main .tp-mode-controls a.cta-outline,
html[data-tp-theme=dark] .tp-mode-main .tp-mode-controls a.cta-outline:visited {
  background:#e8f5f1 !important;border-color:#8abdaf !important;
  color:#133d38 !important;
}
html[data-tp-theme=dark] .tp-mode-main .tp-mode-controls a.cta-outline:hover,
html[data-tp-theme=dark] .tp-mode-main .tp-mode-controls a.cta-outline:focus-visible {
  background:#d1eee6 !important;color:#10352e !important;
}
html[data-tp-theme=dark] .tp-mode-toolbar {
  background:#1b2b31;color:#e6f1ef;border-color:#35545c;
}
html[data-tp-theme=dark] .tp-mode-toolbar .tp-mode-settings {background:transparent;border:0;}
html[data-tp-theme=dark] .tp-mode-toolbar .tp-mode-settings form {
  background:#1b2b31;color:#e6f1ef;border-color:#466068;
  box-shadow:0 12px 32px rgba(0,0,0,.45);
}
@media(max-width:600px) {
  .tp-mode-main{padding-top:.35rem;}
  .tp-mode-toolbar{padding:.45rem .65rem;gap:.35rem;margin-bottom:.4rem;}
  .tp-mode-toolbar-actions{gap:.35rem;}
  .tp-mode-toolbar .tp-mode-countdown span{display:none;}
  .tp-mode-toolbar .tp-mode-countdown strong{font-size:1rem;}
}
@media(max-width:360px) {
  .tp-mode-toolbar .tp-mode-back{font-size:.9rem;}
  .tp-mode-toolbar .tp-mode-settings summary{font-size:.9rem;}
}

/* Allow timer + settings to wrap on very narrow screens without horizontal scrolling. */
@media(max-width:390px){.tp-mode-toolbar{flex-wrap:wrap;}.tp-mode-toolbar-actions{justify-content:flex-end;}}

/* Same-size launch/resume actions in both learning-mode cards. */
.tp-mode-account-choice > form {
  display:block;width:100%;margin-top:auto;
}
.tp-mode-account-choice > a.tp-account-primary {margin-top:auto;}
.tp-mode-account-choice .tp-account-primary {
  box-sizing:border-box;display:flex;align-items:center;justify-content:center;
  width:100%;min-height:3.2rem;padding:.65rem .85rem;
  text-align:center;line-height:1.35;font-weight:700;
}
