/* Open oral examination stage. All live colour follows the user's accent. */
#interrogSession.exam-stage {
    --exam-accent: var(--accent-color, #8b8b8b);
    --exam-muted: var(--text-secondary, #a8a29a);
    --exam-line: var(--border-color, rgba(128,128,128,.2));
    position: relative;
    isolation: isolate;
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: min(760px, calc(100dvh - 150px));
    margin: 0 auto;
    color: var(--text-primary);
    background: transparent;
    box-sizing: border-box;
}
#interrogSession.exam-stage.active { display: flex; }
#interrogSession > * { position: relative; z-index: 1; }
.exam-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 12px 44px 24px; }
.exam-status { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
#interrogSession .interrog-status-pill { font-size: 14px; font-weight: 600; background: none; border: 0; padding: 0; }
.exam-speaker { font-size: 13px; color: var(--exam-muted); }
.exam-speaker[data-state="examiner"], .exam-speaker[data-state="user"] { color: var(--exam-accent); }
.exam-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; flex: 2; min-width: 220px; }
#interrogProgress, #interrogCoverage { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--exam-muted); }
.exam-progress-track { order: 3; flex-basis: 100%; height: 12px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--exam-accent) 14%, transparent); }
.exam-progress-fill { height: 100%; width: 0; border-radius: inherit; background: var(--exam-accent); transition: width .35s ease; }
.exam-finish-btn { background: transparent; border: 1px solid var(--exam-line); border-radius: 99px; padding: 11px 17px; color: var(--exam-muted); font: inherit; font-size: 13px; cursor: pointer; }
.exam-question-card { display: flex; flex: 1; align-items: center; padding: 40px clamp(44px, 8vw, 110px); min-height: 240px; border: 0; background: none; box-shadow: none; }
#interrogSession .exam-question-text { width: 100%; max-width: 820px; margin: 0; font-family: inherit; font-size: clamp(24px, 3vw, 40px); font-weight: 450; letter-spacing: -.025em; line-height: 1.5; overflow-wrap: anywhere; }
#interrogSession[data-speaker="user"] .exam-question-text { opacity: .5; transition: opacity .2s; }
.exam-controls { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px 44px 0; }
.exam-stage-visual { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.exam-audio-orb {
    position: relative;
    isolation: isolate;
    width: min(188px, 48vw);
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--exam-accent) 20%, var(--exam-line));
    border-radius: 50%;
    background: color-mix(in srgb, var(--exam-accent) 6%, var(--study-chat-panel, var(--bg-secondary, #252422)));
    box-shadow: 0 0 48px color-mix(in srgb, var(--exam-accent) 10%, transparent), inset 0 0 34px color-mix(in srgb, var(--exam-accent) 5%, transparent);
}
#interrogSession #interrogAudioBlob.exam-audio-bubble { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.exam-mic-btn {
    position: relative;
    appearance: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--exam-accent) 32%, var(--exam-line));
    border-radius: 50%;
    background: color-mix(in srgb, var(--study-chat-panel, var(--bg-secondary, #252422)) 92%, var(--exam-accent));
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.06);
    transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
#interrogSession .exam-mic-btn, #interrogSession .exam-mic-btn::before { corner-shape: round !important; }
.exam-mic-btn::before {
    content: "";
    position: absolute;
    inset: -8px;
    border: 1px solid color-mix(in srgb, var(--exam-accent) 12%, transparent);
    border-radius: inherit;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.exam-mic-btn svg { width: 28px; height: 28px; }
.exam-mic-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--exam-accent); box-shadow: 0 6px 24px color-mix(in srgb, var(--exam-accent) 18%, transparent); }
.exam-mic-btn:active:not(:disabled) { transform: scale(.96); }
.exam-mic-btn:disabled { opacity: .45; cursor: wait; }
.exam-mic-btn.recording { background: color-mix(in srgb, var(--exam-accent) 18%, var(--study-chat-panel, var(--bg-secondary, #252422))); border-color: var(--exam-accent); }
.exam-mic-btn.recording svg { color: var(--exam-accent); }
.exam-mic-btn.recording::before { animation: exam-mic-pulse 1.8s ease-in-out infinite; }
.exam-audio-orb > .exam-mic-btn { position: absolute; top: 50%; left: 50%; z-index: 1; width: 84px; height: 84px; min-width: 84px; min-height: 84px; transform: translate(-50%, -50%); }
.exam-audio-orb > .exam-mic-btn:hover:not(:disabled) { transform: translate(-50%, calc(-50% - 2px)); }
.exam-audio-orb > .exam-mic-btn:active:not(:disabled) { transform: translate(-50%, -50%) scale(.96); }
@keyframes exam-mic-pulse { 0%,100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.1); opacity: .2; } }
.exam-caption { margin: 0; color: var(--exam-muted); font-size: 13px; text-align: center; min-height: 20px; }
.exam-toolbar { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.exam-tool-btn, .exam-text-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 12px; border: 0; background: transparent; color: var(--exam-muted); font: inherit; font-size: 13px; cursor: pointer; border-radius: 8px; }
.exam-tool-btn svg { width: 16px; height: 16px; }
.exam-tool-btn:hover:not(:disabled), .exam-text-toggle:hover { color: var(--text-primary); background: color-mix(in srgb, var(--exam-accent) 8%, transparent); }
.exam-tool-btn:disabled { opacity: .4; cursor: default; }
.exam-live, .exam-transcript-wrap { display: none !important; }
.exam-textrow { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 44px 24px; }
.exam-textcomposer { display: flex; gap: 10px; width: min(100%, 700px); align-items: flex-end; }
.exam-textcomposer[hidden] { display: none; }
#interrogTextFallback { flex: 1; min-width: 0; min-height: 48px; max-height: 120px; padding: 12px; background: transparent; color: var(--text-primary); border: 0; border-bottom: 1px solid var(--exam-line); font: inherit; resize: vertical; }
#interrogSendTextBtn { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--exam-accent); color: var(--accent-text, #fff); cursor: pointer; }
#interrogSendTextBtn svg { width: 20px; height: 20px; }
#interrogSendTextBtn:disabled { opacity: .4; cursor: wait; }
#interrogSession button:focus-visible, #interrogTextFallback:focus-visible { outline: 2px solid var(--exam-accent); outline-offset: 5px; }
body.study-chat-ui-active[data-study-module="interrogation"] #interrogationView.interrogation-live-conversation .study-chat-scroll { padding-top: 0; }
body.study-chat-ui-active .study-chat-scroll > #interrogSession.exam-stage,
body.study-chat-ui-active[data-study-module="interrogation"] #interrogationView.interrogation-live-conversation .study-chat-scroll > #interrogSession.exam-stage.active { width: 100% !important; max-width: none !important; min-height: min(760px, calc(100dvh - 150px)) !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
@media (max-width: 640px) {
    #interrogSession.exam-stage { min-height: calc(100dvh - 130px); }
    .exam-topbar { padding: 12px 28px 16px; gap: 14px; }
    .exam-progress { order: -1; flex-basis: 100%; }
    .exam-question-card { padding: 30px 36px; min-height: 220px; }
    .exam-controls, .exam-textrow { padding-left: 28px; padding-right: 28px; }
    .exam-audio-orb { width: min(176px, 54vw); }
    .exam-audio-orb > .exam-mic-btn { width: 80px; height: 80px; min-width: 80px; min-height: 80px; }
}
@media (prefers-reduced-motion: reduce) { .exam-mic-btn.recording::before { animation: none; } .exam-progress-fill, .exam-mic-btn, .exam-mic-btn::before, #interrogSession .exam-question-text { transition: none; } }

/* ── Ergebnis ───────────────────────────────────────── */
#interrogFeedback.exam-result {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%; max-width: 860px;
    margin: 6px auto 0;
    padding: 22px;
    border: 1px solid var(--study-chat-line, var(--border-color));
    border-radius: 20px;
    background: var(--study-chat-panel, var(--bg-secondary));
    color: var(--text-primary);
    box-sizing: border-box;
}
#interrogFeedback.exam-result.active { display: flex; }
.exam-result h3 { margin: 0; font-size: 19px; }
.exam-result h4 { margin: 10px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--study-chat-muted, var(--text-secondary)); }
.exam-score-line { font-size: 15px; }
.exam-score-line strong { font-size: 20px; }
.exam-result ul { margin: 4px 0; padding-left: 20px; font-size: 14px; }
.exam-report { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.exam-ghost-btn {
    align-self: flex-start; padding: 8px 14px; border-radius: 10px;
    border: 1px solid var(--study-chat-line, var(--border-color));
    background: transparent; color: var(--text-primary);
    font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.exam-ghost-btn:hover { background: color-mix(in srgb, var(--accent-color) 10%, transparent); }
.exam-primary-btn {
    align-self: flex-start; padding: 10px 18px; border-radius: 12px;
    border: 0; background: var(--accent-color, #8b8b8b); color: var(--accent-text, #fff);
    font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.exam-full-transcript {
    display: none; white-space: pre-wrap; font-size: 13px; line-height: 1.6;
    max-height: 220px; overflow: auto; opacity: 0.9;
    border-top: 1px solid var(--study-chat-line-soft, rgba(255,255,255,0.08));
    padding-top: 10px;
}
.exam-full-transcript.open { display: block; }


body.study-chat-ui-active[data-study-module="interrogation"] #interrogationView.interrogation-live-conversation .study-chat-scroll > .study-chat-message.user { display: none !important; }

body.study-chat-ui-active[data-study-module="interrogation"] #interrogationView.interrogation-live-conversation { padding: 0 !important; }
body.study-chat-ui-active[data-study-module="interrogation"] #interrogationView.interrogation-live-conversation .study-chat-scroll { padding: 0 !important; overflow-y: auto; }

/* Response preparation is a live status on the open surface. */
.exam-question-card { flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; }
.exam-thinking { display: inline-flex; align-items: center; gap: 12px; color: var(--exam-muted); font-size: 14px; }
.exam-thinking[hidden], #interrogEnableAudioBtn[hidden] { display: none !important; }
.exam-thinking-dots { display: inline-flex; align-items: center; gap: 5px; height: 20px; }
.exam-thinking-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--exam-accent); animation: exam-thinking-wave 1.3s ease-in-out infinite; }
.exam-thinking-dots i:nth-child(2) { animation-delay: .14s; }
.exam-thinking-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes exam-thinking-wave { 0%,100% { opacity: .3; transform: translateY(0); } 45% { opacity: 1; transform: translateY(-4px); } }
#interrogSession[data-speaker="thinking"] .exam-question-text { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .exam-thinking-dots i { animation: none; opacity: .7; } }
