/* Student-only extension of the current cabinet design. No live-room selectors. */
.student-exams[hidden], .student-exams [hidden] { display: none !important; }
.lobby-main.exams-open > :not(.student-exams) { display: none !important; }
.student-exams { width: 100%; min-width: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.student-exams * { box-sizing: border-box; }
.student-exams :is(button, select, input, a):focus-visible { outline: 3px solid var(--cabinet-accent); outline-offset: 3px; }
.student-exams h1 { margin: 8px 0 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1.13; letter-spacing: -.035em; }
.student-exams :is(h2,h3,p) { margin-top: 0; }
.student-exams p { color: var(--muted); line-height: 1.65; }
.exam-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.exam-section-heading > div { min-width: 0; }
.exam-section-heading p { margin: 0; max-width: 600px; }
.student-exams.is-solving > .exam-section-heading { display: none; }
.exam-button { display: inline-flex; min-height: 44px; justify-content: center; align-items: center; gap: 8px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-weight: 650; line-height: 1.35; text-decoration: none; cursor: pointer; text-align: center; }
.exam-button:hover:not(:disabled) { background: #252e44; border-color: #7d80a0; }
.exam-button.primary { background: var(--cabinet-accent); border-color: var(--cabinet-accent); color: #171225; }
.exam-button.primary:hover:not(:disabled) { background: #c9bbff; }
.exam-button:disabled { opacity: .5; cursor: default; }
.exam-button.danger { color: #ffb5c2; }
.exam-card { background: var(--cabinet-panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px; min-width: 0; }
.exam-start { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; margin-bottom: 20px; }
.exam-start h2 { font-size: clamp(25px,3vw,36px); margin: 12px 0; letter-spacing: -.02em; }
.exam-start .exam-button { margin-top: 8px; min-width: 200px; }
.exam-kicker { color: var(--cabinet-accent); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; }
.exam-rules { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-left: 28px; border-left: 1px solid var(--line); }
.exam-rules strong { font-size: 18px; }
.exam-rules span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.55; }
.exam-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 24px 0; }
.exam-stat { padding: 22px; }
.exam-stat strong { display: block; font-size: 30px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.exam-stat small { color: var(--muted); line-height: 1.5; display: block; }
.exam-training { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 32px; }
.exam-training .exam-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.exam-training h3 { margin: 0; font-size: 19px; }
.exam-training p { margin: 0; font-size: 13px; }
.exam-training select { margin-top: auto; }
.student-exams select { width: 100%; min-width: 0; min-height: 48px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #111726; color: var(--ink); font: inherit; font-size: 14px; }
.exam-history-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin: 24px 0 16px; }
.exam-history-heading h2 { min-width: 0; overflow-wrap: anywhere; font-size: 24px; margin: 0; }
.exam-history { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.exam-history-row { width: 100%; background: var(--cabinet-panel); color: var(--ink); border: 0; border-bottom: 1px solid var(--line); padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; font: inherit; cursor: pointer; }
.exam-history-row:last-child { border-bottom: 0; }
.exam-history-row:hover { background: #232c40; }
.exam-history-row strong, .exam-history-row small { display: block; }
.exam-history-row small { margin-top: 6px; color: var(--muted); line-height: 1.5; }
.exam-history-row > span:last-child { text-align: right; flex-shrink: 0; }
.exam-status { display: inline-block; font-size: 12px; font-weight: 700; }
.exam-status.passed { color: #8be4b3; }
.exam-status.failed { color: #ffb5c2; }
.exam-status.completed { color: var(--cabinet-accent); }
.exam-topics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.exam-topic { padding: 16px 20px; }
.exam-topic div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.exam-topic strong { font-size: 14px; line-height: 1.5; }
.exam-topic small { color: var(--muted); }
.exam-topic progress { display: block; width: 100%; height: 6px; margin: 12px 0; accent-color: var(--cabinet-accent); }
.exam-empty { padding: 24px; border: 1px dashed var(--line); border-radius: 16px; margin: 0; }
.exam-notice { padding: 16px 20px; background: #392b38; color: #ffd9e2 !important; border: 1px solid #774353; border-radius: 12px; margin: 0 0 20px; }
.exam-notice .exam-button { margin: 10px 0 0 12px; }
.exam-disclaimer { margin: 30px 0 0; font-size: 12px; max-width: 760px; }
/* Illustrated navigation is limited to the dashboard, never the question runner. */
.exam-chooser { margin-bottom: 32px; }
.exam-chooser > .exam-history-heading { margin-top: 0; }
.exam-results-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--cabinet-accent); font-size: 14px; font-weight: 650; line-height: 1.45; text-underline-offset: 4px; }
.exam-modes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.exam-mode-card { display: grid; grid-template-columns: minmax(0,1fr) 156px; grid-template-rows: auto 1fr auto; align-items: center; gap: 16px 18px; width: 100%; min-width: 0; min-height: 264px; padding: 25px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--cabinet-panel); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s,background .15s; }
.exam-mode-card:hover:not(:disabled) { background: #20283c; border-color: #847aab; }
.exam-mode-card:focus-visible { outline: 3px solid var(--cabinet-accent); outline-offset: 4px; }
.exam-mode-exam { background: linear-gradient(135deg,#b6a5ff0a,transparent 62%),var(--cabinet-panel); border-color: #534d71; }
.exam-mode-index { grid-column: 1 / -1; color: var(--cabinet-accent); font-size: 12px; font-weight: 650; line-height: 1.45; letter-spacing: .05em; }
.exam-mode-copy { display: block; min-width: 0; }
.exam-mode-title { display: block; font-size: clamp(23px,2.4vw,29px); line-height: 1.13; letter-spacing: -.025em; font-weight: 750; margin-bottom: 12px; overflow-wrap: anywhere; }
.exam-mode-description { display: block; color: var(--muted); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.exam-mode-art { display: block; width: 156px; height: 156px; max-width: 100%; object-fit: contain; justify-self: end; pointer-events: none; }
.exam-mode-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.exam-mode-meta { color: #d2c8f2; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.exam-mode-arrow { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border: 1px solid #635884; border-radius: 50%; color: var(--cabinet-accent); font-size: 22px; }
.exam-mode-card:disabled { cursor: default; }
.exam-mode-card:disabled :is(.exam-mode-art,.exam-mode-arrow) { opacity: .42; }
.exam-lock-note { margin: 14px 0 0; font-size: 14px; }
.exam-resume { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; background: #29233f; border-color: #7e72a9; }
.exam-resume > div { min-width: 0; }
.exam-resume h2 { margin: 8px 0; font-size: 24px; overflow-wrap: anywhere; }
.exam-resume p { margin: 0; font-size: 14px; }
.exam-resume .exam-button { flex-shrink: 0; }
.exam-results-intro { display: grid; grid-template-columns: minmax(0,1fr) 160px; align-items: center; gap: 28px; margin-top: 34px; }
.exam-results-intro > div { min-width: 0; }
.exam-results-intro :is(h2,p,a), .exam-stat small, .exam-history-row > span { overflow-wrap: anywhere; }
.exam-results-intro h2 { font-size: clamp(24px,2.8vw,32px); margin: 10px 0; }
.exam-results-intro p { font-size: 14px; margin: 0; max-width: 660px; }
.exam-results-art { display: block; width: 160px; height: 160px; max-width: 100%; object-fit: contain; }
.exam-setup { --cabinet-accent: #b6a5ff; --cabinet-panel: #192132; --ink: #f6f6fa; --muted: #b1b9ca; --line: #343d52; color-scheme: dark; box-sizing: border-box; width: min(680px,calc(100vw - 32px - 2 * max(var(--cabinet-safe-left,env(safe-area-inset-left,0px)),var(--cabinet-safe-right,env(safe-area-inset-right,0px))))); max-width: none; max-height: calc(100dvh - 32px - 2 * max(var(--cabinet-safe-top,env(safe-area-inset-top,0px)),var(--cabinet-safe-bottom,env(safe-area-inset-bottom,0px)))); padding: 0; margin: auto; overflow: auto; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--cabinet-panel); font: inherit; }
.exam-setup[open] { display: flex; flex-direction: column; }
.exam-setup *, .exam-setup *::before, .exam-setup *::after { box-sizing: border-box; }
.exam-setup [hidden] { display: none !important; }
.exam-setup::backdrop { background: #050817d9; backdrop-filter: blur(5px); }
.exam-setup :is(button,input,a):focus-visible { outline: 3px solid var(--cabinet-accent); outline-offset: 3px; }
.exam-setup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-shrink: 0; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.exam-setup-head > div { min-width: 0; }
.exam-setup h2 { margin: 6px 0 0; font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
.exam-setup h2:focus { outline: none; }
.exam-setup-head > .exam-button { flex: 0 0 auto; padding: 10px 12px; font-size: 13px; }
.exam-setup-body { min-height: 80px; overflow: auto; overscroll-behavior: contain; padding: 20px 24px; scrollbar-width: thin; }
.exam-setup-description { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 20px; }
.exam-setup .exam-rules { padding: 0; border: 0; }
.exam-setup .exam-rules strong { font-size: 17px; overflow-wrap: anywhere; }
.exam-setup-search-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 650; }
.exam-setup-search { display: block; width: 100%; min-width: 0; min-height: 48px; margin-bottom: 16px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #111726; color: var(--ink); font: inherit; font-size: 16px; }
.exam-setup-search::placeholder { color: #aeb8cd; opacity: 1; }
.exam-setup-topics,.exam-setup-tickets { min-width: 0; border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.exam-setup-topic { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.exam-setup-topic:has(input:checked) { background: #302d4a; border-color: var(--cabinet-accent); }
.exam-setup-topic input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--cabinet-accent); }
.exam-setup-topic span { min-width: 0; }
.exam-setup-topic strong { display: block; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.exam-setup-topic small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.exam-setup-tickets { grid-template-columns: repeat(8,minmax(0,1fr)); gap: 8px; }
.exam-setup-ticket { position: relative; min-width: 0; cursor: pointer; }
.exam-setup-ticket input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.exam-setup-ticket span { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 650; }
.exam-setup-ticket input:checked + span { background: #302d4a; border-color: var(--cabinet-accent); }
.exam-setup-ticket input:focus-visible + span { outline: 3px solid var(--cabinet-accent); outline-offset: 2px; }
.exam-setup-empty { margin: 0; padding: 18px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; font-size: 14px; line-height: 1.6; }
.exam-setup-foot { flex-shrink: 0; padding: 16px 24px 24px; border-top: 1px solid var(--line); }
.exam-setup-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.exam-setup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.exam-setup-actions .primary { flex: 1; }
@media(max-width:1000px) {
  .exam-mode-card { grid-template-columns: minmax(0,1fr) 120px; padding: 22px; gap: 14px; }
  .exam-mode-art { width: 120px; height: 120px; }
}
@media(max-width:760px) {
  .exam-modes { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .exam-mode-card { min-height: 228px; grid-template-columns: minmax(0,1fr) 120px; padding: 22px; border-radius: 20px; }
  .exam-mode-title { font-size: 26px; }
  .exam-mode-art { width: 120px; height: 120px; }
  .exam-resume { align-items: stretch; flex-direction: column; gap: 16px; }
  .exam-resume .exam-button { align-self: flex-start; }
  .exam-results-intro { grid-template-columns: minmax(0,1fr) 110px; gap: 14px; }
  .exam-results-art { width: 110px; height: 110px; }
  .exam-chooser > .exam-history-heading { flex-wrap: wrap; gap: 6px; }
  .exam-setup-tickets { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media(max-width:400px) {
  .exam-mode-card { grid-template-columns: minmax(0,1fr) 88px; padding: 18px; gap: 14px 10px; }
  .exam-mode-title { font-size: 24px; }
  .exam-mode-art { width: 88px; height: 110px; }
  .exam-results-intro { grid-template-columns: minmax(0,1fr) 80px; gap: 10px; }
  .exam-results-art { width: 80px; height: 100px; }
  .exam-setup-head { padding: 18px 16px 14px; gap: 10px; }
  .exam-setup h2 { font-size: 24px; }
  .exam-setup-body { padding: 16px; }
  .exam-setup-foot { padding: 14px 16px 18px; }
  .exam-setup-actions { flex-direction: column; }
}
@media(max-height:500px) {
  .exam-setup[open] { display: block; }
  .exam-setup-body { overflow: visible; }
}
@media(prefers-reduced-motion:reduce) { .exam-mode-card { transition: none; } }
.exam-run-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.exam-run-header strong { font-size: 20px; }
.exam-timer { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; color: var(--cabinet-accent); font-size: 20px; font-weight: 700; }
.exam-timer.is-low { color: #ffb5c2; border-color: #805468; }
.exam-layout { display: grid; grid-template-columns: minmax(0,1fr) 248px; align-items: start; gap: 20px; }
.exam-question { padding: 28px; }
.exam-question h2 { font-size: clamp(20px,2.2vw,26px); line-height: 1.5; margin: 20px 0; overflow-wrap: anywhere; }
.exam-question h2:focus { outline: none; }
.exam-image-button { display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #f2f2f2; cursor: zoom-in; }
.exam-image-button img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.exam-image-hint { display: block; margin: 8px 0; font-size: 12px; color: var(--muted); }
.exam-options { display: grid; gap: 10px; border: 0; margin: 0; padding: 0; min-width: 0; }
.exam-option { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 15px; cursor: pointer; line-height: 1.55; font-size: 15px; overflow-wrap: anywhere; }
.exam-option input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--cabinet-accent); }
.exam-option.is-selected { background: #302d4a; border-color: var(--cabinet-accent); }
.exam-option.is-correct { background: #193f36; border-color: #8be4b3; }
.exam-option.is-wrong { background: #482936; border-color: #ffb5c2; }
.exam-option small { display: block; font-weight: 700; margin-top: 4px; }
.exam-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 22px; }
.exam-actions .primary { flex: 1; }
.exam-palette { padding: 18px; }
.exam-palette > p { font-size: 12px; margin-bottom: 12px; }
.exam-numbers { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.exam-numbers button { height: 44px; min-width: 0; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); background: transparent; cursor: pointer; font: inherit; font-size: 13px; font-weight: 650; }
.exam-numbers button.is-answered { background: #30394e; }
.exam-numbers button.is-current { outline: 2px solid var(--cabinet-accent); outline-offset: -2px; }
.exam-numbers button.is-correct { color: #8be4b3; background: #193f36; }
.exam-numbers button.is-wrong { color: #ffb5c2; background: #482936; }
.exam-palette > .exam-button { width: 100%; margin-top: 18px; font-size: 13px; }
.exam-saved { color: #b6d6c4 !important; font-size: 13px; margin: 14px 0 0; }
.exam-explanation { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.exam-explanation p { white-space: pre-line; margin: 8px 0 0; }
.exam-result { margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.exam-result h2 { margin: 8px 0; font-size: 30px; }
.exam-result p { margin: 0; }
.exam-image-dialog { width: min(1000px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); border: 1px solid #343d52; border-radius: 16px; background: #192132; color: #f6f6fa; padding: 16px; }
.exam-image-dialog::backdrop { background: #000c; }
.exam-image-dialog img { display: block; width: 100%; max-height: 76dvh; object-fit: contain; margin-top: 12px; }
.exam-image-dialog button { color: #f6f6fa; border-color: #343d52; }
.lobby-view .cabinet-nav a[aria-current="page"] { color: var(--cabinet-accent); }
@media(max-width:900px) {
  .exam-layout { grid-template-columns: minmax(0,1fr); }
  .exam-palette { order: -1; }
  .exam-numbers { grid-template-columns: repeat(10,minmax(0,1fr)); }
  .exam-palette > p { display: inline-block; margin-right: 12px; }
  .exam-palette > .exam-button { width: auto; margin-top: 12px; }
  .exam-training { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:600px) {
  .lobby-view .cabinet-nav { gap: 6px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; }
  .lobby-view .cabinet-nav a { min-width: 0; min-height: 44px; padding: 8px 4px; font-size: 12px; text-align: center; display: flex; align-items: center; justify-content: center; }
  .exam-section-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .exam-section-heading .eyebrow { font-size: 10px; }
  .exam-start { grid-template-columns: 1fr; gap: 20px; }
  .exam-card { padding: 20px; border-radius: 16px; }
  .exam-rules { padding-left: 0; border-left: 0; padding-top: 20px; border-top: 1px solid var(--line); }
  .exam-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .exam-stat { padding: 16px; }
  .exam-stat strong { font-size: 26px; }
  .exam-topics { grid-template-columns: minmax(0,1fr); }
  .exam-history-row { padding: 16px; align-items: flex-start; }
  .exam-history-row > span:last-child { flex-shrink: 1; min-width: 70px; }
  .exam-question { padding: 16px; }
  .exam-option { padding: 12px; font-size: 14px; }
  .exam-numbers { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .exam-palette { padding: 14px; }
  .exam-palette { order: 1; }
  .exam-run-header { position: sticky; top: 0; z-index: 3; background: #111726; padding: max(8px,env(safe-area-inset-top,0px)) 0 12px; border-bottom: 1px solid var(--line); }
  .exam-run-header strong { flex-basis: 100%; order: 1; font-size: 16px; }
  .student-exams.is-solving { margin-top: -24px; }
  .exam-palette details summary { min-height: 44px; cursor: pointer; padding: 12px 0; }
  .exam-actions { flex-direction: column; }
  .exam-notice .exam-button { margin-left: 0; display: flex; }
}

/* Focused question workspace: spend the viewport on the task, not cabinet chrome. */
.lobby-view.exams-focused > .app-header { display: none; }
.lobby-view.exams-focused .lobby-main {
  width: min(100% - 40px, 1720px); height: 100dvh; min-height: 0;
  padding: max(12px,env(safe-area-inset-top)) 0 max(12px,env(safe-area-inset-bottom));
  margin: 0 auto;
}
.exams-focused .student-exams.is-solving { height: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; min-height: 0; }
.exams-focused .exam-disclaimer { display: none; }
.exams-focused #examRunner { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.exams-focused .exam-notice { flex-shrink: 0; max-height: 25dvh; overflow: auto; padding: 10px 14px; margin-bottom: 8px; }
.exams-focused .exam-run-header { position: static; flex: 0 0 auto; flex-wrap: nowrap; margin: 0; padding: 0; border: 0; min-height: 48px; gap: 18px; }
.exam-run-title { min-width: 0; flex: 1; }
.exam-run-title small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.exam-run-title strong { display: block; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.exam-run-tools { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.exams-focused .exam-timer { min-width: 78px; text-align: center; padding: 10px 12px; font-size: 20px; }
.exams-focused .exam-layout { display: block; flex: 1; min-height: 0; }
.exams-focused .exam-question { height: 100%; padding: clamp(16px,2vw,28px); display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: clamp(20px,3vw,48px); min-height: 0; }
.exams-focused .exam-question.has-no-image { grid-template-columns: minmax(0,1fr); width: min(100%,1060px); margin: 0 auto; }
.exam-visual { min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.exams-focused .exam-image-button { display: grid; place-items: center; max-height: 100%; min-height: 0; background: #111726; border-radius: 14px; }
.exams-focused .exam-image-button img { max-height: min(66dvh,600px); height: auto; width: 100%; object-fit: contain; }
.exams-focused .exam-image-hint { margin: 0; text-align: center; line-height: 1.35; }
.exam-response { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.exam-answer-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 4px; }
.exam-answer-content:focus-visible { outline: 2px solid var(--cabinet-accent); outline-offset: 2px; border-radius: 6px; }
.exams-focused .exam-question h2 { margin: 12px 0 20px; font-size: clamp(20px,1.7vw,27px); line-height: 1.35; }
.exams-focused .exam-option { min-height: 48px; padding: 12px 14px; line-height: 1.45; font-size: 16px; }
.exams-focused .exam-options { gap: 9px; }
.exams-focused .exam-actions { flex: 0 0 auto; flex-wrap: nowrap; flex-direction: row; margin-top: 14px; gap: 10px; padding: 4px; }
.exams-focused .exam-actions .exam-button { min-height: 48px; padding: 12px 16px; font-size: 15px; }
.exams-focused .exam-saved { margin: 10px 0 0; }
.exams-focused .exam-result { flex-shrink: 0; padding: 12px 20px; margin: 0; border-radius: 14px; gap: 12px; }
.exams-focused .exam-result h2 { font-size: 22px; margin: 3px 0; }
.exams-focused .exam-result p { font-size: 13px; }
.exams-focused .exam-explanation { padding-top: 12px; margin-top: 12px; }
.exam-explanation summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.exam-overflow-hint { color: var(--muted); font-size: 11px; line-height: 1.35; padding: 6px 4px 0; }
.exams-focused .exam-question.is-dense h2 { font-size: 20px; margin: 8px 0 12px; }
.exams-focused .exam-question.is-dense .exam-options { gap: 6px; }
.exams-focused .exam-question.is-dense .exam-option { padding: 8px 10px; min-height: 44px; font-size: 15px; line-height: 1.35; }
.exam-navigation-dialog { width: min(480px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--cabinet-panel); }
.exam-navigation-dialog::backdrop { background: #050817c9; backdrop-filter: blur(4px); }
.exam-navigation-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.exam-navigation-dialog .exam-palette { padding: 0; }
.exam-navigation-dialog .exam-numbers { grid-template-columns: repeat(5,minmax(0,1fr)); }
.exam-navigation-dialog .exam-palette > p { display: block; margin: 10px 0; }
.exam-navigation-dialog .exam-palette > .exam-button { width: 100%; }
.exams-focused .exam-result.exam-stop { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr); align-items: safe center; justify-items: center; overflow: auto; padding: clamp(20px,4vw,56px); }
.exam-stop-content { width: min(100%,600px); text-align: center; }
.exam-stop-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 24px auto; border: 1px solid #885161; border-radius: 50%; color: #ffb5c5; background: #ff668514; font-size: 32px; font-weight: 800; }
.exam-stop h1 { margin: 0 0 16px; font-size: clamp(28px,4.5vw,56px); line-height: 1.12; letter-spacing: -.03em; }
.exam-stop h1:focus { outline: none; }
.exams-focused .exam-stop .exam-stop-reason { color: var(--ink); font-size: clamp(17px,2vw,22px); line-height: 1.4; }
.exams-focused .exam-stop .exam-stop-score { margin-top: 16px; font-size: 15px; }
.exams-focused .exam-stop .exam-stop-note { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.exam-stop .exam-button { margin-top: 28px; min-height: 48px; min-width: 200px; }
@media(max-height:600px) {
  .exam-stop-icon { width: 48px; height: 48px; margin: 12px auto; font-size: 26px; }
  .exam-stop h1 { font-size: clamp(28px,4vw,40px); margin-bottom: 12px; }
  .exam-stop .exam-button { margin-top: 18px; }
}
@media(max-width:1000px) and (min-width:721px) {
  .exams-focused .exam-question { gap: 20px; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); padding: 16px; }
  .exam-run-title strong { font-size: 16px; }
  .exam-run-tools { gap: 6px; }
}
@media(max-width:720px) {
  .lobby-view.exams-focused .lobby-main { width: 100%; padding: max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
  .exams-focused #examRunner { gap: 8px; }
  .exams-focused .exam-run-header { gap: 8px; flex-wrap: wrap; min-height: 44px; }
  .exams-focused .exam-run-header > .exam-button { min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .exam-run-title { flex-basis: 100%; order: 1; }
  .exam-run-title small { display: none; }
  .exams-focused .exam-run-title strong { font-size: 13px; line-height: 1.3; }
  .exam-run-tools { margin-left: auto; gap: 6px; }
  .exam-run-tools .exam-button { padding: 8px; min-height: 44px; font-size: 12px; }
  .exams-focused .exam-timer { min-width: 58px; padding: 10px 6px; font-size: 17px; border: 0; }
  .exams-focused .exam-question { grid-template-columns: minmax(0,1fr); grid-template-rows: clamp(100px,21dvh,185px) minmax(0,1fr); padding: 12px; gap: 10px; border-radius: 14px; }
  .exams-focused .exam-question.has-no-image { grid-template-rows: minmax(0,1fr); }
  .exam-visual { position: relative; }
  .exams-focused .exam-image-button { width: 100%; height: 100%; border-radius: 8px; }
  .exams-focused .exam-image-button img { height: 100%; max-height: 100%; }
  .exams-focused .exam-image-hint { position: absolute; pointer-events: none; bottom: 2px; right: 2px; padding: 3px 6px; border-radius: 5px; background: #111726df; font-size: 10px; }
  .exams-focused .exam-question h2 { font-size: 17px; line-height: 1.3; margin: 6px 0 10px; }
  .exams-focused .exam-kicker { font-size: 10px; letter-spacing: .07em; }
  .exams-focused .exam-options { gap: 6px; }
  .exams-focused .exam-option { font-size: 14px; line-height: 1.4; min-height: 44px; padding: 9px 10px; gap: 8px; }
  .exams-focused .exam-option input { width: 16px; height: 16px; margin-top: 2px; }
  .exams-focused .exam-actions { gap: 6px; padding: 2px; margin-top: 8px; }
  .exams-focused .exam-actions .exam-button { min-height: 44px; padding: 10px 8px; font-size: 12px; }
  .exams-focused .exam-question.is-dense { grid-template-rows: 100px minmax(0,1fr); gap: 8px; }
  .exams-focused .exam-question.is-dense.has-no-image { grid-template-rows: minmax(0,1fr); }
  .exams-focused .exam-question.is-dense h2 { font-size: 16px; line-height: 1.3; margin: 5px 0 8px; }
  .exams-focused .exam-question.is-dense .exam-option { font-size: 14px; line-height: 1.35; padding: 7px 8px; }
  .exams-focused .exam-result { padding: 8px 12px; }
  .exams-focused .exam-result h2 { font-size: 18px; }
}
