/* Exam-only layout. Colors, type, controls and navigation use admin.css. */
#examsView { min-width: 0; }
#examsView .exam-status:not(:empty) {
  padding: 12px 16px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}
#examsView .exam-status:empty { margin: 0; }
#examsView #workspace:empty,
#examsView #detail:empty { display: none; }
#examsView .exam-section-heading { justify-content: space-between; margin-bottom: 18px; }
#examsView .exam-section-heading h2 { margin-bottom: 4px; }
#examsView .exam-section-heading p { margin: 0; }
#examsView [hidden] { display: none !important; }
#examsView .exam-detail-nav { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
#examsView #catalog form label { margin: 0; flex: 1; max-width: 480px; }
#examsView #catalog form { align-items: end; }
#examsView #catalog td:first-child { min-width: 180px; font-weight: 600; }
#examsView .exam-action { margin: 0 8px 10px 0; }
#examsView .actions .exam-action { margin: 0; }
#examsView h2, #examsView h3, #examsView p { overflow-wrap: anywhere; }
#examsView #workspace > p, #examsView #detail > p { color: var(--muted); line-height: 1.7; }
#examsView label { margin: 14px 0; max-width: 760px; }
#examsView fieldset { margin: 18px 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; min-width: 0; }
#examsView legend { padding: 0 8px; color: var(--text); font-size: 15px; font-weight: 600; }
#examsView fieldset p { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 0; }
#examsView .exam-table-wrap { margin: 16px 0; max-height: none; }
#examsView table caption { text-align: left; padding: 12px; font-weight: 600; background: #fbfcff; border-bottom: 1px solid var(--line); }
#examsView td { font-size: 14px; line-height: 1.65; }
#examsView th { white-space: nowrap; }
#examsView td .exam-action { padding: 7px 10px; }
#examsView pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); padding: 14px; border-radius: 6px; max-height: 480px; overflow: auto; font-size: 13px; line-height: 1.7; }
#examsView details { margin: 16px 0; }
#examsView summary { cursor: pointer; color: var(--primary); padding: 6px 0; }
#examsView .warning, #examsView .good { padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 6px; line-height: 1.7; }
#examsView .good { border-left-color: var(--success); }
#examsView img, #examsView video { max-width: 100%; max-height: 480px; }
#examsView audio { max-width: 100%; }
#examsView .recording-playback:not(:empty) { margin: 16px 0; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
#examsView .recording-playback label { max-width: 220px; }
#examsView article:not(.exam-card) { padding: 16px; margin: 16px 0; border: 1px solid var(--line); border-radius: 8px; }
#examsView :focus-visible { outline: 3px solid #8bb3ff; outline-offset: 2px; }
#examsView .exam-tabs { margin: 0 0 20px; }
#examsView .paper-editor { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(280px, 3fr) minmax(220px, 2fr); gap: 20px; align-items: start; }
#examsView .paper-directory { max-height: 75vh; overflow: auto; position: sticky; top: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
#examsView .paper-directory button { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; }
#examsView .paper-directory button[aria-current] { background: var(--primary); color: white; }
#examsView .paper-fields, #examsView .paper-preview { min-width: 0; }
#examsView .paper-preview { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; }
#examsView .paper-preview li { margin: 10px 0; }
#examsView .paper-step { border-top: 1px solid var(--line); padding: 8px 0; }
#examsView .paper-errors:not(:empty) { padding: 16px; border: 2px solid var(--warn); border-radius: 8px; }
#examsView .paper-fields textarea { min-height: 100px; width: 100%; }
#examsView .bank-search-bar { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(100px, 1fr)) auto auto; gap: 12px; align-items: end; margin: 20px 0 8px; }
#examsView .bank-search-bar label { display: flex; flex-direction: column; align-items: stretch; margin: 0; min-width: 0; gap: 6px; }
#examsView .bank-search-bar input, #examsView .bank-search-bar select, #examsView .bank-search-bar button { height: 44px; min-width: 0; margin: 0; }
#examsView .bank-search-bar label > input, #examsView .bank-search-bar label > select { flex: none; min-height: 44px; }
#examsView .bank-search-bar button { white-space: nowrap; }
#examsView .bank-table { min-width: 1040px; table-layout: fixed; }
#examsView .bank-table th:first-child { width: 29%; }
#examsView .bank-table th:nth-child(2) { width: 6%; }
#examsView .bank-table th:nth-child(3) { width: 9%; }
#examsView .bank-table th:nth-child(4) { width: 8%; }
#examsView .bank-table th:nth-child(5) { width: 15%; }
#examsView .bank-table th:nth-child(6) { width: 14%; }
#examsView .bank-table th:nth-child(7) { width: 7%; }
#examsView .bank-table th:last-child { width: 12%; }
#examsView .bank-table caption { font-size: 18px; }
#examsView .bank-table td { vertical-align: top; overflow-wrap: anywhere; padding-top: 18px; padding-bottom: 18px; }
#examsView .bank-question-title { display: block; font-size: 18px; line-height: 1.6; color: var(--text); }
#examsView .bank-prompt-preview { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#examsView .bank-usage small, #examsView .bank-statistics small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
#examsView .bank-statistics strong { font-size: 17px; font-variant-numeric: tabular-nums; }
#examsView .bank-usage details { margin: 6px 0 0; }
#examsView .bank-row-actions .exam-action { margin: 0 0 8px; white-space: normal; }
#examsView .bank-row-actions label { margin: 0 0 8px; }
@media (max-width: 900px) {
  #examsView .bank-search-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #examsView .bank-search-bar label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  #examsView .bank-search-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  #examsView .bank-table.admin-responsive-table caption { display: block; width: 100%; margin-bottom: 12px; }
  #examsView .bank-table.admin-responsive-table td { min-width: 0; }
}
@media (max-width: 1100px) {
  #examsView .paper-editor { grid-template-columns: minmax(150px, 1fr) minmax(280px, 3fr); }
  #examsView .paper-editor > .paper-preview { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  #examsView .paper-editor { display: block; }
  #examsView .paper-directory { position: static; max-height: 220px; margin-bottom: 16px; }
  #examsView fieldset { padding: 12px; }
  #examsView .exam-table-wrap td { min-width: 100px; }
}

#examsView .exam-result-summary { padding: 18px 22px; margin: 8px 0 24px; background: #fff8f7; border: 1px solid #edcecb; border-radius: 10px; }
#examsView .exam-result-summary p { margin: 4px 0; }
#examsView .exam-result-score { display: block; color: #b42318; font-size: clamp(36px, 4vw, 56px); font-weight: 800; line-height: 1.2; margin: 8px 0; }
#examsView .exam-review-layout { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 24px; align-items: start; }
#examsView .exam-question-directory { position: sticky; top: 16px; max-height: 78vh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
#examsView .exam-question-link { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; white-space: normal; padding: 12px; border: 2px solid transparent; background: var(--panel); margin: 0 0 8px; }
#examsView .exam-question-link[aria-current] { border-color: var(--primary); background: #edf4ff; color: var(--text); }
#examsView .exam-question-detail { min-width: 0; }
#examsView .exam-question-detail > p { white-space: pre-wrap; }
#examsView .exam-verdict { font-weight: 700; }
#examsView .exam-verdict.correct { color: #146c43; }
#examsView .exam-verdict.incorrect { color: #b42318; }
#examsView .exam-verdict.partial, #examsView .exam-verdict.pending { color: #875400; }
#examsView .exam-recording-section { padding: 20px; margin: 20px 0; border: 2px solid #98b8e9; border-radius: 10px; background: #f3f7ff; }
#examsView .exam-recording-section h3 { font-size: 22px; }
#examsView .recording-playback video { width: 100%; }
@media (max-width: 900px) {
  #examsView .exam-review-layout { grid-template-columns: minmax(0, 1fr); }
  #examsView .exam-question-directory { position: static; max-height: 240px; }
}
@media (forced-colors: active) {
  #examsView .exam-question-link[aria-current] { border-color: Highlight; }
}
/* Bank pages share a small action hierarchy and a dedicated question editor. */
#examsView .bank-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
#examsView .bank-page-heading h2 { margin: 12px 0; }
#examsView .bank-page-heading > .exam-action { margin: 0; }
#examsView .bank-version-statistics { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 22px 0; padding: 16px; background: var(--bg); border-radius: 8px; }
#examsView .bank-current-content { max-width: 900px; line-height: 1.8; }
#examsView .bank-editor-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 1fr); gap: 28px; align-items: start; }
#examsView .bank-editor-fields { min-width: 0; }
#examsView .bank-editor-fields > label, #examsView .bank-option-row > label:last-child { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
#examsView .bank-editor-fields input:not([type=checkbox]):not([type=radio]), #examsView .bank-editor-fields select, #examsView .bank-editor-fields textarea { width: 100%; min-height: 44px; box-sizing: border-box; }
#examsView .bank-editor-fields textarea { min-height: 110px; }
#examsView .bank-editor-fields input[type=number] { max-width: 140px; }
#examsView .bank-option-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; align-items: center; }
#examsView .bank-option-row > label { margin: 8px 0; }
#examsView .bank-option-row input[type=radio], #examsView .bank-option-row input[type=checkbox] { flex: none; }
#examsView .bank-capability-fields { display: flex; flex-wrap: wrap; gap: 12px 22px; }
#examsView .bank-capability-fields label { margin: 0; }
#examsView .bank-editor-preview { padding: 16px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; min-width: 0; }
#examsView .bank-editor-footer { margin-top: 24px; }
#examsView .bank-save-effect { font-size: 14px; color: var(--muted); line-height: 1.6; }
#examsView .bank-history-list { display: flex; flex-direction: column; align-items: flex-start; }
#examsView .bank-history-preview:empty { display: none; }
#examsView .bank-history-preview { padding: 16px; border: 1px solid var(--line); }
#examsView .bank-picker-preview { white-space: normal; }
#examsView .bank-picker-preview:not(:empty) { padding: 18px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
#examsView .bank-update { margin: 16px 0; padding: 16px; border-left: 3px solid var(--primary); background: var(--bg); }
@media (max-width: 1000px) {
  #examsView .bank-editor-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  #examsView .bank-option-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #examsView .bank-page-heading .actions { width: 100%; }
}
#examsView .bank-picker-search { grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(100px, 1fr)) auto auto; }
@media (max-width: 1000px) { #examsView .bank-picker-search { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { #examsView .bank-picker-search { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
