.exam-archive { display: grid; gap: 14px; width: 100%; }
#examarchive { padding: 36px; }
#exam-archive-alert-root { position: static; }
.exam-archive h2, .exam-archive h3, .exam-archive p { margin: 0; }
.exam-archive-exam, .exam-archive-detail { border: 1px solid var(--line, #ddd5da); border-radius: 14px; background: var(--surface, #fff); padding: 16px; }
.exam-archive-exam { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.exam-archive-exam > div { flex: 1 1 220px; display: grid; gap: 5px; }
.exam-archive-detail { display: grid; gap: 12px; }
.exam-archive details { border-top: 1px solid var(--line, #ddd5da); padding: 10px 0; }
.exam-archive summary { cursor: pointer; font-weight: 700; }
.exam-archive summary .exam-archive-group-count { font-size: .8em; font-weight: 500; color: var(--muted, #695f65); white-space: nowrap; }
.exam-archive ul { padding: 0; margin: 8px 0 0; list-style: none; }
.exam-archive li { padding: 7px 0; }
.exam-archive li label, .exam-archive-select-all { display: flex; align-items: baseline; gap: 8px; }
.exam-archive li small { display: block; margin: 4px 0 0 24px; color: var(--muted, #695f65); overflow-wrap: anywhere; }
.exam-archive button { border: 1px solid var(--line, #ddd5da); border-radius: 9px; padding: 8px 12px; background: var(--surface, #fff); color: inherit; cursor: pointer; }
.exam-archive button:disabled { opacity: .55; cursor: default; }
.exam-archive .exam-archive-primary { justify-self: end; background: #9e4869; color: #fff; border-color: #9e4869; }
.exam-archive-note { color: var(--muted, #695f65); }
.exam-archive-error { color: #a12d3d; overflow-wrap: anywhere; }
.exam-archive-alert { box-sizing: border-box; width: min(420px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); margin: auto; padding: 24px; border: 1px solid var(--line, #e2e4e8); border-radius: 14px; background: var(--paper, #fff); color: var(--ink, #23252b); box-shadow: 0 18px 64px #23252b24; overflow: auto; }
.exam-archive-alert::backdrop { background: #23252b45; backdrop-filter: blur(2px); }
.exam-alert-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.exam-alert-header h2 { margin: 0; font-size: 18px; line-height: 1.5; font-weight: 650; letter-spacing: -.4px; }
.exam-archive-alert p { margin: 12px 0 0; font-size: 14px; line-height: 1.7; color: var(--muted, #626771); }
.exam-alert-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.exam-archive-alert button { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 0; height: 32px; min-height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; font-family: inherit; font-size: 12px; line-height: 1.4; font-weight: 500; white-space: nowrap; cursor: pointer; box-shadow: none; }
.exam-archive-alert .exam-alert-close { flex: 0 0 28px; width: 28px; height: 28px; min-height: 28px; padding: 0; color: var(--muted, #626771); background: transparent; }
.exam-archive-alert .exam-alert-later { color: var(--muted, #626771); background: transparent; }
.exam-archive-alert .exam-alert-manage { color: #fff; background: var(--accent, #79283d); }
.exam-archive-alert .exam-alert-later:hover, .exam-archive-alert .exam-alert-close:hover { background: var(--bg, #f5f6f7); }
.exam-archive-alert .exam-alert-manage:hover { background: #662235; }
.exam-archive-alert button:focus-visible { outline: 2px solid var(--accent, #79283d); outline-offset: 3px; }
@media (max-width: 480px) { .exam-archive-alert { padding: 20px; } }

body.auth-pending #exam-archive-alert-root, body.auth-required #exam-archive-alert-root { display: none; }

.course-administration { margin-top: 28px; }
.exam-archive .exam-archive-back { justify-self: start; border: 0; padding: 4px 0; font-size: 13px; color: var(--muted); background: transparent; }
.exam-archive-detail h3:focus { outline: none; }
.exam-archive button { font-size: 12px; line-height: 1.5; }
.exam-archive details[open] > summary { margin-bottom: 16px; }
.exam-archive .exam-archive-select-all { margin: 0 0 16px; align-items: center; font-size: 13px; }
.exam-archive .exam-archive-item { padding: 14px 0; }
.exam-archive-item + .exam-archive-item { border-top: 1px solid var(--line); }
.exam-archive-item-row { display: flex; align-items: baseline; gap: 16px; }
.exam-archive .exam-archive-item-row > label { flex: 1; min-width: 0; align-items: baseline; font-size: 14px; line-height: 1.6; }
.exam-archive-item-row input[type=checkbox] { flex: 0 0 auto; }
.exam-archive-item-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; white-space: nowrap; font-size: 12px; }
.exam-archive .exam-archive-item-actions button { border: 0; padding: 2px 0; background: transparent; color: var(--muted); }
.exam-archive-item-actions a { color: var(--accent); }
.exam-archive-item-meta { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 6px; margin: 8px 0 0 24px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.exam-scope-editor { margin: 16px 0 0 24px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); display: grid; gap: 12px; font-size: 13px; }
.exam-archive .exam-scope-editor label { display: grid; gap: 6px; }
.exam-scope-session { display: flex; align-items: end; gap: 12px; margin-bottom: 12px; }
.exam-scope-session label:last-of-type { flex: 1; min-width: 0; }
.exam-scope-editor :is(input,select) { width: 100%; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: var(--paper); color: var(--ink); font: inherit; }
.exam-scope-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media(max-width: 600px) { #examarchive { padding: 20px; } .exam-archive-item-row { gap: 10px; } .exam-archive-item-actions { gap: 8px; } .exam-scope-session { flex-wrap: wrap; } }
