/* Online proctoring UI, scoped to avoid altering the main Quiz LAB app. */
#ep-app {
  min-height: 100vh;
  background: #f5f7fb;
  color: #172033;
  font:
    400 14px/1.55 Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  position: relative;
  z-index: 1;
}
#ep-app * {
  box-sizing: border-box;
}
#ep-app button,
#ep-role-entry {
  font: inherit;
}
#ep-app button {
  cursor: pointer;
}
#ep-app button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.ep-shell {
  min-height: 100vh;
}
.ep-top {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid #e7eaf0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 60px);
  gap: 18px;
}
.ep-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #172033;
  text-decoration: none;
}
.ep-brand b,
.ep-brand small {
  display: block;
}
.ep-brand b {
  font-size: 15px;
  letter-spacing: -0.02em;
}
.ep-brand small {
  font-size: 11px;
  color: #8290a5;
}
.ep-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #33558b;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}
.ep-user {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #627087;
  font-size: 12px;
}
.ep-link {
  color: #33558b;
  text-decoration: none;
  font-weight: 650;
}
.ep-link:hover {
  text-decoration: underline;
}
.ep-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 26px 72px;
}
.ep-page.ep-narrow {
  max-width: 760px;
}
.ep-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 6px 0 26px;
}
.ep-heading h1,
.ep-room-head h1 {
  font-size: clamp(27px, 3.2vw, 37px);
  line-height: 1.16;
  letter-spacing: -0.04em;
  margin: 2px 0 7px;
  color: #101b2e;
}
.ep-heading p,
.ep-room-head p {
  margin: 0;
  color: #718097;
  max-width: 670px;
}
.ep-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #64748b;
  margin: 0 0 7px;
}
.ep-card {
  background: #fff;
  border: 1px solid #e5e9f0;
  border-radius: 15px;
  padding: 24px;
  margin: 0 0 18px;
  box-shadow: 0 2px 8px rgba(24, 39, 61, 0.025);
}
.ep-card h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 0 0 5px;
}
.ep-card h3 {
  font-size: 14px;
  margin: 20px 0 8px;
}
.ep-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.ep-card-head p {
  font-size: 12px;
  color: #78869b;
  margin: 4px 0 0;
}
.ep-btn {
  min-height: 38px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: #334155;
  border-radius: 9px;
  padding: 8px 13px;
  font-weight: 650;
  transition:
    background 0.15s,
    border 0.15s,
    transform 0.15s;
}
.ep-btn:hover:not(:disabled) {
  background: #f7f9fc;
  border-color: #bac5d4;
}
.ep-btn-primary {
  background: #33558b;
  border-color: #33558b;
  color: #fff;
}
.ep-btn-primary:hover:not(:disabled) {
  background: #29467a;
  border-color: #29467a;
}
.ep-btn-danger {
  background: #fff4f2;
  border-color: #f4c6c1;
  color: #a33229;
}
.ep-btn-quiet {
  background: transparent;
  border-color: transparent;
  color: #5c6b81;
}
.ep-btn-small {
  min-height: 31px;
  padding: 5px 11px;
  font-size: 12px;
}
.ep-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.ep-muted {
  color: #7e8ba0;
  font-size: 12px;
}
.ep-alert {
  border: 1px solid #cfdbec;
  background: #f3f6fb;
  color: #1e3355;
  padding: 12px 15px;
  border-radius: 10px;
  margin: 0 0 17px;
  font-size: 13px;
}
.ep-alert.error {
  border-color: #f1c9c6;
  background: #fff5f4;
  color: #982f29;
}
.ep-back {
  margin: -12px 0 14px;
}
.ep-table-wrap {
  overflow-x: auto;
}
#ep-app table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
#ep-app th {
  padding: 10px 12px;
  background: #f7f9fc;
  color: #79869a;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 750;
  border-block: 1px solid #ebeff4;
}
#ep-app td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf0f4;
  color: #46546a;
  font-size: 12px;
  vertical-align: middle;
}
#ep-app td:first-child {
  color: #172033;
}
#ep-app td b,
#ep-app td small {
  display: block;
}
#ep-app td small {
  font-size: 10px;
  color: #8793a5;
  margin-top: 3px;
}
.ep-status {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 9px;
  background: #edf1f6;
  color: #59677b;
  text-transform: capitalize;
  font-size: 10px;
  font-weight: 750;
}
.ep-status.live {
  background: #e3eaf5;
  color: #1e3355;
}
.ep-status.paused {
  background: #fff5dd;
  color: #986a09;
}
.ep-status.ended,
.ep-status.archived {
  background: #eff1f5;
  color: #667085;
}
.ep-status.published {
  background: #eaf1ff;
  color: #315db8;
}
.ep-status.draft {
  background: #f3eefb;
  color: #7050a1;
}
.ep-empty {
  text-align: center;
  padding: 52px 20px;
}
.ep-empty.compact {
  padding: 20px;
}
.ep-empty h3 {
  margin: 13px 0 5px;
  color: #243249;
}
.ep-empty p {
  margin: 0;
  color: #8190a5;
  font-size: 12px;
}
.ep-empty-icon {
  font-size: 25px;
  color: #33558b;
  background: #eef3fa;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  margin: auto;
}
.ep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ep-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #59677d;
  font-size: 12px;
  font-weight: 650;
}
.ep-form input,
.ep-form textarea,
.ep-textarea,
.ep-codearea,
.ep-message-compose textarea {
  width: 100%;
  border: 1px solid #dfe4ec;
  border-radius: 9px;
  padding: 11px 12px;
  color: #172033;
  background: #fff;
  outline: none;
  font:
    400 13px/1.5 Inter,
    system-ui,
    -apple-system,
    sans-serif;
  resize: vertical;
}
.ep-form input:focus,
.ep-form textarea:focus,
.ep-textarea:focus,
.ep-codearea:focus,
.ep-message-compose textarea:focus {
  border-color: #33558b;
  box-shadow: 0 0 0 3px #e3eaf5;
}
.ep-span {
  grid-column: 1/-1;
}
.ep-form .ep-actions {
  border-top: 1px solid #edf0f4;
  padding-top: 17px;
}
.ep-import-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
}
.ep-file {
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 650;
  color: #344156;
  cursor: pointer;
}
.ep-file input {
  max-width: 190px;
  font-size: 11px;
}
.ep-codearea {
  min-height: 185px;
  background: #111a28;
  color: #dbe7f4;
  border-color: #26354a;
  font:
    12px/1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  tab-size: 2;
}
.ep-preview {
  border-top: 1px solid #e8ecf2;
  padding-top: 14px;
  margin-top: 18px;
}
.ep-preview h3 {
  margin: 0 0 12px;
}
.ep-preview-q {
  padding: 13px 0;
  border-bottom: 1px solid #edf0f4;
  font-size: 12px;
}
.ep-preview-q > b {
  display: block;
  color: #59677c;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.ep-preview-q > div {
  margin: 5px 0;
}
.ep-preview-option {
  padding-left: 14px;
  color: #516076;
}
.ep-publish-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  border-color: #c7d4e8;
  background: #f9fcfa;
}
.ep-publish-card p {
  margin: 5px 0 0;
  color: #7b899c;
  font-size: 12px;
}
.ep-detail-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(500px, 1.2fr);
  gap: 18px;
  align-items: start;
}
.ep-detail-grid > .ep-card {
  min-width: 0;
}
.ep-facts {
  margin: 18px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ep-facts div {
  padding: 10px 11px;
  background: #f8f9fb;
  border-radius: 9px;
}
.ep-facts dt {
  font-size: 10px;
  color: #8290a3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ep-facts dd {
  margin: 3px 0 0;
  color: #253148;
  font-weight: 650;
  font-size: 12px;
}
.ep-instructions {
  white-space: pre-wrap;
  color: #526078;
  font-size: 13px;
  line-height: 1.65;
}
.ep-live-dot {
  font-size: 11px;
  color: #33558b;
  font-weight: 750;
}
.ep-audit-item {
  border-bottom: 1px solid #edf0f4;
  padding: 7px 0;
  font-size: 11px;
  color: #6c7890;
}
.ep-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #435269;
  font-size: 13px;
  padding: 18px 0;
}
.ep-check input {
  margin-top: 4px;
  accent-color: #33558b;
}
.ep-room {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 22px 60px;
}
.ep-room-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f7fb;
  padding: 15px 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #e5e9ef;
}
.ep-room-head h1 {
  font-size: 24px;
}
.ep-room-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ep-room-meta strong {
  font:
    750 17px/1 ui-monospace,
    monospace;
  color: #24406b;
  background: #eef3fa;
  padding: 10px;
  border-radius: 8px;
}
.ep-questions {
  padding: 18px 0;
}
.ep-question {
  background: #fff;
  border: 1px solid #e5e9f0;
  border-radius: 13px;
  padding: 20px 22px;
  margin-bottom: 13px;
}
.ep-question header {
  display: flex;
  justify-content: space-between;
  color: #8390a3;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 750;
  border-bottom: 1px solid #edf0f4;
  padding-bottom: 11px;
  margin-bottom: 15px;
}
.ep-question-prompt {
  font-size: 14px;
  color: #1f2c41;
  line-height: 1.7;
  margin-bottom: 15px;
}
.ep-answer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin: 7px 0;
  border: 1px solid #e8ecf2;
  border-radius: 9px;
  color: #425169;
  cursor: pointer;
  font-size: 13px;
}
.ep-answer:hover {
  background: #f8fafc;
}
.ep-answer input {
  accent-color: #33558b;
  margin-top: 4px;
}
.ep-answer-text {
  display: block;
  cursor: default;
}
.ep-answer-text textarea {
  display: block;
  margin-top: 8px;
  width: 100%;
  border: 1px solid #dfe4ec;
  border-radius: 9px;
  padding: 10px;
  outline: none;
  font: inherit;
  resize: vertical;
}
.ep-answer-text textarea:focus {
  border-color: #33558b;
  box-shadow: 0 0 0 3px #e3eaf5;
}
.ep-submit-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border: 1px solid #e4e8ef;
  border-radius: 12px;
  box-shadow: 0 6px 28px #1c2c4518;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.ep-save-state {
  font-size: 11px;
  color: #75839a;
}
.ep-dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(600px, calc(100vw - 28px));
  box-shadow: 0 20px 60px #0d162b35;
}
.ep-dialog::backdrop {
  background: #0b1424a3;
}
.ep-dialog form {
  padding: 20px;
}
.ep-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ep-dialog h2 {
  margin: 0;
}
.ep-message-list {
  max-height: 55vh;
  overflow: auto;
  margin: 17px 0;
}
.ep-message-list article {
  padding: 11px;
  border-bottom: 1px solid #edf0f4;
}
.ep-message-list b,
.ep-message-list small {
  display: inline-block;
}
.ep-message-list small {
  float: right;
  color: #8995a7;
  font-size: 10px;
}
.ep-message-list p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}
.ep-message-compose {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.ep-message-compose textarea {
  min-height: 66px;
}
.ep-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 12px);
  z-index: 100;
  color: white;
  background: #20324a;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.ep-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#ep-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 12px);
  z-index: 100;
  color: #fff;
  background: #20324a;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  max-width: min(90vw, 620px);
  box-shadow: 0 8px 30px #10203830;
  font-size: 12px;
}
#ep-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#ep-toast.error {
  background: #a33229;
}
#ep-role-entry {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  background: #1e3355;
  color: #eef3fa;
  padding: 12px 17px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 650;
  font-size: 12px;
  box-shadow: 0 10px 30px #1d2c454d;
}
#ep-role-entry:hover {
  background: #29467a;
}
@media (max-width: 850px) {
  .ep-detail-grid {
    grid-template-columns: 1fr;
  }
  .ep-detail-grid > .ep-card {
    min-width: 0;
  }
}
@media (max-width: 620px) {
  .ep-top {
    height: 62px;
    padding: 0 14px;
  }
  .ep-user {
    gap: 9px;
  }
  .ep-user > span {
    display: none;
  }
  .ep-page {
    padding: 24px 14px 48px;
  }
  .ep-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .ep-card {
    padding: 18px;
  }
  .ep-grid {
    grid-template-columns: 1fr;
  }
  .ep-span {
    grid-column: auto;
  }
  .ep-publish-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .ep-room {
    padding: 10px 12px 42px;
  }
  .ep-room-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .ep-room-meta {
    width: 100%;
    justify-content: space-between;
  }
  .ep-question {
    padding: 16px;
  }
  .ep-dialog form {
    padding: 15px;
  }
  .ep-message-compose {
    align-items: stretch;
    flex-direction: column;
  }
}
/* Rich question content remains readable on phones and at browser zoom. */
#ep-app img {
  max-width: 100%;
  height: auto;
}
#ep-app pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f3f5fa;
  padding: 1rem;
  border-radius: 8px;
}
#ep-app .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
}
#ep-app .exam-rich-table {
  overflow-x: auto;
}
#ep-app :focus-visible,
.ep-dialog :focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}
#ep-app .ep-save-state {
  overflow-wrap: anywhere;
}
#ep-app .ep-room-meta {
  flex-wrap: wrap;
}
.ep-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  font: inherit;
}
.ep-dialog::backdrop {
  background: #17203c88;
}
.ep-dialog [role="alert"] {
  color: #991b1b;
}
#ep-app .ep-result-score {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 24px;
  padding: 20px 0;
}
#ep-app .ep-result-score b {
  font-size: 48px;
}
#ep-app .ep-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
body:has(#ep-app) {
  margin: 0;
  background: #f6f8fc;
  font-family: Inter, system-ui, sans-serif;
  color: #17203c;
}
#ep-app .exam-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}
#ep-app .exam-rich-image {
  margin: 16px 0;
}
#ep-app .exam-rich-image img {
  display: block;
  min-height: 100px;
  object-fit: contain;
}
#ep-app .exam-rich-image figcaption {
  font-size: 12px;
  color: #627087;
  margin-top: 8px;
}
/* Draft setup: copy questions from an existing paper. */
.ep-paper-picker {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #f7fbf8;
}
.ep-paper-picker b {
  display: block;
  font-size: 13px;
  color: #172033;
}
.ep-paper-picker p {
  margin: 3px 0 0;
}
.ep-paper-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 9px;
  margin-top: 11px;
}
.ep-paper-row input,
.ep-paper-row select {
  min-width: 0;
  width: 100%;
  height: 38px;
  border: 1px solid #dfe4ec;
  border-radius: 9px;
  padding: 0 11px;
  background: #fff;
  color: #172033;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.ep-paper-row input:focus,
.ep-paper-row select:focus {
  border-color: #33558b;
  box-shadow: 0 0 0 3px #e3eaf5;
}
.ep-form label .ep-muted {
  font-weight: 400;
}
@media (max-width: 760px) {
  .ep-paper-row {
    grid-template-columns: 1fr;
  }
}
.ep-system {
  border-color: #f0d9a8;
  background: #fffaf0;
}
.ep-system p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

/* ---- Exam screen (palette layout from the exam portal) ---- */
#ep-app.pr-live .ep-top {
  display: none;
}
#ep-app .pr-live-root {
  height: 100vh;
  height: 100dvh;
  font-size: clamp(14px, 0.95vw, 18px);
}
#ep-app .pr-live-header {
  min-height: clamp(62px, 5.4vw, 82px);
  gap: 12px;
}
#ep-app .ep-header-warning {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}
#ep-app .ep-q-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
#ep-app .ep-q-btn {
  box-sizing: border-box;
  width: 100%;
  height: 38px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #334155;
  user-select: none;
}
#ep-app .ep-q-btn.current {
  outline: 2.5px solid #33558b;
  outline-offset: 1px;
}
#ep-app .ep-q-answered {
  background: #dfe8f5 !important;
  border-color: #9fb6d8 !important;
  color: #24406b !important;
}
#ep-app .ep-q-review {
  background: #ede9fe !important;
  border-color: #c4b5fd !important;
  color: #6d28d9 !important;
}
#ep-app .ep-q-unvisited {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}
@keyframes ep-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}
#ep-app .pr-live-prompt pre,
#ep-app .pr-live-main .pr-option pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
  overflow-x: auto;
  margin: 10px 0;
}
#ep-app .pr-live-main button:disabled {
  opacity: 0.4;
}
#ep-app #btn-student-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}
@media (max-width: 860px) {
  #ep-app .pr-live-header {
    flex-wrap: wrap;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  #ep-app .pr-live-tools {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  #ep-app .pr-live-body {
    flex-direction: column;
  }
  #ep-app .pr-live-aside {
    width: 100% !important;
    border-right: 0 !important;
    border-bottom: 2px solid #0f172a;
  }
  #ep-app .pr-live-palette {
    flex: none !important;
    padding: 10px 12px !important;
    overflow-x: auto;
  }
  #ep-app .pr-live-palette-title,
  #ep-app .pr-live-legend {
    display: none;
  }
  #ep-app .pr-live-aside .ep-q-grid {
    display: flex;
    gap: 8px;
    width: max-content;
  }
  #ep-app .pr-live-aside .ep-q-btn {
    width: 40px;
    flex: 0 0 40px;
  }
  #ep-app .pr-live-main {
    padding: 16px 14px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #ep-app .pr-live-root * {
    animation: none !important;
    transition: none !important;
  }
}
#ep-app .ep-header-warning.warning-active {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}
#ep-app .pr-live-tools-box button {
  font-family: inherit;
}

/* ---- Calculator (shared by the paper room and online exams) ---- */
.ep-calc-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 24px 60px -18px rgba(15, 23, 42, 0.28);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ep-card-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

.ep-calc-panel.pro-mode {
  width: 380px;
}

.ep-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.ep-calc-tabs {
  display: flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 8px;
  gap: 2px;
}

.ep-calc-tab-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.ep-calc-tab-btn.active {
  background: #33558b;
  color: #ffffff;
}

.ep-calc-screen {
  background: #eef3fa;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid #c7d4e8;
  min-height: 72px;
}

.ep-calc-history {
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, monospace;
  min-height: 14px;
  word-break: break-all;
}

.ep-calc-display {
  font-size: 24px;
  font-weight: 800;
  color: #1e3355;
  font-family: ui-monospace, monospace;
  letter-spacing: -0.02em;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.ep-calc-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ep-calc-grid-basic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.ep-calc-grid-pro {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.ep-calc-key {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, transform 0.05s;
}

.ep-calc-key:hover {
  background: #e2e8f0;
}

.ep-calc-key:active {
  transform: scale(0.96);
}

.ep-calc-key.op {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.ep-calc-key.op:hover {
  background: #bae6fd;
  color: #075985;
}

.ep-calc-key.fn {
  background: #eef3fa;
  border-color: #c7d4e8;
  color: #24406b;
  font-size: 11.5px;
}

.ep-calc-key.fn:hover {
  background: #eef3fa;
  color: #1e3355;
}

.ep-calc-key.action-clear {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.ep-calc-key.action-clear:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.ep-calc-key.action-equals {
  background: #33558b;
  border-color: #29467a;
  color: #ffffff;
  font-size: 16px;
}

.ep-calc-key.action-equals:hover {
  background: #29467a;
}

@keyframes ep-card-pop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@media (max-width: 480px) {
  .ep-calc-panel,
  .ep-calc-panel.pro-mode {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }
}

img.ep-mark {
  display: block;
  background: none;
  object-fit: cover;
  flex-shrink: 0;
}

/* Student exam list: one card per exam. */
.ep-exam-list {
  display: grid;
  gap: 12px;
}
.ep-card.ep-exam {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 20px 22px;
}
.ep-exam.is-live {
  border-color: #9fb6d8;
  box-shadow: 0 0 0 3px rgba(51, 85, 139, 0.08);
}
.ep-exam-date {
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  align-content: center;
  height: 66px;
  border-radius: 14px;
  background: #eef4ef;
  color: #24406b;
  line-height: 1.1;
}
.ep-exam-date b {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.ep-exam-date span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ep-exam-main {
  flex: 1;
  min-width: 0;
}
.ep-exam-main h2 {
  margin: 8px 0 2px;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.ep-exam-subject {
  margin: 0;
  color: #718097;
  overflow-wrap: anywhere;
}
.ep-exam-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 10px 0 0;
  font-size: 13px;
  color: #4b5a70;
}
.ep-exam-facts span:not(:last-child)::after {
  content: "·";
  margin: 0 9px;
  color: #a7b1c2;
}
.ep-exam .ep-btn {
  flex: 0 0 auto;
  min-width: 128px;
  min-height: 44px;
}
.ep-status.live::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}
@media (max-width: 640px) {
  .ep-card.ep-exam {
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px;
  }
  .ep-exam-main {
    flex-basis: calc(100% - 76px);
  }
  .ep-exam .ep-btn {
    width: 100%;
  }
}

/* Student exam page: next step first, then the facts. */
.ep-card.ep-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-left: 4px solid #c3ccd9;
}
.ep-next h2 {
  margin: 0 0 4px;
}
.ep-next p {
  margin: 0;
  max-width: 640px;
  color: #526078;
}
.ep-next .ep-actions {
  margin: 0;
}
.ep-next .ep-btn {
  min-height: 44px;
}
.ep-next.live {
  border-left-color: #33558b;
  background: #eef3fa;
}
.ep-next.warn {
  border-left-color: #d49a1c;
  background: #fffaec;
}
.ep-next.done {
  border-left-color: #315db8;
  background: #f3f7ff;
}
.ep-facts.ep-facts-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}
.ep-facts-row div {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 12px;
}
.ep-facts-row dd {
  font-size: 15px;
  margin-top: 5px;
}
.ep-student-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.ep-student-cols .ep-card {
  margin: 0;
}
.ep-steps {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #526078;
}
.ep-steps li {
  margin: 0 0 8px;
  padding-left: 4px;
}
@media (max-width: 800px) {
  .ep-facts.ep-facts-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ep-student-cols {
    grid-template-columns: 1fr;
  }
  .ep-next .ep-actions,
  .ep-next .ep-btn {
    width: 100%;
  }
}

/* ============================================================
   ANTI-CHEAT WARNING MODAL & LOCKOUT STYLES
   ============================================================ */
.ep-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999999;
  animation: ep-fade-in 0.2s ease;
}

@keyframes ep-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ep-card-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ep-onboarding-card {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 480px;
  border-radius: 20px;
  padding: 32px 28px 24px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: ep-card-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ep-shield-badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.ep-onboarding-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px 0;
  line-height: 1.3;
}

.ep-onboarding-text {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 20px 0;
  text-align: center;
}

.ep-modal-btn {
  width: 100%;
  background: #475569;
  color: #ffffff;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.ep-modal-btn:hover {
  background: #334155;
  transform: translateY(-1px);
}

.ep-checklist-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.ep-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}
.ep-modal-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.ep-stepper-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #cbd5e1;
  transition: all 0.2s ease;
}
.ep-stepper-dot.active {
  width: 22px;
  background: #33558b;
}
.ep-cam-viewfinder {
  width: 320px;
  height: 240px;
  max-width: 100%;
  border-radius: 12px;
  background: #0f172a;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 2px solid #0284c7;
}
.ep-cam-video, .ep-cam-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ep-sec-tab-btn:hover {
  background: #f1f5f9;
}

/* ============================================================
   OBSIDIAN PROCTOR MANAGER COCKPIT (DASHBOARD OF CONTROL)
   ============================================================ */
.saas-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px;
  width: 100%;
}

.saas-header {
  background: #0b0b0b;
  border: 1px solid #1c1c1c;
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.saas-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 6px;
}
.saas-breadcrumb span.active {
  color: #f9fafb;
}

.saas-title {
  font-size: 22px;
  font-weight: 800;
  color: #f9fafb;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

.saas-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.saas-status-pill.live {
  background: rgba(51, 85, 139, 0.15);
  color: #9fb6d8;
  border: 1px solid rgba(51, 85, 139, 0.35);
}
.saas-status-pill.paused {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.saas-status-pill.ended {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}
.saas-status-pill.published {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.saas-status-pill.draft {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.saas-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: ep-pulse 1.8s infinite;
}

.saas-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.saas-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  background: #141414;
  color: #f9fafb;
}
.saas-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}
.saas-btn-primary {
  background: #1e3355;
  color: #9fb6d8;
  border-color: #24406b;
}
.saas-btn-warning {
  background: #1e1b18;
  color: #fbbf24;
  border-color: #78350f;
}
.saas-btn-danger {
  background: #2a1215;
  color: #fb7185;
  border-color: #881337;
}
.saas-btn-purple {
  background: #2e1065;
  color: #c084fc;
  border-color: #6b21a8;
}

.saas-extend-dock {
  display: flex;
  align-items: center;
  background: #050505;
  border: 1px solid #1c1c1c;
  border-radius: 8px;
  padding: 2px 4px;
}
.saas-extend-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  padding: 0 8px;
  text-transform: uppercase;
  font-family: ui-monospace, monospace;
}
.saas-extend-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.saas-extend-btn:hover {
  background: #1a1a1a;
  color: #f9fafb;
}

.saas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .saas-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .saas-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.saas-kpi-card {
  background: #0b0b0b;
  border: 1px solid #1c1c1c;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.saas-kpi-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.saas-kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.saas-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: #f9fafb;
  letter-spacing: -0.02em;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", monospace;
}
.saas-kpi-subtext {
  font-size: 12px;
  color: #6b7280;
}

.saas-tab-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #1c1c1c;
  margin-bottom: 20px;
  overflow-x: auto;
}
.saas-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.saas-tab-btn:hover {
  color: #f9fafb;
}
.saas-tab-btn.active {
  color: #29467a;
  border-bottom-color: #29467a;
}
.saas-tab-badge {
  background: #1a1a1a;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
}
.saas-tab-btn.active .saas-tab-badge {
  background: rgba(51, 85, 139, 0.2);
  color: #9fb6d8;
}

.saas-card {
  background: #0b0b0b;
  border: 1px solid #1c1c1c;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.saas-table-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid #1c1c1c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #050505;
}
.saas-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0e0e0e;
  border: 1px solid #222222;
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 260px;
}
.saas-search-box input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: #f9fafb;
  width: 100%;
}
.saas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 820px;
}
.saas-table th {
  text-align: left;
  padding: 12px 18px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #070707;
  border-bottom: 1px solid #1c1c1c;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", monospace;
}
.saas-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #1c1c1c;
  color: #d1d5db;
  vertical-align: middle;
}
.saas-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.saas-table tr:last-child td {
  border-bottom: none;
}
.saas-candidate-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.saas-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #141414;
  border: 1px solid #222222;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #f9fafb;
  position: relative;
  flex-shrink: 0;
}
.saas-avatar-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #0b0b0b;
}
.saas-avatar-dot.active { background: #29467a; }
.saas-avatar-dot.locked { background: #f43f5e; }
.saas-avatar-dot.submitted { background: #38bdf8; }
.saas-avatar-dot.not_started { background: #6b7280; }

.saas-badge-success {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(51, 85, 139, 0.12);
  color: #9fb6d8;
  border: 1px solid rgba(51, 85, 139, 0.25);
  font-family: ui-monospace, monospace;
}
.saas-badge-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
  font-family: ui-monospace, monospace;
}
.saas-badge-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-family: ui-monospace, monospace;
}
.saas-badge-muted {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #141414;
  color: #9ca3af;
  border: 1px solid #222222;
}

/* Phones and tablets: the page never scrolls sideways. Wide tables and formulas scroll inside their own box. */
@media (max-width: 900px) {
  html { overflow-x: hidden; }
  html, body { max-width: 100%; overscroll-behavior-x: none; }
  @supports (overflow: clip) {
    html, body { overflow-x: clip; }
  }
}
