/* Theory-test appearance; no changes to other learning modes or the grading engine. */
.bmlms-theory-mode .bmlms-learning-area{background:#edf0f4}
/* This exam flows with the document; viewport-relative overlay padding cancels scrolling. */
.bmlms-theory-mode .bmlms-learning-area.bmlms-has-site-shell:has(>[data-theory-exam]){padding-top:var(--bmlms-theory-shell-spacing,0px)}
.bmlms-theory-exam{--theory-blue:#5ba3e2;--theory-red:#c64c2b;max-width:none;width:100%;margin:0 auto 48px;color:#526271}
.bmlms-theory-exam form.bmlms-quiz-submission{display:grid;grid-template-columns:24px minmax(0,1fr) 24px;gap:0;width:100%;max-width:none;padding:0;background:none;border:0;box-shadow:none}
.bmlms-theory-exam form.bmlms-quiz-submission>*{grid-column:2}
.bmlms-theory-top{display:contents}
.bmlms-theory-progress{grid-column:2;order:1;margin-top:16px;position:relative;min-height:32px;background:#e0e4e9;border-radius:5px;overflow:hidden}
.bmlms-theory-progress-fill{position:absolute;inset:0 auto 0 0;background:linear-gradient(90deg,#db4d8d,var(--theory-blue));transition:width .2s}
.bmlms-theory-progress-label{position:relative;display:block;text-align:center;line-height:32px;color:#111}
.bmlms-theory-exam .bmlms-quiz-questions-pagination{order:2;background:none;padding:12px 0 32px;margin:0;border:0}
.bmlms-theory-exam .bmlms-quiz-questions-pagination ul{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-start;padding:0;margin:0;list-style:none}
.bmlms-theory-exam .bmlms-quiz-questions-pagination li{margin:0;padding:0}
.bmlms-theory-exam .bmlms-quiz-question-paginate-item{position:relative;min-width:30px;min-height:28px;width:auto;height:auto;padding:1px 6px;border:1px solid #c7cdd4;border-radius:4px;background:#fff;color:#627181;font-size:calc(16px - 2pt);line-height:1.4}
.bmlms-theory-exam .bmlms-quiz-question-paginate-item.active{background:var(--theory-blue);border-color:var(--theory-blue);color:#fff}
.bmlms-theory-exam .bmlms-quiz-question-paginate-item.answered:not(.active){background:#e0eef9}
.bmlms-theory-exam .bmlms-quiz-question-paginate-item[data-theory-flagged=true]{background:var(--theory-red);border-color:var(--theory-red);color:#fff}
.bmlms-theory-exam .bmlms-quiz-question-paginate-item[data-theory-flagged=true]::after{content:'⚑';margin-left:3px}
.bmlms-theory-exam .bmlms-quiz-question-paginate-icon{display:none}
.bmlms-theory-toolbar{grid-column:1/-1;order:0;position:sticky;top:var(--bmlms-theory-toolbar-offset,0px);z-index:40;min-width:0;padding:0;background:#fff;border:0;border-bottom:1px solid #d9dde3;border-radius:0;font-size:16px;box-shadow:0 4px 16px #24364b12}
.bmlms-theory-toolbar-controls{display:flex;gap:20px;align-items:center;min-width:0;padding:10px 24px}
.bmlms-theory-toolbar h1{flex:1;min-width:0;font-size:18px;line-height:1.4;font-weight:500;margin:0;color:#243b51;overflow-wrap:anywhere}
.bmlms-theory-timer{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;font-size:16px;font-variant-numeric:tabular-nums;color:#243b51}
.bmlms-theory-grade{white-space:nowrap;min-height:44px;border:0;background:var(--theory-blue);color:#fff;padding:8px 24px;font:inherit;font-size:16px;cursor:pointer}
.bmlms-theory-exam .bmlms-quiz-questions{order:3;padding:0;margin:0;border:0;border-radius:20px;background:#fff;box-shadow:0 16px 24px #24364b1c;overflow:hidden}
.bmlms-theory-exam .bmlms-quiz-question-meta{display:none}
.bmlms-theory-exam .bmlms-quiz-question-wrapper{scroll-margin-top:calc(var(--bmlms-theory-toolbar-offset,0px) + var(--bmlms-theory-toolbar-height,80px) + 16px);padding:0;margin:0;background:transparent;border:0}
.bmlms-theory-exam .bmlms-quiz-question{display:grid;grid-template-columns:minmax(0,1fr);gap:0;padding:0;margin:0;border:0;background:none}
.bmlms-theory-exam .bmlms-theory-question-title{grid-column:1/-1;padding:12px 24px;margin:0;border-bottom:1px solid #d9dde3}
.bmlms-theory-question-title h2{font-size:20px;line-height:1.4;font-weight:700;margin:0;color:#526271}
.bmlms-theory-help{scroll-margin-top:calc(var(--bmlms-theory-toolbar-offset,0px) + var(--bmlms-theory-toolbar-height,80px) + 16px);grid-column:1/-1;margin:8px 24px;padding:0;border:1px solid #d9dde3;background:#fafafa}
.bmlms-theory-help:not([open]){display:none}
.bmlms-theory-help>summary{display:none}
.bmlms-theory-help>summary::-webkit-details-marker{display:none}
.bmlms-theory-help-icon{display:inline-flex;align-items:center;justify-content:center;width:23px;height:23px;margin-right:8px;border-radius:4px;background:var(--theory-blue);color:#fff;font-weight:bold}
.bmlms-theory-help[open]>summary{background:#dce0e5}
.bmlms-theory-help[open] .bmlms-theory-help-icon{font-size:0}
.bmlms-theory-help[open] .bmlms-theory-help-icon::after{content:'−';font-size:20px}
.bmlms-theory-hint,.bmlms-theory-help [data-theory-explanation]{padding:12px 18px;line-height:1.6;overflow-wrap:anywhere}
.bmlms-theory-reveal{margin:0 18px 12px;padding:7px 12px;max-width:calc(100% - 36px);background:#fff;border:1px solid #9daebd;border-radius:4px;color:#334b60;cursor:pointer;font:inherit;white-space:normal}
.bmlms-theory-help [hidden]{display:none!important}
.bmlms-theory-correct-answer{font-weight:700;color:#ad4127}
.bmlms-theory-question-media{padding:16px 24px;min-width:0;overflow-wrap:anywhere}
.bmlms-theory-question-media img,.bmlms-theory-question-media video{max-width:100%;height:auto;object-fit:contain}
.bmlms-theory-exam .bmlms-quiz-question-options{padding:12px 24px 20px;margin:0;display:flex;flex-direction:column;gap:16px;min-width:0;counter-reset:theory-answer}
.bmlms-theory-exam .bmlms-quiz-question-option{counter-increment:theory-answer;position:relative;min-height:48px;padding:8px 0;border:0;background:transparent;border-radius:0;box-shadow:none;overflow-wrap:anywhere}
.bmlms-theory-exam .bmlms-quiz-question-option .bmlms-input-wrapper{gap:8px;align-items:center}
.bmlms-theory-exam .bmlms-quiz-question-option .bmlms-label::before{content:counter(theory-answer,upper-alpha) ' ';font-weight:700}
.bmlms-theory-exam .bmlms-quiz-question-options~.bmlms-quiz-questions-error{padding:0 24px}
.bmlms-theory-navigation{order:4;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:32px;margin-top:48px}
.bmlms-theory-navigation button{display:flex;align-items:center;justify-content:center;gap:16px;min-height:64px;padding:12px 20px;border:0;border-radius:40px;background:var(--theory-blue);color:#fff;cursor:pointer;font:inherit;font-size:18px;letter-spacing:1px;box-shadow:0 10px 18px #24364b15}
.bmlms-theory-navigation button:first-child>span{transform:rotate(180deg)}
.bmlms-theory-navigation button[data-theory-flag]{background:var(--theory-red)}
.bmlms-theory-exam button:disabled{opacity:.5;cursor:default}
.bmlms-theory-exam button:focus-visible,.bmlms-theory-help>summary:focus-visible{outline:3px solid #183f68;outline-offset:3px}
@media(min-width:901px){
 .bmlms-theory-exam .bmlms-quiz-question:is([data-question=single_choice],[data-question=multiple_choice],[data-question=true_false]):has(.bmlms-theory-question-media :is(img,video)){grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .bmlms-theory-exam .bmlms-quiz-question:is([data-question=single_choice],[data-question=multiple_choice],[data-question=true_false]):has(.bmlms-theory-question-media :is(img,video))>.bmlms-theory-question-media{grid-column:2;grid-row:3}
 .bmlms-theory-exam .bmlms-quiz-question:is([data-question=single_choice],[data-question=multiple_choice],[data-question=true_false]):has(.bmlms-theory-question-media :is(img,video))>.bmlms-quiz-question-options{grid-column:1;grid-row:3}
}
@media(max-width:767px){
 .bmlms-theory-exam{width:100%;margin:0 auto 28px}
 .bmlms-theory-exam form.bmlms-quiz-submission{grid-template-columns:12px minmax(0,1fr) 12px}
 .bmlms-theory-exam .bmlms-quiz-questions-pagination{padding-bottom:20px}
 .bmlms-theory-exam .bmlms-quiz-question-paginate-item{min-width:34px;min-height:34px;font-size:calc(14px - 2pt)}
 .bmlms-theory-toolbar-controls{padding:12px;gap:10px;flex-wrap:wrap}
 .bmlms-theory-toolbar h1{flex-basis:100%;font-size:18px}
 .bmlms-theory-timer{flex:1;font-size:16px}
 .bmlms-theory-grade{font-size:16px;padding:8px 16px}
 .bmlms-theory-exam .bmlms-theory-question-title{padding:12px}
 .bmlms-theory-question-title h2{font-size:18px}
 .bmlms-theory-help{margin:6px 12px}.bmlms-theory-help>summary{font-size:17px;padding:10px}
 .bmlms-theory-question-media,.bmlms-theory-exam .bmlms-quiz-question-options{padding:12px}
 .bmlms-theory-navigation{gap:8px;margin-top:24px}
 .bmlms-theory-navigation button{min-height:48px;padding:8px 6px;font-size:12px;letter-spacing:0;gap:6px}
}
@media(prefers-reduced-motion:reduce){.bmlms-theory-progress-fill{transition:none}}

.bmlms-theory-mode .bmlms-theory-exam form.bmlms-quiz-submission{height:auto!important;min-height:0;padding-top:0}
.bmlms-theory-exam form.bmlms-quiz-submission .bmlms-quiz-question-wrapper{max-height:none;overflow:visible}
.bmlms-theory-exam form.bmlms-quiz-submission .bmlms-quiz-questions{container-type:normal!important;flex:none;min-height:0;height:auto;display:block}
.bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] .bmlms-quiz-question-paginate-label{display:inline}
.bmlms-theory-grade,.bmlms-theory-help-toggle,.bmlms-theory-navigation button,.bmlms-theory-help>summary{text-transform:uppercase}

.bmlms-theory-exam form.bmlms-quiz-submission .bmlms-quiz-question-wrapper{margin-bottom:0}

.bmlms-theory-mode .bmlms-theory-exam form.bmlms-quiz-submission .bmlms-quiz-questions{position:static;inset:auto;transform:none;max-width:none;max-height:none;width:100%}
.bmlms-theory-mode .bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number]{position:static;inset:auto;transform:none;width:100%;max-width:none;overflow:visible;mask-image:none;-webkit-mask-image:none}
.bmlms-theory-mode .bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] ul{flex-wrap:wrap;width:100%;margin:0;justify-content:flex-start}
.bmlms-theory-exam form.bmlms-quiz .bmlms-quiz-question-options{display:flex;flex-direction:column}

.bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] ul{height:auto;padding:0;border:0;border-radius:0;background:transparent;gap:7px}
.bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] .bmlms-quiz-question-paginate-item{min-width:30px;min-height:28px;width:auto;height:auto;border:1px solid #c7cdd4;border-radius:4px;background:#fff;color:#627181;font-size:calc(16px - 2pt);padding:1px 6px}
.bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] .bmlms-quiz-question-paginate-item.active{background:var(--theory-blue);border-color:var(--theory-blue);color:#fff}
.bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] .bmlms-quiz-question-paginate-item[data-theory-flagged=true]{background:var(--theory-red);border-color:var(--theory-red);color:#fff}
@media(max-width:767px){.bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] .bmlms-quiz-question-paginate-item{min-width:34px;min-height:34px;font-size:calc(14px - 2pt)}}

.bmlms-theory-exam .bmlms-quiz-question:is([data-question=multiple_choice],[data-question=single_choice],[data-question=true_false]) .bmlms-quiz-question-option{font-size:18px;line-height:1.5}
.bmlms-theory-exam .bmlms-quiz-question-option .bmlms-label{font-size:inherit;line-height:inherit;font-weight:400}

.bmlms-theory-help-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 20px;border:1px solid var(--theory-blue);border-radius:4px;background:#fff;color:#285e8d;font:inherit;font-size:16px;white-space:nowrap;cursor:pointer}
.bmlms-theory-help-toggle[aria-expanded=true]{background:#e0eef9}
@media(max-width:767px){.bmlms-theory-help-toggle{padding:8px 16px;font-size:16px}.bmlms-theory-exam .bmlms-quiz-questions{border-radius:12px}}

@media(max-width:480px){.bmlms-theory-toolbar-controls{gap:8px}.bmlms-theory-toolbar h1{font-size:18px}.bmlms-theory-toolbar .bmlms-theory-timer{font-size:16px}.bmlms-theory-grade,.bmlms-theory-help-toggle{padding:8px 12px;font-size:16px}}

.bmlms-theory-clock{display:inline-block;flex:0 0 18px;width:18px;height:18px;background:currentColor;mask:url("../icons/clock.svg") center/contain no-repeat;-webkit-mask:url("../icons/clock.svg") center/contain no-repeat}

/* A single, full-width dock shows the active question's own help panel. */
.bmlms-theory-help-slot{border-top:1px solid #d9dde3;max-height:min(50dvh,480px);overflow-y:auto;overscroll-behavior:auto;background:#f8fafc}
.bmlms-theory-help-slot[hidden],.bmlms-theory-help-slot>.bmlms-theory-help[hidden]{display:none!important}
.bmlms-theory-help-slot>.bmlms-theory-help{margin:0;border:0;background:transparent;width:100%;box-sizing:border-box}
.bmlms-theory-help-slot .bmlms-theory-hint{display:flex;align-items:flex-start;gap:10px;padding:16px 24px}
.bmlms-theory-help-slot .bmlms-theory-hint>div{min-width:0}
.bmlms-theory-help-slot .bmlms-theory-reveal{margin-inline:24px;max-width:calc(100% - 48px)}
.bmlms-theory-help-slot [data-theory-explanation]{padding-inline:24px}
.bmlms-theory-info-icon{display:inline-block;flex:0 0 20px;width:20px;height:20px;margin-top:3px;background:currentColor;mask:url("../icons/info.svg") center/contain no-repeat;-webkit-mask:url("../icons/info.svg") center/contain no-repeat}
.bmlms-theory-help-arrow{display:inline-block;flex:0 0 14px;width:14px;height:14px;background:currentColor;mask:url("../icons/chevron-down.svg") center/contain no-repeat;-webkit-mask:url("../icons/chevron-down.svg") center/contain no-repeat}
.bmlms-theory-help-toggle[aria-expanded=true] .bmlms-theory-help-arrow{transform:rotate(180deg)}
.bmlms-theory-exam .bmlms-theory-toolbar button.bmlms-theory-help-toggle:is(:hover,:focus,:active,[aria-expanded=true]){color:#285e8d;background:#e0eef9;border-color:#5ba3e2}
@media(max-width:767px){.bmlms-theory-help-slot .bmlms-theory-hint,.bmlms-theory-help-slot [data-theory-explanation]{padding-inline:12px}.bmlms-theory-help-slot .bmlms-theory-reveal{margin-inline:12px;max-width:calc(100% - 24px)}}

/* The theory page scrolls as one document, including when the theme header pins. */
[data-theory-exam] form.bmlms-quiz-submission{height:auto!important;min-height:0!important;max-height:none!important;align-content:start;grid-auto-rows:auto}
[data-theory-exam] form.bmlms-quiz-submission .bmlms-quiz-questions{position:static!important;inset:auto!important;transform:none!important;height:auto!important;min-height:0!important;max-height:none!important;align-self:start;container-type:normal!important}
[data-theory-exam] form.bmlms-quiz-submission .bmlms-quiz-question-wrapper{height:auto!important;min-height:0;max-height:none!important;overflow:visible!important;margin-bottom:0!important}
[data-theory-exam] form.bmlms-quiz-submission .bmlms-quiz-question{margin-block:0}
[data-theory-exam] .bmlms-quiz-questions-pagination{position:static!important;inset:auto!important;transform:none!important}
.bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] .bmlms-quiz-question-paginate-item.answered:not([data-theory-flagged=true]){background:#d8f3e5;border-color:#348765;color:#185c42}
.bmlms-theory-exam .bmlms-quiz-questions-pagination[data-pagination-style=number] .bmlms-quiz-question-paginate-item.active{outline:2px solid #326ea3;outline-offset:2px}

/* Keep answer letters and unselected controls visible against the white question card. */
.bmlms-theory-exam .bmlms-quiz-question-option .bmlms-label::before{color:#5f6c78;font-weight:700}
.bmlms-theory-exam .bmlms-quiz-question-option:has(input:checked) .bmlms-label::before{color:#397fbd}
.bmlms-theory-exam .bmlms-quiz-question-option:not([data-option=correct]):not([data-option=incorrect]) input.bmlms-radio:not(:disabled){box-sizing:border-box;flex:0 0 22px;width:22px;height:22px;margin:0;border:1px solid #d4d7da;background:#eee;box-shadow:0 1px 3px #24364b24}
.bmlms-theory-exam .bmlms-quiz-question-option:not([data-option=correct]):not([data-option=incorrect]) input.bmlms-radio:checked:not(:disabled){border:2px solid #397fbd;background:#fff;box-shadow:0 0 0 2px #397fbd1a}
.bmlms-theory-exam .bmlms-quiz-question-option:not([data-option=correct]):not([data-option=incorrect]) input.bmlms-radio:checked:not(:disabled)::after{width:10px;height:10px;background:#397fbd}

.bmlms-theory-help-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:0 24px 12px}
.bmlms-theory-help-slot .bmlms-theory-help-actions .bmlms-theory-reveal{margin:0;max-width:100%}
.bmlms-theory-book-reference{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;max-width:100%;padding:7px 12px;background:#fff;border:1px solid #9daebd;border-radius:4px;color:#334b60;text-decoration:none;font:inherit;white-space:normal}
.bmlms-theory-exam .bmlms-theory-book-reference:is(:hover,:focus){background:#e0eef9;color:#285e8d;border-color:#5ba3e2}
.bmlms-theory-book-reference:focus-visible{outline:3px solid #183f68;outline-offset:3px}
@media(max-width:767px){.bmlms-theory-help-actions{padding-inline:12px}}
