/* Phase 11 targeted exam-layout repair. Keeps existing exam controls and scoring intact. */
body.test-taking-mode {
  overflow: hidden !important;
  background: #f4f5fa;
}

body.test-taking-mode .exam-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.test-taking-mode .exam-header,
body.test-taking-mode .exam-footer-bar {
  flex: 0 0 auto;
}

body.test-taking-mode .exam-workspace {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  width: 100%;
  overflow: hidden;
  align-items: stretch;
}

body.test-taking-mode .exam-main {
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.test-taking-mode .exam-question-panel {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.test-taking-mode .question-nav-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.test-taking-mode .question-legend,
body.test-taking-mode .section-nav,
body.test-taking-mode .exam-calculator,
body.test-taking-mode .palette-note {
  flex: 0 0 auto;
}

body.test-taking-mode .question-palette {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.test-taking-mode .palette-note {
  margin-top: 10px;
}

@media (max-width: 760px) {
  body.test-taking-mode {
    overflow: auto !important;
  }

  body.test-taking-mode .exam-shell {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  body.test-taking-mode .exam-workspace {
    flex: 0 0 auto;
    height: auto;
    overflow: visible;
  }

  body.test-taking-mode .exam-main,
  body.test-taking-mode .exam-question-panel {
    height: auto;
    overflow: visible;
  }

  body.test-taking-mode .question-nav-body {
    display: block;
    overflow: visible;
  }

  body.test-taking-mode .question-palette {
    flex: none;
    max-height: 220px;
    overflow-y: auto;
  }
}

/* Test-wizard section controls */
.test-wizard-section-row {
  flex-wrap: wrap;
}
.test-wizard-section-row > strong {
  flex: 1 1 110px;
}
.test-wizard-section-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 11px;
}
.test-wizard-section-row .wizard-section-remove {
  padding: 7px 10px;
  color: #a43e48;
  border-color: #efd1d4;
}
.test-wizard-section-row .wizard-section-remove:hover {
  background: #fff4f4;
  border-color: #e8b7bc;
}
.wizard-no-section {
  color: var(--muted, #64748b);
  font-size: 10px;
}
