:root {
  --bg: #eef5ff;
  --bg-soft: #f7fbff;
  --surface: #ffffff;
  --surface-blue: #f2f7ff;
  --surface-strong: #e7f0ff;
  --text: #102033;
  --heading: #081a2e;
  --muted: #5f7087;
  --line: #d7e4f5;
  --line-strong: #bdd0ea;
  --primary: #1769e0;
  --primary-strong: #0f55b8;
  --primary-soft: #e8f1ff;
  --primary-faint: #f4f8ff;
  --cyan: #0c9bc8;
  --cyan-soft: #e5f8fd;
  --danger: #c23b32;
  --danger-soft: #fff0ef;
  --success: #16825f;
  --success-soft: #e9f7f2;
  --warning: #a96800;
  --warning-soft: #fff6df;
  --shadow: 0 18px 38px rgba(19, 52, 95, .11);
  --shadow-soft: 0 8px 20px rgba(19, 52, 95, .07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, #dcecff 0, rgba(238, 245, 255, 0) 340px),
    linear-gradient(90deg, rgba(23, 105, 224, .05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 105, 224, .05) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 44px 44px, 44px 44px, auto;
  color: var(--text);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--cyan), #7b61ff);
  pointer-events: none;
  z-index: 30;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--heading);
  font-size: 2.25rem;
  line-height: 1.08;
  font-weight: 780;
}

h2 {
  margin-bottom: 0;
  color: var(--heading);
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 760;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 12px max(18px, calc((100vw - 1180px) / 2));
  background: linear-gradient(90deg, #0f5fc9, #1f7eea);
  color: white;
  box-shadow: 0 10px 28px rgba(19, 52, 95, .18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
  color: white;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  color: white;
  font-size: .8rem;
  font-weight: 860;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}

.user-pill,
.refresh-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .92);
  font-size: .9rem;
  white-space: nowrap;
}

.refresh-pill {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: var(--shadow-soft);
}

.role-nav {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-actions form,
.table-actions form,
.modal-header form {
  margin: 0;
}

.user-menu,
.nav-menu,
.status-action-menu {
  position: relative;
}

.user-menu summary,
.nav-menu summary,
.status-action-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker,
.nav-menu summary::-webkit-details-marker,
.status-action-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu-trigger,
.nav-menu-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  color: white;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 760;
  white-space: nowrap;
}

.user-menu-trigger::after,
.nav-menu-trigger::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 8px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.user-menu[open] .user-menu-trigger,
.nav-menu[open] .nav-menu-trigger {
  background: rgba(255, 255, 255, .24);
}

.user-menu-popover,
.nav-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-menu-meta {
  margin: 0;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
  word-break: break-word;
}

.user-menu-item,
.nav-menu-item {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  background: white;
  color: var(--text);
  font: inherit;
  font-weight: 720;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-menu-item:hover,
.nav-menu-item:hover {
  background: var(--primary-faint);
  color: var(--primary-strong);
}

.user-menu-button {
  border-top: 1px solid var(--line);
}

.nav-menu-popover {
  right: auto;
  left: 0;
}

.profile-panel {
  display: grid;
  gap: 18px;
}

.profile-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.profile-list div {
  display: grid;
  gap: 3px;
}

.profile-list dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.profile-list dd {
  margin: 0;
  font-weight: 720;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 50px;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 4px 2px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  background: rgba(255, 255, 255, .98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.panel:not(.table-panel) {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--primary-faint), white);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .78fr);
  gap: 18px;
}

.form {
  display: grid;
  gap: 14px;
  max-width: 560px;
}

label {
  display: grid;
  gap: 7px;
  color: #20334b;
  font-weight: 720;
}

input,
textarea,
select,
button,
.button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 105, 224, .15);
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 2px 5px;
  border: 1px solid #bfd3ef;
  border-radius: 5px;
  background: #eaf2ff;
  color: #0b4ea2;
  font-size: .92em;
  font-weight: 700;
}

pre {
  margin: 12px 0 0;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid #bfd3ef;
  border-radius: 8px;
  background: #071b33;
  color: #eaf2ff;
  line-height: 1.45;
}

pre code {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: .95rem;
  font-weight: 650;
  white-space: pre;
}

button,
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: var(--primary);
  color: white;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(23, 105, 224, .18);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

button:hover,
.button:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  box-shadow: 0 12px 22px rgba(23, 105, 224, .24);
}

button:active,
.button:active {
  transform: translateY(1px);
}

button:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(12, 155, 200, .32);
  outline-offset: 2px;
}

button[disabled] {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary-button {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: none;
}

.secondary-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: 0 8px 18px rgba(23, 105, 224, .12);
}

.danger-button {
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 8px 16px rgba(194, 59, 50, .16);
}

.danger-button:hover {
  border-color: #9f2d25;
  background: #9f2d25;
  box-shadow: 0 12px 22px rgba(194, 59, 50, .2);
}

.compact-button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: .92rem;
}

.topbar .secondary-button {
  border-color: rgba(255, 255, 255, .36);
  background: rgba(255, 255, 255, .12);
  color: white;
}

.topbar .secondary-button:hover,
.topbar-button:hover {
  border-color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .22);
  color: white;
}

.icon-button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.topbar-button {
  border-color: rgba(255, 255, 255, .36);
  background: rgba(255, 255, 255, .12);
  color: white;
  box-shadow: none;
}

.button-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-panel {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f5f9ff;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 820;
  text-transform: uppercase;
}

tbody tr:hover td {
  background: #f8fbff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.strong-cell {
  color: var(--heading);
  font-weight: 760;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions {
  align-items: center;
}

.status-cell {
  min-width: 180px;
}

.status-select-form {
  margin: 0;
  max-width: 190px;
}

.status-select-form select {
  min-height: 36px;
  padding: 7px 34px 7px 10px;
  font-weight: 760;
}

.filter-panel {
  margin-bottom: 18px;
}

.import-panel,
.correction-summary,
.correction-list,
.correction-panel {
  margin-bottom: 18px;
}

.class-filter-form {
  grid-template-columns: minmax(240px, 360px) max-content;
  align-items: end;
  max-width: none;
}

.cell-note {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.student-action-menu {
  width: max-content;
  min-width: 150px;
}

.student-action-menu summary {
  list-style: none;
}

.student-action-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 8px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.student-action-menu summary::-webkit-details-marker {
  display: none;
}

.student-action-menu[open] summary {
  background: var(--primary-soft);
}

.student-action-list {
  display: grid;
  min-width: 210px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.student-action-list form {
  margin: 0;
}

.student-menu-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
  font-weight: 720;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.student-action-list > .student-menu-item:last-child,
.student-action-list form:last-child .student-menu-item {
  border-bottom: 0;
}

.student-menu-item:hover {
  background: var(--primary-faint);
  color: var(--primary-strong);
  box-shadow: none;
}

.student-menu-item--danger {
  color: var(--danger);
}

.student-menu-item--danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.password-modal {
  width: min(520px, calc(100vw - 32px));
}

.password-modal-form {
  max-width: none;
}

.student-modal-meta {
  margin-bottom: 16px;
  color: var(--muted);
  word-break: break-word;
}

.status-pill,
.incident-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 820;
}

.status-pill {
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-blue);
  color: var(--primary-strong);
}

.status-waiting {
  border-color: #efcc7b;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-draft,
.status-not_started,
.status-absent {
  border-color: var(--line-strong);
  background: var(--surface-blue);
  color: var(--muted);
}

.status-countdown,
.status-ready {
  border-color: #efcc7b;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-training {
  border-color: #8dcbe0;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.status-started,
.status-in_progress,
.status-submitted {
  border-color: #97d8c1;
  background: var(--success-soft);
  color: var(--success);
}

.status-closed {
  border-color: #e9aaa4;
  background: var(--danger-soft);
  color: var(--danger);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 18px;
  align-items: start;
  max-width: 940px;
  margin: 54px auto 0;
}

.auth-layout--single {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
  max-width: 620px;
}

.auth-panel {
  min-height: 372px;
  display: grid;
  align-content: center;
  position: relative;
  overflow: hidden;
  border-color: #bcd3f4;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--primary), var(--cyan));
}

.auth-panel .form,
.auth-side-panel .form {
  margin-top: 18px;
}

.auth-actions {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: 10px;
}

.text-link {
  color: var(--primary);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--primary-dark);
}

.auth-side-panel {
  margin-top: 34px;
  background: var(--surface-blue);
}

.focus-panel {
  max-width: 700px;
  margin: 48px auto 0;
  border-color: #bcd3f4;
}

.waiting-panel,
.finish-panel {
  display: grid;
  gap: 14px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 340px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-blue);
}

.exam-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 14px;
  align-items: start;
}

.exam-card {
  min-height: 560px;
  border-color: #bcd3f4;
}

.exam-aside {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 10px;
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.timer {
  display: inline-flex;
  min-width: 132px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #bcd3f4;
  border-radius: 8px;
  background: var(--surface-blue);
  color: var(--muted);
  font-weight: 820;
}

.countdown-message {
  max-width: 340px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f1c37f;
  border-radius: 8px;
  background: #fff7e8;
  color: #7a4b05;
  font-weight: 760;
}

.delay-banner {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #f1c37f;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 820;
}

.timer span {
  color: var(--heading);
}

.question-prompt {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #f4f8ff);
  color: #20334b;
  font-size: 1.08rem;
}

.question-form {
  max-width: none;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 560;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.choice:hover {
  border-color: #8db8f0;
  background: var(--primary-faint);
}

.choice input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--primary);
}

.choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(23, 105, 224, .24);
}

.choice-content {
  display: block;
  min-width: 0;
}

.choice-content code {
  white-space: nowrap;
}

.answer-field,
.composite-fields {
  display: grid;
  gap: 8px;
}

.answer-field span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 820;
  text-transform: uppercase;
}

.code-answer {
  min-height: 260px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
}

.current-file {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-blue);
  color: var(--muted);
  font-weight: 720;
}

.question-actions {
  justify-content: flex-end;
  padding-top: 10px;
}

.exam-controls-panel,
.incident-panel {
  padding: 12px;
  border-color: #bcd3f4;
  background: var(--surface-blue);
}

.exam-controls-panel {
  display: grid;
  gap: 9px;
}

.exam-controls-panel h2 {
  margin: 0;
  font-size: .96rem;
}

.exam-aside .eyebrow {
  margin-bottom: 4px;
  font-size: .68rem;
}

.exam-aside h2 {
  font-size: .96rem;
}

.exam-controls-panel button {
  min-height: 36px;
  width: 100%;
  padding: 7px 10px;
  font-size: .9rem;
}

.incident-summary,
.incident-actions,
.modal-header,
.bug-report {
  display: flex;
  align-items: center;
  gap: 8px;
}

.incident-summary {
  justify-content: space-between;
}

.incident-summary h2,
.modal-header h2 {
  margin: 0;
}

.incident-badge {
  min-width: 38px;
  min-height: 28px;
  padding: 4px 9px;
  color: white;
}

.incident-badge--ok {
  background: var(--success);
}

.incident-badge--alert {
  background: var(--danger);
}

.modal {
  width: min(640px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(8, 26, 46, .55);
}

.modal-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.bug-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.bug-panel button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: .9rem;
}

.bug-report {
  align-items: stretch;
  flex-direction: column;
}

.event-panel {
  min-height: 360px;
}

.report-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.report-panel {
  padding: 0;
  overflow: hidden;
}

.report-markdown {
  min-height: 620px;
  max-height: 78vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fbfdff;
  color: var(--text);
  white-space: pre-wrap;
}

.claim-panel {
  position: sticky;
  top: 88px;
  align-self: start;
}

.correction-summary-body,
.correction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 20px;
  color: var(--muted);
}

.correction-summary-body p,
.correction-meta span {
  margin: 0;
}

.correction-question {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.correction-question-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.correction-question h3,
.correction-question h4,
.correction-global-events h3 {
  margin: 0 0 10px;
  color: var(--heading);
}

.question-prompt {
  margin: 0 0 14px;
}

.correction-answer-grid {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0 0 16px;
}

.correction-answer-grid dt {
  color: var(--muted);
  font-weight: 760;
}

.correction-answer-grid dd {
  min-width: 0;
  margin: 0;
}

.correction-answer-grid pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.correction-score-row,
.correction-score-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.correction-score-auto {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-blue);
  color: var(--primary-strong);
  font-weight: 820;
}

.correction-score-form label {
  min-width: 220px;
}

.correction-score-form select {
  width: 260px;
}

.correction-validation-actions {
  display: flex;
  justify-content: flex-end;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.correction-validation-actions form {
  margin: 0;
}

.correction-global-events {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.correction-events {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.correction-events li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-blue);
}

.correction-events span,
.correction-events small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.events {
  display: grid;
  gap: 10px;
  max-height: 520px;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  list-style: none;
}

.event-counts {
  max-height: 170px;
  padding-bottom: 0;
}

.events li {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-blue);
}

.events span,
.events small {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error {
  border-color: #e9aaa4;
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.ok {
  border-color: #97d8c1;
  border-left-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.warning {
  color: var(--danger);
  font-weight: 820;
}

@media (max-width: 900px) {
  .auth-layout,
  .exam-shell,
  .grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    margin-top: 24px;
  }

  .auth-side-panel {
    margin-top: 0;
  }

  .exam-aside {
    position: static;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 24px, 1180px);
    margin-top: 18px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 12px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .user-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 {
    font-size: 2rem;
  }

  .page-header,
  .question-head,
  .status-row {
    align-items: stretch;
    flex-direction: column;
  }

  .timer {
    width: 100%;
  }

  th,
  td {
    padding: 12px 14px;
  }

  .panel:not(.table-panel) {
    padding: 18px;
  }

  .question-actions {
    justify-content: stretch;
  }

  .question-actions button {
    flex: 1 1 140px;
  }

  .class-filter-form {
    grid-template-columns: 1fr;
  }
}
