/* Analytics and photo assignments use the colors of their surrounding workspace. */
.creator-progress,
.learner-photo-assignments {
    --white: var(--surface);
    --muted: var(--quiet);
    --learning-blue: var(--blue);
}

.creator-progress-table tbody tr:is(:hover, :focus-within) {
    background: var(--surface-muted);
}

.chip-success {
    color: var(--success);
    background: var(--success-soft);
}

.notice-error {
    color: var(--error);
    background: var(--error-soft);
    border-color: color-mix(in srgb, var(--error) 45%, var(--line));
}

/* The whole answer row is the radio/checkbox label, including on touch screens. */
.quiz-question :is(.quiz-option, .quiz-options > .field-inline:has(input[type='radio'])) {
    align-items: baseline;
    min-height: 44px;
    padding: .6rem .75rem;
    gap: .65rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .5rem;
    cursor: pointer;
    font-weight: 500;
    @media (hover: hover) {
        &:hover { border-color: var(--control-line); }
    }
    &:has(input:checked) {
        color: var(--blue-deep);
        border-color: var(--blue);
        background: var(--blue-soft);
    }
    &:has(input:focus-visible) {
        outline: 2px solid var(--blue);
        outline-offset: 2px;
    }
    &:has(input:disabled) { cursor: default; }
}

:where(html[data-theme='dark']) input:not([type='checkbox'], [type='radio']),
:where(html[data-theme='dark']) textarea,
:where(html[data-theme='dark']) select {
    background-color: var(--paper);
}

html[data-theme='dark'] :is(input, textarea)::placeholder {
    color: var(--quiet);
    opacity: 1;
}

html[data-theme='dark'] .course-card:nth-child(3n + 2) .card-band {
    color: var(--success);
    background: var(--success-soft);
}

html[data-theme='dark'] .course-card:nth-child(3n + 3) .card-band {
    color: var(--ink);
    background: var(--surface-muted);
}

/* White paper behind transparent artwork preserves fine black strokes in source diagrams. */
html[data-theme='dark'] :is(.asset-block, .tutor-source-image-viewport, .creation-source, .creation-media-preview) img {
    background-color: #f6f7f2;
}

.private-media-frame:fullscreen { background: #11151c; }

@media screen {
    html[data-theme='dark'] .certificate-logo {
        content: url('/brand/logo-on-dark.svg');
    }
}

/* Certificates print on white paper regardless of the app's screen preference. */
@media print {
    body:has(.certificate-sheet) {
        color-scheme: light;
        --ink: #11151c;
        --paper: #f6f7f2;
        --surface: #fff;
        --line: #dde2da;
        --quiet: #49525f;
        --blue: #2448c1;
        --blue-deep: #2448c1;
        --success: #385323;
        --success-soft: #e7f1d5;
        color: var(--ink);
        background: var(--surface);
    }
}

.qti-hottext-choice {
    display: inline;
    padding: .1em .22em;
    border-radius: .25em;
    background: var(--paper, #f6f7f2);
    cursor: pointer;
    box-decoration-break: clone;
}
.qti-hottext-choice input {
    width: 1em;
    height: 1em;
    margin: 0 .25em 0 0;
    accent-color: var(--blue, #325fff);
    vertical-align: baseline;
}
.qti-hottext-choice:has(input:checked) { background: var(--lime, #d9ff43); color: #11151c; }
.qti-hottext-choice:focus-within { outline: 2px solid var(--blue, #325fff); outline-offset: 2px; }

.qti-hottext[data-hide-control] .qti-hottext-choice input,
.qti-hottext[data-hide-unselected] .qti-hottext-choice input {
    position:absolute; inline-size:1px; block-size:1px; margin:0; clip-path:inset(50%);
}
.qti-hottext[data-hide-control] .qti-hottext-choice {
    box-shadow:inset 0 0 0 1px currentColor;
}
.qti-hottext[data-hide-unselected] .qti-hottext-choice:not(:hover):not(:focus-within):not(:has(input:checked)) {
    padding:0; background:transparent; color:inherit; box-shadow:none;
}
.qti-hottext[data-hide-unselected] .qti-hottext-choice:hover { outline:2px solid var(--blue,#325fff); }
.qti-hottext .qti-hottext-choice:has(input:checked) { text-decoration:underline; text-underline-offset:.12em; }
svg[data-hide-unselected] .qti-graphic-region:not(:hover):not([data-focused]):not([data-selected]) { opacity:0; }
.qti-graphic-region[data-focused] > :first-child { stroke-dasharray:3 1; stroke-width:4px; }
.qti-selection-message:empty { position:absolute; margin:0; inline-size:1px; block-size:1px; clip-path:inset(50%); }

.qti-choice-surface { max-inline-size:100%; min-inline-size:0; clear:both; }
.qti-choice-grid {
    display:grid;
    gap:.5rem;
    grid-template-columns:repeat(var(--qti-columns,1),minmax(0,1fr));
    grid-template-rows:repeat(var(--qti-rows,1),auto);
    grid-auto-flow:column;
    counter-reset:qti-option;
}
.qti-choice-grid[data-row-order] { grid-auto-flow:row; }
.qti-vocab-option {
    position:relative; display:flex; align-items:center; gap:.5rem;
    padding:.5rem; border:1px solid #adb5bd; border-radius:.5rem;
    cursor:pointer; overflow-wrap:anywhere; counter-increment:qti-option;
}
.qti-vocab-option input { flex:none; inline-size:1rem; block-size:1rem; margin:0; }
.qti-choice-grid[data-hide-control] input { position:absolute; width:1px; height:1px; clip-path:inset(50%); }
.qti-vocab-option:has(input:checked) { background:var(--lime,#d9ff43); border-color:var(--ink,#11151c); color:var(--ink,#11151c); }
.qti-choice-grid[data-hide-control] .qti-vocab-option:has(input:checked)::after { content:'✓'; }
.qti-vocab-option:focus-within { outline:2px solid var(--blue,#325fff); outline-offset:2px; }
.qti-choice-marker { writing-mode:horizontal-tb; text-orientation:upright; }
.qti-choice-marker[data-style=upper-alpha]::before { content:counter(qti-option,upper-alpha); }
.qti-choice-marker[data-style=lower-alpha]::before { content:counter(qti-option,lower-alpha); }
.qti-choice-marker[data-style=decimal]::before { content:counter(qti-option,decimal); }
.qti-choice-marker[data-style=cjk-ideographic]::before { content:counter(qti-option,cjk-ideographic); }
.qti-choice-marker[data-suffix=period]::after { content:'.'; }
.qti-choice-marker[data-suffix=parenthesis]::after { content:')'; }
.qti-vertical-choices { max-width:100%; overflow:auto; }
.qti-choice-surface > p:empty { display:none; }
@media(max-width:38rem) {
    .qti-choice-surface:not(.qti-vertical-choices) .qti-choice-grid { grid-template-columns:1fr; grid-template-rows:none; grid-auto-flow:row; }
}
