.semio-scan-open {
  overflow: hidden;
}

.semio-scan-layer,
.semio-scan-layer * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.semio-scan-layer {
  position: fixed;
  inset: 66px 0 0;
  z-index: 42;
  overflow: auto;
  background: #eff4f8;
  color: #152235;
  font-family: inherit;
}

.semio-scan-layer[hidden] {
  display: none;
}

.semio-scan-nav-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #aac1d8;
  border-radius: 6px;
  background: #edf4fb;
  color: #123f73;
  font-size: 9px;
  font-weight: 900;
}

.semio-scan-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-shell {
  min-height: 100%;
}

.scan-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  min-height: 72px;
  padding: 10px 28px;
  border-bottom: 1px solid #d8e2ec;
  background: rgb(255 255 255 / 96%);
}

.scan-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: #10233b;
  text-align: left;
  cursor: pointer;
}

.scan-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.scan-brand span {
  display: grid;
}

.scan-brand strong {
  color: #0f3e71;
  font-size: 17px;
  line-height: 1.1;
}

.scan-brand small {
  margin-top: 3px;
  color: #63758a;
  font-size: 11px;
}

.scan-tabs,
.scan-subtabs,
.scan-segmented {
  display: flex;
  align-items: center;
}

.scan-tabs {
  gap: 4px;
}

.scan-tabs button,
.scan-subtabs button,
.scan-segmented button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5b6c80;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.scan-tabs button:hover,
.scan-tabs button.is-active,
.scan-subtabs button:hover,
.scan-subtabs button.is-active,
.scan-segmented button.is-active {
  background: #eaf1f8;
  color: #123f73;
}

.scan-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.scan-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.scan-mode,
.scan-status,
.scan-eyebrow {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 850;
}

.scan-mode {
  padding: 6px 9px;
  border: 1px solid #d6b557;
  border-radius: 999px;
  background: #fff8de;
  color: #70520b;
}

.scan-icon-button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfdbe7;
  border-radius: 8px;
  background: #fff;
  color: #42566d;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.scan-icon-button:hover {
  border-color: #7798ba;
  color: #123f73;
}

.scan-content {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.scan-page-head,
.scan-exam-head,
.scan-section-head,
.scan-form-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.scan-page-head {
  padding: 8px 0 30px;
  border-bottom: 1px solid #d9e3ed;
}

.scan-page-head.compact {
  padding-bottom: 22px;
}

.scan-page-head > div:first-child,
.scan-exam-head > div {
  max-width: 780px;
}

.scan-eyebrow {
  display: inline-block;
  color: #0f527f;
}

.scan-page-head h1,
.scan-exam-head h1,
.scan-form-head h1,
.scan-access h1 {
  margin: 8px 0 0;
  color: #101c2d;
  font-size: 34px;
  line-height: 1.15;
}

.scan-page-head p,
.scan-exam-head p,
.scan-form-head p,
.scan-section-head p {
  margin: 8px 0 0;
  color: #607187;
  font-size: 14px;
  line-height: 1.6;
}

.scan-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.scan-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.scan-button-primary {
  border: 1px solid #123f73;
  background: #123f73;
  color: #fff;
}

.scan-button-primary:hover:not(:disabled) {
  background: #092f5c;
}

.scan-button-secondary {
  border: 1px solid #c9d7e4;
  background: #fff;
  color: #173f69;
}

.scan-button-secondary:hover:not(:disabled) {
  border-color: #6f95ba;
  background: #f4f8fc;
}

.scan-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 28px 0 38px;
  border-block: 1px solid #d9e3ed;
}

.scan-metrics article {
  display: grid;
  min-height: 92px;
  align-content: center;
  padding: 16px 22px;
  border-right: 1px solid #d9e3ed;
}

.scan-metrics article:last-child {
  border-right: 0;
}

.scan-metrics span {
  color: #6a7b8f;
  font-size: 12px;
  font-weight: 700;
}

.scan-metrics strong {
  margin-top: 6px;
  color: #123f73;
  font-size: 28px;
  line-height: 1;
}

.scan-section-head {
  align-items: center;
  margin: 26px 0 16px;
}

.scan-section-head h2,
.scan-overview-grid h2,
.scan-review h2,
.scan-upload-main h2 {
  margin: 4px 0 0;
  color: #152235;
  font-size: 22px;
}

.scan-exam-list,
.scan-class-list {
  border-top: 1px solid #d5e0eb;
}

.scan-exam-row {
  display: grid;
  grid-template-columns: 90px minmax(260px, 1fr) 90px 80px 70px 20px;
  width: 100%;
  min-height: 82px;
  align-items: center;
  gap: 18px;
  padding: 14px 8px;
  border: 0;
  border-bottom: 1px solid #d5e0eb;
  background: transparent;
  color: #152235;
  text-align: left;
  cursor: pointer;
}

.scan-exam-row:hover {
  background: #eef4fa;
}

.scan-status {
  width: fit-content;
  padding: 6px 8px;
  border-radius: 999px;
  background: #e8eef5;
  color: #4e6075;
}

.scan-status-ready,
.scan-status-applied {
  background: #e5f1fa;
  color: #0b5b8f;
}

.scan-status-processing {
  background: #fff4cf;
  color: #765504;
}

.scan-status-review_required {
  background: #fff0dc;
  color: #884b0b;
}

.scan-status-finalized {
  background: #e4f4ee;
  color: #17634e;
}

.scan-exam-main,
.scan-exam-stat,
.scan-student-list label > span,
.scan-sheet-table div > span:first-child,
.scan-result-table div > span:first-child {
  display: grid;
  gap: 3px;
}

.scan-exam-main strong,
.scan-class-list strong,
.scan-student-list strong {
  font-size: 14px;
}

.scan-exam-main small,
.scan-exam-stat small,
.scan-class-list small,
.scan-student-list small,
.scan-sheet-table small,
.scan-result-table small {
  color: #718196;
  font-size: 11px;
}

.scan-exam-stat strong {
  color: #173f69;
  font-size: 16px;
}

.scan-chevron {
  color: #6f849a;
  font-size: 23px;
}

.scan-empty {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  padding: 34px;
  border: 1px dashed #b9c9d9;
  border-radius: 8px;
  background: #fbfdff;
  text-align: center;
}

.scan-empty-mark {
  width: 42px;
  height: 42px;
  border: 7px double #6f92b4;
  border-radius: 50%;
}

.scan-empty h3 {
  margin: 15px 0 0;
  font-size: 18px;
}

.scan-empty p {
  max-width: 540px;
  margin: 8px 0 0;
  color: #65768a;
  font-size: 13px;
  line-height: 1.6;
}

.scan-empty > div {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.scan-integrity-note {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 22px;
  margin-top: 32px;
  padding: 18px 0;
  border-block: 1px solid #d7e2ed;
}

.scan-integrity-note strong {
  color: #145748;
}

.scan-integrity-note p {
  margin: 0;
  color: #5c6f83;
  font-size: 13px;
  line-height: 1.55;
}

.scan-split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr);
  gap: 36px;
  margin-top: 24px;
}

.scan-class-list button {
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
  border: 0;
  border-bottom: 1px solid #d5e0eb;
  background: transparent;
  color: #152235;
  text-align: left;
  cursor: pointer;
}

.scan-class-list button:hover {
  background: #eef4fa;
}

.scan-help,
.scan-capture-guide {
  align-self: start;
  padding: 22px;
  border-left: 3px solid #1a6b64;
  background: #edf7f5;
}

.scan-help h2,
.scan-capture-guide h2 {
  margin: 6px 0 0;
  font-size: 18px;
}

.scan-help p,
.scan-capture-guide li {
  color: #546d75;
  font-size: 13px;
  line-height: 1.6;
}

.scan-help code {
  padding: 2px 4px;
  border-radius: 3px;
  background: #fff;
  color: #164b67;
}

.scan-form-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 4px 0;
}

.scan-form-head {
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid #d8e2ec;
}

.scan-form,
.scan-key-form {
  display: grid;
  gap: 24px;
  margin-top: 26px;
}

.scan-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.scan-field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scan-form label,
.scan-form fieldset,
.scan-review label {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.scan-form label > span,
.scan-form legend,
.scan-review label > span {
  color: #283a50;
  font-size: 12px;
  font-weight: 800;
}

.scan-form label em {
  color: #74859a;
  font-style: normal;
  font-weight: 600;
}

.scan-form input,
.scan-form select,
.scan-form textarea,
.scan-review input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #c8d6e3;
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: #152235;
  font: inherit;
  font-size: 14px;
}

.scan-form textarea {
  resize: vertical;
  line-height: 1.55;
}

.scan-form input:focus,
.scan-form select:focus,
.scan-form textarea:focus,
.scan-review input:focus {
  border-color: #236196;
  box-shadow: 0 0 0 3px rgb(35 97 150 / 12%);
}

.scan-form label > small {
  color: #728398;
  font-size: 11px;
}

.scan-check-row {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 7px;
}

.scan-check-row label {
  display: inline-flex;
}

.scan-check-row input {
  position: absolute;
  opacity: 0;
}

.scan-check-row span {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8d6e3;
  border-radius: 6px;
  background: #fff;
}

.scan-check-row input:checked + span {
  border-color: #123f73;
  background: #123f73;
  color: #fff;
}

.scan-form-actions,
.scan-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.scan-form-actions {
  padding-top: 20px;
  border-top: 1px solid #d8e2ec;
}

.scan-exam-head {
  position: relative;
  align-items: center;
  padding: 4px 0 26px;
}

.scan-back {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #235582;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.scan-exam-head .scan-status {
  margin-bottom: 4px;
}

.scan-exam-head h1 {
  font-size: 29px;
}

.scan-exam-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.scan-subtabs {
  gap: 3px;
  margin-top: 24px;
  overflow-x: auto;
  border-bottom: 1px solid #ccd9e5;
}

.scan-subtabs button {
  flex: 0 0 auto;
  min-height: 44px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}

.scan-subtabs button.is-active {
  border-bottom-color: #123f73;
  background: transparent;
}

.scan-exam-body {
  padding-top: 22px;
}

.scan-overview-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
}

.scan-overview-grid article {
  padding: 24px;
  border: 1px solid #cfdae6;
  border-radius: 8px;
  background: #fff;
}

.scan-progress-panel {
  grid-row: span 2;
}

.scan-progress,
.scan-score-bars i {
  display: block;
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #e5edf5;
}

.scan-progress {
  margin-top: 20px;
}

.scan-progress span,
.scan-score-bars b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #176b76;
}

.scan-progress-panel dl,
.scan-detail-panel dl,
.scan-job dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
}

.scan-progress-panel dl div,
.scan-detail-panel dl div,
.scan-job dl div {
  display: grid;
  gap: 4px;
}

.scan-progress-panel dt,
.scan-detail-panel dt,
.scan-job dt {
  color: #6e7f93;
  font-size: 11px;
}

.scan-progress-panel dd,
.scan-detail-panel dd,
.scan-job dd {
  margin: 0;
  color: #173f69;
  font-size: 18px;
  font-weight: 800;
}

.scan-next-panel p {
  color: #647589;
  font-size: 13px;
  line-height: 1.6;
}

.scan-next-panel .scan-button {
  margin-top: 12px;
}

.scan-detail-panel dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.scan-detail-panel dd {
  font-size: 13px;
}

.scan-segmented {
  gap: 2px;
  padding: 3px;
  border: 1px solid #cbd8e4;
  border-radius: 7px;
  background: #fff;
}

.scan-segmented button {
  min-width: 42px;
  padding: 0 10px;
}

.scan-key-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.scan-key-row {
  display: grid;
  grid-template-columns: 80px minmax(210px, 1fr) 84px 78px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d4dfe9;
  border-radius: 7px;
  background: #fff;
}

.scan-key-row legend {
  display: contents;
  color: #26415e;
  font-size: 12px;
  font-weight: 800;
}

.scan-key-options {
  display: flex;
  gap: 4px;
}

.scan-key-options label {
  position: relative;
}

.scan-key-options input,
.scan-key-annul input {
  position: absolute;
  opacity: 0;
}

.scan-key-options span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c6d4e1;
  border-radius: 5px;
  color: #395069;
  cursor: pointer;
}

.scan-key-options input:checked + span {
  border-color: #123f73;
  background: #123f73;
  color: #fff;
}

.scan-key-options input:disabled + span {
  cursor: not-allowed;
  opacity: 0.34;
}

.scan-key-weight,
.scan-key-annul {
  position: relative;
  display: grid;
  gap: 2px;
  color: #65778c;
  font-size: 10px;
  font-weight: 700;
}

.scan-key-weight input {
  width: 70px;
  height: 34px;
  padding: 5px 7px;
  border: 1px solid #c6d4e1;
  border-radius: 5px;
}

.scan-key-annul span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7c19e;
  border-radius: 5px;
  background: #fffaf0;
  color: #76551c;
  cursor: pointer;
}

.scan-key-annul input:checked + span {
  border-color: #a6592a;
  background: #a6592a;
  color: #fff;
}

.scan-form-actions.sticky {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 14px;
  border: 1px solid #ccd9e5;
  border-radius: 8px;
  background: rgb(255 255 255 / 95%);
}

.scan-select-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-block: 1px solid #d5e0eb;
  color: #5c6e83;
  font-size: 12px;
}

.scan-select-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #203d5c;
  font-weight: 750;
}

.scan-student-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.scan-student-list label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d2dee9;
  border-radius: 7px;
  background: #fff;
}

.scan-student-list input {
  width: 17px;
  height: 17px;
  accent-color: #123f73;
}

.scan-sheet-table,
.scan-result-table {
  margin-top: 28px;
  border-top: 1px solid #cfdbe7;
}

.scan-sheet-table > div,
.scan-result-table > div {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px 130px 80px;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding: 9px 4px;
  border-bottom: 1px solid #d9e3ed;
  font-size: 13px;
}

.scan-table-head {
  min-height: 40px !important;
  color: #687a8f;
  font-size: 10px !important;
  font-weight: 850;
  text-transform: uppercase;
}

.scan-upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.65fr);
  gap: 34px;
}

.scan-upload-main > p {
  max-width: 680px;
  color: #607288;
  font-size: 14px;
  line-height: 1.65;
}

.scan-dropzone {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 28px;
  border: 1px dashed #8eabc7;
  border-radius: 8px;
  background: #fff;
}

.scan-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.scan-dropzone label {
  display: grid;
  cursor: pointer;
}

.scan-dropzone label strong {
  color: #173f69;
  font-size: 15px;
}

.scan-dropzone label span {
  margin-top: 4px;
  color: #718297;
  font-size: 12px;
}

.scan-capture-guide ol {
  margin: 16px 0 0;
  padding-left: 18px;
}

.scan-quality-legend {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #c8dfda;
}

.scan-quality-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4f6771;
  font-size: 11px;
  font-weight: 700;
}

.scan-quality-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.scan-quality-legend .high { background: #14735d; }
.scan-quality-legend .medium { background: #bd7d12; }
.scan-quality-legend .low { background: #b13b4c; }

.scan-job {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #c9d9e7;
  border-radius: 8px;
  background: #f8fbfe;
}

.scan-job > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #5f7288;
  font-size: 12px;
}

.scan-job dl {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.scan-review-context {
  padding-bottom: 18px;
  border-bottom: 1px solid #d5e0eb;
}

.scan-review-context p {
  color: #627388;
  font-size: 13px;
}

.scan-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 28px;
  margin-top: 22px;
}

.scan-review figure {
  margin: 0;
  padding: 16px;
  border: 1px solid #cedbe7;
  border-radius: 8px;
  background: #fff;
}

.scan-review figure img,
.scan-no-crop {
  width: 100%;
  min-height: 190px;
  object-fit: contain;
  border-radius: 5px;
  background: #eef3f7;
}

.scan-no-crop {
  display: grid;
  place-items: center;
  padding: 24px;
  color: #65768a;
  text-align: center;
  font-size: 13px;
}

.scan-review figcaption {
  margin-top: 10px;
  color: #65768a;
  font-size: 11px;
}

.scan-score-bars {
  display: grid;
  gap: 9px;
  margin: 14px 0 24px;
}

.scan-score-bars > div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 9px;
  color: #43576d;
  font-size: 11px;
}

.scan-score-bars strong {
  text-align: right;
}

.scan-review fieldset {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.scan-review legend {
  margin-bottom: 9px;
  color: #2f4359;
  font-size: 12px;
  font-weight: 800;
}

.scan-review-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.scan-review-options button {
  min-height: 40px;
  border: 1px solid #cbd8e4;
  border-radius: 6px;
  background: #fff;
  color: #294158;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.scan-review-options button.is-active {
  border-color: #123f73;
  background: #123f73;
  color: #fff;
}

.scan-shortcuts {
  color: #728398;
  font-size: 11px;
}

.scan-metrics.results {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 18px 0 28px;
}

.scan-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 28px;
}

.scan-results-grid h3 {
  margin: 0;
  font-size: 17px;
}

.scan-result-table > div {
  grid-template-columns: minmax(180px, 1fr) 70px 70px 70px 70px;
}

.scan-item-list {
  display: grid;
  gap: 8px;
  max-height: 540px;
  margin-top: 14px;
  overflow: auto;
}

.scan-item-list article {
  padding: 12px;
  border: 1px solid #d4dfe9;
  border-radius: 7px;
  background: #fff;
}

.scan-item-list article > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #52667c;
  font-size: 11px;
}

.scan-item-list .scan-progress {
  height: 5px;
  margin-top: 9px;
}

.scan-item-list small {
  display: block;
  margin-top: 8px;
  color: #718297;
  font-size: 10px;
}

.scan-psychometrics {
  margin-top: 30px;
  padding: 20px 22px;
  border-left: 3px solid #a47822;
  background: #fff8e7;
}

.scan-psychometrics h3 {
  margin: 5px 0 0;
  color: #4c3d20;
  font-size: 16px;
}

.scan-psychometrics p {
  margin: 6px 0 0;
  color: #6d6045;
  font-size: 12px;
}

.scan-toast {
  position: fixed;
  top: 82px;
  right: 22px;
  z-index: 9;
  display: flex;
  max-width: 440px;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid #aacfc4;
  border-radius: 7px;
  background: #edf8f4;
  color: #215746;
  box-shadow: 0 12px 30px rgb(17 41 65 / 14%);
  font-size: 12px;
  font-weight: 700;
}

.scan-toast-warning {
  border-color: #d5bd78;
  background: #fff8e1;
  color: #6e5012;
}

.scan-toast-error {
  border-color: #d7a9b0;
  background: #fff2f4;
  color: #8b2434;
}

.scan-toast button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}

.scan-loading,
.scan-fatal,
.scan-access {
  display: grid;
  min-height: calc(100vh - 66px);
  place-items: center;
  align-content: center;
  padding: 30px;
  text-align: center;
}

.scan-loading span {
  width: 34px;
  height: 34px;
  border: 3px solid #d8e3ed;
  border-top-color: #123f73;
  border-radius: 50%;
  animation: scan-spin 0.8s linear infinite;
}

.scan-loading p,
.scan-fatal p,
.scan-access p {
  max-width: 560px;
  color: #627388;
  font-size: 13px;
  line-height: 1.6;
}

@keyframes scan-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .scan-header {
    grid-template-columns: 1fr auto;
  }

  .scan-tabs {
    order: 3;
    grid-column: 1 / -1;
    justify-content: center;
    overflow-x: auto;
  }

  .scan-header-actions {
    grid-column: 2;
  }

  .scan-page-head h1,
  .scan-access h1 {
    font-size: 28px;
  }

  .scan-key-grid,
  .scan-results-grid,
  .scan-upload-layout {
    grid-template-columns: 1fr;
  }

  .scan-key-row {
    grid-template-columns: 78px minmax(200px, 1fr) 78px 72px;
  }

  .scan-student-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .scan-header {
    padding: 9px 14px;
  }

  .scan-brand small,
  .scan-mode {
    display: none;
  }

  .scan-content {
    width: min(100% - 24px, 1220px);
    padding-top: 22px;
  }

  .scan-page-head,
  .scan-exam-head,
  .scan-section-head,
  .scan-form-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .scan-page-head .scan-button,
  .scan-section-head .scan-button {
    width: 100%;
  }

  .scan-metrics,
  .scan-metrics.results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scan-metrics article:nth-child(2n) {
    border-right: 0;
  }

  .scan-exam-row {
    grid-template-columns: 1fr 70px 18px;
    gap: 10px;
  }

  .scan-exam-row .scan-status {
    grid-column: 1 / -1;
  }

  .scan-exam-row .scan-exam-stat:nth-of-type(n + 4) {
    display: none;
  }

  .scan-split,
  .scan-overview-grid,
  .scan-review-grid {
    grid-template-columns: 1fr;
  }

  .scan-progress-panel {
    grid-row: auto;
  }

  .scan-field-grid,
  .scan-field-grid.three,
  .scan-student-list {
    grid-template-columns: 1fr;
  }

  .scan-key-row {
    grid-template-columns: 1fr 72px;
  }

  .scan-key-row legend,
  .scan-key-options {
    grid-column: 1 / -1;
  }

  .scan-key-options span {
    width: 38px;
  }

  .scan-dropzone {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .scan-dropzone .scan-button {
    width: 100%;
  }

  .scan-sheet-table > div,
  .scan-result-table > div {
    grid-template-columns: minmax(150px, 1fr) 60px 74px;
  }

  .scan-sheet-table > div > span:nth-child(3),
  .scan-result-table > div > span:nth-child(4) {
    display: none;
  }

  .scan-review-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scan-integrity-note {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scan-loading span {
    animation-duration: 1.8s;
  }
}

/* SEMIO Scan: clearer hierarchy and boundaries. */
.scan-header { border-bottom: 1px solid #aabed0; box-shadow: 0 3px 18px #163c6010; }
.scan-brand img { width: 48px; height: 48px; }
.scan-content { width: min(1180px, calc(100% - 48px)); }
.scan-page-head:not(.compact) { padding: 32px; border: 1px solid #bdd1df; border-radius: 16px; background: linear-gradient(115deg, #fff 25%, #e3eff5); }
.scan-page-head h1 { max-width: 630px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -1px; }
.scan-eyebrow { letter-spacing: 1.4px; font-size: 10px; }
.scan-metrics { gap: 14px; }
.scan-metrics article { border: 1px solid #b8cad9; border-radius: 12px; box-shadow: 0 3px 8px #123f7305; }
.scan-metrics article strong { color: #164d73; }
.scan-exam-row, .scan-class-list > button { border-color: #b8cad9; border-radius: 12px; }
.scan-workflow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.scan-workflow article { padding: 22px; background: #fff; border: 1px solid #c2d0dc; border-radius: 12px; }
.scan-workflow b { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #e8f2f5; color: #176375; font-size: 12px; }
.scan-workflow h3 { margin: 16px 0 6px; color: #18364e; font-size: 15px; }
.scan-workflow p { margin: 0; color: #5b7082; font-size: 13px; line-height: 1.6; }
.scan-upload-main { min-width: 0; background: #fff; border: 1px solid #b8cad9; border-radius: 14px; padding: 28px; }
.scan-upload-main h2 { font-size: 28px; margin: 10px 0; color: #143952; letter-spacing: -.6px; }
.scan-upload-main > p { color: #536b7e; font-size: 14px; line-height: 1.7; }
.scan-dropzone { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 14px; padding: 30px 20px; margin-top: 24px; border: 2px dashed #9bb8ce; border-radius: 12px; background: #f5f9fc; text-align: center; }
.scan-dropzone input[type="file"] { position: static; width: 100%; max-width: 340px; height: auto; opacity: 1; padding: 8px; color: #435c72; font-size: 12px; }
.scan-dropzone input::file-selector-button { border: 1px solid #aac0d1; border-radius: 6px; padding: 9px 12px; background: #fff; color: #164d73; margin-right: 10px; cursor: pointer; }
.scan-upload-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; border: 1px solid #b7cede; background: #e8f2f7; color: #1d587b; font-size: 30px; }
.scan-file-summary { max-width: 100%; margin: 0; color: #536b7e; font-size: 12px; overflow-wrap: anywhere; }
.scan-capture-guide { align-self: start; border: 1px solid #adc9c6; border-radius: 14px; padding: 24px; background: #f0f8f5; }
.scan-capture-guide h3 { color: #20514d; font-size: 18px; line-height: 1.4; margin: 10px 0 18px; }
.scan-capture-guide p, .scan-capture-guide li { color: #476a65; font-size: 12px; line-height: 1.8; }
.scan-paper-example { position: relative; width: 150px; padding: 25px 12px; margin: 10px auto 20px; border: 1px solid #bad0ca; border-radius: 4px; background: white; box-shadow: 4px 5px 0 #dcebe6; text-align: center; }
.scan-paper-example b { display: block; color: #235264; font-size: 10px; }
.scan-paper-example span { display: block; margin-top: 18px; font-size: 14px; line-height: 1.9; color: #3d555f; }
.scan-paper-example i { position: absolute; width: 7px; height: 7px; background: #263e4b; }
.scan-paper-example i:nth-child(1) { left: 8px; top: 8px; }
.scan-paper-example i:nth-child(2) { right: 8px; top: 8px; }
.scan-paper-example i:nth-last-child(2) { left: 8px; bottom: 8px; }
.scan-paper-example i:last-child { right: 8px; bottom: 8px; }
.scan-errors { margin-top: 20px; padding: 14px; border: 1px solid #e0bc90; border-radius: 8px; background: #fff7ea; color: #77451e; font-size: 12px; overflow-wrap: anywhere; }
.scan-errors summary { cursor: pointer; font-weight: 700; }
.scan-errors ul { padding-left: 18px; line-height: 1.7; }
.scan-job-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.semio-scan-layer :focus-visible { outline: 3px solid #3696bb; outline-offset: 3px; }
@media (max-width: 850px) {
  .scan-header { grid-template-columns: 1fr auto; gap: 12px; padding: 12px 16px; }
  .scan-tabs { grid-row: 2; grid-column: 1 / -1; overflow-x: auto; }
  .scan-header-actions { grid-column: 2; grid-row: 1; }
  .scan-upload-layout, .scan-split, .scan-results-grid, .scan-review-grid { grid-template-columns: 1fr; }
  .scan-workflow { grid-template-columns: 1fr; }
  .scan-content { width: calc(100% - 28px); padding-top: 20px; }
  .scan-page-head { align-items: flex-start; flex-direction: column; }
  .scan-page-head:not(.compact), .scan-upload-main { padding: 22px; }
  .scan-subtabs { overflow-x: auto; }
  .scan-subtabs button { white-space: nowrap; }
  .scan-field-grid, .scan-field-grid.three { grid-template-columns: 1fr; }
  .scan-sheet-table, .scan-result-table { overflow-x: auto; }
  .scan-mode { font-size: 9px; }
  .scan-brand small { display: none; }
  .scan-job > div:first-child { flex-direction: column; gap: 6px; }
}
