:root {
  --brand-blue: #051EDD;
  --brand-red: #FF0000;
  --brand-white: #FFFFFF;

  --bg-soft: #eef2ff;
  --bg-dark: #0b1020;
  --text-dark: #111827;
  --text-muted: #6b7280;
  --border-soft: rgba(255, 255, 255, 0.18);
  --success: #0f9d58;
  --danger: #d93025;

  --shadow: 0 18px 45px rgba(5, 30, 221, 0.14);
  --glass: rgba(255, 255, 255, 0.12);
  --glass-strong: rgba(255, 255, 255, 0.18);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

/* RESET */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--bg-soft);
  color: var(--text-dark);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  max-width: 100%;
  display: block;
}

/* =========================
   AUTH / LOGIN PAGE
========================= */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(5, 30, 221, 0.38), transparent 28%),
    radial-gradient(circle at 80% 75%, rgba(255, 0, 0, 0.28), transparent 25%),
    linear-gradient(135deg, #050c2f 0%, #16052b 45%, #25050f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.auth-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: stretch;
}

.auth-left {
  color: #fff;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  margin-bottom: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-title {
  font-size: 3.2rem;
  line-height: 1.02;
  margin: 0 0 16px;
  font-weight: 800;
}

.brand-text {
  font-size: 1.06rem;
  line-height: 1.8;
  max-width: 560px;
  opacity: 0.92;
  margin: 0;
}

.brand-colors {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.color-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.12);
}

.color-chip.blue {
  background: var(--brand-blue);
}

.color-chip.red {
  background: var(--brand-red);
}

.color-chip.white {
  background: var(--brand-white);
}

.auth-card {
  position: relative;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 28px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.2);
  padding: 36px;
  width: 100%;
  max-width: 500px;
  justify-self: end;
  color: #fff;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 2.3rem;
  font-weight: 800;
}

.muted {
  color: rgba(255, 255, 255, 0.78);
  margin-top: 0;
  margin-bottom: 0;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 26px 0 20px;
}

.role-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.22s ease;
}

.role-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.role-btn.active {
  background: linear-gradient(135deg, #1733ff, #051edd);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(5, 30, 221, 0.35);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 4px;
  color: #fff;
}

.auth-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
  transition: all 0.22s ease;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.auth-form input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
  margin-bottom: 0;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  user-select: none;
  opacity: 0.9;
}

.primary-btn {
  background: linear-gradient(135deg, #ff1212, #ff4d4d);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.22s ease;
  box-shadow: 0 14px 30px rgba(255, 0, 0, 0.22);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(255, 0, 0, 0.3);
}

.primary-btn-2 {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.22s ease;
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.22);
}

.primary-btn-2:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(37, 211, 102, 0.3);
}

.primary-btn-2 img {
  height: 20px;
  display: inline-block;
}

.form-message {
  margin-top: 16px;
  min-height: 24px;
  font-weight: 700;
}

.form-message.error {
  color: #FF0000;
}

.form-message.success {
  color: #000044;
}

/* =========================
   APP LAYOUT / DASHBOARDS
========================= */
.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background:
    radial-gradient(circle at top left, rgba(5, 30, 221, 0.06), transparent 28%),
    linear-gradient(180deg, #f7f9ff 0%, #eef2ff 100%);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(5, 30, 221, 0.97), rgba(12, 20, 88, 0.98));
  color: var(--brand-white);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  min-height: 100vh;
  box-shadow: 8px 0 26px rgba(5, 30, 221, 0.18);
}

.sidebar h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.55rem;
  line-height: 1.2;
  text-align: center;
}

.sidebar .nav-btn,
.sidebar .logout-btn {
  width: 100%;
  display: block;
  margin: 10px 0;
  padding: 13px 14px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--brand-white);
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
}

.sidebar .nav-btn:hover,
.sidebar .logout-btn:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.16);
}

.sidebar .logout-btn {
  background: linear-gradient(135deg, #ff1a1a, #e10000);
}

.main-content {
  padding: 24px;
}

.topbar {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 2rem;
}

.topbar p {
  margin: 0;
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--brand-blue);
}

.card p {
  margin-bottom: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf0fb;
  text-align: left;
  vertical-align: top;
}

table th {
  color: var(--brand-blue);
  background: #f8f9ff;
  font-size: 0.94rem;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-online,
.status-ready,
.status-passed {
  background: rgba(15, 157, 88, 0.12);
  color: var(--success);
}

.status-offline,
.status-pending {
  background: rgba(217, 48, 37, 0.1);
  color: var(--danger);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.section-title {
  margin: 0 0 12px;
  color: var(--brand-blue);
}

.field-row {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.field-row label {
  font-weight: 700;
}

.field-row input,
.field-row select,
.field-row textarea {
  width: 100%;
  border: 1px solid #d8def2;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  background: #fff;
}

.field-row input:focus,
.field-row select:focus,
.field-row textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(5, 30, 221, 0.08);
}

.secondary-btn {
  background: linear-gradient(135deg, #1733ff, #051edd);
  color: var(--brand-white);
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(5, 30, 221, 0.2);
}

.danger-btn {
  background: linear-gradient(135deg, #ff1c1c, #d90000);
  color: var(--brand-white);
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.link-btn {
  display: inline-block;
  background: linear-gradient(135deg, #1733ff, #051edd);
  color: var(--brand-white);
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  margin: 6px 8px 0 0;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-card {
    justify-self: stretch;
    max-width: none;
  }

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

  .two-col {
    grid-template-columns: 1fr;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }
}

@media (max-width: 700px) {
  .auth-page {
    padding: 16px;
  }

  .auth-left,
  .auth-card {
    padding: 24px;
  }

  .brand-title {
    font-size: 2.35rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 14px;
  }

  .topbar,
  .card {
    padding: 16px;
  }
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#questionOptionsWrap .card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#questionOptionsWrap .card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(5, 30, 221, 0.08);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.exam-option-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.exam-option-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(5, 30, 221, 0.08);
}

.exam-media-image {
  display: block;
  width: min(100%, 760px);
  max-width: 100%;
  height: auto;
  max-height: min(76vh, 780px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid #dbe2ff;
  background: #fff;
  box-shadow: 0 10px 24px rgba(5, 30, 221, 0.08);
}

.exam-media-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

/* ===== MODERN TOGGLE SWITCH ===== */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}

.toggle-label {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 14px;
}

/* Switch container */
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
}

/* Hide default checkbox */
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider */
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  border: 1px solid rgba(5,30,221,0.2);
  transition: 0.3s;
}

/* Circle knob */
.slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ON state */
.toggle-switch input:checked + .slider {
  background: linear-gradient(135deg, #051EDD, #FF0000);
  box-shadow: 0 0 12px rgba(5,30,221,0.4);
}

/* Move knob */
.toggle-switch input:checked + .slider::before {
  transform: translateX(24px);
}

/* ===== CUSTOM FILE UPLOAD ===== */

.upload-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;

  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(5,30,221,0.2);

  transition: all 0.25s ease;
}

.upload-btn:hover {
  background: linear-gradient(135deg, #051EDD, #FF0000);
  color: #fff;
  box-shadow: 0 0 12px rgba(5,30,221,0.3);
}

.upload-icon {
  font-size: 16px;
}

.file-name {
  font-size: 13px;
  color: #666;
  font-style: italic;
}

/* =========================
   MOBILE RESPONSIVENESS UPGRADE
========================= */

html, body {
  overflow-x: hidden;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
}

.main-content {
  min-width: 0;
}

.sidebar {
  min-width: 0;
}

.cards-grid,
.two-col {
  min-width: 0;
}

.card,
.topbar,
.auth-card,
.auth-left {
  min-width: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 720px;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.upload-field {
  flex-wrap: wrap;
}

.file-name {
  word-break: break-word;
}

/* Better button wrapping */
.secondary-btn,
.primary-btn,
.primary-btn-2,
.danger-btn,
.link-btn,
.nav-btn,
.logout-btn {
  white-space: normal;
}

/* Images should preserve their original proportions. */
img {
  max-width: 100%;
  height: auto;
}

/* =========================
   TABLET
========================= */
@media (max-width: 1024px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    width: 100%;
    padding: 16px;
  }

  .main-content {
    padding: 16px;
  }

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

  .two-col {
    grid-template-columns: 1fr;
  }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .auth-page {
    padding: 14px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
  }

  .auth-left,
  .auth-card {
    padding: 20px;
    border-radius: 18px;
  }

  .brand-title {
    font-size: 2rem;
    line-height: 1.15;
  }

  .brand-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 14px;
    border-radius: 0 0 18px 18px;
  }

  .sidebar h2 {
    font-size: 1.2rem;
    margin-bottom: 14px;
  }

  .sidebar .nav-btn,
  .sidebar .logout-btn,
  .link-btn {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
    text-align: center;
  }

  .main-content {
    padding: 12px;
  }

  .topbar {
    padding: 16px;
    border-radius: 16px;
  }

  .topbar h1 {
    font-size: 1.4rem;
    line-height: 1.2;
  }

  .topbar p {
    font-size: 0.92rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .section-title {
    font-size: 1.05rem;
  }

  .field-row {
    gap: 8px;
    margin-bottom: 10px;
  }

  .field-row input,
  .field-row select,
  .field-row textarea,
  .auth-form input {
    padding: 11px 12px;
    font-size: 15px;
  }

  .primary-btn,
  .primary-btn-2,
  .secondary-btn,
  .danger-btn {
    width: 100%;
    padding: 12px 14px;
  }

  .role-switch {
    grid-template-columns: 1fr;
  }

  .toggle-row {
    align-items: center;
    gap: 10px;
  }

  .upload-field {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .upload-btn {
    justify-content: center;
    width: 100%;
  }

  .file-name {
    font-size: 12px;
  }

  #questionOptionsWrap {
    gap: 10px !important;
  }

  #questionOptionsWrap .card,
  .exam-option-card {
    padding: 12px !important;
  }

  #examRunnerSection .cards-grid {
    grid-template-columns: 1fr !important;
  }

  #examRunnerSection .card,
  #examResultSection .card,
  #studentHomeSection .card,
  #studySection .card,
  #profileSection .card {
    width: 100%;
  }
}

/* Keep modal surface above the later global card theme. */
.question-edit-modal .question-edit-dialog {
  width: min(1380px, 100%);
  max-height: calc(100dvh - clamp(24px, 5vw, 68px));
  margin: 0;
  padding: clamp(18px, 2.2vw, 30px);
  overflow-y: auto;
  border-radius: 26px;
  background: rgba(249, 250, 253, .97);
  box-shadow: 0 35px 100px rgba(4, 10, 31, .34);
}

@media (max-width: 600px) {
  .question-edit-modal .question-edit-dialog {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    padding: 14px;
    border-radius: 0;
  }
}

/* Final student theme precedence. */
body:not(.auth-page) {
  background:
    linear-gradient(rgba(217,217,217,.9), rgba(217,217,217,.94)),
    repeating-linear-gradient(116deg, transparent 0 110px, rgba(255,255,255,.55) 111px 114px),
    #d9d9d9;
}

body:not(.auth-page)::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: -25%;
  pointer-events: none;
  opacity: .28;
  background:
    linear-gradient(90deg, transparent 48.8%, rgba(255,255,255,.9) 49% 51%, transparent 51.2%),
    linear-gradient(90deg, rgba(31,39,58,.16), rgba(31,39,58,.04) 34%, rgba(31,39,58,.04) 66%, rgba(31,39,58,.16));
  transform: perspective(700px) rotateX(66deg) translateY(18%);
  animation: ng-road-motion 9s linear infinite;
}

.page-shell > .sidebar {
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(155deg, #0121d8 0%, #071a84 48%, #041247 74%, #3a0715 100%);
  box-shadow: 18px 0 48px rgba(3,16,75,.24);
}

.page-shell > .sidebar::before {
  width: 260px;
  height: 260px;
  top: -110px;
  right: -120px;
  border-radius: 34% 66% 62% 38% / 38% 36% 64% 62%;
  background: linear-gradient(145deg, rgba(255,255,255,.25), rgba(1,33,216,.08));
  box-shadow: inset -24px -22px 40px rgba(0,0,0,.2), 0 28px 50px rgba(0,0,0,.22);
  animation: ng-sidebar-float 12s ease-in-out infinite alternate;
}

.page-shell > .sidebar::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  left: -125px;
  bottom: 5%;
  border-radius: 50%;
  background: linear-gradient(145deg, #e20302, rgba(226,3,2,.12) 68%);
  box-shadow: inset -30px -26px 44px rgba(69,0,0,.34), 18px 24px 50px rgba(0,0,0,.25);
  animation: ng-sidebar-float 15s ease-in-out infinite alternate-reverse;
}

.page-shell > .sidebar .nav-btn,
.page-shell > .sidebar .link-btn {
  color: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.14);
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
}

.main-content .card,
.main-content .topbar {
  border-color: rgba(255,255,255,.62);
  background: rgba(235,235,235,.78);
}

.student-font-scaling:not(.exam-runner-active):not(.result-review-active) .page-shell {
  width: var(--font-scale-width, 100%);
  zoom: var(--font-scale);
}

body.result-review-active {
  overflow-y: auto;
}

.result-review-active .main-content {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}

.result-review-active #examResultSection {
  height: auto;
  min-height: calc(100dvh - 40px);
  display: block !important;
  overflow: visible;
}

#examResultSection > section.card {
  display: block;
  margin-top: 12px !important;
  overflow: visible;
}

#resultReviewList {
  display: grid;
  gap: 16px;
  overflow: visible;
  scroll-snap-type: y proximity;
}

#resultReviewList .result-review-item,
#resultReviewList .result-review-item[hidden] {
  display: block;
  width: 100%;
  height: auto;
  min-height: min(620px, calc(100dvh - 80px));
  margin: 0 !important;
  padding: clamp(14px, 2vw, 22px);
  overflow: visible;
  scroll-snap-align: start;
}

#resultReviewList .result-review-item.has-review-media,
#resultReviewList .result-review-item.has-review-media[hidden] {
  display: grid;
  grid-template-columns: minmax(210px,.75fr) minmax(360px,1.25fr);
  grid-template-rows: auto auto repeat(3,minmax(74px,auto)) auto;
  gap: 10px 14px;
}

#resultReviewList .result-review-option {
  overflow: visible;
}

#resultReviewList .result-review-option.is-selected-wrong {
  border-color: rgba(217,48,37,.38) !important;
  background: rgba(217,48,37,.1) !important;
}

#resultReviewNavigation {
  display: none !important;
}

@media (max-width: 520px) {
  #resultReviewList .result-review-item,
  #resultReviewList .result-review-item[hidden] {
    min-height: auto;
  }

  #resultReviewList .result-review-item.has-review-media,
  #resultReviewList .result-review-item.has-review-media[hidden] {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  #resultReviewList .result-review-item.has-review-media > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

/* =========================================================
   LOGIN — MATCHED STUDENT MOTION THEME, ONE VIEWPORT
   ========================================================= */
/* High-specificity viewport contract; later legacy theme rules cannot resize it. */
html:has(body.auth-page) {
  height: 100% !important;
  overflow: hidden !important;
}
body.auth-page {
  width: 100% !important;
  height: 100dvh !important;
  min-height: 0 !important;
  padding: clamp(14px,2.3vw,30px) !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
  background: radial-gradient(circle at 86% 12%,rgba(1,33,216,.11),transparent 27%), radial-gradient(circle at 62% 92%,rgba(226,3,2,.075),transparent 24%), #d9d9d9 !important;
}
body.auth-page::before {
  inset: -30% !important;
  opacity: .3 !important;
  background: linear-gradient(90deg,transparent 48.9%,rgba(255,255,255,.92) 49% 51%,transparent 51.1%), linear-gradient(90deg,rgba(31,39,58,.15),rgba(31,39,58,.025) 34% 66%,rgba(31,39,58,.15)) !important;
  transform: perspective(720px) rotateX(67deg) translateY(17%) !important;
  animation: ng-road-motion 9s linear infinite !important;
}
body.auth-page::after {
  inset: 0 !important;
  width: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: linear-gradient(115deg,rgba(255,255,255,.18),transparent 42%,rgba(255,255,255,.08)) !important;
  animation: none !important;
}
.auth-page .auth-shell {
  width: min(1220px,100%) !important;
  height: 100% !important;
  max-height: 760px !important;
  min-height: 0 !important;
  margin: 0 !important;
  grid-template-columns: minmax(0,1.08fr) minmax(390px,.92fr) !important;
  border-radius: clamp(24px,3vw,36px) !important;
  background: rgba(235,235,235,.68) !important;
}
.auth-page .auth-left {
  min-height: 0 !important;
  padding: clamp(34px,5vw,70px) !important;
  overflow: hidden !important;
  justify-content: center !important;
  background: linear-gradient(155deg,#0121d8 0%,#071a84 48%,#041247 74%,#3a0715 100%) !important;
}
.auth-page .auth-left::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  width: clamp(230px,28vw,390px) !important;
  height: clamp(230px,28vw,390px) !important;
  top: -24% !important;
  right: -19% !important;
  border: 0 !important;
  border-radius: 34% 66% 62% 38% / 38% 36% 64% 62% !important;
  background: linear-gradient(145deg,rgba(255,255,255,.26),rgba(1,33,216,.08)) !important;
  box-shadow: inset -30px -26px 48px rgba(0,0,0,.2),0 30px 65px rgba(0,0,0,.24) !important;
  animation: ng-sidebar-float 12s ease-in-out infinite alternate !important;
}
.auth-page .auth-left::after {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  width: clamp(210px,25vw,350px) !important;
  height: clamp(210px,25vw,350px) !important;
  left: -18% !important;
  right: auto !important;
  top: auto !important;
  bottom: -23% !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: linear-gradient(145deg,#e20302,rgba(226,3,2,.13) 68%) !important;
  box-shadow: inset -34px -28px 50px rgba(69,0,0,.34),20px 28px 58px rgba(0,0,0,.26) !important;
  animation: ng-sidebar-float 15s ease-in-out infinite alternate-reverse !important;
}
.auth-page .auth-card {
  width: calc(100% - clamp(30px,5vw,66px)) !important;
  max-width: 470px !important;
  max-height: calc(100% - 32px) !important;
  min-height: 0 !important;
  margin: 16px auto !important;
  padding: clamp(26px,3.4vw,46px) !important;
  overflow: hidden !important;
  border-radius: 27px !important;
  background: rgba(235,235,235,.88) !important;
}

@media (max-height:700px) and (min-width:761px) {
  body.auth-page { padding: 12px !important; }
  .auth-page .auth-shell { max-height: none !important; }
  .auth-page .auth-left { padding-block: 24px !important; }
  .auth-page .auth-card { padding: 24px 34px !important; }
  .auth-page .auth-form { gap: 8px !important; }
  .auth-page .auth-form input,
  .auth-page .auth-form .primary-btn { min-height: 44px !important; }
}

@media (max-width:760px) {
  body.auth-page { padding: 8px !important; }
  .auth-page .auth-shell {
    max-height: none !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0,.8fr) minmax(0,1.2fr) !important;
    border-radius: 22px !important;
  }
  .auth-page .auth-left { padding: 18px 24px !important; }
  .auth-page .brand-badge,
  .auth-page .brand-colors { display: none !important; }
  .auth-page .brand-title { font-size: clamp(1.75rem,8vw,2.65rem) !important; }
  .auth-page .brand-text { font-size: clamp(.76rem,3vw,.9rem) !important; line-height: 1.3 !important; }
  .auth-page .auth-card {
    width: calc(100% - 20px) !important;
    max-width: 520px !important;
    max-height: calc(100% - 12px) !important;
    margin: 6px auto !important;
    padding: 16px 20px !important;
  }
  .auth-page .auth-form { gap: 6px !important; }
  .auth-page .auth-form input,
  .auth-page .auth-form .primary-btn { min-height: 40px !important; }
}
html:has(.auth-page) {
  height: 100%;
  overflow: hidden;
  background: #d9d9d9;
}

body.auth-page {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: clamp(14px, 2.3vw, 30px);
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 86% 12%, rgba(1,33,216,.11), transparent 27%),
    radial-gradient(circle at 62% 92%, rgba(226,3,2,.075), transparent 24%),
    #d9d9d9;
}

body.auth-page::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: -30%;
  pointer-events: none;
  opacity: .3;
  background:
    linear-gradient(90deg, transparent 48.9%, rgba(255,255,255,.92) 49% 51%, transparent 51.1%),
    linear-gradient(90deg, rgba(31,39,58,.15), rgba(31,39,58,.025) 34% 66%, rgba(31,39,58,.15));
  transform: perspective(720px) rotateX(67deg) translateY(17%);
  animation: ng-road-motion 9s linear infinite;
}

body.auth-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  width: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.18), transparent 42%, rgba(255,255,255,.08));
  animation: none;
}

.auth-page .auth-shell {
  width: min(1220px, 100%);
  height: 100%;
  max-height: 760px;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: clamp(24px, 3vw, 36px);
  background: rgba(235,235,235,.68);
  box-shadow: 0 34px 90px rgba(23,31,54,.2), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(22px) saturate(115%);
  -webkit-backdrop-filter: blur(22px) saturate(115%);
}

.auth-page .auth-left {
  isolation: isolate;
  min-height: 0;
  padding: clamp(34px, 5vw, 70px);
  overflow: hidden;
  justify-content: center;
  background: linear-gradient(155deg, #0121d8 0%, #071a84 48%, #041247 74%, #3a0715 100%);
}

.auth-page .auth-left::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: clamp(230px, 28vw, 390px);
  height: clamp(230px, 28vw, 390px);
  top: -24%;
  right: -19%;
  border-radius: 34% 66% 62% 38% / 38% 36% 64% 62%;
  background: linear-gradient(145deg, rgba(255,255,255,.26), rgba(1,33,216,.08));
  box-shadow: inset -30px -26px 48px rgba(0,0,0,.2), 0 30px 65px rgba(0,0,0,.24);
  animation: ng-sidebar-float 12s ease-in-out infinite alternate;
}

.auth-page .auth-left::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: clamp(210px, 25vw, 350px);
  height: clamp(210px, 25vw, 350px);
  left: -18%;
  bottom: -23%;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #e20302, rgba(226,3,2,.13) 68%);
  box-shadow: inset -34px -28px 50px rgba(69,0,0,.34), 20px 28px 58px rgba(0,0,0,.26);
  animation: ng-sidebar-float 15s ease-in-out infinite alternate-reverse;
}

.auth-page .brand-badge {
  margin-bottom: clamp(10px, 2vh, 20px);
  background: rgba(255,255,255,.14);
}

.auth-page .brand-logo-wrap {
  margin-bottom: clamp(10px, 2vh, 20px);
}

.auth-page .brand-logo-wrap img,
.auth-page .brand-logo {
  max-height: clamp(62px, 10vh, 90px);
}

.auth-page .brand-title {
  max-width: 610px;
  margin-bottom: clamp(12px, 2vh, 22px);
  font-size: clamp(2.65rem, 5vw, 4.45rem);
  line-height: .95;
}

.auth-page .brand-text {
  max-width: 570px;
  margin-bottom: clamp(14px, 2.5vh, 26px);
  font-size: clamp(.92rem, 1.3vw, 1.08rem);
  line-height: 1.55;
}

.auth-page .primary-btn-2 {
  min-height: 48px;
  background: linear-gradient(135deg, rgba(255,255,255,.2), rgba(255,255,255,.1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 13px 30px rgba(0,0,0,.17);
  backdrop-filter: blur(12px);
}

.auth-page .primary-btn-2:hover {
  background: linear-gradient(135deg, #0121d8, rgba(226,3,2,.72));
}

.auth-page .brand-colors {
  margin-top: clamp(12px, 2vh, 22px);
}

.auth-page .auth-card {
  align-self: center;
  width: calc(100% - clamp(30px, 5vw, 66px));
  max-width: 470px;
  max-height: calc(100% - 32px);
  min-height: 0;
  margin: 16px auto;
  padding: clamp(26px, 3.4vw, 46px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 27px;
  background: rgba(235,235,235,.88);
  box-shadow: 0 26px 60px rgba(24,32,57,.18), inset 0 1px 0 #fff;
}

.auth-page .auth-card h2 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 3.4vw, 2.7rem);
}

.auth-page .auth-card .muted {
  margin-bottom: clamp(14px, 2.4vh, 24px);
}

.auth-page .role-switch {
  margin-bottom: clamp(13px, 2vh, 20px);
}

.auth-page .role-btn {
  min-height: 44px;
}

.auth-page .auth-form {
  gap: clamp(10px, 1.6vh, 15px);
}

.auth-page .auth-form input {
  min-height: 50px;
}

.auth-page .auth-form .primary-btn {
  min-height: 48px;
  background: linear-gradient(135deg, #0121d8, #173ae4 72%, #e20302 150%);
}

@media (max-height: 700px) and (min-width: 761px) {
  body.auth-page { padding: 12px; }
  .auth-page .auth-shell { max-height: none; }
  .auth-page .auth-left { padding-block: 24px; }
  .auth-page .brand-badge { margin-bottom: 8px; }
  .auth-page .brand-logo-wrap { margin-bottom: 8px; }
  .auth-page .brand-logo-wrap img,
  .auth-page .brand-logo { max-height: 58px; }
  .auth-page .brand-title { margin-bottom: 10px; font-size: clamp(2.4rem, 4.7vw, 3.7rem); }
  .auth-page .brand-text { margin-bottom: 12px; line-height: 1.38; }
  .auth-page .brand-colors { margin-top: 10px; }
  .auth-page .auth-card { padding: 24px 34px; }
  .auth-page .auth-card .muted { margin-bottom: 12px; }
  .auth-page .role-switch { margin-bottom: 11px; }
  .auth-page .auth-form { gap: 8px; }
  .auth-page .auth-form input { min-height: 44px; }
  .auth-page .auth-form .primary-btn { min-height: 44px; }
}

@media (max-width: 760px) {
  body.auth-page { padding: 8px; }
  .auth-page .auth-shell {
    max-height: none;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, .8fr) minmax(0, 1.2fr);
    border-radius: 22px;
  }
  .auth-page .auth-left {
    padding: 18px 24px;
    justify-content: center;
  }
  .auth-page .brand-badge,
  .auth-page .brand-colors { display: none; }
  .auth-page .brand-logo-wrap { margin-bottom: 7px; }
  .auth-page .brand-logo-wrap img,
  .auth-page .brand-logo { max-height: 54px; }
  .auth-page .brand-title {
    margin-bottom: 7px;
    font-size: clamp(1.75rem, 8vw, 2.65rem);
    line-height: 1;
  }
  .auth-page .brand-text {
    margin-bottom: 9px;
    font-size: clamp(.76rem, 3vw, .9rem);
    line-height: 1.3;
  }
  .auth-page .primary-btn-2 {
    min-width: 180px;
    min-height: 40px;
    padding: 8px 14px;
  }
  .auth-page .auth-card {
    width: calc(100% - 20px);
    max-width: 520px;
    max-height: calc(100% - 12px);
    margin: 6px auto;
    padding: 16px 20px;
    overflow: hidden;
  }
  .auth-page .auth-card h2 { font-size: 1.75rem; }
  .auth-page .auth-card .muted { margin-bottom: 8px; font-size: .84rem; }
  .auth-page .role-switch { margin-bottom: 8px; }
  .auth-page .role-btn { min-height: 38px; }
  .auth-page .auth-form { gap: 6px; }
  .auth-page .auth-form input { min-height: 40px; }
  .auth-page .auth-form .primary-btn { min-height: 40px; margin-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-page::before,
  .auth-page .auth-left::before,
  .auth-page .auth-left::after {
    animation: none;
  }
}

/* Font controls resize content text only—never navigation or card geometry. */
.student-font-scaling .page-shell,
.student-font-scaling:not(.exam-runner-active):not(.result-review-active) .page-shell {
  width: 100% !important;
  zoom: 1 !important;
}

.student-font-scaling .main-content {
  font-size: 1rem;
}

.student-font-scaling .sidebar,
.student-font-scaling .sidebar *,
.student-font-scaling .font-control,
.student-font-scaling .font-control * {
  font-size: revert;
}

/* =========================================================
   STUDENT MOTION THEME + CONTINUOUS RESULTS REVIEW
   ========================================================= */
body:not(.auth-page) {
  background:
    linear-gradient(rgba(217, 217, 217, .9), rgba(217, 217, 217, .94)),
    repeating-linear-gradient(116deg, transparent 0 110px, rgba(255,255,255,.55) 111px 114px),
    #d9d9d9;
}

body:not(.auth-page)::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: -25%;
  pointer-events: none;
  opacity: .28;
  background:
    linear-gradient(90deg, transparent 48.8%, rgba(255,255,255,.9) 49% 51%, transparent 51.2%),
    linear-gradient(90deg, rgba(31,39,58,.16), rgba(31,39,58,.04) 34%, rgba(31,39,58,.04) 66%, rgba(31,39,58,.16));
  transform: perspective(700px) rotateX(66deg) translateY(18%);
  animation: ng-road-motion 9s linear infinite;
}

body:not(.auth-page)::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 16%, rgba(1,33,216,.09), transparent 24%),
    radial-gradient(circle at 62% 88%, rgba(226,3,2,.065), transparent 22%);
}

@keyframes ng-road-motion {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 180px, 0 0; }
}

.sidebar {
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(155deg, #0121d8 0%, #071a84 48%, #041247 74%, #3a0715 100%);
  box-shadow: 18px 0 48px rgba(3, 16, 75, .24);
}

.sidebar::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 260px;
  height: 260px;
  top: -110px;
  right: -120px;
  border-radius: 34% 66% 62% 38% / 38% 36% 64% 62%;
  background: linear-gradient(145deg, rgba(255,255,255,.25), rgba(1,33,216,.08));
  box-shadow: inset -24px -22px 40px rgba(0,0,0,.2), 0 28px 50px rgba(0,0,0,.22);
  animation: ng-sidebar-float 12s ease-in-out infinite alternate;
}

.sidebar::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  left: -125px;
  bottom: 5%;
  border-radius: 50%;
  background: linear-gradient(145deg, #e20302, rgba(226,3,2,.12) 68%);
  box-shadow: inset -30px -26px 44px rgba(69,0,0,.34), 18px 24px 50px rgba(0,0,0,.25);
  animation: ng-sidebar-float 15s ease-in-out infinite alternate-reverse;
}

@keyframes ng-sidebar-float {
  from { transform: translate3d(0, 0, 0) rotate(-8deg); }
  to { transform: translate3d(18px, 32px, 0) rotate(9deg); }
}

.sidebar .nav-btn,
.sidebar .link-btn {
  color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 10px 24px rgba(0,0,0,.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar .nav-btn:hover,
.sidebar .link-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,.28);
  background: linear-gradient(135deg, rgba(1,33,216,.82), rgba(226,3,2,.5));
  transform: translateX(4px);
}

.main-content .card,
.main-content .topbar {
  border-color: rgba(255,255,255,.62);
  background: rgba(235,235,235,.78);
  box-shadow: 0 18px 45px rgba(31,39,58,.1), inset 0 1px 0 rgba(255,255,255,.72);
  backdrop-filter: blur(19px) saturate(112%);
  -webkit-backdrop-filter: blur(19px) saturate(112%);
}

/* Scale the complete student interface outside the constrained exam/review views. */
.student-font-scaling:not(.exam-runner-active):not(.result-review-active) .page-shell {
  width: var(--font-scale-width, 100%);
  zoom: var(--font-scale);
}

/* Results are a continuous scrollable list; each card keeps its full answer set together. */
body.result-review-active {
  overflow-y: auto;
}

.result-review-active .main-content {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}

.result-review-active #examResultSection {
  height: auto;
  min-height: calc(100dvh - 40px);
  display: block !important;
  overflow: visible;
}

#examResultSection > .topbar {
  margin-bottom: 12px !important;
}

#examResultSection > section.card {
  display: block;
  margin-top: 12px !important;
  overflow: visible;
}

#resultReviewList {
  display: grid;
  gap: 16px;
  overflow: visible;
  scroll-snap-type: y proximity;
}

#resultReviewList .result-review-item,
#resultReviewList .result-review-item[hidden] {
  display: block;
  width: 100%;
  height: auto;
  min-height: min(620px, calc(100dvh - 80px));
  margin: 0 !important;
  padding: clamp(14px, 2vw, 22px);
  overflow: visible;
  scroll-snap-align: start;
  scroll-margin-top: 18px;
}

#resultReviewList .result-review-item.has-review-media,
#resultReviewList .result-review-item.has-review-media[hidden] {
  display: grid;
  grid-template-columns: minmax(210px, .75fr) minmax(360px, 1.25fr);
  grid-template-rows: auto auto repeat(3, minmax(74px, auto)) auto;
  gap: 10px 14px;
}

#resultReviewList .result-review-item.has-review-media > .exam-media-wrap {
  max-height: 430px;
}

#resultReviewList .result-review-option {
  overflow: visible;
}

#resultReviewList .result-review-option.is-selected-wrong {
  border-color: rgba(217,48,37,.38) !important;
  background: rgba(217,48,37,.1) !important;
}

#resultReviewNavigation {
  display: none !important;
}

#examResultSection > #backToDashboardBtn {
  margin-top: 16px !important;
}

@media (max-width: 768px) {
  #resultReviewList .result-review-item,
  #resultReviewList .result-review-item[hidden] {
    min-height: auto;
  }

  #resultReviewList .result-review-item.has-review-media,
  #resultReviewList .result-review-item.has-review-media[hidden] {
    grid-template-columns: minmax(105px, .5fr) minmax(0, 1.5fr);
    grid-template-rows: auto auto repeat(3, minmax(62px, auto)) auto;
  }
}

@media (max-width: 520px) {
  #resultReviewList .result-review-item.has-review-media,
  #resultReviewList .result-review-item.has-review-media[hidden] {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  #resultReviewList .result-review-item.has-review-media > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  #resultReviewList .result-review-item.has-review-media > .exam-media-wrap {
    max-height: 32dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.auth-page)::before,
  .sidebar::before,
  .sidebar::after {
    animation: none;
  }
}

/* Question editor modal — existing editor and preview, moved off-page. */
body.question-edit-modal-open {
  overflow: hidden;
}

.question-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  place-items: center;
  padding: clamp(12px, 2.5vw, 34px);
  background: rgba(8, 15, 36, .68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.question-edit-modal.is-open {
  display: grid;
  animation: question-modal-fade .18s ease-out;
}

.question-edit-dialog {
  width: min(1380px, 100%);
  max-height: calc(100dvh - clamp(24px, 5vw, 68px));
  margin: 0;
  padding: clamp(18px, 2.2vw, 30px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 26px;
  background: rgba(249, 250, 253, .97);
  box-shadow: 0 35px 100px rgba(4, 10, 31, .34);
  animation: question-modal-rise .22s ease-out;
}

.question-edit-modal-header {
  position: sticky;
  top: calc(clamp(18px, 2.2vw, 30px) * -1);
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: calc(clamp(18px, 2.2vw, 30px) * -1) calc(clamp(18px, 2.2vw, 30px) * -1) 24px;
  padding: 18px clamp(18px, 2.2vw, 30px);
  border-bottom: 1px solid rgba(5, 30, 221, .1);
  background: rgba(249, 250, 253, .94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.question-edit-modal-header .section-title {
  margin: 2px 0 0;
}

.question-edit-modal-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #37415a;
  font-size: 1.8rem;
  line-height: 1;
  border: 1px solid #dce2ee;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 26, 49, .08);
}

.question-edit-modal-close:hover {
  color: #fff;
  border-color: var(--ng-red);
  background: var(--ng-red);
  transform: translateY(-1px);
}

.question-edit-modal .question-live-preview {
  top: 82px;
}

@keyframes question-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes question-modal-rise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1050px) {
  .question-edit-dialog {
    max-height: calc(100dvh - 20px);
  }

  .question-edit-modal .question-live-preview {
    position: static;
  }
}

@media (max-width: 600px) {
  .question-edit-modal {
    padding: 0;
  }

  .question-edit-dialog {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    padding: 14px;
    border-radius: 0;
  }

  .question-edit-modal-header {
    top: -14px;
    margin: -14px -14px 18px;
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .question-edit-modal.is-open,
  .question-edit-dialog {
    animation: none;
  }
}

/* =========================
   SMALL PHONES
========================= */
@media (max-width: 480px) {
  .auth-page,
  .main-content {
    padding: 10px;
  }

  .auth-left,
  .auth-card,
  .topbar,
  .card {
    padding: 14px;
  }

  .brand-title {
    font-size: 1.7rem;
  }

  .sidebar {
    padding: 12px;
  }

  .sidebar h2 {
    font-size: 1.05rem;
  }

  .topbar h1 {
    font-size: 1.2rem;
  }

  .card h3 {
    font-size: 1rem;
  }

  .primary-btn,
  .primary-btn-2,
  .secondary-btn,
  .danger-btn,
  .link-btn {
    font-size: 14px;
  }

  .color-chip {
    width: 26px;
    height: 26px;
  }

  table {
    min-width: 640px;
  }
}

/* =========================
   MOBILE SIDEBAR / TOPBAR
========================= */

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding: 12px 14px;
  background: rgba(5, 30, 221, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1200;
  box-shadow: 0 10px 24px rgba(5, 30, 221, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-menu-btn {
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
}

.mobile-topbar-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.mobile-overlay {
  display: none;
}

@media (max-width: 768px) {
  .mobile-topbar {
    display: flex;
  }

  .mobile-overlay {
    position: fixed;
    top: 68px;
    left: 0;
    width: 100%;
    height: calc(100vh - 68px);
    background: rgba(0, 0, 0, 0.45);
    z-index: 1090;
  }

  .mobile-overlay.show {
    display: block;
  }

  .page-shell {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    position: fixed !important;
    top: 68px;
    left: 0;
    width: min(82vw, 320px);
    height: calc(100vh - 68px);
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    border-radius: 0 0 18px 0;
    padding-top: 14px;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    padding-top: 74px;
  }
} 

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #051EDD #f3f5ff;
}

/* Chrome, Edge, Safari */
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: #f3f5ff;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #051EDD, #000044);
  border-radius: 999px;
  border: 2px solid #f3f5ff;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #051EDD, #FF0000);
}

#adminOverviewSection,
#adminStudentSettingsSection,
#adminExamSettingsSection,
#adminQuestionBankSection,
#adminNotesUploadSection,
#adminActivityLogSection {
  scroll-margin-top: 95px;
}

#studentHomeSection,
#studySection,
#profileSection,
#examRunnerSection,
#examResultSection {
  scroll-margin-top: 95px;
}

/* ===== Toggle Switch (Modern Glass Style) ===== */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  color: #000044;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  border-radius: 20px;
  background: rgba(0, 0, 68, 0.15);
  backdrop-filter: blur(6px);
  transition: 0.3s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #000044;
  transition: 0.3s ease;
}

/* ACTIVE STATE */
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #000044, #3a3aff);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: #ffffff;
}


/* ===== Change Password Page Upgrade ===== */

.modern-password-form {
  display: grid;
  gap: 18px;
}

.password-field-wrap {
  display: grid;
  gap: 8px;
}

.password-field-wrap label {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.96rem;
  letter-spacing: 0.2px;
}

.password-glass {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.password-glass:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 32px rgba(5, 30, 221, 0.18);
  transform: translateY(-1px);
}

.password-glass input {
  flex: 1;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1rem;
  padding: 12px 4px;
  outline: none;
  box-shadow: none;
}

.password-glass input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.password-toggle-btn {
  border: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  color: #ffffff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.password-toggle-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(255,255,255,0.24), rgba(255,255,255,0.12));
}

.password-toggle-btn:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .password-glass {
    padding: 4px 6px 4px 12px;
    border-radius: 16px;
  }

  .password-glass input {
    font-size: 0.96rem;
    padding: 11px 2px;
  }

  .password-toggle-btn {
    padding: 9px 12px;
    font-size: 0.8rem;
  }
}

.auth-card {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo-wrap {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo {
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.brand-logo-preview {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
}

/* ===== TOUCH DESKTOP INPUT IMPROVEMENT ===== */
button,
a,
label,
input[type="button"],
input[type="submit"] {
  touch-action: manipulation;
}


/* =========================
   FLOATING FONT CONTROL
========================= */

.font-control {
  position: fixed;
  top: 90px;
  right: 16px;
  z-index: 2000;
  display: flex;
  gap: 6px;
}

/* =========================================================
   NEXT GEAR — PREMIUM INTERFACE SYSTEM (2026)
   Visual-only layer. Existing IDs, markup and JS are intact.
========================================================= */

:root {
  --ng-ink: #11182b;
  --ng-ink-2: #1a2540;
  --ng-blue: #3157e6;
  --ng-blue-deep: #223caa;
  --ng-coral: #f05d4f;
  --ng-gold: #d9a84e;
  --ng-porcelain: #f7f6f2;
  --ng-surface: #ffffff;
  --ng-surface-soft: #f0f2f7;
  --ng-line: #e2e5ed;
  --ng-text: #182033;
  --ng-muted: #687086;
  --ng-success: #168c68;
  --ng-warning: #b66a13;
  --ng-danger: #c83d44;
  --ng-radius-sm: 12px;
  --ng-radius: 20px;
  --ng-radius-lg: 30px;
  --ng-shadow-sm: 0 8px 24px rgba(17, 24, 43, 0.06);
  --ng-shadow: 0 18px 50px rgba(17, 24, 43, 0.1);
  --ng-shadow-lg: 0 32px 90px rgba(10, 17, 34, 0.18);
  --ng-ease: 180ms cubic-bezier(.2, .8, .2, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ng-porcelain);
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ng-text);
  background:
    radial-gradient(circle at 88% 8%, rgba(49, 87, 230, 0.08), transparent 25rem),
    radial-gradient(circle at 8% 92%, rgba(240, 93, 79, 0.06), transparent 28rem),
    var(--ng-porcelain);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  color: var(--ng-ink);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.25rem);
}

h3 {
  font-size: 1rem;
  letter-spacing: -0.015em;
}

p {
  color: var(--ng-muted);
}

a {
  color: var(--ng-blue);
}

::selection {
  background: rgba(49, 87, 230, 0.2);
}

/* App frame */
.page-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 28px 20px;
  overflow-y: auto;
  color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.045), transparent 42%),
    var(--ng-ink);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 18px 0 55px rgba(17, 24, 43, 0.11);
  z-index: 100;
}

.sidebar::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  margin: 0 0 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ng-coral), var(--ng-gold));
}

.sidebar h2,
.sidebar h3,
.sidebar p {
  color: #fff;
}

.sidebar h2 {
  margin: 12px 8px 28px;
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.sidebar .brand-logo-wrap {
  justify-content: flex-start;
  margin: 0 8px;
}

.sidebar .brand-logo {
  max-width: 62px;
  max-height: 62px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.nav-btn,
.sidebar .link-btn,
.logout-btn,
.sidebar .secondary-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 48px;
  margin: 5px 0;
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  box-shadow: none;
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform var(--ng-ease), color var(--ng-ease), background var(--ng-ease), border-color var(--ng-ease);
}

.nav-btn:hover,
.nav-btn.active,
.sidebar .link-btn:hover,
.sidebar .secondary-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.logout-btn {
  margin-top: 18px;
  color: #ffd6d1;
  background: rgba(240, 93, 79, 0.11);
  border-color: rgba(240, 93, 79, 0.2);
}

.logout-btn:hover {
  color: #fff;
  background: var(--ng-coral);
  transform: translateY(-1px);
}

.main-content {
  width: 100%;
  max-width: 1600px;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 62px);
}

.topbar {
  position: relative;
  margin: 0 0 30px;
  padding: 0 0 24px;
  background: transparent;
  border-bottom: 1px solid var(--ng-line);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 68px;
  height: 2px;
  border-radius: 999px;
  background: var(--ng-blue);
}

.topbar h1 {
  margin-bottom: 8px;
}

.topbar p {
  max-width: 750px;
  margin: 0;
  font-size: 0.98rem;
}

/* Surfaces and dashboard metrics */
.card {
  position: relative;
  color: var(--ng-text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(218, 222, 232, 0.88);
  border-radius: var(--ng-radius);
  box-shadow: var(--ng-shadow-sm);
  padding: clamp(20px, 2.4vw, 30px);
  transition: border-color var(--ng-ease), box-shadow var(--ng-ease), transform var(--ng-ease);
}

.card:hover {
  border-color: #d5daea;
  box-shadow: var(--ng-shadow);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.cards-grid > .card {
  min-height: 132px;
  overflow: hidden;
}

.cards-grid > .card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(49, 87, 230, 0.055);
}

.cards-grid > .card h3 {
  margin-bottom: 22px;
  color: var(--ng-muted);
  font-size: 0.77rem;
  font-weight: 750;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.cards-grid > .card p {
  margin: 0;
  color: var(--ng-ink);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.045em;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--ng-ink);
  font-size: 1.08rem;
}

.section-title::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ng-coral);
  box-shadow: 0 0 0 5px rgba(240, 93, 79, 0.1);
}

/* Forms */
.field-row,
.auth-form {
  display: grid;
  gap: 8px;
}

.field-row {
  margin-bottom: 18px;
}

label,
.toggle-label {
  color: var(--ng-ink);
  font-size: 0.82rem;
  font-weight: 720;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ng-text);
  background: #fbfbfd;
  border: 1px solid #dce0e9;
  border-radius: var(--ng-radius-sm);
  outline: none;
  font: inherit;
  transition: border-color var(--ng-ease), box-shadow var(--ng-ease), background var(--ng-ease);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3b2;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c9cedb;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: var(--ng-blue);
  box-shadow: 0 0 0 4px rgba(49, 87, 230, 0.1);
}

input[type="file"] {
  padding: 10px;
  background: var(--ng-surface-soft);
}

.upload-field {
  padding: 12px;
  border: 1px dashed #c9cfdd;
  border-radius: var(--ng-radius-sm);
  background: #fafbfe;
}

.upload-btn {
  color: var(--ng-blue);
  background: rgba(49, 87, 230, 0.08);
  border: 1px solid rgba(49, 87, 230, 0.12);
  border-radius: 10px;
}

/* Buttons */
.primary-btn,
.primary-btn-2,
.secondary-btn,
.danger-btn,
.link-btn {
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 720;
  font-size: 0.9rem;
  line-height: 1.2;
  box-shadow: none;
  transition: transform var(--ng-ease), box-shadow var(--ng-ease), background var(--ng-ease), border-color var(--ng-ease);
}

.primary-btn,
.primary-btn-2 {
  color: #fff;
  background: var(--ng-blue);
  box-shadow: 0 12px 25px rgba(49, 87, 230, 0.2);
}

.primary-btn:hover,
.primary-btn-2:hover {
  background: var(--ng-blue-deep);
  box-shadow: 0 16px 32px rgba(49, 87, 230, 0.26);
  transform: translateY(-2px);
}

.secondary-btn,
.link-btn {
  color: var(--ng-ink);
  background: #fff;
  border-color: #dce0e9;
}

.secondary-btn:hover,
.link-btn:hover {
  color: var(--ng-blue);
  border-color: rgba(49, 87, 230, 0.32);
  background: #f9faff;
  transform: translateY(-1px);
}

.danger-btn {
  color: #fff;
  background: var(--ng-danger);
  box-shadow: 0 12px 25px rgba(200, 61, 68, 0.16);
}

.danger-btn:hover {
  background: #a92e35;
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(49, 87, 230, 0.28);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.45;
  filter: saturate(0.5);
}

/* Data tables */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--ng-line);
  border-radius: 16px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #edf0f5;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #70788c;
  background: #f7f8fb;
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tbody tr {
  transition: background var(--ng-ease);
}

tbody tr:hover {
  background: #fafbfe;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 740;
}

.status-passed,
.status-active {
  color: #0e7254;
  background: #e5f7f0;
}

.status-pending {
  color: #986011;
  background: #fff3dd;
}

/* Exam experience */
#examRunnerSection,
#examResultSection {
  padding: clamp(20px, 3vw, 38px);
  background: rgba(255, 255, 255, 0.86);
  border-radius: var(--ng-radius-lg);
  box-shadow: var(--ng-shadow);
}

#examRunnerSection > .card,
#examResultSection > .card {
  box-shadow: none;
}

#questionNumberLabel {
  color: var(--ng-blue);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#questionTextDisplay {
  max-width: 900px;
  color: var(--ng-ink);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  font-weight: 650;
  line-height: 1.45;
}

.exam-option-card {
  border-color: #e0e4ed;
  border-radius: 16px;
  box-shadow: none;
}

.exam-option-card:hover {
  border-color: rgba(49, 87, 230, 0.34);
  background: #fafbff;
  box-shadow: 0 10px 28px rgba(49, 87, 230, 0.08);
  transform: translateY(-1px);
}

.exam-option-card input[type="radio"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--ng-blue);
}

.exam-media-wrap {
  min-height: 190px;
  padding: clamp(16px, 3vw, 28px) !important;
  background:
    linear-gradient(45deg, #f6f7fa 25%, transparent 25%),
    linear-gradient(-45deg, #f6f7fa 25%, transparent 25%),
    #fff;
  background-size: 18px 18px;
  background-position: 0 0, 0 9px;
  border-color: #e3e6ee;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.exam-media-image {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(17, 24, 43, 0.14);
}

.font-control {
  position: fixed;
  top: 20px;
  right: 22px;
  display: flex;
  gap: 8px;
  z-index: 1200;
}

.font-control button {
  width: 42px;
  height: 42px;
  color: var(--ng-ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--ng-line);
  border-radius: 12px;
  box-shadow: var(--ng-shadow-sm);
  font-weight: 760;
  backdrop-filter: blur(12px);
}

/* Authentication */
.auth-page {
  min-height: 100vh;
  padding: clamp(20px, 4vw, 64px);
  background:
    radial-gradient(circle at 16% 18%, rgba(49, 87, 230, 0.2), transparent 24rem),
    radial-gradient(circle at 86% 84%, rgba(240, 93, 79, 0.16), transparent 26rem),
    var(--ng-ink);
}

.auth-shell {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 80px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.78fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 50px 130px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.auth-left {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 7vw, 86px);
  overflow: hidden;
}

.auth-left::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.025),
    0 0 0 90px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}

.brand-badge {
  width: fit-content;
  margin-bottom: 28px;
  padding: 7px 12px;
  color: #f6d99e;
  background: rgba(217, 168, 78, 0.1);
  border: 1px solid rgba(217, 168, 78, 0.22);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-title {
  max-width: 650px;
  color: #fff;
  font-size: clamp(2.7rem, 6vw, 5.25rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

.brand-text {
  max-width: 620px;
  margin: 24px 0 30px;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.75;
}

.auth-left .brand-logo-wrap {
  justify-content: flex-start;
}

.auth-left .brand-logo {
  max-width: 74px;
  max-height: 74px;
  margin-bottom: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-left .primary-btn-2 {
  width: fit-content;
  min-width: 210px;
  justify-content: center;
}

.brand-colors {
  margin-top: 30px;
  opacity: 0.62;
}

.color-chip {
  width: 12px;
  height: 12px;
  border: 0;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.auth-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 14px;
  padding: clamp(32px, 5vw, 58px);
  color: var(--ng-text);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: var(--ng-shadow-lg);
  backdrop-filter: blur(20px);
}

.auth-card h2 {
  margin-bottom: 8px;
  color: var(--ng-ink);
}

.auth-card .muted {
  margin: 0 0 26px;
  color: var(--ng-muted);
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 28px;
  padding: 5px;
  border: 1px solid var(--ng-line);
  border-radius: 14px;
  background: #f1f3f7;
}

.role-btn {
  min-height: 42px;
  color: var(--ng-muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-weight: 720;
  box-shadow: none;
}

.role-btn.active {
  color: var(--ng-ink);
  background: #fff;
  box-shadow: 0 5px 15px rgba(17, 24, 43, 0.08);
}

.auth-form {
  gap: 11px;
}

.auth-form .primary-btn {
  margin-top: 12px;
}

.password-field,
.password-glass {
  background: #fbfbfd;
  border: 1px solid #dce0e9;
  border-radius: var(--ng-radius-sm);
}

.password-field input,
.password-glass input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.toggle-password,
.password-toggle-btn {
  color: var(--ng-blue);
}

.form-message {
  border-radius: 10px;
  font-weight: 650;
}

/* Mobile navigation */
.mobile-topbar {
  height: 66px;
  padding: 0 18px;
  color: #fff;
  background: rgba(17, 24, 43, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 25px rgba(17, 24, 43, 0.12);
  backdrop-filter: blur(16px);
}

.mobile-menu-btn {
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.mobile-topbar-title {
  font-weight: 720;
  letter-spacing: -0.02em;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #b9c0d0 transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #c2c8d5;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

/* Responsive */
@media (max-width: 1024px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed !important;
    top: 66px;
    left: 0;
    width: min(84vw, 310px);
    height: calc(100vh - 66px);
    transform: translateX(-105%);
    border-radius: 0 22px 22px 0;
    transition: transform 240ms cubic-bezier(.2, .8, .2, 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    padding: 94px clamp(16px, 4vw, 34px) 34px;
  }

  .mobile-topbar {
    display: flex;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .font-control {
    top: 76px;
    right: 14px;
  }
}

@media (max-width: 760px) {
  .auth-page {
    padding: 0;
  }

  .auth-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .auth-left {
    min-height: 38vh;
    padding: 44px 24px 28px;
  }

  .brand-title {
    font-size: clamp(2.45rem, 13vw, 4rem);
  }

  .brand-text {
    margin: 16px 0 22px;
  }

  .auth-card {
    min-height: 58vh;
    margin: 0;
    padding: 34px 24px 48px;
    border-radius: 28px 28px 0 0;
  }

  .main-content {
    padding-inline: 12px;
  }

  .card {
    padding: 18px;
    border-radius: 17px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cards-grid > .card {
    min-height: 118px;
  }

  .cards-grid > .card p {
    font-size: 1.55rem;
  }

  #examRunnerSection,
  #examResultSection {
    padding: 12px;
    border-radius: 22px;
  }

  .exam-media-wrap {
    min-height: 150px;
    padding: 12px !important;
  }

  th,
  td {
    padding: 12px;
  }
}

@media (max-width: 430px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .brand-colors {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.font-control button {
  background: linear-gradient(135deg, #051EDD, #1733ff);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(5, 30, 221, 0.25);
}

.font-control button:hover {
  transform: translateY(-1px);
}

/* Font scaling variable */
:root {
  --font-scale: 1;
}

/* Apply scaling ONLY to main content */
.main-content {
  font-size: calc(1rem * var(--font-scale));
}

.exam-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.exam-action-buttons .secondary-btn {
  margin: 0;
}

@media (max-width: 768px) {
  .exam-action-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .exam-action-buttons .secondary-btn {
    width: 100%;
  }
}

.back-to-top-btn {
  position: fixed;
  right: 18px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #051EDD;
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0.5;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.back-to-top-btn:hover {
  opacity: 0.85;
}

/* Final premium overrides for legacy declarations below the design layer. */
.font-control button {
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ng-ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--ng-line);
  border-radius: 12px;
  box-shadow: var(--ng-shadow-sm);
}

.font-control button:hover {
  color: var(--ng-blue);
  background: #fff;
  border-color: rgba(49, 87, 230, 0.28);
}

.back-to-top-btn {
  color: #fff;
  background: var(--ng-ink);
  box-shadow: 0 12px 28px rgba(17, 24, 43, 0.2);
  opacity: 0.72;
}

.back-to-top-btn:hover {
  background: var(--ng-blue);
  opacity: 1;
}

/* =========================================================
   SOFT GLASS EDITION
   Lower contrast, ambient motion, fixed desktop navigation.
========================================================= */

:root {
  --ng-ink: #20283c;
  --ng-ink-2: #2b354d;
  --ng-blue: #6478c9;
  --ng-blue-deep: #5064b4;
  --ng-coral: #d9857b;
  --ng-gold: #c7a66b;
  --ng-porcelain: #ececf2;
  --ng-surface: rgba(255, 255, 255, 0.66);
  --ng-surface-soft: rgba(247, 248, 252, 0.58);
  --ng-line: rgba(133, 144, 170, 0.2);
  --ng-text: #273047;
  --ng-muted: #768096;
  --ng-shadow-sm: 0 10px 30px rgba(43, 50, 76, 0.055);
  --ng-shadow: 0 22px 55px rgba(43, 50, 76, 0.085);
  --ng-shadow-lg: 0 34px 90px rgba(28, 35, 57, 0.16);
}

html,
body {
  min-height: 100%;
  background: #e9e9f0;
}

body {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(135deg, #efeee9 0%, #e8eaf1 48%, #eeebef 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  width: min(46vw, 680px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(24px);
  opacity: 0.42;
  will-change: transform;
}

body::before {
  top: -18%;
  right: -8%;
  background:
    radial-gradient(circle at 35% 35%, rgba(117, 139, 211, 0.48), rgba(155, 164, 210, 0.1) 58%, transparent 72%);
  animation: ngAmbientFloatOne 18s ease-in-out infinite alternate;
}

body::after {
  left: 12%;
  bottom: -30%;
  background:
    radial-gradient(circle at 50% 45%, rgba(218, 151, 140, 0.31), rgba(210, 181, 151, 0.08) 60%, transparent 74%);
  animation: ngAmbientFloatTwo 22s ease-in-out infinite alternate;
}

.page-shell::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: 38%;
  left: 46%;
  width: 310px;
  height: 310px;
  border-radius: 42% 58% 65% 35% / 40% 44% 56% 60%;
  background: rgba(157, 175, 211, 0.13);
  filter: blur(36px);
  pointer-events: none;
  animation: ngAmbientMorph 16s ease-in-out infinite alternate;
}

@keyframes ngAmbientFloatOne {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-8vw, 7vh, 0) scale(1.08); }
}

@keyframes ngAmbientFloatTwo {
  from { transform: translate3d(0, 0, 0) scale(0.96); }
  to { transform: translate3d(9vw, -7vh, 0) scale(1.06); }
}

@keyframes ngAmbientMorph {
  from {
    transform: translate3d(-30px, -20px, 0) rotate(0deg);
    border-radius: 42% 58% 65% 35% / 40% 44% 56% 60%;
  }
  to {
    transform: translate3d(55px, 40px, 0) rotate(18deg);
    border-radius: 58% 42% 38% 62% / 55% 36% 64% 45%;
  }
}

/* Fixed, non-scrolling desktop sidebar */
@media (min-width: 1025px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 288px;
    height: 100dvh;
    overflow: hidden;
  }

  .main-content {
    grid-column: 2;
  }
}

.sidebar {
  color: rgba(245, 247, 255, 0.72);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.045), transparent 50%),
    rgba(27, 35, 55, 0.9);
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 60px rgba(31, 38, 59, 0.09);
  backdrop-filter: blur(24px) saturate(125%);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
}

.sidebar::before {
  background: linear-gradient(90deg, #cf8d82, #c9ad78);
  opacity: 0.86;
}

.nav-btn,
.sidebar .link-btn,
.logout-btn,
.sidebar .secondary-btn {
  color: rgba(245, 247, 255, 0.69);
  background: transparent;
}

.nav-btn:hover,
.nav-btn.active,
.sidebar .link-btn:hover,
.sidebar .secondary-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.075);
}

.logout-btn {
  color: #f3c8c3;
  background: rgba(217, 133, 123, 0.1);
  border-color: rgba(217, 133, 123, 0.13);
}

.logout-btn:hover {
  background: rgba(217, 133, 123, 0.78);
}

.topbar {
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  box-shadow: var(--ng-shadow-sm);
  backdrop-filter: blur(22px) saturate(128%);
  -webkit-backdrop-filter: blur(22px) saturate(128%);
}

.topbar::after {
  display: none;
}

.card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(249, 250, 253, 0.5));
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow:
    0 16px 42px rgba(49, 57, 82, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 22px 52px rgba(49, 57, 82, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.cards-grid > .card::after {
  background: rgba(120, 139, 205, 0.045);
}

.cards-grid > .card h3 {
  color: #768097;
}

.cards-grid > .card p {
  color: #252e43;
}

.section-title {
  color: #35415b;
}

.section-title::before {
  background: #d78a80;
  box-shadow: 0 0 0 5px rgba(215, 138, 128, 0.1);
}

.table-wrap {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

th {
  color: #68738d;
  background: rgba(236, 239, 247, 0.72);
}

td {
  border-bottom-color: rgba(137, 149, 177, 0.14);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.4);
}

input,
select,
textarea,
.password-field,
.password-glass {
  color: #313a51;
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(139, 150, 177, 0.24);
  backdrop-filter: blur(10px);
}

input:focus,
select:focus,
textarea:focus {
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(100, 120, 201, 0.65);
  box-shadow: 0 0 0 4px rgba(100, 120, 201, 0.09);
}

.primary-btn,
.primary-btn-2 {
  background: linear-gradient(135deg, #6d80c8, #596daf);
  box-shadow: 0 12px 26px rgba(86, 105, 177, 0.17);
}

.primary-btn:hover,
.primary-btn-2:hover {
  background: linear-gradient(135deg, #6175bc, #5063a7);
  box-shadow: 0 15px 30px rgba(86, 105, 177, 0.21);
}

.secondary-btn,
.link-btn {
  color: #424c64;
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(131, 143, 171, 0.23);
  backdrop-filter: blur(12px);
}

.danger-btn {
  background: linear-gradient(135deg, #c96f70, #b85e63);
  box-shadow: 0 12px 24px rgba(184, 94, 99, 0.14);
}

#examRunnerSection,
#examResultSection {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(26px) saturate(120%);
  -webkit-backdrop-filter: blur(26px) saturate(120%);
}

.exam-option-card {
  background: rgba(255, 255, 255, 0.48);
  border-color: rgba(139, 150, 177, 0.18);
}

.exam-option-card:hover {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(100, 120, 201, 0.3);
}

.font-control button {
  color: #3d475f;
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Keep login atmospheric without overpowering the form. */
.auth-page {
  background:
    radial-gradient(circle at 12% 18%, rgba(106, 126, 194, 0.22), transparent 28rem),
    radial-gradient(circle at 88% 82%, rgba(205, 129, 122, 0.15), transparent 28rem),
    #20283b;
}

.auth-page::before,
.auth-page::after {
  opacity: 0.26;
}

.auth-card {
  background: rgba(248, 249, 252, 0.78);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 38px 95px rgba(15, 21, 36, 0.22);
}

.mobile-topbar {
  background: rgba(30, 38, 58, 0.9);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}

@media (max-width: 1024px) {
  .sidebar {
    overflow-y: auto;
  }

  .main-content {
    padding-top: 94px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .page-shell::before {
    animation: none !important;
  }
}

/* NEXT GEAR LOGIN + EXAM TABLE REFINEMENT — presentation only */
:root {
  --ng-blue: #051edd;
  --ng-blue-deep: #07133f;
  --ng-blue-soft: #3551ef;
  --ng-red: #ff202b;
  --ng-white: #fff;
  --ng-ink: #121a31;
}

.auth-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow-x: hidden;
  padding: clamp(22px, 4vw, 56px);
  background:
    radial-gradient(circle at 14% 18%, rgba(5, 30, 221, .34), transparent 30%),
    radial-gradient(circle at 86% 82%, rgba(255, 32, 43, .22), transparent 28%),
    linear-gradient(135deg, #07133f 0%, #111936 48%, #190e25 100%);
}

.auth-page::before,
.auth-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

.auth-page::before {
  inset: -35%;
  background: repeating-linear-gradient(118deg, transparent 0 94px, rgba(255,255,255,.025) 95px 97px);
  animation: ng-background-drift 24s linear infinite;
}

.auth-page::after {
  width: min(54vw, 760px);
  aspect-ratio: 1;
  right: -18vw;
  top: -30%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 90px rgba(5,30,221,.05), 0 0 0 180px rgba(255,255,255,.025);
  animation: ng-orbit 14s ease-in-out infinite alternate;
}

@keyframes ng-background-drift {
  to { transform: translate3d(110px, 40px, 0); }
}

@keyframes ng-orbit {
  to { transform: translate3d(-50px, 70px, 0) scale(1.08); }
}

.auth-page .auth-shell {
  position: relative;
  width: min(1180px, 100%);
  min-height: min(690px, calc(100vh - clamp(44px, 8vw, 112px)));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 34px;
  background: rgba(255,255,255,.075);
  box-shadow: 0 30px 80px rgba(0,0,0,.32);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.auth-page .auth-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--ng-blue) 0 68%, var(--ng-red) 68%);
}

.auth-page .auth-left {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(48px, 6vw, 86px);
  color: #fff;
  background: radial-gradient(circle at 98% 100%, rgba(5,30,221,.24), transparent 42%),
              linear-gradient(145deg, rgba(7,19,63,.42), rgba(7,19,63,.12));
}

.auth-page .auth-left::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -170px;
  bottom: -180px;
  border-radius: 50%;
  border: 34px solid rgba(255,255,255,.045);
}

.auth-page .brand-badge {
  margin-bottom: 26px;
  padding: 9px 14px;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
}

.auth-page .brand-logo-wrap { margin-bottom: 24px; }

.auth-page .brand-title {
  max-width: 620px;
  margin: 0 0 24px;
  color: #fff;
  font-size: clamp(3rem, 5.2vw, 4.6rem);
  line-height: .94;
  letter-spacing: -.065em;
  text-wrap: balance;
}

.auth-page .brand-text {
  max-width: 590px;
  margin: 0 0 30px;
  color: rgba(255,255,255,.76);
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.72;
}

.auth-page .brand-text strong { color: #fff; }

.auth-page .primary-btn-2 {
  min-width: 220px;
  min-height: 52px;
  padding: 14px 22px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ng-blue), var(--ng-blue-soft));
  box-shadow: 0 14px 28px rgba(5,30,221,.3);
}

.auth-page .primary-btn-2:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(5,30,221,.4);
}

.auth-page .brand-colors { margin-top: 26px; }

.auth-page .auth-card {
  position: relative;
  align-self: center;
  width: calc(100% - 52px);
  max-width: 470px;
  min-height: auto;
  margin: 26px;
  padding: clamp(34px, 4vw, 52px);
  color: var(--ng-ink);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 24px 55px rgba(0,0,0,.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-page .auth-card::before {
  content: "";
  position: absolute;
  top: 34px;
  right: 0;
  width: 5px;
  height: 64px;
  border-radius: 5px 0 0 5px;
  background: var(--ng-red);
}

.auth-page .auth-card h2 {
  margin-bottom: 8px;
  color: var(--ng-ink);
  font-size: clamp(2.2rem, 4vw, 3rem);
  letter-spacing: -.045em;
}

.auth-page .auth-card .muted {
  margin-bottom: 30px;
  color: #68738e;
}

.auth-page .role-switch {
  padding: 5px;
  border: 1px solid #dce2f2;
  border-radius: 15px;
  background: #eef1f8;
}

.auth-page .role-btn {
  min-height: 48px;
  color: #66718b;
  border-radius: 11px;
}

.auth-page .role-btn.active {
  color: #fff;
  background: var(--ng-blue);
  box-shadow: 0 8px 20px rgba(5,30,221,.22);
}

.auth-page .auth-form { gap: 17px; }

.auth-page .auth-form label {
  color: #26314d;
  font-size: .9rem;
  font-weight: 750;
}

.auth-page .auth-form input {
  min-height: 54px;
  color: var(--ng-ink);
  border: 1px solid #d8dfee;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
}

.auth-page .auth-form input:focus {
  border-color: var(--ng-blue);
  box-shadow: 0 0 0 4px rgba(5,30,221,.1);
}

.auth-page .auth-form .primary-btn {
  min-height: 52px;
  margin-top: 6px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ng-blue), #344fee);
  box-shadow: 0 13px 28px rgba(5,30,221,.25);
}

#availableExamsSection {
  padding: clamp(26px, 3vw, 36px);
  border-color: rgba(5,30,221,.12);
  background: rgba(255,255,255,.76);
}

#availableExamsSection .section-title {
  margin-bottom: 18px;
  color: var(--ng-blue);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  font-weight: 800;
}

#availableExamsSection .section-title::before {
  width: 9px;
  height: 9px;
  background: var(--ng-red);
  box-shadow: 0 0 0 6px rgba(255,32,43,.1);
}

#availableExamsSection .table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(5,30,221,.12);
  border-radius: 20px;
  background: rgba(255,255,255,.72);
}

#availableExamsSection table {
  min-width: 960px;
  font-size: .98rem;
}

#availableExamsSection th {
  padding: 18px 14px;
  color: var(--ng-blue);
  font-size: .82rem;
  line-height: 1.35;
  letter-spacing: .075em;
  background: rgba(5,30,221,.045);
}

#availableExamsSection td {
  padding: 18px 14px;
  color: #303a54;
  line-height: 1.45;
  vertical-align: middle;
}

#availableExamsSection tbody tr {
  min-height: 84px;
}

#availableExamsSection tbody tr:hover { background: rgba(5,30,221,.035); }

#availableExamsSection button,
#availableExamsSection .btn,
#availableExamsSection a[class*="btn"] {
  min-height: 46px;
  min-width: 102px;
  padding: 11px 15px;
  font-size: .92rem;
  font-weight: 750;
  border-radius: 13px;
}

#availableExamsSection #saveAllOfflineBtn {
  min-width: 200px;
  margin-bottom: 12px;
  color: var(--ng-blue);
  border-color: rgba(5,30,221,.25);
  background: rgba(255,255,255,.88);
}

@media (max-width: 900px) {
  .auth-page { padding: 18px; }

  .auth-page .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-page .auth-left { padding: 46px 34px 36px; }
  .auth-page .brand-title { font-size: clamp(2.8rem, 11vw, 4.2rem); }

  .auth-page .auth-card {
    width: auto;
    max-width: none;
    margin: 0 20px 28px;
  }

  #availableExamsSection { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page::before,
  .auth-page::after {
    animation: none;
  }
}

/* =========================================================
   VIEWPORT EXAM RUNNER + ADMIN QUESTION PREVIEW
   ========================================================= */
body.exam-runner-active {
  overflow: hidden;
}

.exam-runner-active .main-content {
  height: 100dvh;
  padding: clamp(12px, 1.8vw, 24px);
  overflow: hidden;
}

.exam-runner-active #examRunnerSection {
  height: calc(100dvh - clamp(24px, 3.6vw, 48px));
  min-height: 0;
  padding: clamp(14px, 1.6vw, 24px);
  display: grid !important;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: clamp(8px, 1.1vh, 13px);
  overflow: hidden;
}

#examRunnerSection > .topbar {
  margin-bottom: 0 !important;
  padding-bottom: 9px;
}

#examRunnerSection > .topbar h1 {
  font-size: clamp(1.35rem, 2.1vw, 2rem);
}

#examRunnerSection > .topbar p {
  margin-top: 2px;
}

#practiceRunnerStatusBar {
  margin-bottom: 0 !important;
  padding: 8px 12px;
}

#practiceRunnerStatusBar .cards-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#practiceRunnerStatusBar .card {
  min-height: 0;
  padding: 8px 12px;
}

#practiceRunnerStatusBar h3,
.exam-status-grid h3 {
  margin-bottom: 2px;
  font-size: .72rem;
}

#practiceRunnerStatusBar p,
.exam-status-grid p {
  font-size: .94rem;
}

#examRunnerSection .exam-status-grid {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) !important;
  gap: 10px;
  margin-bottom: 0 !important;
}

#examRunnerSection .exam-status-grid > .card {
  min-height: 0;
  padding: 9px 14px;
}

#examRunnerSection .exam-question-stage {
  min-height: 0;
  padding: clamp(12px, 1.4vw, 20px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

#examRunnerSection #questionNumberLabel {
  margin-bottom: 3px;
}

#examRunnerSection #questionTextDisplay {
  margin: 0;
}

#examRunnerSection #questionOptionsWrap {
  min-height: 0;
  margin-top: 10px !important;
  align-content: stretch;
  gap: 9px !important;
  overflow: hidden;
}

#examRunnerSection #questionOptionsWrap.has-question-media {
  grid-template-columns: minmax(200px, .78fr) minmax(360px, 1.22fr);
  grid-template-rows: repeat(3, minmax(0, 1fr)) auto;
}

#examRunnerSection #questionOptionsWrap.has-question-media > .exam-media-wrap {
  grid-column: 1;
  grid-row: 1 / span 3;
}

#examRunnerSection #questionOptionsWrap.has-question-media > .exam-option-card {
  grid-column: 2;
}

#examRunnerSection .exam-media-wrap {
  min-height: 0;
  height: 100%;
  margin: 0 !important;
  padding: 10px !important;
  overflow: hidden;
}

#examRunnerSection .exam-media-wrap .exam-media-image {
  width: 100%;
  height: 100%;
  max-height: min(42dvh, 390px);
  object-fit: contain;
  box-shadow: 0 8px 22px rgba(17, 24, 43, .12);
}

#examRunnerSection .exam-option-card {
  min-height: 0;
  padding: 10px 12px !important;
  align-items: center;
  overflow: hidden;
}

#examRunnerSection .exam-option-card > div {
  gap: 3px !important;
}

#examRunnerSection .exam-option-card .exam-media-image {
  width: auto;
  max-width: 100%;
  max-height: 9dvh;
  margin: 0;
}

#examRunnerSection .exam-action-bar {
  flex: 0 0 auto;
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px solid rgba(5, 30, 221, .1);
}

#examRunnerSection .exam-action-bar button {
  min-height: 42px;
  padding: 10px 16px;
}

/* Live student-style preview in the administrator editor */
.question-editor-layout {
  display: grid;
  grid-template-columns: minmax(360px, .92fr) minmax(420px, 1.08fr);
  gap: clamp(24px, 3vw, 42px);
  align-items: start;
}

.question-editor-fields {
  min-width: 0;
}

.question-live-preview {
  position: sticky;
  top: 24px;
  min-width: 0;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid rgba(5, 30, 221, .14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(5, 30, 221, .09), transparent 32%),
    rgba(247, 249, 255, .92);
  box-shadow: 0 20px 50px rgba(18, 26, 49, .1);
}

.question-preview-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.question-preview-heading h3 {
  margin: 2px 0 0;
  color: var(--ng-ink);
  font-size: 1.25rem;
}

.question-preview-eyebrow {
  color: var(--ng-blue);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.question-preview-answer-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #087348;
  font-size: .74rem;
  font-weight: 800;
  border: 1px solid rgba(8, 115, 72, .18);
  border-radius: 999px;
  background: rgba(18, 166, 99, .1);
}

.question-preview-canvas {
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid rgba(5, 30, 221, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
}

.question-preview-text {
  margin: 0 0 14px;
  color: var(--ng-ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

.question-preview-media {
  height: clamp(150px, 24vh, 260px);
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #e1e6f4;
  border-radius: 15px;
  background: #f7f8fc;
}

.question-preview-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.question-preview-options {
  display: grid;
  gap: 9px;
}

.question-preview-option {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e0e5f1;
  border-radius: 14px;
  background: #fff;
}

.question-preview-option.is-correct {
  border-color: rgba(18, 166, 99, .35);
  background: rgba(18, 166, 99, .08);
}

.question-preview-option-key {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--ng-blue);
  font-weight: 850;
  border-radius: 9px;
  background: rgba(5, 30, 221, .08);
}

.question-preview-option p {
  margin: 0;
  color: #303a54;
  line-height: 1.35;
}

.question-preview-option img {
  display: block;
  max-width: 100%;
  max-height: 110px;
  margin-top: 8px;
  border-radius: 9px;
  object-fit: contain;
}

.question-preview-correct-mark {
  color: #087348;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.question-preview-explanation {
  margin-top: 12px;
  padding: 12px 14px;
  color: #3e4963;
  border-left: 3px solid var(--ng-blue);
  border-radius: 0 10px 10px 0;
  background: rgba(5, 30, 221, .05);
}

.question-preview-explanation p {
  margin: 4px 0 0;
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .question-editor-layout {
    grid-template-columns: 1fr;
  }

  .question-live-preview {
    position: static;
    grid-row: 1;
  }
}

@media (max-width: 768px) {
  body.exam-runner-active {
    overflow: hidden;
  }

  .exam-runner-active .mobile-topbar {
    height: 52px;
  }

  .exam-runner-active .main-content {
    height: calc(100dvh - 52px);
    padding: 7px;
  }

  .exam-runner-active #examRunnerSection {
    height: calc(100dvh - 66px);
    padding: 9px;
    gap: 6px;
    border-radius: 16px;
  }

  #examRunnerSection > .topbar {
    padding-bottom: 5px;
  }

  #examRunnerSection > .topbar p,
  #practiceRunnerStatusBar {
    display: none !important;
  }

  #examRunnerSection .exam-status-grid {
    grid-template-columns: 1fr 120px !important;
    gap: 6px;
  }

  #examRunnerSection .exam-status-grid > .card {
    padding: 6px 9px;
  }

  #examRunnerSection .exam-question-stage {
    padding: 9px;
  }

  #examRunnerSection #questionOptionsWrap.has-question-media {
    grid-template-columns: minmax(105px, .55fr) minmax(0, 1.45fr);
  }

  #examRunnerSection .exam-media-wrap {
    padding: 5px !important;
  }

  #examRunnerSection .exam-media-wrap .exam-media-image {
    max-height: 32dvh;
  }

  #examRunnerSection .exam-option-card {
    padding: 7px 8px !important;
  }

  #examRunnerSection .exam-action-bar {
    gap: 6px !important;
    margin-top: 6px !important;
    padding-top: 6px;
    flex-wrap: nowrap !important;
  }

  #examRunnerSection .exam-action-bar button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    padding: 7px 8px;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  #examRunnerSection #questionOptionsWrap.has-question-media {
    grid-template-columns: minmax(88px, .46fr) minmax(0, 1.54fr);
  }

  #examRunnerSection #questionTextDisplay {
    line-height: 1.28;
  }

  .question-preview-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .question-preview-answer-badge {
    align-self: flex-start;
  }
}

/* Exam legibility: keep option copy visible and make A-/A+ affect the runner. */
#examRunnerSection #questionTextDisplay {
  font-size: calc(1.24rem * var(--font-scale));
}

#examRunnerSection .exam-option-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  font-size: calc(1rem * var(--font-scale));
  overflow: visible;
}

#examRunnerSection .exam-option-card > div {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  overflow: visible;
}

#examRunnerSection .exam-option-card > div > strong {
  grid-column: 1;
}

#examRunnerSection .exam-option-card > div > div {
  grid-column: 2;
  margin-bottom: 0 !important;
  min-width: 0;
}

#examRunnerSection .exam-option-card > div > img {
  grid-column: 1 / -1;
}

#examRunnerSection .exam-action-bar button,
#examRunnerSection .exam-status-grid p,
#examRunnerSection > .topbar p {
  font-size: calc(.94rem * var(--font-scale));
}

/* One complete result-review question per viewport. */
body.result-review-active {
  overflow: hidden;
}

.result-review-active .main-content {
  height: 100dvh;
  padding: clamp(10px, 1.5vw, 20px);
  overflow: hidden;
}

.result-review-active #examResultSection {
  height: calc(100dvh - clamp(20px, 3vw, 40px));
  min-height: 0;
  padding: clamp(12px, 1.5vw, 20px);
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 9px;
  overflow: hidden;
}

#examResultSection > .topbar {
  margin-bottom: 0 !important;
  padding-bottom: 7px;
}

#examResultSection > .topbar h1 {
  font-size: calc(1.55rem * var(--font-scale));
}

#examResultSection > .cards-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#examResultSection > .cards-grid > .card {
  min-height: 0;
  padding: 8px 12px;
}

#examResultSection > .cards-grid h3 {
  margin-bottom: 2px;
  font-size: calc(.7rem * var(--font-scale));
}

#examResultSection > .cards-grid p {
  font-size: calc(1.05rem * var(--font-scale));
}

#examResultSection > section.card {
  min-height: 0;
  margin-top: 0 !important;
  padding: 11px 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

#examResultSection > section.card > .section-title {
  margin-bottom: 5px;
}

#resultReviewList {
  min-height: 0;
  overflow: hidden;
}

#resultReviewList .result-review-item {
  height: 100%;
  min-height: 0;
  margin: 0 !important;
  padding: 10px 12px;
  overflow: hidden;
}

#resultReviewList .result-review-item[hidden] {
  display: none !important;
}

#resultReviewList .result-review-item.has-review-media {
  display: grid;
  grid-template-columns: minmax(190px, .72fr) minmax(340px, 1.28fr);
  grid-template-rows: auto auto repeat(3, minmax(0, 1fr)) auto;
  gap: 7px 10px;
}

#resultReviewList .result-review-item.has-review-media > h3,
#resultReviewList .result-review-item.has-review-media > p:first-of-type {
  grid-column: 1 / -1;
  margin: 0 !important;
}

#resultReviewList .result-review-item.has-review-media > .exam-media-wrap {
  grid-column: 1;
  grid-row: 3 / span 3;
  min-height: 0;
  height: 100%;
  margin: 0 !important;
  padding: 8px !important;
  overflow: hidden;
}

#resultReviewList .result-review-item.has-review-media > .result-review-option {
  grid-column: 2;
}

#resultReviewList .result-review-item.has-review-media > p:last-child:not(:first-of-type) {
  grid-column: 1 / -1;
  margin: 0 !important;
}

#resultReviewList .result-review-option {
  min-height: 0;
  margin: 0 !important;
  padding: 8px 11px;
  font-size: calc(.96rem * var(--font-scale));
  overflow: hidden;
}

#resultReviewList .result-review-option > div:first-child {
  margin-bottom: 3px !important;
}

#resultReviewList .exam-media-image {
  width: 100%;
  height: 100%;
  max-height: min(34dvh, 320px);
  object-fit: contain;
}

#resultReviewList .result-review-option .exam-media-image {
  width: auto;
  height: auto;
  max-height: 8dvh;
  margin: 3px 0 0;
}

#resultReviewList .result-review-option.is-correct {
  border-color: rgba(15, 157, 88, .42) !important;
  background: rgba(15, 157, 88, .12) !important;
}

.result-review-navigation {
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(5, 30, 221, .1);
}

.result-review-navigation button {
  min-height: 38px;
  padding: 8px 13px;
}

#resultReviewProgress {
  color: var(--ng-blue);
  font-size: calc(.86rem * var(--font-scale));
}

#examResultSection > #backToDashboardBtn {
  min-height: 38px;
  margin-top: 0 !important;
  justify-self: start;
  padding: 8px 14px;
}

@media (max-width: 768px) {
  .result-review-active .main-content {
    height: calc(100dvh - 52px);
    padding: 6px;
  }

  .result-review-active #examResultSection {
    height: calc(100dvh - 64px);
    padding: 8px;
    gap: 5px;
  }

  #examResultSection > .topbar p {
    display: none;
  }

  #examResultSection > .cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px;
  }

  #examResultSection > .cards-grid > .card {
    padding: 5px;
  }

  #resultReviewList .result-review-item.has-review-media {
    grid-template-columns: minmax(90px, .48fr) minmax(0, 1.52fr);
    gap: 5px 7px;
  }

  #resultReviewList .result-review-option {
    padding: 5px 7px;
  }

  .result-review-navigation button {
    min-width: 0;
    padding: 7px 8px;
  }
}

/* Final modal surface precedence over the global card theme. */
.question-edit-modal .question-edit-dialog {
  width: min(1380px, 100%);
  max-height: calc(100dvh - clamp(24px, 5vw, 68px));
  margin: 0;
  padding: clamp(18px, 2.2vw, 30px);
  overflow-y: auto;
  border-radius: 26px;
  background: rgba(249, 250, 253, .97);
  box-shadow: 0 35px 100px rgba(4, 10, 31, .34);
}

@media (max-width: 600px) {
  .question-edit-modal .question-edit-dialog {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    padding: 14px;
    border-radius: 0;
  }
}

/* Student experience overrides — keep last for cascade precedence. */
body:not(.auth-page) {
  background: linear-gradient(rgba(217,217,217,.9), rgba(217,217,217,.94)), #d9d9d9;
}
body:not(.auth-page)::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: -25%;
  pointer-events: none;
  opacity: .28;
  background: linear-gradient(90deg, transparent 48.8%, rgba(255,255,255,.9) 49% 51%, transparent 51.2%), linear-gradient(90deg, rgba(31,39,58,.16), rgba(31,39,58,.04) 34% 66%, rgba(31,39,58,.16));
  transform: perspective(700px) rotateX(66deg) translateY(18%);
  animation: ng-road-motion 9s linear infinite;
}
.page-shell > .sidebar {
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(155deg, #0121d8 0%, #071a84 48%, #041247 74%, #3a0715 100%);
  box-shadow: 18px 0 48px rgba(3,16,75,.24);
}
.page-shell > .sidebar::before {
  width: 260px;
  height: 260px;
  top: -110px;
  right: -120px;
  border-radius: 34% 66% 62% 38% / 38% 36% 64% 62%;
  background: linear-gradient(145deg, rgba(255,255,255,.25), rgba(1,33,216,.08));
  animation: ng-sidebar-float 12s ease-in-out infinite alternate;
}
.page-shell > .sidebar::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  left: -125px;
  bottom: 5%;
  border-radius: 50%;
  background: linear-gradient(145deg, #e20302, rgba(226,3,2,.12) 68%);
  box-shadow: inset -30px -26px 44px rgba(69,0,0,.34), 18px 24px 50px rgba(0,0,0,.25);
  animation: ng-sidebar-float 15s ease-in-out infinite alternate-reverse;
}
.page-shell > .sidebar .nav-btn,
.page-shell > .sidebar .link-btn {
  color: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.14);
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
}
.main-content .card,
.main-content .topbar {
  border-color: rgba(255,255,255,.62);
  background: rgba(235,235,235,.78);
}
.student-font-scaling:not(.exam-runner-active):not(.result-review-active) .page-shell {
  width: var(--font-scale-width, 100%);
  zoom: var(--font-scale);
}
body.result-review-active { overflow-y: auto; }
.result-review-active .main-content {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}
.result-review-active #examResultSection {
  height: auto;
  min-height: calc(100dvh - 40px);
  display: block !important;
  overflow: visible;
}
#examResultSection > section.card {
  display: block;
  margin-top: 12px !important;
  overflow: visible;
}
#resultReviewList {
  display: grid;
  gap: 16px;
  overflow: visible;
  scroll-snap-type: y proximity;
}
#resultReviewList .result-review-item,
#resultReviewList .result-review-item[hidden] {
  display: block;
  width: 100%;
  height: auto;
  min-height: min(620px, calc(100dvh - 80px));
  margin: 0 !important;
  padding: clamp(14px,2vw,22px);
  overflow: visible;
  scroll-snap-align: start;
}
#resultReviewList .result-review-item.has-review-media,
#resultReviewList .result-review-item.has-review-media[hidden] {
  display: grid;
  grid-template-columns: minmax(210px,.75fr) minmax(360px,1.25fr);
  grid-template-rows: auto auto repeat(3,minmax(74px,auto)) auto;
  gap: 10px 14px;
}
#resultReviewList .result-review-option { overflow: visible; }
#resultReviewList .result-review-option.is-selected-wrong {
  border-color: rgba(217,48,37,.38) !important;
  background: rgba(217,48,37,.1) !important;
}
#resultReviewNavigation { display: none !important; }
@media (max-width: 520px) {
  #resultReviewList .result-review-item,
  #resultReviewList .result-review-item[hidden] { min-height: auto; }
  #resultReviewList .result-review-item.has-review-media,
  #resultReviewList .result-review-item.has-review-media[hidden] {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  #resultReviewList .result-review-item.has-review-media > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}
