/* Certificate CBT runner. Neutral surfaces, one filled action per view. */
.cbr {
    --cbr-scale: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 8px 0 56px;
    color: var(--wq-text, #e8edf3);
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.cbr [hidden], .cbr-dialog [hidden] { display: none !important; }
:is(.cbr, .cbr-dialog, .cbr-viewer, .cbr-zoom) :is(button, a, summary, select):focus-visible { outline: 2px solid var(--wq-accent, #4da3f7); outline-offset: 2px; }
.cbr-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; }
.cbr-icon svg { width: 100%; height: 100%; }
html.dark .cbr a.cbr-back { display: inline-flex; align-items: center; min-height: 40px; color: var(--wq-text-muted, #a8b5c5); font-size: 14.5px; text-decoration: none; }
.cbr-back::before { content: "‹"; margin-right: 6px; font-size: 19px; line-height: 1; }
.cbr-intro__title { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.cbr-intro h1 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 750; line-height: 1.3; letter-spacing: -.04em; }
.cbr-loading, .cbr-note { color: var(--wq-text-muted, #a8b5c5); font-size: 14.5px; line-height: 1.6; }
.cbr-note { margin: 0; }

/* Buttons */
.cbr-btn, html.dark .cbr a.cbr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;
    padding: 8px 18px;
    border: 1px solid var(--wq-border-strong, #516983);
    border-radius: 10px;
    background: transparent;
    color: var(--wq-text, #e8edf3);
    font: inherit;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}
.cbr-btn:disabled { opacity: .38; cursor: default; }
.cbr-btn--primary, html.dark .cbr a.cbr-btn--primary { border-color: var(--wq-primary, #2873dc); background: var(--wq-primary, #2873dc); color: #fff; }
.cbr-btn--wide { width: 100%; }
.cbr-btn .cbr-icon { width: 20px; height: 20px; }
.cbr-row, .cbr-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cbr-text { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; border: 0; background: none; color: var(--wq-text-soft, #c9d3df); font: inherit; font-size: 15px; cursor: pointer; }
.cbr-text .cbr-icon { width: 18px; height: 18px; }

/* Start */
.cbr-start { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 32px; margin-top: 24px; }
.cbr-start--single { grid-template-columns: minmax(0, 520px); }
.cbr-setup { display: grid; gap: 28px; min-width: 0; }
.cbr-block > h2 { margin: 0 0 12px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.cbr-resume { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 24px; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--wq-border-strong, #516983); border-radius: 14px; background: var(--wq-surface, #20262e); }
.cbr-resume__copy > strong, .cbr-resume__copy > span { display: block; line-height: 1.5; }
.cbr-resume__copy > strong { font-size: 16px; }
.cbr-resume__copy > span { color: var(--wq-text-muted, #a8b5c5); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.cbr-resume__track { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--wq-surface-3, #333e4b); overflow: hidden; }
.cbr-resume__track span { display: block; height: 100%; background: var(--wq-accent, #4da3f7); }

.cbr-dot { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; border: 2px solid var(--wq-text-dim, #91a0b2); border-radius: 50%; }
[aria-checked="true"] > .cbr-dot { border: 6px solid var(--wq-accent, #4da3f7); background: #fff; }
.cbr-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cbr-mode { display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px; border: 1px solid var(--wq-border, #374351); border-radius: 14px; background: var(--wq-surface, #20262e); color: var(--wq-text, #e8edf3); font: inherit; text-align: left; cursor: pointer; }
.cbr-mode > .cbr-icon { width: 26px; height: 26px; color: var(--wq-text-soft, #c9d3df); }
.cbr-mode__copy { flex: 1 1 auto; min-width: 0; }
.cbr-mode__copy strong, .cbr-mode__copy span { display: block; line-height: 1.45; }
.cbr-mode__copy strong { font-size: 16.5px; }
.cbr-mode__copy span { margin-top: 2px; color: var(--wq-text-muted, #a8b5c5); font-size: 14px; }
.cbr-mode[aria-checked="true"] { border-color: var(--wq-accent, #4da3f7); box-shadow: inset 0 0 0 1px var(--wq-accent, #4da3f7); }
.cbr-scopes { display: grid; gap: 18px; }
.cbr .cbr-scope-group h3 { margin: 0 0 8px; color: var(--wq-text-muted, #a8b5c5); font-size: 14px; font-weight: 600; }
.cbr-scope-list { border: 1px solid var(--wq-border, #374351); border-radius: 14px; background: var(--wq-surface, #20262e); overflow: hidden; }
.cbr-scope { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; background: none; color: var(--wq-text, #e8edf3); font: inherit; text-align: left; cursor: pointer; }
.cbr-scope + .cbr-scope { border-top: 1px solid var(--wq-border, #374351); }
.cbr-scope[aria-checked="true"] { background: var(--wq-surface-2, #29313b); }
.cbr-scope__copy { flex: 1 1 auto; min-width: 0; }
.cbr-scope__copy strong, .cbr-scope__copy span { display: block; line-height: 1.45; }
.cbr-scope__copy strong { font-size: 15.5px; font-weight: 600; }
.cbr-scope__copy span { color: var(--wq-text-muted, #a8b5c5); font-size: 14px; }
.cbr-scope__meta { flex: 0 0 auto; color: var(--wq-text-muted, #a8b5c5); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cbr-segment { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--wq-border, #374351); border-radius: 11px; background: var(--wq-surface, #20262e); }
.cbr-segment button { flex: 1 1 auto; min-height: 42px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--wq-text-muted, #a8b5c5); font: inherit; font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; }
.cbr-segment button[aria-checked="true"] { background: var(--wq-surface-3, #333e4b); color: var(--wq-text, #e8edf3); font-weight: 650; }
.cbr-rows { margin: 0; padding: 0; list-style: none; }
.cbr-rows li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 15px; line-height: 1.45; }
.cbr-rows li + li { border-top: 1px solid var(--wq-border, #374351); }
.cbr-rows__value { flex: 0 0 auto; color: var(--wq-text-soft, #c9d3df); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cbr-rows--pass .cbr-rows__value { color: var(--wq-text, #e8edf3); font-weight: 650; }
.cbr-block > .cbr-rows { padding: 4px 16px; border: 1px solid var(--wq-border, #374351); border-radius: 14px; background: var(--wq-surface, #20262e); }
.cbr-tips { margin: 0; padding-left: 20px; color: var(--wq-text-soft, #c9d3df); font-size: 15px; line-height: 1.75; }
.cbr-tips li::marker { color: var(--wq-text-dim, #91a0b2); }
.cbr-info { padding: 20px; border: 1px solid var(--wq-border, #374351); border-radius: 16px; background: var(--wq-surface, #20262e); }
.cbr-info h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.cbr .cbr-info h3 { margin: 18px 0 4px; color: var(--wq-text-muted, #a8b5c5); font-size: 14px; font-weight: 600; }
.cbr-info .cbr-note { margin-top: 12px; }
.cbr-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 14px 0 0; padding: 14px 0; border-block: 1px solid var(--wq-border, #374351); }
.cbr-facts > div + div { padding-left: 18px; border-left: 1px solid var(--wq-border, #374351); }
.cbr-facts dt { color: var(--wq-text-muted, #a8b5c5); font-size: 14px; font-weight: 400; }
.cbr-facts dd { margin: 2px 0 0; font-size: 15px; }
.cbr-facts dd strong { margin-right: 2px; font-size: 26px; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cbr-go { margin-top: 18px; }
.cbr-go .cbr-btn { min-height: 52px; font-size: 16.5px; }
.cbr-go__summary { display: none; }
.cbr-empty { display: grid; justify-items: start; gap: 10px; max-width: 520px; margin-top: 24px; padding: 28px 24px; border: 1px solid var(--wq-border, #374351); border-radius: 16px; background: var(--wq-surface, #20262e); }
.cbr-empty > .cbr-icon { width: 34px; height: 34px; color: var(--wq-text-muted, #a8b5c5); }
.cbr-empty h2 { margin: 0; font-size: 19px; }
.cbr-empty p { margin: 0 0 8px; color: var(--wq-text-soft, #c9d3df); line-height: 1.6; }

/* Running: one screen of its own; only the question and the sheet scroll. */
body.is-cbt-running { overflow: hidden; padding-bottom: 0 !important; }
body.is-cbt-running :is(.top-header, .bottom-nav, .desktop-footer, .site-footer, .desktop-side-ad, .desktop-side-multiplex-ad) { display: none !important; }
.cbr-run {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    grid-template: "bar" auto "tabs" auto "progress" 3px "body" minmax(0, 1fr) "foot" auto / minmax(0, 1fr);
    height: 100dvh;
    background: var(--wq-bg, #15191f);
}
.is-paused .cbr-run > :not(.cbr-toast) { visibility: hidden; }
.cbr-bar { grid-area: bar; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: env(safe-area-inset-top) 16px 0 8px; background: var(--wq-surface, #20262e); }
.cbr-exit { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 9px; background: none; color: var(--wq-text-soft, #c9d3df); font: inherit; font-size: 15px; cursor: pointer; }
.cbr-bar__title { min-width: 0; line-height: 1.4; }
.cbr-bar__title strong, .cbr-bar__title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbr-bar__title strong { font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; }
.cbr-bar__title span { color: var(--wq-text-muted, #a8b5c5); font-size: 13.5px; }
.cbr-clock { display: grid; grid-template: "label icon" auto "value icon" auto / auto auto; align-items: center; column-gap: 12px; min-height: 46px; padding: 3px 12px; border: 1px solid var(--wq-border-strong, #516983); border-radius: 10px; background: none; color: var(--wq-text, #e8edf3); font: inherit; text-align: right; cursor: pointer; }
.cbr-clock small { grid-area: label; color: var(--wq-text-muted, #a8b5c5); font-size: 12px; line-height: 1.2; }
.cbr-clock strong { grid-area: value; min-width: 3.4em; font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cbr-clock .cbr-icon { grid-area: icon; color: var(--wq-text-muted, #a8b5c5); }
.cbr-clock.is-low { border-color: #d8574c; }
.cbr-clock.is-low strong { color: #f0877d; }
.cbr-tabs { grid-area: tabs; display: flex; gap: 2px; padding: 0 16px; border-top: 1px solid var(--wq-border, #374351); background: var(--wq-surface, #20262e); overflow-x: auto; scrollbar-width: none; }
.cbr-tabs::-webkit-scrollbar { display: none; }
.cbr-tab { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 46px; padding: 6px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--wq-text-muted, #a8b5c5); font: inherit; font-size: 15px; white-space: nowrap; cursor: pointer; }
.cbr-tab__count { color: var(--wq-text-dim, #91a0b2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cbr-tab[aria-current] { border-bottom-color: var(--wq-accent, #4da3f7); color: var(--wq-text, #e8edf3); font-weight: 650; }
.cbr-tab[aria-current] .cbr-tab__count { color: var(--wq-text-soft, #c9d3df); font-weight: 400; }
.cbr-progress { grid-area: progress; background: var(--wq-surface-3, #333e4b); }
.cbr-progress span { display: block; width: 0; height: 100%; background: var(--wq-accent, #4da3f7); transition: width .2s ease; }
.cbr-body { grid-area: body; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 32px; }
.cbr-question { max-width: 780px; margin: 0 auto; font-size: calc(16.5px * var(--cbr-scale)); }
.cbr-q__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.cbr-q__where { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 14.5px; }
.cbr-q__where strong { overflow: hidden; color: var(--wq-text-soft, #c9d3df); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cbr-q__where span { flex: 0 0 auto; color: var(--wq-text-muted, #a8b5c5); font-variant-numeric: tabular-nums; }
.cbr-q__tools { display: flex; flex: 0 0 auto; gap: 8px; }
.cbr-fonts { display: flex; border: 1px solid var(--wq-border, #374351); border-radius: 9px; }
.cbr-fonts .cbr-tool + .cbr-tool { border-left: 1px solid var(--wq-border, #374351); }
.cbr-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 42px; padding: 4px 10px; border: 0; background: none; color: var(--wq-text-soft, #c9d3df); font: inherit; font-size: 14.5px; white-space: nowrap; cursor: pointer; }
.cbr-tool--small { font-size: 13px; }
.cbr-tool--large { font-size: 18px; font-weight: 600; }
.cbr-tool--flag { border: 1px solid var(--wq-border, #374351); border-radius: 9px; }
.cbr-tool .cbr-icon { width: 18px; height: 18px; }
.cbr-tool--flag[aria-pressed="true"] { border-color: #e0a13a; color: #f2bd63; }
.cbr-tool--flag[aria-pressed="true"] svg { fill: #f2bd63; }
.cbr-q__stem { display: flex; gap: .5em; margin: 14px 0 0; font-size: 1.12em; font-weight: 650; line-height: 1.6; letter-spacing: -.015em; }
.cbr-q__no { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.cbr-q__text { min-width: 0; white-space: pre-line; }
.cbr-figure { position: relative; display: block; width: fit-content; max-width: min(100%, 640px); margin: 16px 0 0; padding: 0; border: 0; border-radius: 10px; background: none; overflow: hidden; cursor: zoom-in; }
.cbr-figure img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(42dvh, 400px); }
.cbr-figure--sign > .cbr-icon { display: none; }
.cbr-figure--sign img { max-height: min(30dvh, 250px); }
.cbr-figure--paper { max-width: min(100%, 748px); padding: 14px 14px 4px; background: #fff; }
.cbr-figure--paper img { max-height: min(60dvh, 560px); }
.cbr-figure > .cbr-icon { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; padding: 8px; border-radius: 9px; background: rgba(21, 25, 31, .82); color: #fff; }
/* Tables and graphs run to the edge, so the hint sits below them. */
.cbr-figure--paper > .cbr-icon { position: static; display: grid; width: 28px; height: 28px; margin-left: auto; padding: 4px; background: none; color: #43546a; }
.cbr-passage { margin: 16px 0 0; padding: 14px 18px; border: 1px solid var(--wq-border-strong, #516983); border-radius: 4px; font-size: .97em; line-height: 1.7; }
.cbr-passage > * { margin: 0; }
.cbr-passage > * + * { margin-top: .35em; }
.cbr-passage p { white-space: pre-line; }
.cbr-li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5em; }
.cbr-li__mark { min-width: 1.1em; font-variant-numeric: tabular-nums; }
.cbr-li--dot .cbr-li__mark { min-width: 0; width: 5px; height: 5px; margin: .72em .25em 0 .1em; border-radius: 50%; background: currentColor; }
.cbr-passage--facts { border-color: var(--wq-border, #374351); border-radius: 10px; background: var(--wq-surface, #20262e); }
.cbr-multi { display: flex; align-items: center; gap: 8px; margin: 18px 0 -6px; font-size: .92em; }
.cbr-multi strong { color: #f2bd63; }
.cbr-multi span { color: var(--wq-text-muted, #a8b5c5); font-variant-numeric: tabular-nums; }
.cbr-options { display: grid; gap: 8px; margin-top: 20px; }
.cbr-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; width: 100%; min-height: 54px; padding: 12px 16px; border: 1px solid var(--wq-border, #374351); border-radius: 12px; background: var(--wq-surface, #20262e); color: var(--wq-text, #e8edf3); font: inherit; line-height: 1.6; text-align: left; cursor: pointer; }
.cbr-option__no { display: inline-grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border: 1.5px solid var(--wq-text-dim, #91a0b2); border-radius: 50%; font-size: 14.5px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.cbr-option__text { padding-top: .06em; white-space: pre-line; }
.cbr-option__tag { align-self: center; color: var(--wq-text-soft, #c9d3df); font-size: 14px; font-weight: 600; white-space: nowrap; }
.cbr-option[aria-checked="true"] { border-color: var(--wq-accent, #4da3f7); box-shadow: inset 0 0 0 1px var(--wq-accent, #4da3f7); }
.cbr-option[aria-checked="true"] .cbr-option__no { border-color: var(--wq-primary, #2873dc); background: var(--wq-primary, #2873dc); color: #fff; }
.cbr-option:disabled { cursor: default; }
.cbr-option.is-correct { border-color: #35a56f; box-shadow: inset 0 0 0 1px #35a56f; }
.cbr-option.is-correct .cbr-option__no { border-color: #23845a; background: #23845a; color: #fff; }
.cbr-option.is-correct .cbr-option__tag { color: #57c48e; }
.cbr-option.is-wrong { border-color: #d8574c; box-shadow: inset 0 0 0 1px #d8574c; }
.cbr-option.is-wrong .cbr-option__no { border-color: #c2463c; background: #c2463c; color: #fff; }
.cbr-option.is-wrong .cbr-option__tag { color: #f0877d; }
.cbr-feedback { margin-top: 20px; padding: 16px 18px 18px; border: 1px solid var(--wq-border, #374351); border-radius: 12px; background: var(--wq-surface, #20262e); }
.cbr-feedback__head { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; font-size: 1em; }
.cbr-feedback__head .cbr-icon { width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: #23845a; color: #fff; }
.cbr-feedback.is-wrong .cbr-feedback__head .cbr-icon { background: #c2463c; }
.cbr-feedback__head strong { color: #57c48e; font-size: 1.06em; }
.cbr-feedback.is-wrong .cbr-feedback__head strong { color: #f0877d; }
.cbr-feedback__head > span:last-child { color: var(--wq-text-soft, #c9d3df); }
.cbr .cbr-feedback h3, .cbr .cbr-detail h4, .cbr-viewer .cbr-detail h4 { margin: 14px 0 4px; color: var(--wq-text-muted, #a8b5c5); font-size: 14px; font-weight: 600; }
.cbr-explain { color: var(--wq-text-soft, #c9d3df); font-size: .97em; line-height: 1.75; }
.cbr-explain > * { margin: 0; }
.cbr-explain > * + * { margin-top: .45em; }
.cbr-law { color: var(--wq-text-muted, #a8b5c5); font-size: .93em; }
.cbr-blank { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-left: 16px; border-radius: 10px; background: var(--wq-surface, #20262e); color: var(--wq-text-soft, #c9d3df); font-size: 14.5px; }
.cbr-foot { grid-area: foot; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--wq-border, #374351); background: var(--wq-bg, #15191f); }
.cbr-foot .cbr-btn { padding-inline: 12px; white-space: nowrap; }
.cbr-foot__sheet { font-variant-numeric: tabular-nums; }
.cbr-foot__hint { display: none; }
.cbr-toast { position: fixed; left: 50%; bottom: 92px; z-index: 60; margin: 0; padding: 12px 20px; border-radius: 10px; background: #f5f8fc; color: #15191f; font-weight: 600; white-space: nowrap; transform: translateX(-50%); }

/* Answer sheet */
.cbr-sheet { display: none; }
.cbr-sheet.is-open { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; padding: calc(8px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom)); background: var(--wq-bg, #15191f); }
.cbr-sheet__head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.cbr-sheet__head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.cbr-sheet__filter .cbr-segment button { flex: 1 1 0; min-height: 40px; padding: 4px 6px; font-size: 14px; }
.cbr-omr { flex: 1 1 auto; min-height: 0; margin: 10px 0 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--wq-border, #374351); }
.cbr .cbr-omr__group h3 { position: sticky; top: 0; z-index: 1; margin: 0; padding: 10px 4px 8px; background: var(--wq-bg, #15191f); color: var(--wq-text-muted, #a8b5c5); font-size: 14px; font-weight: 600; }
.cbr-omr__row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; min-height: 46px; border-bottom: 1px solid var(--wq-border, #374351); }
.cbr-omr__row.is-current { background: var(--wq-surface-2, #29313b); box-shadow: inset 3px 0 0 var(--wq-accent, #4da3f7); }
.cbr-omr__no { display: flex; align-items: center; justify-content: center; align-self: stretch; gap: 5px; padding: 0; border: 0; background: none; color: var(--wq-text-soft, #c9d3df); font: inherit; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.cbr-omr__row.is-flagged .cbr-omr__no { color: #f2bd63; }
.cbr-omr__row.is-flagged .cbr-omr__no::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f2bd63; }
.cbr-omr__marks { display: flex; justify-content: space-evenly; gap: 2px; }
.cbr-mark { position: relative; display: inline-grid; place-items: center; flex: 0 1 44px; min-width: 0; height: 44px; padding: 0; border: 0; background: none; color: var(--wq-text-muted, #a8b5c5); font: inherit; font-size: 14px; font-weight: 600; line-height: 1; isolation: isolate; cursor: pointer; }
.cbr-mark::before { content: ""; position: absolute; top: 50%; left: 50%; z-index: -1; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 1.5px solid var(--wq-border-strong, #516983); border-radius: 50%; }
.cbr-mark:is(.is-on, .is-correct, .is-wrong) { color: #fff; }
.cbr-mark.is-on::before { border-color: var(--wq-primary, #2873dc); background: var(--wq-primary, #2873dc); }
.cbr-mark.is-correct::before { border-color: #23845a; background: #23845a; }
.cbr-mark.is-wrong::before { border-color: #c2463c; background: #c2463c; }
.cbr-mark:disabled { cursor: default; }
.cbr-omr__empty { padding: 20px 4px; }
.cbr-sheet__foot { display: grid; gap: 10px; padding-top: 12px; }
.cbr-sheet__foot p { margin: 0; color: var(--wq-text-soft, #c9d3df); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.cbr-sheet__submit.is-ready { border-color: var(--wq-primary, #2873dc); background: var(--wq-primary, #2873dc); color: #fff; }

/* Dialogs */
.cbr-dialog { margin: auto; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 24px; border: 1px solid var(--wq-border-strong, #516983); border-radius: 16px; background: var(--wq-surface, #20262e); color: var(--wq-text, #e8edf3); word-break: keep-all; overflow-y: auto; }
.cbr-dialog::backdrop, .cbr-viewer::backdrop { background: rgba(8, 11, 15, .74); }
.cbr-dialog h2 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.03em; }
.cbr-dialog p { margin: 6px 0 0; color: var(--wq-text-soft, #c9d3df); font-size: 15.5px; line-height: 1.6; }
.cbr-dialog .cbr-rows { margin-top: 12px; border-block: 1px solid var(--wq-border, #374351); }
.cbr-dialog .cbr-rows li.is-complete .cbr-rows__value { color: #57c48e; }
.cbr-dialog__blanks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; color: var(--wq-text-muted, #a8b5c5); font-size: 14px; }
.cbr-dialog__blanks .cbr-cell { width: 44px; }
.cbr-dialog .cbr-dialog__time { margin: 10px 0 0; color: var(--wq-text, #e8edf3); font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cbr-dialog .cbr-row { margin-top: 20px; }
.cbr-dialog .cbr-btn { flex: 1 1 120px; }
.cbr-cell { position: relative; min-height: 44px; padding: 0; border: 1px solid var(--wq-border-strong, #516983); border-radius: 9px; background: none; color: var(--wq-text, #e8edf3); font: inherit; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.cbr-cell.is-correct { border-color: transparent; background: #23845a; color: #fff; }
.cbr-cell.is-wrong { border-color: transparent; background: #b8443b; color: #fff; }
.cbr-cell.is-blank { border-style: dashed; color: var(--wq-text-muted, #a8b5c5); }
.cbr-cell.is-flagged::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #f2bd63; }

/* Full-screen figure */
.cbr-zoom { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #0b0e12; overflow: hidden; }
.cbr-zoom__stage { display: grid; width: 100%; height: 100%; padding: 12px; overflow: auto; touch-action: pan-x pan-y; }
.cbr-zoom__stage img { display: block; max-width: none; height: auto; margin: auto; }
.cbr-zoom--paper .cbr-zoom__stage img { background: #fff; }
.cbr-zoom__tools { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; }
.cbr-zoom__button { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid var(--wq-border-strong, #516983); border-radius: 11px; background: #15191f; color: #fff; cursor: pointer; }
.cbr-zoom__button:disabled { color: var(--wq-text-dim, #91a0b2); cursor: default; }

/* Result */
.cbr-result { display: grid; gap: 30px; margin-top: 22px; }
.cbr-score { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 36px; padding: 26px 28px; border: 1px solid var(--wq-border, #374351); border-radius: 18px; background: var(--wq-surface, #20262e); }
.cbr-score__message { grid-column: 1 / -1; margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--wq-border, #374351); color: #f2bd63; font-size: 15px; }
.cbr-score p { margin: 0; }
.cbr-score__meta { color: var(--wq-text-muted, #a8b5c5); font-size: 15px; line-height: 1.5; }
.cbr-score__value { margin-top: 4px !important; font-size: 20px; line-height: 1.1; }
.cbr-score__value strong { margin-right: 5px; font-size: 58px; font-weight: 750; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.cbr-score h2 { margin: 8px 0 0; font-size: 20px; letter-spacing: -.03em; }
.cbr-score.is-pass h2 { color: #57c48e; }
.cbr-score.is-fail h2 { color: #f0877d; }
.cbr-score__failed { margin-top: 4px !important; color: var(--wq-text-soft, #c9d3df); font-size: 15px; line-height: 1.55; }
.cbr-score .cbr-note { margin-top: 10px; }
.cbr-scale { margin: 18px 0 30px; }
.cbr-scale__track { position: relative; height: 10px; border-radius: 5px; background: var(--wq-surface-3, #333e4b); }
.cbr-scale__track > span { display: block; height: 100%; border-radius: 5px; background: var(--wq-text-soft, #c9d3df); }
.is-pass .cbr-scale__track > span { background: #35a56f; }
.is-fail .cbr-scale__track > span { background: #d8574c; }
.cbr-scale__track i { position: absolute; top: -4px; width: 2px; height: 18px; background: #fff; font-style: normal; }
.cbr-scale__track i span { position: absolute; top: 22px; left: 50%; color: var(--wq-text-soft, #c9d3df); font-size: 13.5px; line-height: 1.3; white-space: nowrap; transform: translateX(-50%); }
.cbr-scale__track i:first-of-type:not(:last-of-type) span { transform: translateX(-100%); }
.cbr-scale__track i + i span { transform: none; }
.cbr-stats { align-self: center; margin: 0; padding-left: 36px; border-left: 1px solid var(--wq-border, #374351); }
.cbr-stats > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 15.5px; }
.cbr-stats > div + div { border-top: 1px solid var(--wq-border, #374351); }
.cbr-stats dt { color: var(--wq-text-muted, #a8b5c5); font-weight: 400; }
.cbr-stats dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.cbr-result__columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 32px; }
.cbr-result__columns > :only-child { grid-column: 1 / -1; }
.cbr-result__side { display: grid; gap: 28px; }
.cbr-subjects { display: grid; gap: 16px; }
.cbr-subject__row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 15.5px; }
.cbr-subject__name { min-width: 0; }
.cbr-subject__value { display: inline-flex; align-items: baseline; gap: 10px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.cbr-subject__value span { color: var(--wq-text-muted, #a8b5c5); font-size: 14px; }
.cbr-subject__value em { color: #f0877d; font-size: 14px; font-style: normal; font-weight: 650; }
.cbr-subject__track { position: relative; height: 10px; margin-top: 8px; border-radius: 5px; background: var(--wq-surface-3, #333e4b); }
.cbr-subject__track span { display: block; height: 100%; border-radius: 5px; background: #35a56f; }
.cbr-subject.is-fail .cbr-subject__track span { background: #d8574c; }
.cbr-subject__track i { position: absolute; top: -3px; width: 2px; height: 16px; background: #fff; }
.cbr-subjects + .cbr-note { margin-top: 12px; }
.cbr-history { display: flex; align-items: flex-end; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cbr-history li { display: grid; justify-items: center; gap: 4px; flex: 0 1 48px; color: var(--wq-text-muted, #a8b5c5); }
.cbr-history strong { color: var(--wq-text-soft, #c9d3df); font-weight: 600; }
.cbr-history__bar { display: flex; align-items: flex-end; width: 26px; height: 92px; border-radius: 5px; background: var(--wq-surface-2, #29313b); overflow: hidden; }
.cbr-history__bar span { display: block; width: 100%; background: var(--wq-border-strong, #516983); }
.cbr-history .is-now strong { color: var(--wq-text, #e8edf3); font-weight: 750; }
.cbr-history .is-now .cbr-history__bar span { background: var(--wq-accent, #4da3f7); }
.cbr-rows--button li { padding: 0; }
.cbr-rows--button button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 48px; padding: 8px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cbr-legend { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px; color: var(--wq-text-muted, #a8b5c5); font-size: 14px; }
.cbr-legend i { width: 14px; height: 14px; border: 1px solid transparent; border-radius: 4px; }
.cbr-legend i:not(:first-child) { margin-left: 10px; }
.cbr-legend .is-correct { background: #23845a; }
.cbr-legend .is-wrong { background: #b8443b; }
.cbr-legend .is-blank { border: 1px dashed var(--wq-text-dim, #91a0b2); }
.cbr-review > h3 { margin: 16px 0 8px; color: var(--wq-text-soft, #c9d3df); font-size: 15px; font-weight: 600; }
.cbr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.cbr-review__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.cbr-review__bar .cbr-segment { flex: 0 1 auto; }
.cbr-review__bar .cbr-segment button { padding-inline: 16px; }
.cbr-select { min-height: 50px; max-width: 100%; padding: 8px 14px; border: 1px solid var(--wq-border, #374351); border-radius: 11px; background: var(--wq-surface, #20262e); color: var(--wq-text, #e8edf3); font: inherit; font-size: 15px; }
.cbr-review__list { margin-top: 12px; }
.cbr-review__list > .cbr-btn { margin-top: 14px; }
.cbr-review__item { border-bottom: 1px solid var(--wq-border, #374351); }
.cbr-review__item summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; min-height: 56px; padding: 14px 2px; font-size: 15.5px; line-height: 1.6; list-style: none; cursor: pointer; }
.cbr-review__item summary::-webkit-details-marker { display: none; }
.cbr-review__item summary > .cbr-icon { margin-top: 2px; color: var(--wq-text-muted, #a8b5c5); transform: rotate(90deg); }
.cbr-review__item[open] summary > .cbr-icon { transform: rotate(-90deg); }
.cbr-review__item[open] .cbr-review__text { font-weight: 650; }
.cbr-state { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 26px; padding: 0 8px; border-radius: 7px; background: var(--wq-surface-3, #333e4b); color: var(--wq-text-soft, #c9d3df); font-size: 13.5px; font-weight: 650; line-height: 1; white-space: nowrap; }
.cbr-state.is-correct { background: #23845a; color: #fff; }
.cbr-state.is-wrong { background: #b8443b; color: #fff; }
.cbr-detail { max-width: 780px; font-size: 15.5px; line-height: 1.65; }
.cbr-review__item .cbr-detail { padding: 0 0 22px 62px; }
.cbr-detail .cbr-figure, .cbr-detail .cbr-passage { margin-top: 0; margin-bottom: 14px; }
.cbr-detail__options { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cbr-detail__options li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 7px 0; }
.cbr-detail__options .cbr-option__no { width: 26px; height: 26px; font-size: 13.5px; }
.cbr-detail__options em { align-self: center; font-size: 14px; font-style: normal; font-weight: 650; white-space: nowrap; }
.cbr-detail__options .is-correct { font-weight: 600; }
.cbr-detail__options .is-correct .cbr-option__no { border-color: #23845a; background: #23845a; color: #fff; }
.cbr-detail__options .is-correct em { color: #57c48e; }
.cbr-detail__options .is-wrong .cbr-option__no { border-color: #c2463c; background: #c2463c; color: #fff; }
.cbr-detail__options .is-wrong em { color: #f0877d; }
.cbr-review-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 18px; border: 1px solid var(--wq-border, #374351); border-radius: 14px; }
.cbr-review-note p { flex: 1 1 280px; margin: 0; font-size: 15px; line-height: 1.6; }

/* One graded question */
.cbr-viewer { width: min(820px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 48px)); max-height: none; margin: auto; padding: 0; border: 1px solid var(--wq-border-strong, #516983); border-radius: 16px; background: var(--wq-surface, #20262e); color: var(--wq-text, #e8edf3); word-break: keep-all; overflow-wrap: anywhere; overflow: hidden; }
.cbr-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.cbr-viewer__head { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 22px; border-bottom: 1px solid var(--wq-border, #374351); }
.cbr-viewer__where { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--wq-text-muted, #a8b5c5); font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.cbr-viewer__body { padding: 18px 22px 28px; overflow-y: auto; overscroll-behavior: contain; }
.cbr-viewer__body .cbr-q__stem { margin: 0 0 16px; font-size: 17.5px; }
.cbr-viewer__foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--wq-border, #374351); font-variant-numeric: tabular-nums; }
.cbr-viewer__foot > span { color: var(--wq-text-muted, #a8b5c5); font-size: 14.5px; }

@media (hover: hover) {
    .cbr-btn:not(:disabled):hover, html.dark .cbr a.cbr-btn:hover { border-color: var(--wq-accent, #4da3f7); }
    .cbr-btn--primary:not(:disabled):hover, html.dark .cbr a.cbr-btn--primary:hover, .cbr-sheet__submit.is-ready:hover { border-color: var(--wq-primary-hover, #3480e6); background: var(--wq-primary-hover, #3480e6); }
    html.dark .cbr a.cbr-back:hover, .cbr-exit:hover, .cbr-tab:hover, .cbr-text:hover { color: var(--wq-text, #e8edf3); }
    .cbr-mode:hover, .cbr-option:not(:disabled):hover { border-color: var(--wq-border-strong, #516983); }
    .cbr-mode[aria-checked="true"]:hover, .cbr-option[aria-checked="true"]:not(:disabled):hover { border-color: var(--wq-accent, #4da3f7); }
    .cbr-scope:hover, .cbr-segment button:not([aria-checked="true"]):hover { background: var(--wq-surface-2, #29313b); }
    .cbr-clock:hover { border-color: var(--wq-accent, #4da3f7); }
    .cbr-mark:not(:disabled):hover::before { border-color: var(--wq-accent, #4da3f7); }
    .cbr-cell:hover { outline: 2px solid var(--wq-text-soft, #c9d3df); outline-offset: 1px; }
    .cbr-rows--button button:hover, .cbr-review__item summary:hover .cbr-review__text { color: var(--wq-accent, #4da3f7); }
}

/* Desktop: the answer sheet stays open beside the question. */
@media (min-width: 1000px) {
    .cbr-run { grid-template: "bar bar" auto "tabs tabs" auto "progress progress" 3px "body side" minmax(0, 1fr) "foot side" auto / minmax(0, 1fr) 336px; }
    .cbr-bar { min-height: 64px; padding-inline: 16px 20px; }
    .cbr-bar__title { padding-left: 14px; border-left: 1px solid var(--wq-border, #374351); }
    .cbr-bar__title strong { font-size: 16.5px; }
    .cbr-tabs { padding-inline: 20px; }
    .cbr-body { padding: 18px 40px 40px; }
    .cbr-question { max-width: 840px; font-size: calc(17px * var(--cbr-scale)); }
    .cbr-sheet, .cbr-sheet.is-open { grid-area: side; position: static; display: flex; flex-direction: column; min-height: 0; padding: 10px 16px 12px; border-left: 1px solid var(--wq-border, #374351); background: var(--wq-surface, #20262e); }
    .cbr-sheet .cbr-segment { background: var(--wq-bg, #15191f); }
    .cbr .cbr-omr__group h3 { background: var(--wq-surface, #20262e); }
    .cbr-omr__row { min-height: 42px; }
    .cbr-mark { height: 40px; }
    .cbr-sheet__close, .cbr-foot__sheet { display: none; }
    .cbr-foot { grid-template-columns: 132px minmax(0, 1fr) 164px; align-items: center; padding-inline: 40px; }
    .cbr-foot__hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; color: var(--wq-text-muted, #a8b5c5); font-size: 13.5px; white-space: nowrap; }
    .cbr-foot__hint kbd { padding: 3px 7px; border: 1px solid var(--wq-border, #374351); border-radius: 6px; background: none; color: var(--wq-text-soft, #c9d3df); font: inherit; font-size: 12.5px; }
    .cbr-foot__hint kbd:not(:first-child) { margin-left: 12px; }
}
@media (max-width: 999px) {
    .cbr-start { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .cbr-result__columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .cbr-resume { grid-template-columns: minmax(0, 1fr); }
    .cbr-resume .cbr-btn { flex: 1 1 130px; padding-inline: 10px; }
    .cbr-setup { gap: 24px; }
    .cbr-modes { grid-template-columns: minmax(0, 1fr); }
    .cbr-mode { min-height: 72px; }
    .cbr-segment button { padding-inline: 6px; }
    .cbr-info { padding: 18px 16px; }
    .cbr:has(.cbr-go) { padding-bottom: 96px; }
    .cbr-go { position: fixed; inset: auto 0 var(--bottom-nav-height, 56px); z-index: 30; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--wq-border, #374351); background: var(--wq-surface, #20262e); }
    .cbr-go__summary { display: block; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .cbr-exit > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .cbr-bar { gap: 6px; padding-right: 12px; }
    .cbr-clock { padding-inline: 10px; column-gap: 8px; }
    .cbr-tabs { padding-inline: 8px; }
    .cbr-tab { padding-inline: 10px; font-size: 14.5px; }
    .cbr-tool--flag { padding-inline: 10px; }
    .cbr-option { gap: 12px; padding: 12px 14px; }
    .cbr-passage { padding: 12px 14px; }
    .cbr-figure--paper { padding: 8px 8px 2px; }
    .cbr-foot__prev > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .cbr-foot__prev { min-width: 52px; }
    .cbr-score { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; gap: 18px; }
    .cbr-score__value strong { font-size: 50px; }
    .cbr-stats { padding: 8px 0 0; border: 0; border-top: 1px solid var(--wq-border, #374351); }
    .cbr-actions .cbr-btn { flex: 1 1 100%; }
    .cbr-review__bar .cbr-segment { flex: 1 1 100%; }
    .cbr-review__bar .cbr-segment button { padding-inline: 6px; }
    .cbr-select { width: 100%; }
    .cbr-review__item summary { gap: 10px; }
    .cbr-review__item .cbr-detail { padding-left: 0; }
    .cbr-review-note .cbr-btn { flex: 1 1 100%; }
    .cbr-viewer { width: 100vw; max-width: none; height: 100dvh; margin: 0; border: 0; border-radius: 0; background: var(--wq-bg, #15191f); }
    .cbr-viewer__head { padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px; }
    .cbr-viewer__body { padding: 16px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) { .cbr-progress span { transition: none; } }
