/* ==========================================================================
   AUTOGRADING - STUDENT PORTAL BENTO NEO-MINIMALISM
   Responsive Desktop & Mobile Zero-Login Examination Submission Portal
   File length ceiling: strictly <= 800 lines, Separation of Concerns
   ========================================================================== */

/* 1. SHELL ISOLATION & FLEX CROSS-AXIS WIDTH FIX */
html.portal-mode aside.cockpit-sidebar, body.portal-mode aside.cockpit-sidebar,
html.portal-mode header.studio-topbar, body.portal-mode header.studio-topbar,
html.portal-mode .mobile-bottom-dock, body.portal-mode .mobile-bottom-dock,
html.portal-mode .mobile-fab, body.portal-mode .mobile-fab,
html.portal-mode #teacher-dashboard-view, body.portal-mode #teacher-dashboard-view,
html.portal-mode #auth-gate-view, body.portal-mode #auth-gate-view,
html.portal-mode .auth-gate-wrapper, body.portal-mode .auth-gate-wrapper {
  display: none !important;
}

body.portal-mode, html.portal-mode,
body.portal-mode .ag-shell, body.portal-mode .app-cockpit-layout,
body.portal-mode .studio-canvas, body.portal-mode .workspace-container,
body.portal-mode .cockpit-layout, body.portal-mode .cockpit-main,
body.portal-mode .cockpit-content-body {
  background: var(--bento-bg) !important;
}

html.portal-mode .studio-canvas, body.portal-mode .studio-canvas,
html.portal-mode main.workspace-container, body.portal-mode main.workspace-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

html.portal-mode #student-portal-view,
body.portal-mode #student-portal-view,
body.unauthenticated.portal-mode #student-portal-view,
#student-portal-view {
  width: 100% !important;
  max-width: 1160px !important;
  margin: 0 auto !important;
  padding: 1.5rem 2rem 3.5rem !important;
  box-sizing: border-box !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--bento-text-body) !important;
}

@media (max-width: 899.98px) {
  html.portal-mode #student-portal-view, body.portal-mode #student-portal-view, #student-portal-view {
    padding: 1.15rem 1rem 2.75rem !important;
  }
}

@media (max-width: 480px) {
  html.portal-mode #student-portal-view, body.portal-mode #student-portal-view, #student-portal-view {
    padding: 0.85rem 0.75rem 2.25rem !important;
  }
}

/* 2. PORTAL CARD PRIMITIVES & TYPOGRAPHY */
.portal-card.bento-card,
.portal-access-required-card,
.portal-card {
  background: var(--bento-surface) !important;
  border: 1px solid var(--bento-border) !important;
  border-radius: var(--bento-radius-hero) !important;
  box-shadow: var(--bento-shadow-flat), inset 0 1px 0 var(--bento-inner-highlight) !important;
  transition: var(--bento-transition) !important;
  position: relative;
  overflow: visible;
  padding: 1.75rem !important;
  box-sizing: border-box !important;
}

#student-portal-view h2, #student-portal-view h3,
.portal-card h3, .portal-access-required-card h3 {
  color: var(--bento-text-title) !important;
}

#student-portal-view p, .portal-access-required-card p {
  color: var(--bento-text-body) !important;
}

/* 3. PORTAL TOP HEADER BAR */
#student-portal-view .portal-top-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 1rem 1.35rem !important;
  margin-bottom: 1.25rem !important;
  background: var(--bento-surface) !important;
  border: 1px solid var(--bento-border) !important;
  border-radius: var(--bento-radius-card) !important;
  box-shadow: var(--bento-shadow-flat) !important;
}

.portal-header-brand { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.portal-brand-logo { width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.22); }
.portal-header-copy { min-width: 0; }
.portal-header-copy h2 { font-size: 1.35rem !important; font-weight: 800 !important; line-height: 1.25 !important; margin: 0 !important; font-family: var(--font-heading, "Outfit", sans-serif) !important; }
.portal-header-subtitle { font-size: 0.84rem; color: var(--bento-text-muted) !important; margin-top: 0.15rem; }
.portal-header-actions { display: flex; align-items: center; gap: 0.55rem; flex-shrink: 0; }
.portal-home-link { text-decoration: none !important; font-weight: 700 !important; white-space: nowrap !important; }
#student-portal-view .portal-header-actions:has(#btn-back-to-teacher:not([style*="display: none"])) #btn-portal-home-link { display: none !important; }

@media (max-width: 640px) {
  #student-portal-view .portal-top-header { padding: 0.85rem 1rem !important; margin-bottom: 1rem !important; }
  .portal-brand-logo { width: 36px; height: 36px; }
  .portal-header-copy h2 { font-size: 1.12rem !important; }
  .portal-header-subtitle { font-size: 0.76rem; }
}
@media (max-width: 440px) {
  .portal-header-subtitle { display: none !important; }
}

/* 4. LINKED EXAM BENTO BANNER */
#portal-exam-banner {
  background: var(--bento-surface) !important;
  border: 1px solid var(--bento-border) !important;
  border-left: 4px solid #0284c7 !important;
  border-radius: var(--bento-radius-card) !important;
  box-shadow: var(--bento-shadow-flat) !important;
  padding: 1rem 1.35rem !important;
  margin-bottom: 1.25rem !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 0.85rem !important;
}

.portal-exam-banner-main { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.portal-exam-banner-icon { border-radius: 11px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0, 197, 223, 0.22); }
.portal-exam-banner-eyebrow { font-size: 0.75rem; font-weight: 700; color: #0284c7; text-transform: uppercase; letter-spacing: 0.04em; }
#portal-banner-exam-title { font-size: 1.12rem !important; color: var(--bento-text-title) !important; font-family: "Plus Jakarta Sans", sans-serif !important; font-weight: 800 !important; line-height: 1.3 !important; }
#portal-banner-exam-meta { font-size: 0.82rem; color: var(--bento-text-muted) !important; margin-top: 0.15rem; }
.portal-exam-banner-actions { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.portal-bound-badge { font-size: 0.8rem !important; padding: 0.35rem 0.75rem !important; }
.portal-rescan-qr-btn { font-size: 0.78rem !important; padding: 0.35rem 0.75rem !important; font-weight: 700 !important; border-color: #0284c7 !important; color: #0284c7 !important; background: var(--bento-surface-subtle) !important; border-radius: 999px !important; }

/* 5. TWO-COLUMN DESKTOP PORTAL WORKSPACE (.portal-wrap) */
.portal-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 18px !important;
  box-sizing: border-box !important;
}

.portal-wrap > .p-left { flex-direction: column !important; gap: 16px !important; min-width: 0 !important; }
.portal-wrap > .flow-right-col { display: flex !important; flex-direction: column !important; gap: 14px !important; min-width: 0 !important; width: 100% !important; }
.portal-flow-grid { position: relative; width: 100% !important; display: block !important; grid-template-columns: minmax(0, 1fr) !important; }
.portal-header-subtitle, .portal-bound-badge, .portal-zero-login-pill, #portal-deadline-banner, .p-left .card.p-tips { display: none !important; }
@media (max-width: 899.98px) { #portal-exam-left-col { display: none !important; } }
@media (min-width: 900px) { #portal-exam-banner { display: none !important; } }

@media (min-width: 900px) {
  .portal-wrap {
    grid-template-columns: 340px minmax(0, 1fr) !important;
    gap: 24px !important;
    align-items: start !important;
  }
  .portal-wrap > .p-left {
    position: sticky !important;
    top: 20px !important;
  }
  .portal-wrap.access-required-mode,
  .portal-wrap:has(> .p-left[style*="display: none"]),
  .portal-wrap:has(> #portal-exam-left-col[style*="display: none"]) {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100% !important;
  }
}

.p-left .card.exam-card,
.p-left .card.p-tips {
  padding: 1.25rem !important;
  border: 1px solid var(--bento-border) !important;
  border-radius: var(--bento-radius-card) !important;
  background: var(--bento-surface) !important;
  box-shadow: var(--bento-shadow-flat) !important;
}

.exam-card .ey { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #0284c7; font-weight: 800; display: block; }
.exam-card h2 { font-size: 1.15rem !important; font-weight: 800 !important; line-height: 1.32 !important; margin: 0.35rem 0 0 !important; }
.exam-card p { font-size: 0.84rem !important; color: var(--bento-text-muted) !important; margin: 0.25rem 0 0 !important; }
.exam-card .countdown { align-items: center; gap: 8px; padding: 0.65rem 0.8rem; border-radius: 10px; background: #fef3c7; color: #b45309; font-weight: 700; font-size: 0.82rem; margin-top: 0.85rem; }
.exam-card .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0.85rem; }
.exam-card .facts > div { padding: 0.55rem 0.65rem; border-radius: 10px; background: var(--bento-surface-subtle); border: 1px solid var(--bento-border); font-size: 0.74rem; color: var(--bento-text-muted); line-height: 1.35; }
.exam-card .facts > div b { display: block; color: var(--bento-text-title); font-size: 0.82rem; margin-top: 2px; }
.p-tips h3 { font-size: 0.92rem !important; font-weight: 800 !important; margin: 0 0 0.55rem !important; }
.p-tips .tip { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.82rem; color: var(--bento-text-body); padding: 0.3rem 0; line-height: 1.45; }
.p-tips .tip-check { color: #10b981; font-weight: 800; flex-shrink: 0; }

/* 6. PROGRESSIVE STEPPER IN BENTO PILL CONTAINER */
.portal-stepper-container {
  background: var(--bento-surface) !important;
  border: 1px solid var(--bento-border) !important;
  border-radius: var(--bento-radius-pill) !important;
  box-shadow: var(--bento-shadow-flat) !important;
  padding: 0.7rem 1.5rem !important;
  margin-bottom: 0.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.stepper-step { display: flex !important; align-items: center !important; gap: 0.6rem !important; flex-shrink: 0 !important; }
.step-meta { display: flex; flex-direction: column; line-height: 1.22; }
.step-icon-circle {
  width: 30px !important; height: 30px !important; border-radius: 50% !important;
  font-weight: 800 !important; font-size: 0.8rem !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  background: var(--bento-surface-subtle) !important; color: var(--bento-text-muted) !important;
  border: 1px solid var(--bento-border) !important; flex-shrink: 0 !important;
}
.stepper-step.active .step-icon-circle { background: var(--bento-accent-primary, #2563eb) !important; color: #ffffff !important; border-color: var(--bento-accent-primary, #2563eb) !important; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.32) !important; }
.stepper-step.completed .step-icon-circle { background: var(--bento-accent-emerald, #10b981) !important; color: #ffffff !important; border-color: var(--bento-accent-emerald, #10b981) !important; }
.stepper-line { flex: 1 1 auto !important; max-width: none !important; min-width: 18px !important; height: 2px !important; margin: 0 0.75rem !important; background: var(--bento-border) !important; }
.stepper-line.completed { background: var(--bento-accent-emerald, #10b981) !important; }
.step-name { font-size: 0.8rem !important; font-weight: 700 !important; color: var(--bento-text-title) !important; }
.step-desc { font-size: 0.73rem !important; color: var(--bento-text-muted) !important; }

@media (max-width: 640px) {
  .portal-stepper-container { padding: 0.55rem 0.9rem !important; }
  .stepper-line { margin: 0 0.35rem !important; }
  .step-desc { display: none !important; }
}

/* 7. QR & UNIQUE LINK REQUIRED STATE (2-COLUMN BENTO ON DESKTOP) */
#portal-access-required-card { padding: 2rem 1.5rem !important; }
.portal-access-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.portal-access-info-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.access-required-icon-wrap {
  width: 64px; height: 64px; margin-bottom: 1rem;
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border-radius: 18px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.16);
}
.portal-access-title { font-size: 1.4rem !important; font-weight: 800 !important; margin: 0 0 0.55rem !important; font-family: var(--font-heading, "Outfit", sans-serif) !important; }
.portal-access-desc { font-size: 0.92rem; line-height: 1.6; margin: 0 0 1.15rem; max-width: 540px; }
.portal-access-error-msg {
  width: 100%; padding: 0.75rem 1rem; margin-bottom: 1.1rem;
  background: #fff1f2; border: 1.5px solid #fecdd3; border-radius: 12px;
  font-size: 0.85rem; color: #be123c; font-weight: 600; box-sizing: border-box;
}
.portal-access-guide-list { display: flex; flex-direction: column; gap: 0.55rem; width: 100%; margin-bottom: 1.25rem; text-align: left; }
.portal-access-guide-item {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.8rem;
  border-radius: 10px; background: var(--bento-surface-subtle);
  border: 1px solid var(--bento-border); font-size: 0.83rem; color: var(--bento-text-body);
}
.guide-step-badge {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(2, 132, 199, 0.12); color: #0284c7;
  font-size: 0.74rem; font-weight: 800; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.portal-access-teacher-bar { width: 100%; padding-top: 1rem; margin-top: auto; border-top: 1px solid var(--bento-border); font-size: 0.84rem; color: var(--bento-text-muted); }
.portal-teacher-login-btn { background: none; border: none; color: var(--primary, #0284c7); font-weight: 700; cursor: pointer; text-decoration: underline; margin-left: 4px; padding: 0; }
.portal-access-actions-col { display: flex; flex-direction: column; gap: 1rem; width: 100%; }

.portal-qr-action-tile,
.portal-manual-entry-box {
  width: 100% !important; max-width: 100% !important; margin: 0 !important;
  padding: 1.35rem !important; background: var(--bento-surface-subtle) !important;
  border: 1px solid var(--bento-border) !important; border-radius: var(--bento-radius-card) !important;
  box-sizing: border-box !important; text-align: center;
}
.portal-manual-entry-box { text-align: left !important; }
.portal-action-tile-label,
.portal-manual-entry-box label {
  font-size: 0.82rem !important; font-weight: 700 !important; color: var(--bento-text-title) !important;
  display: block !important; margin-bottom: 0.75rem !important; text-align: left !important;
}
.portal-scan-qr-cta {
  width: 100% !important; padding: 0.85rem 1.35rem !important; font-weight: 700 !important; font-size: 0.98rem !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  gap: 0.55rem !important; border-radius: 12px !important; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28) !important;
}
.portal-qr-action-hint { font-size: 0.78rem; color: var(--bento-text-muted); margin-top: 0.55rem; }
.portal-qr-file-wrap { margin-top: 0.45rem; }
.portal-upload-qr-file-btn { font-size: 0.82rem; color: var(--primary, #0284c7); font-weight: 600; text-decoration: underline; background: none; border: none; cursor: pointer; padding: 4px 8px; }
.portal-manual-entry-row { display: flex; gap: 0.55rem; }
.portal-manual-entry-row .form-control { flex: 1 1 auto; min-width: 0; font-size: 0.88rem; padding: 0.65rem 0.85rem; }
#btn-portal-apply-manual-code { font-weight: 700; padding: 0.65rem 1.15rem; white-space: nowrap; }
.portal-manual-entry-hint { font-size: 0.76rem; color: var(--bento-text-muted); margin-top: 0.5rem; line-height: 1.45; }

@media (min-width: 900px) {
  #portal-access-required-card { padding: 2.35rem 2.5rem !important; }
  .portal-access-grid { grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr); gap: 2.25rem; align-items: stretch; }
  .portal-access-info-col { align-items: flex-start; text-align: left; }
  .portal-access-desc { max-width: none; }
}
@media (max-width: 480px) {
  #portal-access-required-card { padding: 1.35rem 1rem !important; }
  .portal-manual-entry-row { flex-direction: column; }
  #btn-portal-apply-manual-code { width: 100%; justify-content: center; }
}

/* 8. STEP 1: UPLOAD & CAMERA DROPZONE BENTO CARD */
.portal-card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.6rem; }
.portal-card-title-group { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.portal-card-title-group h3 { font-size: 1.15rem !important; font-weight: 800 !important; margin: 0 !important; }
.portal-zero-login-pill { font-size: 0.76rem; color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; padding: 0.25rem 0.65rem; border-radius: 999px; font-weight: 700; }
.portal-expired-notice { padding: 1rem 1.25rem; background: #fff1f2; border: 1.5px solid #fecdd3; border-radius: 12px; margin-bottom: 1rem; text-align: center; }
.portal-expired-title { font-size: 1.02rem; font-weight: 800; color: #be123c; margin-bottom: 0.2rem; }
.portal-expired-desc { font-size: 0.83rem; color: #9f1239; }

#portal-dropzone,
.portal-upload-zone,
.portal-dropzone-box {
  background: var(--bento-surface-subtle) !important;
  border: 2px dashed var(--bento-border) !important;
  border-radius: var(--bento-radius-card) !important;
  padding: 1.85rem 1.25rem !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: var(--bento-transition) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.55rem !important;
  margin-bottom: 1rem !important;
}
@media (min-width: 900px) {
  #portal-dropzone { padding: 2.5rem 2rem !important; }
}
#portal-dropzone:hover, .portal-upload-zone:hover, .portal-dropzone-box:hover {
  border-color: var(--bento-border-hover, #0284c7) !important;
  background: var(--bento-surface) !important;
  box-shadow: var(--bento-shadow-hover) !important;
}

.portal-dropzone-icon { width: 56px; height: 56px; border-radius: 16px; background: rgba(2, 132, 199, 0.1); color: #0284c7; display: flex; align-items: center; justify-content: center; margin-bottom: 0.25rem; }
.portal-dropzone-title { font-weight: 800; color: var(--bento-text-title); font-size: 1.04rem; }
.portal-dropzone-subtitle { font-size: 0.83rem; color: var(--bento-text-muted); max-width: 560px; line-height: 1.5; margin-bottom: 0.65rem; }
.portal-action-btn-group { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; align-items: center; width: 100%; }
.portal-action-btn-group .btn { padding: 0.72rem 1.25rem; font-weight: 700; }
#btn-portal-native-camera { color: var(--primary, #0284c7); border-color: #7dd3fc; }

@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  #btn-portal-native-camera { display: none !important; }
}

.portal-clipboard-cue-row { width: 100%; margin-top: 0.2rem; }
#portal-files-preview.portal-thumbnails-tray { display: flex; flex-wrap: wrap; gap: 0.65rem; min-height: 8px; }
.portal-thumbnail-item { position: relative; width: 96px; height: 128px; border-radius: var(--bento-radius-sm); border: 1px solid var(--bento-border); overflow: hidden; box-shadow: var(--bento-shadow-flat); flex-shrink: 0; background: var(--bento-surface); }
.portal-thumbnail-item img { width: 100%; height: 100%; object-fit: cover; }

/* 9. STEP 2: AI EXTRACTION, ROLE TOGGLE & CONFIRMATION */
.portal-back-step1-btn { font-weight: 700 !important; padding: 0.35rem 0.75rem !important; display: inline-flex !important; align-items: center !important; gap: 0.35rem !important; }
.portal-form-group { margin-bottom: 1.1rem; }
.portal-autocomplete-group { position: relative; }
.portal-field-label { font-weight: 700; font-size: 0.86rem; color: var(--bento-text-title); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.45rem; }
.portal-field-hint { font-size: 0.74rem; color: var(--bento-text-muted); font-weight: 500; }
.portal-exam-selector-wrap { margin-bottom: 1.1rem; }
.portal-exam-selector { font-weight: 700 !important; font-size: 0.94rem !important; padding: 0.65rem 0.85rem !important; border: 2px solid var(--primary, #0284c7) !important; border-radius: 10px !important; }
.portal-exam-selector-hint { font-size: 0.78rem; color: #b45309; margin-top: 0.35rem; font-weight: 600; }
.portal-ai-hint-badge { font-size: 0.72rem; color: #0369a1; background: #e0f2fe; border: 1px solid #bae6fd; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.portal-autocomplete-dropdown { position: absolute; z-index: 50; width: 100%; background: var(--bento-surface); border: 1.5px solid var(--bento-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14); max-height: 220px; overflow-y: auto; }
.portal-routing-info { background: var(--bento-surface-subtle); padding: 0.85rem 1rem; border-radius: 10px; border: 1px solid var(--bento-border); font-size: 0.83rem; color: var(--bento-text-body); margin-bottom: 1.25rem; }
.portal-confirm-submit-btn, .btn-portal-submit, #btn-portal-submit, #btn-confirm-submit { width: 100% !important; padding: 0.9rem 1.5rem !important; font-size: 1rem !important; font-weight: 800 !important; justify-content: center !important; border-radius: 12px !important; }

#portal-submitter-toggle.segmented-button-group,
.portal-card .segmented-button-group {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important; background: var(--bento-surface-subtle) !important;
  padding: 6px !important; border-radius: 14px !important;
  border: 1.5px solid var(--bento-border) !important; width: 100% !important; box-sizing: border-box !important;
}
#portal-submitter-toggle .segmented-btn,
.portal-card .segmented-button-group .segmented-btn {
  display: flex !important; align-items: center !important; justify-content: center !important;
  gap: 6px !important; padding: 0.65rem 0.75rem !important; min-height: 46px !important;
  border-radius: 10px !important; font-weight: 700 !important; font-size: 0.87rem !important;
  cursor: pointer !important; border: 1.5px solid var(--bento-border) !important;
  background: var(--bento-surface) !important; color: var(--bento-text-body) !important;
  width: 100% !important; min-width: 0 !important; transition: all 0.2s ease !important;
}
#portal-submitter-toggle .segmented-btn.active,
.portal-card .segmented-button-group .segmented-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important; font-weight: 800 !important; border-color: #0369a1 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
}
@media (max-width: 540px) {
  #portal-submitter-toggle.segmented-button-group, .portal-card .segmented-button-group { grid-template-columns: 1fr !important; }
  #portal-submitter-toggle .segmented-btn, .portal-card .segmented-btn { justify-content: space-between !important; }
}

/* 10. STEP 3: LIVE RECEIPT & PAST SUBMISSIONS */
#portal-success-receipt { text-align: center !important; background: linear-gradient(180deg, #ecfdf5 0%, #f8fafc 100%) !important; border: 1.5px solid #a7f3d0 !important; }
.portal-receipt-celebration { font-size: 2.4rem; margin-bottom: 0.35rem; }
.portal-receipt-heading { font-size: 1.3rem; font-weight: 800; color: #065f46; margin: 0 0 0.25rem; }
.portal-receipt-code-line { font-size: 0.88rem; color: #047857; }
.portal-live-submitted-card { margin: 1.15rem 0; background: var(--bento-surface); border: 1.5px solid #a7f3d0; border-radius: 14px; padding: 1.1rem 1.25rem; text-align: left; box-shadow: 0 2px 10px rgba(16, 185, 129, 0.08); }
.portal-live-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; }
.portal-live-card-eyebrow { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: #059669; letter-spacing: 0.04em; }
.portal-live-exam-title { font-size: 1.05rem; font-weight: 800; color: var(--bento-text-title); }
.portal-live-student-meta { font-size: 0.84rem; color: var(--bento-text-body); margin-top: 0.25rem; }
.portal-live-meta { font-size: 0.76rem; color: var(--bento-text-muted); margin-top: 0.2rem; }
.portal-live-thumbnails { display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto; padding-bottom: 0.25rem; }
.portal-receipt-primary-action { margin: 1.15rem 0 0.75rem; }
#btn-submit-next-student { width: 100%; min-height: 48px; padding: 0.85rem 1.25rem; font-weight: 800; font-size: 1rem; justify-content: center; border-radius: 12px; }
.portal-receipt-secondary-actions { display: flex; justify-content: center; gap: 0.55rem; flex-wrap: wrap; }
.portal-view-submitted-btn { background: #059669 !important; border-color: #059669 !important; color: #ffffff !important; font-weight: 700 !important; }

#student-my-submissions-container { margin-top: 1.5rem !important; }
.portal-submissions-header { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--bento-border); }
.portal-submissions-subtitle { font-size: 0.82rem; color: var(--bento-text-muted); margin-top: 0.2rem; }
.portal-submissions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.portal-empty-submissions { grid-column: 1 / -1; text-align: center; color: var(--bento-text-muted); padding: 1.75rem; background: var(--bento-surface-subtle); border: 1px dashed var(--bento-border); border-radius: 12px; font-size: 0.88rem; }

/* 11. DARK-MODE HIGH-CONTRAST SEMANTIC OVERRIDES */
[data-theme="dark"] .access-required-icon-wrap,
[data-theme="dark"] .portal-dropzone-icon { background: rgba(56, 189, 248, 0.14) !important; color: #38bdf8 !important; }
[data-theme="dark"] .portal-exam-banner-eyebrow,
[data-theme="dark"] .exam-card .ey,
[data-theme="dark"] .guide-step-badge,
[data-theme="dark"] .portal-rescan-qr-btn { color: #38bdf8 !important; border-color: rgba(56, 189, 248, 0.4) !important; }
[data-theme="dark"] .portal-zero-login-pill,
[data-theme="dark"] .portal-ai-hint-badge { background: rgba(16, 185, 129, 0.14) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.35) !important; }
[data-theme="dark"] .portal-access-error-msg,
[data-theme="dark"] .portal-expired-notice { background: rgba(244, 63, 94, 0.14) !important; border-color: rgba(244, 63, 94, 0.35) !important; color: #fda4af !important; }
[data-theme="dark"] .portal-expired-title,
[data-theme="dark"] .portal-expired-desc { color: #fda4af !important; }
[data-theme="dark"] .exam-card .countdown { background: rgba(245, 158, 11, 0.16) !important; color: #fcd34d !important; }
[data-theme="dark"] #portal-success-receipt { background: rgba(5, 150, 105, 0.14) !important; border-color: rgba(16, 185, 129, 0.35) !important; }
[data-theme="dark"] .portal-receipt-heading,
[data-theme="dark"] .portal-receipt-code-line { color: #6ee7b7 !important; }
[data-theme="dark"] .portal-live-submitted-card { background: var(--bento-surface) !important; border-color: rgba(16, 185, 129, 0.35) !important; }
[data-theme="dark"] #portal-exam-selector { background: var(--bento-surface-subtle) !important; color: var(--bento-text-title) !important; border-color: #38bdf8 !important; }
